annoying script freezing
Hi, I am working on a simple script which does work fine but freezes ramdomly for several minutes. The script "stabilizes" an animated mesh to be on world origin constantly. Any ideas on that? Would be great!
undo off
(
cui.commandPanelOpen = false
myOffset = #()
myLastFrame = animationrange.end as integer
for i = 0 to myLastFrame do
(
sliderTime = i
myOffset[i+1] = $.center
)
ResetXForm $
modPanel.addModToSelection (XForm ()) ui:off
set animate on
for j = 0 to myLastFrame do
(
sliderTime = j
$.modifiers[#XForm].Gizmo.position = -myOffset[j+1]
)
set animate off
cui.commandPanelOpen = true
)
Comments
simulation
Are you use *simulateLocal*?
bga
mesh to be on world origin constantly
bga
thanks a lot. but this does
thanks a lot. but this does freeze max too. on the last frame, when the script should be done, max hangs for 5-10 minutes doing nothing.
i suspect my mesh to be the problem somehow, it is a cloth simulation.
Are you try with position
Are you try with position script?
Send me a test scene and explain me what do you want to achive.
Maybe is there better solution for this problem
bga
i can prepare something
i can prepare something tonight and send it to you.
imagine a mesh which is moving away from world origin. the pivot stays on world origin, the mesh does not. therefor the position script does not work.
my script "stabilizes" that motion to keep the mesh centered. problem is it freezes for some reason
It's not easy task.
It's not easy task.
They would help if you add position constraint and use point helper
(at origin) as target.But i think that simulation break any mesh link with other objects.
bga
Try this
bga