コード例 #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):
        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'}