1
$\begingroup$

I am scripting an addon to help with workflow and I cannot get the align_axis() param of the import image as the plane to work. It always aligns it to the main axis, I am trying to get it to align to a Z+ (So up.)

bpy.ops.import_image.to_plane(files=[{"name":scenename+".png", "name":scenename+".png"}], directory=filepath, shader="SHADELESS", align_axis="Z+")

Any help would be much appreciated as I cannot work out what I am doing wrong.

All the best.

$\endgroup$
2
  • 1
    $\begingroup$ Could you add a picture of result and expected result for one imported image. AFAICT this is working OK it aligns the normal of plane to the global z axis. $\endgroup$
    – batFINGER
    Commented Dec 5, 2019 at 4:45
  • $\begingroup$ Actually... It is working now, I guess I just needed to restart blender. Whoops. Rookie mistake, Thanks for letting me know. $\endgroup$
    – Falcon
    Commented Dec 5, 2019 at 4:49

1 Answer 1

0
$\begingroup$

Code works as intended. Just had to restart blender for change to my script to take effect.

$\endgroup$
1
  • 1
    $\begingroup$ Oh ok, in 2.79x F8 key would reload scripts via operator bpy.ops.scripts.reload() can remake the shortcut, call this in python console, or append a button for it say in text editor header to avoid having to close/restart blender for every addon edit. (will depend somewhat on error and how you import in addon, see how a lot of addons use imp.reload) $\endgroup$
    – batFINGER
    Commented Dec 5, 2019 at 4:53

You must log in to answer this question.

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