www.tombraiderforums.com

www.tombraiderforums.com (https://www.tombraiderforums.com/index.php)
-   XNALara (https://www.tombraiderforums.com/forumdisplay.php?f=52)
-   -   XnaLara for 3dsmax (https://www.tombraiderforums.com/showthread.php?t=181251)

mariokart64n 14-05-11 16:15

XnaLara for 3dsmax
 
Maxscript for importing and exporting geometry between 3dsmax and xnalara.
maxscripts tested on 3dsmax8-3dsmax2012 should work across all versions of max past v8(2005).

Videos are included below to give an idea of script operation. but are not made to teach you 3dsmax.
scripts are designed with the assumption that the user is already capable in 3dsmax.

Please leave feedback if you have an idea that would benefit the script.

-mariokart64n
"mario_kart64n(at)hotmail(dot)com"


MaxScript - XnaLara Import/Export
https://dl.dropbox.com/u/86746436/Ma...20Converter.ms (Updated: March 07, 2016)


VIDEO Complete Xnalara Import/Export Script:


VIDEO XNALara (Beginners Tutorial for 3dsmax):


[OUTDATED] VIDEO (Importing Models From XNALara to 3DSMAX):


[OUTDATED] VIDEO (Exporting Models From 3DSMAX to XNALara):





DeleteDoubleFaces: http://www.mediafire.com/?3dmab8ej93b9faw

OLD SCRIPTS
Quote:

MAXSCRIPTS:
Mesh Importer: http://www.mediafire.com/?z2vbc4lbbobtlwk
Ascii Exporter: http://pastebin.com/1p7GKNhg
Xnalara Converter (Updated: August 2, 2011):http://www.mediafire.com/?139hxd1wb2cbf4j

Features Yet to be added, will be included with UserInterface
Import:
- Ascii Import Support
- Ascii Editor (Reassign Textures/Rendering Group)

Export:
- Copy Materials on Export (Copies any textures used on the model to the export path)
- Fix Error with Reading Instanced Modifiers
- Multiple UV Support
- Actual Normal Recalulation
- Project CleanUp (Removes unused assets from the Project Folder)
- Add diffuse colour pickup on material gathering (export this if no diffuse map)

Notes / Research:
Mesh Spec:
http://xnalara.svn.sourceforge.net/v...=3&view=markup
http://xnalara.svn.sourceforge.net/v...=3&view=markup


EDIT2
DOWNLOAD SCRIPT: (May31,2011) OUTDATED
http://www.mediafire.com/?z2vbc4lbbobtlwk


DOWNLOAD DeleteDoubleFaces SCRIPT: (By Bobo)
http://www.mediafire.com/?3dmab8ej93b9faw

Ventrue 15-05-11 10:14

Quote:

Originally Posted by mariokart64n (Post 5415379)
Bone Limit 59?

For just one meshpart... According to Dusan, that's the hardware limit, or s/t like that. If you separate the mesh you can have as many bones as you want. (My Bayonetta port has like 300 bones. :D)

Anyway... You can still contact XNAaraL on deviantART.

mariokart64n 15-05-11 14:32

great, then its 59 per mesh piece. otherwise theres no limit, just as long as the persons hardware holds up to XXX amount of bones right?

next, are there mesh limits?

also important how are textures detected?

the paths are like: data/somewhere/mytexture_diffuse.png

1. can I ignore paths, and only state texture name.
2. can I assume that name descriptors are always present.
example: eye_diffuse.png, eye_lightmap.png
the only way I can determine a texture from each other is by reading the name "diffuse" of "lightmap"
without that, there is no other indicators in the mesh or ascii format.

I need more info on the generic format, i know that alot of the meshes are hardcoded.. so you cannot alter the meshes order or the bone order. however its possible the generic mesh type bypasses these limitations. and if it does not follow descriptors then I have to rethink the texture type detection

sn00p 15-05-11 14:43

I doubt there's mesh limit, even if it's gotta be high, since some Lara models are with 40/50 meshes.

About the paths, I guess they can be ignored if they are in the same folder as the .mesh file, Blender export the file with the full path to texture but while editing the .mesh.ascii you can let just Texture_Diff.png and will work fine.

Uhm not everyone use _diffuse/_diff or w/e is it when they release something, but I guess wouldn't hurt to be a "standard" and it's aesthetic tho.

Ventrue 15-05-11 15:00

I was thinking about the textures' detection. I think it depends on the order in the mesh.ascii. For example: There's a meshpart with a diffuse, a specular, a bump and with a lightmap. It will start like this in the mesh.ascii:
Code:

25_meshname
1 # uv layers
4 # textures
diffuse_map.extension
0 # uv layer index
lightmap.extension
0 # uv layer index
bump_map.extension
0 # uv layer index
specular_map.extension
0 # uv layer index

There's a different order for every rendergroup though...

http://www.tombraiderforums.com/show...postcount=1735

sn00p 15-05-11 15:11

Yea the order for each group can be found here http://www.tombraiderforums.com/show...postcount=1735

Ventrue 15-05-11 15:12

Quote:

Originally Posted by sn00p (Post 5417705)
Yea the order for each group can be found here http://www.tombraiderforums.com/show...postcount=1735

Just added that link to my post... xD

mariokart64n 15-05-11 15:14

I don't understand what are these groups?

is this for the hardcoded mesh files or the generic format?

if I understand correctly group 1, which is mesh 1, does diffuse, bump, light
but mesh 2 only does diffuse, bump.. something to that effect?

o0Crofty0o 15-05-11 15:39

These groups are used in generic meshes.
They tell how many textures go on one mesh part and wich ones. The order of the listed textures is quite important there^^

for eg render group 1_ wants 6 textures they have to be listed like : diffuse, lightmap, bump, mask, minibump1, minibump2

but this changes with the render groups for eg 6_ only needs 2 textures listed like: diffuse, bump

but well mesh 1 doesn't have to be render group 1. you can use every render group you want on any mesh you want.... :)

mariokart64n 15-05-11 15:42

ok so that list is only relating to the generic format. and what does groups mean?

a group of meshes..

mesh1, mesh2, etc..

or mesh1 is group1?

I'm scripting up the material section of the importer now, after thats done max import will be working.

o0Crofty0o 15-05-11 15:44

Quote:

Originally Posted by mariokart64n (Post 5417765)
ok so that list is only relating to the generic format. and what does groups mean?

a group of meshes..

mesh1, mesh2, etc..

or mesh1 is group1?

I'm scripting up the material section of the importer now, after thats done max import will be working.

not sure why it's called like that xD I think it simply means that 1_ and all 6 textures are a group. It's nothing realted to meshes actually...just to those numbers.

mariokart64n 15-05-11 16:36

huh, now i'm a bit confused.. so if I name a mesh part _1.. then it takes on group ones texture properties? 6textues etc..

the groups are activated how?

>Script update:

Mesh Import Ready, materials aren't fully sorted out only applies diffuse at the moment until I can understand what funny business is going on with the materials in xnalara <_<

also 3dsmax does not support normals and tangents, so I'm trying to figure a way to store them or trick a way for them to be used.

<Drag Script into 3dsmax to run importer>
http://www.mediafire.com/?z2vbc4lbbobtlwk

monique1983 15-05-11 17:20

Quote:

Originally Posted by mariokart64n (Post 5417877)
huh, now i'm a bit confused.. so if I name a mesh part _1.. then it takes on group ones texture properties? 6textues etc..

the groups are activated how?

>Script update:

Mesh Import Ready, materials aren't fully sorted out only applies diffuse at the moment until I can understand what funny business is going on with the materials in xnalara <_<

also 3dsmax does not support normals and tangents, so I'm trying to figure a way to store them or trick a way for them to be used.

<Drag Script into 3dsmax to run importer>
http://www.mediafire.com/?z2vbc4lbbobtlwk

Thanks.. was age that i was looking for this, 'couse i work only with Max... is Export/Import?

edit.. i've try.. but don't works..

mariokart64n 15-05-11 17:37

oh yeah, I forgot to change the input line.. so its expecting a fixed path.

i'm lazy to reupload, but if you want to fix it yourself open the file in a note pad

and change this
Code:

fsource="C:\\Program Files (x86)\\XNALara\\data\\lara_bathing_suit\\lara_bathing_suit.mesh"


-- fsource = GetOpenFileName \
-- caption:"[PC] XnaLara Mesh File" \
-- types: "Binary(*.mesh)|*.MESH|All files (*.*)|*.*|"

to this

Code:

--fsource="C:\\Program Files (x86)\\XNALara\\data\\lara_bathing_suit\\lara_bathing_suit.mesh"


fsource = GetOpenFileName \
caption:"[PC] XnaLara Mesh File" \
types: "Binary(*.mesh)|*.MESH|All files (*.*)|*.*|"


monique1983 15-05-11 17:41

Quote:

Originally Posted by mariokart64n (Post 5418027)
oh yeah, I forgot to change the input line.. so its expecting a fixed path.

i'm lazy to reupload, but if you want to fix it yourself open the file in a note pad

and change this
Code:

fsource="C:\\Program Files (x86)\\XNALara\\data\\lara_bathing_suit\\lara_bathing_suit.mesh"


-- fsource = GetOpenFileName \
-- caption:"[PC] XnaLara Mesh File" \
-- types: "Binary(*.mesh)|*.MESH|All files (*.*)|*.*|"

to this

Code:

--fsource="C:\\Program Files (x86)\\XNALara\\data\\lara_bathing_suit\\lara_bathing_suit.mesh"


fsource = GetOpenFileName \
caption:"[PC] XnaLara Mesh File" \
types: "Binary(*.mesh)|*.MESH|All files (*.*)|*.*|"


oh.. ok.. wait.. why have you wrote Lara Bathing suit??? :confused:

monique1983 15-05-11 17:46

Good work!!! Works perfectly... now i need an exporter.. becouse i rig my models with max...;)

mariokart64n 15-05-11 17:47

I was testing on that mesh file, its quicker to fix a file in the script when testing and debugging. cause it'll import that mesh once the script is executed.

if I had done it otherwise I would have to re-open the file again through the windows file browser.. it adds 30secs to each time I want to test.. but just that little bit is annoying, thats why I always fix the file in the script when testing.

but I forgot to change it before I posted it.. so it tries to open a file on my computer, that may not exist on your computer.

EDIT


Import isn't complete, I need to complete that before I can start the exporter.

I need to implement tangents and normals, then I need help with the materials? are all the materials hardcoded into XnaLara?
if so I need a compile of the materials to hardcode into my script

tombraidergale 15-05-11 18:47

Quote:

Originally Posted by mariokart64n (Post 5417877)
huh, now i'm a bit confused.. so if I name a mesh part _1.. then it takes on group ones texture properties? 6textues etc..

the groups are activated how?

It's not exactly like that, consider the mesh group like a prefix of your mesh's name. For example, if you call your mesh part "1_meshname", you'll have to assign 6 textures in the correct order: Diffuse, Lightmap, Bumpmap, Mask, Bump1, Bump2.
The same goes for every other meshgroups, for example "5_meshname" uses only a diffuse map without an alpha channel, while "7_meshname" uses a diffuse map with an alpha channel :)

mariokart64n 15-05-11 18:57

thanks, thats all I needed to know ^_^

Now I can complete the importer and start for the exporter.. then its just a matter of testing :P

EDIT
~_~ there seems to be more to it then just 1_ or 2_...

in the generic_item files there is additional information in the name like "_0.1_16_16" .. values for something?

sephiroth99 15-05-11 20:02

Quote:

Originally Posted by mariokart64n (Post 5418216)
~_~ there seems to be more to it then just 1_ or 2_...

in the generic_item files there is additional information in the name like "_0.1_16_16" .. values for something?

the values are explained in this tutorial by Ol.a. It seems those values are only used by some render groups.

http://www.3d.tombraider.gr/render_groups.htm

mariokart64n 15-05-11 20:19

awesome, thanks I was searching the forum for info about the generic_item type. but was only finding little spats like "add 0.1_0_0 its default!"

I'm surprised that info isn't linked with the xnalara download. thats a rather critical part if anyone hopes to learn how to add new models.

also the majority of the information seems to be miss translated.. micro maps lol

hopefully my maxscript will bring power back to the fellow n00b!


EDIT
here's what I'm assuming the name system is

<Material Type> <Mesh Name> <Spec Power> <Bump1 Scale> <Bump2 Scale>
example:
1_myModel_0.1_0_0

this system is very sloppy and material parameters are really basic
seems this is all a hackup, I'm not sure why dusan did not setup a proper material system O_o aw well

EDIT2
I'm going to go ahead and assume XNAaraL is ignoring my inquires about the generic_item materials
either way the setup is a real pain, and I'm still unsure how to approach it so that everything it automated. I'd like to have it so that the user can just hit export and the proper rendering group will be automatically setup in your export.

but then do I add support to the exporter for existing models? models that are not generic_item meshes.. hm..

Edit3
my proposal on getting a more detailed model of angelina jolie got shot down hard. however I still don't see the harm in editing the model into xnalara. even only for private use.
if anyones interested in rigging up the head PM me.
[IMG]http://i54.************/1zgf2mt.jpg[/IMG]

Ventrue 16-05-11 14:19

Hey! I was testing your script, and here's a suggestion:

There are many generic meshes, which have 'unused' bones. These bones are usually moving some small parts, like they're 'fine-tuners', or they are simply not moving anything, so modders just give them an 'unused' prefix, and XNALara will ignore them. They show up in Max though, and you get a really messy skeleton. Is it possible to hide those?

grotesque 16-05-11 16:40

Is normal this?
http://i.imgur.com/QLCFc.jpg
Lara don't have same problem

irishhips 16-05-11 18:45



Animation test using the script

mariokart64n 16-05-11 20:33

@Ventrue
ok, but I think some of the un-used bones actually have some vertices assigned to that, so removing them could cause problems. but I'll look into it, and delete them if possible.

if not, then I'll have to make a way of excluding it from the main skeleton, or like you said hide them

@grotesque
I noticed this last night.. the normals get deleted after the skin modifer is applied. I'll have to enter the normals in a modifier and add that over top the skin modifer..

its complicated cause 3dsmax doesn't fully support normals. it tries to convert them to smooth groups. which it doesnt do properly.. so you get that black area effect

o0Crofty0o 16-05-11 20:34

Quote:

Originally Posted by mariokart64n (Post 5420131)
@Ventrue
ok, but I think some of the un-used bones actually have some vertices assigned to that, so removing them could cause problems. but I'll look into it, and delete them if possible.

if not, then I'll have to make a way of excluding it from the main skeleton, or like you said hide them

Dunno about 3ds max... but in blender those unused bones are on a second bone layer. I don't know if there are bone layers in 3ds max but that would be a nice option i guess :)

mariokart64n 17-05-11 02:41

wrote up a script that reads through a ascii mesh, to gather information on the "generic_item" name format

here's what I got on the first file:
Quote:

albino_spider.mesh.ascii

2_body_0.3_0_0_head_head jaws upper left 1_head jaws upper right 2
2_legs1_0.3_0_0_body_root body
2_eyes_0.4_0_0
2_legs2_0.3_0_0
previously I had thought the format when something like this
<Mesh Name> <Spec Power> <Bump1 Scale> <Bump2 Scale>

although in the above example bone names are appearing in the mesh name.

any ideas why? how does that have any significance to the materials?

sephiroth99 17-05-11 03:00

Quote:

Originally Posted by mariokart64n (Post 5420641)
wrote up a script that reads through a ascii mesh, to gather information on the "generic_item" name format

here's what I got on the first file:


previously I had thought the format when something like this
<Mesh Name> <Spec Power> <Bump1 Scale> <Bump2 Scale>

although in the above example bone names are appearing in the mesh name.

any ideas why? how does that have any significance to the materials?

nope that's for the camera view in XNALara :) I don't think it's important at all for the mesh/model

mariokart64n 17-05-11 03:04

cool, thanks for clearing that up.

I'll gather some more information like bump scale and spec power so I can import the materials more true to xnalara.

EDIT

Ok.. another question.. as it stands the default models in xnalara are hardcoded into xnalara.. meaning xnalara expects a certain skeleton to be present or a certain mesh to be within the mesh file.. if theres a difference xnalara crashes. this was before the generic_item spec existed, some may know that from modding mesh withs in blender..

the generic_item format isn't a problem I can dump whatever into it, and aslong as this render group business is setup right theres no problems (no xnalara crashing).
the concerning issue is editing existing hardcoded models.. not only do I have to consider mesh names, but I have to consider the skeleton, mesh order and materials.

my question is, do you guys feel that being able to edit hardcoded models is important?

if so I have to make it so my script creates a profile of an opened mesh files. then when you export it, it'll make sure your export follows the bone,mesh, material orders.

i'll make up a GUI, and probably have a drop down, "Export as Existing MESH","Export as NEW MESH"

"Export as NEW MESH" of course will be the generic_item spec...


?? feedback please

XNAaraL 17-05-11 07:40

How rude. :(
 
Quote:

Originally Posted by mariokart64n (Post 5418364)
awesome, thanks I was searching the forum for info about the generic_item type. but was only finding little spats like "add 0.1_0_0 its default!"

Maybe you should optimize your search strategy. http://www.tombraiderforums.com/show...&postcount=850

Quote:

Originally Posted by mariokart64n (Post 5418364)
This system is very sloppy and material parameters are really basic
seems this is all a hackup, I'm not sure why not setup a proper material system O_o aw well

Quote:

Originally Posted by mariokart64n;
your concept might have been a quick work around for dusan, but its unprofessional and sloppy.

Criticize my work only after you've made ​​it better. My Generic_Item extensions were implemented by me before the source code was available.
The requirements: http://www.tombraiderforums.com/show...&postcount=197
  1. To integrate a new interface and format for modders, easy to use.
  2. The generic format has no limits. Any number of bones, meshes, camera pivots and materials.
  3. New models support all hard-coded functions of XNALara.
  4. All existing features and all future enhancements made ​​by Dusan automatically work with the new format and the new Interface.
  5. All models released by Dusan and all the mods still work there.
  6. The existing poses and scenes should be able to be used without any changes.
  7. The new format is compatible with the existing external utilities.
  8. Making only minor changes on the existing source code of XNALara (As little work as possible for Dusan)
  9. The stability of the XNALara application shall not be affected.
  10. The existing models can be automatically converted to the new format.
  11. The new interface must use the internal routines for loading of skeletons and mesh.
  12. The new interface must use the internal routines for rendering.
  13. Future shaders are automatically recognized and supported.
  14. The generic format must be transparent. It thus operates automatically and invisibly in the background.
  15. ...
  16. Implementation of a new function for normal users (Not modders). Dusan so are not bothered with questions about the Generic_Item changes.
  17. The extensions works with XNALara even the source code is not available at this time.
Attempts to implement these requirements themselves. Then You can criticize me.

Quote:

Originally Posted by mariokart64n (Post 5418364)
I'm going to go ahead and assume XNAaraL is ignoring my inquires about the generic_item materials
either way the setup is a real pain

  • This claim is not polite.
  • You never asked me!
  • Why do you expect support from me? I left this forum. Why do you expect that I answer here?
  • I have contacted you in the past several times with PM. You're the one who has never answered me.
Your behavior is rude.

Quote:

Originally Posted by mariokart64n (Post 5420656)
Ok.. another question.. as it stands the default models in xnalara are hardcoded into xnalara.. meaning xnalara expects a certain skeleton to be present or a certain mesh to be within the mesh file.. if theres a difference xnalara crashes. this was before the generic_item spec existed, some may know that from modding mesh withs in blender..

the generic_item format isn't a problem I can dump whatever into it, and aslong as this render group business is setup right theres no problems (no xnalara crashing).
the concerning issue is editing existing hardcoded models.. not only do I have to consider mesh names, but I have to consider the skeleton, mesh order and materials.

my question is, do you guys feel that being able to edit hardcoded models is important?

if so I have to make it so my script creates a profile of an opened mesh files. then when you export it, it'll make sure your export follows the bone,mesh, material orders.

i'll make up a GUI, and probably have a drop down, "Export as Existing MESH","Export as NEW MESH"

"Export as NEW MESH" of course will be the generic_item spec...

?? feedback please

Read the available tutorials ! http://www.tombraiderforums.com/show...85&postcount=1
I have already implemented this functionality since XNALara version 7.2.
  1. Load the original model into XNALara. In the main window, hit the function key F11 to convert the model as Generic_Item.mesh .
  2. Use as filename: Generic_Item !!! The extension .mesh.ascii addet XNALara automatical
  3. Move the resut file Generic_Item.mesh.ascii over my GeMeshAsciiToBin.exe program. The result: Generic_Item.mesh :ton:

Ventrue 17-05-11 12:47

Quote:

Originally Posted by mariokart64n (Post 5420656)
my question is, do you guys feel that being able to edit hardcoded models is important?

if so I have to make it so my script creates a profile of an opened mesh files. then when you export it, it'll make sure your export follows the bone,mesh, material orders.

i'll make up a GUI, and probably have a drop down, "Export as Existing MESH","Export as NEW MESH"

"Export as NEW MESH" of course will be the generic_item spec...


?? feedback please

I think we're totally fine with generic meshes. :)

mariokart64n 17-05-11 20:36

alright I guess, I'll focus my efforts on the generic_item format


@XNAaraL
> Sorry for slandering you, but I have a zero understanding of whats happened around here in the past year. All I knew was you were anger at me for something I didn't do a year ago. and that replying to you or sending you a message was impossible {you've blocked incoming PMs}

> I still feel the format is sloppy, but thankyou very much for giving more information about the format.

> I didn't intend for there to be any ill will between us. so maybe we can start over? my email is in my profile, maybe add me on msn or something. I'm sure there are many things we can learn from each other.

-mariokart64n

XNAaraL 18-05-11 08:45

Quote:

Originally Posted by mariokart64n (Post 5422033)
So maybe we can start over?

Sure. :hug:
Quote:

Originally Posted by mariokart64n (Post 5422033)
My email is in my profile, maybe add me on msn or something. I'm sure there are many things we can learn from each other.

I dont use email or msn. I am member in many foren. I leave TRF and are only back for short time because this case :hea:

I'm sure you'll find me with help from google. ;)

