• abc exported object names

    Moved Bugs r25 python
    3
    2
    1 Votes
    3 Posts
    935 Views
    S
    super, thanks
  • 0 Votes
    5 Posts
    885 Views
    fwilleke80F
    @jana sorry, I forgot to flag it myself. All solved, thank you
  • Setting texture path to a RS Domelight with python

    Cinema 4D SDK r25 python
    2
    0 Votes
    2 Posts
    1k Views
    ferdinandF
    Hello @Ryan_Territory, Welcome to the Plugin Café forum and the Cinema 4D development community, it is great to have you with us! Getting Started Before creating your next postings, we would recommend making yourself accustomed with our Forum and Support Guidelines, as they line out details about the Maxon SDK Group support procedures. Of special importance are: Support Procedures: Scope of Support: Lines out the things we will do and what we will not do. Support Procedures: Confidential Data: Most questions should be accompanied by code but code cannot always be shared publicly. This section explains how to share code confidentially with Maxon. Forum Structure and Features: Lines out how the forum works. Structure of a Question: Lines out how to ask a good technical question. It is not mandatory to follow this exactly, but you should follow the idea of keeping things short and mentioning your primary question in a clear manner. About your First Question This exact question of yours has been asked before here for C++. Find a Python variant of the code below. For the technical details, I would recommend reading the older thread. Cheers, Ferdinand Result: [image: 1685984571549-557e9ddd-793a-4d07-aa6e-5ffd7ad05687-image.png] Code: import c4d # Define #Orslight, only must be done in pre 2023.0 API versions. c4d.Orslight: int = 1036751 def main(): doc = c4d.documents.GetActiveDocument() # Create Light light = c4d.BaseObject(c4d.Orslight) # Set the attributes light[c4d.REDSHIFT_LIGHT_TYPE] = c4d.REDSHIFT_LIGHT_TYPE_DOME # Define the texture parameter ID. texturePathId: c4d.DescID = c4d.DescID( # 1st DescLevel for the outer unexposed datatype of "Texture". c4d.DescLevel( c4d.REDSHIFT_LIGHT_DOME_TEX0, # The parameter ID (12000) for "Texture" 1036765, # The datatype ID for for "Texture", this type is not exposed, # we must use the raw ID. c4d.Orslight # The creator ID, Orslight in this case. ), # 2nd DescLevel for the inner exposed datatype of "Texture.Path". c4d.DescLevel( c4d.REDSHIFT_FILE_PATH, # The sub-channel parameter ID (1000) for "Texture.Path" c4d.DTYPE_STRING, # The data type ID of this component, string in this case. 0 # The creator ID, I just went with undefined here. )) light[texturePathId] = "asset:///file_c622e9ad3ea0e159" # Insert the light into the scene doc.InsertObject(light) c4d.EventAdd() if __name__=='__main__': main()
  • Getting rid of the burger icon in a dialog

    Cinema 4D SDK r25 c++
    12
    0 Votes
    12 Posts
    2k Views
    fwilleke80F
    Woot, it works!
  • TreeView DropDown Menu

    Cinema 4D SDK
    3
    0 Votes
    3 Posts
    905 Views
    ferdinandF
    Hello @simonator420, Thank you for reaching out to us. As announced here, Maxon is currently conducting a company meeting. Please understand that our capability to answer questions is therefore limited at the moment. I am slightly confused about the nature of your questions, especially in the context of the reply from @mogh. TreeViewFunctions.GetDropDownMenu lets you define the content of drop down menus in a TreeView, and the slightly ill named SetDropDownMenu lets you react to an item being selected in such menu. The 'problem' with your code snippet is that you do not differentiate the drop down gadgets which are set in GetDropDownMenu. Like many methods of TreeViewFunctions it is called for each cell in the tree view table, where lColumn denotes the column as defined in your TreeViewCustomGui.SetLayout call, and obj denotes an item in your root, so sort of the row in the tree. lColumn becomes meaningless when your tree view has only one column of type LV_DROPDOWN. How to make sense of obj, depends on the shape of the data you passed as root. When root root is just a list[object], you could for example alternate between even and odd rows like this. def GetDropDownMenu( self, root: list[object], userdata: any, obj: object, lColumn: int, menuInfo: dict): """Simple example for defining the menu content based on the position of #obj in #root. """ index: int = root.index(obj) if index % 2 == 0: menuInfo["menu"][1000] = "Even row first option" menuInfo["menu"][1001] = "Even row second option" else: menuInfo["menu"][1000] = "Odd row first option" menuInfo["menu"][1001] = "Odd row second option" menuInfo["state"] = int(menuInfo["state"]) In practice, the content of a drop down is more likely to be determined based on the fields of obj (e.g., if obj.a == "foo" then Menu1 else Menu2)rather than its relative position in root (be it a list-like or tree-like data structure). Cheers, Ferdinand
  • Detect CTRL + RightMouseButton in SceneHook

    Cinema 4D SDK r25 c++ 2023
    3
    0 Votes
    3 Posts
    683 Views
    C4DSC
    Thanks for taking the time to respond, even during the weekend. I must say this is quite embarrassing: I already had forgotten about the response in the other thread, and it's not even 3 weeks old. I sincerely apologize for wasting your time with this duplicate thread. I can confirm the GetInputState is working fine, no need to waste more of your time trying it out. Thanks again.
  • PointObject.CalcVertexMap(self, modifier)

    Cinema 4D SDK python r25
    5
    0 Votes
    5 Posts
    906 Views
    A
    @m_adam hi Maxime, thank you for your availability. Bacca's answer immediately cleared my mind on the subject, just as I was reading the other thread. I usually use the traditional method of calculating vertexmaps in the presence of obstacles. I thought CalcVertexMap did just that (the restriction tag is not mentioned in the SDK, so I couldn't figure out how to use it) but my curiosity is just didactic. Ciao Gianluca
  • Removing IsolateObjects document

    Cinema 4D SDK r23 r25 c++ 2023 r20
    3
    0 Votes
    3 Posts
    733 Views
    ManuelM
    hi, yes, KillDocument is not necessary in that case. Cheers, Manuel
  • How to detect CTRL being pressed in a GeDialog

    Cinema 4D SDK r23 r25 2023 c++
    4
    0 Votes
    4 Posts
    1k Views
    C4DSC
    Thanks @m_adam I can confirm that the following does work with R20, R23 and 2023 Int32 MyDialog::Message(const BaseContainer& msg, BaseContainer& result) { BaseContainer keyChannels; if (GetInputState(BFM_INPUT_KEYBOARD, QCTRL, keyChannels)) { Bool ctrlModifier = (keyChannels.GetInt32(BFM_INPUT_QUALIFIER) & QCTRL) != 0;
  • Tree-Generator

    Moved General Talk r25
    8
    1
    0 Votes
    8 Posts
    3k Views
    R
    @love_me_render Thank you very much
  • Keyframing the source file on an ImageTexture shader

    Cinema 4D SDK r25
    3
    0 Votes
    3 Posts
    641 Views
    mocolocoM
    Hi, A simple addition on CTrack and DescId as I was also faced to this a time ago. You can consult the @ferdinand's explanations and exemples on CTrack to the following post : https://developers.maxon.net/forum/topic/14315/solved-how-to-setup-a-ctrack-on-tag-plugin-ui-slider-with-extended-details/8 Cheers, Christophe
  • Set PYP file syntax highlighting in VS Code?

    General Talk r25 python
    4
    0 Votes
    4 Posts
    869 Views
    M
    Btw if you install the Cinema 4D Vs Code extension, pyp extension should be added as Python.
  • Implement A Usage Counter?

    General Talk python r25
    3
    0 Votes
    3 Posts
    597 Views
    B
    @ferdinand Thanks for the pointers. I'll try to look up those options. Will close this thread now.
  • Add Additional Script Path?

    General Talk r25 python
    3
    0 Votes
    3 Posts
    536 Views
    B
    @m_adam Thanks for the response. Modifying the environment varialbles works for my use case. Closing the thread now.
  • Compiling for R20... linker error in maxon::String

    Cinema 4D SDK r20 r25 c++
    5
    0 Votes
    5 Posts
    971 Views
    M
    Hello @fwilleke80 , without further questions or postings, we will consider this topic as solved by Thursday 01/06/2023 and flag it accordingly. Thank you for your understanding, Maxime.
  • Actively Link Hair Guides to a Spline or Alembic?

    Cinema 4D SDK r25 python
    3
    0 Votes
    3 Posts
    582 Views
    B
    Hi @ferdinand Thanks for the response and heads up on the crashes. RE: you want to control hair guide vertices programmatically Yep yep you are right on this part. Basically, have a geometric hair animated and simulated for preview. But rendered on the actual hair object. This is the workflow for other DCC, and the more logical one. This way you separate the hair source and hair generation. It's easier to debug. Anyhow, for looking at your python example, this should get me by on my current use case. Thanks for your illustration as always! Will close thread now.
  • Node Method IsValid() Throws ValueError

    Cinema 4D SDK python r25
    5
    0 Votes
    5 Posts
    454 Views
    B
    @m_adam Gotcha. Thanks for the heads up!
  • Swap Out Joint Axis Rotation?

    Cinema 4D SDK r25 python
    7
    0 Votes
    7 Posts
    600 Views
    B
    @manuel Interesting. Thanks for the heads up. It works now as expected. Closing the thread.
  • 0 Votes
    4 Posts
    694 Views
    B
    @ferdinand Gotcha. Thanks for the clarification and the sample code. Should have probably went for the matrix transforms to begin with. I was hoping I can get away with those euler angles lol. Closing the thread now.
  • MatrixToHPB Not Giving the Global Rotation?

    Cinema 4D SDK r25 python
    3
    1
    0 Votes
    3 Posts
    360 Views
    ferdinandF
    Hello @bentraje, thank you for reaching out to us. There is nothing much left to add for us here. All angle values are represented internally in radians in Cinema 4D, only the UI does convert to degrees. Except for displaying angle values in UIs, I would however recommend to embrace the unit of radians in code rather than converting in and out of it. There is no computional downside to always doing the conversions, e.g., theta: float = c4d.utils.DegToRad(90). But writing something like theta: float = math.pi * .5 forces oneself to understand the intimate relation between a trigangle and the unit circle, i.e., the circle or trigonometric functions. Understanding radians and why it is a useful unit is then an emergent property of that understanding of trigonometry. Cheers, Ferdinand