Arnold DNA Render KIT

Multitexture material - one shader, different textures.
You can reduce amount of shaders in scene and speed up look development with one material and individual textures on each object. With this setup, object shapes share same shader but has their own textures.












Method:

- create string attribute on object shapes, name it  mtoa_constant_(attributeName). 
- enter attribute token  < attr:(attributeName) > in Image Name field of file node with full absolute path to texture (D:\projects\arnoldTemplates\3D\sourceimages\< attr:(attributeName) ).
It become relative immediatley (sourceimages\< attr:(attributeName) >) but if you enter relative path from start it would not work.
- enter desirable texture names in each object attribute (c_R.tif, c_G.tif, c_B.tif for obj_A, obj_B, obj_C).

Also you can set place2dTexture.repeatUV attribute on every shape individualy with aiUserDataFloat nonde and float attribute  mtoa_constant_(attributeName). Look into example scene see how to setup this.


You can create and set Arnold custom attributes on object shapes with Attribute Manager script.
Example scene shader_BASES_01.mb and Sourceimages.









Object and shader IDs.


Method:

OBJECT ID:
- add shape attribute on object. Name it: mtoa_constant_(maskName). set attribute color to R, G or B. Assign aiShader.
- create AOV, name it AOV_(maskName)
- create aiUserDataColor, set colorAttrName: (maskName)
- plug aiUserDataColor to  AOV_(maskName) in shading group of object shader or in default shader slot in AOV_(maskName).

SHADER ID:
- create AOV, name it AOV_(maskName)
- create 3 aiUtility with flat corols R, G, B. Name them ID_R, ID_G, ID_B
- plug ID_R to AOV_(maskName) slot in shading group for 1 object
- plug ID_G to AOV_(maskName) slot in shading group for 2 object
- plug ID_B to AOV_(maskName) slot in shading group for 3 object and repeat for next objects

Example scene shader_BASES_01.mb

ID manager
You can create IDs for bunch of objects or shaders automatically with ID manager.
For creating object IDs select objects or groups of object and press "Create object IDs". Objects inside selected groups share same channel.
For creating shader IDs select shading groups and press "Create shader IDs". If no shading group selected IDs will be created for all shading groups in scene. Creating IDs for shaders require clean scene without existing AOVs, otherwise it may work wrong. So be careful using it.


After some steps with developing pipeline ID manager was extended. Now you can create shader IDs with 2 methods: with aiWriteColor node(shader ID WC) or with Custom AOVs (shader ID UT), like in previous version. You should avoid using 2 methods together, just choose one of them. Write Color methods works with limited amount of shaders( 'aiStandard' , 'aiSkin' , 'aiHair' , 'aiUtility' , 'alSurface', 'jf_nested_dielectric') Also you can create set of passes with one click (passes button). It include 'N' , 'P' , 'Z' , 'direct_diffuse' , 'direct_specular' , 'indirect_diffuse' , 'indirect_specular' , 'refraction' , 'sss' , 'sheen' , 'specular' from build in AOVs and also ambient occlusion, aliased depth as custom AOVs. Download AOV manager.













Preview shape textures.
When using multitexture material as described above, you can`t see textures in viewport. One way of solving this for each object:
- read texture name from desirable attribute,
- create lambert shader with this texture as color,
- assign shader to appropriate object. 
Shader manager -script for doing this automatically (ShowTX).
Also you can delete all preview shaders in scene with it (Delete preview).

Get texture from shader and assign to shape.
When preview lambert shader assigned (or any other shader with texture on color) you can transfer name of texture from shader to desired color attribute on objects shape with Shader manager (Get TX).












Set Arnold subdivision for multiple objects.
You can define arnold attributes for multiple objects in two ways:
- create set of objects and assign desirable attributes for set
- establish attributes individually in each object shape.
Set Arnold subdivision for each selected object with script aiSetSubdiv 
You can turn off Maya subdivision (when pressing button 3) to avoid arnold treat this object as subdivision surface (which make ASS files much bigger and generation time much longer) with "Maya smooth off" button.












Virtual photostudio.


Template scene with indoor lighting setup and example objects, shaders, AOVs.
Download textures from sourceimages and convert them to float tif.


Global materials with local controls.


With one shader assigned to several objects easy to setup independent tweaks of different parameters for each object. Even with the same texture bunch of variations can be achieved from custom geometry shape attributes.



Shape shading example scene. Download textures from sourceimages and convert them to float tif.

Material library.


Set of common materials, such as wood, brick, concrete, paper etc.
The most complex setup has COPPER material, made according to shape shading technique. You can easily extend other materials to any complexity in the same way. Download material library and example object with custom attributes.

Save next version of current scene.
This simple task- save new version of current scene, indeed take huge amount of time because we do it over and over again. Insane often. Push one button instead of going through menu and typing can be done with save new version script.

Using this methods and tools together we has some basic workflow how to setup for rendering bunch of geometry and shots in a short time. Proper naming of objects, materials  and some nodes allow to automate all repetitive process and focus on artistic side of rendering. Below i try to systemize my experience in CG as draft of production pipeline focusing on rendering.

Watch brief preview of workflow:


Arnold rendering pipeline draft.
To perform complex project successfully the best way to do is to break whole process on logical parts and deal with small tasks solving problems one by one. Division occurs several times- bigger tasks splits again and again until we get to basic manipulations. This is structuring.
Structure of film: FILM > SEQUENCE > SHOT >FRAME
Structure of film production process: SEGMENT > BRANCH > PHASE > PROCEDURE > ACTION
This is very generalized view on the subject but it gives overlook of whole process and let to understand CG role in it. During movie (or any other project with CG) creation there are a lot of segments exist. VFX artist usually stay away from script writing, HR, sound design, management, promotion and all other aspects of final result. So we are inside  computer graphic segment — creation of image sequences.
Set of rules how exactly split apart CG segment and how to make this parts work together effective is called production pipeline. The main goals of pipeline are: perfect project organisation, automatisation of actions and making structure flexible to many changes.

Example of pipeline tools implementation. See details in Making of Nicky Tanner




CG segment General notes.
Physically CG branch is set of files on a hard drive. To manage huge amount files of different formats in a logical and descriptive way special folder structure have to be created. Folder structure rely on: used software, requirements to folder structure for particular software, pithiness, logic and usability for data exchange. Each file should have proper name, version and be in proper folder. This will give possibility to develop scripts and automate a lot of process, such as gathering scenes for render, import cashes, apply materials etc.
Branches of CG segment.
We can approximate branges as: 1) Concept Art brunch, 2) 2D compositing brunch, 3) 3D brunch.
Phases of 3D: - Asset creation - Animation - Layout - FX - Data transfer and baking - Rendering
Each phase splits on procedures. For example, well known procedures of asset creation phase are: modeling,  texturing, sculpting,  rigging. This is also specific and generalized segmentation of CG production but it quite suitable for our goal- discovering rendering phase in conjunction with all other process. 3D phase in a rough way:


First, you create models of your objects (assets). Than you make layout and animations. Finally(for 3D branch) your gather all data together in render scenes and output final images.

File names and versions
All files should be named properly strictly according to the pipeline rules. Generally full file name always consist from fileName_version.extension 
If file name is complex than each part should goes one after one by the rule: FROM GENERAL TO SPECIFIC. For example NY_manhatten_peachtree_equitableBuilding -is file name and full name would be NY_manhatten_peachtree_equitableBuilding_001.mb
All files should has versions. Version padding should be chosen according to quantity of possible versions.

Naming objects and nodes
Naming of objects in scenes extremely important if you want to operate any amount of data efficient. Basic and simple operation — selection of objects become a trick when you need to do this with many-many assets or nodes in many scenes. Easy selection different assets or logical parts of assets (characters, environment elements, leaves, metals, fluids etc) speed up work dramatically and good naming system can make selection much more easy and fast. Details may depend on concrete project but in overall name should be descriptive, readable, without useless information and ordered from general to specific. You can implement in name any characteristic which you may need to have access later for many objects. For example, if you render background separate from characters you will need select all background elements and all characters huge amount of time, so "_BRGD_" and "_CHAR_" codes  in names will allow to do this with command cmds.select( "*_BRGD_*") and cmds.select( "*_CHAR_*"). Except selection by names there are other ways of automatic selection of many objects such as display layers, sets, reading custom attributes etc. Combining them together allow to create very handy selection system.

Codes
There are a lot of names which may repeat from scene to scene and even from project to project and a lot of long words which may reduce readability. Thats why it has sense to define code system to avoid this issues. In all my projects imageFile nodes has name "IF_(material or object name/code)", for example.

Data transfer: references, import, cashes
By using references we get  flexible file connection system which allow to make changes in all stages of production without loosing to much work. What type of data transfer between each phase to choose (importing, referencing, cashes, alembic cashes etc) depends on many factors, i usually use referencing for big chunks of data (like reference location scene with many assets), import for smaller tasks(like importing many assets to scene with location) and animation cashes or alembic for simulation and animation. Reference could be nested when you reference file which already contain another referenced files. Better to keep reasonable balance between flexibility and complexity of reference brunching.

Assets
Prepare models so, that finalised assets has only geometry and custom shapes attributes, defined all shading parameters you need to adjust (in examples above this is mColor, mDisp, mTileUV etc). One of attributes (mMat) define material name or material type (wood, metal. glass etc) if you using just few types for all object in scenes. Assign materials at the latest level of nesting references (in render scene) has a lot of benefits: asset files are clean, no mess with same from different imports and no scene break when using render layers and references(this is well known issue with references and render layers, and one more good habit to be safe - don't use per face shader assignment). Shader manager is working whorse for preparing assets and assigning materials at render scene. Dont forget to delete history, freese transforms and name all asset parts properly. Animated asset should be rigged and if you wish to keep render scene clean, you may use only models without rigging elements and transfer animation with a help of cashes. Render geometry of asset should be in separate group without any rigging nodes and no render objects should be outside asset group. Parenting eyes geometry to joints is an example of very-very bed setup.

Materials
Usually we has a custom material for each object in scene. Sometimes different objects can share same shader but never the less, the more object we has, the more shaders we need and more headache to tweak shaders them. One way of reducing shaders quantity is organizing materials by physical types (metals, woods, glass, stones etc) so amount of shaders become limited and not connected to amount of objects. Varying of individual characteristics for each object can be achieved with shape shading technique, described above. At the beginning of project we can develop materials in one master lighting scene (aiPhotostudio). As result you have basic material library of all types required for project (arnold material library). First you make general approach of scene appearance with materials from library. Than you make unique tweaks for each object and improve scene in details (by changing shaders on object base).

Rendering shots
In final render scene gather all data for rendering- models, animation, cameras, materials etc. Assign materials from material library to objects (automatically with Shader manager), setup lights (lights can be also predefined in master lighting scene) and you have scene which is ready for individual look development tweaks.

Download set of scripts for rendering phase as Arnold DNA Render KIT

Arnold DNA render KIT evolution
During the last year on the base of highly improved ideas above i was developing pipeline for animation feature film.
Arnold DNA Render KIT became an Animation DNA — complete set of tools for 3D animation, which basically includes integration with FTrack project management system, tools for assembling rendering and animation scenes, data transfer utilities, look development accessories etc.

See details about the animation feature in Making of Nicky Tanner


You can also buy Maya 2015 scene with rigged, shaded and textured Bender