• How to Get cloner data in C++

    s26 c++ windows
    2
    1
    0 Votes
    2 Posts
    553 Views
    M
    Hi you can find in read_modata_color_r16.py a Python example doing exactly that. To retrieve the position instead of retrieving the MODATA_COLOR your need to retrieve MODATA_MATRIX. There is no difference for doing it in C++. Cheers, Maxime.
  • Hot4D for C4D 2024 not working, Xcode error

    2024 macos
    3
    0 Votes
    3 Posts
    1k Views
    J
    Hello @josephnvelasquez49, 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 Thanks a lot for posting, we are looking into this and let you know as soon as possible. Cheers Jana
  • Adding multiple cameras from a single file to the render queue

    python r23
    22
    0 Votes
    22 Posts
    19k Views
    M
    @gsmetzer said in Adding multiple cameras from a single file to the render queue: My only question: Can you run this script without saving a multiple iterations of the source .c4d file to the OS? Sadly, this is not possible, you are forced to create a c4d file each time. However this is a feature we will tackle in the future, but I can't say when neither give any guarantee. Or, is it possible to delete the source .c4d file iterations upon completion? You can iterate all elements, call GetElementStatus and check for its finish state. If you need help to achieve that please open a new topic. Cheers, Maxime.
  • Geometry Axis asset node and LoadAssets

    python s26
    7
    1
    1 Votes
    7 Posts
    1k Views
    M
    @Dunhou said in Geometry Axis asset node and LoadAssets: Hi there, In C4D 2024, the Geometry Axis can not accessible in python anymore, how can I fix that? from typing import Optional import c4d doc: c4d.documents.BaseDocument # The active document op: Optional[c4d.BaseObject] # The active object, None if unselected def main() -> None: for i, (bc, descid, _) in enumerate(op.GetDescription(c4d.DESCFLAGS_DESC_0)): name = bc[c4d.DESC_NAME] if name == "Axis X": print(i,descid) print(op[descid]) if __name__ == '__main__': main() 2024 [image: 1699255573905-832ba1ea-2683-4deb-95de-67444dbcf033-image.png] 2023 [image: 1699255607788-d37942ef-53b5-4e13-9cab-2946766c3fd6-image.png] Cheers~ DunHou Hi, this issue have been fixed in 2024.2 and your code is working as it was previously. Cheers, Maxime.
  • Problems with Reloading Python Plugins in Cinema 4D 2024.1.0

    2024 python
    14
    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.
  • Issue with return values of VertexColorTag.GetAllHighlevelData()

    python
    5
    0 Votes
    5 Posts
    733 Views
    M
    Hi just to let you know that with the release 2024.2 the issue have been fixed and it is now possible to retrieve the value of a Vertex Color Tag in point mode. Cheers, Maxime.
  • Utilize Mograph Effectors to be used with custom generators

    python
    3
    0 Votes
    3 Posts
    442 Views
    bacaB
    Hi @m_adam , That's sad... Thanks, anyway.
  • Utilizing InExclude for advanced use

    python
    7
    0 Votes
    7 Posts
    1k Views
    bacaB
    @m_adam good to know, thanks.
  • Sub-frame document time

    c++ windows
    3
    0 Votes
    3 Posts
    625 Views
    WickedPW
    Is there any way to get around the apparent hard-coded maximum frame rate limit? WP.
  • Accessing vector field data of Volume Builder or Volume object

    2024 python
    8
    0 Votes
    8 Posts
    3k Views
    M
    Hi correct I made a typo in the string representation of a Vec3, this is going to be fixed in an upcoming release. Cheers, Maxime.
  • Adding UVs to Ngons in C++

    c++ 2024
    2
    0 Votes
    2 Posts
    392 Views
    i_mazlovI
    Hello @mn-kb3d , 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 Sorry for the delayed answer. In your further postings please add a code snippet that highlights the issue you're struggling with and shows the context of your question. Please also note that you're pointing out to the outdated documentation, please use the up-to-date one instead: UVWStruct. You can easily access it from the top menu as shown on the screenshot [image: 1701798037356-a17b9e9f-6762-4617-ae84-9d0fe94c73cd-image.png] Regarding your question. Ngons are actually sort of a collection of polygons (tris or quads). Even though you create an Ngon, for the UV mapping you would be using the same UVWStruct being applied to the underlying polygons. To find out the corresponding polygons and its indices you're welcome to use GetPolygonTranslationMap and GetNGonTranslationMap functions. Here is a simple example of how you can use them: // PolygonObject* poly; // ... // // Polygon-object initialization routine // ... Int32 ngonCount = 0; Int32* polyMap = nullptr; CheckState(poly->GetPolygonTranslationMap(ngonCount, polyMap)); Int32** ngons = nullptr; CheckState(poly->GetNGonTranslationMap(ngonCount, polyMap, ngons)); for (Int32 i = 0; i < ngonCount; ++i) { Int32 nPoly = ngons[i][0]; String polyIndicesStr; for (Int32 j = 1; j < nPoly + 1; ++j) polyIndicesStr += FormatString("@ ", polygonIdx); DiagnosticOutput("Ngon #@ with @ polygons: @", i, nPoly, polyIndicesStr); } Cheers, Ilia
  • This topic is deleted!

    1
    2
    0 Votes
    1 Posts
    21 Views
    No one has replied
  • use existing Catmull Clark algorithm

    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
  • After undo, point object SetAllPoints not update

    2024 python
    3
    1 Votes
    3 Posts
    622 Views
    chuanzhenC
    @ferdinand Thanks for your help!
  • "Vector Curl" on Volume Builder?

    python 2024
    3
    0 Votes
    3 Posts
    604 Views
    justinleducJ
    Hey @i_mazlov, thank you so much for your incredibly helpful and thorough reply. This is exactly what I was looking for. Thanks again! I really appreciate it!
  • How to get position and rotation in softbody simulation

    2023 windows python
    2
    0 Votes
    2 Posts
    495 Views
    ferdinandF
    Hello @Christian-0, Thank you for reaching out to us. I am a bit confused by your question. A soft body simulation is characterized by the fact that it gives up the idea of a geometry transform with governs a geometry as usually applied in computer graphics. In the end this means that the transform of the object (BaseObject.GetMg) will not change but the points will and with it the bounding box of an object. Below you see a soft body cylinder falling. Its transform, the axis, never changes, but the bound box does. Animated are here the points, not the object, hence the term soft body. bbox.mp4 In the API you can get the bounding box values with BaseObject.GetMp and BaseObject.GetRad. When you want a transform, a matrix for that, you would have to compute that yourself. The matrix manual dissects how to construct matrices. Cheers, Ferdinand
  • Simple plugin to dynamically list python scripts

    python
    2
    1
    0 Votes
    2 Posts
    398 Views
    ferdinandF
    Hello @Dave , 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 Your question is effectively out of scope of support because we do not debug code for users as lined out in our support guidelines. So, you cannot just post your code and then ask us to fix it, this especially applies when things like Chat GPT are involved. With that being said, there are two (three) major problems with your code: show_script_list_dialog: This is pure nonsense regarding creating and running a dialog. Dialogs must be implemented, see here for our dialog examples. run_script: This does not set the runtime environment, the globals, of the script to run. Which will cause many scripts to fail, as script manager scripts are prepopulated with doc and op. Plugin ID: The plugin ID 1009792 you are using does not seem to be a valid ID, the current plugin ID counter is at 1062027. You can do whatever you want to do locally, but you cannot ship any plugins with such made up IDs. You also do not really need a full-blown dialog here, you could just get away with ShowPopupDialog. Find a simple version below. Please understand that we cannot support ChatGPT nonsense output in future postings of yours. Cheers, Ferdinand Result: Running the twice hello_doc.py script with the wrapper script run_scripts.py. And then for the lulz run the wrapper with the wrapper to run the hello_doc script. metalol.mp4 Code: """Demonstrates how to run Script Manager scripts from a Script Manager script. Must be run as a Script Manager script while setting #SCRIPT_DIRECTORY to a path where your scripts do lie. Note: This code has been written for Cinema 4D 2023.2 or higher, it uses the pipe operator in type hints supported only by Python 3.10 or higher. To run this code in older versions, simply remove the pipe operator and its second argument: def foo() -> str | None: # 3.10 code def foo() -> str: # legacy code """ import c4d import os import runpy # Make sure to use a raw string or to escape it when defining a windows path. SCRIPT_DIRECTORY: str = r"C:\Users\f_hoppe\AppData\Roaming\MAXON\2024.1.0_7142A741\library\scripts" doc: c4d.documents.BaseDocument # The active document op: c4d.BaseObject # The active object, can be `None`. def SelectScript(path: str) -> str | None: """Opens popup selection dialog to let a user select a Python file in the given #path. """ # Sort out that #path is indeed an existing directory path and get all Python files in it. if not os.path.exists(path) or not os.path.isdir(path): raise OSError(f"'{path}' is not a valid directory path.") files: list[str] = [os.path.join(path, f) for f in os.listdir(path) if os.path.splitext(f)[1] == ".py"] if len(files) == 0: c4d.gui.MessageDialog(f"There are no Python scripts in the path: '{path}'.") # Build a popup menu for #files and display it under the cursor. menu: c4d.BaseContainer = c4d.BaseContainer() for i, item in enumerate(files): menu.InsData(c4d.FIRST_POPUP_ID + i, os.path.split(item)[1]) index: int = c4d.gui.ShowPopupDialog( cd=None, bc=menu, x=c4d.MOUSEPOS, y=c4d.MOUSEPOS) - c4d.FIRST_POPUP_ID # ShowPopupDialog returns the index of the selected item, which we let start at #FIRST_POPUP_ID # and the later subtracted that value again. So, index should now either be below 0 because # user aborted the dialog or an index for #files. if index < 0: print ("User aborted selection.") return if index > len(files): raise IndexError("Unexpected invalid index.") # Get the file path and be extra paranoid in checking if the file actually does exist (it # should since we retrieved only existing files above). file: str = files[index] print (file) if not os.path.exists(file): raise OSError(f"The file '{file}' does not exist.") return file def main() -> None: """Runs the example. """ # Let the user select a Python script at #SCRIPT_DIRECTORY and run the script in an environment # that matches that of a Script Manager script - which primarily means defining #doc and #op. # Script Manager scripts also do some other stuff, but that is irrelevant for us here. If you # wanted to be ultra-precise, you could also pass #globals() as the second argument to # #run_path(). One should then however make sure that the globals are indeed clean, so we should # not expose #SCRIPT_DIRECTORY as a global then. file: str | None = SelectScript(SCRIPT_DIRECTORY) if isinstance(file, str): runpy.run_path(file, {"doc": doc, "op": op}, "__main__") if __name__ == "__main__": main()
  • Discrepancy with point positions of Circle Spline Primitive

    windows s26 python
    3
    0 Votes
    3 Posts
    759 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
  • Setting Mograph Tracer Properties

    python 2024
    3
    0 Votes
    3 Posts
    483 Views
    D
    Dear Ferdinand, Thank you so much. I've found it tricky to navigate the API reference. Being able to get a pointer to the object parameter through drag and drop is a game changer for me!!
  • HtmlViewerCustomGui issue

    2023 python
    3
    0 Votes
    3 Posts
    544 Views
    PoliigonP
    Bummer. But thanks, Maxime, for the quick reply.