Thanks, I'm also using that Undo wrapping but it doesn't work with the Repeat 
command.

I ended up changing my code adding the refresh command in my Paste Weights and 
other commands I wanted to use with Repeat, and using them in the same plugin 
file.

The updated tool is here:
http://skymill.co.jp/tools/Softimage/mSkin/Manual/index.html

Martin
Sent from my iPhone

> On 14 Jan 2017, at 15:56, Steven Caron <car...@gmail.com> wrote:
> 
> Could you wrap your code with an OpenUndo/CloseUndo. Then all commands 
> between will be treated as one distinct command? I use it all the time to 
> collapse all commands into a single high-level command named "do man awesome 
> things" ;)
> 
> *written with my thumbs
> 
> On Jan 13, 2017 10:34 PM, "Martin" <furik...@gmail.com> wrote:
> I didn't know that difference in calling a command inside a function with 
> executecommand . It sounds like exactly what I need. I'll try it as soon as I 
> get to my office. Thanks !
> 
> Martin
> Sent from my iPhone
> 
>> On 14 Jan 2017, at 5:18, Matt Lind <speye...@hotmail.com> wrote:
>> 
>> If you could provide a code snippet, that would help.
>> 
>> Off the top of my head, I think you need to revise how you're calling 
>> GetWeights() inside your plugin.  If you just call it directly as var 
>> aWeights = GetWeights(), then that will be recorded as a discrete call in 
>> the script log and be affected by the undo/redo commands.   If you use 
>> Application.ExecuteCommand( "GetWeights", aArguments );, it will be 
>> considered just another line of code in your plugin.  This is likely what 
>> you're looking for.
>> 
>> There's a 3rd method to invoke a command from inside of a plugin, but I'd 
>> have to exhume a lot of old code to remember what that was.  Just be aware 
>> it exists.
>> 
>> 
>> Matt
>> 
>> 
>> 
>> Date: Fri, 13 Jan 2017 20:55:57 +0900
>> From: Martin <furik...@gmail.com>
>> Subject: Re: Executing a Command without undo (Scripting)
>> To: "Official Softimage Users Mailing List.
>> 
>> Thanks for your answer.
>> 
>> I had the misconception that the undo stack was related with the repeat 
>> command. I realized it isn't.
>> 
>> I have a jscript command that gives me the weights array to work it on my 
>> python plugin because getting the array in Python is like 3 times slower.
>> 
>> I use this command to refresh my weights GUI so not being able to undo it 
>> shouldn't give any problems since it isn't changing anything.
>> 
>> So I use another command like paste weights and then my refresh command run 
>> automatically and I can't repeat my paste weights command because the last 
>> command was the Jscript GetWeights.
>> 
>> 
>> 
>> ------
>> Softimage Mailing List.
>> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
>> "unsubscribe" in the subject, and reply to confirm.
> 
> ------
> Softimage Mailing List.
> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
> "unsubscribe" in the subject, and reply to confirm.
> 
> ------
> Softimage Mailing List.
> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
> "unsubscribe" in the subject, and reply to confirm.
------
Softimage Mailing List.
To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
"unsubscribe" in the subject, and reply to confirm.

Reply via email to