Date: Fri, 29 Mar 2024 11:19:04 +0000 (UTC) Message-ID: <2112089018.685.1711711144344@ip-10-0-0-233.us-west-2.compute.internal> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_684_1673380196.1711711144341" ------=_Part_684_1673380196.1711711144341 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
RenderMan procedural primitives are user provided subroutines th= at can be called upon to generate geometry during the process of rendering.= The advantage of procedurals over native Maya geometry is that they can ge= nerate complex geometry very efficiently. Procedurals can create incredible= geometric complexity from a small number of inputs, and we can delay handl= ing it until the render time. This may make it possible to render much more= complex scenes than would be possible with standard Maya representation. P= rocedurals can also be thought of as units of memory management. The render= er can elect to unload all concrete geometry associated with a procedural k= nowing that the geometry can be regenerated should there be further need fo= r it.
RenderMan for Maya ships with the generic procedural node type of Render= ManProcedural that can be used to load a RiProcedural subroutine (not RiPro= cedural2). This is meant to be quick and easy without requiring installatio= n or customization. For flexibility, a Pre Shape Mel attribute can be used = to set the string data parameter during scene translation.
Alternatively, users can specify custom mappings of arbitrary Maya nodes= to DSO procedurals using .args file parameter lists. This is meant to prov= ide seamless RenderMan integration with exiting Maya plug-ins.
RfM can be made aware of custom .args file procedurals by placing a conf=
ig/mayaTranslation.json extension file under RFM_PLUGINS_PATH
=
(22.2), RFM_SITE_PATH
or RFM_SHOW_PATH
. Example s=
ite configuration:
setenv = RFM_SITE_PATH /tmp/simple_procedural
RFM_PLUGINS_PATH
is specially designed for procedurals and =
takes a list of paths:
setenv = RFM_PLUGINS_PATH "/tools/plugins/myHairPlugin:/tools/plugins/myCrowdPlugin:= /tools/plugins/mySpherePlugin"
Each path should contain the procedural as well as a config
=
directory that may contain the usual files: rfm.json
, e=
xtensions.json
, menu.json
, shelf.json
, etc=
.
The paths in RFM_PLUGINS_PATH
will be added to render-time =
search paths, including the following sub paths:
Option "searchpath"
"string r=
ixplugin" ["...:/tools/plugins/mySpherePlugin:/tools/plugins/mySpherePlugin=
/nodes:/tools/plugins/mySpherePlugin/nodes/args"]
<=
code> "string shader" ["...:/tools/plugins/mySpherePlugin:/tools/plugins/my=
SpherePlugin/nodes:/tools/plugins/mySpherePlugin/nodes/osl"] =
"string texture" ["...:/tools/plugins/mySpherePlugin"]
"string procedural" ["...:/tools/plugins/mySphe=
rePlugin"]
The directory should contain config/mayaTranslation.json which declares = translator mappings. In this case, we map the custom Maya nodetype "MayaSph= ere" to the RenderMan procedural "SphereProc". Example config/mayaTranslati= on.json:
{ "nodeTable": [ "MayaSphere", "SphereProc" ] }
RfM and RenderMan will search RFM_SITE_PATH and RFM_SHOW_PATH for proced= urals DSOs and Args of the specified name, i.e. SphereProc.so and SpherePro= c.args.
The args file should set the plug-in typeTag to "procedural" for RiProce= dural or "procedural2" for RiProcedural2. A special "string __dsoname" para= meter must also be set to the name of the DSO. Other procedural parameter c= an be declared similar to shading parameters. The "match" feature can be us= ed to translate Maya attributes with differing parameters name, i.e.:
<arg= s format=3D"1.0"> <page name=3D"Parameters" open=3D"True"> <param name=3D"__dsoname" type=3D"string" default=3D"SphereProc.= so" match=3D"-none-"/> <param name=3D"radius" type=3D"float" default=3D"1"/> <param name=3D"material" match=3D"rman_material" type=3D"string"= default=3D""/> </page> <typeTag> <tag value=3D"procedural2"/> </typeTag> <rfmdata classification=3D"RenderMan/procedural"/> </args>
An example Maya plug-in with RenderMan procedural integration: simple_procedural.zip
Materials can be late bound using the __materialid mechanism described h= ere: Ri Material Binding. = In Maya, the "string __materialid" parameter corresponds to the Maya shadin= g group name. Users may need to enable "Output All Shaders" under the Advan= ced section of render settings to output all materials up front.
setAttr= "rmanGlobals.outputAllShaders" 1;