Notifications
Clear all

[Closed] point3_script() slow?

Recently I’ve been pulling my hair out trying to figure out why the point3_script() controller is so slow! Well… not sure if it’s the real culprit or not, but here it goes:

I’ve got a simple spline, with 3 knots (all bezier). I used the point3_script() to link the knots and their tangents (InVec’s and OutVec’s) to helper do I can control the spline and make it a curve or a straight line by simple moving the helper objects. The setup is done and everything works properly.

The only problem is that I’ve froze transformed the helpers and every time I try to “Transform to Zero” these helpers max hangs for a good 10 seconds before become responsive again. Is this normal? Is there a fix?

Below is the problem in question (Max 2013 file). The first system uses the above described method, the second system relies in Skin Mod.

32 Replies

save the test file in an earlier version… i have max 2012 and can’t open the file.

Sure, here it is (Max 2010+)

your problem in this rig is not a scripted point3 controller. it’s the Skin modifier. you can achieve the same result by wiring point helpers to animated points of a spline.

1 Reply
(@denist)
Joined: 1 year ago

Posts: 0
delete objects
sp = splineshape name:"spline" wirecolor:green vertexTicks:on
addnewspline sp
addknot sp 1 #corner #curve [0,0,0]
addknot sp 1 #corner #curve [100,0,0]
setknottype sp 1 1 #bezierCorner 
setknottype sp 1 2 #bezierCorner 

animatevertex sp #all
updateshape sp

start = point name:"start" cross:off box:on size:20 pos:(getpointpos sp 2) wirecolor:orange
start_out = point name:"start_out" cross:off box:on size:10 pos:(getpointpos sp 3) wirecolor:yellow
end = point name:"end" cross:off box:on pos:[100,0,0] size:20 pos:(getpointpos sp 5) wirecolor:orange
end_in = point name:"end_in" cross:off box:on size:10 pos:(getpointpos sp 4) wirecolor:yellow

paramWire.connect start[#transform][#position] sp.baseobject[#master][2] "position"
paramWire.connect start_out[#transform][#position] sp.baseobject[#master][3] "position"
paramWire.connect end_in[#transform][#position] sp.baseobject[#master][4] "position"
paramWire.connect end[#transform][#position] sp.baseobject[#master][5] "position"

Hey Denis! Thanks for looking at it, but the problem is that the rig is slow only when you alt+right click-> Transform to Zero. In this case the rig with skin is faster than the one using point3_script().

I’ve done the rigging with wiring though. It works beautifully, thanks!

1 Reply
(@denist)
Joined: 1 year ago

Posts: 0

the skin modifier per se is not badly slow… but it sends a lot of unnecessary notifications by every case and not a case. it makes all its dependents and whole its environment work very slow.

Maybe I did not express myself properly in this thread. When I said the point 3 script controller is slow I mean it hangs Max for a good 5 to 10 seconds. Does this happens on your end too?

Do this – select any point helper from the first spline, move it around, then ALT+right click -> Transform to Zero. That’s it, Max hangs…

3 Replies
(@denist)
Joined: 1 year ago

Posts: 0

is it for ‘skin” version of rig? if so, i just don’t care. as i said – skin modifier is written bad. it might cause anything with any controller.

(@denist)
Joined: 1 year ago

Posts: 0

your mistake is when you use in the script controllers ThisSpline target as node itself. the system sends notification message every time when anything changed in the spline including geometry. it makes some sort of pseudo-loop dependency. but for your rig you need only transform changed notification message. to make the script controller work right you have to to change the ThisSpline target from the node to its transform controller. and use this expression:


  ThisHelper.transform.pos * inverse ThisSpline.value
  

BWT… it’s also better to make ThisHelper as a target of the helper’s position subanim (track)

(@davius)
Joined: 1 year ago

Posts: 0

You’re right!! Now it works perfectly! What’s the difference between this method (point3_script()) and wiring? Would you prefer one over the other?

Just changing ThisSpline from node to controller made the Transform to Zero fast again! I tried to also change the helpers from nodes to Track and selecting the Position tracks, but this made the invec and outvec fly around out of their positions.

Thanks Denis! Very nice tips! And do you know why using Node was so slow?

No, it’s for the point 3 script version of the rig… the skin version doesn’t hang.

1 Reply
(@denist)
Joined: 1 year ago

Posts: 0

attach a test scene with the rig

Already did it? In my second post of this thread?

1 Reply
(@denist)
Joined: 1 year ago

Posts: 0

it’s a skin solution

edit… i see. you’ve updated it.

i gave the answer in my previous post. because when you use the spline itself as target node any script controller receives update message after any spline deformation, and deforms the spline again.
to work the script controllers properly we only need transform message.

my preferred order of the using ‘scripted’ controllers is:

expression controller – it’s old school and doesn’t use mxs at all

wire controller – it’s more recent than script controller and it seems like some bugs fixed

script controller – it sucks but there is no alternative sometimes

Page 1 / 2