Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not able to find scenegraph_rc #1

Open
maurizio1974 opened this issue Feb 16, 2017 · 8 comments
Open

not able to find scenegraph_rc #1

maurizio1974 opened this issue Feb 16, 2017 · 8 comments

Comments

@maurizio1974
Copy link

Hi

First of all thank you for the projects, I have always wanted to learn how to do a graph in pyside.
i am trying to lauch the code in standalone and after compiling the ui with pysideuic and execute it
it tells me that it cannot find the procedure screnegraph_rc which after a small digging I found is at the end of the code of the copiled ui file.
Can you help me making this work ?

Thnak you in advance.
M.

@mfessenden
Copy link
Owner

You could try changing the import statement to this:

from SceneGraph.icn import scenegraph_rc

@maurizio1974
Copy link
Author

sorry too keep bother , but is that something that is on the ui file ?
if so how would I go about to changing it on the ui file, cause I can't find any of those lines there.

thx

@mfessenden
Copy link
Owner

The scenegraph_rc.py module is a compiled version of the scenegraph.qrc resource, which contains all of the icons used by the application.

The ui files here are compiled on the fly with resources stored in a different directory, if you're looking to compile your own interfaces, I'd suggest starting with one that's saved with the icons and arc in the same directory.

@maurizio1974
Copy link
Author

I am no where near been able to do my own thing, I am trying to learn from you.
I just couldn't find the scenegraph_rc.py anywhere and I am looking how to change the import cause it cannot find it.
So I simply don't know how to change it to your suggestion.
sorry if this is a stupid question , learning is a long process I guess

Thank for your help !

M.

@maurizio1974
Copy link
Author

Hi Michael

so I pased the rc issue I was having , thank you for the help, but now when I run this

from SceneGraph import scenegraph
sgui = scenegraph.SceneGraphUI()
sgui.show()

I get this

[SceneGraph]: INFO: initializing SceneGraph 0.69.0...
QWidget: Must construct a QApplication before a QPaintDevice
[Finished in 0.5s with exit code -6]

Thanks again for the help.
M

@mfessenden
Copy link
Owner

Where are you running this from??

You can't import a Qt UI unless you're running inside a Qt application (maya, nuke, etc). That's what the launch scripts in /bin are for.

@maurizio1974
Copy link
Author

I was running it from the python ide, I though that the first option was a standalone UI.
So followinf your suggestin I run it from maya and now it tells me that it cannot find the module logger even after that I specifically add that core path to the PYTHONPATH environment variable.

from SceneGraph import scenegraph

Error: ImportError: file /mnt/extra/code/SceneGraph/core/init.py line 2: cannot import name logger

any clue

sorry for my r-tardness :)

@mfessenden
Copy link
Owner

For maya, you'll need to import the maya wrapper:

from SceneGraph import scenegraph_maya
scenegraph_maya.main()

Be forewarned, if you're using the newest maya 2017, it won't work as is currently. Autodesk is using a new PySide version in the newest maya, so you'll need to do some reworking of the maya wrapper because the update broke a lot of things. I wish I had time to look at it right now, but feel free to fork it :)

For standalone, you'll use call one of the launchers in SceneGraph/bin: the SceneGraph.bat file for Windows, the SceneGraph for Linux/macOS. You'll probably want to symlink them to somewhere on your system PATH and make sure they've got executable permissions.

The reason it is setup this way is because you need to run the application in a parent QApplication. In standalone, we create a default one, in maya, nuke etc., SceneGraph piggybacks on those applications as they are also QApplications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants