Nearly finished my basic port for 3ds Max.
this little script can start xnormal, bakes high to low and can visualize the result via the Xoliulshader.
hope i got not that much bugs. still new to max script :poly142:
this tool only bakes one lowpoly in your current max scene. the highpoly has to be finished with some other tools or exported as supported filetype for xnormal. there are other tools that can handly highpoly with good quality better than 3ds max ^^
here some explanations
File Path Settings- Results
- the final images are stored here
- Work
- here are placed the highpoly, lowpolys and the base textures for the highpoly
- xNormal
- Path to xNormal (x86 or x64)
- with x86 you can also use the experimental hxGrid network rendering
Generell Settings- Get Size
- if current selected object got a texture, the texture size is shown in the left two bars
- Texture Sizer
- if set, the UV-Layout will be used to calculate the final texture size via different methods. explained later
- Bake Processing
Texture Size Settings- Simple Detection
- evaluates the texture size by a fast method over a single edge
- the uv layout shouldn't be stretched!
- result isnt power of 2
- Fine Detection
- evaluates the final texture size by the real volume of the 3d space and the uv space
- result isnt power of 2
- Force Size Power of 2
- the result of the detection is brought to the next power of 2 for booth sides seperatly
- texel proportion is still valid
- Tollerance in %
- if the result of the detected texture size is % over a valid power of 2 value, then it will be strechted to fit this size
- booth sides are evaluated seperatly
- Texelsize
- how many pixel you want...
- Unitsize
- to fit in this amount of units
- Edge Padding
- Edge Bledding about this size in pixel
xNormal Bake Settings- Bake Diffusemap
- enables diffusemap baking in xnormal
- Bake Normalmap
- enables normalsmap baking in xnormal
- Bake Heightsmap
- enables heights baking in xnormal
- Bake AO
- enables ambient occlusion baking in xnormal
- CageSize
- sets the push value for a cage
- Mips to Render
- not supported right now, will implement later
- BatchBake xNormal
- this little option opens a file dialog, where you can multiselect different xnormal xml files. these xml files will all be rendered via xnormal
- Export only
- only export the current object but dont start xnormal
- good for batchbake later
Texture Generation- *.TGA
- resulting images are saves as tga
- *.DDS
- resulting images are saves as dds
- DDS Settings
- how many mimaps the dds should have
- all mimaps or 1 to 5
- Bake AO to Diffuse
- Multiplys the AO Texture with the Diffuse Texture
- deletes the AO texture
Grab Image Settings
- DirectX
- applies on the current object the images a DirectX Shader
- resulting root is searched for texture that fits the current object
- Standard
- applies on the current object the images a Standard Material
- resulting root is searched for texture that fits the current object
To get it work, the stuff you want to bake have to fit some name conventions and the highpoly mesh sould be already existing in the work root. the base texture of the highpoly mesh should be placed there also
lowpoly should be named like objectname +L01
highpoly mesh file should be named like objectname +L00
multi highpolymeshfiles should be named like objectname +L00_n+1
highpoly base texture should be named like the highpolymesh
example
Box01_L01 <--- Lowpolymesh object in Max
Box01_L00.fbx <--- Highpoly meshfile on disc
Box01_L00.tga <--- Highpoly texture on disc
if your highpoly is existing as multiple files, they should be named like
Box01_L00_1.fbx <--- Highpoly meshfile on disc
Box01_L00_1.tga <--- Highpoly texture on disc
Box01_L00_2.fbx <--- Highpoly meshfile on disc
Box01_L00_2.tga <--- Highpoly texture on disc
the valid filetypes are limited by the xnormal support of files.
think i got it all :poly122:
heres the script. just drag&drop in your max scene. it will extract in scripts root. a macro script will be added also
http://www.scriptspot.com/files/u12142/PB_Texturizer.mzp
Replies
the tool tooks me 1 year of life. max can be a bitch sometimes *g*
hope you dont mind that i used some of your functions
the only thing i still got on list is prerendering of mimaps.
got it to work but the stitch tool from nvidia does weird things.
the final image is toasted afterwards.
Changes
ToDo for next Update
damn locals and globals.
to clean up those variables will take some time *g*
i drag and drop the file over the viewport..
what then?
start the corresponding script or inside the toolbar under group Piranha-bytes is a new option with PB_Texturizer
this you can place as key shortcut or in a toolbar