#!/usr/bin/env python # See Templates->Python->aHelper.py for a more efficient way # of generating geometry for prman. # Malcolm Kesson: March 4th 2017 import sys def lorenz(num, h, sigma, rho, beta): x0 = 0.1 y0 = 0.0 z0 = 0.0 pnts = [] for i in range(num): x1 = x0 + h * sigma * (y0 - x0) y1 = y0 + h * (x0 * (rho - z0) - y0) z1 = z0 + h * (x0 * y0 - beta * z0) x0 = x1 y0 = y1 z0 = z1 pnt = [x0,y0,z0] pnts.append(pnt) return pnts args = sys.stdin.readline() if args: arg = args.split() pixels = float(arg[0]) num = int(arg[1]) h = float(arg[2]) sigma = float(arg[3]) rho = float(arg[4]) beta = float(arg[5]) width = float(arg[6]) pnts = lorenz(num, h, sigma, rho, beta) print('Attribute "dice" "int roundcurve" [1]\n') print('Basis "catmull-rom" 1 "catmull-rom" 1\n') print('Curves "cubic" [%d] "nonperiodic" "P" [\n' % num) for x,y,z in pnts: print('%1.3f %1.3f %1.3f\n' % (x,y,z)) print('] "constantwidth" [%1.3f]\n' % width) sys.stdout.write('\377') sys.stdout.flush() # wait for the next set of inputs args = sys.stdin.readline()
rman "-version 1" { Declare param {int lorenz_num} { label "Number of CVs" subtype slider range {4 10000 100} description "No description." } Declare param {float lorenz_h} { label "H" subtype slider range {0 0.03} description "No description." } Declare param {float lorenz_sigma} { label "Sigma" subtype slider range {0 20} description "No description." } Declare param {float lorenz_rho} { label "Rho" subtype slider range {0 30} description "No description." } Declare param {float lorenz_beta} { label "Beta" subtype slider range {2 30} description "No description." } Declare param {float lorenz_width} { label "Curve Width" subtype slider range {0 3} description "No description." } # The Collection and NodeOptions blocks enable a Pre-Shape MEL script # to be assigned to "RenderMan Controls->Geometric Settings" panel. Collection lorenz_OptionalGeometricSettings { param lorenz_num { default 4 state optional } param lorenz_h { default 0 state optional } param lorenz_sigma { default 0 state optional } param lorenz_rho { default 0 state optional } param lorenz_beta { default 0 state optional } param lorenz_width { default 0 state optional } } NodeOptions {kGeometric kParticle} { reference Collection optionalGeometricSettings reference Collection lorenz_OptionalGeometricSettings } }
// Generated by Cutter v7.7.8 at 0:36:47 on the 5.22.2017. // The source document on which this mel script is based is, // "C:/Users/jmken/Documents/maya/projects/RfM_mel/lorenz.rman" // Cutter software by Malcolm Kesson (all rights reserved). // // Pre Shape User Interface (UI) Mel Script // global proc lorenzUI() { string $selected[] = `ls -sl`; int $i; for($i = 0; $i < size($selected); $i++ ) { string $shp[] = `listRelatives -shapes $selected[$i]`; // To add the UI implemented by this proc to the "Geometric // Settings" panel use the following mel commands, // select rmanSettings; // lorenzUI; // where "rmanSettings" might be rmanSettings1, rmanSettings2 etc. if(`nodeType $selected[$i]` == "RenderMan") $shp[0] = $selected[$i]; string $shapeName = $shp[0]; string $attr = `rmanGetAttrName "preShapeScript"`; // "Connect" to the mel script that calls // Pixar's custom Ri mel procedures. rmanAddAttr $shapeName $attr "lorenzRI"; $attr = `rmanGetAttrName "lorenz_num"`; rmanAddAttr $shapeName $attr "10000"; $attr = `rmanGetAttrName "lorenz_h"`; rmanAddAttr $shapeName $attr "0.01"; $attr = `rmanGetAttrName "lorenz_sigma"`; rmanAddAttr $shapeName $attr "10"; $attr = `rmanGetAttrName "lorenz_rho"`; rmanAddAttr $shapeName $attr "28"; $attr = `rmanGetAttrName "lorenz_beta"`; rmanAddAttr $shapeName $attr "3.2"; $attr = `rmanGetAttrName "lorenz_width"`; rmanAddAttr $shapeName $attr "0.2"; } }
// Generated by Cutter v7.7.8 at 0:37:40 on the 5.22.2017. // The source document on which this mel script is based is, // "C:/Users/jmken/Documents/maya/projects/RfM_mel/lorenz.rman" // Cutter software by Malcolm Kesson (all rights reserved). // // Pre Shape Mel Script // global proc lorenzRI() { // Get the name of the shape node string $shapeNode = `rman ctxGetObject`; string $parents[] = `listRelatives -parent $shapeNode`; string $tformNode = $parents[0]; // The node may hava a number in its name that we can use // to set the random number generator int $nodeNumber = `match "[0-9]+" $shapeNode`; if($nodeNumber != "") { seed(int($nodeNumber)); } // Bounding box... float $bb_width = `getAttr ($shapeNode + ".boundingBoxSizeX")`; float $bb_height = `getAttr ($shapeNode + ".boundingBoxSizeY")`; float $bb_depth = `getAttr ($shapeNode + ".boundingBoxSizeZ")`; string $attr; $attr = `rmanGetAttrName "lorenz_num"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; int $lorenz_num = `getAttr $attr`; $attr = `rmanGetAttrName "lorenz_h"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $lorenz_h = `getAttr $attr`; $attr = `rmanGetAttrName "lorenz_sigma"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $lorenz_sigma = `getAttr $attr`; $attr = `rmanGetAttrName "lorenz_rho"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $lorenz_rho = `getAttr $attr`; $attr = `rmanGetAttrName "lorenz_beta"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $lorenz_beta = `getAttr $attr`; $attr = `rmanGetAttrName "lorenz_width"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $lorenz_width = `getAttr $attr`; // Use of Pixar's custom RenderMan Studio procedures begins here. string $cmd; if(`about -win64`) $cmd = "\nProcedural \"RunProgram\" [\"python C:/Users/jmken/Documents/maya/scripts/lorenz_helper.py\" "; else $cmd = "\nProcedural \"RunProgram\" [\"C:/Users/jmken/Documents/maya/scripts/lorenz_helper.py\" "; $cmd += "\" " + $lorenz_num; $cmd += " " + $lorenz_h; $cmd += " " + $lorenz_sigma; $cmd += " " + $lorenz_rho; $cmd += " " + $lorenz_beta; $cmd += " " + $lorenz_width + "\"] [-100 100 -100 100 -100 100]"; print($cmd + "\n"); RiArchiveRecord("structure", $cmd); // Make the proxy object inactive RiAttribute "visibility" "int camera" 0; RiAttribute "visibility" "int indirect" 0; RiAttribute "visibility" "int transmission" 0; } //__________________________________________________________ // A utility to create a rib path for an archive to be saved // in the project directories "data" folder. global proc string getArchivePath(string $nodename) { string $projpath = `workspace -q -rootDirectory`; string $datapath = $projpath + "data/"; string $scenename = `file -q -sceneName -shortName`; int $frame = `currentTime -q`; string $fstr = "0" + $frame; if($frame < 10) $fstr = "000" + $frame; else if($frame < 100) $fstr = "00" + $frame; $ribpath = $datapath + $nodename + "." + $fstr + ".rib"; return $ribpath; }
#!/usr/bin/env python # See Templates->Python->aHelper.py for a more efficient way # of generating geometry for prman. # Malcolm Kesson: March 4th 2017 import sys def halvorsen(num, alpha): x0 = -5.0 y0 = 0.0 z0 = 0.0 pnts = [] for i in range(num): x1 = (-alpha * x0) - (4 * y0) - (4 * z0) - (y0 * y0) y1 = (-alpha * y0) - (4 * z0) - (4 * x0) - (z0 * z0) z1 = (-alpha * z0) - (4 * x0) - (4 * y0) - (x0 * x0) x0 += x1 * 0.004 y0 += y1 * 0.004 z0 += z1 * 0.004 pnt = [x0,y0,z0] pnts.append(pnt) return pnts args = sys.stdin.readline() if args: arg = args.split() pixels = float(arg[0]) num = int(arg[1]) alpha = float(arg[2]) width = float(arg[3]) pnts = halvorsen(num, alpha) print('Attribute "dice" "int roundcurve" [1]\n') print('Basis "catmull-rom" 1 "catmull-rom" 1\n') print('Curves "cubic" [%d] "nonperiodic" "P" [\n' % num) for x,y,z in pnts: print('%1.3f %1.3f %1.3f\n' % (x,y,z)) print('] "constantwidth" [%1.3f]\n' % width) sys.stdout.write('\377') sys.stdout.flush() # wait for the next set of inputs args = sys.stdin.readline()
rman "-version 1" { Declare param {int halvorsen_num} { label "Number of CVs" subtype slider range {4 10000 100} description "No description." } Declare param {float halvorsen_alpha} { label "Alpha" subtype slider range {1.4 1.5} description "No description." } Declare param {float halvorsen_width} { label "Curve Width" subtype slider range {0 3} description "No description." } # The Collection and NodeOptions blocks enable a Pre-Shape MEL script # to be assigned to "RenderMan Controls->Geometric Settings" panel. Collection halvorsen_OptionalGeometricSettings { param halvorsen_num { default 4 state optional } param halvorsen_alpha { default 0 state optional } param halvorsen_width { default 0 state optional } } NodeOptions {kGeometric kParticle} { reference Collection optionalGeometricSettings reference Collection halvorsen_OptionalGeometricSettings } }
// Generated by Cutter v7.7.8 at 7:6:56 on the 5.22.2017. // The source document on which this mel script is based is, // "C:/Users/jmken/Documents/maya/projects/RfM_mel/halvorsen.rman" // Cutter software by Malcolm Kesson (all rights reserved). // // Pre Shape User Interface (UI) Mel Script // global proc halvorsenUI() { string $selected[] = `ls -sl`; int $i; for($i = 0; $i < size($selected); $i++ ) { string $shp[] = `listRelatives -shapes $selected[$i]`; // To add the UI implemented by this proc to the "Geometric // Settings" panel use the following mel commands, // select rmanSettings; // halvorsenUI; // where "rmanSettings" might be rmanSettings1, rmanSettings2 etc. if(`nodeType $selected[$i]` == "RenderMan") $shp[0] = $selected[$i]; string $shapeName = $shp[0]; string $attr = `rmanGetAttrName "preShapeScript"`; // "Connect" to the mel script that calls // Pixar's custom Ri mel procedures. rmanAddAttr $shapeName $attr "halvorsenRI"; $attr = `rmanGetAttrName "halvorsen_num"`; rmanAddAttr $shapeName $attr "30000"; $attr = `rmanGetAttrName "halvorsen_alpha"`; rmanAddAttr $shapeName $attr "1.4"; $attr = `rmanGetAttrName "halvorsen_width"`; rmanAddAttr $shapeName $attr "0.2"; } }
// Generated by Cutter v7.7.8 at 7:7:54 on the 5.22.2017. // The source document on which this mel script is based is, // "/home/jkengl20/mount/stuhome/maya/projects/RfM_mel/halvorsen.rman" // Cutter software by Malcolm Kesson (all rights reserved). // // Pre Shape Mel Script // global proc halvorsenRI() { // Get the name of the shape node string $shapeNode = `rman ctxGetObject`; string $parents[] = `listRelatives -parent $shapeNode`; string $tformNode = $parents[0]; // The node may hava a number in its name that we can use // to set the random number generator int $nodeNumber = `match "[0-9]+" $shapeNode`; if($nodeNumber != "") { seed(int($nodeNumber)); } // Bounding box... float $bb_width = `getAttr ($shapeNode + ".boundingBoxSizeX")`; float $bb_height = `getAttr ($shapeNode + ".boundingBoxSizeY")`; float $bb_depth = `getAttr ($shapeNode + ".boundingBoxSizeZ")`; string $attr; $attr = `rmanGetAttrName "halvorsen_num"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; int $halvorsen_num = `getAttr $attr`; $attr = `rmanGetAttrName "halvorsen_alpha"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $halvorsen_alpha = `getAttr $attr`; $attr = `rmanGetAttrName "halvorsen_width"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $halvorsen_width = `getAttr $attr`; // Use of Pixar's custom RenderMan Studio procedures begins here. string $cmd; if(`about -win64`) $cmd = "\nProcedural \"RunProgram\" [\"python C:/Users/jmken/Documents/maya/scripts/halvorsen_helper.py\" "; else $cmd = "\nProcedural \"RunProgram\" [\"/home/jkengl20/mount/stuhome/maya/scripts/halvorsen_helper.py\" "; $cmd += "\" " + $halvorsen_num; $cmd += " " + $halvorsen_alpha; $cmd += " " + $halvorsen_width + "\"] [-100 100 -100 100 -100 100]"; print($cmd + "\n"); RiArchiveRecord("structure", $cmd); // Make the proxy object inactive RiAttribute "visibility" "int camera" 0; RiAttribute "visibility" "int indirect" 0; RiAttribute "visibility" "int transmission" 0; } //__________________________________________________________ // A utility to create a rib path for an archive to be saved // in the project directories "data" folder. global proc string getArchivePath(string $nodename) { string $projpath = `workspace -q -rootDirectory`; string $datapath = $projpath + "data/"; string $scenename = `file -q -sceneName -shortName`; int $frame = `currentTime -q`; string $fstr = "0" + $frame; if($frame < 10) $fstr = "000" + $frame; else if($frame < 100) $fstr = "00" + $frame; $ribpath = $datapath + $nodename + "." + $fstr + ".rib"; return $ribpath; }
#!/usr/bin/env python # See Templates->Python->aHelper.py for a more efficient way # of generating geometry for prman. # Malcolm Kesson: March 4th 2017 import sys def rossler(num, alpha, beta, sigma): x0 = 1.0 y0 = 1.0 z0 = 1.0 pnts = [] for i in range(num): x1 = -(y0 + z0) y1 = x0 + alpha * y0 z1 = beta + (x0 * z0) - (sigma * z0) x0 += x1 * .01 y0 += y1 * .01 z0 += z1 * .01 pnt = [x0,y0,z0] pnts.append(pnt) return pnts args = sys.stdin.readline() if args: arg = args.split() pixels = float(arg[0]) num = int(arg[1]) alpha = float(arg[2]) beta = float(arg[3]) sigma = float(arg[4]) width = float(arg[5]) pnts = rossler(num, alpha, beta, sigma) print('Attribute "dice" "int roundcurve" [1]\n') print('Basis "catmull-rom" 1 "catmull-rom" 1\n') print('Curves "cubic" [%d] "nonperiodic" "P" [\n' % num) for x,y,z in pnts: print('%1.3f %1.3f %1.3f\n' % (x,y,z)) print('] "constantwidth" [%1.3f]\n' % width) sys.stdout.write('\377') sys.stdout.flush() # wait for the next set of inputs args = sys.stdin.readline()
rman "-version 1" { Declare param {int rossler_num} { label "Number of CVs" subtype slider range {4 10000 100} description "No description." } Declare param {float rossler_alpha} { label "Alpha" subtype slider range {0 10} description "No description." } Declare param {float rossler_beta} { label "Beta" subtype slider range {0 10} description "No description." } Declare param {float rossler_sigma} { label "Sigma" subtype slider range {0 20} description "No description." } Declare param {float rossler_width} { label "Curve Width" subtype slider range {0 3} description "No description." } # The Collection and NodeOptions blocks enable a Pre-Shape MEL script # to be assigned to "RenderMan Controls->Geometric Settings" panel. Collection rossler_OptionalGeometricSettings { param rossler_num { default 4 state optional } param rossler_alpha { default 0 state optional } param rossler_beta { default 0 state optional } param rossler_sigma { default 0 state optional } param rossler_width { default 0 state optional } } NodeOptions {kGeometric kParticle} { reference Collection optionalGeometricSettings reference Collection rossler_OptionalGeometricSettings } }
// Generated by Cutter v7.7.8 at 6:56:14 on the 5.22.2017. // The source document on which this mel script is based is, // "C:/Users/jmken/Documents/maya/projects/RfM_mel/rossler.rman" // Cutter software by Malcolm Kesson (all rights reserved). // // Pre Shape User Interface (UI) Mel Script // global proc rosslerUI() { string $selected[] = `ls -sl`; int $i; for($i = 0; $i < size($selected); $i++ ) { string $shp[] = `listRelatives -shapes $selected[$i]`; // To add the UI implemented by this proc to the "Geometric // Settings" panel use the following mel commands, // select rmanSettings; // rosslerUI; // where "rmanSettings" might be rmanSettings1, rmanSettings2 etc. if(`nodeType $selected[$i]` == "RenderMan") $shp[0] = $selected[$i]; string $shapeName = $shp[0]; string $attr = `rmanGetAttrName "preShapeScript"`; // "Connect" to the mel script that calls // Pixar's custom Ri mel procedures. rmanAddAttr $shapeName $attr "rosslerRI"; $attr = `rmanGetAttrName "rossler_num"`; rmanAddAttr $shapeName $attr "8000"; $attr = `rmanGetAttrName "rossler_alpha"`; rmanAddAttr $shapeName $attr "0.2"; $attr = `rmanGetAttrName "rossler_beta"`; rmanAddAttr $shapeName $attr "0.2"; $attr = `rmanGetAttrName "rossler_sigma"`; rmanAddAttr $shapeName $attr "5.7"; $attr = `rmanGetAttrName "rossler_width"`; rmanAddAttr $shapeName $attr "0.2"; } }
// Generated by Cutter v7.7.8 at 6:57:52 on the 5.22.2017. // The source document on which this mel script is based is, // "/home/jkengl20/mount/stuhome/maya/projects/RfM_mel/rossler.rman" // Cutter software by Malcolm Kesson (all rights reserved). // // Pre Shape Mel Script // global proc rosslerRI() { // Get the name of the shape node string $shapeNode = `rman ctxGetObject`; string $parents[] = `listRelatives -parent $shapeNode`; string $tformNode = $parents[0]; // The node may hava a number in its name that we can use // to set the random number generator int $nodeNumber = `match "[0-9]+" $shapeNode`; if($nodeNumber != "") { seed(int($nodeNumber)); } // Bounding box... float $bb_width = `getAttr ($shapeNode + ".boundingBoxSizeX")`; float $bb_height = `getAttr ($shapeNode + ".boundingBoxSizeY")`; float $bb_depth = `getAttr ($shapeNode + ".boundingBoxSizeZ")`; string $attr; $attr = `rmanGetAttrName "rossler_num"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; int $rossler_num = `getAttr $attr`; $attr = `rmanGetAttrName "rossler_alpha"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $rossler_alpha = `getAttr $attr`; $attr = `rmanGetAttrName "rossler_beta"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $rossler_beta = `getAttr $attr`; $attr = `rmanGetAttrName "rossler_sigma"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $rossler_sigma = `getAttr $attr`; $attr = `rmanGetAttrName "rossler_width"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $rossler_width = `getAttr $attr`; // Use of Pixar's custom RenderMan Studio procedures begins here. string $cmd; if(`about -win64`) $cmd = "\nProcedural \"RunProgram\" [\"python C:/Users/jmken/Documents/maya/scripts/rossler_helper.py\" "; else $cmd = "\nProcedural \"RunProgram\" [\"/home/jkengl20/mount/stuhome/maya/scripts/rossler_helper.py\" "; $cmd += "\" " + $rossler_num; $cmd += " " + $rossler_alpha; $cmd += " " + $rossler_beta; $cmd += " " + $rossler_sigma; $cmd += " " + $rossler_width + "\"] [-100 100 -100 100 -100 100]"; print($cmd + "\n"); RiArchiveRecord("structure", $cmd); // Make the proxy object inactive RiAttribute "visibility" "int camera" 0; RiAttribute "visibility" "int indirect" 0; RiAttribute "visibility" "int transmission" 0; } //__________________________________________________________ // A utility to create a rib path for an archive to be saved // in the project directories "data" folder. global proc string getArchivePath(string $nodename) { string $projpath = `workspace -q -rootDirectory`; string $datapath = $projpath + "data/"; string $scenename = `file -q -sceneName -shortName`; int $frame = `currentTime -q`; string $fstr = "0" + $frame; if($frame < 10) $fstr = "000" + $frame; else if($frame < 100) $fstr = "00" + $frame; $ribpath = $datapath + $nodename + "." + $fstr + ".rib"; return $ribpath; }
#!/usr/bin/env python # See Templates->Python->aHelper.py for a more efficient way # of generating geometry for prman. # Malcolm Kesson: March 4th 2017 import sys def aizawa(num, alpha, beta, delta, epsilon, zeta, gamma): x0 = 0.1 y0 = 0.0 z0 = 0.0 pnts = [] for i in range(num): x1 = (z0 - beta) * x0 - (delta * y0) y1 = (delta * x0) + ((z0 - beta) * y0) z1 = gamma + (alpha * z0) - ((z0 * z0 * z0) / 3) - (((x0 * x0) + (y0 * y0)) * (1 + (epsilon * z0))) + ((zeta * z0 * (x0 * x0 * x0))) x0 += x1 * 0.01 y0 += y1 * 0.01 z0 += z1 * 0.01 pnt = [x0,y0,z0] pnts.append(pnt) return pnts args = sys.stdin.readline() if args: arg = args.split() pixels = float(arg[0]) num = int(arg[1]) alpha = float(arg[2]) beta = float(arg[3]) delta = float(arg[4]) epsilon = float(arg[5]) zeta = float(arg[6]) gamma = float(arg[7]) width = float(arg[8]) pnts = aizawa(num, alpha, beta, delta, epsilon, zeta, gamma) print('Attribute "dice" "int roundcurve" [1]\n') print('Basis "catmull-rom" 1 "catmull-rom" 1\n') print('Curves "cubic" [%d] "nonperiodic" "P" [\n' % num) for x,y,z in pnts: print('%1.3f %1.3f %1.3f\n' % (x,y,z)) print('] "constantwidth" [%1.3f]\n' % width) sys.stdout.write('\377') sys.stdout.flush() # wait for the next set of inputs args = sys.stdin.readline()
rman "-version 1" { Declare param {int aizawa_num} { label "Number of CVs" subtype slider range {4 10000 100} description "No description." } Declare param {float aizawa_alpha} { label "Alpha" subtype slider range {0 10} description "No description." } Declare param {float aizawa_beta} { label "Beta" subtype slider range {0 10} description "No description." } Declare param {float aizawa_delta} { label "Delta" subtype slider range {0 20} description "No description." } Declare param {float aizawa_epsilon} { label "Epsilon" subtype slider range {0 10} description "No description." } Declare param {float aizawa_zeta} { label "Zeta" subtype slider range {0 10} description "No description." } Declare param {float aizawa_gamma} { label "Gamma" subtype slider range {0 10} description "No description." } Declare param {float aizawa_width} { label "Curve Width" subtype slider range {0 3} description "No description." } # The Collection and NodeOptions blocks enable a Pre-Shape MEL script # to be assigned to "RenderMan Controls->Geometric Settings" panel. Collection aizawa_OptionalGeometricSettings { param aizawa_num { default 4 state optional } param aizawa_alpha { default 0 state optional } param aizawa_beta { default 0 state optional } param aizawa_delta { default 0 state optional } param aizawa_epsilon { default 0 state optional } param aizawa_zeta { default 0 state optional } param aizawa_gamma { default 0 state optional } param aizawa_width { default 0 state optional } } NodeOptions {kGeometric kParticle} { reference Collection optionalGeometricSettings reference Collection aizawa_OptionalGeometricSettings } }
// Generated by Cutter v7.7.8 at 7:22:42 on the 5.22.2017. // The source document on which this mel script is based is, // "C:/Users/jmken/Documents/maya/projects/RfM_mel/aizawa.rman" // Cutter software by Malcolm Kesson (all rights reserved). // // Pre Shape User Interface (UI) Mel Script // global proc aizawaUI() { string $selected[] = `ls -sl`; int $i; for($i = 0; $i < size($selected); $i++ ) { string $shp[] = `listRelatives -shapes $selected[$i]`; // To add the UI implemented by this proc to the "Geometric // Settings" panel use the following mel commands, // select rmanSettings; // aizawaUI; // where "rmanSettings" might be rmanSettings1, rmanSettings2 etc. if(`nodeType $selected[$i]` == "RenderMan") $shp[0] = $selected[$i]; string $shapeName = $shp[0]; string $attr = `rmanGetAttrName "preShapeScript"`; // "Connect" to the mel script that calls // Pixar's custom Ri mel procedures. rmanAddAttr $shapeName $attr "aizawaRI"; $attr = `rmanGetAttrName "aizawa_num"`; rmanAddAttr $shapeName $attr "30000"; $attr = `rmanGetAttrName "aizawa_alpha"`; rmanAddAttr $shapeName $attr "0.95"; $attr = `rmanGetAttrName "aizawa_beta"`; rmanAddAttr $shapeName $attr "0.7"; $attr = `rmanGetAttrName "aizawa_delta"`; rmanAddAttr $shapeName $attr "3.5"; $attr = `rmanGetAttrName "aizawa_epsilon"`; rmanAddAttr $shapeName $attr "0.25"; $attr = `rmanGetAttrName "aizawa_zeta"`; rmanAddAttr $shapeName $attr "0.1"; $attr = `rmanGetAttrName "aizawa_gamma"`; rmanAddAttr $shapeName $attr "0.6"; $attr = `rmanGetAttrName "aizawa_width"`; rmanAddAttr $shapeName $attr "0.2"; } }
// Generated by Cutter v7.7.8 at 7:23:48 on the 5.22.2017. // The source document on which this mel script is based is, // "/home/jkengl20/mount/stuhome/maya/projects/RfM_mel/aizawa.rman" // Cutter software by Malcolm Kesson (all rights reserved). // // Pre Shape Mel Script // global proc aizawaRI() { // Get the name of the shape node string $shapeNode = `rman ctxGetObject`; string $parents[] = `listRelatives -parent $shapeNode`; string $tformNode = $parents[0]; // The node may hava a number in its name that we can use // to set the random number generator int $nodeNumber = `match "[0-9]+" $shapeNode`; if($nodeNumber != "") { seed(int($nodeNumber)); } // Bounding box... float $bb_width = `getAttr ($shapeNode + ".boundingBoxSizeX")`; float $bb_height = `getAttr ($shapeNode + ".boundingBoxSizeY")`; float $bb_depth = `getAttr ($shapeNode + ".boundingBoxSizeZ")`; string $attr; $attr = `rmanGetAttrName "aizawa_num"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; int $aizawa_num = `getAttr $attr`; $attr = `rmanGetAttrName "aizawa_alpha"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $aizawa_alpha = `getAttr $attr`; $attr = `rmanGetAttrName "aizawa_beta"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $aizawa_beta = `getAttr $attr`; $attr = `rmanGetAttrName "aizawa_delta"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $aizawa_delta = `getAttr $attr`; $attr = `rmanGetAttrName "aizawa_epsilon"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $aizawa_epsilon = `getAttr $attr`; $attr = `rmanGetAttrName "aizawa_zeta"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $aizawa_zeta = `getAttr $attr`; $attr = `rmanGetAttrName "aizawa_gamma"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $aizawa_gamma = `getAttr $attr`; $attr = `rmanGetAttrName "aizawa_width"`; $attr = `rmanGetFullSharedGeometricAttrName $shapeNode $attr`; float $aizawa_width = `getAttr $attr`; // Use of Pixar's custom RenderMan Studio procedures begins here. string $cmd; if(`about -win64`) $cmd = "\nProcedural \"RunProgram\" [\"python C:/Users/jmken/Documents/maya/scripts/aizawa_helper.py\" "; else $cmd = "\nProcedural \"RunProgram\" [\"/home/jkengl20/mount/stuhome/maya/scripts/aizawa_helper.py\" "; $cmd += "\" " + $aizawa_num; $cmd += " " + $aizawa_alpha; $cmd += " " + $aizawa_beta; $cmd += " " + $aizawa_delta; $cmd += " " + $aizawa_epsilon; $cmd += " " + $aizawa_zeta; $cmd += " " + $aizawa_gamma; $cmd += " " + $aizawa_width + "\"] [-100 100 -100 100 -100 100]"; print($cmd + "\n"); RiArchiveRecord("structure", $cmd); // Make the proxy object inactive RiAttribute "visibility" "int camera" 0; RiAttribute "visibility" "int indirect" 0; RiAttribute "visibility" "int transmission" 0; } //__________________________________________________________ // A utility to create a rib path for an archive to be saved // in the project directories "data" folder. global proc string getArchivePath(string $nodename) { string $projpath = `workspace -q -rootDirectory`; string $datapath = $projpath + "data/"; string $scenename = `file -q -sceneName -shortName`; int $frame = `currentTime -q`; string $fstr = "0" + $frame; if($frame < 10) $fstr = "000" + $frame; else if($frame < 100) $fstr = "00" + $frame; $ribpath = $datapath + $nodename + "." + $fstr + ".rib"; return $ribpath; }