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 Gaming, Asus Tuf Gaming RTX 4070 OC Edition, 1+2 TB SSD's, 6+4TB HD
πŸ‘Ώ Mac Mini M2, Tahoe 26.5, 16GB, 500GB SSD
πŸ‘Ώ Nas 10TB
πŸ‘Ώ Poser 13 and 14 β€οΈ

π‘€π“Ž π’’π’Άπ“π“π‘’π“‡π“Ž