1
$\begingroup$

Every time I create a script to create text it adds the text into layer 1, when in fact I am working in layer 3. I realize the "True" relates to layer 1, so I possibly require a script in its place.?

bpy.ops.object.text_add(
        radius=3, 
        view_align=True,
        enter_editmode=False,  
        layers=(True, False, False, False, 
                False, False, False, False,
                False, False, False, False, 
                False, False, False, False,
                False, False, False, False))

bpy.ops.transform.translate(
        value=(0, 0, 2), 
        constraint_axis=(False, False, True), 
        constraint_orientation='LOCAL',
        mirror=False,
        proportional='DISABLED',
        proportional_edit_falloff='SMOOTH',
        proportional_size=1)
$\endgroup$
  • $\begingroup$ Related blender.stackexchange.com/questions/34319/… $\endgroup$ – batFINGER Mar 10 '19 at 11:13
  • $\begingroup$ I have mistakenly killed my 2.79 version with a lib update... so I can't test right now. Try bpy.ops.object.text_add() and see which layer it adds it to (given what layer you are on) or use layers = bpy.context.scene.layers to put the object on the same layers as the current scene. This could be the default...IIRC $\endgroup$ – batFINGER Mar 10 '19 at 11:20
  • $\begingroup$ Unfortunately it still throws the text into layer 1.. $\endgroup$ – Michael Teiniker Mar 10 '19 at 20:16

Your Answer

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

Browse other questions tagged or ask your own question.