[Closed] Max SDK and the widget object
I’ve done the sdk exercise “How to Write a Geometric Object” which results in a simple procedural object. However, I have some problems when animating its parameters. If I animate lets say the size parameter and then play the animation in viewport it doesn’t update the view and shows static object. However if I go to specific frame or rotate the view while its playing the animation it works just fine and scales the object.
So, how do I specify max to update object on each frame while playing animation? I tried to look into geospheres source code and see whats done differently because it works just fine however I didn’t find anything. Ideas?
- Jerry
Sounds like you forget to set the object Validity.
So max is thinking the object is valid forever, where really it should be valid for the range where the animation of your size spinner doesn’t change.
-Kees
And how exactly would I set this? I’ve tried to compare geosphere source code to mine and I haven’t found any differences in how I use the paramblock. I haven’t found any glues on SDK help either… Here is the part of the source from BuildMesh function I think is the cause:
Geosphere:
ivalid = FOREVER;
pblock2->GetValue(geo_radius, t, radius, ivalid);
And mine:
ivalid = FOREVER;
pblock2->GetValue(size, t, oSize, ivalid);
Now I set it to FOREVER but so does the geosphere, should it be something else?