CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 03-30-2013, 02:39 PM   #1
spider853
Veteran
portfolio
Spider Spider
Anonymous, RO
 
Join Date: Nov 2008
Posts: 47
Question [MXS] Is it posible to force a mesh plugin to update on each frame?

Hi,
Is it possible to make the mesh plugin to update on time scrub without creating a global callback?

on buildMesh is called only when the object is created, I need to create a procedural mesh scripted plugin.

Thanks
 
Old 03-30-2013, 05:06 PM   #2
Bobo
Krakatoa Guy
 
Bobo's Avatar
Borislav Petrov
Product Specialist
Thinkbox Software
Vancouver, Canada
 
Join Date: Mar 2002
Posts: 5,324
Quote:
Originally Posted by spider853
Hi,
Is it possible to make the mesh plugin to update on time scrub without creating a global callback?

on buildMesh is called only when the object is created, I need to create a procedural mesh scripted plugin.

Thanks


The On BuildMesh is called whenever the Validity Interval of the plugin is invalid. Max is trying to be economical with updates (and often fails), but in this case it actually does what is is supposed to do. Thankfully, the granularity of Validity Interval checking for Scripted Plugins is quite low, so anything you change would trigger an update.

The simplest way to fool it is to create an animatable track in the paramBlock and set keyframes with different values on frame 0 and frame 100, then set the Out Of Range behavior to continue the animation in both directions. You set this in the create handler. The parameter itself does nothing else. This way, when you scrub the time slider, the plugin's validity will be checked and Max will notice that a parameter has changed and will trigger the on buildMesh handler to make sure it looks right.

In fact, you can have a checkbox in your UI that enables and disables this ("Auto-Update On/Off") by adding and removing the keys in your dummy track. I used this in the DIMaster objects and it worked great.
__________________
Bobo
 
Old 03-30-2013, 06:39 PM   #3
spider853
Veteran
portfolio
Spider Spider
Anonymous, RO
 
Join Date: Nov 2008
Posts: 47
Thumbs up

Thank you very much Bobo.
I was thinking of validity interval but sadly didn't found any reference for script plugin, sad that plugin interface for maxscript doesn't allow to set it.
 
Old 03-30-2013, 10:50 PM   #4
spider853
Veteran
portfolio
Spider Spider
Anonymous, RO
 
Join Date: Nov 2008
Posts: 47
Question

[edit, fixed]

Last edited by spider853 : 03-30-2013 at 10:59 PM. Reason: fixed
 
Old 03-30-2013, 10:50 PM   #5
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:54 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.