• VC_FLAGS

    Cinema 4D SDK 2024 python 2023
    2
    0 Votes
    2 Posts
    449 Views
    M
    Hi @baca VC_SAFETY has been removed in 2023.1, you do not need it anymore, since the message can't fail anymore. You should keep it for old code but for new code, just leave the vc_flags empty will be enough. Cheers, Maxime.
  • Access to the coordinate manager.

    Cinema 4D SDK 2023 python windows
    3
    1
    0 Votes
    3 Posts
    830 Views
    S
    @ferdinand Thank you very much for the expanded object.
  • HtmlViewerCustomGui issue

    Cinema 4D SDK 2023 python
    3
    0 Votes
    3 Posts
    600 Views
    PoliigonP
    Bummer. But thanks, Maxime, for the quick reply.
  • 0 Votes
    3 Posts
    937 Views
    H
    Hi @ferdinand, thanks for taking the time to clarify that Okay, I see. So one can view this "behavoiur" as intended since it is the result of the math behind how the circle spline is calculated? Still I wonder why the circle spline primitive with 1 intermediate point, i.e. with four control points doesn't appear like the n-side spline with 8 sides? Wouldn't it be "cleaner" that way? Regading the true values - I am well aware that the repr of c4d.Vector rounds in the GUI. It was only that those values were quite off compared to the values of the points of the n-side spline. That's why my initial question arose. Interesting and good to know that rotating points via sine and cosine is slow and no good option. Thank you for that insight. May I ask why that is? I mean why is c4d.utils.MatrixRotZ better? What does that function do differently in terms of performance? In the end it has to do the math as well, does it not? Sorry for constantly asking all this stupid questions. It is only that I want to understand these things thoroughly. Thanks for your time, Sebastian
  • 0 Votes
    4 Posts
    902 Views
    K
    I found the AddPorts() Method,Sorry I missed it before. from typing import Optional import c4d import maxon doc: c4d.documents.BaseDocument # The active document op: Optional[c4d.BaseObject] # The active object, None if unselected def main() -> None: material = doc.GetActiveMaterial() nodeMaterial = material.GetNodeMaterialReference() graph: maxon.GraphModelInterface = nodeMaterial.GetGraph(c4d.GetActiveNodeSpaceId()) with graph.BeginTransaction() as transaction: layered_node = graph.AddChild(maxon.Id(),"com.chaos.vray_node.texlayeredmax") layers = layered_node.GetInputs().FindChild("com.chaos.vray_node.texlayeredmax.texture_layers") #The Layers portbundle layers.AddPorts(2, 1) #Add layers transaction.Commit() #Layer in Layers portbundle layers_list = [] layers.GetChildren(layers_list,maxon.NODE_KIND.INPORT) #Textureports and BlendMode_ports in Layers portbundle layers_texport_list = [tport for port in layers_list if (tport := port.FindChild("com.chaos.vray.portbundle.texture_layer.texture"))] layers_mode_list = [mport for port in layers_list if (mport := port.FindChild("com.chaos.vray.portbundle.texture_layer.blend_mode"))] print(layered_node) print(layers) print(layers_list) print(layers_texport_list) print(layers_mode_list) if __name__ == '__main__': main()
  • 0 Votes
    2 Posts
    728 Views
    ferdinandF
    Hey @LingZA, Thank you for reaching out to us. There are multiple questions in this topic, which always makes things tricky to answer. Is there any way to stop MMB wheel to zoom the camera? I need to scroll the MMB wheel in the viewport to change my tool's params? Is there any way to get MMB wheel scrolling in viewport? In general, Cinema 4D has no input device control & emulation layer, so you cannot intercept an input device from sending (stop the mouse wheel to zoom) or emulate inputs (get the mouse wheel scrolling). You can get the state of an input device. For MMB that would be the GUI message BFM_INPUT with BFM_INPUT_DEVICE being BFM_INPUT_MOUSE and BFM_INPUT_CHANNEL being BFM_INPUT_MOUSEMIDDLE. When you fail to read BFM_INPUT_MOUSEMIDDLE in your plugin, please share executable code, so that we can reproduce the problem. When necessary, you can send code confidentially to us via sdk_support(at)maxon(dot)net. Cheers, Ferdinand
  • use existing Catmull Clark algorithm

    Cinema 4D SDK python c++ 2024
    14
    0 Votes
    14 Posts
    3k Views
    ferdinandF
    Hey @CJtheTiger, yes, we disabled Ask as question because it was a lot of extra work for us to maintain because 60%-80% of users set their topics never as solved. Cheers, Ferdinand
  • Get & Set Active Camera for a specific viewport

    Cinema 4D SDK python
    4
    0 Votes
    4 Posts
    1k Views
    ferdinandF
    Hey @Thodos, without the console output of your browser, I cannot say much. I suspect that a DNS is failing. In the meantime, here are the offline docs. Cheers, Ferdinand
  • Which DisplayFilter affects ToolData.draw

    Cinema 4D SDK 2023 2024 s26 python
    3
    0 Votes
    3 Posts
    682 Views
    gheyretG
    Hi @ferdinand , I'm sorry that my title and description may be a little confused, maybe I misunderstood something and thought a little complicated. And thank you very much for your answer, you always help me when my thinking is confused. Cheers! Gheyret
  • 0 Votes
    3 Posts
    995 Views
    G
    This is an excellent explanation , thank you.
  • HideElement in Cinema 4D 2024

    Cinema 4D SDK 2024 python
    4
    2
    0 Votes
    4 Posts
    896 Views
    DunhouD
    Yes @simonator420 , it worked in 2023, and not worked any more in 2024, I also found that strange behavior in HideElement() and confused me for a while.
  • Get value of texture node filepath port?

    Cinema 4D SDK 2024 python
    3
    1
    0 Votes
    3 Posts
    1k Views
    B
    Oh wow! Thank you so much! Yes I'm a beginner with python cinema 4D so I really appreciate your support and this definitly gives me a better understanding of the node structure.
  • 0 Votes
    6 Posts
    3k Views
    i_mazlovI
    Hi @gsmetzer, please have a look at the related thread (How to get the bounding box for the whole scene) where your issue was explained in details by @ferdinand @ferdinand said in How to get the bounding box for the whole scene: a BaseObject will also not include its descendants in its bounding box computation So, one must carry out such computations oneself Cheers, Ilia
  • 0 Votes
    14 Posts
    3k Views
    M
    Hi thanks a lot for your report, the issue regarding Reloading Python Plugin not working as expected have been fixed in 2024.2. Cheers, Maxime.
  • Print Custom User data to text doc

    Cinema 4D SDK python
    6
    1
    0 Votes
    6 Posts
    1k Views
    ferdinandF
    Hey @apetownart, Thank you for sharing your solution, much appreciated! I have fenced in your code with a code block so that it is a bit more readable and has a copy button. Find out how to do that yourself in our Forum Markup documenation. Cheers, Ferdinand
  • 0 Votes
    2 Posts
    750 Views
    ferdinandF
    Hello @Aeoll-0, Thank you for reaching out to us. You should be a bit more specific about the circumstances and which you are using the command. As declared in our Support Guidelines, you should always post executable code, as we are otherwise are guessing what you are doing. The self.filedir implies that this happens in a method, which in turn could mean that you are trying to do this off-main-thread. This is not allowed. I also gave it a spin myself, and for me it works. Note that after the operation, the opened file is not the old file anymore. So, when you had a \data\a\myfile.c4d and saved to backup\a\, the opened file will be backup\a\myfile.c4d and not \data\a\myfile.c4d. Because of that, such newly "exported" documents will also induce thumbnail rendering. When you are trying to save many documents at once in this manner, the thumbnail rendering could make Cinema unresponsive. The path into which you want to dump things must also exist, Cinema 4D cannot create it for you. I have tested this in 2023.2.2 and 2024.1.0 and found no problems in both versions. Cheers, Ferdinand Result: [image: 1699977932661-34f18c02-cc1d-42ef-94ac-d50f2ad57195-image.png] Successfully saved project to: 'e:\projects\foo\', exporting the assets: [{'filename': 'e:\\projects\\foo\\myfile.c4d', 'assetname': 'myfile.c4d', 'channelId': 0, 'netRequestOnDemand': False}, {'filename': 'e:\\projects\\foo\\tex\\Maxon-Computer-Logo.jpg', 'assetname': 'E:\\temp\\Maxon-Computer-Logo.jpg', 'channelId': 0, 'netRequestOnDemand': True}]. Code: import c4d import os doc: c4d.documents.BaseDocument # The active document def main() -> None: """ """ # Cinema 4D cannot create the directory path for us, we must ensure that #path does exist. path: str = "e:\\projects\\foo\\" if not os.path.exists(path): os.makedirs(path) # Your settings. flags: int = (c4d.SAVEPROJECT_ASSETS | c4d.SAVEPROJECT_SCENEFILE | c4d.SAVEPROJECT_USEDOCUMENTNAMEASFILENAME) data: list = [doc, flags, path, [], []] # Invoke the command and raise errors on failure or missing assets. if not c4d.documents.SaveProject(*data): raise IOError(f"Could not save project to: '{path}'.") if data[4]: raise IOError(f"Failed to export the following assets: {data[4]}") # Success :) print (f"Successfully saved project to: '{path}', exporting the assets: {data[3]}.") if __name__ == '__main__': main()
  • Frame All command on Spline User Data

    Cinema 4D SDK python 2023
    8
    1
    0 Votes
    8 Posts
    2k Views
    i_mazlovI
    Hi Gabriel, Sorry for the delay in this thread. Unfortunately you cannot control this folding GUI functionality as it is sealed to the non-public GUI implementation. That would not be the case when using custom GUI implementations. Cheers, Ilia
  • Access values of an RS material in Python?

    Cinema 4D SDK python
    2
    0 Votes
    2 Posts
    772 Views
    J
    Hello @ryanjp, 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 We were not sure to which RS material type you are referring - Xpresso based RS material or the RS node material. Here are informations for both: Node API Python examples, mostly focusing on material nodes: https://github.com/PluginCafe/cinema4d_py_sdk_extended/tree/master/scripts/05_modules/node Example for a general pattern for writing an "material converter", here at the example of mapping material models in the RS Xpresso system to the standard material model space. https://developers.maxon.net/forum/topic/14753/script-that-converts-redshift-materials-back-to-c4d-standard-ones/20 Note: In 2024 Redshift renamed all attributes in its legacy material type RS C4D Shader, with the result that the MAPPINGS data defined in the script is incorrect now. While one can easily update the mappings, many ports are just named Color now. You either have to use IDs in the meantime or wait for the update which fixes this port naming issue. Cheers Jana
  • Create Xpresso Python node

    Cinema 4D SDK python 2024
    3
    0 Votes
    3 Posts
    745 Views
    B
    WOW!!! It turns out that there is a node specifically for python. But in the documentation, in the list GV Node Types, it is not indicated. This fact forced me to look for workarounds. Thanks for the help
  • Failed to Connect to Cinema 4D, with port: 7788

    Cinema 4D SDK python 2023 2024
    3
    0 Votes
    3 Posts
    923 Views
    RenatoTR
    ah! Thanks a lot!