I work with an add on for Blender and after hours of debugging I finally found the culprit. It's the localisation. For Example:
When i add a modificator, i. e. "Smooth" it is added as "Weich" in the german localisation. So far, so good. But if the coder uses another language as the user (coder: english,user: german) in lines such as
bpy.ops.object.modifier_add(type="REMESH")
bpy.context.object.modifiers["Remesh"].mode = "SMOOTH"
you get an error, that blender can't find the keyword "Remash", which is understandable, because the correct keyword would be "Weich" if you selected the german localisation.
My questions are:
- Is there a way to list all installed localisation?
- is there a way to check for the chosen localisation at the start of a script?
thanks in advance
modifier = obj.modifiers.new(type='REMESH', name="whatever")
and thenmodifier.mode = 'SMOOTH'
$\endgroup$Remesh.001
, and you'd end up changing the wrong one. In general, you should never assume that anything you create through Python actually has the name you requested, because it will be changed automatically if it clashes with an existing name. $\endgroup$