Maxigo-07 v.02 (update-21.April 2007)

Announcements, requests and support regarding the 3DS MAX exporter
Post Reply
176 posts
User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Maxigo-07 v.02 (update-21.April 2007)

Post by suvakas » Tue Jan 30, 2007 10:41 pm

When U3dreal declared, that he will abandon his excellent exporter script for max, then quite a fiew of us decided to pick up maxscript to code some kind of replacement for it.(or at least try to 8) ) And so did I (even though I had no former maxscript experience.)
I have no info about how far the others are with their scripting, but I decided to open a small blog type of thread about how far I am with mine.
First of all - this small script of mine is not intended to be the "Next Big Exporter" for max users (there should be one more serious thing in the making now by VictorJapi (well..at least he sounds like he knows what he is doing :) ) and U3dreal has stated, that he will update his great exporter too). So I will keep my project as my late night hobby and as my door into maxscript world 8)

Anyway. Here is the list of the fiew features my script currently supports:

Supported in v.01 :
===================
* geometry export to xml format
* geometry export to 3ds format
* geometry export to obj format
* Mesh instancing
* Meshlights
* Camera export (Image aspect, F-Stop, Bloom, Autofocus)
* Physical Sky/Sun (using Direct Light)
* HDR Environment map (only EXR format at the moment)
* Bitmap textures (no procedural textures yet)
* Tone mapping
* Diffuse Material
* Phong Material
* Medium/SSS Material
* Null Material
* Emitter Material
* Blend Material (through Max Blend material)
* Multi-Material
* Animation support (experimental)
* Indigo Setup using *.ini file (no manual editing required)

Changes in v.01b :
===================
* added option for Custom Image name
* added option to save EXR image
* added possibility to open the rendering in Max Frame Buffer
* Geometry format selection gets saved
* HDR environment has now more reasonable gain value (should render out nicely with default settings)
* Max version checking when viewing environment EXR image. (EXR is not supported in Max 7 and down)

Changes in v.01c :
===================
* added - Alpha map to Diffuse Material
* added - Alpha map to Phong Material
* added - RGB Multiplier for Absorption (Medium/SSS material)
* added - RGB Multiplier for Scattering coef. (Medium/SSS material)
* added - Maximum Power value increased to 9999 (Emitter material)
* added - Basic support for Vray material (only color,reflection and glossiness for now)
* added - support for Vray Sun
* added - support for Max Daylight system
* added - support for Max Sunlight system
* added - Export Indigo Image (*.igi) (Export Scene rollout)
* added - Open igi in Tonemapper (Export Scene rollout) NB! IndigoToneMapper.exe must be in Indigo installation directory.
* added - Resume from igi (Export Scene rollout)
* added - automatic igi search
* added - "Fix mesh errors" option (Export Scene rollout)
* added - Utilities rollout
* added - Select Models Without Material (utilities rollout)
* added - Replace Spaces in material Names (utilities rollout)
* added - *.OBJ and *.3DS are exported into sub-folders with the scene name (/Exported_From_Max/3DS/scene_name)
* fixed - exported Bump values are smaller by one digit
* fixed - exported Glossy transparency values are smaller by one digit
* fixed - Models with same name are exported correctly
* fixed - Models with 0 faces are exported Ok
* fixed - typo in Exported_From_Max dir name (Fom changed to From)

Changes in v.02 :
===================
* added - Procedurals support
* added - Indigo Blend material type
* added - Indigo ImportMat material type
* added - Import/Export materials from/to Indigo material format (*.igm)
* added - Fog/Dust feature (Environment rollout)
* added - Polarisation on/off (Camera Rollout)
* added - Different rendering algorythms (Advanced Setup rollout)
* added - BiDir on/off (Advanced Setup rollout)
* added - Option for starting Indigo in lower priority mode (Advanced Setup rollout)
* added - Procedurals rendering resolution (Advanced Setup rollout)
* added - "Update image buffer" spinners enabled (Export Scene rollout)
* fixed - "Number Of Threads" maximum value raised to 100 (Export Scene rollout)



Get it from File Attachment !!

Basic video tutorial from Afecelis (thank you !!):
http://www.danielpatton.com/afecelis/In ... maxigo.zip (29 mb, wmv format)


[edit] I named my script to Maxigo. There are already Blendigo and Skindigo so i thought i keep the general naming "pattern". If you have a better idea, then let me know.
I've only tested the script on my own workstation so i'm not sure if it even runs on other Pc's. Let me know if it works or not !!

I'll keep adding to the list when i get more things done.

Take care ! (maxscript is fun)
Suvakas
Attachments
Maxigo-07_v02.zip
Latest version of Maxigo-07.
(227.2 KiB) Downloaded 724 times
Last edited by suvakas on Sun Apr 22, 2007 4:09 am, edited 7 times in total.

tizxx
Posts: 116
Joined: Tue Jul 04, 2006 1:50 am

Post by tizxx » Tue Jan 30, 2007 11:04 pm

Good words, finally...
We just start.. If you need any help I'm here...

if you need use this skeleton to export...

---