mariokart64n 19-05-11 00:01

I see..

when I was doing a search about the generic_item I came across a few xnalara specific forums..

however they all seem to have small populations.. or alot of empty topics that havent been active for months.

either way I'm disappointed how much xnalara's community has crumbled and divided in the past year. ..real shame.

mariokart64n 29-05-11 00:25

does anyone know what the 3 channels in the mask is used for?

channel 1 of the texture mask is reserved for bump1
channel 2 of the texture mask is reserved for bump2
channel 3 doesn't seem to cause rendering effects, although is seen as a texture of smoke or clouds...

Anyway have an idea of why the green channel has such a mask?

jnka 01-06-11 00:55

Out of curiosity for what version of max are you designing the script.
I;ve got max nine and sadly the only thing it throws at me when I try to launch the script is "aborted"

mariokart64n 01-06-11 03:19

uhm... yeah its because I forgot to re-enable the file prompt.. it was addressed a few pages back..

anyway here's a fixed script, as well a video explaining the script. if you have an issue running this new script, just refer to the video.

SCRIPT:
http://www.mediafire.com/?z2vbc4lbbobtlwk


VIDEO:

sn00p 01-06-11 05:36

Great job as always, gonna try it soon, watched the video just out of pure curiosity.

jnka 01-06-11 10:11

Much thanks mario

grotesque 01-06-11 17:40

Nice :-D
But can put a link for DDF?
Work in 3dsmax 2012?


All times are GMT. The time now is 02:14.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.