Skip to content
Snippets Groups Projects
Commit 87e698f1 authored by Campbell Barton's avatar Campbell Barton
Browse files

fix [#27149] OBJ import does not import OBJ vertex/poly groups, produces error messages

disable polygroup by default too.
parent 48d34bac
Branches
No related tags found
No related merge requests found
...@@ -66,7 +66,7 @@ class ImportOBJ(bpy.types.Operator, ImportHelper): ...@@ -66,7 +66,7 @@ class ImportOBJ(bpy.types.Operator, ImportHelper):
# KEEP_VERT_ORDER = BoolProperty(name="Keep Vert Order", description="Keep vert and face order, disables split options, enable for morph targets", default= True) # KEEP_VERT_ORDER = BoolProperty(name="Keep Vert Order", description="Keep vert and face order, disables split options, enable for morph targets", default= True)
ROTATE_X90 = BoolProperty(name="-X90", description="Rotate X 90.", default=True) ROTATE_X90 = BoolProperty(name="-X90", description="Rotate X 90.", default=True)
CLAMP_SIZE = FloatProperty(name="Clamp Scale", description="Clamp the size to this maximum (Zero to Disable)", min=0.0, max=1000.0, soft_min=0.0, soft_max=1000.0, default=0.0) CLAMP_SIZE = FloatProperty(name="Clamp Scale", description="Clamp the size to this maximum (Zero to Disable)", min=0.0, max=1000.0, soft_min=0.0, soft_max=1000.0, default=0.0)
POLYGROUPS = BoolProperty(name="Poly Groups", description="Import OBJ groups as vertex groups.", default=True) POLYGROUPS = BoolProperty(name="Poly Groups", description="Import OBJ groups as vertex groups.", default=False)
IMAGE_SEARCH = BoolProperty(name="Image Search", description="Search subdirs for any assosiated images (Warning, may be slow)", default=True) IMAGE_SEARCH = BoolProperty(name="Image Search", description="Search subdirs for any assosiated images (Warning, may be slow)", default=True)
def execute(self, context): def execute(self, context):
......
...@@ -857,7 +857,7 @@ def create_mesh(new_objects, has_ngons, CREATE_FGONS, CREATE_EDGES, verts_loc, v ...@@ -857,7 +857,7 @@ def create_mesh(new_objects, has_ngons, CREATE_FGONS, CREATE_EDGES, verts_loc, v
# content of the vertex_groups. If the user selects to NOT have vertex groups saved then # content of the vertex_groups. If the user selects to NOT have vertex groups saved then
# the following test will never run # the following test will never run
for group_name, group_indices in vertex_groups.items(): for group_name, group_indices in vertex_groups.items():
group = ob.vertex_groups.new(group_name) group = ob.vertex_groups.new(group_name.decode('utf-8', "replace"))
group.add(group_indices, 1.0, 'REPLACE') group.add(group_indices, 1.0, 'REPLACE')
...@@ -1209,7 +1209,7 @@ def load(operator, context, filepath, ...@@ -1209,7 +1209,7 @@ def load(operator, context, filepath,
if context_parm.lower() == b'u': if context_parm.lower() == b'u':
context_nurbs.setdefault(b'parm_u', []).extend([float_func(f) for f in line_split]) context_nurbs.setdefault(b'parm_u', []).extend([float_func(f) for f in line_split])
elif context_parm.lower() == b'v': # surfaces not suported yet elif context_parm.lower() == b'v': # surfaces not supported yet
context_nurbs.setdefault(b'parm_v', []).extend([float_func(f) for f in line_split]) context_nurbs.setdefault(b'parm_v', []).extend([float_func(f) for f in line_split])
# else: # may want to support other parm's ? # else: # may want to support other parm's ?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment