3D abstract

Mental Ray
SIZE- number of shaded vertexes, taking to account
DEPTH- how deep renderer extrapolate them

Lower SIZE - faster render but more memory it use.
Higher SIZE- more peaces of information it takes at once- and LESS amount of MEMORY it use
Bigger DEPTH- faster render and more memory it use
Start numbers- 10;40
If (see in output window) averege leave size much biger than in render globals than u need to INCREASE DEPTH.
Usualy depth 30-small scenes, depth 40-medium scenes, depth 50-large scenes.
Imf_copy –r –p filename.sgi filename.map
_____________________________________________________________

Rendermen

ReadArchive "ribbox\plant.$F4.rib"
Alfa hole: RibBox with text> matte 1
ANIMATING ATTRIBUTE IN SLIM
Create attribute in maya and write TCL expression:
[mattr "locatorShape1.atributename" $f]

imageName.###.tif > imageName.$F3.tif
One material, different textures on different objects.
Add string attribute on shape nodes of objects.
In extra atributes of objects write imagefile name.extention.
In SLIM, in file fild of image file node write expression.
[txmake textures/[mel "getAttr $OBJPATH.attrName" ] -smode black -tmode black -resize round-]
Rendering Passes in renderman
install meCombineAOV slim template.

1) Go to rendermen globals> display> channel.
Create any namber of variables that you need to use.

For example if you have to output Color, Diffuse and Specular:
create 3 variables, and give them descriptive names in the "channel" field.
such as [color myColor],[color myDiffuse],[color mySpecular].
Check "Quantize", set all to zero.
Prefix "color" before names- is data type. If u need to output for ex. geometry normals,
u have to set prefix "normal" because geometry normal has data type= normal.
(normal myNormals)

2) Go to rendermen globals> display> secondary
In the "name" field write the filename of passes, for ex. myPasses, set "type" to openexr,
in the "channels" add your 3 new variables
(color myColor, color myDiffuse, color mySpecular)


3) Run slim. Create meCombineAOV shader and add your 3 variables inside it.
Connect any shaders to variables (specular shadingmodel to mySpecular variable etc).
Beware of datatype- u can not connect normal to color etc.
4) Render.

Render RIBS in alfred:

Start> Run>

paste the code:

"C:\Program Files\Pixar\RenderMan-Studio-1.0.1-Maya2008\bin\alfred.exe" \\Nas\McFoxy\rib\Shot_01HD.*.rib
_____________________________________________________________

