Example #1
0
    def execute(self, context):
        importer = vmd_importer.VMDImporter(filepath=self.filepath, scale=self.scale, frame_margin=self.margin)
        for i in context.selected_objects:
            importer.assign(i)
        if self.update_scene_settings:
            auto_scene_setup.setupFrameRanges()
            auto_scene_setup.setupFps()

        return {'FINISHED'}
    def execute(self, context):
        importer = vmd_importer.VMDImporter(filepath=self.filepath,
                                            scale=self.scale,
                                            frame_margin=self.margin)
        for i in context.selected_objects:
            importer.assign(i)
        if self.update_scene_settings:
            auto_scene_setup.setupFrameRanges()
            auto_scene_setup.setupFps()

        return {'FINISHED'}
Example #3
0
    def execute(self, context):
        obj = context.active_object
        root = mmd_model.Model.findRoot(obj)
        rig = mmd_model.Model(root)
        importer = vmd_importer.VMDImporter(filepath=self.filepath, scale=root.mmd_root.scale, frame_margin=self.margin)
        arm = rig.armature()
        t = arm.hide
        arm.hide = False
        importer.assign(arm)
        arm.hide = t
        for i in rig.meshes():
            t = i.hide
            i.hide = False
            importer.assign(i)
            i.hide = t
        if self.update_scene_settings:
            auto_scene_setup.setupFrameRanges()
            auto_scene_setup.setupFps()

        return {'FINISHED'}
Example #4
0
    def execute(self, context):
        selected_objects = set(context.selected_objects)
        for i in frozenset(selected_objects):
            root = mmd_model.Model.findRoot(i)
            if root == i:
                rig = mmd_model.Model(root)
                selected_objects.add(rig.armature())
                selected_objects.add(rig.morph_slider.placeholder())
                selected_objects |= set(rig.meshes())

        bone_mapper = None
        if self.bone_mapper == 'PMX':
            bone_mapper = makePmxBoneMap
        elif self.bone_mapper == 'RENAMED_BONES':
            bone_mapper = vmd_importer.RenamedBoneMapper(
                rename_LR_bones=self.rename_bones,
                use_underscore=self.use_underscore,
                translator=DictionaryEnum.get_translator(self.dictionary),
            ).init

        start_time = time.time()
        importer = vmd_importer.VMDImporter(
            filepath=self.filepath,
            scale=self.scale,
            bone_mapper=bone_mapper,
            use_pose_mode=self.use_pose_mode,
            frame_margin=self.margin,
            use_mirror=self.use_mirror,
        )

        for i in selected_objects:
            importer.assign(i)
        logging.info(' Finished importing motion in %f seconds.',
                     time.time() - start_time)

        if self.update_scene_settings:
            auto_scene_setup.setupFrameRanges()
            auto_scene_setup.setupFps()
        context.scene.frame_set(context.scene.frame_current)
        return {'FINISHED'}
    def execute(self, context):
        obj = context.active_object
        root = mmd_model.Model.findRoot(obj)
        rig = mmd_model.Model(root)
        importer = vmd_importer.VMDImporter(filepath=self.filepath,
                                            scale=root.mmd_root.scale,
                                            frame_margin=self.margin)
        arm = rig.armature()
        t = arm.hide
        arm.hide = False
        importer.assign(arm)
        arm.hide = t
        for i in rig.meshes():
            t = i.hide
            i.hide = False
            importer.assign(i)
            i.hide = t
        if self.update_scene_settings:
            auto_scene_setup.setupFrameRanges()
            auto_scene_setup.setupFps()

        return {'FINISHED'}
Example #6
0
 def execute(self, context):
     auto_scene_setup.setupFrameRanges()
     auto_scene_setup.setupFps()
     return {'FINISHED'}
Example #7
0
 def execute(self, context):
     auto_scene_setup.setupFrameRanges()
     auto_scene_setup.setupFps()
     return {'FINISHED'}