2
$\begingroup$

I have enabled the freestyle SVG add-on. I can set the 'Line thickness' in the 'Render' tab. But, I would like to change this value using a python script. I can't find an example of this.

Does anyone know how to change the line thickness via script?

$\endgroup$

1 Answer 1

2
$\begingroup$

If you mouse over a field in blender it, amongst other things, gives you the script path

enter image description here

bpy.data.scenes["Scene"].render.line_thickness

For most scripts we use context. If we are in scene "Scene" it is the context scene, rather than look it up from bpy.data.scenes

import bpy
from bpy import context # for testing
scene = context.scene
#set line thickness to 2.0
scene.render.line_thickness = 2.0

Or in the python console, where C = bpy.context for convenience.

>>> C.scene.render.line_thickness
1.0

>>> C.scene.render.line_thickness = 3.0
$\endgroup$
1
  • $\begingroup$ Stupidly, I never actually noticed that! (Ohps.) - Thankyou. $\endgroup$
    – James
    Commented Sep 5, 2016 at 10:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .