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
    • Login
    1. Maxon Developers Forum
    2. d_schmidt
    3. Posts
    D
    • Profile
    • Following 0
    • Followers 0
    • Topics 38
    • Posts 137
    • Best 2
    • Controversial 0
    • Groups 0

    Posts made by d_schmidt

    • RE: Reading from the Project Settings

      Hi @ferdinand,

      Sorry about missing that post. This exactly solved my problem, thanks.

      Dam

      posted in Cinema 4D SDK
      D
      d_schmidt
    • Reading from the Project Settings

      Hello, I was looking for a way to read some of the Project Settings of a document but I can't figure out the method. I know how to read some of them, the SDK example shown below, but how do I access the latter tabs? I'm struggling to read from the Simulation sub tabs specifically.

        // This example switches the statue of the "Use Generators" setting.
       
        const BaseContainer data = doc->GetData(DOCUMENTSETTINGS::GENERAL);
        const Bool useGenerators = data.GetBool(DOCUMENT_USEGENERATORS);
       
        // set new settings
        BaseContainer settings;
        settings.SetBool(DOCUMENT_USEGENERATORS, !useGenerators);
        doc->SetData(DOCUMENTSETTINGS::GENERAL, settings);
      

      Screenshot 2025-04-04 at 11.40.28 AM.png

      Thanks for the help,
      Dan

      posted in Cinema 4D SDK c++ 2024
      D
      d_schmidt
    • RE: Volume Builder Type Fog Should it be solid?

      Hi @m_adam ,

      Thank you so much! That was exactly what I needed.

      Dan

      posted in Cinema 4D SDK
      D
      d_schmidt
    • Volume Builder Type Fog Should it be solid?

      Hello, I'm using a Volume Builder, with Volume Type Fog and I'm getting some results I didn't expect with the location of the voxels. Would it be expected that the entire Volume would be filled and 'solid' with Fog mode?

      It's not the most elegant test case, but it's the one I can trim down.

      //Get the volume from the volume builder object.
      maxon::Volume       volume = volumeObject->GetVolume();
      maxon::GridIteratorRef<maxon::Float32, maxon::ITERATORTYPE::ON> iterator = maxon::GridIteratorRef<maxon::Float32, maxon::ITERATORTYPE::ON>::Create() iferr_return;
      iterator.Init(volume)iferr_return;
      maxon::Matrix transform = volume.GetGridTransform();
      
      BaseDocument* doc = GetActiveDocument();
      BaseObject* sphere = BaseObject::Alloc(Osphere);
      BaseContainer* con = sphere->GetDataInstance();
      con->SetFloat(PRIM_SPHERE_RAD, 5);
      
      for (; iterator.IsNotAtEnd(); iterator.StepNext())
      {
                      const maxon::IntVector32 coord = iterator66.GetCoords();
                      BaseObject* clone = static_cast<BaseObject*>( sphere->GetClone(COPYFLAGS::NONE, nullptr));
                      clone->SetAbsPos(transform* Vector(coord));
                      doc->InsertObject(clone, nullptr, nullptr);
      }
      

      This code will create a sphere at the location of each active voxel. This was the easiest way I could think of showing the active voxels.

      If I use a cube underneath a Volume Builder and delete away some of the spheres then the hollow inside, which I didn't think would happen with Fog mode.
      Screenshot 2025-02-27 at 4.36.23 PM.png
      Screenshot with the spheres deleted to show the hollow interior.

      Dan

      posted in Cinema 4D SDK c++ 2024
      D
      d_schmidt
    • RE: New Condition Naming in Attribute Manager

      Thank you so much! I couldn't ask for a more thorough response.

      Dan

      posted in Cinema 4D SDK
      D
      d_schmidt
    • New Condition Naming in Attribute Manager

      Hello, I noticed there seemed to be a new 'name' feature with the Condition object.
      Screenshot 2025-01-14 at 4.23.52 PM.png
      Is it possible to make use of it in a plugin?

      'Condition' is just the object's Name, but I can't figure out how 'distance' is set.

      Dan

      posted in Cinema 4D SDK c++ r25
      D
      d_schmidt
    • RE: Volume Builder GetInputObject returns something different?

      Thanks for the info!

      Dan

      posted in Bugs
      D
      d_schmidt
    • RE: Volume Builder GetInputObject returns something different?

      Hi @i_mazlov

      Sorry about the lack of clarity in my post, I managed to trim the case down to something pretty narrow:

      The hierarchy:
      b6f976e8-566f-4c91-a74e-e7b4f763a43f-image.png

      The code:

        BaseObject* firstChild = op->GetDown();
          if(firstChild != nullptr)
          {
              if(firstChild->GetType() == Ovolumebuilder)
              {
                  VolumeBuilder* volumeBuilder = static_cast<VolumeBuilder*>(firstChild);
                  if(volumeBuilder!=nullptr)
                  {
                      Int32 volumeBuilderInputCount = volumeBuilder->GetInputObjectCount(false);
                      BaseObject* volumeChildInput = volumeBuilder->GetDown();
                      
                      if(volumeBuilderInputCount > 0 && volumeChildInput != nullptr)
                      {
                          BaseObject* volumeInputObject = volumeBuilder->GetInputObject(0);
                          if(volumeChildInput == volumeInputObject)
                          {
                              ApplicationOutput("The two inputs are the same.");
                          }
                          else
                          {
                              ApplicationOutput("The two inputs are not the same.");
                          }
                          
                      }
                  }
              }
          }
      

      In most cases it seems like the two objects equal each other, e.g. if the cube is moved. If an Undo is performed after moving the cube, so the Undo returns the cube's position back, then they do not equal each other.

      This is the same circumstance where I'm not able to retrieve the cache from the GetInputObject() object. Would this be expected behavior in this circumstance?

      Dan

      posted in Bugs
      D
      d_schmidt
    • Volume Builder GetInputObject returns something different?

      Hello, I have a circumstance pretty far in my code where I'm using a VolumeBuilder.

      If I have a cube as a child of a VolumeBuilder when I use GetInputObject to retrieve that cube, I'm not able to get the cache from that cube sometimes with GetCache().

      In the same circumstance, if I use GetDown() from the VolumeBuilder, to retrieve that cube, I am able to get the cache from that cube same cube with GetCache().

      Do GetInputObject() and GetDown() behave differently in this circumstance?

      Thanks for the help!
      Dan

      posted in Bugs 2024 c++ macos
      D
      d_schmidt
    • RE: 3d Connector problem after 2024.4 update

      Hi Ferdinand,

      So to be clear, the only thing that can be done with ItemTreeData is adding new objects to it?

      Thanks,
      Dan

      posted in Bugs
      D
      d_schmidt
    • RE: Sampling Redshift Materials

      Hi Ilia,

      At this point this seems a bit over my head, but it seems to be what I need, thanks!

      Dan

      posted in Cinema 4D SDK
      D
      d_schmidt
    • Sampling Redshift Materials

      Hello, I've just started to dive into Redshift materials and I was wondering if there is a way to sample them like a Standard material?

      I've had some success with Standard materials with using BaseShader::Sample() and BaseChannel::Sample() to get the values of specific shaders at given positions. I can't find a similar way to sample a Redshift material.

      Dan

      posted in Cinema 4D SDK 2024 c++ macos
      D
      d_schmidt
    • RE: VariableTag, Resize, and CopyTo

      Hi Ilia,

      I'm on Mac 13.3 and C4D 2024.0.0 at the moment.

      Dan

      posted in Cinema 4D SDK
      D
      d_schmidt
    • RE: VariableTag, Resize, and CopyTo

      Hello, @i_mazlov

      You're exactly right about what I'm trying to achieve. Thanks again for the answers.

      With your code, placed in RoundedTube, seems to work in that the VertrexColorTag is preserved between updates and I can see the tag changes as it's updated.

      I am encountering an issue where if I increasing and decreasing Rotation Segments I'll occasionally get a crash. Sometimes the crash is pointing to this line: "CheckState(pKernel->Commit());" but other times I'm not getting a particular crash location. Do you encounter this issue?

      Then, when I implement your fix into my code, everything seems to be working well, until I shrink down the number of points I have. When increasing the number of points it seems like the VertexColorTag is increasing up correctly but when I scale decrease the number of points it will crash occasionally. This isn't tied to the above crash, since I'm not using Modeling in my code. Would any tweaks need to be done to the code to handle shrinking point counts?

      Dan

      posted in Cinema 4D SDK
      D
      d_schmidt
    • RE: VariableTag, Resize, and CopyTo

      @i_mazlov

      From my current testing it seems like CopyTo() 'work', in so far as the data is copied, but it seems to break all existing Links to the existingVertexColor VertexColorTag. Would there be a way to preserve the links?

      Dan

      posted in Cinema 4D SDK
      D
      d_schmidt
    • RE: VariableTag, Resize, and CopyTo

      Hi @i_mazlov
      I'm currently using CopyTagsTo(), to copy the tag from the object to the cache. The problem with the methodology is that if I'm linking to the VertexColorTag externally, that deleting it and creating a new tag would break that link.

      That's where I was left at this point:

      PolygonObject* myGeometry = PolygonObject::Alloc(polygonCount,pointCount);
      
      //create geometry 
      
      VertexColorTag* existingVertexColor = static_cast<VertexColorTag*>(op->GetTag(Tvertexcolor));
      if(vertexColorTag == nullptr)
      {
        existingVertexColor = VertexColorTag::Alloc(pointCount);
        op->InsertTag(existingVertexColor);
      }
      if(pointCount != oldPointCount)
      {
         VertexColorTag* largerVertexColor  = VertexColorTag::Alloc(pointCount);
      
         //fill in color data for the new tag, then copy it to the existing tag
      
        largerVertexColor->CopyTo(existingVertexColor, COPYFLAGS::NONE, nullptr);
      
      
      }
      else
      {
           //fill in color data for existingVertexColor
      }
      op->CopyTagsTo(myGeometry, true, true, false, nullptr);
      

      The problem I was encountering here is that CopyTo() doesn't seem to be copying the data from the new correct larger tag to the smaller existing one.

      Should CopyTo() work here?

      Dan

      posted in Cinema 4D SDK
      D
      d_schmidt
    • RE: VariableTag, Resize, and CopyTo

      I'm also confused by what you meant here.

      @i_mazlov said in VariableTag, Resize, and CopyTo:

      How are you going to use this color data? VertexColorTag works with polygon objects, so having it on the op (the actual object that user sees in c4d) doesn't make too much sense, as it can neither be modified with the painting tool (because it sits on your plugin object, not on polygon object) nor can it be displayed (the same reason).

      Screenshot 2024-02-05 at 12.09.50 PM.png
      Screenshot 2024-02-05 at 12.09.55 PM.png

      The VertexColorTag data can be displayed in this case. If I have the tag selected the black to white gradient is being displayed in the viewport.

      posted in Cinema 4D SDK
      D
      d_schmidt
    • RE: VariableTag, Resize, and CopyTo

      Does this provide the needed context or would more details be helpful?

      Dan

      posted in Cinema 4D SDK
      D
      d_schmidt
    • RE: VolumeBuilder Cache and AddDependence()

      Hi Illia,

      I haven't been able to properly stress test the new code, but by the first look it seems to be working. Thanks!

      Dan

      posted in Cinema 4D SDK
      D
      d_schmidt
    • RE: VariableTag, Resize, and CopyTo

      Hi Ilia, baca
      Thanks for the reply.

      Thanks for the example code! Is there a manual for the Modeling kernel? I took a look in the SDK but didn't see one. Would it always be better to use that approach for creating geometry?

      Here's my current setup.

      For more context on what I'm trying to achieve, this is my hierarchy: Screenshot 2024-01-11 at 11.56.04 AM.png

      "My Point Generator" is returning a series of points, a polygon object with only points, no polygons. I'm adding a Vertex Color Tag to the plugin, and copying it to my cache. Right now with the colors being random.

      Then "My Point Generator" is being given to the Cloner, for the point locations. The Vertex Color Tag is put in the Field list for the Plain effector and then the Plain Effector is given to the Cloner to pass the color data on.
      Right now that is working and resulting in this:

      Screenshot 2024-01-11 at 11.54.49 AM.png

      Dan

      posted in Cinema 4D SDK
      D
      d_schmidt