THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/09/2009 at 14:04, xxxxxxxx wrote:
So in my Message() for my tool plugin I have the following code.
> `
\> Bool SculptTool::Message(BaseDocument* doc, BaseContainer& data, LONG type, void* t_data)
\> {
\>
\> switch (type)
\> {
\> case MSG_DESCRIPTION_COMMAND:
\> {
\> DescriptionCommand *dc = (DescriptionCommand* ) t_data;
\> if (dc->id[0].id==COMMAND_SUBDIVIDE)
\> {
\> GePrint("Subdivide Button Clicked");
\> }
\> }
\> }
\> return TRUE;
\> }
\>
`
Where if say's GePrint ("Subdivide Button Clicked"); I would instead like to execute the DoCommand() member. in that is the following code.
> `
\> Bool SculptTool::DoCommand(ModelingCommandData &mdat;)
\> {
\>
\> //CODE RELATED TO THE SUBDIVISION OPTIONS/////////////////////////////////
\>
\> //Define Variables
\>
\> BaseObject *op=mdat.doc->GetActiveObject();
\> PolygonObject* objPoly;
\> objPoly=(PolygonObject* )op;
\>
\> //Determine Attributes
\>
\> if (mdat.bc->GetBool(HYPERNURBS_SUBDIVISION, TRUE)) //If HyperNURBS is checked
\> {
\> mdat.bc->SetBool(MDATA_SUBDIVIDE_HYPER, TRUE); //Set HyperNURBS subdivision
\> }
\> else
\> {
\> mdat.bc->SetBool(MDATA_SUBDIVIDE_HYPER, FALSE); //Disable HyperNURBS subdivision
\> }
\> mdat.bc->SetLong(MDATA_SUBDIVIDE_SUB, mdat.bc->GetLong(NUM_SUBDIVISIONS)); //Set Number of Subdivisions
\> mdat.bc->SetReal(MDATA_SUBDIVIDE_ANGLE, mdat.bc->GetReal(MAX_ANGLE)); //Set Maxiumum Angle
\>
\> //Subdivision Command
\> SendModelingCommand(MCOMMAND_SUBDIVIDE, mdat);
\> mdat.bc->SetLong(POLYGON_COUNT, objPoly->GetPolygonCount());
\>
\> return true;
\>
\> //END SUBDIVISION OPTIONS/////////////////////////////////////////////////
\>
\>
\> }
\>
`
Can anyone explain how ot do this?
Thanks
~Shawn