THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/10/2006 at 03:35, xxxxxxxx wrote:
Cinema 4D Version: 9.5
Platform: Windows ;
Language(s) : C++ ;
I have a Menu-Plugin that is supposed to create a new object and then insert my own tag to that object. But when I run it, it closes C4D without any message whatsoever. Here's my code for the Menu-Plugin Execute:
Bool GenStation::Execute(BaseDocument *doc)
BaseObject *op = BaseObject::Alloc(Onull);
BaseTag *StationTag = (BaseTag* )TagStation::Alloc();
If I take out the line
, then everything works fine, but obviously I don't have the tag on my object then ... any ideas?
On 18/10/2006 at 04:46, xxxxxxxx wrote:
If the tag is one of yours, you'll need to call it like this:
BaseTag* StationTag = PluginTag::Alloc(YOUR_UNIQUE_ID);
It is also always a good idea to check for NULL (in this case 'op' and 'StationTag' after the Alloc()).
On 23/10/2006 at 01:27, xxxxxxxx wrote:
Thanks Robert, that solved the problem! I also included the checks for NULL ...