Hello, I want to import animPicker data from saved file with python command
I searched for forum and found
from mgear import anim_picker
what is the command to import data ?
I looked for official documents but I couldn’t find
thank you
Hello, I want to import animPicker data from saved file with python command
I searched for forum and found
from mgear import anim_picker
what is the command to import data ?
I looked for official documents but I couldn’t find
thank you
Not sure if working as never used it… but just in case.
import mgear.shifter.custom_step as cstp
from mgear.anim_picker import picker_node
from mgear.anim_picker.handlers import file_handlers
import pymel.core as pm
import os
class CustomShifterStep(cstp.customShifterMainStep):
def __init__(self):
self.name = "anim_picker"
def run(self, stepDict):
"""Run method.
i.e: stepDict["mgearRun"].global_ctl gets the global_ctl from
shifter rig build bas
i.e: stepDict["mgearRun"].components["control_C0"].ctl gets the
ctl from shifter component called control_C0
i.e: stepDict["otherCustomStepName"].ctlMesh gets the ctlMesh
from a previous custom step called "otherCustomStepName"
Arguments:
stepDict (dict): Dictionary containing the objects from
the previous steps
Returns:
None: None
"""
file_path = os.path.join(stepDict["paths"].custom_steps_base_path,
"chara",
"_shared",
"data",
"biped.pkr")
pkr_data = file_handlers.read_data_file(file_path)
node = picker_node.DataNode()
node.create()
node.write_data(data=pkr_data)
node.read_data()
pm.parent(node, "rig")
pm.setAttr("PICKER_DATAS.picker_datas_file", file_path, type="string")
pm.rename(node, "PICKER_DATA_BIPED")
Thank you so much
It worked!!