1

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!

Scott
  • 11
  • 2
  • Can you use the code formatting option and re-add your code with the correct line breaks etc? – Sazerac Jun 21 '19 at 06:42
  • 1
    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 https://blender.stackexchange.com/questions/72928/blender-2-78-obj-import-via-script (probable duplicate) – batFINGER Jun 21 '19 at 08:35

0 Answers0