• 0 Votes
    4 Posts
    1k Views
    M
    Hi just to let you know that the bug has been fixed, this will be available in one of the next releases. I will post on this topic once the fix is available. Cheers, Maxime.
  • 0 Votes
    6 Posts
    2k Views
    i_mazlovI
    Hi @qq475519905, You issue is likely a bug in the material export code, I've created a ticket (ITEM#530704) in our internal bug tracking system. Thank you for reporting the issue! Cheers, Ilia
  • ToolData Linkbox does not retain object when one is dragged in.

    Moved python
    7
    0 Votes
    7 Posts
    2k Views
    B
    Blah! Bummer. Seemed like a bug to me. I guess I will just convert this to a CommandData plugin and use GeDialog.
  • Volume Builder GetInputObject returns something different?

    Moved 2024 c++ macos
    5
    0 Votes
    5 Posts
    1k Views
    D
    Thanks for the info! Dan
  • Particles and RenderDocument

    Moved c++ 2024
    12
    0 Votes
    12 Posts
    3k Views
    ferdinandF
    Hey @peter_horvath, Just as an FYI, you are currently limited by the issues lined out in the video, i.e., you will have to use LoadFile at the moment to get a meaningful particle simulation (or let the document be cloned by RenderDocument). The Simulation team has already fixed that issue, it will be delivered with the next major release of Cinema 4D, i.e., 2025.0.0. In case you want to test that fix, I would recommend moving this discussion over to the beta forum. Cheers, Ferdinand
  • 2024.4.0 crashes when setting key-values

    Moved 2024 python windows
    5
    0 Votes
    5 Posts
    2k Views
    M
    Hi @ThomasB, sorry for the issue. This is going to be fixed in the next version of Cinema 4D. With that's said you can workaround the issue by using directly SetParameter like so: # key[c4d.ID_CKEY_PRESET] = 2 key.SetParameter(c4d.DescID(c4d.ID_CKEY_PRESET), 2, c4d.DESCFLAGS_SET_NONE) Thanks for the report ! Cheers, Maxime.
  • Browsing field layers causes dangling/not alive references

    Moved 2024 python
    4
    0 Votes
    4 Posts
    1k Views
    ferdinandF
    Hey @baca, feel free to send us a mail to sdk_support(at)maxon(dot)net in case you cannot share code publicly. But we have to have a look at your code to see what is going on. When you say this worked before, we either have a soft regression (you did something which you should not but it somehow worked and we now broke that) or a strong one (we broke something that should work) on our hands. And for that we will need code to see what is going on. And I would not say that the performance penalty is dramatic, it more likely will be neligable. But if everyone would do that everywhere, Cinema 4D would come to a crawl. I would say you can ship your plugin with that "fix" when it does not cause any issues for you. But we should work towards solving this properly. Cheers, Ferdinand
  • issue with inserting fieldlayers in r2024

    Moved windows python 2024
    4
    0 Votes
    4 Posts
    1k Views
    M
    Hey thanks for the report, I indeed fix one issue with the InsertLayer but in your case it was another one, sadly there is no workaround for you (except the one you found). The fix will be provided in the next release. Cheers, Maxime.
  • 0 Votes
    3 Posts
    947 Views
    T
    Hi Adam, thanks for the update and the workaround!
  • 0 Votes
    5 Posts
    1k Views
    B
    Awesome, Thank you so much @m_adam ! Cheers and best regards Ben
  • 0 Votes
    2 Posts
    632 Views
    ferdinandF
    Hey @JACK0319, thank you for reaching out to us and reporting this. You are right, up is incorrect and upvector is the correct keyword. I fixed this and double checked the other keywords for the next upcoming Python documentation release. Cheers, Ferdinand
  • 0 Votes
    4 Posts
    1k Views
    ferdinandF
    @datamilch said in Calling BaseDocument.SetMode twice in a row leads to freezes: always had the feeling, that i could print feedback while it is running That is a misconception many users have. This is because most code usually runs very fast, so you do not realize it. Note that I also wrote Script Manager script. While it technically applies to all Python Scripting scene elements, the execution of the Python VM is there always blocking, it is much more prominent for a Script Manager script. Because there the module is only executed once and it is also okay to run scripts here which take seconds to execute. But it also applies for example to a Python Programming tag, the execution of the module is there also blocking. But because the module of a Python Programming tag is called many times - on each scene update at least once, and you are anyway in a world of hurt when your Python Programming tag module takes more than ~100 ms to run, it is not that obvious there. Syntax errors are evaluated before the VM actually runs because then the compilation of your code into byte code fails (which is then later interpreted by the VM). But the error is here also displayed only after the VM stopped (just as a RuntimeError which is raised by the VM and not by the compiler), but syntax errors prevent the VM from running your code in the first place. Cheers, Ferdinand import time def main() -> None: """Run as a Python Script Manager script to see that the execution of a scope in the Python VM is blocking. This will not print five 'A's with a stride of one second, but five 'A's after five seconds. """ for _ in range(5): print('A') time. Sleep(1) if __name__ == '__main__': main()
  • 0 Votes
    8 Posts
    2k Views
    sasha_janvierS
    @ferdinand Yay! Amazing. I can confirm that my solution builds without any problems in 2024.3.2. Big thanks to you and the dev team at Maxon!
  • Undo method for LayerShaderLayer

    Moved python 2024 limitation
    11
    0 Votes
    11 Posts
    2k Views
    John_DoJ
    Oof, that's an unfortunate end for me but at least I have a clear explanation. Thanks @ferdinand
  • Can REAL MIN / MAX value be changed on Init?

    Moved 2023 python s26 sdk
    20
    0 Votes
    20 Posts
    4k Views
    mocolocoM
    Hi there, Was the issue fixed on R2023 or R2024? Thanks, Christophe
  • 0 Votes
    2 Posts
    719 Views
    i_mazlovI
    Hi @Gaal-Dornik , Thanks for reaching out to us. Please excuse the delay. This issue is now tracked via internal bug tracking system. Thread is tagged to_fix, so that the thread can be tracked more closely. Cheers, Ilia
  • Redshift Standard Material base Properties

    Moved
    3
    1
    0 Votes
    3 Posts
    1k Views
    ferdinandF
    Hey @simonator420, Thank you for reaching out to us. And thank you @Dunhou for providing a solution. You should however be aware that Dunhou's solution requires his proprietary library as he states below. I think you should give it a spin because it is quite useful. When you must remain within the bounds of the Cinema 4D standard library, find an example for how to do that below. Cheers, Ferdinand PS: I have added the example below to the code examples of the upcoming release alongside the standard renderer example. Result: [image: 1693559902074-2f242653-ad67-4010-a78a-277f5953b856-image.png] Code: #coding: utf-8 """Demonstrates setting up a Redshift node material composed out of multiple nodes. Creates a new node material with a graph in the Redshift material space, containing two texture nodes and a mix node, in addition to the default core material and material node of the material. Topics: * Creating a node material and adding a graph * Adding nodes to a graph * Setting the value of ports without wires * Connecting ports with a wires * (Asset API): Using texture assets in a node graph """ __author__ = "Ferdinand Hoppe" __copyright__ = "Copyright (C) 2023 MAXON Computer GmbH" __date__ = "01/09/2023" __license__ = "Apache-2.0 License" __version__ = "2023.2.0" import c4d import maxon doc: c4d.documents.BaseDocument # The active document. def main() -> None: """Runs the example. """ # The asset URLs for the "RustPaint0291_M.jpg" and "Sketch (HR basic026).jpg" texture assets in # "tex/Surfaces/Dirt Scratches & Smudges/". These could also be replaced with local texture URLs, # e.g., "file:///c:/textures/stone.jpg". These IDs can be discovered with the #-button in the info # area of the Asset Browser. urlTexRust: maxon.Url = maxon.Url(r"asset:///file_edb3eb584c0d905c") urlTexSketch: maxon.Url = maxon.Url(r"asset:///file_3b194acc5a745a2c") # The node asset IDs for the two node types to be added in the example; the texture node and the # mix node. These and all other node IDs can be discovered in the node info overlay in the # bottom left corner of the Node Editor. Open the Cinema 4D preferences by pressing CTRL/CMD + E # and enable Node Editor -> Ids in order to see node and port IDs in the Node Editor. idTextureNode: maxon.Id = maxon.Id("com.redshift3d.redshift4c4d.nodes.core.texturesampler") idMixNode: maxon.Id = maxon.Id("com.redshift3d.redshift4c4d.nodes.core.rscolormix") idCoreMaterialNode: maxon.Id = maxon.Id("com.redshift3d.redshift4c4d.nodes.core.material") # Instantiate a material, get its node material and the graph for the RS material space. material: c4d.BaseMaterial = c4d.BaseMaterial(c4d.Mmaterial) if not material: raise MemoryError(f"{material = }") nodeMaterial: c4d.NodeMaterial = material.GetNodeMaterialReference() graph: maxon.GraphModelRef = nodeMaterial.AddGraph( maxon.Id("com.redshift3d.redshift4c4d.class.nodespace")) if graph.IsNullValue(): raise RuntimeError("Could not add RS graph to material.") doc.InsertMaterial(material) c4d.EventAdd() # Attempt to find the core material node contained in the default graph setup. result: list[maxon.GraphNode] = [] maxon.GraphModelHelper.FindNodesByAssetId(graph, idCoreMaterialNode, True, result) if len(result) < 1: raise RuntimeError("Could not find standard node in material.") standardNode: maxon.GraphNode = result[0] # Start modifying the graph by opening a transaction. Node graphs follow a database like # transaction model where all changes are only finally applied once a transaction is committed. with graph.BeginTransaction() as transaction: # Add two texture nodes and a blend node to the graph. rustTexNode: maxon.GraphNode = graph.AddChild(maxon.Id(), idTextureNode) sketchTexNode: maxon.GraphNode = graph.AddChild(maxon.Id(), idTextureNode) mixNode: maxon.GraphNode = graph.AddChild(maxon.Id(), idMixNode) # Set the default value of the 'Mix Amount' port, i.e., the value the port has when no # wire is connected to it. This is equivalent to the user setting the value to "0.5" in # the Attribute Manager. mixAmount: maxon.GraphNode = mixNode.GetInputs().FindChild( "com.redshift3d.redshift4c4d.nodes.core.rscolormix.mixamount") mixAmount.SetDefaultValue(0.5) # Set the path sub ports of the 'File' ports of the two image nodes to the texture URLs # established above. Other than for the standard node space image node, the texture is # expressed as a port bundle, i.e., a port which holds other ports. The texture of a texture # node is expressed as the "File" port, of which "Path", the URL, is only one of the possible # sub-ports to set. pathRustPort: maxon.GraphNode = rustTexNode.GetInputs().FindChild( "com.redshift3d.redshift4c4d.nodes.core.texturesampler.tex0").FindChild("path") pathSketchPort: maxon.GraphNode = sketchTexNode.GetInputs().FindChild( "com.redshift3d.redshift4c4d.nodes.core.texturesampler.tex0").FindChild("path") pathRustPort.SetDefaultValue(urlTexRust) pathSketchPort.SetDefaultValue(urlTexSketch) # Get the color output ports of the two texture nodes and the color blend node. rustTexColorOutPort: maxon.GraphNode = rustTexNode.GetOutputs().FindChild( "com.redshift3d.redshift4c4d.nodes.core.texturesampler.outcolor") sketchTexColorOutPort: maxon.GraphNode = sketchTexNode.GetOutputs().FindChild( "com.redshift3d.redshift4c4d.nodes.core.texturesampler.outcolor") mixColorOutPort: maxon.GraphNode = mixNode.GetOutputs().FindChild( "com.redshift3d.redshift4c4d.nodes.core.rscolormix.outcolor") # Get the fore- and background port of the blend node and the color port of the BSDF node. mixInput1Port: maxon.GraphNode = mixNode.GetInputs().FindChild( "com.redshift3d.redshift4c4d.nodes.core.rscolormix.input1") mixInput2Port: maxon.GraphNode = mixNode.GetInputs().FindChild( "com.redshift3d.redshift4c4d.nodes.core.rscolormix.input2") coreDiffusePort: maxon.GraphNode = standardNode.GetInputs().FindChild( "com.redshift3d.redshift4c4d.nodes.core.material.diffuse_color") # Wire up the two texture nodes to the blend node and the blend node to the BSDF node. rustTexColorOutPort.Connect(mixInput1Port, modes=maxon.WIRE_MODE.NORMAL, reverse=False) sketchTexColorOutPort.Connect(mixInput2Port, modes=maxon.WIRE_MODE.NORMAL, reverse=False) mixColorOutPort.Connect(coreDiffusePort, modes=maxon.WIRE_MODE.NORMAL, reverse=False) # Finish the transaction to apply the changes to the graph. transaction.Commit() # Insert the material into the document and push an update event. doc.InsertMaterial(material) c4d.EventAdd() if __name__ == "__main__": main()
  • def state breaks viewport rendering when script is docked in layout

    Moved python r20
    11
    0 Votes
    11 Posts
    2k Views
    ferdinandF
    Hey @HerzogVonWiesel, There is nothing that is strictly illegal to do with Script Manager scripts, but threading is not supported. Scripts are intended to be little blocks of code that run and while they run block the execution of other things. They are not intended to spawn dialogs which then dangle forever without an owner. Because when the user closes a dialog, it is not deallocated (because dialogs can be re-opened). This contrasts for example with a node, tool, or command plugin, which always sit there and do stuff even when they are not the focus of things. When they own a dialog, it is bound to the plugin instance and when properly implemented, the plugin also uses one dialog which is simply opened and closed instead of allocating a new dialog for each execution. In the end you can do pretty much anything with scripts, but you should avoid the c4d.threading module and async dialogs. There might be a minor feature I am overlooking here, but the yardstick is async execution. When something is async in nature it might not work properly in Script Manager scripts. edit: You should also avoid (attempting) to draw into a viewport from a script, or more precisely, manipulate the draw buffer of a BaseDraw. Cinema 4D won't let you do this anyways but there might be cases where you can still mess up things when you add drawing instructions. Getting information, e.g., calling myBaseDraw.GetDisplayFilter() or doing other things which are not drawing instructions is fine. You can also manipulate the parameters of a BaseDraw or switch the camera. Cheers, Ferdinand
  • How to get a port data type?

    Moved sdk python windows 2023
    6
    1
    0 Votes
    6 Posts
    1k Views
    J
    Hello @Dunhou , you are correct, the issue is not fixed yet. As Ferdinand mentioned in the beginning he has flagged it as "to_fix", so it will be fixed as soon as possible. Thanks and Cheers Maxon SDK Group
  • 0 Votes
    3 Posts
    917 Views
    J
    Hello @jenandesign , without further questions or postings, we will consider this topic as solved by Friday, the 11th of august 2023 and flag it accordingly. Thank you for your understanding, Maxon SDK Group