UltiMaker uses functional, analytical and tracking cookies. Tracking cookies enhance your experience on our website and may also collect your personal data outside of Ultimaker websites. If you agree with the use of tracking cookies, click “I agree, continue browsing”. You can withdraw your consent at any time. If you do not consent with the use of tracking cookies, click “Refuse”. You can find more information about cookies on our Privacy and Cookie Policy page.
Query per-object settings for post-processing script development
So basicly, you can get all the keys of a profile by using getAllKeys().
So you would need to do something like:
for container in stack:for setting_key in container.getAllKeys():print(f"{container.getName()}: {setting_key}: {container.getProperty(setting_key, 'value')}")
I didn't actually check that code, so you might need to change some things to get that to work.
If you want to know if an object has per object settings, you wil need to check it's decorator. So you will need to loop over all objects in the scene and check if they have any settings in their per object stack. There isn't a global function to get all of them (as we only do this in the CuraEngine plugin and it's never re-used anywhere else)
Edited by nallath
1
Link to post
Share on other sites
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
In this stable release, Cura 5.3 achieves yet another huge leap forward in 3D printing thanks to material interlocking! As well as introducing an expanded recommended print settings menu and lots of print quality improvements. Not to mention, a whole bunch of new printer profiles for non-UltiMaker printers!
Are you a fan of tree support, but dislike the removal process and the amount of filament it uses? Then we would like to invite you to try this special release of UltiMaker Cura. Brought to you by our special community contributor @thomasrahm
We generated a special version of Cura 5.2 called 5.3.0 Alpha + Xmas. The only changes we introduced compared to UltiMaker Cura 5.2.1 are those which are needed for the new supports. So keep in mind, this is not a sneak peek for Cura 5.3 (there are some really cool new features coming up) but a spotlight release highlighting this new version of tree supports.
Recommended Posts
nallath 1,113
You might also want to check the godmode plugin, which already does some of the things that you're asking for (https://github.com/sedwards2009/cura-god-mode-plugin)
Walking over all stacks and figuring if they have an actual value set is done (although with more logic than you would need) in the SettingInheritanceManager: https://github.com/Ultimaker/Cura/blob/f130eb2e7cafdec78849d5763f2914d609691718/cura/Settings/SettingInheritanceManager.py#L171
So basicly, you can get all the keys of a profile by using getAllKeys().
So you would need to do something like:
I didn't actually check that code, so you might need to change some things to get that to work.
If you want to know if an object has per object settings, you wil need to check it's decorator. So you will need to loop over all objects in the scene and check if they have any settings in their per object stack. There isn't a global function to get all of them (as we only do this in the CuraEngine plugin and it's never re-used anywhere else)
Link to post
Share on other sites