Just to confirm - skipping the unwanted entries worked absolutely fine for my needs. And I was able to reproduce the behavior in Cinema4D 2023 too if I created such user data manually and tried to access it. So - no bug or regression, just my limited knowledge.
BigRoy
@BigRoy
Technical Director at Colorbleed animation studios.
Latest posts made by BigRoy
-
RE: Cinema4D 2025 get user data value parameter not accessible?
-
RE: Cinema4D 2025 get user data value parameter not accessible?
Thanks so much - of course, it may very well be that something in Cinema4D may just be generating more user data than I expected to live there. As such, I'll just perfectly ignore any values that couldn't be parsed since in my case I only care about those that I put there from Python to begin with.
Thanks for the quick and thorough reply.
-
Cinema4D 2025 get user data value parameter not accessible?
It seems that triggering this logic in Cinema4D 2025 fails:
for description_id, base_container in obj.GetUserDataContainer(): key = base_container[c4d.DESC_NAME] value = obj[description_id]
Which did not error in Cinema4D 2023 and 2024.
With an error along the lines of:value = obj[description_id] ~~~^^^^^^^^^^^^^^^^ AttributeError: Parameter value not accessible (object unknown in Python)
Source issue reported here
Even though this same logic worked in Cinema4D 2023 and 2024.
Is this a regression, or does my code need updating?Could it be failing on trying to get a value from a Group, e.g. as one created here:
# Create the group group_bc = c4d.GetCustomDatatypeDefault(c4d.DTYPE_GROUP) group_bc[c4d.DESC_NAME] = group group_bc[c4d.DESC_SHORT_NAME] = group group_bc[c4d.DESC_TITLEBAR] = True group_bc[c4d.DESC_GUIOPEN] = False group_id = node.AddUserData(group_bc)
If so, how would I detect correctly which user data should be allowed to retrieve the values from?
-
RE: Alembic Export Options Not Working
Just want to confirm here that I'm facing this same issue - only setting the negative state first and then the positive state after seems to make this work. So, thanks for the workaround.
Here's the reported bug on our pipeline: https://github.com/ynput/ayon-cinema4d/issues/6
And this is what fixed it: https://github.com/ynput/ayon-cinema4d/pull/8Looking at 'what' fixes it this most definitely sounds like a bug.
(I tested in Cinema4D 2023.2.2 on Windows 10) -
RE: Import and managing 'merged' Alembic
Hi Ilia, this is great - thanks so much. I was able to get what I needed using the
LoadDocument
it seems. Am I correct in understand that the document it 'opens' is only temporary and I do not have to ensure proper deletion (in memory) of the loaded document once I'm done with it?Other than that - part of my code is currently here. It's more of a "spare time" open-source pipeline development because I don't use Cinema4D myself but am hoping it can become useful for others - so thanks for the details!
-
Merged Alembic Generator object, how to check if it is a camera?
When importing an Alembic it turns the objects into Alembic Generators. How can I, without making the objects editable detect whether the object is a camera or not?
print(op.GetTypeName())
Prints:
Alembic Generator
. -
RE: Register event callbacks for "new file", "open file", "save file" (hooks?)
@m_adam said in Register event callbacks for "new file", "open file", "save file" (hooks?):
Regarding new document, sadly there is no way to hook into that and the best way would be to have a MessageData, list all doc by calling c4d.documents.GetFirstDocument and then iterating them by calling BaseList2D.GetNext(). Since a document is a BaseList2D you can hash them and therefor know if there is a new document.
So that would just be running on a timer then, with the hope that I 'trigger' on it swiftly enough? Doesn't fit my needs so dedicated SceneHooks I can register application wide would be a mad helper for this!
Aside of that - was there still a way to 'add' the python generator object into the scene without it maybe serializing into the saved file? Like have a flag that says "Do not serialize"? (Also, Scene Hooks would still be better)
-
Update Xref filepath without user interaction
I'm looking to update filepath of an Xref via Python without user interaction requiring the "Yes" on a popup dialog.
This works:
xref.SetParameter( c4d.ID_CA_XREF_FILE, filepath, c4d.DESCFLAGS_SET_USERINTERACTION, )
But that basically means I will get this pop-up dialog:
However I want to do this without any user interaction in-between. How can I force the update without requiring the
c4d.DESCFLAGS_SET_USERINTERACTION
flag.How can I update the filepath without the pop-up dialog?
This has come up often before, see here:
- http://developers.maxon.net/forum//post/63608
- https://developers.maxon.net/forum/topic/14319/does-xref-or-xref-simple-are-now-accessible-with-python
- http://developers.maxon.net/forum//post/63554
But from back in 2020 through 2022 these remained lingering with "impossible". But hey, the future is bright and now. How do we do this? (From Python)
-
RE: Register event callbacks for "new file", "open file", "save file" (hooks?)
And of course just after I find this Python API: Document Events topic which seems to hit close to this.
However - it seems it requires me to create an ACTUAL object in the scene if I understand correctly - which seems odd. Is there any way that I can make this work - inside the scene file within the pipeline, but have the Cinema4D file itself remain free of this when saved and shared with someone else? (Maybe we can exclude the node from persisting with the scene on saves, or alike?)
Also, that does not allow me to respond to a "new" document being created?
-
Register event callbacks for "new file", "open file", "save file" (hooks?)
I'm looking for a way via Cinema4D's Python API to respond to a user creating a new document (to e.g. apply certain default settings) and to respond to file open and file save (preferably a callback before save and after save) to respond with some custom pipeline logic as well.
A google search and search over the SDK didn't get me anywhere. I did see Plugin Messages and Hooks but both didn't point me in the right direction to run python code on any of the mentioned events. At some point I thought
MessageData
was what I was looking for, but I couldn't find what ids it could capture and whether any were related to new document, saving document, opening documents, etc.