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

    Generator GetDimension() not called

    Cinema 4D SDK
    r21 c++
    2
    9
    1.2k
    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.
    • rsodreR
      rsodre
      last edited by rsodre

      Hello,

      Is there any reason for my generator's GetDimension() not neing called?
      I'm sure I'm sending a Message(MSG_UPDATE) to it, but
      The object size in the Coordinates Manager is always the default, never what I set in GetDimension().

      Thanks,
      Roger

      1 Reply Last reply Reply Quote 0
      • r_giganteR
        r_gigante
        last edited by

        Hi Roger, thanks for reaching out us.

        With regard to your issue, there's actually no known reasons for having the ObjectData::GetDimensions() not being called if the ObjectData plugin has been properly registered.

        The method is implemented in most of the ObjectData- related examples shipped with cinema4dsdk project and the implementation is called properly during the scene execution phase.

        If you need further support, please provide some code to reproduce the issue.

        Cheers, R

        rsodreR 1 Reply Last reply Reply Quote 0
        • rsodreR
          rsodre @r_gigante
          last edited by

          @r_gigante After comparing my code with the examples, and trying multiple things, when I remove OBJECT_ISSPLINE from my object, it starts calling GetDimension().

          Debugging the objectdata_heartshape example, breakpoints at GetContour() always break execution, but breakpoints at GetDimension() never do. Is that a bug?

          Got the same result on R19, R20 and R21.

          1 Reply Last reply Reply Quote 0
          • r_giganteR
            r_gigante
            last edited by r_gigante

            Hi Roger,

            when an ObjectData is generating a spline, ObjectData::GetDimension() is correctly not called because internally Cinema 4D handles this differently and checks only for the implementation existence.
            Actually - as you've already experienced - the ObjectData::GetContour() is called first to create the cache of the spline and, after that, Cinema takes care of checking all the points used to represent the shape are to compute the bounding.

            I apologize due to the example being misleading and, to avoid future doubts, I'll correct the HeartShape class declaration as:

            class HeartShape : public ObjectData
            {
            	INSTANCEOF(HeartShape, ObjectData)
            
            public:
            	static NodeData* Alloc(){ return NewObj(HeartShape) iferr_ignore("HeartShape plugin not instanced"); }
            
            	virtual Bool Init(GeListNode* node);
            	void GetDimension(BaseObject* op, Vector* mp, Vector* rad){ return; }
            	virtual SplineObject* GetContour(BaseObject* op, BaseDocument* doc, Float lod, BaseThread* bt);
            };
            

            Cheers, R

            rsodreR 1 Reply Last reply Reply Quote 0
            • rsodreR
              rsodre @r_gigante
              last edited by

              @r_gigante Oh, ok... So it's impossible to define a custom dimension for spline objects?

              Is there anything I can do to display different value in the Coordinates Manager Size?
              Or inherit from another object, like one of it's modifiers?

              1 Reply Last reply Reply Quote 0
              • r_giganteR
                r_gigante
                last edited by

                Hi Roger,

                Is there anything I can do to display different value in the Coordinates Manager Size?

                what the purpose of granting this? I can't figure a good reason to make it

                Cheers, R

                rsodreR 1 Reply Last reply Reply Quote 0
                • rsodreR
                  rsodre @r_gigante
                  last edited by

                  @r_gigante My generator creates an empty spline, several modifiers can actually create and modify it. I's like to display the final size in the main generator object.

                  1 Reply Last reply Reply Quote 0
                  • r_giganteR
                    r_gigante
                    last edited by

                    Thanks @rsodre for following up.

                    Actually there's nothing that comes on my mind to help you sort this issue out cause even implementing both ObjectData::GetContour() and ObjectData::GetVirtualObject() doesn't help to have the GetDimension effectively called.

                    Cheers, R

                    rsodreR 1 Reply Last reply Reply Quote 0
                    • rsodreR
                      rsodre @r_gigante
                      last edited by

                      @r_gigante ok thanks!

                      I managed a workaround by filling my dummy spline with two zero length segments at the claculated bounding box limits.

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