Users browsing this thread: 1 Guest(s)
Another UMC side-thread
#24
just to update everyone:

[Image: UMC_DAT_KAR_Stage3.png]

older:
[Image: UMC_DAT_KAR_Stage2.png]

it's still unfinished though, the script used is still using the PT functions where the data is expected to be world-location specified like an OBJ or DAE file

as for the new UT functions well...
I still need to finish up the data verification...
Code:
def __VerifyBoneTree(BID,Data,children,wpbind,wptransform):
   BoneName, BDL, (l,r,s), Res, Bind, Inv_Bind, PBID, PrBID, CBID, NBID = Data
   
   default = __rr.Matrix44(DM) # default (same as identity)
   
   transform = __rr.Matrix44.from_scale(s) * __rr.Matrix44.from_eulers(r) * __rr.Matrix44.from_translation(l) # Local Transform
   bind = __rr.Matrix44(Bind) # Local Bind
   inverse = __rr.Matrix44(Inv_Bind) # World Inverse Bind
   
   wtransform = __rr.matrix44.multiply(transform,wptransform) # World Transform
   wbind = __rr.matrix44.multiply(bind,wpbind) # World Bind
   
   cinverse = __rr.matrix33.inverse(wbind)
   if (transform == bind).all():
       if (default == bind).all(): # possible problem (this may be the proper local location)
           if (default == inverse).all(): # this may not be the proper locations
               if (default != wpbind).all(): # assume identity to parent and recalculate the inverse bind.
                   inverse = __rr.matrix33.inverse(wpbind)
           else: # recalculate defaulted bind and LRS
               wbind = __rr.matrix33.inverse(inverse)
               pinverse = __rr.matrix33.inverse(wpbind)
               bind = wbind * pinverse
               transform = bind
               
       else: # make sure the bind matches the inverse
           if (default == inverse).all(): # this is obviousely wrong
               inverse = __rr.matrix33.inverse(wbind)
           elif (cinverse != inverse).all():
               inverse = cinverse
   
   elif (default == bind).all(): pass
   elif (default == transform).all(): pass
   else: # neither are default, but don't match
       pass
   
   # recalculate
   #wtmtx = __rr.matrix44.multiply(ltmtx,wptmtx)
   #wbmtx = __rr.matrix44.multiply(lbmtx,wpbmtx)
   
   if BID in children: # if this bone has any children
       for CID in children[BID]:
           __VerifyBoneTree(CID,Data,children,wbind,wtransform)
[color=lime]^ what does this do?

after everything has been imported, the data is still likely unstable, especially for bones.
what this does is gather the current bone's LRS, Bind, and Inverse coords (for each bone) and tests to make sure everything matches accordingly and even attempts to fix what doesn't match.

what this means is you only need to specify 1 of any:
- Loc,Rot,Sca
- Bind Matrix
- Inverse Matrix

and the verifier will calculate the rest.

if everything is defaulted and nothing is supplied, the verifier maps the Inverse to an inverted world-bind matrix at the parent's location.
(LRS and Bind don't need to be touched as they're locally defaulted)

I still have yet to test the various occurrences if the LRS and Bind don't match

I'm actually thinking about redoing the logic to test the Inverse first before testing the LRS and bind...
in fact, I think that's a really good idea
[Image: banner.PNG]
Reply
Thanked by:


Messages In This Thread
Another UMC side-thread - by Tcll - 12-13-2014, 01:18 AM
RE: Another UMC side-thread - by Tcll - 12-13-2014, 11:44 PM
RE: Another UMC side-thread - by Struggleton! - 12-13-2014, 11:44 PM
RE: Another UMC side-thread - by Tcll - 12-14-2014, 12:30 AM
RE: Another UMC side-thread - by Tcll - 12-15-2014, 09:56 PM
RE: Another UMC side-thread - by Tcll - 12-17-2014, 03:17 PM
RE: Another UMC side-thread - by puggsoy - 12-17-2014, 08:39 PM
RE: Another UMC side-thread - by Struggleton! - 12-17-2014, 09:15 PM
RE: Another UMC side-thread - by Tcll - 12-17-2014, 11:34 PM
RE: Another UMC side-thread - by Tcll - 12-18-2014, 01:55 AM
RE: Another UMC side-thread - by Tcll - 12-27-2014, 02:57 AM
RE: Another UMC side-thread - by Struggleton! - 12-29-2014, 12:37 AM
RE: Another UMC side-thread - by Tcll - 12-29-2014, 12:43 AM
RE: Another UMC side-thread - by Tcll - 01-01-2015, 01:59 PM
RE: Another UMC side-thread - by Tcll - 01-29-2015, 12:26 AM
RE: Another UMC side-thread - by Tcll - 01-30-2015, 01:22 AM
RE: Another UMC side-thread - by Tcll - 02-14-2015, 07:02 PM
RE: Another UMC side-thread - by Tcll - 02-15-2015, 03:37 PM
RE: Another UMC side-thread - by Tcll - 02-28-2015, 09:03 AM
RE: Another UMC side-thread - by Tcll - 03-10-2015, 09:11 AM
RE: Another UMC side-thread - by Tcll - 03-22-2015, 08:59 AM
RE: Another UMC side-thread - by Tcll - 03-31-2015, 12:54 AM
RE: Another UMC side-thread - by Tcll - 04-04-2015, 09:58 PM
RE: Another UMC side-thread - by Tcll - 04-11-2015, 09:23 AM
RE: Another UMC side-thread - by Tcll - 04-14-2015, 01:19 AM
RE: Another UMC side-thread - by Manki - 04-14-2015, 07:37 PM
RE: Another UMC side-thread - by Tcll - 04-14-2015, 08:54 PM
RE: Another UMC side-thread - by Tcll - 06-14-2015, 03:43 PM
RE: Another UMC side-thread - by Tcll - 06-18-2015, 09:20 AM
RE: Another UMC side-thread - by Tcll - 06-21-2015, 09:22 AM
RE: Another UMC side-thread - by Tcll - 07-09-2015, 01:27 PM
RE: Another UMC side-thread - by Tcll - 07-09-2015, 11:43 PM
RE: Another UMC side-thread - by Tcll - 08-10-2015, 10:26 PM

Forum Jump: