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. Motion4D
    3. Posts
    M
    • Profile
    • Following 0
    • Followers 0
    • Topics 8
    • Posts 21
    • Best 3
    • Controversial 0
    • Groups 0

    Posts made by Motion4D

    • RE: Placing an effector at specific Index in effector list

      @ferdinand Perfect! that seemed to do the trick. I'm not entirely sure what's going on in that function but it works. I tried different index positions and it threw an error but it works for the zero index and that's all I really needed. Thanks for the help!

      AJ

      posted in Cinema 4D SDK
      M
      Motion4D
    • Placing an effector at specific Index in effector list

      Hi, this is probably an easy question but I'm placing an effector into a cloner and I want to put it in the first position so the cloner reads it first. I see the InExcludeData has the InsertObject() command which always puts the effector in the last position and no option to place at a specific index. Is there a way to specify which index to place the effector?

      posted in Cinema 4D SDK python
      M
      Motion4D
    • RE: Unique Object Identifier

      @zipit thanks for clarifying. Hopefully, there will be something more predictable for IDs in the future.

      posted in Cinema 4D SDK
      M
      Motion4D
    • RE: Unique Object Identifier

      @zipit Hi Ferdinand, it seems I spoke too soon. At first, it seems that the ID stays consistent. But I noticed when you go into the plugin manager and reload a plugin all the IDs change again:(
      It's possible this won't be an issue for users who aren't reloading plugins but there also may be other things that change the ID of all objects.
      Is this a bug perhaps or is there really no guarantee that an ID can stay consistent with an object?

      Thanks!

      Adam

      posted in Cinema 4D SDK
      M
      Motion4D
    • RE: Best Wishes to the team

      @C4DS Thank you to you and all the friendly people that help on this forum! Happy New Year:)

      posted in General Talk
      M
      Motion4D
    • RE: Unique Object Identifier

      @zipit Hi Ferdinand, yes this is exactly what I was looking for. Sorry, I must have missed the other post. Thanks so much for clarifying with the example code:)

      posted in Cinema 4D SDK
      M
      Motion4D
    • Unique Object Identifier

      Hi, I searched around for an answer on this but I haven't found anything solid on how to identify an object based on a unique ID of any kind in python. Isn't there something uniquely consistent with each object we can refer to? I need something I can write out to a file and read back later to reference a specific object.

      Thank you

      posted in Cinema 4D SDK python
      M
      Motion4D
    • RE: Python Effector not working with Fields

      @m_magalhaes @x_nerve Thanks for the update and workaround solutions guys! Hopefully fields can be implemented natively soon!

      posted in Cinema 4D SDK
      M
      Motion4D
    • Python Effector not working with Fields

      Hi, I have some python effector code created in an older version of C4D and it still works and looks great in the viewport on the current version(R23) but it renders in the picture viewer as if there is no falloff. I'm positive this is due to switching to fields from the old way of using falloffs. How do I get the python effector to respect fields?

      I attached the python effector example taken straight from the C4D SDK. It rendered in the picture viewer fine until I upgraded the falloff method to fields and then it renders in the picture viewer with no effect from the falloff? I imagine it has to do with the SetArray command at the end?

      py_effector_shape.c4d

      posted in Cinema 4D SDK r23 python
      M
      Motion4D
    • RE: Changing parameters broken in S22

      @m_adam Thanks for clarifying!

      posted in Cinema 4D SDK
      M
      Motion4D
    • RE: Changing parameters broken in S22

      @m_adam said in Changing parameters broken in S22:

      M

      Thanks! @m_adam it worked but I'm just curious why we needed to specify the fixed clone mode to False?

      posted in Cinema 4D SDK
      M
      Motion4D
    • Changing parameters broken in S22

      Hi, bit of a newb question. When changing a setting on an object this used to work:

      obj[c4d.MG_LINEAR_OBJECT_POSITION,c4d.VECTOR_Y] = 0.0
      

      But now it doesn't, it keeps getting an unexpected type error even though the type should be a float.
      I read the sdk saying to use the "original set method" to avoid type errors but I'm not sure what the original method would be?

      posted in Cinema 4D SDK
      M
      Motion4D
    • RE: Copy shader from one material to another

      Thanks Bach! I knew it was going to be something simple like that.

      posted in Cinema 4D SDK
      M
      Motion4D
    • Copy shader from one material to another

      Hi, I'm trying to copy a shader from one material to another. I know how to set the other material to the same type of shader but I don't know how to copy it exactly? for example if the noise parameters were tweaked on the texture we're copying.
      The code assumes 2 materials are selected for coping the shader.

      #Get the type of shader from 1st Material
      shaderType = c4d.BaseList2D(mat[0][c4d.MATERIAL_LUMINANCE_SHADER].GetType()) 
      
      #Set shader to same type on 2nd
      mat[1].InsertShader(shaderType)
      mat[1][c4d.MATERIAL_ALPHA_SHADER] = shaderType
      
      
      posted in Cinema 4D SDK
      M
      Motion4D
    • RE: Attribute Manager not updating with Tag Selection

      @C4DS Thank your reply! I had to come back to this because I had problems with switching back to object context and this solved that!

      posted in Cinema 4D SDK
      M
      Motion4D
    • RE: Attribute Manager not updating with Tag Selection

      Thank you!
      doc.SetActiveTag() was the key.
      doc.SetSelection() was not switching it over to tag mode.

      posted in Cinema 4D SDK
      M
      Motion4D
    • Attribute Manager not updating with Tag Selection

      I am selecting tags on an object with python and once the selection is set the attribute manager doesn't update with the tag's attributes. It will if you only have any tag selected before the selection but if an object is selected or nothing is selected the attribute manager won't display anything when the tag is selected:/

      Any idea how to get the tag's properties to show up without manually selecting it?

      Here is simplified code to illustrate the issue. If you just make a cube primitive and select it this code will select the phong tag. But again the properties of the phong tag dont show up.

      import c4d
      from c4d import gui
      
      def main():
          obj = doc.GetActiveObject()
          tags = obj.GetTags()
          doc.SetSelection(tags[0])
          c4d.EventAdd()
          
      # Execute main()
      if __name__=='__main__':
          main()
      
      posted in Cinema 4D SDK python
      M
      Motion4D
    • RE: "Signed Integer is greater then maximum" when registering python plugin

      @a_block It was the ID. I did use a random number, apparently one too many. I didn't think it would matter for testing but I guess I was wrong! I figured it would be something dumb like that. It was just weird it pointed me to that line for the error. And yes sorry my code snippet was confusing, I thought it was standard practice to put RegisterObjectPlugin on multiple lines for easier reading.

      Thanks again!

      posted in Cinema 4D SDK
      M
      Motion4D
    • "Signed Integer is greater then maximum" when registering python plugin

      Cinema is complaining about this line of code in my RegisterObjectPlugin function saying "Signed Integer is greater then maximum":

      info=c4d.OBJECT_GENERATOR | c4d.OBJECT_ISSPLINE)

      I even referenced a working spline plugin and it's the same.
      I tried looking the error up and I still have no idea why it thinks this is an issue, any ideas?

      posted in Cinema 4D SDK r20
      M
      Motion4D
    • RE: R20 Script State Function

      @y_puech and @dskeith Thank you both, that is extremely helpful as I didn't see any other documentation on that. I can see how state() could become very dangerous very quickly. I will certainly proceed with caution and hope this will help others will to not abuse the state() function as well:)

      posted in Cinema 4D SDK
      M
      Motion4D