macroScript Max2Indigo category:"myTOOLS"
(

rollout EnviromentA "Enviroment" width:240 height:200
(
groupBox grp3 "SKY Light" pos:[8,80] width:216 height:48
editText edt16 "Temperature" pos:[16,32] width:200 height:16
editText edt17 "Gain" pos:[16,48] width:200 height:16
groupBox grp4 "Background" pos:[8,8] width:216 height:64
editText edt18 "Turbidity" pos:[16,104] width:200 height:16
groupBox grp5 "SKY Light" pos:[8,136] width:216 height:48
)

rollout Render_SettingsA "Render Settings" width:240 height:230
(
groupBox grp1 "Render Settings" pos:[8,8] width:216 height:176
editText RS_W "Width " text:"800" pos:[16,32] width:200 height:16
editText RS_H "Height" text:"600" pos:[16,48] width:200 height:16
checkbox RS_MET "Metropolis" state:true pos:[16,64] width:200 height:16
editText RS_LMP "Large mutation prob" text:"0.4" pos:[16,96] width:200 height:16
editText RS_MC "Max Change" text:"0.02" pos:[16,80] width:200 height:16
editText RS_RUS "Russian roulette live prob" text:"0.7" pos:[16,112] width:200 height:16
editText RS_STW "Strata Width" text:"10" pos:[16,144] width:200 height:16
checkbox RS_LOG "Logging" state:true pos:[16,160] width:200 height:16
editText RS_MD "MAX Depth" text:"0.4" pos:[16,128] width:200 height:16
button btn1 "Export --> INDIGO" pos:[8,192] width:216 height:24
on btn1 pressed do
(
-- Create MAIN file
createfile "c:\indigo\MYSCENE.xml"
myfile = openfile "C:\indigo\MYSCENE.xml" mode:"r+"

-- Create Material file
createfile "c:\indigo\MYMAT.xml"
myfilem = openfile "C:\indigo\MYMAT.xml" mode:"r+"

-- Create Geometry file
createfile "c:\indigo\MYGEOM.xml"
myfileg = openfile "C:\indigo\MYGEOM.xml" mode:"r+"

format "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" to:myfile
format "<!--Exported from Max2Indigo-->\n\n" to:myfile

format "<scene>\n" to:myfile

format "\t<!--RENDERING SETTINGS-->\n" to:myfile

format "\t<renderer_settings>\n" to:myfile

format "\t\t<width>%</width>\n" RS_W.text to:myfile
format "\t\t<height>%</height>\n" RS_H.text to:myfile
format "\t\t<metropolis>%</metropolis>\n" RS_MET.state to:myfile
format "\t\t<large_mutation_prob>%</large_mutation_prob>\n" RS_LMP.text to:myfile
format "\t\t<max_change>%</max_change>\n" RS_MC.text to:myfile
format "\t\t<russian_roulette_live_prob>%</russian_roulette_live_prob>\n" RS_RUS.text to:myfile
format "\t\t<max_depth>%</max_depth>\n" RS_MD.text to:myfile
format "\t\t<bidirectional>true</bidirectional>\n" to:myfile
format "\t\t<max_num_consec_rejections>1000</max_num_consec_rejections>\n" to:myfile
format "\t\t<strata_width>%</strata_width>\n" RS_STW.text to:myfile
format "\t\t<frame_upload_period>20</frame_upload_period>\n" to:myfile
format "\t\t<halt_time>-1</halt_time>\n" to:myfile
format "\t\t<logging>%</logging>\n" RS_LOG.state to:myfile
format "\t\t<image_save_period>20</image_save_period>\n" to:myfile
format "\t\t<save_tonemapped_exr>false</save_tonemapped_exr>\n" to:myfile
format "\t\t<save_untonemapped_exr>false</save_untonemapped_exr>\n" to:myfile

format "\t</renderer_settings>\n\n" to:myfile


-- Tone Mapping - reinhard
format "\t<!--TONE MAPPING REINHARD-->\n" to:myfile
format "\t<tonemapping>\n" to:myfile
format "\t\t<reinhard>\n" to:myfile
format "\t\t\t<pre_scale></pre_scale>\n" to:myfile
format "\t\t\t<post_scale></post_scale>\n" to:myfile
format "\t\t\t<burn></burn>\n" to:myfile
format "\t\t</reinhard>\n" to:myfile
format "\t</tonemapping>\n" to:myfile

-- Tone Mapping - Linear
format "\t<!--TONE MAPPING LINEAR-->\n" to:myfile
format "\t<tonemapping>\n" to:myfile
format "\t\t<linear>\n" to:myfile
format "\t\t\t<scale></scale>\n" to:myfile
format "\t\t</linear>\n" to:myfile
format "\t</tonemapping>\n" to:myfile

-- Background
format "\t<!--BACKGROUND-->\n" to:myfile
format "\t<background>\n" to:myfile
format "\t\t<spectrum>\n" to:myfile
format "\t\t\t<blackbody>\n" to:myfile
format "\t\t\t\t<temperature>3500</temperature>\n" to:myfile
format "\t\t\t\t<gain>1.0</gain>\n" to:myfile
format "\t\t\t</blackbody>\n" to:myfile
format "\t\t</spectrum>\n" to:myfile
format "\t</background>\n" to:myfile

-- SKY Light
format "\t<!--SKY LIGHT-->\n" to:myfile
format "\t<skylight>\n" to:myfile
format "\t\t<sundir></sundir>\n" to:myfile
format "\t\t<turbidity></turbidity>\n" to:myfile
format "\t</skylight>\n" to:myfile

-- Enviroment MAP
format "\t<!--ENVIROMENT MAP-->\n" to:myfile
format "\t<env_map>\n" to:myfile
format "\t\t<spherical>\n" to:myfile
format "\t\t\t<path>immagine.float</path>\n" to:myfile
format "\t\t\t<width>640</width>\n" to:myfile
format "\t\t\t<gain>0.9</gain>\n" to:myfile
format "\t\t</spherical>\n" to:myfile
format "\t\t<!--latlong>\n" to:myfile
format "\t\t\t<path>immagine.exr</path>\n" to:myfile
format "\t\t\t<gain>1.0</gain>\n" to:myfile
format "\t\t</latlong-->\n" to:myfile
format "\t</env_map>\n" to:myfile

-- CAMERA Settings
-- format "\t\t<pos>%,%,%</pos>\n" $camera01.pos.x $camera01.pos.y $camera01.pos.z to:myfile
format "\t<!--CAMERA SETTINGS-->\n" to:myfile
format "\t<camera>\n" to:myfile
format "\t\t<pos></pos>\n" to:myfile
format "\t\t<up></up>\n" to:myfile
format "\t\t<forwards></forwards>\n" to:myfile
format "\t\t<aperture_radius></aperture_radius>\n" to:myfile
format "\t\t<focus_distance></focus_distance>\n" to:myfile
format "\t\t<aspect_ratio></aspect_ratio>\n" to:myfile
format "\t\t<sensor_width>0.036</sensor_width>\n" to:myfile
format "\t\t<lens_sensor_dist></lens_sensor_dist>\n" to:myfile
format "\t\t<white_balance>D65</white_balance>\n" to:myfile
format "\t\t<autofocus/>\n" to:myfile
format "\t\t<bloom>\n" to:myfile
format "\t\t\t<weight></weight>\n" to:myfile
format "\t\t\t<radius></radius>\n" to:myfile
format "\t\t</bloom>\n" to:myfile
format "\t</camera>\n\n" to:myfile

format "\t<!--INCLUDE GEOMETRY-->\n" to:myfile
format "\t<include>\n" to:myfile
format "\t\t<pathname>mygeom.xml</pathname>\n" to:myfile
format "\t</include>\n\n" to:myfile

format "\t<!--INCLUDE MATERIALS-->\n" to:myfile
format "\t<include>\n" to:myfile
format "\t\t<pathname>mymat.xml</pathname>\n" to:myfile
format "\t</include>\n\n" to:myfile

format "\t<!--POSITION SINGLE OBJECTS-->\n" to:myfile
format "\t<model>\n" to:myfile
format "\t<pos></pos>\n" to:myfile
format "\t<scale>0.01</scale>\n" to:myfile
format "\t<rotation>\n" to:myfile
format "\t\t<matrix>\n" to:myfile
format "\t\t\t1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0\n" to:myfile
format "\t\t</matrix>\n" to:myfile
format "\t</rotation>\n" to:myfile
format "\t<mesh_name></mesh_name>\n" to:myfile
format "\t</model>\n" to:myfile

format "\t<!--EMITTER OBJECTS-->\n" to:myfile
format "\t<meshlight>\n" to:myfile
format "\t\t<pos></pos>\n" to:myfile
format "\t\t<scale></scale>\n" to:myfile
format "\t\t<rotation>\n" to:myfile
format "\t\t\t<matrix>\n" to:myfile
format "\t\t\t\t1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0\n" to:myfile
format "\t\t\t</matrix>\n" to:myfile
format "\t\t</rotation>\n" to:myfile
format "\t\t<mesh_name></mesh_name>\n" to:myfile
format "\t\t<spectrum>\n" to:myfile
format "\t\t\t<rgb>\n" to:myfile
format "\t\t\t\t<rgb>2550.0 2550.0 2550.0</rgb>\n" to:myfile
format "\t\t\t</rgb>\n" to:myfile
format "\t\t</spectrum>\n" to:myfile
format "\t</meshlight>\n" to:myfile



format "</scene>\n" to:myfile

-- Scene Materials
format "<scenedata>\n\n" to:myfilem

-- Material DIFFUSE - color
format "\t<!--DIFFUSE MATERIAL (ONLY COLOR)-->\n" to:myfilem
format "\t<material>\n" to:myfilem
format "\t\t<name></name>\n" to:myfilem
format "\t\t<diffuse>\n" to:myfilem
format "\t\t\t<colour> </colour>\n" to:myfilem
format "\t\t</diffuse>\n" to:myfilem
format "\t</material>\n\n" to:myfilem

-- Material DIFFUSE - color/diffuse map/bump map
format "\t<!--DIFFUSE MATERIAL (DIFFUSE MAP/BUMP MAP)-->\n" to:myfilem
format "\t<material>\n" to:myfilem
format "\t\t<name></name>\n" to:myfilem
format "\t\t<diffuse>\n" to:myfilem
format "\t\t\t<colour></colour>\n" to:myfilem
format "\t\t\t<albedo_texture>\n" to:myfilem
format "\t\t\t\t<uv_set>albedo</uv_set>\n" to:myfilem
format "\t\t\t\t<path></path>\n" to:myfilem
format "\t\t\t\t<exponent></exponent>\n" to:myfilem
format "\t\t\t</albedo_texture>\n" to:myfilem
format "\t\t\t<bump_map>\n" to:myfilem
format "\t\t\t\t<uv_set></uv_set>\n" to:myfilem
format "\t\t\t\t<path></path>\n" to:myfilem
format "\t\t\t\t<b></b>\n" to:myfilem
format "\t\t\t\t<exponent></exponent>\n" to:myfilem
format "\t\t\t</bump_map>\n" to:myfilem
format "\t\t</diffuse>\n" to:myfilem
format "\t</material>\n\n" to:myfilem

-- Material SPECULAR - Transparent/Medium
format "\t<!--SPECULAR MATERIAL (BUMP MAP)-->\n" to:myfilem
format "\t<material>\n" to:myfilem
format "\t\t<name></name>\n" to:myfilem
format "\t\t<specular>\n" to:myfilem

format "\t\t\t<transparent>true</transparent>\n" to:myfilem
format "\t\t\t<internal_medium_name>glass</internal_medium_name>\n" to:myfilem

format "\t\t\t<bump_map>\n" to:myfilem
format "\t\t\t\t<uv_set></uv_set>\n" to:myfilem
format "\t\t\t\t<path></path>\n" to:myfilem
format "\t\t\t\t<b></b>\n" to:myfilem
format "\t\t\t\t<exponent></exponent>\n" to:myfilem
format "\t\t\t</bump_map>\n" to:myfilem

format "\t\t</specular>\n" to:myfilem
format "\t</material>\n\n" to:myfilem

-- Material PHONG color
format "\t<!--PHONG MATERIAL (ONLY COLOR)-->\n" to:myfilem
format "\t<material>\n" to:myfilem
format "\t\t<name></name>\n" to:myfilem
format "\t\t<phong>\n" to:myfilem
format "\t\t\t<diffuse></diffuse>\n" to:myfilem
format "\t\t\t<ior></ior>\n" to:myfilem
format "\t\t\t<exponent></exponent>\n" to:myfilem
format "\t\t</phong>\n" to:myfilem
format "\t</material>\n\n" to:myfilem

-- Material PHONG diffuse map/specular map/bump map/
format "\t<!--PHONG MATERIAL (DIFFUSE MAP/SPECULAR MAP/BUMP MAP)-->\n" to:myfilem
format "\t<material>\n" to:myfilem
format "\t\t<name></name>\n" to:myfilem
format "\t\t<phong>\n" to:myfilem
format "\t\t\t<diffuse></diffuse>\n" to:myfilem
format "\t\t\t<ior></ior>\n" to:myfilem
format "\t\t\t<exponent></exponent>\n" to:myfilem

format "\t\t\t<albedo_texture>\n" to:myfilem
format "\t\t\t\t<uv_set></uv_set>\n" to:myfilem
format "\t\t\t\t<path></path>\n" to:myfilem
format "\t\t\t</albedo_texture>\n" to:myfilem

format "\t\t\t<bump_map>\n" to:myfilem
format "\t\t\t\t<uv_set></uv_set>\n" to:myfilem
format "\t\t\t\t<path></path>\n" to:myfilem
format "\t\t\t\t<b></b>\n" to:myfilem
format "\t\t\t</bump_map>\n" to:myfilem

format "\t\t\t<exponent_map>\n" to:myfilem
format "\t\t\t\t<uv_set></uv_set>\n" to:myfilem
format "\t\t\t\t<path></path>\n" to:myfilem
format "\t\t\t\t<b></b>\n" to:myfilem
format "\t\t\t</exponent_map>\n" to:myfilem

format "\t\t</phong>\n" to:myfilem
format "\t</material>\n" to:myfilem


-- Material TRUE METAL using NK files
format "\t<!--TRUE METAL MATERIAL -->\n" to:myfilem
format "\t<material>\n" to:myfilem
format "\t\t<name></name>\n" to:myfilem
format "\t\t<phong>\n" to:myfilem
format "\t\t\t<nk_data>nkdata/**.nk</nk_data>\n" to:myfilem
format "\t\t\t<exponent>1000</exponent>\n" to:myfilem
format "\t\t</phong>\n" to:myfilem
format "\t</material>\n\n" to:myfilem

format "</scenedata>\n" to:myfilem




-- Scene Geometry
format "<scenedata>\n\n" to:myfileg

format "\t<!-- OBJECT -->\n" to:myfileg
format "\t<mesh>\n" to:myfileg
format "\t\t<name></name>\n" to:myfileg
format "\t\t<embedded>\n" to:myfileg

format "\t\t\t<vertex pos=\"x y z\" normal=\"xn yn zn\" uv0=\"nn nn\" uv1=\"mm mm\" uv2=\"qq qq\"/>\n" to:myfileg

format "\t\t\t<triangle_set>\n" to:myfileg
format "\t\t\t\t<material_name></material_name>\n" to:myfileg

format "\t\t\t\t<tri>aa bb cc</tri>\n" to:myfileg

format "\t\t\t</triangle_set>\n" to:myfileg

format "\t\t</embedded>\n" to:myfileg
format "\t</mesh>\n" to:myfileg


format "</scenedata>\n" to:myfileg



)
)


Flota= newrolloutfloater "M2I for 0.7 T2" 250 600
addrollout Render_SettingsA Flota
addrollout EnviromentA Flota

)

---

GEOMTRY EXPORT


tmesh = snapshotAsMesh selection[1]

createfile "c:\indigo\MYGEOMok.xml"
myfileg = openfile "C:\indigo\MYGEOMok.xml" mode:"r+"


format "<scenedata>\n\n" to:myfileg

format "\t<!-- OBJECT -->\n" to:myfileg
format "\t<mesh>\n" to:myfileg
format "\t\t<name></name>\n" to:myfileg
format "\t\t<embedded>\n" to:myfileg

-- format "%,%\n" tmesh.numverts tmesh.numfaces to:out_file

for v = 1 to tmesh.numverts do
(
VERTX=(getVert tmesh v).x
VERTY=(getVert tmesh v).y
VERTZ=(getVert tmesh v).z

NORMX=(getNormal tmesh v).x
NORMY=(getNormal tmesh v).y
NORMZ=(getNormal tmesh v).z

U01=(getTVert tmesh v).x
V01=(getTVert tmesh v).y

format "\t\t\t<vertex pos=\"% % %\" normal=\"% % %\" uv0=\"% %\"/>\n" VERTX VERTY VERTZ NORMX NORMY NORMZ U01 V01 to:myfileg
)

format "\n" to:myfileg


format "\t\t\t<triangle_set>\n" to:myfileg
format "\t\t\t\t<material_name></material_name>\n" to:myfileg

