• 0 Votes
    9 Posts
    3k Views
    i_mazlovI
    Hi Christophe, Please note our Support Procedures, namely: We cannot provide support for third party libraries "It doesn't work" is not a support request and we cannot debug your code for you, but instead provide answers to specific problems. From my personal point of view, you need to reduce your setup as far as possible while still being able to reproduce the bug: Determine which one of your 2 tag plugins causes the issue Cut off unrelated functionality of your plugin that has nothing to do with the issue Figure out the specific function or line that causes the issue Search the forum if this issue was already discussed If not, create an example code snippet that highlights your issue Post your specific question and the example code snippet in a separate thread with a meaningful title Cheers, Ilia
  • 0 Votes
    6 Posts
    3k Views
    G
    I apologize for posting repeatedly. I think I succeeded in installing numpy and other libraries as well. In case for someone in same situation, I would like to share my own case resolution. After installing pip, not from c4dpy, but using the python below worked: /Applications/Maxon Cinema 4D 2024/resource/modules/python/libs/python311.macos.framework/python and executed the command like python -m pip install numpy normally. And worked inside C4D properly. If there are any inaccuracies or clear errors, I would appreciate it if you could point them out. Thank you in advance.
  • 0 Votes
    6 Posts
    1k Views
    bacaB
    @ferdinand said in c4d.MCOMMAND_EXPLODESEGMENTS makes target object dead: Select 0th polygon in a mesh. SMC: MCOMMAND_SELECTCONNECTED SMC: MCOMMAND_SPLIT Delete the selected polygons. When no polygons are left, exit, otherwise goto 1. Oh, great idea. Not that elegant, but seems legit. Thanks again.
  • Running commanline application with Python

    Moved General Talk 2023 python macos windows
    15
    0 Votes
    15 Posts
    4k Views
    ferdinandF
    One last thing: Have you tried using LICENSEMODEL::MAXONAPP as an alternative login method? ::MAXONACCOUNT is being deprecated as I said, and I do not quite remember why we chose it here nonetheless. User support surely can help you with the details here.
  • Error building R25 macOS - TypeTraitExpr

    Cinema 4D SDK r25 c++ macos
    7
    1
    0 Votes
    7 Posts
    1k Views
    rsodreR
    Thanks for all the tips @ferdinand The solution was Catalina + XCode 12.4
  • Check if a texture is missing

    Cinema 4D SDK python 2024 macos
    2
    0 Votes
    2 Posts
    626 Views
    ferdinandF
    Hello @visualride, Thank you for reaching out to us. I would recommend having a look at c4d.documents.GetAllAssetsNew . Helpful might also be the thread Get all Textures for a Material. It is one of the multiple threads where I showcased the usage of GetAllAssetsNew (search for GetAllAssetsNew and my user name to find the other threads). In this thread you can see here how to read the exists field in asset data to know if Cinema 4D can find that asset. But asset handling can get complex when node materials are involved as shown here (also a good place to better understand the data associated with MSG_GETALLASSETS). The thread shows also a simpler approach using BaseDocument.GetAllTextures. You can then just check with os.exists if the paths do exist. You might have to deal with relative paths here, depending on the document. Cheers, Ferdinand
  • 0 Votes
    4 Posts
    789 Views
    P
    @spedler Thank you for your help
  • 0 Votes
    3 Posts
    596 Views
    P
    @ferdinand Thank you for your reply
  • subprocess not running in background

    Cinema 4D SDK python 2023 macos
    4
    0 Votes
    4 Posts
    853 Views
    B
    MAny thanks Ferdinand. I will look into the BatchRender suggestion. That looks promising.
  • Can't debug C4D 2023 and 2024 on macOS

    Cinema 4D SDK 2023 2024 c++ macos
    11
    1
    0 Votes
    11 Posts
    2k Views
    fwilleke80F
    @ferdinand said in Can't debug C4D 2023 and 2024 on macOS: first, thank you very much for investing more time into this and with that saving time for me, truly appreciated. You're welcome. If any of this get any of us further it's worth the time. @ferdinand said in Can't debug C4D 2023 and 2024 on macOS: But let us discuss the details per mail. Okay! Cheers, Frank
  • R23 Monterey SDK compile errors

    Cinema 4D SDK r23 c++ macos
    9
    0 Votes
    9 Posts
    1k Views
    S
    Thanks Ferdinand. That's very helpful. TBH, for me the best option is probably to support only R2023/4/5 if that just needs the one development environment. It would be different for commercial plugins but for mine I think the most I want to do is support the 2-3 latest versions of Cinema. It just gets too confusing for earlier releases. But it's very useful to know that Monterey/XCode 13 is good for the current two latest releases and maybe the next one too. Cheers, Steve
  • 0 Votes
    8 Posts
    1k Views
    fwilleke80F
    I already tried using 8 bit greyscale. Still doesn't work in 2023 on macOS, but on the other C4D/OS combinations. Will try RGB, too. If that doesn't work either, I'll be back and try to write a minimal example. Cheers, Frank
  • Instance variables static or not?

    Moved General Talk c++ macos 2023
    3
    0 Votes
    3 Posts
    828 Views
    W
    Hi @ferdinand, Thank you for moving this topic to its correct category. Although I believe we agree on the C++ meaning of static members I really wasn't aware that the use of static plugin parameters and static plugin state could in practice be as problematic as you describe and will certainly heed your advice to no longer use static plugin state. Also, your point on field members and parallel execution of member functions is well taken. Thanks again!
  • How to "permanently" store data?

    Cinema 4D SDK
    4
    0 Votes
    4 Posts
    616 Views
    ferdinandF
    Hello @herrmay, Yes, it can be a bit cumbersome to write a whole abstraction layer, but most of the time it is avoidable to do that in the first place. In your case it should be pretty simple. Iterate over all layers you want to save to disk. Get the MAXON_CREATOR_ID UUID of each layer and its data container. Write the UUID and the data container to disk using JSON or HyperFile, I would recommend the latter as it will be less work. You only must convert the UUID bytes to a string, put the string into the file, then the data container and you are done. If you want to, you could also store all layer data in one file per document, or just have one giant file for all documents. Later load these hyper file fragments back and do what you want with the data. When you need the original node, traverse the layers in the active document for a node with the stored UUID. You could also make things fancier and search in all open documents or even store the document path in your serialized data and load that document. Saving things in the document container is a possibility too, you should make sure though to use a plugin ID for that. Cheers, Ferdinand
  • Cinema crashes renaming items in a TreeView

    Moved Bugs r20 s26 python windows macos
    11
    0 Votes
    11 Posts
    3k Views
    ferdinandF
    Hello @HerrMay, Thank you for your reply, and please excuse that I have overlooked it. Maybe a little bit off topic but since we're already talking Treeviews. There seems to be a bug too when it comes to multi-selecting objects in the Treeview. At least when using c4ds native BaseList2D objects. Without wanting to be rude, that statement is too vague to make a bug report out of it. The thread is quite old and therefore not the most reliable source of information, geared towards C++, and from what I see, not even conclusive in the assessment if there is a bug or not. I see there a user claiming that there is a bug, and another user, probably a Maxon employee, being skeptical about it. We are happy to file bugs, but we need a reproducible case. And just as a heads up, us filing a bug does not necessarily mean that we will fix soon or at all. I understand that this can be disheartening, but we must prioritize where our bug fixing efforts are most needed, which can lead to minor bugs being pushed for a long time. I have closed this thread due to its age, please feel free to open a new thread when you want to discuss that other bug. The thread is still be tracked due to its to_fix tag. Cheers, Ferdinand
  • Plugin opens on Mac not correctly

    Cinema 4D SDK 2023 python macos
    13
    1
    0 Votes
    13 Posts
    2k Views
    ferdinandF
    Hello @pim, In addition to my answer via mail, I will also answer here, as this might be interesting for the rest of the community. Cheers, Ferdinand So, the question was here "Why does my tree view not open with the right size?". The easy answer to this is that: You did neither set a minimum size for the dialog in GeDialog.Open(). Nor one for the tree view itself via GeDialog.AddCustomGui(). Both in conjunction did result in your dialog collapsing down to zero height. What can I do? Not much, the TreeViewCustomGui is not designed to scale to the size of its content. The underlying question is what you expect to happen here. a. Just have the tree view have some fixed minimum size, regardless of its content. b. Have the tree view initialize automatically to size, i.e., when the view has 10 items upon opening, it should have exactly 10 items height. When it is (a.) what you want, then this is easily doable with the minimum size passed to GeDialog.AddCustomGui(). When it is (b.), then you are more or less out of luck, as a tree view cannot scale automatically to the size of its content. You can adjust the minimum size dynamically based on the content which is going to be placed in the tree view, but when the content changes, you will have to flush your layout in order to be able to set a new minimum size. On a practical level it is also not so desirable to have a tree view scale like this, as this minimum height is not well defined. Should it be all items, or just all top level items, i.e., fully collapsed or fully expanded (which is implied by your example as all nodes start out as expanded). Let's say we choose fully collapsed. What happens when you have so many root nodes that the tree view will not fit on screen when making space for all root nodes. Example Result The dialog is set to have a minimum height which matches the total number of nodes in it. [image: 1675704054022-58d6b1aa-de83-484f-9d48-d6a0d327a98f-image.png] Code I had to cut here a bit, but the relevant parts are: class TreeNode: # ... def __len__(self): """(f_hoppe): Counts all descendants of this node, including the node itself. Implemented fully recursively. Should be implemented iteratively for production due to stack overflows and Python's recursion limit preventing them. Or the data should be acquired when textures are collected. """ count: int = 1 for child in self.children: count += len(child) class ListView(c4d.gui.TreeViewFunctions): COLUMN_COUNT: int = 1 MIN_LINE_HEIGHT: int = 24 MIN_WIDTH: int = 500 def __init__(self): # The root nodes of the tree view. self._rootNodes: list[TreeNode] = [] def __len__(self): """(f_hoppe): Returns the number of tree nodes in the instance. """ return sum([len(node) for node in self._rootNodes]) def GetMinSize(self) -> tuple[int, int]: """(f_hoppe): Returns the minimum GUI size for the data of this ListView instance. """ # But all these classic API pixel values are quite wonky anyways and the tree view does # many custom things. So we must do some ugly magic number pushing. Subtracting nine units # from the actual height of each row gave me sort of the best results, but the tree view # GUI does not scale linearly in height with the number of rows. Meaning that what looks # good for 5 items might not look good for 50 items. return (ListView.MIN_WIDTH, (ListView.MIN_LINE_HEIGHT - 9) * len(self)) def GetColumnWidth(self, root: TreeNode, userdata: None, obj: TreeNode, col: int, area: c4d.gui.GeUserArea): """(f_hoppe): This cannot be a constant value, as we will otherwise clip data. """ return area.DrawGetTextWidth(obj.textureName) + 24 def GetLineHeight(self, root, userdata, obj, col, area): """(f_hoppe): Used constant value. """ return ListView.MIN_LINE_HEIGHT # ... class SimpleDialog (c4d.gui.GeDialog): ID_TRV_TEXTURES: int = 1000 def __init__(self) -> None: self._treeView: c4d.gui.TreeViewCustomGui = None # This builds the tree node data so that self._listView._rootNodes holds the top level # node(s) for the tree managed by this ListView instance. self._listView: ListView = self.GetTree() super().__init__() def CreateLayout(self) -> bool: """(f_hoppe): I substantially rewrote this. """ # Because we already initialized the ListView data, we can use it to compute the minimum # size of the gadget. w, h = self._listView.GetMinSize() print(f"{self._listView.GetMinSize() = }, {len(self._listView) = }") # Use these values to define a default size so that it shows all columns. What you want to # be done here is sort of not intended by the TreView GUI, although admittedly desirable. # The closest thing we can do is set the minimum size for the gadget, so that all lines # will fit into it. This will then ofc also have the side effect that the GUI cannot be # scaled down beyond this point. You might want to implement ListView.GetMinSize() in a # different manner, so that it does not take into account all nodes and instead just the # top level nodes. self._treeView = self.AddCustomGui( id=SimpleDialog.ID_TRV_TEXTURES, pluginid=c4d.CUSTOMGUI_TREEVIEW, name="", flags=c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, minw=w, minh=h, customdata=SimpleDialog.SETTINGS_TREEVIEW) if not isinstance(self._treeView, c4d.gui.TreeViewCustomGui): raise MemoryError(f"Could not allocate tree view.") # If you want to do this at runtime, i.e., load a new texture path, you would have to # call GeDialog.LayoutChanged() on the layout group which contains the tree view, add # the tree view again (with new min size values), and then call GeDialog.LayoutChanged() # on the group. It might be easier to just live with a fixed minimum size just as # (300, 300) return True # ...
  • Multiple instances of ObjectData plugin?

    Cinema 4D SDK c++ r25 macos
    3
    1
    0 Votes
    3 Posts
    545 Views
    W
    @ferdinand Thank you very much for your elaborate answer! Explaining the difference between the interface layer and the plugin layer was very enlightening. I now understand that calling functions more than once is all part of the package and that this does not refer to the actual plugin instance. Thank you again.
  • Developing for MacOS

    Cinema 4D SDK c++ macos
    6
    0 Votes
    6 Posts
    1k Views
    S
    @m_adam Thanks very much for your comments. You asked which parts of the manual page weren't clear. It's more that it's incomplete, in that it doesn't tell you how to get a bundle ID, app password or provider ID. Also, I don't think the statement that adding a timestamp is optional if you enable the hardended runtime is correct - from what I can see, you must provide a timestamp even though you enable the hardended runtime. The other thing is that invariably at some point the process is going to fail and there's no mention of what to do when it does. It's extremely frustrating when the notarization fails and you have to figure out why. Apart from that, the page is actually very good - just needs a bit more detail (IMO). Steve
  • 1 Votes
    10 Posts
    2k Views
    fwilleke80F
    @m_adam said in macOS Monterey - Can't run source processor anymore?: So you have to link for example from /usr/local/bin to a python installation, I personally have Python 3.8.9. Xcode itself ships with a python version you could link to (its in Contents/Developer/usr/bin of the application package). So with that path you can call call sudo ln -s PATH_TO_PYTHON /usr/local/bin/python in terminal. Hi Adam! That is in deed what I tried, creating a symlink that points to Python 3. I didn't use the paths, though, but just linked the word "python" to "python3". I guess that was my mistake. Wouldn't it be easier for Maxon and everybody else, if you just changed the preprocessor call in the projects' PreBuild events to "python3", instead of having to go the symlink way and change things on users' computers (which, I guess, will have side effects when users later decide to install Python 2.7 for some reason)? Cheers, Frank
  • 0 Votes
    3 Posts
    629 Views
    W
    Hi! One more question, why does it process the command gui.MessageDialog('Hide Object[s]') first, is it pretty much last in the order of commands?? How do I have to install the command so that the program runs according to the order in which it was entered? Thank you very much!