I can't find a solution to this but I finally understood 2 things:

The Cmd.SetFlag(262144,false) makes the command undoable, but if this
command is using other commands inside, they will be undoable.
This Flag don't affect at all Repeat last command.

Is there anyway to manipulate, or manually set which command Repeat should
use as the last executed command?

Martin

On Thu, Jan 12, 2017 at 7:53 PM, Martin Yara <furik...@gmail.com> wrote:

> Thanks for your answer.
>
> I tried that but it resets all the Undo History so both a() and b() won't
> be undoable.
> And worst, b() is still in the Repeat list.
>
> I want to keep a() undoable and repeatable while making b() invisible.
>
> It seems to work fine when b() is called by an event, undo and repeat will
> ignore the event. A workaround would probably be using a few onEndCommand
> events.
>
> Martin
>
> On Thu, Jan 12, 2017 at 7:42 PM, Alok Gandhi <alok.gandhi2...@gmail.com>
> wrote:
>
>> You can set
>> preferences.General.undo': 0
>> before calling b().
>>
>> In python this can be easily done through a decorator
>> <http://www.softimageblog.com/index.php?s=decorators>
>>
>>
>> On Thu, Jan 12, 2017 at 6:20 PM, Martin Yara <furik...@gmail.com> wrote:
>>
>>> I've found SetFlag(262144, false) in an old message in the list but I
>>> don't understand how does it work.
>>>
>>> I create a command a() with these flags in JScript.
>>> oCmd.SetFlag(siNoLogging,true);
>>> oCmd.SetFlag(siSupportsKeyAssignment,false) ;
>>> oCmd.SetFlag(262144,false);
>>> Just like the commands inside GlobalVarPlugin.js from the Softimage
>>> Commands folder..
>>>
>>> The command does a simple duplicate Component, just for testing.
>>>
>>> Then I execute:
>>>
>>> Translate("",0,0,1)
>>> a()
>>>
>>> As expected, it moves the selected point and then, duplicate it.
>>> If I use Repeat, it repeats a()
>>> If I undo, it undoes a(), and if undo again it undoes Translate.
>>>
>>> So I don't see any change with a not flagged command.
>>>
>>> Is this behavior normal? I though it wouldn't undo the a() command and
>>> hoped that Repeat would ignore it too, but i doesn't.
>>>
>>>
>>> Martin
>>>
>>>
>>>
>>>
>>> On Thu, Jan 12, 2017 at 5:44 PM, Martin Yara <furik...@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Is it possible, in Scripting, to execute a command without leaving a
>>>> trace in the undo stack?
>>>>
>>>> I want to execute 2 commands a() and b() in that order, but I want to
>>>> be able to use Repeat to use a() again, not b().
>>>>
>>>> b() command is only a command to get data so it shouldn't break
>>>> anything if I skip that command when undoing or repeating.
>>>>
>>>> I've found 'TermUndoRedo' in the SDK manual but it is only for C++ API.
>>>>
>>>> Thanks
>>>>
>>>> Martin
>>>>
>>>
>>>
>>> ------
>>> 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