Dynamic Descriptions and Animation ;)
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/03/2006 at 23:15, xxxxxxxx wrote:
User Information:
Cinema 4D Version:Â Â Â 9.102Â
Platform:   Windows ; Mac ; Mac OSX ;Â
Language(s) :Â Â Â Â C++Â ;---------
Time for a lesson about putting the horse before the cart...My plugin imports Poser figures (etc.). Normally, you would import the figure and animate interactively or by applying animated poses to the figure after the fact. The animation tracks are stored on Dynamic Description Real sliders which keep unique indices. Easy-peazy.
Now answer me this: If the figure is already animated when being loaded, the Dynamic Descriptions don't really exist yet, do they? They are only created, it seems, when the actual object is selected and thus triggers a call to GetDDescription(). So, how to handle this?
If the DD doesn't yet exist, my code stores the animation keys for later application. But there is still required that kick in the pants to get GetDDescription() to create the darn things. I've found that ActiveObjectManager_SetObject() can be used, but it is not very pretty watching all of the objects cycle through the AM to create the DDs.
Is there an alternative?
Thanks,
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 04/03/2006 at 17:16, xxxxxxxx wrote:
Took long enough, but I remembered that the same problem existed for my polygon selection tag visibilty tag (so that they could be unrendered).
The idea is simple: send an unused message (MSG_RETRIEVEPRIVATEDATA works most of the time) to the plugin object when the descriptions in GetDDescription() may not be constructed yet but you need them for applying settings programmatically. Simply doing a node->GetDescription(desc, 0) in the plugin Message() seems to do the trick. Description* desc is allocated in Init() for whenever I need to call GetDescription() (often enough to justify it).
I really did not like ActiveObjectManager_SetObject() as it required much more time and all you see is the darn AMs whizzing by (and it would open an AM windows if none were available to boot!).
Alternative achieved!