Parent of a tag
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/11/2007 at 03:48, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R10
Platform: Windows ;
Language(s) : C++ ;---------
I want to restrict my Tag just to meshes (doesnt make any sense elsewhere)
What I am trying to do is checking the parent in during the Init.
I found a post with the same problem and tried to use the solution.
However my BaseObject is always NULL.
Are there any other methods to access the parent of a tag?Thanks for any help
> _class p406SkinTag : public TagData
> {
> public:
> virtual Bool Init(GeListNode *node);
>
> virtual LONG Execute(PluginTag *tag, BaseDocument *doc, BaseObject *op, BaseThread *bt, LONG priority, LONG flags);
> static NodeData *Alloc(void) { return gNew p406SkinTag; }
> };
>
> Bool p406SkinTag::Init(GeListNode *node)
> {
> BaseTag* tag = static_cast<BaseTag*>(node);
> String name = tag->GetName();
> BaseObject* op = tag->GetObject();
>
>
> if(op && op->GetType() == Opolygon)
> return TRUE;
> return FALSE;
> }
> _ -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/11/2007 at 15:25, xxxxxxxx wrote:
During Init() it isn't guaranteed that the parent has been established. If you are using Execute(), check there before continuing and return if the object is not Opolygon. As far as I am aware, there is no way to restrict to what kind of object a tag can be attached by the user. By the time Init() is called, it is already too late. Also, an SDK object can't delete itself - that is, if the object type check fails, you can't have the tag call Remove() and Free() on itself.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/11/2007 at 00:04, xxxxxxxx wrote:
It is not possible to restrict tag creation to certain object types. You have to exclude object types within Execute() of your plugin tag.
cheers,
Matthias -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/11/2007 at 01:32, xxxxxxxx wrote:
Thanks alot for the help