Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. WTools3D
    • Profile
    • Following 0
    • Followers 0
    • Topics 10
    • Posts 29
    • Best 2
    • Controversial 0
    • Groups 0

    WTools3D

    @WTools3D

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

    WTools3D Unfollow 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
      WTools3DW
      WTools3D
    • 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 Bugs
      WTools3DW
      WTools3D

    Latest posts made by WTools3D

    • RE: Reading Display scale factor? <Retina,non-Retina>

      Thank you Ferdinand!
      I'll continue in backstage with this topic.
      V.

      posted in Cinema 4D SDK
      WTools3DW
      WTools3D
    • Reading Display scale factor? <Retina,non-Retina>

      Hi guys,

      When drawing bitmaps on the screen using BaseDraw::DrawTexture(), there is a difference between Retina and non-Retina displays. The scale factor is usually 1.0 for regular displays and 2.0 for Retina displays. When the scale factor is larger, the pixel size of the bitmap needs to increase accordingly.

      Is there any way to retrieve this factor directly from the Cinema C++ SDK? I would expect this to be accessible in the BaseDraw or BaseView class.

      I hope I’m asking correctly this time. 🙂

      Thanks,
      V.

      Let me know if you’d like further revisions!

      @edit:

      --- the size of the bitmap in pixels needs to increase accordingly. ----
      just to be more clear.

      posted in Cinema 4D SDK c++
      WTools3DW
      WTools3D
    • RE: Workplane Manipulation Within a ToolData-Derived Plugin

      I am sorry for a messy question and thank for answering it anyways.
      I'll try to be more precise next time.

      This solution works fine.
      Thank you!
      V.

      posted in Cinema 4D SDK
      WTools3DW
      WTools3D
    • Workplane Manipulation Within a ToolData-Derived Plugin

      Hi,
      When the workplane is modified using the ToolData custom plugin, the ortho viewports do not refresh to reflect the new workplane. The modification is done in the ToolData::Mouse callback:

          // Example: Modify the Workplane Matrix here
          BaseObject* workplane = doc->GetWorkplaneObject();
          if (workplane)
          {
              Matrix newMatrix;
              // Modify the matrix as needed
              workplane->SetMg(newMatrix);
              
              // Notify Cinema 4D that a change has occurred
              EventAdd();
      
              // Force the viewports to update
              DrawViews(DRAWFLAGS::DRAWFLAGS_FORCEFULLREDRAW);
          }
      

      When the workplane is modified using Cinema 4D's native tools, the ortho viewports automatically align to the new workplane.

      Any clue on how to achieve this programmatically in a custom plugin tool?

      Thanks!

      posted in Cinema 4D SDK c++
      WTools3DW
      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
      WTools3DW
      WTools3D
    • 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
      WTools3DW
      WTools3D
    • 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
      WTools3DW
      WTools3D
    • 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 2023 c++
      WTools3DW
      WTools3D
    • 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 c++ 2023
      WTools3DW
      WTools3D
    • 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 Bugs
      WTools3DW
      WTools3D