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
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Register
    • Login
    1. Home
    2. pchg
    3. Posts
    P
    • Profile
    • Following 0
    • Followers 0
    • Topics 12
    • Posts 29
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by pchg

    • RE: How to Swap location in Object Manager

      @ferdinand Thank you very much for your reply

      posted in Cinema 4D SDK
      P
      pchg
    • How to Swap location in Object Manager

      Hello colleagues, I used C++ to write the C4D S26 plugin on Windows 10. Swap the positions of 2 and 10 in the Object Manager. I cannot find the relevant API.
      777.png
      888.png

      BaseDocument* doc = GetActiveDocument();
      Int32 count = selection->GetCount();
      AutoAlloc<AtomArray> selection;
      doc->GetActiveObjects(selection, GETACTIVEOBJECTFLAGS::CHILDREN);
      BaseObject* obj_2 = static_cast<BaseObject*>(selection->GetIndex(count - obj_10));
      BaseObject* obj_10 = static_cast<BaseObject*>(selection->GetIndex(count - obj_2));
      

      What should we do next?Thanks in advance!

      posted in Cinema 4D SDK c++ s26 windows
      P
      pchg
    • RE: How to modify the index

      @ferdinand Thank you for your reply

      posted in Cinema 4D SDK
      P
      pchg
    • How to obtain the color of each ball in each frame

      Hello colleagues, I used C++ to write the C4D S26 plugin on Windows 10, This is an animation, How to obtain the color of each ball in each frame, Colors are set in a Linear Field.Thanks in advance!
      444.png
      555.png
      666.png

      posted in Cinema 4D SDK s26 windows c++
      P
      pchg
    • How to modify the index

      Hello colleagues, I used C++ to write the C4D S26 plugin on Windows 10, How can I modify the index of these cubes.what should I do?
      111.png

      posted in Cinema 4D SDK s26 c++ windows
      P
      pchg
    • RE: How to preserve the animation of a sphere

      @i_mazlov thank you very much

      posted in Cinema 4D SDK
      P
      pchg
    • RE: How to preserve the animation of a sphere

      @i_mazlov Thanks for your explanation. How to use code to execute the "Select Connected" command and loop through all points. I have obtained all the points now, but I don't know how to execute the "Select Connected" command for each point

      BaseObject* obj = doc->GetActiveObject();
      PointObject* pointObj = static_cast<PointObject*>(obj);
      Int32 pointCount = pointObj->GetPointCount();		
      Vector* points = pointObj->GetPointW();
      
      
      posted in Cinema 4D SDK
      P
      pchg
    • RE: How to preserve the animation of a sphere

      @i_mazlov Or is there a way to preserve the animation after using MCOMMAND_EXPLODESEGMENTS

      posted in Cinema 4D SDK
      P
      pchg
    • RE: How to preserve the animation of a sphere

      Thanks @i_mazlov I wrote a plugin that would read the coordinates of every sphere in every frame and then output, and get all frame coordinates of all spheres to the user

      posted in Cinema 4D SDK
      P
      pchg
    • How to preserve the animation of a sphere

      Hello colleagues, I used C++ to write the C4D S26 plugin on Windows 10, I import .abc and want to explode this file, but I found using SendModelingCommand()that the sphere animation disappeared, what should I do?
      111.png
      333333.png

      BaseDocument* doc = GetActiveDocument();
      BaseObject* activeObject = doc->GetActiveObject();
      if (!activeObject)
      	return break;
      ModelingCommandData mcd;
      mcd.doc = doc;
      mcd.op = activeObject;
      const bool result = SendModelingCommand(MCOMMAND_EXPLODESEGMENTS, mcd);
      if(result)
      {
      	EventAdd();
      }
      

      Although I got all the spheres, all the sphere animation was lost, Thanks in advance!

      posted in Cinema 4D SDK s26 c++ windows
      P
      pchg
    • RE: How to get sphere coordinates

      @i_mazlov Thanks

      BaseObject* activeObject = doc->GetActiveObject();
      if (!activeObject)
      	return break;
      ModelingCommandData mcd;
      mcd.doc = doc;
      mcd.op = activeObject;
      const bool result = SendModelingCommand(MCOMMAND_EXPLODESEGMENTS, mcd);
      if(result)
      {
      	EventAdd();
      }
      

      Although I got all the spheres, all the sphere animation was lost, What should I do?

      posted in Cinema 4D SDK
      P
      pchg
    • RE: How to get sphere coordinates

      Thanks @i_mazlov
      I want to get the coordinate information of all spheres under this editable object

      BaseDocument* doc = GetActiveDocument();
      BaseObject* obj = doc->GetActiveObject();
      ModelingCommandData mcd;
      mcd.doc = doc;
      mcd.op = obj;
      const bool result = SendModelingCommand(MCOMMAND_EXPLODESEGMENTS, mcd);
      

      Wrong result, result = false, or whether it should be done

      const bool result = SendModelingCommand(MCOMMAND_CURRENTSTATETOOBJECT, mcd);
      BaseObject* res = static_cast<BaseObject*>(mcd.result->GetIndex(0));
      while (res != nullptr)
      {
      Vector points = res ->GetAbsPos();
      res = res -> GetNext();
      }
      

      but only one coordinate

      posted in Cinema 4D SDK
      P
      pchg
    • RE: How to get sphere coordinates

      Thanks in advance!

      posted in Cinema 4D SDK
      P
      pchg
    • How to get sphere coordinates

      Hello colleagues, I used C++ to write the C4D S26 plugin on Windows 10, I import .abc and want to get the center point coordinates of each sphere, not the vertex coordinates

      BaseObject* obj = doc->GetActiveObject();
      PointObject* pointObj = static_cast<PointObject*>(obj);
      Int32 pointCount = pointObj->GetPointCount();		
      Vector* points = pointObj->GetPointW();
      const ::Matrix globalMtx = pointObj->GetMg();
      for (Int32 i = 0; i < pointCount; ++i)
      {
        Vector site = pointObj->GetMg() * points[i];
        GePrint("Frame " + String::IntToString(count) + ": " + String::VectorToString(site));
      }
      

      111.png
      2222.png

      posted in Cinema 4D SDK s26 c++ windows
      P
      pchg
    • How to Get cloner data in C++

      I used C++ to write the C4D S26 plugin on Windows 10, I used cloner function to animate, How to get the coordinates and color information of all spheres. Thanks in advance!
      12333.png

      posted in Cinema 4D SDK s26 c++ windows
      P
      pchg
    • RE: How to change the color of shaded wire in C++

      @i_mazlov Thank you for your reply

      posted in Cinema 4D SDK
      P
      pchg
    • How to change the color of shaded wire in C++

      I used C++ to write the C4D S26 plugin on Windows 10, I want to change the color of the shaded wire, But don't know how to do it. Thanks in advance!
      31ba2da7-4a33-4125-a100-9d3b61c183a0-image.png

      posted in Cinema 4D SDK s26 c++
      P
      pchg
    • RE: How to obtain the selection order of objects in C++

      @spedler Thank you for your help

      posted in Cinema 4D SDK
      P
      pchg