ragnoru

ragnoru

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

456.py and hou.qt.mainWindow() returns None when Houdini first starts June 6, 2017, 5:53 p.m.

HI,
we have a pyside window that we want to parent to the hou.qt.mainWindow(), like in the docs I am doing something along these lines
from hutil.Qt import QtCore
dialog = MyDialog()
print (hou.qt.mainWindow()) #this returns None on first houdini start so no parenting happens
dialog.setParent(hou.qt.mainWindow(), QtCore.Qt.Window)
dialog.show()

So the question is
How to create a PySide window that is parented to the hou.qt.mainWindow() on start up?

Houdini 16 on Windows 7, Python Ctype not returning expected value June 6, 2017, 12:37 p.m.

Thank you for the answer, I ended up just calling a command line that is compatible with windows7 and windows10
import subprocess
cmd = ['Whoami', '/FQDN']
process = subprocess.Popen(cmd,stdout=subprocess.PIPE, shell=True)
name = process.stdout.read().split(',')[0].split('CN=')[-1]

Cheers
Aldo

Houdini 16 on Windows 7, Python Ctype not returning expected value June 2, 2017, 8:21 p.m.

I am not sure if anybody has a fix for this but it looks like the following python code does not return anything, and specifically in
-houdini 16 windows 7
it seems to work fine in houdini 15 and windows 7, or houdini 16 in windows 10, where it returns the full user name of the person logged in.
Any help would be appreciated


import ctypes

def get_display_name():
    GetUserNameEx = ctypes.windll.secur32.GetUserNameExW
    NameDisplay = 3

    size = ctypes.pointer(ctypes.c_ulong(0))
    GetUserNameEx(NameDisplay, None, size)

    nameBuffer = ctypes.create_unicode_buffer(size.contents.value)
    GetUserNameEx(NameDisplay, nameBuffer, size)
    return nameBuffer.value

Thank you