Page 2 of 5

Re: Avengers Academy .ccz .c3b

Posted: Wed Aug 30, 2017 9:54 am
by TRDaz
I may have figured the vertex count but how they work this for both meshes is what's confusing me. 0x13A = 37,040. 37,040/16=2,315. That's the vertex count for the 2nd submesh, maybe they use this value for both meshes somehow. This seems to work with the other files provided too - the value after "VERTEX_ATTRIB_BLEND_INDEX".

Re: Avengers Academy .ccz .c3b

Posted: Wed Aug 30, 2017 2:55 pm
by TRDaz
Sorry for the double post (and for the red/orange background on the screenshots, that's how I like my Noesis layout lol) but:

Image
Image

The script works on every sample given but c_Daredevil_L1_skin_v2. It definitely needs tidying and refining, this was made just against testing one file, but it works with multiple instead. I'll look into making it work with others, and maybe look into bones/weights.

Edit - Reason why Daredevil's L1 skin doesn't work is because it has 3 meshes, I did manually checking with the first revision of the script so the script has been updated to fix that problem. I will get more/the rest of the models if I can and check to see if anything isn't working.

Code: Select all

#sample class
from inc_noesis import *

def registerNoesisTypes():
	handle = noesis.register("Marvel's Avengers Academy", ".c3b")
	noesis.setHandlerTypeCheck(handle, c3bCheckType)
	noesis.setHandlerLoadModel(handle, c3bLoadModel)
	noesis.logPopup()
	return 1

def c3bCheckType(data):
	td = NoeBitStream(data)
	return 1

class c3bFile: 
         
	def __init__(self, bs):
		self.texList   = []
		self.vtxList   = []
		self.matList   = []
		self.boneList  = []
		self.loadAll(bs)
		
	def loadAll(self, bs):
		self.readC3B(bs)
		
	def readC3B(self, bs):
		bs.seek(0xA, NOESEEK_ABS)
		namesizeA = bs.readUInt()
		matnameA = bs.readBytes(namesizeA).decode("ASCII")
		skip = bs.readBytes(8)
		namesizeB = bs.readUInt()
		matnameB = bs.readBytes(namesizeB).decode("ASCII")
		skip = bs.readBytes(248)
		vertex_count = bs.readUInt()
		vertBuff = bs.readBytes (vertex_count * 4)
		numSubmesh = bs.readUInt()
		for i in range(numSubmesh):
			namesizeC = bs.readUInt()
			meshname = bs.readBytes(namesizeC).decode("ASCII")
			face_count = bs.readUInt()
			faceBuff = bs.readBytes (face_count * 2)
			skip = bs.readBytes(24)
			vertex_stride = 64
			rapi.rpgBindPositionBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 64, 0)
			rapi.rpgBindNormalBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 64, 12)
			rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 64, 24)
			rapi.rpgCommitTriangles(faceBuff, noesis.RPGEODATA_USHORT, face_count, noesis.RPGEO_TRIANGLE, 1)
			
	def loadMeshNames(self, bs):
		pass
		
def c3bLoadModel(data, mdlList):
	ctx = rapi.rpgCreateContext()
	c3b = c3bFile(NoeBitStream(data))
	try:
		mdl = rapi.rpgConstructModel()
	except:
		mdl = NoeModel()
	mdl.setModelMaterials(NoeModelMaterials(c3b.texList, c3b.matList))
	mdlList.append(mdl); mdl.setBones(c3b.boneList)	
	return 1

Re: Avengers Academy .ccz .c3b

Posted: Wed Aug 30, 2017 4:40 pm
by Rutabaga
Thanks a lot! I will test the script as soon as i will get access to my laptop.
Now i need to know how to download all game assets (if this a possible of course)
P.S Script for anims would be also good,i know what reverse anims it' hard,but it's only one thing what are left.

Re: Avengers Academy .ccz .c3b

Posted: Wed Aug 30, 2017 4:44 pm
by TRDaz
Animations is definitely something I can't/won't do. I can possibly get bones and weights but animations are something I've never looked into.

Re: Avengers Academy .ccz .c3b

Posted: Thu Aug 31, 2017 6:10 am
by Rutabaga
Ok,and big thanks for the script
If any anyone can take a look here are animations in c3b format
https://www.sendspace.com/file/p2fgfe
Also,i'm wondering if this method can be used to get all assets from the game,without playing it.
viewtopic.php?f=29&t=16055

Re: Avengers Academy .ccz .c3b

Posted: Thu Aug 31, 2017 10:08 pm
by shakotay2
Rutabaga wrote:,i know what reverse anims it' hard,but it's only one thing what are left.
no, it's not. You'll need the skeleton first before dealing with animations, without it doesn't make any sense for me.

Dealing with the skeleton of c_FoggyNelson_L1_skin_v1.c3b is just a waste of time&life, again. :cry:

There's 24 head bone names and 30+59 body bone names, where the latter contains head bone names, too, weird.
(The two body bones blocks share some names, too, so not to get nuts I restarted with the bone index 0.
It's not 113 bones because of these doubles.)
Head
0 "jt_head_bind" -1
1 "jt_l_brow_in_bind" 0
2 "jt_r_brow_in_bind" 0
3 "jt_l_brow_mid_bind" 0
4 "jt_l_brow_out_bind" 0
5 "jt_l_cheek_bind" 0
6 "jt_nose_bind" 0
7 "jt_nostrils_bind" 0
8 "jt_l_lip_bind" 0
9 "jt_lowerlip_bind" 0
10 "jt_jaw_bind" 0
11 "jt_upperlip_bind" 0
12 "jt_neck_bind" 0
13 "jt_chest_bind" 0
14 "jt_l_upperlid_bind" 0
15 "jt_l_lowerlid_bind" 0
16 "jt_r_brow_mid_bind" 0
17 "jt_r_brow_out_bind" 0
18 "jt_r_cheek_bind" 0
19 "jt_r_lip_bind" 0
20 "jt_r_upperlid_bind" 0
21 "jt_r_lowerlid_bind" 0
22 "jt_l_eye_bind" 0
23 "jt_r_eye_bind" 0

body, part1
0 *jt_chest_attach_bind* -1
1 *jt_midspine_bind* 0
2 *jt_hips_bind* 0
3 *jt_l_thumb_base_bind* 0
4 *jt_l_wrist_bind* 0
5 *jt_l_forearm_bind* 0
6 *jt_l_index_base_bind* 0
7 *jt_l_index_mid_bind* 0
8 *jt_l_middle_base_bind* 0
9 *jt_l_middle_mid_bind* 0
10 *jt_l_toes_bind* 0
11 *jt_l_ankle_bind* 0
12 *jt_l_knee_bind* 0

13 *jt_l_clavicle_bind* 0
14 *jt_l_upperarm_bind* 0
15 *jt_neck_temp_bind* 0
16 *jt_l_thigh_bind* 0
17 *jt_r_thigh_bind* 0
18 *jt_r_thumb_base_bind* 0
19 *jt_r_wrist_bind* 0
20 *jt_r_forearm_bind* 0
21 *jt_r_index_base_bind* 0
22 *jt_r_index_mid_bind* 0
23 *jt_r_middle_base_bind* 0
24 *jt_r_middle_mid_bind* 0
25 *jt_r_toes_bind* 0
26 *jt_r_ankle_bind* 0
27 *jt_r_knee_bind* 0

28 *jt_r_clavicle_bind* 0
29 *jt_r_upperarm_bind* 0

body, part2
partially added parent IDs manually
0 "jt_all_head_bind" -1
1 "jt_chest_bind" 0
2 "jt_neck_bind" 1
3 "jt_head_bind" 2
4 "jt_l_eye_bind" 1
5 "jt_l_upperlid_bind" 0
6 "jt_l_lowerlid_bind" 0
7 "jt_l_brow_in_bind" 0
8 "jt_l_brow_mid_bind" 0
9 "jt_l_brow_out_bind" 0
10 "jt_l_cheek_bind" 0
11 "jt_l_lip_bind" 0
12 "jt_upperlip_bind" 0
13 "jt_lowerlip_bind" 0
14 "jt_jaw_bind" 0
15 "jt_nostrils_bind" 0
16 "jt_nose_bind" 0
17 "jt_r_eye_bind" 0
18 "jt_r_upperlid_bind" 0
19 "jt_r_lowerlid_bind" 0
20 "jt_r_brow_in_bind" 0
21 "jt_r_brow_mid_bind" 0
22 "jt_r_brow_out_bind" 0
23 "jt_r_cheek_bind" 0
24 "jt_r_lip_bind" 0
25 "jt_all_bind" 0
26 "jt_hips_bind" 25
27 "jt_midspine_bind" 26
28 "jt_chest_attach_bind" 1
29 "jt_neck_temp_bind" 2
30 "jt_head_temp_bind" 3
31 "jt_l_clavicle_bind" 0
32 "jt_l_upperarm_bind" 31
33 "jt_l_forearm_bind" 32
34 "jt_l_wrist_bind" 33
35 "jt_l_thumb_base_bind" 34
36 "jt_l_index_base_bind" 34
37 "jt_l_index_mid_bind" 36
38 "jt_l_middle_base_bind" 34
39 "jt_l_middle_mid_bind" 38
40 "jt_r_clavicle_bind" 0
41 "jt_r_upperarm_bind" 40
42 "jt_r_forearm_bind" 41
43 "jt_r_wrist_bind" 42
44 "jt_r_thumb_base_bind" 43
45 "jt_r_index_base_bind" 43
46 "jt_r_index_mid_bind" 45
47 "jt_r_middle_base_bind" 43
48 "jt_r_middle_mid_bind" 47
49 "jt_l_thigh_bind" 26
50 "jt_l_knee_bind" 49
51 "jt_l_ankle_bind" 50
52 "jt_l_toes_bind" 51
53 "jt_r_thigh_bind" 26
54 "jt_r_knee_bind" 53
55 "jt_r_ankle_bind" 54
56 "jt_r_toes_bind" 55
57 "jt_shadow_bind" 0
58 "jt_prop_bind" 0

Re: Avengers Academy .ccz .c3b

Posted: Fri Sep 01, 2017 4:53 am
by Rutabaga
shakotay2 wrote:You'll need the skeleton first before dealing with animations, without it doesn't make any sense for me.

Dealing with the skeleton of c_FoggyNelson_L1_skin_v1.c3b is just a waste of time&life, again. :cry:
Excuse me,because i didn't checked the script and i didn't know if script has bones support.

Re: Avengers Academy .ccz .c3b

Posted: Sat Sep 16, 2017 11:14 pm
by SickAlice
Hey TRDaz, you are awesome! <insert thumbs up here>

Note I've been using the basic set. Any standard models load as do any lodes. The only one that crashed for me thus far is Falcon and Weeny Cap. I'll update with more if you wish as I explore the event specific ones.

Re: Avengers Academy .ccz .c3b

Posted: Mon Sep 18, 2017 5:55 am
by Rutabaga
I agree with Alice,it's awesome to finally have script to extract models from this game.
Now bones are left :) i hope daz will add bones support soonly

Re: Avengers Academy .ccz .c3b

Posted: Mon Sep 18, 2017 5:15 pm
by TRDaz
Would be nice to know which ones don't work and if you could, send them to me so I can check them (I have Falcon, I saw he doesn't work too, need to try and find a fix). Rutabaga sent me a couple from the Inhumans event and I saw that Lockjaw doesn't work with the current version of the script.

I'm still trying with the bones, have never really worked with them in scripts before so it's a little harder for me, currently a bit busy in real life too so I don't have any estimate on when it will be finished.

Edit: I have Falcon and Lockjaw working now, send any more along that you find not working since I'd like to have most models working before posting this version if possible! I don't plan on supporting props/random other models YET since they probably would make the script too confusing, the game seems to like having different headers a lot, might check them out once the character models and bones are sorted.

Re: Avengers Academy .ccz .c3b

Posted: Tue Sep 19, 2017 1:59 pm
by SickAlice
I was wrong on Cap Weenie. He has the "d_" prefix. Falcon was the only for me. As there's a lot of files I'll list the ones that have worked so far. These are the static "c_" prefixed as well their lod's and alternate costumes. None of the animation files have worked for me. Some of the fx so far have though I only went through all of the "c_" files thus far and checked the caches from several different versions.

working: Ares, Abomb, Baron Zemo, Black Panther, Black Widow, Captain America, Chitauri, Drax, Enchantress, Gamora, Groot, Hank Pym, Hulk Weenie, Hydra, Holo-Loki, Iron Man, Leader, Loki, Madame Hydra, Ms.Marvel, Nebula, Nick Fury, Odin, Quake, Red Hulk, Rescue, Rocket Raccoon, Ronan, Scientist Supreme, Spider-woman, Star-Lord, Ultron, Vision, War Machine, Wasp, Yondu.

a few others I got so far are the dj table, the ant and the anthill. Will list more when I get through them. Thank you again though and massive props for this.

Re: Avengers Academy .ccz .c3b

Posted: Tue Sep 19, 2017 8:38 pm
by TRDaz
No idea what the "d_" prefix represents, I have Cosmo The Dog with a name like that, and a flower bed item, no idea what they have in common unless they are just items you can place down. I've only looked at the "c_" files and those are the ones I focus on since they are the main characters, most other things probably won't work, animations definitely not.

Looks like a lot are working though which is great, I can look into other things once the "c_" files are sorted but those are my focus right now, along with the bones.

Re: Avengers Academy .ccz .c3b

Posted: Wed Sep 20, 2017 5:29 am
by Rutabaga
TRDaz wrote:No idea what the "d_" prefix represents, I have Cosmo The Dog with a name like that, and a flower bed item, no idea what they have in common unless they are just items you can place down. I've only looked at the "c_" files and those are the ones I focus on since they are the main characters, most other things probably won't work, animations definitely not.

Looks like a lot are working though which is great, I can look into other things once the "c_" files are sorted but those are my focus right now, along with the bones.
_d is a dialouge,i think (probably dialouge only character)
SickAlice wrote:Some of the fx so far have though I only went through all of the "c_" files thus far and checked the caches from several different versions.
These caches has a lot of character files? If yes,can you share me some caches or tell me the where you are downloaded them?
Thanks.

Re: Avengers Academy .ccz .c3b

Posted: Fri Sep 22, 2017 6:30 am
by Rutabaga
Sorry for double post.
I've uploaded more c3b samples,i hope they can help.
https://www.sendspace.com/file/1uxoo5

Also,here are files with no extension,can they contain info about event chars or something like that?
https://www.sendspace.com/file/7e53kr

Re: Avengers Academy .ccz .c3b

Posted: Fri Sep 22, 2017 8:05 am
by TRDaz
Thanks for the model files, looks like the Falcon model in there doesn't work with the updated version I have for the other Falcon model, which is weird. Everything else does though, I'll check that out later when I have time.

Those unknown files don't seem to be related to models so I don't think they are useful.