Jump to content

Where to put the 123.py file?


magneto

Recommended Posts

I am reading this page, but it seems unclear where to put 123.py file. I looked at the HOUDINI_PATH using the command line tools, but it says "not defined".

HOME shows "C:/Users/Username/Documents", but I only have My Documents there, not Documents.

When I put it inside "C:\Users\Pusat\Documents\houdini11.0\scripts"

then at the startup, it complains there are no desktops.

Any ideas on this?

Thanks.

Link to comment
Share on other sites

If I put it in the last path in my first post, I get this error:

Error running Python code:
Traceback (most recent call last):
  File "C:/Users/vfx/Documents/houdini11.0/scripts/123.py", line 1, in <module>
    desktop = hou.ui.curDesktop()
  File "C:/PROGRA~1/SIDEEF~1/HOUDIN~1.733/houdini/python2.6libs\hou.py", line 27049, in curDesktop
    return _hou.ui_curDesktop(*args)
NotAvailable: Not available in this context.
No desktops are available

The scripts is this:

desktop = hou.ui.curDesktop()
desktop.floatingPanels()[0].setIsFullscreen(False)
desktop.floatingPanels()[0].setIsFullscreen(True)

print "LOADED"

Link to comment
Share on other sites

Thanks, the error sounds like it's not about not being able to find the right modules but that it's too early in the execution stage to ask for UI when the UI is not initialized yet. That's my guess, but if that's the case, how would I do this otherwise?

Or is this folder wrong that it's actually trying to load everything there at startup, even before the UI is up? Maybe the right folder for 123.py only loads it at the right time?

I am not sure but if anyone using these files can comment, I would really appreciate it.

Link to comment
Share on other sites

I'm not sure what you are trying to do, but if you type houdini -h from the command line you get this, at least in linux, not sure if it's avail on windows

-h: output this usage message

-f: force the use of asset definitions in OTL files on the command line

-j: set maximum processors to nproc

-s: specify starting desktop by name

-n: start up in Never cook mode

-foreground: starts process in foreground

-geometry: specify window width, height and x and y offsets

It could be that you need to set your desktop first, then grab the current desktop. To the best of my knowledge where the 123 files lives doesn't determine when it is initialized, although any additional 123. files will overrule previous ones, so if you have multiple paths, whatever is the last 123. file is the one that 'sticks'

Link to comment
Share on other sites

Thanks for replying. I will try that at home but what I am trying to do is from my current desktop, set the fullscreen to false for my only floating window, and then back on.

If I don't do this, then the floating window appears fullscreen on top of my main window where turning the fullscreen by hand is tricky because both windows flicker since they are overlapped. But when I set the fullscreen to false, then the floating window appears on my second monitor which is what I want. Then I set it to fullscreen so that the title bar, etc is hidden.

I can try setting the desktop in the first line but not sure if that's gonna fix it.

Btw I get this error as soon as the splash screen comes up, so I don't even see the UI yet, and then nothing happens after the error.

Link to comment
Share on other sites

I can try setting the desktop in the first line but not sure if that's gonna fix it.

I'm not sure if you get my meaning. I don't mean set the desktop to some variable in Python but to litterally tell Houdini what desktop to open in, I don't remember off hand but I think the syntax is

DESK_SET = desktop name

this would be the first line in the 123 but I think that it needs to be in .cmd, not .py but maybe there is an equivelent in python...dunno.... But try explicityly chagning the desktop, then call ui.curDesktop()

Link to comment
Share on other sites

I'm not sure if you get my meaning. I don't mean set the desktop to some variable in Python but to litterally tell Houdini what desktop to open in, I don't remember off hand but I think the syntax is

DESK_SET = desktop name

this would be the first line in the 123 but I think that it needs to be in .cmd, not .py but maybe there is an equivelent in python...dunno.... But try explicityly chagning the desktop, then call ui.curDesktop()

That's what I understood as well. I was gonna try it yesterday but my second lcd has a problem. Will try to do it soon.

But I know how to set the desktop from python.

Link to comment
Share on other sites

  • 2 weeks later...

3dbeing, I tried what you said last night and it seems to work. Couldn't spend much time but from what I saw, the programmatic way of setting a floating panel full screen off and then on, seems to behave differently than doing it by hand.

So I will make a new desktop without the floating panel, set this desktop to current and create the floating panel on the fly. Hopefully this should work.

Edited by magneto
Link to comment
Share on other sites

Ok so I got it working, although I had to mess around the desktop inside Houdini for a while because otherwise the floating window wasn't popping up in the second window as I was seeing before.

2 more problems I have seen though. If I can't get them working, that's ok because they are not deal breakers.

1. When I set the desktop to my own desktop in a 456.py file to affect the file post-open to use my desktop, it somehow closes my floating panel. In my 456.py, I only use:

desktop.setAsCurrent()

so it shouldn't be me. Although if I don't use this file (what I do now), and after opening the file, set the desktop by hand, it works.

2. This is actually interesting. I have my floating window in my second monitor. Then I thought why not have another floating panel that contains the rest of the items in the actual Houdini window. Do you guys think it's bizarre? Doing so actually saves the titlebar and start menu taskbar space. Also make the whole app kind of a full desktop suite like app that is fullscreen 100%.

This seems to work but there are some issues. After moving the playbar into this new floating window, I get this error:

"::addPlaybar p 000000001175E7D0 myPlaybar 0000000000000000"

Any ideas on this?

Also there are some UI drawing issues, i.e. flickers, etc. Not sure if it's because of this.

This kind of setup would actually be pretty awesome IMO.

Also I found a bug with the hou.Desktop.createFloatingPanel function where passing a negative screen coordinate doesn't work. It clips at 0. Since my second monitor is on my left, this doesn't work.

Do you guys think I should change my setup so it's:

[LCD 1] [LCD 2]

instead of:

[LCD 2] [LCD 1]

?

Either way I am using LCD 1 as the main monitor. I want to do some other tests to see what other effects I could see, so I could report back. I am sure this would be useful for people who want to ultimate Houdini experience :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...