Generator GetDimension() not called



  • 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



  • 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



  • @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.



  • 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



  • @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?



  • 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



  • @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.



  • 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



  • @r_gigante ok thanks!

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


Log in to reply