HI
I know this topic has been touched on before but i'm still finding a few issues that if anyone can help out on it would help me loads.
1st issue:
Ok so i need to apply vray Nurbs Attributes to 1000's of surfaces, so i can use this script...
global proc vrayCreateNurbsAttributes(int $staticGeom, int $tesselationDepth, float $curvatureThreshold) {
string $selectedNodes[] = `selectedNodes`;
string $nurbsShapes[];
int $i, $j = 0;
for ($i = 0; $i < size($selectedNodes); $i++) {
string $shapes[] = `listRelatives -shapes $selectedNodes[$i]`;
for ($iShape = 0; $iShape < size($shapes); $iShape++) {
string $objType = `objectType $shapes[$iShape]`;
if ($objType == "nurbsSurface") {
$nurbsShapes[$j++] = $shapes[$iShape];
}
}
}
print($nurbsShapes);
print("\n");
for ($i = 0; $i < size($nurbsShapes); $i++) {
string $node = $nurbsShapes[$i];
if (!`attributeQuery -exists -node $node "vrayAsStaticGeom"`) {
addAttr -ln "vrayAsStaticGeom" -at "bool" -dv $staticGeom $node;
}
if (!`attributeQuery -exists -node $node "vrayMaxSubdivDepth"`) {
addAttr -ln "vrayMaxSubdivDepth" -at "long" -dv $tesselationDepth $node;
}
if (!`attributeQuery -exists -node $node "vrayFlatnessCoef"`) {
addAttr -ln "vrayFlatnessCoef" -at "float" -dv $curvatureThreshold $node;
}
}
}
and then to set attributes i might use this one...
vrayCreateNurbsAttributes(1, 30, 0.5);
(vrayCreateNurbsAttributes($staticGeom, $tesselationDepth, $curvatureThreshold);
Where $staticGeom shoudl be True/Faulse 1/0, $tesselationDepth = Max tessellation depth value and $curvatureThreshold = Curvature threshold value.)
THE problem now is that i cannot find a way of changing the attributes once they are set.
Does anyone know how i can set them to a higher quality for eg? like this...
vrayCreateNurbsAttributes(1, 30, 0.2);
2nd Issue
I have imported in a load of Nurbs data into a scene and used the import option name clash option to insert BB: before each surface name. It seems that Vray now doesn't recognise this as a Nurbs surface and so i can't apply the Vray Nurbs Attribute!!
I wish i had realised this earlier as i've done a load of prep work on this data already and don't really want to bin and re-import. If anyone knows how to rename 1000's of surfaces any help would save me some serious grief!!
thanks to anyone who can lend a hand..
cheers
I know this topic has been touched on before but i'm still finding a few issues that if anyone can help out on it would help me loads.
1st issue:
Ok so i need to apply vray Nurbs Attributes to 1000's of surfaces, so i can use this script...
global proc vrayCreateNurbsAttributes(int $staticGeom, int $tesselationDepth, float $curvatureThreshold) {
string $selectedNodes[] = `selectedNodes`;
string $nurbsShapes[];
int $i, $j = 0;
for ($i = 0; $i < size($selectedNodes); $i++) {
string $shapes[] = `listRelatives -shapes $selectedNodes[$i]`;
for ($iShape = 0; $iShape < size($shapes); $iShape++) {
string $objType = `objectType $shapes[$iShape]`;
if ($objType == "nurbsSurface") {
$nurbsShapes[$j++] = $shapes[$iShape];
}
}
}
print($nurbsShapes);
print("\n");
for ($i = 0; $i < size($nurbsShapes); $i++) {
string $node = $nurbsShapes[$i];
if (!`attributeQuery -exists -node $node "vrayAsStaticGeom"`) {
addAttr -ln "vrayAsStaticGeom" -at "bool" -dv $staticGeom $node;
}
if (!`attributeQuery -exists -node $node "vrayMaxSubdivDepth"`) {
addAttr -ln "vrayMaxSubdivDepth" -at "long" -dv $tesselationDepth $node;
}
if (!`attributeQuery -exists -node $node "vrayFlatnessCoef"`) {
addAttr -ln "vrayFlatnessCoef" -at "float" -dv $curvatureThreshold $node;
}
}
}
and then to set attributes i might use this one...
vrayCreateNurbsAttributes(1, 30, 0.5);
(vrayCreateNurbsAttributes($staticGeom, $tesselationDepth, $curvatureThreshold);
Where $staticGeom shoudl be True/Faulse 1/0, $tesselationDepth = Max tessellation depth value and $curvatureThreshold = Curvature threshold value.)
THE problem now is that i cannot find a way of changing the attributes once they are set.
Does anyone know how i can set them to a higher quality for eg? like this...
vrayCreateNurbsAttributes(1, 30, 0.2);
2nd Issue
I have imported in a load of Nurbs data into a scene and used the import option name clash option to insert BB: before each surface name. It seems that Vray now doesn't recognise this as a Nurbs surface and so i can't apply the Vray Nurbs Attribute!!
I wish i had realised this earlier as i've done a load of prep work on this data already and don't really want to bin and re-import. If anyone knows how to rename 1000's of surfaces any help would save me some serious grief!!
thanks to anyone who can lend a hand..
cheers
Comment