0
$\begingroup$

I'm trying to add the Line art crease angle to my viewport panel. I thought it should be fairly straightforward. When I change it to 180 degrees using the slider control I get this in the console area:

bpy.context.object.grease_pencil_modifiers["Line Art"].crease_threshold = 3.14159

Of course the value is in radians and not degrees, but the slider display is in degrees. All well and good. But when I place in in a panel thusly:

col.prop(bpy.data.objects["Line Art Thin"].grease_pencil_modifiers["Line Art"], "crease_threshold")

I get a nice control, which has the degrees shown, and I can manually enter the value by typing in it, but the slider control does not work. What is the best way to remedy this situation?

$\endgroup$
1
1
$\begingroup$

Thanks to batfinger for pointing me to that link. The answer is straightforward:

col.prop(bpy.data.objects["Line Art Thin"].grease_pencil_modifiers["Line Art"], "crease_threshold", slider=True)

It needed to have the slider=True appended.

$\endgroup$
1
  • $\begingroup$ Possibly worth mentioning that this works because the property is a 'ROTATION' type. If the scene unit designated to rotations is degrees (default) it will display as degrees. $\endgroup$
    – batFINGER
    Jul 30 at 10:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.