2
$\begingroup$

Why doesn't

bpy.ops.wm.save_as_mainfile(filepath="D:/ddd/test_v1.blend")"

work in UI panel?

I need to add a new button in the render panel which sends the current file to a network location.

$\endgroup$
1
  • $\begingroup$ Is the " after the ) a typo? $\endgroup$ May 17, 2020 at 3:50

1 Answer 1

2
$\begingroup$

Use backslashes (\) instead of forward slashes (/). Also you need to either escape special characters, or use (') instead of ("). The following code should work:

bpy.ops.wm.save_as_mainfile(filepath='D:\ddd\test_v1.blend')

or escaping characters

bpy.ops.wm.save_as_mainfile(filepath="D:\\ddd\\test_v1.blend")
$\endgroup$

You must log in to answer this question.

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