Member crudodev Posted March 22 Member Share Posted March 22 Hello, I'm just wondering—how can I skip the "Save As" dialog menu when saving a layer to .obj, .fbx, etc.? I just want to programmatically pass the path for the 3D model without dealing with dialog menus. Also, is it necessary to switch to the Retopo room for model decimation, or can we avoid that as well and just set the decimation level as an argument? Same goes for importing into the current level—how can I programmatically use an object path as an argument and avoid the dialog menu? Thanks Quote Link to comment Share on other sites More sharing options...
Member crudodev Posted March 23 Author Member Share Posted March 23 This post was recognized by Carlosan! crudodev was awarded the badge 'Great Content' and 1 points. Okay, I found a solution in the documentation. To prevent the pop-up dialog menu and pass the file path, we can use the following method: coat.ui.setFileForFileDialog(se.exportMesh) 1 Quote Link to comment Share on other sites More sharing options...
Member crudodev Posted March 23 Author Member Share Posted March 23 Just playing around with the Python API—Is it possible to create one Python add-on that has its own submenu with different buttons? Or do I have to create a separate "script" for each action? Also, I found that only with C++ we can create custom sculpt tools integrated into the UI, similar to the tree generator C++ add-on from the examples. Correct me if I'm wrong. Quote Link to comment Share on other sites More sharing options...
Carlosan Posted March 23 Share Posted March 23 You mean this ? Scripts Menu > CreatePythonScript > Basic... > Dialogs.py 1 Quote Link to comment Share on other sites More sharing options...
Member crudodev Posted March 23 Author Member Share Posted March 23 I meant more like this: I made a workaround where each button is an independent script (Python package) in the context of 3DCoat. But ideally, it would be great to create a custom menu—one add-on with multiple modules and subpackages. Edit: Ah, I see! There are examples showing how to insert into the Tools panel and menus. Thanks! 1 Quote Link to comment Share on other sites More sharing options...
carrots Posted March 24 Share Posted March 24 On 3/22/2025 at 8:14 AM, crudodev said: Hello, I'm just wondering—how can I skip the "Save As" dialog menu when saving a layer to .obj, .fbx, etc.? I just want to programmatically pass the path for the 3D model without dealing with dialog menus. Also, is it necessary to switch to the Retopo room for model decimation, or can we avoid that as well and just set the decimation level as an argument? Same goes for importing into the current level—how can I programmatically use an object path as an argument and avoid the dialog menu? Thanks You can use low-level APIs, as it is done in the Reality Capture module. 3DCoat_install_folder\UserPrefs\Scripts\Modules\RealityCapture\PhotosTo3DExt.pyhttps://pilgway.com/files/3dcoat/PythonAPI/classcoat_1_1_paint_room.html if you need additional low-level API functionality - let me know 2 Quote Link to comment Share on other sites More sharing options...
Advanced Member MJonathan Posted March 24 Advanced Member Share Posted March 24 (edited) How can I import extra modules? For example PySide6? My goal is to create an integration with ShotGrid (Flow Production Tracking) and the toolkit for Pipeline flows.https://help.autodesk.com/view/SGSUB/ENU/?guid=SG_Automotive_am_getting_started_am_integrations_intro_html Community Integrations: https://help.autodesk.com/view/SGDEV/ENU/?guid=SGD_si_integrations_community_shared_integrations_html Edited March 24 by MJonathan 1 Quote Link to comment Share on other sites More sharing options...
Member crudodev Posted March 24 Author Member Share Posted March 24 16 hours ago, carrots said: You can use low-level APIs, as it is done in the Reality Capture module. 3DCoat_install_folder\UserPrefs\Scripts\Modules\RealityCapture\PhotosTo3DExt.pyhttps://pilgway.com/files/3dcoat/PythonAPI/classcoat_1_1_paint_room.html if you need additional low-level API functionality - let me know Thanks. This is useful. I just found your add-on system quite similar to something I built for Autodesk Maya, which helps manage scripts in a more simplified way. If you're interested, I have an article about it link Also, I’m wondering if it’s possible to create a custom context menu with submenus, separators, etc.? I saw that it's possible to insert menu items, but I couldn’t find how to manage submenus, separators etc. 1 Quote Link to comment Share on other sites More sharing options...
carrots Posted March 25 Share Posted March 25 Ok, I'll make some examples of custom extensions based on PySide6, custom menu and post them here. 2 Quote Link to comment Share on other sites More sharing options...
Member crudodev Posted March 25 Author Member Share Posted March 25 (edited) 9 hours ago, carrots said: Ok, I'll make some examples of custom extensions based on PySide6, custom menu and post them here. Just quick question: - I found that on macOS, the Addon context menu doesn't parse the standard Examples scripts, so they don't show up in the Addon menu. - The command coat.ui.toRoom(f"{ROOM_NAME}") doesn't work on macOS — I have to use coat.ui.cmd("$SETPAGE_Sculpt") instead. - I also noticed that in the examples, we use coat.ui.toRoom("Sculpt") for the SCULPT room, but it doesn't work — I have to use "Voxels" instead. What’s the difference between them? Is this an undocumented change?3D Coat 2024.31 Edited March 25 by crudodev Quote Link to comment Share on other sites More sharing options...
carrots Posted April 13 Share Posted April 13 Sorry for the delay, I was rewriting the entire interface in python. Please check if it works.https://drive.google.com/file/d/1GyKa_GNaeN97igoWnI03ue8-MwRIPnhc/view?usp=sharing Quote Link to comment Share on other sites More sharing options...
Advanced Member MJonathan Posted August 3 Advanced Member Share Posted August 3 (edited) Hey @carrots I was searching a way to get the class of the paint objects! but I think there is no way to have this class! My objective is to access to the instances of the PaintObjects to manipulate their options like hide and unhide. I only can found this methods: def PaintObjectsCount () -> int : ... def RemovePaintObject (idx: int) : ... def PaintObjectName (idx: int) -> str : ... There are not a PaintObject Class (I'm not sure if PaintObjecs are part of Mesh Class) and these are the only methods that I found. Ideally should be more appropiated to have something like this: class PaintObject: def __init__(self): ... @staticmethod def getName(self): ... @staticmethod def hide(self): ... @staticmethod def unhide(self): ... @staticmethod def delete(self): ... @staticmethod def lock(self): ... @staticmethod def getMesh(self): ... If you know a way to manipulate these can you point me in the right direction please? Or if there is no an option, Can you implement these please? the same as Model class. Edited August 3 by MJonathan 2 Quote Link to comment Share on other sites More sharing options...
Advanced Member MJonathan Posted August 4 Advanced Member Share Posted August 4 (edited) 2025-08-03 20-22-50.mkv Still need help with this!I've atached a video showing this wrong behavior with the model class methods. For PolyGroups, I'm using the Model class to access the methods. In this script, I'm hiding elements using multi-selection, and everything seems to be working, the changes are reflected in the native PolyGroup interface. But the viewport isn't updating to reflect those changes! as you can see in the video #Documentation in the Model Class say that we can use this to manage the visibility of the groups setObjectVisibility(self, int index, bool visible) #Example of a peace of my code: self.model = coat.Model.fromModeling() is_checked = changed_item.checkState() == Qt.Checked self.model.setObjectVisibility(index, is_checked) Edited August 4 by MJonathan Quote Link to comment Share on other sites More sharing options...
carrots Posted August 7 Share Posted August 7 On 8/3/2025 at 12:00 AM, MJonathan said: Hey @carrots I was searching a way to get the class of the paint objects! but I think there is no way to have this class! My objective is to access to the instances of the PaintObjects to manipulate their options like hide and unhide. I only can found this methods: def PaintObjectsCount () -> int : ... def RemovePaintObject (idx: int) : ... def PaintObjectName (idx: int) -> str : ... There are not a PaintObject Class (I'm not sure if PaintObjecs are part of Mesh Class) and these are the only methods that I found. Ideally should be more appropiated to have something like this: class PaintObject: def __init__(self): ... @staticmethod def getName(self): ... @staticmethod def hide(self): ... @staticmethod def unhide(self): ... @staticmethod def delete(self): ... @staticmethod def lock(self): ... @staticmethod def getMesh(self): ... If you know a way to manipulate these can you point me in the right direction please? Or if there is no an option, Can you implement these please? the same as Model class. Thanks, Ok, I'll add this to the Python API 2 Quote Link to comment Share on other sites More sharing options...
carrots Posted August 13 Share Posted August 13 Hi @MJonathan , please try this version https://drive.google.com/file/d/1_wyvaT-A0OGOrcPffSew3vkEJRc7qemu/view?usp=sharing To access the Paint object model, you can use the coat.Model.fromUv() function To access the Paint object properties, you can use the coat.PaintRoom.GetPPPObject(idx) function Also fixed an issue with changing the visibility of retopo groups myTJGv4DAl.mp4 1 1 Quote Link to comment Share on other sites More sharing options...
Advanced Member MJonathan Posted August 13 Advanced Member Share Posted August 13 (edited) EDIT: SetLocked is not working Hey Carrots! Thank you very much for this update — it’s working as expected for both PPPObjects and Retopo Objects! I have another question: PPPObjects have the GetLocked and SetLocked methods. Is it possible to use SetLocked and GetLocked with Retopo Objects as well, or would that logic need to be implemented by the Retopo developer first? Edited August 15 by MJonathan 1 Quote Link to comment Share on other sites More sharing options...
Advanced Member MJonathan Posted August 15 Advanced Member Share Posted August 15 Sorry Carrots! the SetLocked method is not working in PaintObjects, it has a bug! this unchecked and checked the lock icon in the interface, but if it is SetLocked(True), you can continue drawing in the object, that's wrong, if I manually click in that icon it works correctly, but no with coding. 1 Quote Link to comment Share on other sites More sharing options...
carrots Posted August 19 Share Posted August 19 On 8/14/2025 at 7:33 PM, MJonathan said: Sorry Carrots! the SetLocked method is not working in PaintObjects, it has a bug! this unchecked and checked the lock icon in the interface, but if it is SetLocked(True), you can continue drawing in the object, that's wrong, if I manually click in that icon it works correctly, but no with coding. Thanks for the message, I will fix it soon. 1 Quote Link to comment Share on other sites More sharing options...
carrots Posted August 19 Share Posted August 19 On 8/14/2025 at 7:33 PM, MJonathan said: Sorry Carrots! the SetLocked method is not working in PaintObjects, it has a bug! this unchecked and checked the lock icon in the interface, but if it is SetLocked(True), you can continue drawing in the object, that's wrong, if I manually click in that icon it works correctly, but no with coding. Now Alexander @Gorbatovsky is working on the hierarchy for retepo, you can ask him about the functionality you need. I'll give him a link to this forum. 2 1 Quote Link to comment Share on other sites More sharing options...
carrots Posted August 23 Share Posted August 23 On 8/14/2025 at 7:33 PM, MJonathan said: Sorry Carrots! the SetLocked method is not working in PaintObjects, it has a bug! this unchecked and checked the lock icon in the interface, but if it is SetLocked(True), you can continue drawing in the object, that's wrong, if I manually click in that icon it works correctly, but no with coding. https://drive.google.com/file/d/1AwVX89QIhWH4poWDYlrYuW7ZVks1Upms/view?usp=sharing Please try this version, this error should be fixed in it. 1 Quote Link to comment Share on other sites More sharing options...
Advanced Member MJonathan Posted August 23 Advanced Member Share Posted August 23 SetLocked is working as expected in this 3dcoat version! thank you very much carrots! it will be very helpful 1 Quote Link to comment Share on other sites More sharing options...
Advanced Member MJonathan Posted Wednesday at 11:48 PM Advanced Member Share Posted Wednesday at 11:48 PM 3DCoat2025.15 has python issues! 1- Python console is lagging when starts to writing code. 2- I can't access to the PaintRoom methods. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.