The VG Resource

Full Version: Another UMC side-thread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
just showin off progress as it comes Smile
(just to keep everyone informed I'm still hard at work) Wink
[Image: UMC_FileDialog6.png]
I still gotta get this stupid filter-select box working and make it scrollable, then I can start working on the file-list scrollbox Wink
(I hate the selectbox and scrollbox widgets because they require alot of brain-work)

the scrollbox draws on specified layers for cutoff and cutout
the selctbox currently needs 2 extended widget types for the buttons and clickoff area

talk about migranes... lol

EDIT:
update:
[Image: UMC_FileDialog8.png]

up next, I'll be tackling the filters and directory traversal.

for continuing into a directory, I'll just use the single-click event for now until the update where I add a D-click event to the events system Wink
just back out using the back button (as expected) Tongue

I should note, the actions for the files and directories in the items are separate,
but I'll still make it to where typing in a directory (in an update when entry widgets support key-press events), also continue to the directory Wink

EDIT2:
welp, finished that up Cute
[Image: UMC_FileDialog9.png]
I'm just about ready to go into beta testing before releasing Cute
[Image: UMC_DisplayPanel2.png]
I'm just now restoring KBd interaction with the UI and fixing minor display issues

CPU usage has gotten better as well (the purpose of the new UI, aside from making things easier to work with):
[Image: CPU_stress_old.png] - old UI
[Image: CPU_stress_new.png] - new UI (with import)

I've still got a few optimizations I can do, but that'll take a while to clean up.
so I can promise a release here soon Smile
(I just can't say how soon as big issues could arise during beta testing)
I AM NOW BETA TESTING! Big Grin

for those who want to try it out, you can download a zip of my folder here:
https://copy.com/3Zg7S8HwFyVaXstm


[Image: hqdefault.jpg]
Please understand, this is my active collaborative repository, which is updated as I edit the src.
alot of included scripts here don't work properly if at all and won't be in the release.

the official release will be hosted on GitHub Wink

EDIT:
just to notify, I know about the GL error on some model imports:
Code:
importing TyPichu.dat 100%
Converting from import format...
Verifying data...
Finalizing...
Updating Viewer


Traceback (most recent call last):
  File "Z:\home\tcll\sync\copy\UMC_v3.0a\API.py", line 40, in run
    VIEWER.Init()
  File "Z:\home\tcll\sync\copy\UMC_v3.0a\data\VIEWER.py", line 1039, in Init
    else: __Draw_Scene() #no 3D display
  File "Z:\home\tcll\sync\copy\UMC_v3.0a\data\VIEWER.py", line 565, in __Draw_Scene
    __GL.glCallList(__MODEL_DATA)
  File "Z:\home\tcll\sync\copy\UMC_v3.0a\data\Python\x86\lib\site-packages\OpenGL\error.py", line 208, in glCheckError
    baseOperation = baseOperation,
GLError: GLError(
    err = 1281,
    description = 'invalid value',
    baseOperation = glCallList,
    cArguments = (270L,)
)
this will eventually be found, I'm not sure what causes this, so please don't report these cases Wink
I'm starting another script:
-see edit for link-

though I'm not too good at reading max-script, so don't bite me if there's issues Tongue
if I can gain RTB's help on this, the script might just be in the release Wink

also, the GL error issue is fixed, marth and others import now Smile
[Image: marth2.png]
and I also found a new object on the slick star which didn't import last time:
[Image: slickstar.png]

EDIT:
just got finished fixing up RTB's syntax: (it's actually readable now, though still dirty)
https://copy.com/wnsFsqIgMTMCQYCa (copy can't display the file)
my script is here: (being translated from RTB's script)
https://copy.com/fG3pJg4ui2AZHFCT
there will definitely be alot less variables, and term translations:

vertex -> facepoint (makes more sense and doesn't confuse "vertice" along with it, which is "vert" in my terms)
various: skin -> rig, bone, or weight (skin is too general, like alot of other 3D terms)

RTB, how the heck could you work with that, the syntax alone gave me a headache O.o
lol

EDIT2:
because when coding sucks, I have to be an A and bost about how it could've been done better... lol
of course though this is a translation from max to python... heh

RTB's code:
Code:
-- <- because this indentation is removed for some reason
                BoneName = readstring q
                if x < 10 do(BoneName = "00" + x as string + " - " + BoneName)
                if x > 9 and x < 100 do(BoneName = "0" + x as string + " - " + BoneName)
                if x > 99 do(BoneName = x as string + " - " + BoneName)

my code:
Code:
# <- because this indentation is removed for some reason
                    BoneName = "%03i-%s"%(x,string()) # read until 0x00

both do the same exact thing:
Code:
>>> '%03i'%2222
'2222'
>>> '%03i'%22
'022'

for max, because I don't know much, I'd just recommend this to keep the code clean:
Code:
-- <- because this indentation is removed for some reason
                BoneName = x as string + " - " + (readstring q)
^ if this doesn't work, at least you know my intentions. (1-liners are awesome)

hey RTB, wanna compete for cleanest code Cute
lol
just to let everyone know, I've back-stepped a tad...

the UT model functions will work as expected, and are needed for Sm4sh conversion.
so I'm working on building the transformer into the data verification process.

yes, I'm supporting 2 buffers with only a single buffer Smile
(UT models will always be converted to PT before being displayed)

this shouldn't take too long to implement, and should greatly benefit writing scripts Wink
(no more script-sided model conversion)
probably should've mentioned this here as well...

I'm having a small issue with UMC's UT-data transformer which I can't quite figure out...
[Image: UMC_trans3.png]
I think it might be something with the single-bind weight influeces.

hey it's proof that 20% less code works Smile
just wanted to post about a major update
it's too much to type and fix up, so I'll just link you to the main post:
http://smashboards.com/threads/universal...92/page-11

unfortunately I might still be far from a release.
but trust me, your patience will pay off. Smile
(I'm no scam artist, I'm writing UMC for fun and knowledge)
^ I'm not one to release half-baked stuff like Microsoft, or more recently, Nintendo
my stuff will work better than what everyone expects.

if you really want it bad enough, I'm not one to with-hold it from you...
you can download it directly from my synced environment:
https://copy.com/3Zg7S8HwFyVaXstm
just note, it's not complete so things are likely to not work.
if you start writing a script, you can expect things to break here and there, as minor things are still being ported (such as matrix functions)
new support is also being added for faster and better conversion.

I'm sorry this is taking quite a while, but it's not like something this complex could be done by a complete noob in only a few years.
I can't exactly read math mind you, but I can visualize logic.

so yea, UMC will be in development for a while longer (I can't say how long due to my lack of knowing what I need to know).
but expect it to work at least near flawlessly upon it's release. Smile
I can't stay working on what I say I want to work on, thank you autism... lol

so here's a screenshot for you guys: Cute
[Image: UMC_DAT_Stage.png]

EDIT:
more stuff here:
http://smashboards.com/threads/universal...t-18908735
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
hey @RTB, I found a typo in your code Smile
Code:
-- stupid pre l-strip
                for x = 1 to VertexAmount_array[z] do(
                    colorr = readbyte m #unsigned
                    colorg = readbyte m #unsigned
                    colorb = readbyte m #unsigned
                    colora = readbyte m #unsigned
                    tu = (readBEHalfFloat m) * 2
                    tv = (((readBEHalfFloat m) * 2) * -1) + 1
                    tu2 = (readBEHalfFloat m) * 2
                    tv2 = (((readBEHalfFloat m) * 2) * -1) + 1
                    tu3 = (readBEHalfFloat m) * 2
                    tv3 = (((readBEHalfFloat m) * 2) * -1) + 1
                    append UV_array[tu, tv, 0]
                    append UV2_array[tu2, tv2, 0]
                    append UV3_array[tu2, tv2, 0]
                    append Color_Array[colorr,colorg,colorb]
                    append Alpha_Array colora
                )

found it while converting it to UMC-script Tongue
Code:
# stupid pre l-strip
                for x in range(VertexAmount_array[z]):
                    colorr, colorg, colorb, colora = u8(['','','','']) # don't need big=big
                    tu = f16(big=big) * 2
                    tv = ((f16(big=big) * 2) * -1) + 1
                    tu2 = f16(big=big) * 2
                    tv2 = ((f16(big=big) * 2) * -1) + 1
                    tu3 = f16(big=big) * 2
                    tv3 = ((f16(big=big) * 2) * -1) + 1
                    UV_array.append([tu, tv, 0])
                    UV2_array.append([tu2, tv2, 0])
                    UV3_array.append([tu3, tv3, 0])
                    Color_Array.append([colorr,colorg,colorb])
                    Alpha_Array.append(colora)

what's wrong?
look at UV3_array Wink
@Tcll
It's been a while.

Nice to see you making progress on your code.
haha, thanks Smile

I can't really get much working atm with my sm4sh script because I need to redo my bone verification.

I think I'm just gonna leave the LRS for the user (including supplied matrices), and then have the verifier calculate the bind and inv matrices for transformation of the supplied UT data...

btw, I officially HAATE MaxScript Tongue
I hated it before, but now that I'm dissecting RTB's noobishly formatted (poor indentation, hard to read, too many arrays, converts primitives to triangles, and more) code, I'd blow my brains out before working on a max-script...

now I can say Blender is far better than max.
I've always hated max's dirty, cluttered, and confusing user interface, but having a backend that operates more similar to the disgusting DAE format really makes me hate it. Tongue

the language for UMC-scripts is more closely related to OpenGL's FFP, so it's easy for noobs to use.
to add, UMC supports every type of primitive including quad-strips and polygons.
the automated file and data interfaces allow you to easily manage file data (rather than having to define functions for particular data types)

heck, UMC even goes as far as a #-byte IEEE754 float value:

float5 = bf(5)
data = float5() # read

UMC-scripts are based off python in which the indentation standard enforces readability.

@RTB: don't worry, I'm not mad at you in the least, though a little disappointed at the code...
still congrats for what you've done Smile
I guess I should mention how everything's coming along:
[Image: PlBoNr.png]

- ported to glfw from sdl (now I don't have to recreate my display lists)
- using freetype-py to manage fonts
- various other minor improvements have been made

and credit to Matt Sitton for this: (excuse the size, I can only resize a picasa or blogger link)

still working on fixing the bones, not getting much help with this:
[Image: HL_Bones.png]
^the issue is the bone verification after importing, it's not building the matrices correctly.
UMC draws the inverse-bind matrix

the problem with this is I can't transform the UT data with improper matrices.

EDIT:
I can't open the spoiler, so I can't tell exactly how big the image is... >_>
could be another chrome bug Tongue

EDIT2:
yep, it opens now, and I did nothing
not sure if the forum devs did anything >.>
well here's an update Smile
wrote a nice little hacky model script which exports all imported images as png images Smile
[Image: png_exports.png]
I'll include this with the release Wink

here's the script btw:
Code:
ugeScriptType(UGE_MODEL_SCRIPT)
ugeScriptFormats('PNG Textures', ['dummy'])

def ugeExportModel(T,C):
    while ugeImagesExist(Global=True):
        name = ugeGetImageName()
        ugeGetImageData('%s.png'%name, isfile=True)
probably my smallest script yet Tongue
Pages: 1 2 3