ITS TIME FOR NEW....

Announcements, requests and support regarding the 3DS MAX exporter
kl_mar
Posts: 21
Joined: Wed Jul 26, 2006 9:59 am

Post by kl_mar » Mon May 14, 2007 11:20 am

How about mat preview in mateditor of 3ds max?

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

Post by suvakas » Mon May 14, 2007 6:44 pm

It's in my plans.
The actual material slot can not be replaced with bitmap (At least I asked some maxscript gurus and they didn't know how to do it via script.)
So i would have to use a small preview image on the material interface itself.

vansan
Posts: 67
Joined: Fri May 04, 2007 2:35 am

Post by vansan » Tue May 15, 2007 12:29 am

Here you are, Suvakas. :wink:
There is no saving of material properties here, only working interface.
Hope this helps you in development.

Code: Select all

plugin material Indigo_Material

name:"Indigo Material"

classID:#(1787142791, -1209055881)

extends:Standard replaceUI:true version:1

(

parameters main rollout:params
(
)

rollout importIGM_mat_properties "Import .IGM Material Properties" -- rolledUp:true
(
label importIGM_mi "ImportIGM Material Interface"	fieldwidth:45 offset:[-90,0]
)

rollout diffuse_mat_properties "Diffuse Material Properties" -- rolledUp:true
(
label diffuse_mi "Diffuse Material Interface"	fieldwidth:45 offset:[-90,0]
)

rollout phong_mat_properties "Phong Material Properties" -- rolledUp:true
(
label Phong_mi "Phong Material Interface"	fieldwidth:45 offset:[-90,0] 
)

rollout blend_mat_properties "Blend Material Properties" -- rolledUp:true
(
label Blend_mi "Blend Material Interface"	fieldwidth:45 offset:[-90,0]
)

rollout params "Material Class"
( 
checkbutton importIGM_b "ImportIGM" checked:false tooltip:"Opens ImportIGM Material Properties Rollout Floater" align:#left width:60 height:25 offset:[-5,0]
checkbutton diffuse_b "Diffuse" checked:false tooltip:"Opens Diffuse Material Properties Rollout Floater" align:#left width:48 height:25 offset:[60,-30]
checkbutton phong_b "Phong" checked:false tooltip:"Opens Phong Material Properties Rollout Floater" align:#left width:48 height:25 offset:[112,-30]
checkbutton blend_b "Blend" checked:false tooltip:"Opens Blend Material Properties Rollout Floater" align:#left width:48 height:25 offset:[164,-30]


on importIGM_b changed IGM_State do 
if IGM_State == true then 
(
RemoveRollout importIGM_mat_properties
RemoveRollout diffuse_mat_properties
RemoveRollout phong_mat_properties
RemoveRollout blend_mat_properties
AddRollout importIGM_mat_properties
diffuse_b.checked = false
phong_b.checked = false
blend_b.checked = false
)
else (RemoveRollout importIGM_mat_properties)


on diffuse_b changed diffuse_State do 
if diffuse_State == true then 
(
RemoveRollout importIGM_mat_properties
RemoveRollout diffuse_mat_properties
RemoveRollout phong_mat_properties
RemoveRollout blend_mat_properties
AddRollout diffuse_mat_properties
importIGM_b.checked = false
phong_b.checked = false
blend_b.checked = false
)
else (RemoveRollout diffuse_mat_properties)


on phong_b changed phong_State do 
if phong_State == true then 
(
RemoveRollout importIGM_mat_properties
RemoveRollout diffuse_mat_properties
RemoveRollout phong_mat_properties
RemoveRollout blend_mat_properties
AddRollout phong_mat_properties
importIGM_b.checked = false
diffuse_b.checked = false
blend_b.checked = false
)
else (RemoveRollout phong_mat_properties)


on blend_b changed blend_State do 
if blend_State == true then 
(
RemoveRollout importIGM_mat_properties
RemoveRollout diffuse_mat_properties
RemoveRollout phong_mat_properties
RemoveRollout blend_mat_properties
AddRollout blend_mat_properties
importIGM_b.checked = false
diffuse_b.checked = false
phong_b.checked = false

)
else (RemoveRollout blend_mat_properties)




)

on create do

(
-- setup initial material
)

)
[/code]

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

Post by suvakas » Tue May 15, 2007 12:47 am

Hey, thanks !!!!!
I'll check it out right after work today.

[edit]
Eh.. i went through the code and it seems, that the only ones i missed when i tryed to do it were: RemoveRollout and AddRollout commands
I guess i missed those in help file :lol:
Thank you ! This will sure be helpful. I'm not going to convert everything into one material in next release, but I will start working on it.

[edit2]
There is one more thing i can't figure out. How can you start without any (or some) rollouts and add them later according to what button gets pressed? (similar to selecting different shader types under standard material). I can't find the correct event to remove all the rollouts that are not initially needed.

vansan
Posts: 67
Joined: Fri May 04, 2007 2:35 am

Post by vansan » Tue May 15, 2007 5:42 am

here you are! :)

Code: Select all

...
rollout params "Material Class"
( 
checkbutton importIGM_b "ImportIGM" checked:false tooltip:"Opens ImportIGM Material Properties Rollout Floater" align:#left width:60 height:25 offset:[-5,0]
checkbutton diffuse_b "Diffuse" checked:false tooltip:"Opens Diffuse Material Properties Rollout Floater" align:#left width:48 height:25 offset:[60,-30]
checkbutton phong_b "Phong" checked:false tooltip:"Opens Phong Material Properties Rollout Floater" align:#left width:48 height:25 offset:[112,-30]
checkbutton blend_b "Blend" checked:false tooltip:"Opens Blend Material Properties Rollout Floater" align:#left width:48 height:25 offset:[164,-30]


-----------------this action closes all unneeded rollouts-----------------
on params open do 
(
RemoveRollout importIGM_mat_properties
RemoveRollout diffuse_mat_properties
RemoveRollout phong_mat_properties
RemoveRollout blend_mat_properties
)
-----------------end of this action------------------


on importIGM_b changed IGM_State do 
...

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

Post by suvakas » Tue May 15, 2007 6:00 am

Thank you !!!
I'm 99.9% sure, that i tried "on rollout open" event. Maybe i had a syntax error or something :lol:
Thanks again!

I wonder how much of the code i have to re-write in order to convert most of the stuff to one material. We'll see. I'm sure it will be better and more organized than having a lot of small different materials.

@vansan
How well do you know maxscript? You seem to be quite good at it...
The whole Maxigo thing is a very very very first thing i've ever done with maxscript... 8) That's also one of the reasons the script is still encrypted. It just looks like a big mess.

vansan
Posts: 67
Joined: Fri May 04, 2007 2:35 am

Post by vansan » Tue May 15, 2007 6:16 am

Just like you, I'm newbee to maxscript. Had to read alot of scripts from scriptspot.com and BlurScripts Pack to get how things really work.
So, I just do most of my scripts with manual, copy-pasting and macrorecorder set On :lol:
The most complex of my scripts is a material converter. It's here:
http://scriptspot.com/3ds-max/maxwell-m ... -converter

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

Post by suvakas » Tue May 15, 2007 6:28 am

Is that so?
You really sounded like a pro.:lol:
I mostly use the help file and it can be quite confusing sometimes.
I've also got some help from master Bobo and from some other guys in internet forums.

Nice converter. Maybe you can do one for Maxigo? (you know..if you need to kill some time or something... :wink:)

vansan
Posts: 67
Joined: Fri May 04, 2007 2:35 am

Post by vansan » Tue May 15, 2007 6:40 am

The converter thing was written just for fun, as you did with Maxigo.
And I will update it with Maxigo material modules, once you'll finish it up with your Maxigo connector (after Indigo 1.0 release, I guess...).

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

Post by suvakas » Tue May 15, 2007 6:45 am

Ok. Sounds good.

vansan
Posts: 67
Joined: Fri May 04, 2007 2:35 am

Post by vansan » Tue May 15, 2007 7:56 am

By the way, I've got an idea - what about adding two buttons to the material interface:
"Save Material State"
"Load Material State"
They can be in the lower right corner of the rollout, where you choose the material type.
Saving material states is very handy when you make several previews and need 2 go back to preffered material settings.

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Tue May 15, 2007 8:08 am

-> igm?
or do you mean st. different?

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

Post by suvakas » Tue May 15, 2007 8:21 am

hmm.. interesting idea.. I've never missed such feature though.
You can always make a copy of the good material.

vansan
Posts: 67
Joined: Fri May 04, 2007 2:35 am

Post by vansan » Tue May 15, 2007 8:25 am

No, just 3dsmax's material properties saved to disk. (IGM, supporting that feature will be even better, though 8))
As there will be only all-in-one material - it's good to have an option to quickly switch between different colors and textures.

The reason 2 do so is that I can loose my previous material, assigning new one instead of previous, if I forgot 2 make a copy of it :?.

And one more thing - I'm really angry, working on a scene having many variations of the same material in a scene, sometimes I apply different ones to different objects and in the end I have 10 asphault materials, 15 grass materials, 5 glasses and so on. :x Hard to change something on a complex scene.

So, it's a really handy feature that nobody ask for, not really a must-have, but I will be happy 2 get :)

Post Reply
29 posts

Who is online

Users browsing this forum: No registered users and 5 guests