1
$\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
$\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$
  • $\begingroup$ Stupidly, I never actually noticed that! (Ohps.) - Thankyou. $\endgroup$ – James Sep 5 '16 at 10:51

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.