View Full Version : massive undo on loop
luigi 06-16-2006, 10:45 AM i trying to be able to undo a massive change of objects in a loops in a scene.
What I want to undo in this sample , firstable i switch off the turbosmooth in all geometry objects in scene but i will be able to undo it if the the user make a mistake.
I could do switch on turbosmooth for fix it but in case of changes iterinations or other properties i can undo it easly.
code:
undo "test"on
(
global test = "TurboSmooth"
for o in geometry do for m in o.modifiers where m.name as string == test do m.enabled = false
)
but doesnt work.
I dont know if is posible to undo massive change of properties of objects done in a loop
or i have to use another command or do in another way.but probably i dont it wrong i stil ned to learn a lot of maxscript.
Thanks in advance
|
|
f97ao
06-16-2006, 01:09 PM
i trying to be able to undo a massive change of objects in a loops in a scene.
What I want to undo in this sample , firstable i switch off the turbosmooth in all geometry objects in scene but i will be able to undo it if the the user make a mistake.
I could do switch on turbosmooth for fix it but in case of changes iterinations or other properties i can undo it easly.
code:
undo "test"on
(
global test = "TurboSmooth"
for o in geometry do for m in o.modifiers where m.name as string == test do m.enabled = false
)
but doesnt work.
I dont know if is posible to undo massive change of properties of objects done in a loop
or i have to use another command or do in another way.but probably i dont it wrong i stil ned to learn a lot of maxscript.
Thanks in advance
Be careful with undo in big loops, it gets very slow and can demand so much memory so max crashes. Undo doesn't always work as expected, but I would expect it to work here.
/Andreas
luigi
06-19-2006, 11:26 AM
thanks f97ao
but undo stil doesnt work . i been tryin g and work in simple lines ofcode but in bigs loops like " where m.name" kind of stafe doesnt do it properly.
I tried in a scene with all the objects with turbosmooth on the first of the stack and still doesnt work the undo
undo "mytest" on
(
for o in geometry do o.modifiers[1].enabled = false
)
does undo have any problem with .enabled property or is imposibe to work or undo the loops.
another posibility i thinked does the undo depends of the number of undo setup on preferences general. i have it on 20.
wel i will continue trying to find a solution
Zbuffer
06-19-2006, 11:54 AM
Hi !
try making your script a macroscript
something like
macroscript MyScript
category:My Cat
(
-- Your script here
)
when you execute your macrtoscript, you should have an "Undo Maxscript" or
"undo MyScript" entry in the undo list
luigi
06-19-2006, 12:29 PM
my script is already a macroscript but i found it confusing how it display in the undo list.
if your script does selection or other thing will put all this info in the undo list so will be dificult to find it on the undo list.
is your macroscript is like a floating window that you keep open whe you work yo can have proper track of what is going on so is not like press undo and will do it or in the undo list because i will be full of select and other operations.
CGTalk Moderation
06-19-2006, 12:29 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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.