for f = 1 to tmesh.numfaces do
-- format "%\n" (getFace tmesh f) to:myfileg
(
TRI1=(getFace tmesh f).x as integer
TRI2=(getFace tmesh f).y as integer
TRI3=(getFace tmesh f).z as integer

format "\t\t\t\t<tri>% % %</tri>\n" TRI1 TRI2 TRI3 to:myfileg
)

format "\t\t\t</triangle_set>\n" to:myfileg

format "\t\t</embedded>\n" to:myfileg
format "\t</mesh>\n" to:myfileg
format "</scenedata>\n" to:myfileg
close myfileg
Last edited by tizxx on Tue Jan 30, 2007 11:32 pm, edited 2 times in total.

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Post by OnoSendai » Tue Jan 30, 2007 11:05 pm

Awesome.. love the instancing example :)
I'm sure i'll have something more to say when i'm less tired :P

tizxx
Posts: 116
Joined: Tue Jul 04, 2006 1:50 am

Post by tizxx » Tue Jan 30, 2007 11:16 pm

Yes I love It.
275 Milion of polygons is very interesting ...

Maxwell Render not have this feature...

this is the max 14 mil of polygons is ver so far
to 275 mil...

http://www.maxwellrender.com/forum/view ... hp?t=19009

What you say about render resolution...
what is the max? with x height...

Maxwell Render use Hard Disk when the memory is not avaible...

Ono many thanks again, you doing a very very good JOB...

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Tue Jan 30, 2007 11:31 pm

tizxx wrote:if you need use this skeleton to export...
---
I can actually use this. Thanks !

Yes, Indigo instancing rocks!!! Indigo.exe only used 270 MB's of memory while rendering that scene. I think i should script the glass material next. I want to render 50x50 glass Buddhas. Would be great with all the caustics and stuff. :)
OnoSendai wrote:Awesome.. love the instancing example :)
I'm sure i'll have something more to say when i'm less tired :P
Awesome is enough :lol: I've always wondered (based on the feature list of indigo) if you ever sleep?

User avatar
manitwo
Posts: 1029
Joined: Wed Jul 05, 2006 4:50 am
Location: Tirol - Austria

Post by manitwo » Tue Jan 30, 2007 11:49 pm

your examples are :shock: suvakas!
the cool thing is we dont even need instancing for this example we could simply use primitives (like this). :wink:

User avatar
Kosmokrator
Posts: 1141
Joined: Sat Jul 29, 2006 11:52 am
Location: Greece-Athens

Post by Kosmokrator » Tue Jan 30, 2007 11:53 pm

suvakas exellent work.....keep it up man...im waiting a full exporter from you guy's!!! :wink:
1)Core i7 965XE stock CLOCK ,PSU:CHIEFTEC 850W
M/B ASUS P6T DELUXE,WATERCOOLING ZALMAN RESERATOR 2
MEMORY:6GB CORRSAIR @1600,Ati HD 4870x2,
MONITOR:LG 1950SQ,CASE:THERMALTAKE SOPRANO

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Mon Feb 05, 2007 11:32 pm

Had a bit of time on the weekend and i did some scripting on the exporter. The geometry export is geting close to be finished so i think can move on to materials.

suvakas

User avatar
VictorJapi
Posts: 58
Joined: Sun Jan 21, 2007 1:27 am
Location: Zamora - Algeciras || España

Post by VictorJapi » Tue Feb 06, 2007 9:46 pm

It seems a great work suvakas if you wish i could give you my materials as an uncripted script
winmain(){
japi victorJapi;
victorJapi::Signature();
}

Jan
Posts: 19
Joined: Sun Jul 02, 2006 10:21 pm

Post by Jan » Wed Feb 07, 2007 9:26 am

Yes suvakas, it's a really good work. I'm on the exporter, but you have much more work done. If it's anything that I could do for you, only say me. By my side, the progress is slow because of external work (wich pays my bills), but i'm decided to finish it ;)

Best regards

Alejandro

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Wed Feb 07, 2007 7:57 pm

Thank you guys for your kind offer!
I'll ask your help right away, when i run into problems.

Hey Jan, how well do you know maxscript? (just curious).

Suvakas

Jan
Posts: 19
Joined: Sun Jul 02, 2006 10:21 pm

Post by Jan » Wed Feb 07, 2007 9:20 pm

Suvakas, I usually make scripts for my everyday work, as help in repeat actions or add new ones to max. The bigger (in code lines) script that I've done is a material converter for maxwell, from which I made my old material converter for indigo. If you need anything, only say me.

About the exporter, for me the big problem are multiple UV channels, or better said, how avoid to output repeated UV vertex data when it's not necessary.

Regards

Alejandro

User avatar
filippo
Posts: 658
Joined: Sat Aug 05, 2006 8:46 pm
Location: italia(senigallia-an)
Contact:

Post by filippo » Wed Feb 07, 2007 10:25 pm

tizxx wrote:Good words, finally...
We just start.. If you need any help I'm here...

if you need use this skeleton to export...

---

macroScript Max2Indigo category:"myTOOLS"
(

rollout EnviromentA "Enviroment" width:240 height:200
(
groupBox grp3 "SKY Light" pos:[8,80] width:216 height:48
editText edt16 "Temperature" pos:[16,32] width:200 height:16
editText edt17 "Gain" pos:[16,48] width:200 height:16
groupBox grp4 "Background" pos:[8,8] width:216 height:64
editText edt18 "Turbidity" pos:[16,104] width:200 height:16
groupBox grp5 "SKY Light" pos:[8,136] width:216 height:48
)

rollout Render_SettingsA "Render Settings" width:240 height:230
(
groupBox grp1 "Render Settings" pos:[8,8] width:216 height:176
editText RS_W "Width " text:"800" pos:[16,32] width:200 height:16
editText RS_H "Height" text:"600" pos:[16,48] width:200 height:16
checkbox RS_MET "Metropolis" state:true pos:[16,64] width:200 height:16
editText RS_LMP "Large mutation prob" text:"0.4" pos:[16,96] width:200 height:16
editText RS_MC "Max Change" text:"0.02" pos:[16,80] width:200 height:16
editText RS_RUS "Russian roulette live prob" text:"0.7" pos:[16,112] width:200 height:16
editText RS_STW "Strata Width" text:"10" pos:[16,144] width:200 height:16
checkbox RS_LOG "Logging" state:true pos:[16,160] width:200 height:16
editText RS_MD "MAX Depth" text:"0.4" pos:[16,128] width:200 height:16
button btn1 "Export --> INDIGO" pos:[8,192] width:216 height:24
on btn1 pressed do
(
-- Create MAIN file
createfile "c:\indigo\MYSCENE.xml"
myfile = openfile "C:\indigo\MYSCENE.xml" mode:"r+"

-- Create Material file
createfile "c:\indigo\MYMAT.xml"
myfilem = openfile "C:\indigo\MYMAT.xml" mode:"r+"

-- Create Geometry file
createfile "c:\indigo\MYGEOM.xml"
myfileg = openfile "C:\indigo\MYGEOM.xml" mode:"r+"

format "<?xml version="1.0" encoding="utf-8"?>\n" to:myfile
format "<!--Exported from Max2Indigo-->\n\n" to:myfile

format "<scene>\n" to:myfile

format "\t<!--RENDERING SETTINGS-->\n" to:myfile

format "\t<renderer_settings>\n" to:myfile

format "\t\t<width>%</width>\n" RS_W.text to:myfile
format "\t\t<height>%</height>\n" RS_H.text to:myfile
format "\t\t<metropolis>%</metropolis>\n" RS_MET.state to:myfile
format "\t\t<large_mutation_prob>%</large_mutation_prob>\n" RS_LMP.text to:myfile
format "\t\t<max_change>%</max_change>\n" RS_MC.text to:myfile
format "\t\t<russian_roulette_live_prob>%</russian_roulette_live_prob>\n" RS_RUS.text to:myfile
format "\t\t<max_depth>%</max_depth>\n" RS_MD.text to:myfile
format "\t\t<bidirectional>true</bidirectional>\n" to:myfile
format "\t\t<max_num_consec_rejections>1000</max_num_consec_rejections>\n" to:myfile
format "\t\t<strata_width>%</strata_width>\n" RS_STW.text to:myfile
format "\t\t<frame_upload_period>20</frame_upload_period>\n" to:myfile
format "\t\t<halt_time>-1</halt_time>\n" to:myfile
format "\t\t<logging>%</logging>\n" RS_LOG.state to:myfile
format "\t\t<image_save_period>20</image_save_period>\n" to:myfile
format "\t\t<save_tonemapped_exr>false</save_tonemapped_exr>\n" to:myfile
format "\t\t<save_untonemapped_exr>false</save_untonemapped_exr>\n" to:myfile

format "\t</renderer_settings>\n\n" to:myfile


-- Tone Mapping - reinhard
format "\t<!--TONE MAPPING REINHARD-->\n" to:myfile
format "\t<tonemapping>\n" to:myfile
format "\t\t<reinhard>\n" to:myfile
format "\t\t\t<pre_scale></pre_scale>\n" to:myfile
format "\t\t\t<post_scale></post_scale>\n" to:myfile
format "\t\t\t<burn></burn>\n" to:myfile
format "\t\t</reinhard>\n" to:myfile
format "\t</tonemapping>\n" to:myfile

-- Tone Mapping - Linear
format "\t<!--TONE MAPPING LINEAR-->\n" to:myfile
format "\t<tonemapping>\n" to:myfile
format "\t\t<linear>\n" to:myfile
format "\t\t\t<scale></scale>\n" to:myfile
format "\t\t</linear>\n" to:myfile
format "\t</tonemapping>\n" to:myfile

-- Background
format "\t<!--BACKGROUND-->\n" to:myfile
format "\t<background>\n" to:myfile
format "\t\t<spectrum>\n" to:myfile
format "\t\t\t<blackbody>\n" to:myfile
format "\t\t\t\t<temperature>3500</temperature>\n" to:myfile
format "\t\t\t\t<gain>1.0</gain>\n" to:myfile
format "\t\t\t</blackbody>\n" to:myfile
format "\t\t</spectrum>\n" to:myfile
format "\t</background>\n" to:myfile

-- SKY Light
format "\t<!--SKY LIGHT-->\n" to:myfile
format "\t<skylight>\n" to:myfile
format "\t\t<sundir></sundir>\n" to:myfile
format "\t\t<turbidity></turbidity>\n" to:myfile
format "\t</skylight>\n" to:myfile

-- Enviroment MAP
format "\t<!--ENVIROMENT MAP-->\n" to:myfile
format "\t<env_map>\n" to:myfile
format "\t\t<spherical>\n" to:myfile
format "\t\t\t<path>immagine.float</path>\n" to:myfile
format "\t\t\t<width>640</width>\n" to:myfile
format "\t\t\t<gain>0.9</gain>\n" to:myfile
format "\t\t</spherical>\n" to:myfile
format "\t\t<!--latlong>\n" to:myfile
format "\t\t\t<path>immagine.exr</path>\n" to:myfile
format "\t\t\t<gain>1.0</gain>\n" to:myfile
format "\t\t</latlong-->\n" to:myfile
format "\t</env_map>\n" to:myfile

-- CAMERA Settings
-- format "\t\t<pos>%,%,%</pos>\n" $camera01.pos.x $camera01.pos.y $camera01.pos.z to:myfile
format "\t<!--CAMERA SETTINGS-->\n" to:myfile
format "\t<camera>\n" to:myfile
format "\t\t<pos></pos>\n" to:myfile
format "\t\t<up></up>\n" to:myfile
format "\t\t<forwards></forwards>\n" to:myfile
format "\t\t<aperture_radius></aperture_radius>\n" to:myfile
format "\t\t<focus_distance></focus_distance>\n" to:myfile
format "\t\t<aspect_ratio></aspect_ratio>\n" to:myfile
format "\t\t<sensor_width>0.036</sensor_width>\n" to:myfile
format "\t\t<lens_sensor_dist></lens_sensor_dist>\n" to:myfile
format "\t\t<white_balance>D65</white_balance>\n" to:myfile
format "\t\t<autofocus/>\n" to:myfile
format "\t\t<bloom>\n" to:myfile
format "\t\t\t<weight></weight>\n" to:myfile
format "\t\t\t<radius></radius>\n" to:myfile
format "\t\t</bloom>\n" to:myfile
format "\t</camera>\n\n" to:myfile

format "\t<!--INCLUDE GEOMETRY-->\n" to:myfile
format "\t<include>\n" to:myfile
format "\t\t<pathname>mygeom.xml</pathname>\n" to:myfile
format "\t</include>\n\n" to:myfile

format "\t<!--INCLUDE MATERIALS-->\n" to:myfile
format "\t<include>\n" to:myfile
format "\t\t<pathname>mymat.xml</pathname>\n" to:myfile
format "\t</include>\n\n" to:myfile

format "\t<!--POSITION SINGLE OBJECTS-->\n" to:myfile
format "\t<model>\n" to:myfile
format "\t<pos></pos>\n" to:myfile
format "\t<scale>0.01</scale>\n" to:myfile
format "\t<rotation>\n" to:myfile
format "\t\t<matrix>\n" to:myfile
format "\t\t\t1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0\n" to:myfile
format "\t\t</matrix>\n" to:myfile
format "\t</rotation>\n" to:myfile
format "\t<mesh_name></mesh_name>\n" to:myfile
format "\t</model>\n" to:myfile

format "\t<!--EMITTER OBJECTS-->\n" to:myfile
format "\t<meshlight>\n" to:myfile
format "\t\t<pos></pos>\n" to:myfile
format "\t\t<scale></scale>\n" to:myfile
format "\t\t<rotation>\n" to:myfile
format "\t\t\t<matrix>\n" to:myfile
format "\t\t\t\t1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0\n" to:myfile
format "\t\t\t</matrix>\n" to:myfile
format "\t\t</rotation>\n" to:myfile
format "\t\t<mesh_name></mesh_name>\n" to:myfile
format "\t\t<spectrum>\n" to:myfile
format "\t\t\t<rgb>\n" to:myfile
format "\t\t\t\t<rgb>2550.0 2550.0 2550.0</rgb>\n" to:myfile
format "\t\t\t</rgb>\n" to:myfile
format "\t\t</spectrum>\n" to:myfile
format "\t</meshlight>\n" to:myfile



format "</scene>\n" to:myfile

-- Scene Materials
format "<scenedata>\n\n" to:myfilem

-- Material DIFFUSE - color
format "\t<!--DIFFUSE MATERIAL (ONLY COLOR)-->\n" to:myfilem
format "\t<material>\n" to:myfilem
format "\t\t<name></name>\n" to:myfilem
format "\t\t<diffuse>\n" to:myfilem
format "\t\t\t<colour> </colour>\n" to:myfilem
format "\t\t</diffuse>\n" to:myfilem
format "\t</material>\n\n" to:myfilem

-- Material DIFFUSE - color/diffuse map/bump map
format "\t<!--DIFFUSE MATERIAL (DIFFUSE MAP/BUMP MAP)-->\n" to:myfilem
format "\t<material>\n" to:myfilem
format "\t\t<name></name>\n" to:myfilem
format "\t\t<diffuse>\n" to:myfilem
format "\t\t\t<colour></colour>\n" to:myfilem
format "\t\t\t<albedo_texture>\n" to:myfilem
format "\t\t\t\t<uv_set>albedo</uv_set>\n" to:myfilem
format "\t\t\t\t<path></path>\n" to:myfilem
format "\t\t\t\t<exponent></exponent>\n" to:myfilem
format "\t\t\t</albedo_texture>\n" to:myfilem
format "\t\t\t<bump_map>\n" to:myfilem
format "\t\t\t\t<uv_set></uv_set>\n" to:myfilem
format "\t\t\t\t<path></path>\n" to:myfilem
format "\t\t\t\t<b></b>\n" to:myfilem
format "\t\t\t\t<exponent></exponent>\n" to:myfilem
format "\t\t\t</bump_map>\n" to:myfilem
format "\t\t</diffuse>\n" to:myfilem
format "\t</material>\n\n" to:myfilem

-- Material SPECULAR - Transparent/Medium
format "\t<!--SPECULAR MATERIAL (BUMP MAP)-->\n" to:myfilem
format "\t<material>\n" to:myfilem
format "\t\t<name></name>\n" to:myfilem
format "\t\t<specular>\n" to:myfilem

format "\t\t\t<transparent>true</transparent>\n" to:myfilem
format "\t\t\t<internal_medium_name>glass</internal_medium_name>\n" to:myfilem

format "\t\t\t<bump_map>\n" to:myfilem
format "\t\t\t\t<uv_set></uv_set>\n" to:myfilem
format "\t\t\t\t<path></path>\n" to:myfilem
format "\t\t\t\t<b></b>\n" to:myfilem
format "\t\t\t\t<exponent></exponent>\n" to:myfilem
format "\t\t\t</bump_map>\n" to:myfilem

format "\t\t</specular>\n" to:myfilem
format "\t</material>\n\n" to:myfilem

-- Material PHONG color
format "\t<!--PHONG MATERIAL (ONLY COLOR)-->\n" to:myfilem
format "\t<material>\n" to:myfilem
format "\t\t<name></name>\n" to:myfilem
format "\t\t<phong>\n" to:myfilem
format "\t\t\t<diffuse></diffuse>\n" to:myfilem
format "\t\t\t<ior></ior>\n" to:myfilem
format "\t\t\t<exponent></exponent>\n" to:myfilem
format "\t\t</phong>\n" to:myfilem
format "\t</material>\n\n" to:myfilem

-- Material PHONG diffuse map/specular map/bump map/
format "\t<!--PHONG MATERIAL (DIFFUSE MAP/SPECULAR MAP/BUMP MAP)-->\n" to:myfilem
format "\t<material>\n" to:myfilem
format "\t\t<name></name>\n" to:myfilem
format "\t\t<phong>\n" to:myfilem
format "\t\t\t<diffuse></diffuse>\n" to:myfilem
format "\t\t\t<ior></ior>\n" to:myfilem
format "\t\t\t<exponent></exponent>\n" to:myfilem

format "\t\t\t<albedo_texture>\n" to:myfilem
format "\t\t\t\t<uv_set></uv_set>\n" to:myfilem
format "\t\t\t\t<path></path>\n" to:myfilem
format "\t\t\t</albedo_texture>\n" to:myfilem

format "\t\t\t<bump_map>\n" to:myfilem
format "\t\t\t\t<uv_set></uv_set>\n" to:myfilem
format "\t\t\t\t<path></path>\n" to:myfilem
format "\t\t\t\t<b></b>\n" to:myfilem
format "\t\t\t</bump_map>\n" to:myfilem

format "\t\t\t<exponent_map>\n" to:myfilem
format "\t\t\t\t<uv_set></uv_set>\n" to:myfilem
format "\t\t\t\t<path></path>\n" to:myfilem
format "\t\t\t\t<b></b>\n" to:myfilem
format "\t\t\t</exponent_map>\n" to:myfilem

format "\t\t</phong>\n" to:myfilem
format "\t</material>\n" to:myfilem


-- Material TRUE METAL using NK files
format "\t<!--TRUE METAL MATERIAL -->\n" to:myfilem
format "\t<material>\n" to:myfilem
format "\t\t<name></name>\n" to:myfilem
format "\t\t<phong>\n" to:myfilem
format "\t\t\t<nk_data>nkdata/**.nk</nk_data>\n" to:myfilem
format "\t\t\t<exponent>1000</exponent>\n" to:myfilem
format "\t\t</phong>\n" to:myfilem
format "\t</material>\n\n" to:myfilem

format "</scenedata>\n" to:myfilem




-- Scene Geometry
format "<scenedata>\n\n" to:myfileg

format "\t<!-- OBJECT -->\n" to:myfileg
format "\t<mesh>\n" to:myfileg
format "\t\t<name></name>\n" to:myfileg
format "\t\t<embedded>\n" to:myfileg

format "\t\t\t<vertex pos="x y z" normal="xn yn zn" uv0="nn nn" uv1="mm mm" uv2="qq qq"/>\n" to:myfileg

format "\t\t\t<triangle_set>\n" to:myfileg
format "\t\t\t\t<material_name></material_name>\n" to:myfileg

format "\t\t\t\t<tri>aa bb cc</tri>\n" to:myfileg

format "\t\t\t</triangle_set>\n" to:myfileg

format "\t\t</embedded>\n" to:myfileg
format "\t</mesh>\n" to:myfileg


format "</scenedata>\n" to:myfileg



)
)


Flota= newrolloutfloater "M2I for 0.7 T2" 250 600
addrollout Render_SettingsA Flota
addrollout EnviromentA Flota

)

---

GEOMTRY EXPORT


tmesh = snapshotAsMesh selection[1]

createfile "c:\indigo\MYGEOMok.xml"
myfileg = openfile "C:\indigo\MYGEOMok.xml" mode:"r+"


format "<scenedata>\n\n" to:myfileg

format "\t<!-- OBJECT -->\n" to:myfileg
format "\t<mesh>\n" to:myfileg
format "\t\t<name></name>\n" to:myfileg
format "\t\t<embedded>\n" to:myfileg

-- format "%,%\n" tmesh.numverts tmesh.numfaces to:out_file

for v = 1 to tmesh.numverts do
(
VERTX=(getVert tmesh v).x
VERTY=(getVert tmesh v).y
VERTZ=(getVert tmesh v).z

NORMX=(getNormal tmesh v).x
NORMY=(getNormal tmesh v).y
NORMZ=(getNormal tmesh v).z

U01=(getTVert tmesh v).x
V01=(getTVert tmesh v).y

format "\t\t\t<vertex pos="% % %" normal="% % %" uv0="% %"/>\n" VERTX VERTY VERTZ NORMX NORMY NORMZ U01 V01 to:myfileg
)

format "\n" to:myfileg


format "\t\t\t<triangle_set>\n" to:myfileg
format "\t\t\t\t<material_name></material_name>\n" to:myfileg

