Hi!
When I need the polygons of some object, I usually use the JOIN command to build a fresh cache, apply all the modifiers and include all the children. Works really good.
But I have a setup now, of a Plane with a Bend and a Jiggle to give some physics to the animation.
When I apply the Join command to this plane, I get the Bend deformation but never the Jiggle.
Is there anything different with the Jiggle to force it's deformation into the cache?
I see there's an Enable Cache in it, but from the docs I think it's not what I'm looking for, and of course I tried it and made no difference for me.
This is how I join the object...
bool MakePolygon( BaseDocument* doc, BaseObject* src, PolygonObject* dst )
{
auto clonedSource = static_cast<BaseObject*>( src->GetClone( COPYFLAGS_0, nullptr ) );
CHECK_RETURN_FALSE( clonedSource != nullptr );
// ignore object transform
clonedSource->SetMg( Matrix() );
// The JOIN command will make editable, appy all modifiers, and join into a single polygon
ModelingCommandData joinCommand;
joinCommand.op = clonedSource;
joinCommand.doc = doc; // cannot be null, wil not create object
joinCommand.mode = MODELINGCOMMANDMODE_ALL;
joinCommand.flags = MODELINGCOMMANDFLAGS_0;
auto success = SendModelingCommand( MCOMMAND_CURRENTSTATETOOBJECT, joinCommand );
if( !success || joinCommand.result == nullptr )
{
BaseObject::Free( clonedSource );
return false;
}
auto result = false;
PolygonObject* joinedPolygon = static_cast<PolygonObject*>( joinCommand.result->GetIndex(0) );
if( joinedPolygon->IsInstanceOf( Opolygon ) )
{
joinedPolygon->CopyTo( dst, COPYFLAGS_0, nullptr );
result = true;
}
BaseObject::Free( clonedSource );
PolygonObject::Free( joinedPolygon );
return result;
}