예제 #1
0
 def execute(self, context):
     if "wol" in self.filepath:
         wow_hashes = popmap.create_wowlist(os.path.dirname(self.filepath))
         popmap.import_wol(self.filepath, context, wow_hashes)
         return {'FINISHED'}
     else:
         self.report({'ERROR'}, "Selected file does not contain 'wol'!")
         return {'CANCELLED'}
예제 #2
0
 def execute(self, context):
     wow_hashes = popmap.create_wowlist(self.directory)
     for file in os.listdir(self.directory):
         path = os.path.join(self.directory, file)
         if (os.path.isfile(path) and path.endswith(".dec")
                 and "wow" in path):
             try:
                 popmap.import_wow(path, context, self.textures_only,
                                   wow_hashes)
             except:
                 raise RuntimeError("Error while importing '" + file + "'!")
     return {'FINISHED'}
예제 #3
0
    def execute(self, context):
        if "wol_to_load" in context.active_object:
            path = context.active_object["wol_to_load"]
            # delete everything
            bpy.ops.object.mode_set(mode='OBJECT')
            for object in context.scene.objects:
                object.hide_set(False)
            bpy.ops.object.select_all(action='SELECT')
            bpy.ops.object.delete()

            wow_hashes = popmap.create_wowlist(os.path.dirname(path))
            popmap.import_wol(path, context, wow_hashes)
            return {'FINISHED'}
        else:
            self.report({'ERROR'}, "The selected object is not a valid "
                        "loading trigger!")
            return {'CANCELLED'}