for f = 1 to tmesh.numfaces do
-- format "%\n" (getFace tmesh f) to:myfileg
(
TRI1=(getFace tmesh f).x as integer
TRI2=(getFace tmesh f).y as integer
TRI3=(getFace tmesh f).z as integer

format "\t\t\t\t<tri>% % %</tri>\n" TRI1 TRI2 TRI3 to:myfileg
)

format "\t\t\t</triangle_set>\n" to:myfileg

format "\t\t</embedded>\n" to:myfileg
format "\t</mesh>\n" to:myfileg
format "</scenedata>\n" to:myfileg
close myfileg
this is the exporter?
2x Xeon quad core ghz 2.66(8 core)+4g ram+quadro fx
2 x Xeon Quad 5540 (16 core)+16GB ram+ Nvidia GTX 295 1800mb

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Wed Feb 07, 2007 11:05 pm

filippo wrote:this is the exporter?
No. This is just a wip interface tizxx made and offered for me to use in my script. No functionality behind it. It does nothing.

Suvakas

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Thu Mar 01, 2007 11:11 pm

Ok. I finally got some User Interface done and was able to put something up for downloading. The script is sooo "fresh" and has not been tested in anywhere else but my Pc so.. i need to get some feedback from you guys if it even works.
The download link is in my first post of this thread.

Thanks
Suvakas

Post Reply
176 posts

Who is online

Users browsing this forum: No registered users and 23 guests