Page 77 of 123

Re: Señor Casaroja's Noesis

Posted: Sat Aug 25, 2012 8:38 pm
by chrrox
Vindis wrote:hi,

may i ask how can i get float16 into this: rapi.rpgBindUV1BufferOfs(varhere, noesis.RPGEODATA_FLOAT, 0, 0)

I'll try to write an Swtor gr2 plugin for Noesis, I have the vertices and faces so far, the only thing is the UV.
It is float16 stored in 2byte or 4 (cant remember, but the test gave me good results), which i can get with getFloat16, but how can i implement this into the buffer?

Sorry if this is noobish question, but it's hard to get Noesis documentation. I'm not that godd in python so i cannot differentiate what can i get from python doc and what from here :D

edit: i think it's better to ask what arguments those rpgBindetcetc expect? i saw someone used RPGEODATA_HALFFLOAT but it didn't worked for me....

rapi.rpgBindUV1BufferOfs(varhere, noesis.RPGEODATA_HALFFLOAT, 0, 0

Re: Señor Casaroja's Noesis

Posted: Sat Aug 25, 2012 9:27 pm
by finale00
MrAdults wrote: Sorry, I missed that. You just need to move your immNormal3f call above the immVertex3f call. immVertex3f is what commits the vertex with all of the other active vertex components. Remember that you just need to make one of the component calls with None as well if you want to clear it out for the next committed vertex.
Lol it was a simple call issue. Didn't think of trying to actually change the order :[

Finally I can render models without having to convert from per-face to per-vertex :D

Re: Señor Casaroja's Noesis

Posted: Mon Aug 27, 2012 12:03 am
by finale00
I have a question about loadTextureByHandler.

Does the texture plugin have to be written a specific way, or does it only need to add a texture object to the texList?

I'm using this plugin (don't remember where I got it, it was on these forums)

https://www.dropbox.com/sh/7stlpd4qvkq3 ... rVR_pvr.py

And although I can load up textures fine by clicking on the files, when I use the above method it doesn't seem to be able to load the texture.

Re: Señor Casaroja's Noesis

