Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Armature support #6

Merged
merged 2 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions io_scene_pyrogenesis/import_pyrogenesis_actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,15 @@ def get_props_from_variant(self, root):

return childProps

def mesh_uv_layers_names_update(self, mesh: bpy.types.Mesh):
if len(mesh.uv_layers) > 0:
self.logger.info("Renaming" + mesh.uv_layers[0].name + " to " + "UVMap")
mesh.uv_layers[0].name = "UVMap"

if len(mesh.uv_layers) > 1:
self.logger.info("Renaming" + mesh.uv_layers[1].name + " to " + "AOMap")
mesh.uv_layers[1].name = "AOMap"

def parse_actor(
self, root, proppoint="root", parentprops=[], rootObj=None, propDepth=0
):
Expand Down Expand Up @@ -465,23 +474,8 @@ def parse_actor(

backup = bpy.context.selected_objects.copy()
for b in backup:
if (
b.data is None
or b.data.uv_layers is None
or not len(b.data.uv_layers)
):
continue
if len(b.data.uv_layers) > 0:
self.logger.info(
"Renaming" + b.data.uv_layers[0].name + " to " + "UVMap"
)
b.data.uv_layers[0].name = "UVMap"

if len(b.data.uv_layers) > 1:
self.logger.info(
"Renaming" + b.data.uv_layers[1].name + " to " + "AOMap"
)
b.data.uv_layers[1].name = "AOMap"
if b.type == "MESH":
self.mesh_uv_layers_names_update(b.data)

# Get those objects
imported_objects = bpy.context.selected_objects.copy()
Expand Down
2 changes: 1 addition & 1 deletion io_scene_pyrogenesis/max_collada_fixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def indent(self, elem, level=0):

def __init__(self, file_path=None):
self.file_path = file_path
self.logger = logging.getLogger("PyrogenesisActorImporter." % __name__)
self.logger = logging.getLogger(f"PyrogenesisActorImporter.{__name__}")

def execute(self):
import xml.etree.ElementTree as ET
Expand Down
Loading