Skip to content

Commit

Permalink
Merge pull request #196 from Simarilius-uk/OS_support
Browse files Browse the repository at this point in the history
Get the autofitter working again. Think it works now.
  • Loading branch information
Simarilius-uk authored Jan 19, 2025
2 parents cb3109c + bb078f5 commit fc40c86
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions i_scene_cp77_gltf/meshtools/meshtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def CP77UvChecker(self, context):
texture_node.location = (-200, 0)
texture_node.image = image
# Connect the texture node to the shader node
shader_node = uvchecker.node_tree.nodes["Principled BSDF"]
shader_node = uvchecker.node_tree.nodes[loc("Principled BSDF")]
uvchecker.node_tree.links.new(texture_node.outputs['Color'], shader_node.inputs['Base Color'])
for mesh in selected_meshes:
mat_assigned = False
Expand Down Expand Up @@ -231,6 +231,7 @@ def applyRefitter(obj):
bpy.ops.object.shape_key_remove(all=False)
newnames = getShapeKeyNames(obj)
setActiveShapeKey(obj, 'Basis')
bpy.context.view_layer.objects.active = obj
bpy.ops.object.shape_key_remove(all=False)
for name in newnames:
if 'AutoFitter' in name:
Expand Down Expand Up @@ -353,11 +354,12 @@ def setup_lattice(r_c, fbx_rot, lattice_object_name, target_body_name, control_p
lattice.interpolation_type_w = lattice_interpolation_w

# Create a flat list of lattice points
lattice_points = lattice.points
flat_lattice_points = [lattice_points[w + v * lattice.points_u + u * lattice.points_u * lattice.points_v] for u in range(lattice.points_u) for v in range(lattice.points_v) for w in range(lattice.points_w)]

for control_point, lattice_point in control_points, flat_lattice_points:
for control_point, lattice_point in zip(control_points, flat_lattice_points):
lattice_point.co_deform = control_point

if new_lattice:
bpy.context.object.hide_viewport = True
return new_lattice
return new_lattice

0 comments on commit fc40c86

Please sign in to comment.