Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Is it possible to delete a modifier though registerTimeCallback?

Is it possible to delete a modifier though registerTimeCallback?

Anonymous
Not applicable
1,716 Views
3 Replies
Message 1 of 4

Is it possible to delete a modifier though registerTimeCallback?

Anonymous
Not applicable

Hey there, just like the title asks, is possible to delete a modifier from the stack each time the timeline position is changed using a function called with registerTimeCallback?  I am using the script below to copy uvs from one object to another and this creates a new UVW Mapping Paste modifier each frame.  I would like to be able to clear the previous instances of the modifier at the beginning of each frame as part of the function which does the uv channel operations.  I am quite new to Maxscript, the standard deleteModifer command does not seem to be able touch the stack from within the function called by the registerTimeCallback event.

 

Here is the script so far:

 

fn UVUpdate = (
deleteModifier $ROADANIM 1 --<--Does Nothing
ChannelInfo.CopyChannel $ROADFREEZE 3 1
ChannelInfo.PasteChannel $ROADANIM 3 1
)
registerTimeCallback UVUpdate

 

Thanks in advance peeps! 

 

EDIT: I didn't realize that 3Ds does not keep an eye on changes made to a script at save time when that script is actively running in the app, had to hit ctrl+e to get it to update... -_-

0 Likes
Accepted solutions (1)
1,717 Views
3 Replies
Replies (3)
Message 2 of 4

ads_royje
Alumni
Alumni

Hi yamanashg,

 

I saw you edited your post, does it mean you found the issue ?

 

Just in case, it does work, it is that you cannot 'see' it as you re-add one just at the end.

As a test, just do not do the "ChannelInfo.PasteChannel" and you'll see that your modifier gets deleted.

 

Cheers! 

Message 3 of 4

Anonymous
Not applicable
Accepted solution

Hey, thanks for the response, yeah I just forgot to hit ctrl+e to run to updated script.  Smiley Embarassed

0 Likes
Message 4 of 4

Alfred.DeFlaminis
Alumni
Alumni

Hello @Anonymous,

 

Thanks for updating the thread!  I'm going to move the thread to the Programming forum because I think it will be easier to find there for future users.  Thanks very much!

Best Regards,

0 Likes