Notifications
Clear all

[Closed] Callback problem – spline doesn't update on render

Hi there. I’ve written very simple callback function to animate my spline in time. It works fine in viewport, but when I render an animation, the spline just doesn’t update.
I’m doing something wrong?

--create simple spline
s = SplineShape render_renderable:true render_displayRenderMesh:true
addNewSpline s
addKnot s 1 #corner #curve [0,0,0]
addKnot s 1 #corner #curve [10,10,10]
updateShape s

--callback function
fn moveKnot =
(
	setKnotPoint s 1 2 [currentTime+10,10,10]
	
	--animate second vertex
	npos = getKnotPoint s 1 2
	setKnotPoint s 1 2 (npos+[1,1,1])
	updateShape s
)

unregisterTimeCallback moveKnot
registerTimeCallback moveKnot

callbacks.removeScripts #preRenderFrame
callbacks.addScript #preRenderFrame "moveKnot()"
1 Reply

registerTimeCallback will not working in rendering , its work in viewport only.
ty cache your file before render , or use render callbacks .

http://docs.autodesk.com/3DSMAX/15/ENU/MAXScript-Help/index.html?url=files/GUID-C1F6495F-5831-4FC8-A00C-667C5F2EAE36.htm,topicNumber=d30e707700,hash=WS3ED54CBA79FF2E3D-7A802F912B7835E9A3-4E02