Forum: Poser - OFFICIAL


Subject: Nodes for Dummies

RobynsVeil opened this issue on Jan 24, 2009 · 490 posts


RobynsVeil posted Fri, 27 February 2009 at 3:27 PM

You're going to get so sick of me, Bill...

Following your example - double-checking to make sure I got it entered right, and commenting to keep it clear to myself what's actually going on here:

def makeSurface():
  s = Surface(1,0,0,0)
  s.Diffuse_Color = WHITE
  s.Specular_Color = WHITE
  
  # keeps diffuse_color from doing anything but just displaying in the pose room
  s.Diffuse_Value = Add(0,0)
  s.Highlight_Size = .02
  s.Bump = Sub(ImageMap(Image_Source = "HeaFaceB.jpg", Background = Turbulence(.05,.05,.05,8,0,.5,.15)),.5) *.03
  
  # --New Stuff! Bill's ....
  # Gamma-correction node
  gamma = Add(2.2).labelled("Gamma")
 
  # Placeholder for colorMap
  colorMap = ImageMap().labelled("Color Map")
 
  # Anti-gamma process
  linearColormap = colorMap ** gamma
 
  # Set up specular node
  spec = Blinn(1,.4,.4,.4)
  
  # Set up the Diffuse node, keep it from exceeding conservation of energy with Specular
  diff = Diffuse(linearColormap, .7 * (1 - spec)
 
 
  s.Alternate_Diffuse = (diff + spec) ** (1/gamma)
  
  return s
 
makeSurface()

I get a syntax error on that s.Alternate_Diffuse = (diff + spec) ** (1/gamma) line. The error reads:

----- MATMATIC COMPILER -----
verbose 1
Processing script C:Program Filese frontierPoser 7RuntimeLibrariesMaterials!RobynsveilScriptsVR2_005.mm1.txt -> material
MATMATIC Script Error: invalid syntax (VR2_005.mm1.txt, line 27)
Traceback (most recent call last):
  File "c:program filescurious labsposer 6runtimepythonmatmaticcompiler.py", line 233, in processScript
  File "C:Program Filese frontierPoser 7RuntimeLibrariesMaterials!RobynsveilScriptsVR2_005.mm1.txt", line 27
     s.Alternate_Diffuse = (diff + spec) ** (1/gamma)
     ^
 SyntaxError: invalid syntax
------ MATMATIC COMPILER DONE -----

I'm at a loss.

Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand] 

Metaphor of Chooks