0
$\begingroup$

enter image description hereCan't seem to get this script to work please help.

I think it's got some thing to do with opening a blend file and it not being able to carry on with the script.

import bpy

bpy.ops.wm.open_mainfile(filepath="Z:\\Projects\\Test\\blend\\template\\template.blend", filter_blender=True, filter_backup=False, filter_image=False, filter_movie=False, filter_python=False, filter_font=False, filter_sound=False, filter_text=False, filter_btx=False, filter_collada=False, filter_alembic=False, filter_folder=True, filter_blenlib=False, filemode=8, display_type='DEFAULT', sort_method='FILE_SORT_ALPHA', load_ui=True, use_scripts=True)

bpy.ops.wm.alembic_import(filepath="Z:\\Projects\\Test\\abc\\A\\box.abc", relative_path=True, as_background_job=False)

bpy.ops.wm.save_as_mainfile(filepath="Z:\\Projects\\Test\\blend\\A\\A.blend", check_existing=True, filter_blender=True, filter_backup=False, filter_image=False, filter_movie=False, filter_python=False, filter_font=False, filter_sound=False, filter_text=False, filter_btx=False, filter_collada=False, filter_alembic=False, filter_folder=True, filter_blenlib=False, filemode=8, display_type='DEFAULT', sort_method='FILE_SORT_ALPHA', compress=False, relative_remap=True, copy=False, use_mesh_compat=False)

$\endgroup$
4
  • $\begingroup$ Please add a screenshot of the actual error message to your question. Also, if that's only a section of your python code, please include all of the relevant bits. As a guess, your problem is that you're not escaping '\' (backslash) characters. Either change you filepath strings to have \\ everywhere you now have \ or put an r in front of the opening double quote. $\endgroup$ Oct 21 at 22:15
  • $\begingroup$ Added the image, I can run each line on it's own but the moment I open a scene and the import it gives me issues. $\endgroup$
    – Linton
    Oct 22 at 7:12
  • $\begingroup$ Dupe, different operator, same issue. Can copy the text of an error message from system console and post as text. (in a code bleck) blender.meta.stackexchange.com/questions/2788/… $\endgroup$
    – batFINGER
    Oct 22 at 11:29
  • $\begingroup$ Sorry, I wasn't aware. I was read screenshot and did exactly that. $\endgroup$
    – Linton
    Oct 22 at 12:41

Browse other questions tagged or ask your own question.