Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Get BaseObject from ObjectData

    SDK Help
    0
    3
    331
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 10/02/2016 at 04:57, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R17 
      Platform:      
      Language(s) :     C++  ;

      ---------
      Here is the newbie again, I've managed to create my object derived from ObjectData but what if I want to move it from inside itself?

      Moving it seems to be trivial using BaseObject* functions but I cannot find the way to get it.

      Regards and thank you in advance again!

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 10/02/2016 at 05:38, xxxxxxxx wrote:

        From inside your ObjectData-derived class, you can use either the GeListNode* node passed to the method in the class:

        //*---------------------------------------------------------------------------*
        Bool MyObjectData::Message(GeListNode* node, Int32 type, void* data)
        //*---------------------------------------------------------------------------*
        {
        	if (!node)
        		return FALSE;
          
        	BaseObject*	pObject =	static_cast<BaseObject*>(node);
          
        	// etc.
          
        	return SUPER::Message(node,type,data);
        }
        

        Or you can use the NodeData::Get() method:

        //*---------------------------------------------------------------------------*
        Bool MyObjectData::MyMethod()
        //*---------------------------------------------------------------------------*
        {
        	GeListNode*	node =	Get();
        	if (!node)
        		return FALSE;
          
        	BaseObject*	pObject =	static_cast<BaseObject*>(node);
          
        	// etc.
          
        	return TRUE;
        }
        
        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 10/02/2016 at 10:02, xxxxxxxx wrote:

          Thank you second method is perfect for me

          1 Reply Last reply Reply Quote 0
          • First post
            Last post