Skip to content

Commit

Permalink
Simplify imports a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
StanleySweet committed Aug 4, 2024
1 parent 45309bb commit d95df43
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions io_scene_pyrogenesis/ImportPyrogenesisActor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
# This file is part of 0 A.D.
# SPDX-License-Identifier: GPL-2.0-or-later

from . import MaxColladaFixer
import bpy
import bpy_extras
import logging
import math
import os
from . import MaxColladaFixer

import random
import xml.etree.ElementTree as ET

class ImportPyrogenesisActor(bpy.types.Operator, bpy_extras.io_utils.ImportHelper):
"""Load a Pyrogenesis actor file"""
Expand Down Expand Up @@ -221,8 +223,6 @@ def assign_material_to_object(self, ob, material_name):
ob.data.materials.append(mat)

def import_pyrogenesis_actor(self, context):
import xml.etree.ElementTree as ET

self.logger.info("loading " + self.filepath + "...")

self.currentPath = (self.filepath[0 : self.filepath.find("actors")]).replace(
Expand Down Expand Up @@ -278,8 +278,6 @@ def create_custom_mesh(self, objname, px, py, pz, width, depth):
return myobject

def get_element_from_variant(self, root, name):
import xml.etree.ElementTree as ET

for child in root:
if child.tag == name:
return child
Expand All @@ -297,8 +295,6 @@ def get_mesh_from_variant(self, root):
return self.get_element_from_variant(root, "mesh")

def get_textures_from_variant(self, root):
import xml.etree.ElementTree as ET

child_textures = None
for child in root:
if child.tag == "textures":
Expand All @@ -319,8 +315,6 @@ def get_textures_from_variant(self, root):
return child_textures

def get_props_from_variant(self, root):
import xml.etree.ElementTree as ET

childProps = None
for child in root:
if child.tag == "props":
Expand All @@ -344,10 +338,6 @@ def get_props_from_variant(self, root):
def parse_actor(
self, root, proppoint="root", parentprops=[], rootObj=None, propDepth=0
):
import xml.etree.ElementTree as ET
import bpy
import random
import math

meshprops = []
imported_props = []
Expand Down

0 comments on commit d95df43

Please sign in to comment.