27 November 2010

Camera Scripts

[EN]
This is a demonstration of good camera rig scripts that i wrote. Here are its names, functionalities and concepts:

vzCameraSmoothLevel.py - 2010-10-08
A python script to set smooth levels of detail to polygons depending of the distance of the camera. This technique is very useful in games :)
. create circle controls to the camera rig (2 horizontals as templates and 2 verticals to change the distance of the system).
. connect the translate of the vertical controls (min and max controls) to the radius of the horizontals template circles.
. create a group of this circles and parent to the camera.
. so, create distanceBetween nodes from camera to each selected object (meshes in this case).
. now, create multiplyDivides and conditions nodes in order to check if the translate of the vertical controls is greather or less than the distance of the distanceBetween node and apply the result connecting the output value to the smoothLevel attribute of the object.

vzSetCameraClipPlane.py - 2010-08-17
A python to just create a user interface (window) to change the Near and Far Clip Plane to all cameras. It is very useful when we have to render great scenes in layers.
. you just need to read the value from floatSliderGrp and
. set this value in the attribute ".nearClipPlane" or ".farClipPlane" of the camera.

cbCameraShake.mel - 2008-12-22
A mel script to create a interface and generate random values to animate a group above the camera baking its animation. It is useful to shake the camera like stopMotion, handCamera, in the ocean, etc...
. create a group over the camera to shake it.
. read values of variations from the interface like: what camera is selected, start and end frames (or use timeline), random values to translation and rotation, min and max frames to key frames, the type of keys to use (flat, spline, linear), etc.
. so, run a function to randomize these values and bake its animations at the end of the process.

cbStereoCamera.mel - 2009-10-20
A mel script to create a camera rig to simplify the stereoscopic (3D) setup.
. create a default Maya stereoscopic camera.
. create 2 controls and parent to the main camera.
. limit the translations of the controls to only X and Z directions respectively.
. connect the translate Z of the pointing controls (in front of the camera) to the ($stereoCamera+"CenterCamShape.zeroParallax") attribute.
. connect the translate X of the side control to the ($stereoCamera+"CenterCamShape.interaxialSeparation") attribute of the camera.
. so, create 2 aimConstraints from side cameras to the point control to get the real-time interaction.

I hope you enjoy, Thanks!

[PT]
Essa é uma demonstração de bons scripts de rig de cameras que eu escreve. Aqui estão seus nomes, funcionalidades e conceitos:

vzCameraSmoothLevel.py - 2010-10-08
Um script em python para configurar o smooth level of detail dependendo da distancia da camera. Essa tecnica é muito util em games :)
. crie controles de circulos para o rig da camera (2 horizontais como templates e 2 verticais para mudar a distancia calculada).
. conecte o translate dos controles verticais (min e max controles) aos raios dos controles horizontais em templates.
. crie um grupo com os circulos de controles e parenteie à camera.
. então, crie nodes de distanceBetween da camera a cada objeto selecionado (meshes nessa caso).
. agora, crie nodes de multiplyDivides e condictions para checar se o translate do controle vertical é maior ou menor que a distancia do node distanceBetween e aplique esse resultado conectando o valor de output ao atributo de smoothLevel do objeto.

vzSetCameraClipPlane.py - 2010-08-17
Um script python que apenas cria uma interface para o usuario (janela) para mudar os valores de Near (Proximo) e Far (Longe) Clip Plane de todas as cameras. Ele é muito util quando precisamos renderizar grande cenas em layers.
. voce precisa apenas ler os valores do floatSliderGrp e
. configurar esses valores nos atributos ".nearClipPlane" ou ".farClipPlane" da camera.

cbCameraShake.mel - 2008-12-22
Um mel script que cria uma interface e gera valores randomicos (aleatórios) para animar um grupo acima da camera, bakeando (gravando) sua animação. Ele é util para balanços de camera como stopMotion, cameras de mão, em oceanos, etc...
. crie um grupo acima da camera para balança-lo.
. leia os valores das variações da interface como: qual camera selecionada, frames iniciais e finais (ou pela timeline), randomize valores de translacao e rotação, frames min e max para marcar keys, o tipo de keys para usar (flar, spline, linear), etc.
. então, execute uma função para radomizar esses valores e faça o bake de suas animações no final do processo.

cbStereoCamera.mel - 2009-10-20
Um mel script para criar um rig de camera para simplificar a configuração estereoscopica (3D).
. criar uma camera estereoscopica padrão do Maya.
. criar 2 controles e parentea-los a camera principal.
. limitar as translações dos controles para somente X e Z livres respectivamente.
. conectar a translacao em Z do controle apontador (em frente da camera) no ($stereoCamera+"CenterCamShape.zeroParallax") atributo.
. conectar o translate X do controle lateral no ($stereoCamera+"CenterCamShape.interaxialSeparation") atributo da camera.
. então, crie 2 aimConstraints das cameras laterais ao controle apontador para conseguir uma interação em tempo real.

Espero que gostem, Obrigado!


Camera Scripts from Danilo Pinheiro on Vimeo.

0 comments: