Integrating 3D models with photography
Interested in integrating your 3D work with the real world? This might help
# 76 12-06-2006 , 12:50 PM
Registered User
Join Date: Aug 2005
Posts: 80
Matt, the code works now. Great job, even tho we miss a little thing to be corrected.

Here's my render, not sure why it renders like that with skylight.

Rendered in maya...
user added image

Rendered in indigo with skylight...
user added image

# 77 12-06-2006 , 12:51 PM
MattTheMan's Avatar
Registered User
Join Date: Apr 2005
Location: Fairfield, CT
Posts: 2,436
you need to triangulate the model first user added image


Live the life you love, love the life you live
# 78 14-06-2006 , 03:02 AM
Registered User
Join Date: Aug 2005
Posts: 80
Ok, exporting and rendering took forever. Once I finally exported with triangulated and onto Indigo. I got an error msg saying...

"runtime error...

indigo.exe

this application has requested the runtime to terminate it in an unusual way. Please contact the application's suport team for more information."

Btw, Indigo stated 46k tris.

Meaning the program had crashed?? user added image

# 79 14-06-2006 , 12:18 PM
MattTheMan's Avatar
Registered User
Join Date: Apr 2005
Location: Fairfield, CT
Posts: 2,436
meaning that you probably didnt have any lights in the scene. Ive rendererd 2 million polys in Indigo before.

-Matt


Live the life you love, love the life you live
# 80 14-06-2006 , 02:17 PM
Registered User
Join Date: Aug 2005
Posts: 80
I had one point light with intensity of 1.

# 81 14-06-2006 , 03:15 PM
MattTheMan's Avatar
Registered User
Join Date: Apr 2005
Location: Fairfield, CT
Posts: 2,436
no! pointlights don't do anything in my script, except for the sun's position- which only is taken accord if you say to use physical sky. To use a light you have to have an actual polygon object with a material that has a non-zero (not black) incandesce value user added image

-Matt


Live the life you love, love the life you live
# 82 16-06-2006 , 09:14 PM
arneoog's Avatar
Registered User
Join Date: Mar 2006
Posts: 189
Hey, Matt, I was just wondering if you had started on the GUI yet?
If not, I have some simple stuff I've made...
(mostly to learn some more MEL though)

# 83 16-06-2006 , 10:18 PM
MattTheMan's Avatar
Registered User
Join Date: Apr 2005
Location: Fairfield, CT
Posts: 2,436
no... I haven't what with the move in 3 days and everything. sorry... but I definatly will get a go on it when I get back!!! user added image

also- if you could tell me when you start trying to make the materials- that would help a bunch, since we could split the load- you could do Indigo Diffuse and Indigo Specular, for instance, and I could do Indigo Phong and Indigo Metal.

But I have been brainstorming- how about what U3dreal, the writer of the 3ds Max plugin, did? With the preview in the material tab? Sounds easy enough... now that Indigo can output to a specific location.

Yeah... so I'll be doing that. Feel free to start on the GUI (please add to the window that I created for the buttons, please please please).

but I will pick up on it when the move is over.

-Matt


Live the life you love, love the life you live
# 84 16-06-2006 , 10:27 PM
arneoog's Avatar
Registered User
Join Date: Mar 2006
Posts: 189
ah, okay user added image
It's way harder than I thought to create Materials...
But it's probably easyer when they don't need to be renderable...

I have no idea what U3dreal have done, hehe...

Sure I'm going to add your window/buttons user added image

here's what I've made so far:
It's not using the converter yet...

Code:
global proc abWin() 
{ 
window -title "About Maya -> Indigo" -h 200 -w 300 -sizeable false;
columnLayout;
text -label "About Maya -> Indigo" -w 300 -h 40 -backgroundColor 1 1 1 -font "boldLabelFont" -align "center" ;

text -label "" -w 300 -align "center";
text -label "Creators:" -w 300 -font "boldLabelFont" -align "center";
text -label "Matt B. (mostly)" -w 300 -align "center";
text -label "Arne OOG" -w 300 -align "center";
text -label "" -w 300 -align "center";

	separator -w 300;

text -label "" -w 300 -align "center";
text -label "Copyright © 2006" -w 300 -align "center";
			showWindow;
}

	window -title "Maya -> Indigo Controll Panel" -h 600 -w 400 -menuBar true -sizeable false;

	menu -label "Edit" -tearOff true;

		menuItem -label "Save Settings";
		menuItem -label "Reset Settings";
		menuItem -divider true;
		menuItem -label "Close" -command "closeWindow";
			
		menu -label "Help" -helpMenu true;
		menuItem -label "About Maya -> Indigo..." -command "abWin";

columnLayout -columnAlign "center";
text -label "Maya -> Indigo Controll Panel" -w 390 -h 40 -backgroundColor 1 1 1 -font "boldLabelFont" -align "center";

 		tabLayout;
 			shelfLayout Materials;
shelfButton -annotation "Diffuse Shader" -image1 "commandButton.xpm";
shelfButton -annotation "Phong Shader" -image2 "commandButton.xpm";
shelfButton -annotation "Specular Shader" -image3 "commandButton.xpm";
 				setParent ..;

 			shelfLayout Lights;
shelfButton -annotation "Physical Sky" -image1 "commandButton.xpm" -command "sphere -r 0.5 -n Sun;";
shelfButton -annotation "Sky Light" -image2 "commandButton.xpm";
shelfButton -annotation "Specular Shader" -image3 "commandButton.xpm";
 				setParent ..;

 			shelfLayout Misc;
 				setParent ..;
 			setParent ..;

//Settings
frameLayout -collapsable true -label "Render Setting" -w 390;

 			columnLayout -columnAlign "center";
			
				checkBox -label "Metropolis" -align "center";
				checkBox -label "Pathtracing" -align "center";
				checkBox -label "Bidirectional" -align "center";
	separator -w 390 -h 12;

optionMenu -label "Logging";
		menuItem -label "True";
		menuItem -label "False";

 			                setParent ..;
 			setParent ..;

frameLayout -collapsable true -label "Environment" -w 390;

 			columnLayout -columnAlign "center";

				checkBox -label "Physical Sky" -align "center";
				checkBox -label "Sky Light" -align "center";
	separator -w 390 -h 12;
				checkBox -label "HDR map" -align "center";
		attrNavigationControlGrp -l "HDR file";

 			                setParent ..;
 			setParent ..;

button -w 390 -h 30 -label "Generate XML code" -align "center"  -command "indigoOutput";

			showWindow;

# 85 16-06-2006 , 10:38 PM
MattTheMan's Avatar
Registered User
Join Date: Apr 2005
Location: Fairfield, CT
Posts: 2,436
wow! that's a very good start! But... would you mind making the checkbox sets into radio buttons? that would help a LOT!!!! user added image and... sorry, I haven't got the time to look at the code too well, but do the checkboxes have commands? Oh well, you've done great so far user added image

-Matt


Live the life you love, love the life you live
# 86 16-06-2006 , 10:41 PM
arneoog's Avatar
Registered User
Join Date: Mar 2006
Posts: 189
Thanks!
I'll make radio buttons, no problem!
I'm going to start on the commands soon user added image

# 87 17-06-2006 , 08:45 PM
arneoog's Avatar
Registered User
Join Date: Mar 2006
Posts: 189
I did some more on it...

Code:
global proc abWin() 
{ 
window -title "About Maya -> Indigo" -h 200 -w 300 -sizeable false;
columnLayout;
text -label "About Maya -> Indigo" -w 300 -h 40 -backgroundColor 1 1 1 -font "boldLabelFont" -align "center" ;

text -label "" -w 300 -align "center";
text -label "Creators:" -w 300 -font "boldLabelFont" -align "center";
text -label "Matt B. (mostly)" -w 300 -align "center";
text -label "Arne OOG" -w 300 -align "center";
text -label "" -w 300 -align "center";

	separator -w 300;

text -label "" -w 300 -align "center";
text -label "Copyright © 2006" -w 300 -align "center";
			showWindow;
}

proc skylight() 
{ 
int $state = `checkBox -query -value SkylightCheckBox`; 

  if ($state == 0) 
    floatSliderGrp -edit -enable 0 skylightSlider; 
  else 
    floatSliderGrp -edit -enable 1 skylightSlider; 
} 

proc bglight() 
{ 
int $state = `checkBox -query -value BgCheckBox`; 

  if ($state == 0) 
    floatSliderGrp -edit -enable 0 bgSlider; 
  else 
    floatSliderGrp -edit -enable 1 bgSlider; 
} 

proc hdrlight() 
{ 
int $state = `checkBox -query -value HDRCheckBox`; 

  if ($state == 0) 
    attrNavigationControlGrp -edit -enable 0 hdrSlider; 
  else 
    attrNavigationControlGrp -edit -enable 1 hdrSlider; 
} 

//-----------------CREATE STUFF------------------

proc sun() 
{sphere -r 0.5 -n Sun;} 

proc reclight() 
{ } 

proc camera() 
{} 

	window -title "Maya -> Indigo Controll Panel" -h 600 -w 400 -menuBar true -sizeable false;

	menu -label "Edit" -tearOff true;

		menuItem -label "Save Settings";
		menuItem -label "Reset Settings";
		menuItem -divider true;
		menuItem -label "Close" -command "closeWindow";

	menu -label "Create" -tearOff true;

	menuItem -label "Materials" -subMenu true;
		menuItem -label "Diffuse Shader";
		menuItem -label "Phong Shader";
		menuItem -label "Specular Shader";
		menuItem -label "Mesh Light Shader";
		menuItem -label "Metal Shader";
 				setParent -menu ..;
	menuItem -label "Lights" -subMenu true;
		menuItem -label "Sky Light" -command "sun";
		menuItem -label "Rectangle Light" -command "reclight";
 				setParent -menu ..;
	menuItem -label "Misc" -subMenu true;
		menuItem -label "Camera" -command "camera";

	menu -label "Window" -tearOff true;

		menuItem -label "Material Editor"  -command "materialEditor";
		menuItem -label "Material Browser"  -command "materialBrowser";
			
	menu -label "Help" -helpMenu true;
		menuItem -label "About Maya -> Indigo..." -command "abWin";

columnLayout -columnAlign "center";
text -label "Maya -> Indigo Controll Panel" -w 390 -h 40 -backgroundColor 1 1 1 -font "boldLabelFont" -align "center";

 		tabLayout;
 			shelfLayout Materials;
shelfButton -annotation "Diffuse Shader" -image "commandButton.xpm" -command "diffuce";
shelfButton -annotation "Phong Shader" -image "commandButton.xpm" -command "phong";
shelfButton -annotation "Specular Shader" -image "commandButton.xpm" -command "specular";
shelfButton -annotation "Mesh Light Shader" -image "commandButton.xpm" -command "meshlight";
shelfButton -annotation "Metal Shader" -image "commandButton.xpm" -command "metal";
 				setParent ..;

 			shelfLayout Lights;
shelfButton -annotation "Sky Light" -image "commandButton.xpm" -command "sun";
shelfButton -annotation "Rectangle Light" -image "commandButton.xpm"  -command "reclight";
 				setParent ..;

 			shelfLayout Misc;
shelfButton -annotation "Camera" -image "commandButton.xpm"  -command "camera";
 				setParent ..;
 			setParent ..;
text -label "General setting" -w 390 -align "center" -font "boldLabelFont";
//Settings
frameLayout -collapsable true -label "Render Setting" -w 390;

 			columnLayout -columnAlign "center";
			
				checkBox -label "Metropolis" -align "center";
				floatSliderGrp -h 25 -label "Large Mutation Prob" -field true -fieldMinValue -10000 -fieldMaxValue 10000 -minValue 0.001 -maxValue 1 -value 0.2 -precision 3;
				floatSliderGrp -h 25 -label "Max Change" -field true -fieldMinValue -10000 -fieldMaxValue 10000 -minValue 0.001 -maxValue 0.1 -value 0.025 -precision 3;
				floatSliderGrp -h 25 -label "Russian Roulette Live Prob" -field true -fieldMinValue -10000 -fieldMaxValue 10000 -minValue 0.001 -maxValue 1 -value 0.7 -precision 3;
				floatSliderGrp -h 25 -label "Max Depth" -field true -fieldMinValue -10000 -fieldMaxValue 10000 -minValue 100 -maxValue 10000 -value 1000 -precision 3;
				checkBox -label "Pathtracing" -align "center";
				checkBox -label "Bidirectional" -align "center";
	separator -w 390 -h 12;

optionMenu -label "Logging";
		menuItem -label "True";
		menuItem -label "False";

 			                setParent ..;
 			setParent ..;

frameLayout -collapsable true -label "Camera Setting" -w 390;

 			columnLayout -columnAlign "center";
			
				floatSliderGrp -h 25 -label "Sensor Width" -field true -fieldMinValue -10000 -fieldMaxValue 10000 -minValue 0.001 -maxValue 0.1 -value 0.036 -precision 3;
				floatSliderGrp -h 25 -label "Lens Sensor Dist" -field true -fieldMinValue -10000 -fieldMaxValue 10000 -minValue 0.0000001 -maxValue 0.1 -value 0.0523314 -precision 7;
	separator -w 390 -h 12;

optionMenu -label "White Balance";
		menuItem -label "E";
		menuItem -label "D50";
		menuItem -label "D55";
		menuItem -label "D60";
		menuItem -label "D65";
		menuItem -label "D75";
		menuItem -label "A";
		menuItem -label "B";
		menuItem -label "C";
		menuItem -label "9300";
		menuItem -label "F2";
		menuItem -label "F7";
		menuItem -label "F11";

 			                setParent ..;
 			setParent ..;

frameLayout -collapsable true -label "Environment Setting" -w 390;

 			columnLayout -columnAlign "center";

				checkBox -label "Sky Light" -align "center"  -value 0 -changeCommand "skylight" SkylightCheckBox;
floatSliderGrp -h 25 -label "Turbidity" -field true -fieldMinValue -10000 -fieldMaxValue 10000 -minValue 0.1 -maxValue 5 -value 2 -precision 3 -enable 0 skylightSlider;
	separator -w 390 -h 12;
				checkBox -label "Background Light" -align "center" -changeCommand "bglight" BgCheckBox;
	colorSliderGrp -h 25 -label "Backgroung Light Color" -rgb 0.5 0.5 0.5 -enable 0 bgSlider;
	separator -w 390 -h 12;
				checkBox -label "HDR map" -align "center" -changeCommand "hdrlight" HDRCheckBox;
		attrNavigationControlGrp -l "HDR file" -enable 0 hdrSlider;

 			                setParent ..;
 			setParent ..;

button -w 390 -h 30 -label "Generate XML code" -align "center"  -command "indigoOutput";

			showWindow;

# 88 28-06-2006 , 04:56 PM
MattTheMan's Avatar
Registered User
Join Date: Apr 2005
Location: Fairfield, CT
Posts: 2,436
o wow! k00l! I guess I have to come back... now with a succesful move + internet user added image

Later,
Matt


Live the life you love, love the life you live
# 89 28-06-2006 , 05:25 PM
arneoog's Avatar
Registered User
Join Date: Mar 2006
Posts: 189
Yo, Matt!
Congrats with the move user added image

I've done some more on it, but not that much...

Code:
//-----------------MAYA TO INDIGO CONTROL PANEL------------------

//Made by Arne OOG
//-------------------------------------------------------------------------------

//-----------------ABOUT MAYA -> INDIGO------------------

global proc abWin() 
{ 
window -title "About Maya -> Indigo" -h 200 -w 300 -sizeable false;
columnLayout;
text -label "About Maya -> Indigo" -w 300 -h 40 -backgroundColor 1 1 1 -font "boldLabelFont" -align "center" ;

text -label "" -w 300 -align "center";
text -label "Creators:" -w 300 -font "boldLabelFont" -align "center";
text -label "Matt B. (mostly)" -w 300 -align "center";
text -label "Arne OOG" -w 300 -align "center";
text -label "" -w 300 -align "center";

	separator -w 300;

text -label "" -w 300 -align "center";
text -label "Copyright © 2006" -w 300 -align "center";
			showWindow;
}

//-----------------ACTIVATE FIELDS------------------

proc skylight() 
{ 
int $state = `checkBox -query -value SkylightCheckBox`; 

  if ($state == 0) 
    floatSliderGrp -edit -enable 0 skylightSlider; 
  else 
    floatSliderGrp -edit -enable 1 skylightSlider; 
} 

proc bglight() 
{ 
int $state = `checkBox -query -value BgCheckBox`; 

  if ($state == 0) 
    floatSliderGrp -edit -enable 0 bgSlider; 
  else 
    floatSliderGrp -edit -enable 1 bgSlider; 
} 

proc hdrlight() 
{ 
int $state = `checkBox -query -value HDRCheckBox`; 

  if ($state == 0) 
    attrNavigationControlGrp -edit -enable 0 hdrSlider; 
  else 
    attrNavigationControlGrp -edit -enable 1 hdrSlider; 
} 

//-----------------CREATE STUFF------------------

proc sun() 
{sphere -r 0.5 -n Sun;} 

proc reclight() 
{ } 

proc indcamera() 
{camera -centerOfInterest 5 -focalLength 35 -lensSqueezeRatio 1 -cameraScale 1 
-horizontalFilmAperture 1.41732 -horizontalFilmOffset 0 -verticalFilmAperture 0.94488 
-verticalFilmOffset 0 -filmFit Fill -overscan 1 -motionBlur 0 -shutterAngle 144 
-nearClipPlane 0.01 -farClipPlane 1000 -orthographic 0 -orthographicWidth 30; 
objectMoveCommand; cameraMakeNode 3 "";} 

//-----------------THE CONTROL PANEL------------------

	window -title "Maya -> Indigo Controll Panel" -h 600 -w 400 -menuBar true -sizeable false;

	menu -label "Edit" -tearOff true;

		menuItem -label "Save Settings";
		menuItem -label "Reset Settings";
		menuItem -divider true;
		menuItem -label "Close" -command "closeWindow";

	menu -label "Create" -tearOff true;

	menuItem -label "Materials" -subMenu true;
		menuItem -label "Diffuse Shader";
		menuItem -label "Phong Shader";
		menuItem -label "Specular Shader";
		menuItem -label "Mesh Light Shader";
		menuItem -label "Metal Shader";
 				setParent -menu ..;
	menuItem -label "Lights" -subMenu true;
		menuItem -label "Sky Light" -command "sun";
		menuItem -label "Rectangle Light" -command "reclight";
 				setParent -menu ..;
	menuItem -label "Misc" -subMenu true;
		menuItem -label "Camera" -command "indcamera";

	menu -label "Window" -tearOff true;

		menuItem -label "Material Editor"  -command "materialEditor";
		menuItem -label "Material Browser"  -command "materialBrowser";
			
	menu -label "Help" -helpMenu true;
		menuItem -label "About Maya -> Indigo..." -command "abWin";

columnLayout -columnAlign "center";
text -label "Maya -> Indigo Controll Panel" -w 390 -h 40 -backgroundColor 1 1 1 -font "boldLabelFont" -align "center";

 		tabLayout;
 			shelfLayout Materials;
shelfButton -annotation "Diffuse Shader" -image "indigo_diffuce.bmp" -command "diffuce";
shelfButton -annotation "Phong Shader" -image "indigo_phong.bmp" -command "phong";
shelfButton -annotation "Specular Shader" -image "indigo_specular.bmp" -command "specular";
shelfButton -annotation "Mesh Light Shader" -image "indigo_meshLight.bmp" -command "meshlight";
shelfButton -annotation "Metal Shader" -image "indigo_metal.bmp" -command "metal";
 				setParent ..;

 			shelfLayout Lights;
shelfButton -annotation "Sky Light" -image "indigo_sun.bmp" -command "sun";
shelfButton -annotation "Rectangle Light" -image "commandButton.xpm"  -command "reclight";
 				setParent ..;

 			shelfLayout Misc;
shelfButton -annotation "Camera" -image "indigo_camera.bmp"  -command "indcamera";
 				setParent ..;
 			setParent ..;
text -label "General setting" -w 390 -align "center" -font "boldLabelFont";

//-----------------SETTINGS------------------

frameLayout -collapsable true -label "Render Setting" -w 390;

 			columnLayout -columnAlign "center";
			
				optionMenu -label "Metropolis";
		menuItem -label "True";
		menuItem -label "False";
				floatSliderGrp -h 25 -label "Large Mutation Prob" -field true -fieldMinValue -10000 -fieldMaxValue 10000 -minValue 0.001 -maxValue 1 -value 0.2 -precision 3;
				floatSliderGrp -h 25 -label "Max Change" -field true -fieldMinValue -10000 -fieldMaxValue 10000 -minValue 0.001 -maxValue 0.1 -value 0.025 -precision 3;
				floatSliderGrp -h 25 -label "Russian Roulette Live Prob" -field true -fieldMinValue -10000 -fieldMaxValue 10000 -minValue 0.001 -maxValue 1 -value 0.7 -precision 3;
				floatSliderGrp -h 25 -label "Max Depth" -field true -fieldMinValue -10000 -fieldMaxValue 10000 -minValue 100 -maxValue 10000 -value 1000 -precision 3;
				optionMenu -label "Pathtracing";
		menuItem -label "True";
		menuItem -label "False";
				optionMenu -label "Bidirectional";
		menuItem -label "True";
		menuItem -label "False";
	separator -w 390 -h 12;

optionMenu -label "Logging";
		menuItem -label "True";
		menuItem -label "False";

 			                setParent ..;
 			setParent ..;

frameLayout -collapsable true -label "Camera Setting" -w 390;

 			columnLayout -columnAlign "center";
			
				floatSliderGrp -h 25 -label "Sensor Width" -field true -fieldMinValue -10000 -fieldMaxValue 10000 -minValue 0.001 -maxValue 0.1 -value 0.036 -precision 3;
				floatSliderGrp -h 25 -label "Lens Sensor Dist" -field true -fieldMinValue -10000 -fieldMaxValue 10000 -minValue 0.0000001 -maxValue 0.1 -value 0.0523314 -precision 7;
	separator -w 390 -h 12;

optionMenu -label "White Balance";
		menuItem -label "E";
		menuItem -label "D50";
		menuItem -label "D55";
		menuItem -label "D60";
		menuItem -label "D65";
		menuItem -label "D75";
		menuItem -label "A";
		menuItem -label "B";
		menuItem -label "C";
		menuItem -label "9300";
		menuItem -label "F2";
		menuItem -label "F7";
		menuItem -label "F11";

 			                setParent ..;
 			setParent ..;

frameLayout -collapsable true -label "Environment Setting" -w 390;

 			columnLayout -columnAlign "center";

				checkBox -label "Sky Light" -align "center"  -value 0 -changeCommand "skylight" SkylightCheckBox;
floatSliderGrp -h 25 -label "Turbidity" -field true -fieldMinValue -10000 -fieldMaxValue 10000 -minValue 0.1 -maxValue 5 -value 2 -precision 3 -enable 0 skylightSlider;
	separator -w 390 -h 12;
				checkBox -label "Background Light" -align "center" -changeCommand "bglight" BgCheckBox;
	colorSliderGrp -h 25 -label "Backgroung Light Color" -rgb 0.5 0.5 0.5 -enable 0 bgSlider;
	separator -w 390 -h 12;
				checkBox -label "HDR map" -align "center" -changeCommand "hdrlight" HDRCheckBox;
		attrNavigationControlGrp -l "HDR file" -enable 0 hdrSlider;

 			                setParent ..;
 			setParent ..;

button -w 390 -h 30 -label "Generate XML code" -align "center"  -command "indigoOutput";

			showWindow;
I've also created some Icons for th GUI
user added image
user added image
user added image
user added image
user added image
user added image
user added image

May create new Material Icons... (they are simple maya renders)
They have to be placed in the "C:\Documents and settings\User\My Documents\maya\6.0\prefs\icons" Folder to work...

Please just add stuff to the GUI and make it use your script, Matt.

I'm leaving for a 3.5 weeks long vacation somewhere in Europe, tomorrow...
I may come by the site some times from an internet café or so...
But I won't be able to do much computer stuff user added image

user added image

# 90 29-06-2006 , 01:08 AM
Registered User
Join Date: Aug 2005
Posts: 80
Very nice!

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads