1
$\begingroup$

I am new to blender/python api. I am trying to import an object into blender using python api, and I keep getting syntax errors. Here is what it looks like:

import bpy
from mathutils import Matrix, Vector
from math import radians

context = bpy.context
scene = context.scene

bpy.ops.import_scene.obj(obj()
bpy.ops.import_scene.obj(filepath="//OBJECTS/Boat_OBJ.rar Folder/Boat.obj", filter_glob="*.obj", use_ngons=True, use_edges=True, use_smooth_groups=True, use_split_objects=True, use_split_groups=True, use_groups_as_vgroups=False, use_image_search=True, split_mode='ON', global_clamp_size=0, axis_forward='-Z', axis_up='Y')

The above gives me syntax errors. Thanks in advance for any help!

$\endgroup$
2
  • $\begingroup$ Can you use the code formatting option and re-add your code with the correct line breaks etc? $\endgroup$
    – Sazerac
    Commented Jun 21, 2019 at 6:42
  • 1
    $\begingroup$ This line bpy.ops.import_scene.obj(obj() will produce errors and can be erased. Despite the 2.78 title the answers here are still valid blender.stackexchange.com/questions/72928/… (probable duplicate) $\endgroup$
    – batFINGER
    Commented Jun 21, 2019 at 8:35

0

You must log in to answer this question.

Browse other questions tagged .