Blender: The Madness Returns


#1

So after taking few months break from messing around with Blender Armatures and the sort…

<img src="/uploads/highfidelity/4163/6cb6c403e77b8f69.gif" width=“500” height=“284” alt="The Madness is back!’>

Lets actually try to find a true solution for cross-compatibility and end this madness.

Recap

So earlier we discovered with @davedub walkTool.js script that there are have some odd angles for extremities which are go off the main hips-spine-neck chain with blender avatar. @davedub eventually created a temporary solution for the walk script with a set of “rotation offsets” which came around from my results of the mad experiments. It workable for now, but its not enough in the long term.

This normally would seriously indicate that there still is an exporting issue of what axis to use, as the fbx (re)viewer seems to interpret the fbx just fine. My earliest guess pointed to a disparity between rotation types of the Blender and Maya FBX exporting, mostly PrePostRotation, as simulating the lack of such resulted the same result with mixamo avatars in Blender as with avatars which are brought in from Blender to High Fidelity. But we need to make sure this is actually true. I tried to validate it earlier by creating a hack work around, but it was spotty at best.

This was further reinforced after I went in and digged at the Rotations in the mixamo avatar template versus the re-exported version from Blender. All the rotations were sound, except for the bones that were pointing towards the X Axis. But that was with my own Rotation settings, and those we also, reverse engineered earlier.

The Rotations difference in the raw files for the first Left and Right bones were radically off by
180 degrees in all axises (in different directions) aside from the “LCL Rotation” vs “PreRotation” use definition: Otherwise all the other rotations were close to each other in rotation without much difference…

Another discovery through the walk script was that avatar skeletons actually are base on absolute frame to the relative rotation of the avatar so regardless of the way how the rest position is in blender, the rotation of armatures will always be forced to a specific rotation. This is most noticeable with my Fen Avatar’s legs being straight as if it was plantigrade using the walkscript, even thought they are made to be Digitgrade.

With also the avatar being half way to the ground, there must be another explanation to this, including simply being axing being off: since incorrect axis for the avatars has had some weird results as @Judas discovered.

Now that we have some new debugging tools, its time to actually take them and test them.
To make sure of that my earlier guess is still accurate, I’m going run through new Brutal experiments:

As a rule of thumb, in this test, We are using my Box Avatar Model set, throwing away all my earlier work arounds and starting with absolute 0,0,0 positions and rotations and default settings.

What actually might be putting us all off is the fact the Hips are hard controlled system to always point forward, and rotated specifically.

Lets Brute Force

Lets try to do this documentation together, so

What we are going to do is ** go through All 16 24 variations of different world axies** for the models, without leaf orientation. and post the results here.

Control - http://www.norteclabs.com/HF/labs/tests/skinning_test_mixamo_autorig.fst?V11 - Test avatar running on Mixamo Autorig mesh. Control “normal Avatar”

Here is a base model you can import and export from blender as fbx
https://dl.dropboxusercontent.com/u/52871969/community_test.blend

Test Instructions:

  1. Open Blend
  2. Select the entire scene
  3. Export as FBX, Make sure no leaf bones. Or just make a script to export them all http://www.norteclabs.com/HF/experiment/ExportFBX.py
  4. Pick a non-tested Axis
  5. Import into Hifi via Model Packager > Avatar With Head
  6. Reset all bones to 0 rotation ( @davedub’s script to zero the avatars bones )
  7. Answer the following questions
  8. Repeat if you are insane enough.

  • What Axises were used?
  • Does it look correct when all bones are set to 0? This includes position of the avatar as well as rotation
  • Does it look correct when animated using Animate Rig. Even if position or rotation of avatar is incorrect, if the animations are correct (no folding) then we are on to something.
  • Describe
  • Link to Model and fst

I will list the results in this gdoc


The main purpose of this test is to find closure of what is close and what is not close. Then use the “close” aproximates to create a potential fix for High Fidelity, or Blender export.


#2

Questions
were using the Base model blend file not the control right
are we exporting the entire scene lights and all?
import into hifi- using the package model?
Avatar body with head?
if so are you using a scale (arrived in world tiny)

fbx export as

were changing these parts


#3

I would like to contribute also.


#4
  • Blend file has all the extra unnecessary stuff removed. So it is everything in the blend file.
  • Import into hifi, means using the package model
  • Avatar body with head -> There shouldn’t be any other avatar type
  • Scale should be 1:1. Need to double check when I get home.

#5

Forgot that I should have just run through all the possible combinations using a script instead as it might be quicker. Derp. , as thus I did this within an hour.

But yeah, it seems the avatar is tiny now… which is odd since It used to work: Oh well, going to do it blind then.

