THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/06/2009 at 06:20, xxxxxxxx wrote:
Sorry I still don't understand why you would want to call SendModelingCommand() in your tools Message() method. I think you go wrong about it.
It works usally like this (this is true for most CINEAM 4D plugins) :
-derive your plugin from one of the plugin data classes (ObjectData, ShaderData etc.)
-overload the necessary virtual methods with your own code
Have a look at the example below, here I derived my own plugin from the DescriptionToolData class. Next thing would be to overload the virtual methods. MouseInput lets you react to mouse inputs. DoCommand is called if someone is calling your tool through SendModelingCommand.
For you there is no need to call SendModelingCommand as far as I can tell from your post.
> \> class MyTool : public DescriptionToolData \> { \> public: \> MyTool(); \> \> virtual LONG GetToolPluginId() { return ID_MY_TOOL; } \> virtual const String GetResourceSymbol() { return String("My Tool"); } \> \> virtual Bool MouseInput(BaseDocument \*doc, BaseContainer &data;, BaseDraw \*bd, EditorWindow \*win, const BaseContainer &msg;); \> virtual LONG GetState(BaseDocument \*doc); \> \> virtual void InitDefaultSettings(BaseDocument \*doc, BaseContainer &data;); \> virtual Bool DoCommand(ModelingCommandData &mdat;); \> virtual Bool GetCursorInfo(BaseDocument \*doc, BaseContainer &data;, BaseDraw \*bd, Real x, Real y, BaseContainer &bc;); \> \> virtual Bool GetDEnabling(BaseDocument \*doc, BaseContainer &data;, const DescID &id;,GeData &t;\_data,LONG flags,const BaseContainer \*itemdesc); \> virtual LONG Draw(BaseDocument \*doc, BaseContainer &data;, BaseDraw \*bd, BaseDrawHelp \*bh, BaseThread \*bt,LONG flags); \> }; \>
Please take a look again at the edgecut tool example to see how it works in detail.
cheers,
Matthias