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. JH23
    3. Topics
    • Profile
    • Following 7
    • Followers 0
    • Topics 12
    • Posts 46
    • Best 1
    • Controversial 0
    • Groups 0

    Topics created by JH23

    • JH23J

      lhit from BaseVolumeData

      Cinema 4D SDK
      • r21 python windows • • JH23
      3
      0
      Votes
      3
      Posts
      515
      Views

      JH23J

      Hey @m_adam,
      Thanks for the reply! What you’re saying makes a lot of sense C++ is clearly the better option for this kind of stuff, especially when you need more control and better performance. I haven’t had much chance to dive into C++ yet, but I’m well aware it’s way more powerful than Python when it comes to working with the engine.
      It’s a bit of a shame that there’s no way to directly access polygon info from Python, since that’s exactly what I needed. But still, I really appreciate you taking the time to explain it.
      Cheers,
      James H.

    • JH23J

      access the layers in the shader layer

      Cinema 4D SDK
      • python • • JH23
      10
      0
      Votes
      10
      Posts
      2.0k
      Views

      JH23J

      Hi @i_mazlov ,
      This solves my problem, for now I don't think I have another question, and I could consider my problem solved, thanks.
      cheers,
      James H.

    • JH23J

      update error?

      Cinema 4D SDK
      • r20 python • • JH23
      10
      0
      Votes
      10
      Posts
      2.3k
      Views

      JH23J

      I want to finish with this in case someone reads it. Years ago, I asked about the outdated methods when using these techniques. I tried to adjust the depth of the IK spline controls with the actual length of the spline itself. Today, I understand my mistake, as I was trying something that didn’t make logical sense. At the time, I thought it was the best option for what I was looking for.

      In short, this was never a problem, and the low response time is normal because the length depends on the depth of the controls. I thought there would be a solution, but choosing this path was not useful.

      In conclusion, what eventually satisfied my requirements was directly referencing the angles of the controls, meaning identifying how oriented each control is to another. I took this angle and used it as a factor to multiply by the depth. This model is much more logical and doesn’t have any flaws. At the time, I couldn’t think of a direct solution, but I didn’t want to leave this post like that. Thanks anyway, Ferdinand, for trying to help me.
      Cheers
      JH

    • JH23J

      Is it possible to change the mode of the Viewport without callcommands?

      Cinema 4D SDK
      • r20 python • • JH23
      6
      0
      Votes
      6
      Posts
      969
      Views

      ferdinandF

      Hello @JH23,

      without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022.

      Thank you for your understanding,
      Ferdinand

    • JH23J

      import presets and be reversible

      Cinema 4D SDK
      • r20 python • • JH23
      6
      0
      Votes
      6
      Posts
      857
      Views

      ferdinandF

      Hello @JH23,

      without any further questions or postings, we will consider this thread as solved by Friday the 4th, February 2022.

      Thank you for your understanding,
      Ferdinand

    • JH23J

      preset children of objects?

      Cinema 4D SDK
      • • • JH23
      5
      0
      Votes
      5
      Posts
      674
      Views

      JH23J

      Hi
      Thank you for solving my question, and thank you very much also for the advice.

    • JH23J

      create a material with a set texture?

      General Talk
      • r20 python • • JH23
      3
      0
      Votes
      3
      Posts
      704
      Views

      JH23J

      Hi.
      Oh I understand, thanks for your answer, it has helped me a lot.

    • JH23J

      create a cube that disappears when you return?

      Cinema 4D SDK
      • • • JH23
      10
      0
      Votes
      10
      Posts
      1.4k
      Views

      ferdinandF

      Hello @JH23,

      without any further questions or postings, we will consider this topic as solved by Wednesday and flag it accordingly.

      Cheers,
      Ferdinand

    • JH23J

      How to create a material with the selected object as assigned?

      General Talk
      • r20 python • • JH23
      4
      0
      Votes
      4
      Posts
      768
      Views

      ferdinandF

      Hello @JH23,

      without further questions or postings, we will consider this topic as solved by Wednesday and flag it accordingly.

      Thank you for your understanding,
      Ferdinand

    • JH23J

      problema de regreso de código de gestor de scripts

      General Talk
      • • • JH23
      3
      0
      Votes
      3
      Posts
      665
      Views

      JH23J

      Excuse me, I thought I translated it was my mistake, and in the same way, thank you for your help.

    • JH23J

      How to create a child from the script manager?

      General Talk
      • r20 python • • JH23
      8
      0
      Votes
      8
      Posts
      1.1k
      Views

      ferdinandF

      Hello @JH23,

      first, I would like to point out that we ask the community here to post separate questions into separate postings, so that other users can find more easily answers when searching the forum. You can read more about the procedures of SDK support in our Forum Guidelines. It is okay in this case, but for future cases we have to ask you to open new topics for follow-up questions that are not directly related to the initial question of the topic (thread).

      About your question - you have two options when you want to make an object editable:

      In case you already have the object in question already inserted into the active document and are in the main thread, you can still use CallCommand. For CallCommand you have to keep in mind that it usually relies on an object selection. When running it in a script, you have then make sure that actually the objects you want to be affected are selected when you do run the CallCommand. I have provided an extension of my prior example at the end of this posting. In all other cases, i.e., when the object is either in no document or not in the active one, or you are not on the main thread, then you must use c4d.utils.SendModelingCommand Link. In this case for example for the command MCOMMAND_MAKEEDITABLE. You can find more information about that in our SDK documentation and in the code examples on GitHub.

      Cheers,
      Ferdinand

      Example code:

      import c4d def main(): # Assuming you want to use a CallCommand, you can do this. In practice # instantiating a cube object is better done in the way shown by Cairyn # in the forums. # The CallCommand for creating a cube object which will also insert and # select the cube. c4d.CallCommand(5159) # Get the currently active object; which is the new cube object due to the # prior CallCommand. The function object() created by the script log, and # used in your code, does effectively something similar. But it has the # overhead of retrieving the active object each time it is being called, # which is not necessary here. # In a script environment there are also the predefined attributes op and # doc, "variables" in non-Python terms. op is the currently active object # when the script is being run and doc the currently active document. # We cannot use op here, since the CallCommand just did change that, but # we can use doc, which we could retrieve also manually if we had to via # c4d.documents.GetActiveDocument(). cube = doc.GetActiveObject() # Set some of the parameters of that cube object. cube[c4d.ID_BASELIST_NAME] = "Cube" cube[c4d.PRIM_CUBE_LEN, c4d.VECTOR_X] = 32 cube[c4d.PRIM_CUBE_LEN, c4d.VECTOR_Y] = 32 cube[c4d.PRIM_CUBE_LEN, c4d.VECTOR_Z] = 32 cube[c4d.PRIM_CUBE_SUBX] = 11 cube[c4d.PRIM_CUBE_SUBY] = 11 cube[c4d.PRIM_CUBE_SUBZ] = 11 # Instantiate manually a cone object and insert it under that cube, i.e., # do it like Cairyn has shown it. cone = c4d.BaseObject(c4d.Ocone) # We can also set the name of a node like this, which is a bit easier to # remember than the ID. cone.SetName("Cone") # Set some parameters of the cone. You can find out parameter ids via # drag and drop and the console, read more about it here: # developers.maxon.net/docs/Cinema4DPythonSDK/html/misc/descriptions.html cone[c4d.PRIM_CONE_HEIGHT] = 32 cone[c4d.PRIM_CONE_BRAD] = 16 cone[c4d.ID_BASEOBJECT_REL_POSITION, c4d.VECTOR_Y] = 32 # Create a phong tag for the cone, so that the cone is being shaded nicely. phongTag = cone.MakeTag(c4d.Tphong) # Enable the angle limit of the phong tag. phongTag[c4d.PHONGTAG_PHONG_ANGLELIMIT] = True # Insert the cone under the cube. cone.InsertUnder(cube) # When we are doing things "manually", i.e., do not use CallCommand, we # have to push an update to Cinema 4D after we have modified the scene # graph. c4d.EventAdd() # Make the cube object the new active selection. doc.SetActiveObject(cube, c4d.SELECTION_NEW) # And run the " Make Editable" CallCommand on that c4d.CallCommand(12236) # Make Editable if __name__ == '__main__': main()
    • JH23J

      How to delete obj in the environment from a button in userdata

      Cinema 4D SDK
      • r20 python • • JH23
      4
      0
      Votes
      4
      Posts
      720
      Views

      ferdinandF

      Hello @JH23,

      without any further feedback or questions, we will consider this topic as solved by Wednesday and flag it accordingly.

      Thank you for your understanding,
      Ferdinand