Real Flow
Simulation deprnd on scale. Circle scale 0.2 it needs 2000 of resolution to get behavior
of 1.4 scale with 9 of resolution.
Large scale take much longer to calculate. But give more realistic and detailed behavior.
There are many ways to speed up the RF work flow.
The biggest things are the resolution of emitters, number of sub steps, and geometry in the
scene. Increasing any of these will slow down the simulation, and reducing any will speed the
simulation up.
The most overlooked is probably the sub steps, the default maximum of 333 sub steps per frame
is rarely needed. Start from 15. Command line simulations are about 30% faster
than running simulations in the GUI mode of RF.
meshbuild
C:
CD "c:\program files\next limit\realflow4\"
realflownode -threads 2 -mesh -range 1 120 "D:\projects\water\Scenes\water.flw"
Simulation
CD "c:\program files\next limit\realflow4\"
realflownode "D:\projects\water\Scenes\water.flw"
Экспоненциальная функция имеет значение 1 в кадре 0 и снижается до нуля.
Чтобы получить ослабевающую экспоненциальную функцию мы используем отрицательное
значение. Чтобы она имела на старте значение X, впишите формулу "X*exp(-t)".
Чтобы увеличить скорость понижения, увеличьте значение времени 5*exp(-Y*t).
Если вы имеете функцию exp(-5*t) и хотите сдвинуть время так,
чтобы она начиналась на 2 секунды позже, все, что вам нужно - это заменить t на (t-2).
if (f<80 span="">
Формулировка “if” означает: до 80-го кадра значение составляет 50, в другом случае - 30.

Scripting.

Переменные
myStringVariable= "jdject_A"
myIntVar = 5

BATCH SCRIPTS
myVase=scene.addVase(20,8,2.5)
scene.message("I create a vase vith custom parameters")
myVase.setParameter("Scale",Vector.new(1,2,1) )
myVase.freezeTransformations()
scene.message("I modify its scale and freeze transform")
myVase.setName("maSelfmadevase")
scene.message("Its renamed to "+myVase.getName())


Для повторения кода Х раз используеися for in loop:

for i in range (1,10):
scene.message("%d" %i)
Повторить 9 раз
(перед коммандой ставится таб!!!) напечатать значение И.

Создать колонну из 10 кубиков один над другим:
for i in range (0,10):
brick = scene.addCube()
brick.freezeTransformations()
brick.setParameter("Position", Vector.new(0.0, i ,0.0))

Создать стенку из 10 колонн и рядов:
for j in range (0,10):
for i in range (0,10):
brick = scene.addCube()
brick.freezeTransformations()
brick.setParameter("Position", Vector.new(0.0, i , j)
Для проверки утверждения используется if statement
if 3>2:
scene.message("Yes its true")
else:
scene.message("Its not true")

if i%2==0:
если четный

GUI
form = GUIFormDialog.new ()
form.addIntField( "column",6 )
form.addIntField( "rows",6 )
form.addBoolField( "offset",True )

form.show()

GUI стена
form = GUIFormDialog.new ()
form.addIntField( "column",6 )
form.addIntField( "rows",6 )
form.addBoolField( "offset",True )
if (form.show()== GUI_DIALOG_ACCEPTED):
for j in range (1, form.getFieldValue("column")):
for i in range (1,form.getFieldValue("rows")):
brick = scene.addCube()
brick.setParameter("scale",Vector.new(1.0,1.0,2))
brick.freezeTransformations()
if (i%2==0) and form.getFieldValue("offset"):
brick.setParameter("Position", Vector.new(0.0, i ,j*2))
else:
brick.setParameter("Position", Vector.new(0.0, i ,j*2+1))

EVENT SCRIPTS

Emitt particles when objects collide:
#--------------------------------------------------
# Function: onSimulationStep
#--------------------------------------------------

def onSimulationStep():
import random #Get python function to work in script
obj1 = scene.getObject("cube1")
obj2 = scene.getObject("cube2")
pointList = obj1.getCollisionPoints( obj2 )
emitter = scene.getEmitter("Circle01")
for point in pointList:
emitter.addParticle(point, Vector.new(0,0,0))
pass

Преобразование флоатового типа данных в стринговое
scene.message ( "%f" % 2.56 )

_____________________________________________________________


HDRI

MANUAL EXPOSURE, FOCUS, WHITE BALANCE-choose shooting position based on Sun location (Sun NOT should be at the age of mirror sphere )
-use higher aperture (f/22)
-focus on center of sphere
Exposures: 1/4000 1/2000 … (devide by 2 ) … 1/4 (11 images)
To remove fotographer from HDR – rotate you position to 90 degrees to one side and shoot again.
PANORAMIC SHOOTING
SET TO MANUAL MODE IN CAMERA: EXPOSURE, FOCUS, WHITE BALANCE !
Film Back (in maya camera attributes) for 35 mm format is
Aperture 1,5 , 1,0
Film aspect ratio 1,5
Lens squeeze ratio 1,0

Focal Length (in maya camera attributes) = Focal Length of real camera lens * 1,6
(for crop matrix)

_____________________________________________________________
MEL
isolate selected HOTKEYзапусти этот скрипт и ищи в hotkey editore в категории "isolate" свой isolate select
runTimeCommand
-annotation "view isolate selected"
-category "isolate"
-command ("{string $panel = `getPanel -wf`;if(`gmatch $panel \"modelPanel*\"`)
{if(`isolateSelect -q -state $panel`) isolateSelect -state 0 $panel;
else {isolateSelect -state 1 $panel; isolateSelect -addSelected $panel;}}}")
IsolateSelect_rtc;
nameCommand
-annotation "IsolateSelect_rtcNameCommand"
-command ("IsolateSelect_rtc")
IsolateSelect_rtcNameCommand;
ParentShape
parent -add -s;

//set attr for selected obj
string $sel[]= `ls -sl`;
string $item;
for($item in $sel)
{
setAttr($item + ".scaleY")(rand(0,5));
}

//build sinus curve
curve -p 0 0 0 -n "curve1";
int $i;
for ($i=0; $i<500 i="$i+1)" t="$i;" x="$t;" y="sin($t);">($x)($y) 0 curve1;
}
// WHILE LOOP-repeatly execute the code inside the loop until the condition satisfied.while (condition)statement;
int $x = 0;while ( $x <20>//increment of looping$x= $x+1;//action to doprint ($x) ;}

//FOR IN LOOP- allow to repeat chunk of code for each member in array.for (each element in array) statement;

string $eachElementInArray;
string $selectedElements[] = `ls -sl`;
for ( $eachElementInArray in $selectedElements )
{
print (“the current element is” + $eachElementInArray) ;
}
//FOR LOOP – handy when u want something done a certain amount of time.for (start value; end value; increment) statement; ($x=$x+1)=($x++)

for ($i=0;$i<20 i="" lang="EN-US" span="">
{
float $
sine = sin($i);float $cos=cos($i);
polySphere -name ("sphereName" + $i);
move -r $cos $i $sine;
}

P R O C E D U R E S
Is a group of MEL commands.
global proc procedureName (arguments) {commands;}
global proc creationOfSphere (float $rad, float $divX, float $divY)
{
polySphere -radius $rad -sx $divX -sy $divY;
}
creationOfSphere 10 12 12;
Rename selected jdjects. Run script, run command {renamer newName}.
global proc renamer (string $newName)
{
string $sel[] = `ls -sl`;
for ($each in $sel)
{
rename $each ($newName + "_#");
}
}

Create spiral curve MEL
global proc string spiral( float $ht, float $radius, float $numRounds )

{
string $cylinder[] = `cylinder -ch off -ax 0 1 0 -p 0 0 0 -r 1.0 -hr 1.0`;
scale $radius $ht $radius $cylinder[0];
string $cos = `curveOnSurface -d 1 -uv 0.0 0.0 -uv 1.0 ($numRounds*8.0) $cylinder[0]`;
string $duplicatedCrv[] = `duplicateCurve -ch off $cos`;

delete $cos;
delete $cylinder[0];

return $duplicatedCrv[0];
}
_____________________________________________________________