mgear-dev / shifter_classic_components

Components library for Shifter
MIT License
1 stars 10 forks source link

Control_01 component space switching with mgear viewport menu #82

Closed miquelcampos closed 3 years ago

miquelcampos commented 4 years ago

reported in the forum: http://forum.mgear-framework.com/t/control-01-component-space-switching-with-mgear-viewport-menu/1634

tldr: The space/ref attributes created by the control_01 component do not follow the logic expected by the “mgear viewport menu” (mgear.core.dagmenu.py) for switching spaces/refs.

For this example, let’s say you’re using a control_01 component and have named it “sword”.

Issue 1 The enum attribute that holds the space or “ikref” node names is being named “control_ikref”, rather than “sword_ikref”. Therefore, when the code is trying to determine the space attribute name, it is looking for: sword_C0_ctl.control_C0_ctl (where the control name exists but the attribute does not)

Issue 2 The space switching code is looking for an extra token in the control name, which doesn’t get created. The component creates: “sword_C0_ctl” The space switching code is looking for “sword_C0_ik_ctl”.

Issue 3 The component is creating a “control_control” attr rather than an expected “sword_sword” attr.

Workaround

Rename the control: “sword_C0_ctl” -> “sword_C0_ik_ctl” Rename attributes: “sword_C0_ctl” -> “sword_C0_ik” (string value of “sword_C0_ik_ctl,”) “control_ikref” -> “sword_ikref” “control_control” -> “sword_sword” To Repro

Import biped template (this isnt absolutely necessary, but gives a starting point". Add a control_01 component Rename the component to “sword” (Settings -> Main Settings) Set the Channel Host to itself (“sword_C0_root”) Add some nodes to the IK Reference Array (In Component Settings) Build Rig Toggle On mGear -> mGear Viewport Menu Select “sword_C0_ctl”, right click, and set to a different parent ik space

miquelcampos commented 3 years ago

fixed on https://github.com/mgear-dev/mgear_core/issues/62