PDA

View Full Version : Is it Ok to UpdateShape in a scriptController


hotknife
10-05-2009, 03:08 PM
If including an UpdateShape command in a script controller will Max constantly update the spline in the background or only when the script is called, in this case when a point helper moves.?

Cheers in advance.

HuaMuLan
10-05-2009, 05:53 PM
Maybe you need a callback not a script controller

denisT
10-05-2009, 08:33 PM
If including an UpdateShape command in a script controller will Max constantly update the spline in the background or only when the script is called, in this case when a point helper moves.?

Cheers in advance.

you have to Update shape every time after the shape was really changed. To do it on every tick (it's how script controller works) is not a right solution. Every shape update in a script controller causes big memory leaking. If shape's changing happens on a helper movement use construct when transform <you_helper_node> changes do <update_shape_function>

it's better, safer, and smoother to use when construct for change transform case with handleAt:#redrawViews

ah-fx
10-05-2009, 08:54 PM
awesome, very useful to know

hotknife
10-06-2009, 12:39 PM
Cheers fellas - I'm aware of callbacks but not familiar with using them but shall read up on them. I'm not sure at the moment how to save them with the scene as stated :-
These scripts can optionally be saved with the currently-open file and stay permanently with it, running whenever the scene is loaded, until they are explicitly removed.


In theory I shouldn't have to use them as all I'm trying to do is link the Handles of a Spline to point helpers....c 2010 file attached.

It is updating as expected until I either - cancel the move by right clicking the Point Helper or Transform to Zero the Helper which the Handle is following.

I've popped this code into the render_thickness of the Spline :-
setInVec Circle 1 1 (Def+R1)
setOutVec Circle 1 1 ((Def*[1,1,-1])+R2)

setInVec Circle 1 3 ((Def*[-1,1,-1])+L2)
setOutVec Circle 1 3 ((Def*[-1,1,1])+L1)

CGTalk Moderation
10-06-2009, 12:39 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.