EpicGamesExt / BlenderTools

Blender addons that improve the game development workflow between Blender and Unreal.
https://epicgamesext.github.io/BlenderTools/
MIT License
2.79k stars 58 forks source link

UE to Rigify - Edit viewport display options in each mode #153

Closed drichardson closed 1 year ago

drichardson commented 3 years ago

Summary

In Source to Deform mode, start linking nodes. In some situations, the red wireframe picker control is completely obstructed by DEF bones. In my specific case, I was using the HeroFPP skeleton from Epic's ShooterGame sample game.

Steps to Reproduce

  1. Open new blank Blender file
  2. Import Bug Repro Template.zip in ue2rigify preferences.
  3. Import FPP_RifleAim.FBX (contains a preview skeletal mesh and animation).
  4. In UE to Rigify Toolkit UI, select b_Root as the Source and Bug repro template as the Template.
  5. Switch to Source to Deform mode. You should see a partially complete Source to Deform mapping.
  6. Find b_RightForeArm source bone. Note the red picker control is not visible.
  7. Select DEF-upper_arm.R.001 and press H to hide. Note you can now see b_RightForeArm's picker control.

Workarounds

Either hide the DEF bone obstructing the red picker control or increase the scale of the picker. See screenshots.

Screenshots

Notice the b_LeftArmRoll picker is hidden by the green DEF bone.

Cannot see b_LeftArmRoll picker control

Hiding the DEF bone makes b_LeftArmRoll picker visible.

DEF bone hidden picker now visible

Alternatively, increasing the custom shape scale of the b_LeftArmRoll picker bone makes it visible.

Increase Custom Shape Scale to See

drichardson commented 3 years ago

I'm not sure if this is possible, but ideally the wireframe controls would always render on top of everything else.

james-baber commented 3 years ago

I believe both are bones with blenders x-ray view option turned on, I am not sure if Blender allows you to specify xray layer, but it is something worth looking into. Here you can see this massive function (that really needs to be refactored) sets the viewport settings on mode changes https://github.com/EpicGames/BlenderTools/blob/f27e77e7e29e5aa1a73ef47142e25f905f458ae7/ue2rigify/addon/functions/utilities.py#L144

I have these settings being read from a separate settings file https://github.com/EpicGames/BlenderTools/blob/f27e77e7e29e5aa1a73ef47142e25f905f458ae7/ue2rigify/addon/settings/viewport_settings.py#L77

Although you should be able to work around all these issues from within the viewport, it would be nice to switch/edit viewport options in the addon preferences. I abstracted these display options here, but haven't gotten around to writing a "theme" file. Ideally I think this would be a json file that maybe lives in resources/themes/theme_name01.json. There would need to be some UI for saving/editing theme files, and that set_viewport_settings will need to support more granular options, like spheres or cube, or size/color options, etc. But if you or anyone else would like to submit a PR that allows the user to edit these viewport options I think it would be very useful to have especially in situations like this where different rigs can obstruct your view

drichardson commented 3 years ago

I believe both are bones with blenders x-ray view option turned on

X-ray on/off seems to effect partially hidden picker bones, but not completely hidden bones. The b_RightArmRoll picker control is not visible in either of the screenshots below. The source bone just below DEF-upper_arm.R.001, on the other hand, does slightly change when X-ray mode is toggled.

X Ray Off

X Ray Off

X Ray On

X Ray On

james-baber commented 3 years ago

Looks more like an issue with the layering of blenders viewport. The addon doesn't hide those bones, they are still visible, just seems like they are obstructed from view in this case. Changing the bones display from octahedral to stick makes them view able in this case without changing the actual hide value on the bone. image

image

This is why i think it would be cool have some viewport setting so you could make persistent changes to the viewport if you like when switching modes. Like setting the default to stick, etc.