Navigation

    • Register
    • Login
    • Search
    1. Home
    2. WTools3D
    WTools3D

    WTools3D

    @WTools3D

    2
    Reputation
    25
    Posts
    24
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online
    Website www.lwcad.com Location Slovakia

    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    WTools3D Follow

    Best posts made by WTools3D

    RE: Creating NGONs low level with NgonBase::BuildNgon() ?

    @m_magalhaes
    Thanks Manuel!

    When I fill-in only Inner edges in NgonBase::BuildNgon, then it surprisingly works 😉
    I don't know why I tested all combinations except this one 🙂
    There are still some minor glitches, some inner edges are randomly not hidden, but ngons created are valid for all the cases I have tested.
    Random glitches are easily fixable with forcing all inner edges to be hidden.

    I will test it more, but this seems to be reliable for now.
    NGONS import - read outer edges directly from Pgon::*m_Edge array
    NGONS export - with NgonBase::BuildNgon(), filling Inner edges only, and force hide inner edges on quads.

    Thanks a lot Manuel,
    Your help has been very valuable to me.

    Regards,
    Viktor.

    posted in Cinema 4D SDK •
    RE: R25 - DrawPoint2D,DrawHandle2D not drawing pixel size anymore

    I just found out it's a GPU issue.
    Pixels are not visible on Intel UHD 630.
    Mac M1 well.
    GeForce works on 4K monitor but not on HD monitor.

    So it is a bug.

    posted in Cinema 4D SDK •

    Latest posts made by WTools3D

    RE: ObjectData::GetDimension() ignored?

    Now it's more clear.
    I assumed behavior of the framing commands on wrong premise.

    Maybe you could add some further explanation in the documentation where the overwritten bounding data is used in the cinema.

    Thank you for your suggestions how to resolve this on my side!

    Regards,
    Viktor

    posted in Cinema 4D SDK •
    RE: ObjectData::GetDimension() ignored?

    Hi Ferdinand.
    I'll explain each issue separately:

    First. try to multiply *rad value by 10, in your example.
    case 1: *rad = Vector(rady, rado + radx, rado + radx) *10; break;

    Then when you try to select this object and use 'Frame Selected Elements' function in the viewport.
    It will frame to the size of actual geometry not to the overridden size multiplied by 10.
    So it ignores the override.

    posted in Cinema 4D SDK •
    RE: Animatable control not working (DESC_ANIMATE_ON)

    Yes, this condition was the issue!
    It was a copy-paste part from some C4D example without deeper thinking.
    Now it works as expected also with animations!

    Regarding the value as a class parameter, it is of course handled for read-write copy.
    Our plugins are ported into more applications not just for C4D. Using its own data management so that's why the Get-Set callback are used.

    Thank you for your quick and useful help, as usual 🙂

    Regards,
    Viktor

    posted in Cinema 4D SDK •
    ObjectData::GetDimension() ignored?

    Hi guys.
    ObjectData::GetDimension() callback is ignored in most of the cases.

    1. When ObjectData::GetVirtualObjects() callback returns null object, in this case GetDimension() is completely ignored. It is the case when it would be most useful!

    2. When ObjectData::GetVirtualObjects() callback returns valid PolygonObject, in this case GetDimension() is again ignored because the plugin is calculating dimension from returned PolygonObject.

    Is there some additional settings which needs to be set to force plugin to use GetDimension()?

    Thanks!

    posted in Cinema 4D SDK •
    Animatable control not working (DESC_ANIMATE_ON)

    Hi.
    I am struggling to update existing plugins to be animatable.
    Plugins are geometry generator derived from ObjectData.
    Panel is generated with GetDDescription() callback.
    And internal data are handled via GetDParameter() and SetDParameter() callbacks.

    Below is simplified example.
    I need to animate the internal parameter (Float m_value).
    It doesn't work when set to DESC_ANIMATE_ON.
    Animation of Value parameter appears in panel with the animate diamond icon, but it doesn't switch to red state when clicking on it.

    1d6b4d01-6e6a-4d0a-b220-b7d0ab2ec025-image.png

    #define CTL_VAL_ID	1001
    //===========================================================================================================
    // class
    //===========================================================================================================
    class TestData : public ObjectData
    {
    	INSTANCEOF(TestData, ObjectData);		// Cinema4D hierarchy	
    public:
    	// create
    	static NodeData* Create() { return NewObjClear(TestData); }
    
    	//----------------------------------------------------------
    	// DATA
    	//----------------------------------------------------------
    	Float	m_value = 15;
    
    	//----------------------------------------------------------	
    	// panel
    	//----------------------------------------------------------
    	Bool GetDDescription(GeListNode* node, Description* description, DESCFLAGS_DESC& flags)
    	{
    		// validation
    		if (node == nullptr || description == nullptr)			return false;
    		// load the description for Obase
    		if (description->LoadDescription(Obase) == false)		return false;
    
    		// load all parameters
    		if (description->GetSingleDescID() == nullptr)
    		{
    			//
    			const DescID cid = DescLevel(CTL_VAL_ID, DTYPE_REAL, 0);
    			//---------------------------------------------------------------------
    			BaseContainer bc = GetCustomDataTypeDefault(DTYPE_REAL);
    			//---------------------------------------------
    			bc.SetInt32(DESC_UNIT, e_CtlUnitType::flt);
    			bc.SetString(DESC_NAME, String("Value: "));
    			bc.SetInt32(DESC_SCALEH, 1);
    			//---------------------------------------------		
    			// animate ON
    			bc.SetInt32(DESC_ANIMATE, DESC_ANIMATE_ON);
    			//---------------------------------------------
    			// set parameter
    			description->SetParameter(cid, bc, DescLevel(ID_OBJECTPROPERTIES));
    		}
    
    		// controls loaded into tool description
    		flags |= DESCFLAGS_DESC::LOADED;
    
    
    		// base	class
    		return SUPER::GetDDescription(node, description, flags);
    	}
    	//----------------------------------------------------------
    	Bool GetDParameter(GeListNode* node, const DescID& id, GeData& t_data, DESCFLAGS_GET& flags) override
    	{
    		// shortcuts		
    		BaseContainer* bc = static_cast<BaseObject*>(node)->GetDataInstance();
    
    		//-----------------------------------------
    		// parameter value to bc (get from bc)		
    		if (CTL_VAL_ID == id[0].id)
    		{
    			bc->SetFloat(CTL_VAL_ID, m_value);
    			return true;
    		}
    		//---------------------
    		// base
    		return SUPER::GetDParameter(node, id, t_data, flags);
    	}
    	//----------------------------------------------------------
    	Bool SetDParameter(GeListNode* node, const DescID& id, const GeData& t_data, DESCFLAGS_SET& flags) override
    	{
    		//-----------------------------------------
    		// parameter value from bc (set in bc)
    		C4dControls controls(t_data);
    		if (CTL_VAL_ID == id[0].id)
    		{
    			m_value	= t_data.GetFloat();
    			return true;
    		}
    		//-----------------------------------------
    		// base
    		return SUPER::SetDParameter(node, id, t_data, flags);
    	}
    };
    
    RegisterObjectPlugin(1060016, String("#$44 Test Nurbs"), OBJECT_GENERATOR | OBJECT_USECACHECOLOR, TestData::Create, maxon::String(""), nullptr, 0);
    
    posted in Cinema 4D SDK •
    RE: R25 - DrawPoint2D,DrawHandle2D not drawing pixel size anymore

    I just found out it's a GPU issue.
    Pixels are not visible on Intel UHD 630.
    Mac M1 well.
    GeForce works on 4K monitor but not on HD monitor.

    So it is a bug.

    posted in Cinema 4D SDK •
    RE: Spline generator drawing and selection override.

    I guess it is probably not doable with current api.
    I am marking this as solved!

    I sacrifice the possibility that the generator can be changed to a Spline object with the Cinema Make Editable command.
    If the call to NurbsData::GetContour() returns null, no highlighting or geometry will be drawn.
    So I can draw everything without any collisions.

    Only downside of this is that additional command for conversion of this object to a spline object is needed.

    Thanks.

    posted in Cinema 4D SDK •
    R25 - DrawPoint2D,DrawHandle2D not drawing pixel size anymore

    Hi,
    I am not able to draw a pixel in R25 anymore.
    DrawPoint2D and DrawHandle2D() with DRAWHANDLE::MINI option doesn't work anymore.
    R21,S22,R23,S24 works fine.

    Is anything changed in R25 drawing api?

    I hope it is just an error on my side. But it works in all other versions.
    Problem is just in R25.

    Anybody else having a problem with this?

    Thanks!
    Viktor

    posted in Cinema 4D SDK •
    RE: Spline generator drawing and selection override.

    @m_adam said in Spline generator drawing and selection override.:

    What do you mean by being part of the generator? If they are children of your generator, and your generator is registered with the OBJECT_INPUT then the cache should be automatically touched and therefor not shown.

    No children.
    I just want to disable drawing of Spline Object by cinema. Spline object which is returned in GetContour() callback.
    But only for the time it is being generated. Until you call Make Editable command which destroy generator and keep just Spline object.

    So I want to override drawing of that generated Spline object. And draw selected and not selected parts with differnt colors.
    Avoid to overdrawing selected parts over existing draw made by cinema which makes "glitches".

    So in short just need to disable drawing spline object and highlighting.

    Sorry for confusion.
    Thanks!
    V

    posted in Cinema 4D SDK •
    RE: Spline generator drawing and selection override.

    @m_adam said in Spline generator drawing and selection override.:

    Just return true in your draw method during the HIGHLIGHT_PASS, this way nothing will be drawn.

    I have tested all returns of DRAWRESULT from NurbsData::Draw() callback. (R21-R25)

    In R21 the spline is always white, in R25 it is orange.
    No matter if I exit with return SUPER::Draw(op, type, bd, bh) or return any DRAWRESULT result.

    V.

    posted in Cinema 4D SDK •