Infact, the rexport method on the mixamo rigs seems to be causing the tiny avatars: seems just like the earlier bug I had with my avatar @chris! Might be something to do with the fst packager too.

Their Physics shapes is all over the place too
next time if something works ill put it in the marketplace for reference until any changes.

It used to work: Oh well, going to do all of these blind and using the new fun debug tools:


Specificially, Debug Draw Bind Pose, Debug Draw Animation

In anycase, with the help of using the new debug tool I was able to cycle through all the 16 different world axis rotations.

Unfortunately



I have come to a conclusion: If you have an avatar using absolute 0 rotation, and location, no blender world setting is correct.Closest I can get is

Forward = Y
Up = -X
In which the avatar is faced down, floating hips height above the floor
Rotations are needed to upright the avatar, but this still causes the avatar to float above the floor.
However the rotation is still incorrect, and requires a 90 degree correction…

Source files for the experiment available here:
http://www.norteclabs.com/HF/experiment/


#6

@Menithal, last week we have gotten the new animation system. It seems not all to work until now and some is fully new and will maybe change in the next time. My pose editor hasn’t worked more also for Mixamo avatars.

https://alphas.highfidelity.io/t/new-animation-system/7117


#7

I just noticed that I completely forgot 8 other possible variants x.x Derpaderpa. I need to go to bed. XD

ill do that tommorrow, or if someone can check all the Forward Z, and Forward -Z axises.

Edit:

I added all Z forward variants to
http://www.norteclabs.com/HF/experiment/
Folder

Further tests indicate that all Debug Skeletons align and face the right direction when using Blenders Default, as in:

Forward -Z
Up Y

Oddly enough, these are the same settings @Judas suggested when importing high fidelity avatar models into Blender.

However all the rotation directions for arms and legs are completely borked on the avatar it self (its hard to see, until they fix the tiny avatar issue), including animation Directions. And are not close to the discovery I made about counter rotating the avatar by -90.

However, Direction is correct, and Avatar Bounding box size seems to match avatar size. Without at all playing around with rotations. Requires more testing.

I will look into the rotation differences later today.


#8

The scaling issue is definitely present: At first I thought it had something to do with Unit scale, but it doesnt seem so. It has to do with something completely different. Only seems to happen with the Control test reexport FBX… Might be something do with the missing fingers, but I doubt it.

There seems to have been changes to the code again:

This is what I get for doing my tests while they are revamping the animation system

I ran through Leaf bone tests last night and got to the result is that yes, they do affect the rotation of the avatar as well, but landed up back to the result that no existing Blender FBX Export setting goes even close: All Blender avatars were still folded.

However what I found interesting was that the avatar skeleton in **debug for my fen avatar includes ** its Tail, Ear bones and extra eye socket bones included, and offsets included!.. Now if only the avatar would match the skeleton…

The Odd thing here is that with -ZY and my Custom avatar, the binding rig and the animation rig actually do not align.
Even though theoretically It should as only thing changed is the forward and up are switched. Another oddity there is the fact that, well. the avatar is offset from its skeleton…

Another thing I discovered is that the custom bones bone are not relatively rotating with the parent armatures on binding, causing my Tail to come out of the pelvis in the animated rig. I can Provide these to devs on demand (was that @hyperlogic ? ) .

As a Suggestion, the Bounding box should only be built using the humanoid rig: any extra limbs such as tails or ears currently increase the size of the avatar.

Notice how the name tag goes into its correct location.

Here are other stuff I need to try out:

  • OK. Checkout the recently updated http://blenderfbx.render.jp/ Edit: Had issues with shapekeys exporting.

  • OK. Replace packagename with mixamo.com to check how the fbx gets read then with global transforms (Mixamo hack in FBXReader) Edit: No effect

  • OK. Check the Rotation Differences between reexport -ZY, and Autorig

  • Take another break: wait for the Animation Rig changes to blow over before doing these again. Started these simply in the wrong time: Wasnt paying attention to the changes that would be coming


#9

#Update:

  • Small avatar issue seems completely random. I still havent figured out what causes it. all previous methods cause this on my end. Occasionally it doesn’t happen though. I have one export that literally “shrinks” after it is applied: Edit: it seems to have something to do with Leaf Bones.

  • Offset for the avatar still exists, and I think the name tag is again in the avatar due to it.

  • Basically Default Blender settings export, but remember to rotate the avatar 90 on export on the X axis. This means all the skeletons are aligned, and the avatar is not tiny, in specific cases, such as my control test (which seriously is wierd)

  • Here is a list of some of the rotation differences (Lcl Rotation = Blender Rexport, PreRotation = Mixamo Autorig)

Left Shoulder
P: “PreRotation”, “Vector3D”, “Vector”, “”,-19.4407875784882,5.0045223012982e-008,0.0502179513540034
P: “Lcl Rotation”, “Lcl Rotation”, “”, “A”,109.82890909905,91.0542900141938,1.30084282460113

