So, to be clear, in the end I need an user to interact and I can't do it in scripting? Can I access the dialog, somehow?
Best posts made by Rage
Latest posts made by Rage
Thanks @r_gigante for your reply
What if I want to scale the project using the "Scale Project" button?
I know that I can use the CallButton() function, but I don't know how to properly set the settings
op is a baselist containing the options for the button, right? How can I set the options (current and target scale)? I searched in the c++ documentation but all I could find is the ddoc.h with a reference to it, with no description.
I'd like to triangulate the geometry when exporting a fbx from python. I've been searching the documentation for the id for the "triangulate geometry" option, but it looks like there's nothing about it. Also, the fbx exporter has no id like the others. For example the object export is c4d. FORMAT_OBJ2EXPORT while the fbx export is 1026370
Here's a piece of my script
container = c4d.plugins.GetWorldPluginData(1026370) for id, value in container: if id == c4d.FBXEXPORT_TRIANGULATE_GEOMETRY: container[id] = 1 ...
I've been searching the python documentation but I've found no way to set the options when loading a 3d file. The functions LoadFile() and LoadDocument() don't seem to allow you to set settings such as "Flip z axis" or "swap X and Y axes" which are available, as instance, when importing an obj
Then, how can I set the settings displayed in the gui when importing a file?
I'm trying to figure out how to change the Project scale and type (centimeters, meters etc etc) through python.
I think I've to use the UnitScale class, but the documentation is a bit unclear about this class
It seems like it has a projection.
Please note that I don't know c4d, I'm just coding with the api but I don't know the software itself (I came from the blender's world)
Anyways, If you go to the UV edit, and you select your object and UVW tag, you can choose the UV mapping - Projection
let me attach a screenshot of what I'm trying to access. On the bottom right you can see there are some projections types, how do I set those through python?
I'm trying to create a new UVWTag (if an object doesn't already have one). Here's my basic code:
obj = doc.GetFirstObject()
if obj.GetTag(c4d.Tuvw) is None: tag = obj.MakeTag(c4d.Tuvw) tag[c4d.TEXTURETAG_PROJECTION]=3 tag.SetName('Cubic_map') c4d.EventAdd()
The code runs howewer, cinema reports the following error later when trying to access the uv:
A problem with this project has been detected: Object "Cube" - Tag 5671 not in sync. Please save and contact MAXON Support with a description of the last used commands, actions or plugins.
What Am I missing?
Hi @m_adam ,
Let me give you more details.
I'm writing a plugin that processes the geometry of each object in a scene. After processing the geometry I want to export the file as obj and mtl. I followed the documentation to do this last part (linked in the first post) but the mtl is not exporting. On the other hand, on another machine, the mtl gets exported.
If you go to file->export->obj , after selecting the path to export to, you will see that a list of parameters pops up. In one of these parameters you can set to export or to don't export the materials. For some reasons, when I run the plugin, on my computer the material is not exported. How can I set this property and all the others that pop up in this dialog?
I'm struggling to find the options (like the ones visible in the gui, export materials/flip z axis and so on) in the python documentation.
SaveDocument takes a base document as parameter and I set its settings using SetDocumentData that points to this list of settings:
I don't see all the options I can see in the gui. How do I set them?