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
    1. Maxon Developers Forum
    2. JohnThomas
    3. Posts
    J
    • Profile
    • Following 0
    • Followers 0
    • Topics 21
    • Posts 65
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by JohnThomas

    • RE: Sweep Modifier

      @i_mazlov Thanks for the response. I was afraid that that would be the case.

      John Thomas

      posted in Cinema 4D SDK
      J
      JohnThomas
    • Sweep Modifier

      Hello,

      I'm working on a modifer object that is meant to modify a spline object by changing the number of points in the spline. In the process of doing so I encountered some peculiar behaviour with the Sweep object when it interacts with my modifer.

      For the boiled down code I used the Spherify example from the sdk with the only modification to ModifyObject.

      Bool Spherify::ModifyObject(const BaseObject* mod, const BaseDocument* doc, BaseObject* op, const Matrix& op_mg, const Matrix& mod_mg, Float lod, Int32 flags, BaseThread* thread) const
      {
      	SplineObject* spline = (SplineObject*)op;
      	if (spline)
      	{
      		spline->ResizeObject(4, 1);
      
      		Segment* splineSegment = spline->GetSegmentW();
      		Vector* splinePoints = spline->GetPointW();
      
      		splineSegment[0].cnt = 4;
      		splineSegment[0].closed = FALSE;
      		splinePoints[0] = Vector(0, 100, 0);
      		splinePoints[1] = Vector(0, 0, 0);
      		splinePoints[2] = Vector(100, 0, 0);
      		splinePoints[3] = Vector(100, 100, 0);
      
      		op->Message(MSG_UPDATE);
      
      	}
      	return TRUE;
      }
      

      Am I missing something obvious with the way that Sweep operates that is causing this behaviour or am I missing something from my code that would prevent this?

      Any help would be greatly appreciated.

      John Thomas

      posted in Cinema 4D SDK 2025 c++ windows
      J
      JohnThomas
    • RE: Render Settings Videopost

      @ferdinand
      Thanks for the response, I figured that would be the case.

      John Thomas

      posted in Cinema 4D SDK
      J
      JohnThomas
    • Render Settings Videopost

      Hello.

      I'm working on a plugin that on input from user is meant to update parameters inside of Render Settings. For the ease of the user I want to be able to set to active the "Output" videopost if it isn't already selected. Is this possible to do via code in any way?
      59fe23de-0904-4158-b47b-8db1643d1290-image.png

      I've looked at the forums and I haven't seen any post dealing with this issue specifically.

      Any help would be greatly appreciated.

      John Thomas

      posted in Cinema 4D SDK 2025 c++ windows
      J
      JohnThomas
    • RE: Cache Proxy Tag

      @ferdinand
      Thanks for the detailed response, unfortunately what I'm trying to do doesn't seem viable.

      John Thomas

      posted in Cinema 4D SDK
      J
      JohnThomas
    • RE: Cache Proxy Tag

      Thanks for the response.

      For clarification what I am trying to do is have my modifer inside of ModifyObject change the points of the modified object. For simplicity sake it takes in the four points and moves them inwards so the Rectangle spline is smaller. The idea with the selection tag is to mimic the behavior of the things like the Selections in the Text object, so I could create a selection tag that would have some amount of the points from the Rectange spline selected, these points would be set in the Selection tag inside of ModifyObject. The selection tag would ideally be able to now be dragged into something like the Plain effector where it can effect the selected points, without the parent Spline object being made editable.

      When it comes to Selection tags is it possible, via code, to create the Tcacheproxytagpointselection style selection tags or is that purely limited to things like the Selections in a Text object?

      John Thomas

      posted in Cinema 4D SDK
      J
      JohnThomas
    • Cache Proxy Tag

      Hello,

      I have a question when it comes to the Selection tags such as "Tcacheproxytagpointselection". In the SDK they are listed as private for generators and not referenced again.

      Is there a method available to utilize them or an equivalent method. Specifically I'm trying to achieve the behavior shown in this clip, where the Text object is able to be changed by the Plain effector without being made editable due to its selection tag, while the Rectangle spline has to be made editable to be changed.

      Any help would be greatly appreciated.

      John Thomas

      posted in Cinema 4D SDK 2025 c++ windows
      J
      JohnThomas
    • RE: Order Of Hierarchy Updates For Fieldobjects

      @ferdinand Thanks for the response.

      That's what I was afraid the situation would be, I believe I have a work around that will be able to fulfill what I need it to do.

      John Thomas

      posted in Cinema 4D SDK
      J
      JohnThomas
    • Order Of Hierarchy Updates For Fieldobjects

      Hello,

      I am working on a FieldObject plugin that I am registering with RegisterFieldPlugin. My FieldObject is meant to be getting data from a linked object in its UI and then using the passed data to calculate the values for Sample.

      My issue is coming in that when I make a change to the linked object it is not being reflected in the FieldObject. This issue seems to stem from the fact that the FieldObject is running its code prior to the change in the linked object being reflected. So instead of the FieldObject having fresh values it referencing the previous data.

      Visualized this is what seems to be happening.
      FieldObject runs its Sample
      Linked Object updates its data

      and I am looking to have the reverse order happen. This happens regardless of the order of the objects in the Object Manager.

      Is it possible to have an object in the scene update before the FieldObject is called? In the sdk is there an example of the order in which Cinema will call things to be updated in the hierarchy.

      Any help would be greatly appreciated.

      John Thomas

      posted in Cinema 4D SDK 2025 c++
      J
      JohnThomas
    • RE: Tags Under Cloners

      @ferdinand

      Thanks for the response.

      That's what I was afraid of. 😦

      John Thomas

      posted in Cinema 4D SDK
      J
      JohnThomas
    • Tags Under Cloners

      Hello,

      I'm working on a tag plugin that is using positional data of an object to drive parameters. This is simple and straightforward so it is working properly using the code below inside of the Execute function to drive the Radius value of a sphere object.

      EXECUTIONRESULT TagParamRun::Execute(BaseTag* tag, BaseDocument* doc, BaseObject* op, BaseThread* bt, Int32 priority, EXECUTIONFLAGS flags)
      {
      	
      	if (tag->GetObject())
      	{
      		BaseObject* parentObj = tag->GetObject();
      		if (parentObj->GetType() == Osphere)
      		{
      			ApplicationOutput("Parent object " + parentObj->GetName());
      			Matrix sphereMat = parentObj->GetMg();
      			Vector spherePos = sphereMat.off;
      			Vector centerPos = Vector(0);
      			Float distance = sqrt(pow(spherePos.x - centerPos.x, 2) + pow(spherePos.y - centerPos.y, 2) + pow(spherePos.z - centerPos.z, 2));
      			GeData setData;
      			distance = distance / 2;
      			if (distance > 50)
      				distance = 50;
      			setData.SetFloat(100 - distance);
      			parentObj->SetParameter(ConstDescID(DescLevel(PRIM_SPHERE_RAD)), setData, DESCFLAGS_SET::NONE);
      		}
      		
      	}
      
      	return EXECUTIONRESULT::OK;
      }
      

      My issue comes in when I have the object with my tag under a Cloner. As I drag the tag's object around the scene all of the cloned spheres are changing their radius based on that single object instead of their cloned positions. Shown below.

      Broken Case.png

      If I make the cloner edititable then the setup is working as I would expect.

      Working Case.png

      Is there a way to make it so that my tag is running after the Cloner has run? In this case 9 separate spheres with attached tags running on their own positions.

      Any help would be greatly appreciated.

      John Thomas

      posted in Cinema 4D SDK 2024 c++ windows
      J
      JohnThomas
    • RE: BitmapButton in Resource file

      @i_mazlov Thanks for the response.

      I tried utilizing the code and I am not getting any response when I try running it.

      John Thomas

      posted in Cinema 4D SDK
      J
      JohnThomas
    • RE: BitmapButton in Resource file

      Any ideas, my GetDParameter is defined with this code.

      Bool ExampleFieldLayer::GetDParameter(const GeListNode* node, const DescID& id, GeData& t_data, DESCFLAGS_GET& flags) const 
      {
      	Int32 ID = id[0].id;
      	if (ID == 1006)
      	{
      		Int32 dirty = 0;
      		maxon::WeakRawPtr<const GeListNode> weakPtr(node);
      		if (weakPtr.Get())
      		{
      			GeListNode* convert = MAXON_REMOVE_CONST(weakPtr.Get());
      			BaseList2D* convertObject = static_cast<BaseList2D*>(convert);
      			BitmapButtonStruct bbs(convertObject, id, dirty);
      			t_data = GeData(bbs, CUSTOMDATATYPE_BITMAPBUTTON);
      			flags |= DESCFLAGS_GET::PARAM_GET;
      		}
      	}
      	return SUPER::GetDParameter(node, id, t_data, flags);
      }
      
      posted in Cinema 4D SDK
      J
      JohnThomas
    • RE: Python: Detect Plugins

      Thanks for the response. I'll see if this does what I need it to

      John Thomas

      posted in Cinema 4D SDK
      J
      JohnThomas
    • RE: Python: Detect Plugins

      @m_adam

      Thanks for the response.

      Going through the code you have the line

      assetDescription = repository.FindLatestAsset(maxon.AssetTypes.NodeTemplate(), assetId, maxon.Id(), maxon.ASSET_FIND_MODE.LATEST)
      

      Looking at the sdk the NodeTemplate for AssetTypes first appears in 2024.2. Is there a way to tell if there is a Maxon One asset in 2023 or is this new functionality that isn't possible in older versions?

      John Thomas

      posted in Cinema 4D SDK
      J
      JohnThomas
    • RE: BitmapButton in Resource file

      Thanks for the response.

      My SetDParamter function is defined with this code.

      Bool ExampleFieldLayer::SetDParameter(GeListNode* node, const DescID& id, const GeData& t_data, DESCFLAGS_SET& flags)
      {
      	switch (id[0].id)
      	{
      		case 1006: // ID_EXECUTERUN 
      		{
      			if (flags & DESCFLAGS_SET::USERINTERACTION)
      			{
      				ApplicationOutput("Running SetDParameter");
      			}
      			break;
      		}
      	}
      	
      	return SUPER::SetDParameter(node, id, t_data, flags);
      }
      

      And at no point am I getting a print from the BitmapButton being pressed.

      John Thomas

      posted in Cinema 4D SDK
      J
      JohnThomas
    • BitmapButton in Resource file

      Hello.

      I'm currently trying to create a FieldLayer plugin that is using a resource file for the creation of its description. Everything is working properly with the exception of a BitmapButton that does not seem to be sending any kind of message that it has been pressed.

      Here is the line from the resource file that I am creating the BitmapButton.

      BITMAPBUTTON ID_EXECUTERUN {BUTTON;}
      

      Inside of Message I Have the MSG_DESCRIPTION_GETBITMAP to set the image for the bitmap.

      if (type == MSG_DESCRIPTION_GETBITMAP)
      	{
      		DescriptionGetBitmap* dgb = static_cast<DescriptionGetBitmap*>(t_data);
      		Int32 ID = dgb->_descId[0].id;
      		AutoAlloc<BaseBitmap> bm;
      		Filename bg;
      
      		
      		if (ID == ID_EXECUTERUN )
      		{
      			bg = GeGetPluginPath() + Filename("res") + Filename("Icons") + Filename("Execute.png");
      
      			bm->Init(bg);
      			AutoAlloc<BaseBitmap> bm2;
      			bm2->Init(bm->GetBw() / 2, bm->GetBh() / 2);
      
      			bm->ScaleIt(bm2, 256, TRUE, TRUE);
      			dgb->_bmp = bm2.Release();
      		}
      		
      	}
      

      There was a forum post that was dealing with the same issue, but the solution offered in the post does not seem to be working. I put prints in both the SetDParameter function as well as the MSG_DESCRIPTION_COMMAND message and neither one is ever being printed, all of the other controls I have are working properly.

      Is there something fundamental that I'm missing that is preventing it from catching that the button is being pressed?

      Any help would be greatly appreciated.

      John Thomas

      posted in Cinema 4D SDK 2024 c++
      J
      JohnThomas
    • RE: Python: Detect Plugins

      Any luck with detecting Maxon One?

      John Thomas

      posted in Cinema 4D SDK
      J
      JohnThomas
    • RE: Python: Detect Plugins

      Any luck with detecting Maxon One?

      John Thomas

      posted in Cinema 4D SDK
      J
      JohnThomas
    • RE: Python: Detect Plugins

      Thanks for the response, the code seems to work as hoped for detecting a plugin.

      Have you had a chance to look into detecting a Maxon One capsule?

      John Thomas

      posted in Cinema 4D SDK
      J
      JohnThomas