Right Shoulder
P: “PreRotation”, “Vector3D”, “Vector”, “”,-70.1488928685856,-88.979431384796,178.678676366088
P: “Lcl Rotation”, “Lcl Rotation”, “”, “A”,109.851189176122,-91.0205625400723,-1.32127437500787

LeftUpLeg
P: “PreRotation”, “Vector3D”, “Vector”, “”,2.27804863475665,-0.0247413215694183,-179.37807713654
P: “Lcl Rotation”, “Lcl Rotation”, “”, “A”,4.63874133094755,0.169534526627267,-179.640286266128

RightUpLeg
P: “PreRotation”, “Vector3D”, “Vector”, “”,1.96432058155014,0.0213397680171732,179.377824788492
P: “Lcl Rotation”, “Lcl Rotation”, “”, “A”,4.39209679671605,-0.172604456535349,179.769650049008

As we can see there are some especially odd rotation differences between the lcl rotation and Pre-rotations of *UpLegs, which shouldn’t affect the legs so much, but it does…
While Left Shoulder and Right shoulder definitely explain the zombie arms. This supports the odd results I had when I actually replaced all of the instances of Lcl Rotation with Pre Rotation not fixing everything:

-If however I **disable Rig Animations the true binding pose of the avatar shows in debug, **and this matches the folded avatar…


This is odd, mostly because when the Rig Animations are turned on, the debug skeleton is correct

Infact, Now that I got the Avatar Orientations Correct…

There something totally off between these.

The Left Image is the avatar without Rig Animations. The Right Image is the avatar with Rig Animations.
The Dark Grey skeleton = Bind Skeleton, The Blue = Animated Skeleton.

  1. Tail is pointing the wrong direction, so are the Ears and the Nose bones. Aka all custom bones not same as their binding poses.
  2. The Rig Animation of the skeleton is mostly correctly animated. Infact its following the original bind pose which is very impressive… Unfortunately the avatar is not following this and is completely folded.
  3. When the Rig animation is off, the Animation Skeleton reminds me of the folded avatar… sorta facing the wrong direction…

Thats probably all ill look into this for now, some developer should look into this one… @chris Hopefully that one helps more than my previous looks into this.


#10

Some of the earlier issues I reported with debug skeleton are now outdated…


In anycase tried a small experiment: I imported one of my avatars to Maya LT (via FBX), and then rexported the model…

Unfortunately, same issues persist.
I even got the micro-avatar issue, even thought the original blender export had it solved this time.
The rotations of the limbs were also off, as if it the model was exported straight from Blender.

Unfortunately I dont have enough knowledge how to make an avatar from scratch on Maya LT, but from what @ozan shown us, it should also work.


#11

Revives topic fer a question

I made an avatar in blender, rigged it in mixamo and the arms are crossed
so i thought maybe the scale has to be 0.01 and rotate it x90
rig it in mixamo same again
so i thought maybe it has to be a unity fbx
same again…

I could just rig it without using mixamo, but I thought this was working and I was feeling lazy


#12

Make sure to use the Standard Avatar Skeleton Template I made, and to use Absolute T pose. Do not rotate the joints to match the avatar, rotate the avatar limbs to match the skeleton.

See full, updated notes:

https://alphas.highfidelity.io/t/ultimate-blender-compendium-at-the-mountains-of-documentation-madness/4739
https://alphas.highfidelity.io/t/avatars-standard-compendium/6200


#13

I was using the standard 65 bone skeleton. So imma guess mixamo isnt worth the time.
Ill go back to how I did them b4. And leave the “convenient method” to people who enjoy getting angry lol


#14

The main issue with the mixamo default is that they are in A bind pose. So the binding is off when you bring it in world :stuck_out_tongue: there is a way to rebind the pose, but it is a tad bit annoying


#15

All that matters to me is that we don’t end up with a nice simple method that everyone can use then I can make lots of money selling avatars to people. I was so happy when they changed to pbr shaders as this meant the remaining mixamo avatars were made good and shiny. And only a few experts are able to cure this for an exorbitant fee obviously :wink:


#16


#17

Ferengi Rules of Acquisition 11, 13 and 74 come to mind.


#18

Unfortunately, that may change. Looking into the tool @polygonmonster asked about earlier


#19

The Rules of Acquisition, words to live by! :grin:

I’m also reminded of Space Corp Directive 1742.

Edit: Or was it 497.


#20

Space Core Directive 1742. ‘No member of the Corps should ever report for active duty in a ginger toupee.’ (“Psirens”, Red Dwarf 1996 Log Book)

Uhmm… wait, what does that have to do with crafting avatars? oO

::giggles::