Forum: Poser 12


Subject: Rotation when using an HDR bitmap on the background node

Y-Phil opened this issue on May 02, 2021 ยท 13 posts


Y-Phil posted Mon, 03 May 2021 at 6:18 AM

Small update: this version displays the current value:

def set_background_angle(angle):
  bk_shader = poser.Scene().BackgroundShaderTree()

  for node in bk_shader.Nodes():
    if node.Type() == 'ccl_Mapping':
          node.InputByInternalName('Rotation').SetColor(0.0, angle, 0.0)

  bk_shader.UpdatePreview()
  
def get_background_angle():
  bk_shader = poser.Scene().BackgroundShaderTree()
  node = [n for n in bk_shader.Nodes() if n.Type() == 'ccl_Mapping']
  if not node:
    return None

  values = node[0].InputByInternalName('Rotation').Value()
  return values[1] if isinstance(values, tuple) else None

    
msg = "Enter the Vertical Rotation (rad)"
curr_val = get_background_angle()
if curr_val:
    msg = "{}nActually: {}".format(msg, curr_val)

val = poser.DialogSimple.AskFloat(msg)
if val != None:
    set_background_angle(val)

Actually, the Poser function asks for a float. To be able to respond to hborre's query, I will search, at the end of may day job, for a function that let us enter a string of characters, instead... ?

๐’ซ๐’ฝ๐“Ž๐“


(ใฃโ—”โ—กโ—”)ใฃ

๐Ÿ‘ฟ Win11 on i9-13900K@5GHz, 64GB, RoG Strix B760F Gamng, Asus Tuf Gaming RTX 4070 OC Edition, 1 TB SSD, 6+4+8TB HD
๐Ÿ‘ฟ Mac Mini M2, Sequoia 15.2, 16GB, 500GB SSD
๐Ÿ‘ฟ Nas 10TB
๐Ÿ‘ฟ Poser 13 and soon 14 โค๏ธ