Difference between pages "ColorAtPointThruNurb" and "Color to RGB"

From scripting
(Difference between pages)
Jump to: navigation, search
(Created page with " global proc vector colorAtPointThruNurb(string $ObjName, float $UVal, float $VVal) { //Author Nick Pisca 0001d 2009 string $TRel[] = `listRelatives $ObjName`; string $TCon...")
 
(Created page with " Function Color_to_RGB(Color As Long) As Variant Dim CurRGB() As Integer ReDim CurRGB(2) CurRGB(0) = Color Mod 256 CurRGB(1) = (Color \ 256) Mod 256 CurRGB(2) = (Co...")
 
Line 1: Line 1:
  global proc vector colorAtPointThruNurb(string $ObjName, float $UVal, float $VVal) {
+
  Function Color_to_RGB(Color As Long) As Variant
  //Author Nick Pisca 0001d 2009
+
  Dim CurRGB() As Integer
  string $TRel[] = `listRelatives $ObjName`;
+
  ReDim CurRGB(2)
string $TCon[] = `listConnections $TRel[0]`;
+
  CurRGB(0) = Color Mod 256
string $TB[] = `listHistory $TCon[0]`;
+
  CurRGB(1) = (Color \ 256) Mod 256
string $TBOutput = $TB[2];
+
  CurRGB(2) = (Color \ 256 \ 256) Mod 256
float $CAPArr[2] = `colorAtPoint -o RGB -u $UVal -v $VVal $TBOutput`;
+
  Color_to_RGB = CurRGB
  vector $CAPVec = <<$CAPArr[0], $CAPArr[1], $CAPArr[2]>>;
+
  End Function
return $CAPVec;
 
  }
 
  
  
  
''More information on navigating shader nodes, read pages 133-134 in [http://stores.lulu.com/nickpisca YSYT]. 
+
[[Category:CATIA DP VB]]
[[Category:MEL]]
 

Latest revision as of 05:16, 22 April 2017

Function Color_to_RGB(Color As Long) As Variant
Dim CurRGB() As Integer
ReDim CurRGB(2)
  CurRGB(0) = Color Mod 256
  CurRGB(1) = (Color \ 256) Mod 256
  CurRGB(2) = (Color \ 256 \ 256) Mod 256
Color_to_RGB = CurRGB
End Function