ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Fri Mar 05, 2021 3:59 pm

All times are UTC




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Jan 17, 2021 7:04 pm 

Joined: Wed Dec 02, 2020 1:16 pm
Posts: 10
I'm working with models for juiced and have located a 4 byte section that controls how far a vertex will "deform" on impact.

The first 3 bytes [xyz] are always same value per vertex with last byte always 0.
E.g.
55 55 55 00
4f 4f 4f 00 ect.

My assumption is that devs used vertex color to set this value per vertex which would allow some sections of part to deform less or not at all.

Max value of 255 so I think it is int8? Maybe? Still rather new to this so please excuse my ignorance.

I've had a look at maxscript reference site but not finding anything that jumps out as a solution.

Anyone have an example script laying around?


Top
   
PostPosted: Tue Jan 19, 2021 8:08 pm 
User avatar

Joined: Mon Sep 15, 2014 5:13 am
Posts: 40
Here is some example code to help if it can.

Code:
Color_array=#()
for x = 1 to vertCount do (
   r = readByte f #unsigned
   g = readByte f #unsigned
   b = readByte f #unsigned
   a = readByte f #unsigned
   
   append Color_array (color r g b a)
)

msh = mesh vertices:Vert_array faces:Face_array
msh.numTVerts = UV_array.count
buildTVFaces msh
defaultVCFaces msh
setShadeCVerts msh true
setCVertMode msh true
for j = 1 to UV_array.count do setTVert msh j UV_array[j]
for j = 1 to Face_array.count do setTVFace msh j Face_array[j]
for j = 1 to Color_array.count do setVertColor msh j Color_array[j]



Top
   
PostPosted: Sat Jan 23, 2021 11:34 am 

Joined: Wed Dec 02, 2020 1:16 pm
Posts: 10
Hey I was able to get that to work.
how can I handle that on export?
I assume getVertColor but is there any additional code needed to write it back as byte sections?


Top
   
PostPosted: Sat Jan 23, 2021 12:03 pm 

Joined: Wed Dec 02, 2020 1:16 pm
Posts: 10
Also I'm getting vivid colors (yellows,reds,greens) from the values when it should be all shades of greys.
If all color values are the same across rgb I should get shades from white to black only correct?

Edit: the first mesh seems to load colors correctly.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Limited