Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Spotlight: Señor Casaroja's Noesis

General game file tools that are useful for more than one game
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Señor Casaroja's Noesis

Post by MrAdults »

They should be written out to the desired format as external files before the export handler is called, so you can reload them from those already-interpreted files. It could become an issue if you're exporting to an image format with no import module, but no such format exists in Noesis at the moment.

Edit: Also, if this ever does cause issues, I can consider changing the existing behavior. I just don't really want to unless I have to. There's also a native plugin function to auto-gather texture data from all of the texture references on export, it's used in the MD2 exporter. I don't think I exposed it to Python though. Which again is an option, but doesn't seem very important right now. Translating texture data to Python bytearrays is just kind a fundamentally gross/high-overhead thing to do, so I'd really recommend using native plugins anyway if you have a format that needs that. But it kind of depends on how much texture data you're talking about as to whether it would make a tangible difference or not.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Señor Casaroja's Noesis

Post by finale00 »

That sounds like it would basically result in all plugins I write exporting the textures while it's parsing the file *just in case* they wanted to export to this particular format that stores textures inside the model file?
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Señor Casaroja's Noesis

Post by MrAdults »

No, exporting texture data is part of the standard export pipeline.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Señor Casaroja's Noesis

Post by finale00 »

Oh ya, I just noticed all of the textures were being exported lol

If a model used a large number of textures would it take a significant hit on performance?
Like sure if it's only 4-5 small textures it probably isn't too bad but some models seem to like to have a whole bunch of textures, especially for large models like maps and stuff.

Guess people will just have to be patient.
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Señor Casaroja's Noesis

Post by MrAdults »

Yeah, although most of that overhead is again in the Python layer. Native plugins can also export texture data without reloading it from disk, because the textures are in the native global memory pool. (exposing the actual texture data to Python in the order that things happen would require actually duplicating all of that memory, which is kind of terrible) So if you're talking like 100MB of texture data, then again, that sounds like a format better-suited to a native plugin if you have performance concerns.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Señor Casaroja's Noesis

Post by finale00 »

Probably wouldn't happen often. Not the kinds of things I expect people to be using it for anyways.

Also, not sure how bounding boxes work, but the format I'm working with requires me to calculate the bounding box for an arbitrary model.

Previously I just grabbed the "max" and "min" vertices in terms of their coordinates and just set those as the max and min points for the bbox and the results seemed ok (this led to some overhead while parsing vertex coords), but is there a better or more correct way to do it?
Last edited by finale00 on Tue Mar 06, 2012 9:40 am, edited 1 time in total.
Vashey
advanced
Posts: 41
Joined: Tue Mar 15, 2011 2:47 pm
Has thanked: 9 times

Re: Señor Casaroja's Noesis

Post by Vashey »

How do you add plugins? I've put the dlls in the plugin file but it doesn't seem to work.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Señor Casaroja's Noesis

Post by finale00 »

mesh.uvs contains a list of vec3's.
I don't need the 3rd value. Fastest way to get it?

What I'm doing now

Code: Select all

mesh.uv[i].toBytes()[:8]
jackjack45
ultra-n00b
Posts: 6
Joined: Thu Feb 23, 2012 3:07 am

Re: Señor Casaroja's Noesis

Post by jackjack45 »

I remember a while back when you posted in the Dissidia Modding Suite for Prologus that you hadn't found a way )command line, I'm guessing) to get the cutscene models in a T-pose with skeleton, Mr.Adults. Did you ever find/figure out how to do it? It wasn't addressed again that particular thread and I'm curious to know. So I had been using the wrong command line all along? Damn, so what the right one for getting the model in a T-pose then?
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Señor Casaroja's Noesis

Post by MrAdults »

finale00: If you need an AABB then what you're doing should work just fine. There's actually already a native function to calculate bounds, radius, and 2D radius for a whole model called rpgGetModelExtents, but it works on a per-model (not per-mesh) basis and apparently I didn't expose it to Python. I don't know why I didn't. It shouldn't be too world-endingly expensive to do in Python, though.

Taking an 8 byte slice of the raw byte array works. Or you could write out each element as a float. You shouldn't notice any real performance difference between the 2 approaches.

jackjack45: Based on the forum search I don't seem to have ever posted in a thread here containing the words "Dissidia Modding Suite" so I have no idea what you're talking about, and I already answered all of those other questions in my last post. You can't do it because I haven't given you the option to do it.

Vashey: Be more specific. Which plugin(s) are you trying to use? Are you putting it with the other Noesis plugin DLL's that come with Noesis? Are you trying to use plugins (.dll files) or Python scripts (.py files)?
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Señor Casaroja's Noesis

Post by finale00 »

Yes, I only need the bounds for the entire model.
jackjack45
ultra-n00b
Posts: 6
Joined: Thu Feb 23, 2012 3:07 am

Re: Señor Casaroja's Noesis

Post by jackjack45 »

Oh, sorry about that Mr. Adults, I read your last post wrong. I could have sworn you had posted in the thread I mentioned. I probably confused your icon with someone else since I'm browsing on my PSP. Didn't mean to cause any confusion. Thanks for the help!
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Señor Casaroja's Noesis

Post by MrAdults »

Oh, ok. No problem.

Edit: Unrelated note, I'm browsing the forums and catching up on some stuff I've been missing for weeks/months. You've done a lot, finale00 - good job on all of the tutorials and new Noesis scripts. I'm quite happy to see you doing all of this and helping Noesis get more recognition/usage even in my absence. (though I'm sure you aren't doing it for my sake, I nonetheless want to express appreciation) And chrrox too of course, but he already knows I love him.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Señor Casaroja's Noesis

Post by finale00 »

I'm getting the path of the directory using "rapi.getDirForFilePath(rapi.getInputName())", but it seems like in command line mode, the directory is just the empty string? Or at least, I have no idea what the current working directory is.

Trying some more things, it looks like if I just ask for the absolute path of the file, it takes me to where I'm actually calling noesis from (in this case, from a batch file in a completely different folder)

So I can just say "os.path.dirname(os.path.absname(rapi.getInputName()))", which gets me the correct directory path so I can load all of the meshes in the folder at once and export them.

I guess in this case, I could check whether dirpath == "" and then use the os.path version.
But this is assuming the batch file and the model file are in the same folder. Have not checked what happens if someone decides to reference a file's abspath in command-line...

Code: Select all

def get_directory_path():
    dirPath = rapi.getDirForFilePath(rapi.getInputName())
    if not dirPath:
        dirPath = os.path.dirname(os.path.abspath(rapi.getInputName()))    
    return dirPath
==========================

Secondly, is there a fast way to get the index of the material that the mesh uses?

In the dataviewer, I can examine the mesh and it tells me which material it uses...by name.

But we know that a lot of formats simply index into a material array, so I want to be able to quickly get the index without having to build a list of mat names on my own and get the index by searching through that list.
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Señor Casaroja's Noesis

Post by MrAdults »

In command-line mode because the file path you're giving it isn't absolute, the directory of the file is "" because it doesn't have an absolute path. This is actually correct. Example:

noesis ?cmode "c:\mydir\blah.obj" "c:\mydir\blah.fbx"
^ Directory of blah.obj is "c:\mydir\"

noesis ?cmode blah.obj blah.fbx
^ Directory of blah.obj is "", because you're relying Noesis finding the file in the current working directory.

Say blah.png is in the same directory and you want to open. In the first example you append the filename to the directory and open "c:\mydir\blah.png". That works. In the second example you append the filename to the directory (which is "") and open "blah.png". That also works, because it's still going to go through the working directory for all file operations.

Material index... I would just print the material list in Python. Since you're already using your own support framework, you could just make a quick function that iterates a material list and prints names and whatever else you care about, and then you've got that forever after.

Also, I just noticed you've amassed nearly 1300 posts in less than a year of being a member here. Such tenacity.
Post Reply