Posted: Mon Aug 27, 2012 11:42 am
by Vindis
chrrox wrote:
rapi.rpgBindUV1BufferOfs(varhere, noesis.RPGEODATA_HALFFLOAT, 0, 0
Thank You!

It worked, i just messed up the stride value... :roll:

Can I ask one again? :D Is there a way to prevent mesh renaming? In the files lot of mesh have the same name, mostly in the capital ships, and the rename process conflict with my other tools that i wrote.

Re: Señor Casaroja's Noesis

Posted: Mon Aug 27, 2012 6:48 pm
by Demonsangel
rapi.rpgSetName("name")

Re: Señor Casaroja's Noesis

Posted: Tue Aug 28, 2012 3:31 am
by Satoh
I've run into an issue with a BND archive from a PSP game... It contains a number of uncompressed GMO's, some JSON's and maybe some other things...

It seems as though Noesis knows the format, but it fails to read and crashes.

I can't make heads or tails of the archive... I just don't see any offset lists or anything that links the filename list at the top, to the files later on in the archive...

All I'm interested in at the moment is the GMO's but there may be more important data in some of the archives I haven't looked at yet...

What I'm trying to do currently is write a ripper for the GMO's using the OMG.00.1PSP tag (the start of GMO data) and the GMO file length listed at 0x14...

However, while I know Noesis has some sort of process for unpacking things, I was wondering how I'm supposed to actually grab the data from the archive, and then output it.

I could just dump the raw data with bs.writeBytes(data[start:end])... but that seems like a poor execution.

I've read in the documentation there is a fmtExtractArc function, and I have read the specs on it... however, I am uncertain as to what exactly they mean.

I can't seem to find any python plugins that use the function.

I don't really know how to progress. What are some suggestions?

At this point my only thoughts are brute force loops that appends all ".gmo" strings into a list until reaching a "OMG." string, and then using a bs.writeBytes function to write to the nameList[ i] as the output filename... This however, will execute every time the file is even attempted to be loaded, and will not preserve any sort of directory structure...
... and I'm not entirely certain I know how to correctly determine the start and end of the filenames in the BND archive's list... (they're not 4 byte aligned nor consistent in length).

Failing any sort of export ability for the archives I'll have to manually copy the GMO's by hand via hex editor.

I need help and I'm not even certain what kind.

Here is part of one of the files I'm working with. (an image of the header, that's not breach of TOS right?)
http://i86.photobucket.com/albums/k99/eremes/data.png

The highlighted string is the beginning of the first file, and before it are the names of all the included files. These are small archives.


EDIT:
Ahem... Now how did I miss that... I found the absolute offsets to the files... now all I have to do is output the files and attach the proper directory structure... still, I could use some help understanding how the fmtExtractArc function works.

I looked at the Duke3D grpExtractArc function... but I couldn't really tell what it was doing or for that matter how or why.

What is 'justChecking' and how is it set?

EDIT2:
Ok, I've written all the code I'd need to parse the files normally, but I can't seem to get them to actually... output... I really need some help with this fmtExtractArc defining.

EDIT3:
After much much toil... I think I figured out what vital thing I was missing.

I'd been assuming that since no reference to {data} was passed to ExtractArc, there was no way for me to use noeBitStream functions on it... it took me forever to figure out I could create a new data reference using f.read(fileLen) and then parse it as I would in any other function... once that clicked, (and after the discovery of extractArchiveFile(sO)) I think I hacked together a working BND exporter.

Now to add some Prints so I know it's actually doing stuff.... and... whew...

Man, noesis never seems to cease kicking my ass, but it sure is useful.

Re: Señor Casaroja's Noesis

Posted: Wed Aug 29, 2012 8:09 am
by ShinRa Inc
Apologies in advance if I'm overlooking something very simple, or if this has been asked and answered already, and I couldn't find it...

I'm a bit new to all this, but I'm trying to export Crisis Core models, but retain the texture mapping (preferably in Collada format). Anything I'm loading the exported files from Noesis into seems to be missing the textures.

Re: Señor Casaroja's Noesis

Posted: Wed Aug 29, 2012 10:35 am
by Demonsangel
In what program are you importing the .dae?

I'm not entirely sure on the behavior of Noesis with textures, but sometimes when the textures aren't in the model folder noesis copies and renames them into the model folder.
I've also noticed that some exported formats only hold the texture name and not the full path to it, which might be happning if the textures aren't in the model folder.

UV should still be loaded with it no matter what, all you have to do is relink to the location of the textures or relink the textures themselves, probably.

Re: Señor Casaroja's Noesis

Posted: Wed Aug 29, 2012 1:32 pm
by Satoh
ShinRa Inc wrote:Apologies in advance if I'm overlooking something very simple, or if this has been asked and answered already, and I couldn't find it...

I'm a bit new to all this, but I'm trying to export Crisis Core models, but retain the texture mapping (preferably in Collada format). Anything I'm loading the exported files from Noesis into seems to be missing the textures.
If you're using an Autodesk software to open the DAE models... you're better off using FBX... Autodesk has absolutely miserable support for DAE. It's supported... but the implementation is glitchy at best, entirely useless at worst.

In Max, I lose all UV data consistently... in Maya I sometimes retain UVs and sometimes not, but I ALWAYS lose rigging info...

Even in Blender (which has pretty decent, yet not infallible, support for collada) there are random issues that spark up...

However, if you are using blender, of 2.5x or higher, I recommend converting the files to PSK and PSA, as blender has some packaged importers for those, and they seem to work well.


However, if you're concerned about the UV's going missing, open the DAE you just exported in Noesis and go to the data viewer and check the "UV View" option out.

If the UV's are there, then it's either your modeling software not importing them properly, or you simply haven't reassigned the textures.

And yes, you will have to reassign textures manually for most models in nearly all programs... Max might sometimes manages to assign a few, but it's a crap-shoot, and you can't rely on it.

Re: Señor Casaroja's Noesis

Posted: Wed Aug 29, 2012 3:55 pm
by ShinRa Inc
Demonsangel wrote:In what program are you importing the .dae?
Ultimately, I'm trying to import them into an OpenSim environment (offshoot of SecondLife). I have Blender to work with the files, and a friend of mine did get the textures mapped to one of the smaller and simpler models with only one texture sheet; I was hoping to find a way of getting Noesis to export with the mapping intact to avoid that step, since I don't really have any experience with Blender myself, and it would be rather time consuming for the number of models I'm interested in working with, especially the larger ones with 50+ textures.
Satoh wrote:If you're using an Autodesk software to open the DAE models... you're better off using FBX... Autodesk has absolutely miserable support for DAE. It's supported... but the implementation is glitchy at best, entirely useless at worst.
Unfortunately, the ultimate destination for the files (the OpenSim) requires meshes in .dae format.

Re: Señor Casaroja's Noesis

Posted: Wed Aug 29, 2012 5:47 pm
by Darko
ShinRa Inc wrote:
Demonsangel wrote:In what program are you importing the .dae?
Ultimately, I'm trying to import them into an OpenSim environment (offshoot of SecondLife). I have Blender to work with the files, and a friend of mine did get the textures mapped to one of the smaller and simpler models with only one texture sheet; I was hoping to find a way of getting Noesis to export with the mapping intact to avoid that step, since I don't really have any experience with Blender myself, and it would be rather time consuming for the number of models I'm interested in working with, especially the larger ones with 50+ textures.
Satoh wrote:If you're using an Autodesk software to open the DAE models... you're better off using FBX... Autodesk has absolutely miserable support for DAE. It's supported... but the implementation is glitchy at best, entirely useless at worst.
Unfortunately, the ultimate destination for the files (the OpenSim) requires meshes in .dae format.
Do you mean mapped by having a model woth uv's or complete materials??

Re: Señor Casaroja's Noesis

Posted: Wed Aug 29, 2012 6:28 pm
by ShinRa Inc
The friend of mine who got the texturing working said all she did in Blender was assign the texture, she didn't touch the UVs. She didn't mention anything about materials.

Re: Señor Casaroja's Noesis

Posted: Wed Aug 29, 2012 8:57 pm
by Vindis
I gave up...

Please somebody could elaborate in a nutshell how should i continue with my Noesis importer.
I'll upload my script and two sample file that i use. Well, my skills are below beginner in python and in noesis aswell so i just used basic for loops and lists to store the data.

This was my guide http://wiki.xentax.com/index.php/SWTOR: ... model_file thanks to SWTOR Fan.

As you can see it works, i get everything important (in a messy way). I looked over dozens of noesis script but it was just "what the heck, parse, self, omg" :eek:

From the "#the draw " section it's a complete mess. I have to give different materials to different face, but i cant even understand what numIdx stands for and how to get them. I know where are the face indices, but what should i do with vertexid1-2-3...

Sorry to bother you guys with this, but it takes me 100+ hours just to get here and i feel my head explode :scaredy:

(i looked over and over the documentation but it don't help much)

ps: i'm not asking to write the code, just to point me in the right direction

Re: Señor Casaroja's Noesis

Posted: Thu Aug 30, 2012 12:14 am
by finale00
Well if it works what's there to elaborate lol

I define a single parser class for the format, because I just copy a template and fill in the blanks.
`self` is just python's (accepted) way of referencing instance methods.
`parse` is just a choice of method naming to make it clear what you're doing.
numIdx
Number (of face) Index
The guide says numFaces = total number of faces (= faces indices) so I guess numIdx == numFace for you.
So you already have it.
I know where are the face indices, but what should i do with vertexid1-2-3...
You just read it into your faceBuff and then commitTriangles.

Re: Señor Casaroja's Noesis

Posted: Thu Aug 30, 2012 8:05 am
by MrAdults
finale00 wrote:I have a question about loadTextureByHandler.

Does the texture plugin have to be written a specific way, or does it only need to add a texture object to the texList?

I'm using this plugin (don't remember where I got it, it was on these forums)

https://www.dropbox.com/sh/7stlpd4qvkq3 ... rVR_pvr.py

And although I can load up textures fine by clicking on the files, when I use the above method it doesn't seem to be able to load the texture.
I'm not sure where you got that script, because a PVR script is already in the current Noesis distribution, and it's identical to that, but has a different filename.

loadTextureByHandler should work for plugin and script based formats, and seems to be working that way for me. Can you show me your code?
Satoh wrote:I've run into an issue with a BND archive from a PSP game
Lots of games use BND containers in seemingly slightly or very different formats. If you just want to get the GMO's then you might as well just use GitMO. It's on my personal web site. I would walk you through writing an archive script, but doing that much typing from the iPad is too terrible to endure. If you read the Duke3D GRP script carefully, it should tell you everything you need to know. Also, justChecking is set when Noesis just wants to validate the type, without performing any kind of extraction. It differs from how other data handlers have separate validation methods, and is inherited from legacy Noesis archive handling from years ago.

Regarding this other stuff with people not seeing textures after exporting to FBX/DAE/etc., it's likely a case of the texture output files not being on a path the importing app can find, or that app needs file extensions on texture names because it isn't smart enough to scan for its own supported image formats. In the latter case you'd have to append the appropriate extension (like .png or whatever the extension is for the texture format you used) to the texture names yourself. That is easy to do to COLLADA files in a text editor, or with FBX if you use the option to export the FBX in ASCII mode. (see the FBX section of the advanced options list from the export dialog) I think I even made a FBX-specific option to auto-append extension strings, but I can't recall for sure. As mentioned, I'm posting from an iPad and can't run Noesis to see right now.