QUOTE(garyfixler @ 06/26/08, 12:56 AM) [snapback]287502[/snapback]
There may be a way, as you say, but I just haven't found it, outside of using the command line, which was until now the missing piece of the puzzle.
Yes that would be the kind of 70's technology nearly every program in the world supports thats widely not used because people think its obsolete. Please note it may be much saner than putting it all in one render since when it ends up flooding over your screwed. And in general rendering 10,000 frames with lot of textures can crash maya unless you turn all textures to bot/map first.
Anyway you should have know that before any line of mel you ever worte its the base slab and not the other way around.
Theres a trick t male and thats to consider it NOT a programming language, anyway theres a more elegant solution. You could make a mr shader that outputs ALL textures for each frame for one render. And then second is to output the uv cords on the sample field resolution, then let your comp app repaint in the texture. Both of wich are much much faster and the second can faciliate any new texture as you invent them.
But let us consider a scene as follows:
CODE
file -f -new;
sphere -p 0 0 0 -ax 0 1 0
-ssw 0 -esw 360 -r 1
-d 3 -ut 0 -tol 0.01
-s 8 -nsp 4 -ch 1;
//geocentric sphere for cam position
polyPlatonicSolid -r 1 -l 21.411
-ax 0 1 0 -st 0
-cuv 4 -ch 1;
polySmooth -mth 0 -dv 2 -c 1 -kb 1
-ksb 1 -khe 1 -kt 0 -kmb 1
-suv 1 -sl 1 -dpe 1 -ps 0.1
-ro 1 -ch 1 pSolid1;
for ($i in ls("-fl","pSolid1.vtx[0:241]")){
float $tmp[]=pointPosition $i;
$vec=unit(<>)*10;
move -a -ws ($vec.x) ($vec.y) ($vec.z) $i;
}
//camera for anim
camera -focalLength 35
-lensSqueezeRatio 1 -cameraScale 1
-orthographic 0 -orthographicWidth 30;
//create some angles animation
expression -s ("$pos=pointPosition(\"pSolid1.vtx[\"+frame+\"]\");\r\n"+
"camera1.translateX=$pos[0];\r\n"+
"camera1.translateY=$pos[1];\r\n"+
"camera1.translateZ=$pos[2];") -o camera1 -ae 1 -uc all;
aimConstraint -offset 0 0 0 -weight 1 -aimVector 0 0 -1
-upVector 0 1 0 -worldUpType "vector"
-worldUpVector 0 1 0 pSolid1 camera1;
bakeResults -simulation false -t "0:241" -sampleBy 1
-disableImplicitControl true
-preserveOutsideKeys true
-sparseAnimCurveBake false
-at "tx" -at "ty" -at "tz" -at "rx" -at "ry"
-at "rz" camera1;
delete camera1_aimConstraint1 pSolid1;
playbackOptions -minTime 0 -maxTime 241;
//file texture
shadingNode -asTexture file;
shadingNode -asUtility place2dTexture;
connectAttr -f place2dTexture1.coverage file1.coverage;
connectAttr -f place2dTexture1.translateFrame file1.translateFrame;
connectAttr -f place2dTexture1.rotateFrame file1.rotateFrame;
connectAttr -f place2dTexture1.mirrorU file1.mirrorU;
connectAttr -f place2dTexture1.mirrorV file1.mirrorV;
connectAttr -f place2dTexture1.stagger file1.stagger;
connectAttr -f place2dTexture1.wrapU file1.wrapU;
connectAttr -f place2dTexture1.wrapV file1.wrapV;
connectAttr -f place2dTexture1.repeatUV file1.repeatUV;
connectAttr -f place2dTexture1.offset file1.offset;
connectAttr -f place2dTexture1.rotateUV file1.rotateUV;
connectAttr -f place2dTexture1.noiseUV file1.noiseUV;
connectAttr -f place2dTexture1.vertexUvOne file1.vertexUvOne;
connectAttr -f place2dTexture1.vertexUvTwo file1.vertexUvTwo;
connectAttr -f place2dTexture1.vertexUvThree file1.vertexUvThree;
connectAttr -f place2dTexture1.vertexCameraOne file1.vertexCameraOne;
connectAttr place2dTexture1.outUV file1.uv;
connectAttr place2dTexture1.outUvFilterSize file1.uvFilterSize;
defaultNavigation -force true -connectToExisting -source file1 -destination lambert1.color;
connectAttr -force file1.outColor lambert1.color;
firtst. you can use render layers Altough that has some problems, but thisway maya knows how to do this. This is fairly straightforward and maya automatically loops and gives them separate fiile names.
QUOTE
. I can build out the scene with loops, but it's going to get into the 10s of thousands of frames, and I'd rather have a batch just steamroll through them. I cannot, however, change the currentTime from within a batch.
Thats actually very short to do, and you can issue it at rendertime too, Let us assume you had 40 textures in the above scene:
then your time range would be 0 to 242*40-1 So to set this up you just simply do ok im omitting need to handle expressions and other whatnot but thets 8 lines more, and it universally works (hey im not here to do your work im just pointing you on the way)
CODE
proc loopAnimXtimes(int $x){
createNode -n "loopingTime" time;
$min=playbackOptions -q -minTime;
$max=playbackOptions -q -maxTime;
expression -s ("loopingTime.outTime="+$min+"+frame%"+($max-$min));
for ($item in ls -type animCurve){
if (!connectionInfo -isDestination ($item + ".input"))
connectAttr -f loopingTime.outTime ($item + ".input");
}
playbackOptions -maxTime (($max+1-$min)*$x-1);
}
loopAnimXtimes(40);
now you can call this in pre render script on demand. It does not really matter if its animation within animation either.
As for the texture change and output name change (this is demonstrative but i could make it easier and use values in file nodes instead):
QUOTE
expression -s("int $index=((frame-frame%241)/241);\r\n"+
"$files={\"file1\",\"file2\",\"file3\",\"file4\",\r\n"+
" \"file5\",\"file6\",\"file7\",\"file8\",\r\n"+
" \"file9\",\"file10\",\"file11\",\"file12\",\r\n"+
" \"file13\",\"file14\",\"file15\",\"file16\",\r\n"+
" \"file17\",\"file18\",\"file19\",\"file20\",\r\n"+
" \"file21\",\"file22\",\"file23\",\"file24\",\r\n"+
" \"file25\",\"file26\",\"file27\",\"file28\",\r\n"+
" \"file29\",\"file30\",\"file31\",\"file32\",\r\n"+
" \"file33\",\"file34\",\"file35\",\"file36\",\r\n"+
" \"file37\",\"file38\",\"file39\",\"file40\"};\r\n"+
"setAttr -type \"string\" file1.fileTextureName ($files[$index]);\r\n")
-o "" -ae 1 -uc all ;
theres still a second way and that is to use the expression to drive time1 at beginning of frame based on global counter. Please note it MUST be a expression maya governs its attributes witha iron fist otherwise.
And a 3rd way to change how the renderer is invoked in the relevant mels and duplicate thoe and register a new type of render wich by the way is the eilite solution.
But now ive spend way too much on the subject. Anyway if your dcode is very loong you should review how you THINK mel works.