Page 1 of 1

is a way to export programmed textures with MEL

Posted: Wed May 02, 2007 6:46 pm
by deadalvs
hello there...

i wanted to ask if there is a way to procedurally generate colors for pixels and then export them in series as a full image.

le's say i wanted to create a mathematical fractal and then export the array in an image...

:?: :?:

Posted: Wed May 02, 2007 11:39 pm
by deadalvs
http://www.vassg.hu/letoltes_en.htm

this is a link, where a .ma file is posted.

it shows how an expression can be used to define a graph (in the example a mandelbrot fractal). the image is then mapped onto a plane which can be rendered at any res.

the difference to my question though is that this is explicit mathematical definition of a graph (resolution-independent) and i just want to export a specific range of programmed pixels. (i care only for a few specified sampled point, the infinity between each point i don't care about)

Posted: Wed May 02, 2007 11:43 pm
by deadalvs
other words:

* * *

input:
image --> float/vector array

process ...

output
float/vector array --> image

Posted: Thu May 03, 2007 12:00 am
by DrMerman
Hey man,

Really stuck with work right now, but I whipped up this little script that might help you with the second part.
Code: Select all
//creates a plane for you to assign your texture to
	polyPlane -w 24 -h 24 -sx 10 -sy 10 -ax 0 1 0 -tx 1 -ch 1 -n deadalvsTextureMe;

///////////////////////////////////////////////////////////////////////////////

//with the plane textured, set the following variables
	int $res = 512; 	//the res of your exported map
	string $yourPathPlusNameNOEXT = "C:/Documents and Settings/Matt/Desktop/yourMap"; 	//the path where you want to save, and the filename with NO extension

//////////////////////////////////////////////////////////////////////////////

//when you have done that, run the following : 
	polyPlane -w 24 -h 24 -sx 10 -sy 10 -ax 0 1 0 -tx 1 -ch 1 -n textureGrabber;
	setAttr "textureGrabber.visibility" 0;
	
	eval ("surfaceSampler -target textureGrabberShape -uvSet map1 -searchOffset 0 -maxSearchDistance 0 -searchCage \"\" -source deadalvsTextureMeShape -mapOutput diffuseRGB -mapWidth " + $res + " -mapHeight " + $res + " -max 1 -mapSpace tangent -mapMaterials 1 -shadows 0 -filename \"" + $yourPathPlusNameNOEXT + "\" -fileFormat \"jpg\" -superSampling 2 -filterType 0 -filterSize 3 -overscan 1 -searchMethod 0 -useGeometryNormals 1;");

Run the first part, that'll create a plane. You can then add whatever texture you want onto it. Then run the rest of the script and it'll output an image of your texture.

Just the input to go, eh? :D

Well, back to work,

Cheers,
Dr Merman

Posted: Thu May 03, 2007 12:10 am
by deadalvs
:shock:

that part works ! yes !!
thanks !

* * *

unbelievable, that man ... :cry:

* * *

now to program maps ...

Posted: Thu May 03, 2007 12:19 am
by deadalvs
absolutely awesome, man !

* * *

MEL is so cool !