On 27/07/2013 at 12:34, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13
Platform: Windows ;
Language(s) : C++ ;
---------
Hi,
I have a few questions about CMotion
Q1:
If CMotion is an object plugin. Why do the headers start with the letter "t"?
And why does the tcawcycle.res file contain all sorts of TAG references in it as if it's a tag plugin?
~~ Q2:~~
How do we execute the the ADD button for the actions option in C++?
Q3:
How do we access the CMotion tree gui?
How do we add objects to it?
How do we select objects in it?
My Code:
#include "..\..\..\modules\ca\res\description cawcycle.h"
BaseObject *cm = doc->SearchObject("CMotion");
if(!cm) return FALSE;
BaseObject *cube = doc->SearchObject("Cube");
if(!cube) return FALSE;
GeData d;
cm->GetParameter(DescID(ID_CA_WCYCLE_TAG_ACTIONS), d, DESCFLAGS_GET_0); //Gets the current actions option
cm->SetParameter(DescID(ID_CA_WCYCLE_TAG_ACTIONS), GeData(1), DESCFLAGS_SET_0); //Sets the Lift(P.Y) action option
//How do we add the cube to the CMotion tree gui?
//c4d.CallButton(cm,c4d.ID_CA_WCYCLE_TAG_ACTION_ADD) //Executes the "ADD" button to create the new Lift action in Python
//Trying to execute the ADD button with C++ is not working
LONG plugin_id = doc->GetAction();
BasePlugin *CMplugin = FindPlugin(plugin_id, PLUGINTYPE_COMMAND); //Find the CMotion plugin
if(CMplugin) GePrint("found the CMotion plugin"); //Confirms that we've got the plugin
if(!CMplugin) return FALSE;
DescriptionCommand dc;
dc.id = DescID(ID_CA_WCYCLE_TAG_ACTION_ADD); //ID_CA_WCYCLE_TAG_ACTION_ADD is the id# for the button
CMplugin->Message(MSG_DESCRIPTION_COMMAND, &dc); //<---Not working!!!
EventAdd();
-ScottA