Notifications
Clear all

[Closed] Undo

Use: undo “My Operation” on () and instert whatever you want to undo inside that expression. You probably dont want to undo the rollout? So basicly add undo on right after on * pressed do events like:

Replace: on but_Relax pressed do
With: on but_Relax pressed do undo “Relax Spline” on

7 Replies

I’m writing a spline relax script and I’m trying to get undo to work. I’ve tried a few different ways, but haven’t been able to get it to work yet. The script is far from finished, but here’s a link http://home.iprimus.com.au/wickergray/CgRay-relaxSpline2fn.mcr to it as it is to see if anyone can see why undo might not be working, or can point me in the right direction to get undo to work for this macroscript.

Cheers,

Cg.

Hi Bercon, thanks for the reply, but that doesn’t seem to work either.

Cg.

 JHN

I’m not 100% sure but I think there’s no undo functionality for spline operations… Maybe a true mxs master can confirm this, but I seem to remember it won’t stick to the undo buffer…

-Johan

1 Reply
(@magicm)
Joined: 11 months ago

Posts: 0

I’m afraid Johan is right…

There’s a way around this limitation (read: hack) by copying the shape, performing the shape ops on the copy, and replacing the original shape by the copy. Like so:

with undo on
(
	-- create a copy of the selected shape
	shp = copy $
	
	/*
	put shape operations on [b][u]shp[/u][/b] here
	*/
	
	-- replace the selected shape with the copy
	instanceReplace $ shp
	-- delete the copy
	delete shp
)

Hope this helps,
Martijn

 JHN

That’s a really good hack/solution! Have to remember that one… *grabs a pen and memo…

-Johan

Thanks for your help.

Is it just me or are posts getting out of order for other people too? Yesterday I had trouble posting cause it just kept telling me that I was only allowed to post once every 30 seconds… Even though my last post was hours ago.

“Wait a minute, Doc. Ah… Are you telling me you built a time machine… out of a DeLorean?”

great hack Martijn!

J.