• 0 Votes
    6 Posts
    1k Views
    D
    Thanks a lot for the clarification! It would be nice to include more usecase examples of GetAccessedObjects(..) implementation in the SDK examples in the future. I will try your suggestion once 2024.4 becomes available.
  • How to group nodes in a Scaffold using Python

    2024 python
    3
    0 Votes
    3 Posts
    701 Views
    D
    Hey @m_adam , Thanks for your help. It works now. However, I'm wondering how I would have known that I needed to set the scaffold ID to the node. The documentation doesn't seem to explicitly mention this step. I might be wrong, but for someone without strong knowledge of the API, I'd never thought that way. I would rather added the selected nodes to a group, as this is what a scaffol is. Does that make sense? As a side note, after adding the nodes to the scaffold group, they appear messy, actually the nodes are nicely arranged inside the group, but the scaffold is overlapping other nodes. This is likely related to the bug we discussed here: https://developers.maxon.net/forum/post/73446. Am I right? Cheers
  • Force VertexMap display

    python
    18
    0 Votes
    18 Posts
    3k Views
    ymoonY
    @ferdinand, Is it possible to VertexColor, WeightMap(character rig) in the same way? Some games use VertexColor, so marking can always be useful. I tried to convert your code to VertexColor, but I lack knowledge. Please help us.
  • Output multiple file types from one render.

    2024 python macos windows
    4
    1
    0 Votes
    4 Posts
    959 Views
    G
    The API does appear to have movie saving features. https://developers.maxon.net/docs/py/2023_2/modules/c4d.bitmaps/MovieSaver/index.html
  • The cloner is calculated before the Python tag

    2023 python
    2
    0 Votes
    2 Posts
    539 Views
    i_mazlovI
    Hi @ll2pakll , Please excuse the delay, your topic somehow slipped from my list. I can only speculate here, as you haven't attached a sample scene that highlights your issue. The way you describe the problem it looks like a priority issue of the python tag. Please have a look at how the priority works in our documentation: https://help.maxon.net/c4d/2023/en-us/Default.htm#html/TPYTHON-OBASELIST.html#EXPRESSION_PRIORITY Also note that it's forbidden to call c4d.EventAdd() (or in reality is just skipped) from the python tag due to multithreading restrictions (c4d.EventAdd() is executed on main thread whilst python tag is executed in a parallel thread): [image: 1704368550401-9ddbfeab-53dd-49e1-8ded-0a6c3dddba94-image.png] Cheers, Ilia
  • How to create python plugin in 2024?

    2024
    6
    0 Votes
    6 Posts
    1k Views
    B
    @ThomasB said in How to create python plugin in 2024?: Yes, download the SDK and study the examples. I wrote my own software that allows me to simply select the type of plugin I want to create, enter the plugin ID and the plugin name. The program then creates the folder structure, all files with the correct content and the correct name automatically...that was the first thing I did because it is always extremely tedious. This then takes 10 seconds and I have a finished blueprint. Then I can start programming straight away. I usually make the Gui first using UserData to roughly create the design and then I write it down in the resfile in no time at all. It's relatively quick and even fun and you gradually grow into it, it emerges little by little..... Basically it wouldn't be a problem to write a script that writes the UserData interface into a Res, header and string file, I already have an idea for that... That would actually be easy to do. I'll get to it when I'm done with my update... and then maybe make it available to the community... However, a similar one is already there, but I can't remember where. Greetings Tom Yeah, that sounds cool. The ui stuff you're mentioning was very similar to how the old ResEdit plugin worked. the source code is on gitHub, but I don't know how to compile C++ plugins. But I guess there is nothing there. This stems from me copying one of the examples from the Python SDK and trying to make it my own. It hasn't been very intuitive for me, which is why I asked because I figured I must have been missing something, but it seems I am not.
  • Controlling drag&drop using MSG_DESCRIPTION_CHECKDRAGANDDROP

    2024 python
    5
    0 Votes
    5 Posts
    1k Views
    CJtheTigerC
    Hi @m_adam, thanks a lot, that did the trick. To close this topic off here's a snippet to allow other objects but not the current object to be dropped in there: def Message(self, node: GeListNode, type: int, data: object) -> bool: if type == c4d.MSG_DESCRIPTION_CHECKDRAGANDDROP: relevant_id = c4d.DescID(c4d.YOUR_PARAM) # Use the ID of the parameter of your object that you want to check. current_id: c4d.DescID = data['id'] if relevant_id.IsPartOf(current_id)[0]: dragged_element = data["element"] is_same_object = node == dragged_element data['result'] = not is_same_object return True return True Cheers, Daniel
  • Include same container multiple times in .res

    2024 python c++
    2
    0 Votes
    2 Posts
    512 Views
    i_mazlovI
    Hi Daniel, You cannot include multiple containers and keep their IDs different. There's no special arguments for the INCLUDE statement that can optimize this workflow for you. In your case having your own implementation of CYCLE would be the solution you're looking for. Cheers, Ilia
  • Python effector (Full control) - has no effect during render

    python
    4
    0 Votes
    4 Posts
    870 Views
    bacaB
    Hi Maxon team, Just want to bump up the issue, which is still here under the Cinema4D 2024.2
  • TypeError: GeListNode_ass_subscript when creating a new object

    python 2024
    7
    0 Votes
    7 Posts
    1k Views
    John_DoJ
    Hi Maxime, Thank you very much for looking at my issue. Did you try the new function ? I've added it in my code and unfortunately I get the same result as before. [image: 1703847634618-cinema_4d_3jwccopdud.gif]
  • Passing data to a CommandData plugin from Python

    2023 2024 c++ python r25
    3
    0 Votes
    3 Posts
    783 Views
    D
    Hi Maxime, thank you very much for your answer! I wasn't sure if storing things in the global document BaseContainer was a good approach, but it's working well. Cheers, Daniel
  • Python: Localized Plugin Name

    2024 python
    5
    0 Votes
    5 Posts
    958 Views
    M
    Hi you are right, I double checked and my c4d_string.str was like that, sorry I copy-pasted your in my reply without notifying it. // C4D-StringResource // Identifier Text STRINGTABLE { PLuginName "AAAAAA-ROUNDED Tube"; } All the rest is correct in your sentences. Cheers, Maxime.
  • Get clone position over spline for Spline Based Cloner/Matrix

    python
    2
    1
    0 Votes
    2 Posts
    489 Views
    M
    Hi @baca, sadly it is not possible to get the exact same random in Python than the one used internally for this feature. So the only way would be to actually clone some objects an retrieve their position as shown in read_modata_color.py. The previous example retrieve the color and not the position, so instead of retrieving the MODATA_COLOR, use the MODATA_MATRIX. Cheers, Maxime.
  • Python Weight Painting Brush Plugin Questions

    python 2024
    2
    0 Votes
    2 Posts
    492 Views
    M
    Hi @BretBays this is correct, if you want to make a Brush the easiest way is to register a SculptBrushToolData , you can find examples in Python in Github or in C++ in Github. SculptBrushToolData is derived from DescriptionToolData, meaning they can have a description visible in the attribute manager and therefor you can add your own checkbox if needed. Cheers, Maxime.
  • Vertex Color Tag disappearing when made editable

    2024 c++
    3
    2
    0 Votes
    3 Posts
    713 Views
    D
    Thanks Ilia! That was exactly what I needed! Dan
  • how to program plugins with python?

    r25 python
    20
    0 Votes
    20 Posts
    6k Views
    love_me_renderL
    Hi, thank you for the tips. Here is my C++ -treegenerator-plugin, written for R25: http://www.klausfilm.bplaced.net/TreeGenerator/Website_Treegenerator.html Cheers Klaus
  • Python Effector with custom FieldList

    python 2024
    3
    0 Votes
    3 Posts
    700 Views
    M
    Hi @baca, this is unfortunately not possible there is some default CheckDirty in place to support the default FiledList, but since you can not override CheckDirty in an effector yourself you can't add another FieldList dependency check. Cheers Maxime.
  • Python: How to import files as modules?

    python 2024
    2
    0 Votes
    2 Posts
    553 Views
    i_mazlovI
    Hi @gaschka, In your next postings please provide more detailed description of your question. In this case you're lacking information about the file structure you're using, the code that performs the import, the information on how and what have you set the environment variable for. Regarding your question, when splitting python code into separate pieces one usually uses the concept of packages rather than raw files. Hence, your question relates to local modules you'd like to use in your script. Please, have a look at the Python Libraries Manual especially the last section about the Local Plugin Search Paths. Another point of interest for you would be a utility function LocalImportPath that simplifies the process of importing packages. If you have any further questions, please let me know and provide a code sketch that showcases your issue. Cheers, Ilia
  • GraphModelHelper.IsConnected(node, port) crash in 2024.

    2024 python windows
    2
    0 Votes
    2 Posts
    466 Views
    M
    Hi thanks for the report, python should never crash, so it's going to be fixed in the next release. In any case the port should be a valid a port, but an exception should be raised when None is passed. Cheers, Maxime
  • Python tag initalization?

    python 2024
    7
    0 Votes
    7 Posts
    1k Views
    gaschkaG
    @m_adam @m_adam said in Python tag initalization?: OM is not single threaded, Oh, that's an interesting insight for me. Perhaps I was misinformed, as Character Rigs had the tendency to get slow quite easily in C4D, and Animators look envy over to Maya, as they do have a parallel evaluation (and caching). Though I'm aware that there are changes/improvements to C4D performance lately. Thanks for the link. A lot of new information to learn an absorb