Viz Artist 腳本調試

鑑於Vizrt沒有提供腳本什麼調試功能,那麼只能自己弄一個了。下面的DavidDebug是一個有文字的container。

dim debug_info =scene.findcontainer("DavidDebug").getchildcontainerbyindex(0)
dim debug_array as array[string]
sub oninit()
	debug_array.clear()
end sub


sub setdebug(info as string)
	dim debug=getparameterbool("debug")
	dim temp=getTime(getcurrenttime())&"  "&info
	if debug_array.ubound<5 then
		debug_array.push(temp)
	else
		debug_array.Erase(0)
		debug_array.push(temp)
	end if
	if debug then
		debug_info.geometry.text=cstr(getStringArray(debug_array))
	end if
end sub

function getTime(dt as datetime) as string
	getTime=cstr(dt.hour)&":"&cstr(dt.minute)&":"&cstr(dt.second)
end function

function getStringArray(arrStr as array[string]) as string
	dim temp as string
	for i=0 to arrStr.ubound
		temp=temp&arrStr[i]&Chr(10)
	next
	getStringArray=temp
end function 

sub OnInitParameters()
	registerparameterbool("debug","Debug: ",false)
end sub




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章