Notifications
Clear all

[Closed] Is it Ok to UpdateShape in a scriptController

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.

4 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

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

Maybe you need a callback not a script controller

awesome, very useful to know

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)