Unable to attach other windows into formLayout

34 views
Skip to first unread message

likage

unread,
Aug 12, 2014, 7:06:06 AM8/12/14
to python_in...@googlegroups.com
Hi all, pardon me if my thread title is misleading.
I was utterly lost in this code that I was doing as I am understanding how it works.

I used the same method with the Hypershade or hyperPanel and it works fine. But as I tried it along with graph editor, UV texture window etc. I keep getting the error:
#     (out_panel1, "right", 0)
# RuntimeError: Object '' not found. #

While executing it, the 'wrong' window was prompted instead of this custom ui i did.
Any ideas?

def ui():
    main_win
= cmds.window(win_name, title = "TEST", width = 600, height = 600)
    tab_win
= cmds.tabLayout()

    out_layout1
= cmds.formLayout("textureWin", parent = tab_win)
    out_panel1
= cmds.TextureViewWindow()    

    cmds
.formLayout(out_layout1, edit = True,
                    attachForm
=[
                       
(out_panel1, "top", 0),
                       
(out_panel1, "left", 0),
                       
(out_panel1, "bottom", 0),
                       
(out_panel1, "right", 0)


Justin Israel

unread,
Aug 12, 2014, 4:03:18 PM8/12/14
to python_in...@googlegroups.com
The cmds.TextureViewWindow() doesn't return anything. It only shows the singleton texture editor. The docs say only one can exist at any time:

This would mean that if you were to embed it into your own UI, it would steal from anywhere else that is showing it, and likewise if anywhere else wanted to show it, your UI would lose the widget.



--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/e5e0e044-ffd5-45e9-96ed-be3e73153240%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

likage

unread,
Aug 13, 2014, 10:07:34 PM8/13/14
to python_in...@googlegroups.com
HI, if that is the case, there are a few commands that I have tried like cmds.GraphEditor() however I am unable to find any documentation on it despite that I am able to run it in the script editor. Tried incorporating it into my code, same problem as listed in my first post.

So can I just assume that it is having the same description as this Texture Editor?

Justin Israel

unread,
Aug 13, 2014, 10:22:03 PM8/13/14
to python_in...@googlegroups.com
They aren't in the docs because they actually aren't part of the API proper:

whatIs GraphEditor;
// Result: Run Time Command // 
whatIs TextureViewWindow;
// Result: Run Time Command //




--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

likage

unread,
Aug 14, 2014, 2:19:07 AM8/14/14
to python_in...@googlegroups.com
I see.

Just one last question though, using my current code, is it possible to have a tab where users can create and saved in their custom commands into this ui of mine instead of having it in the shelf?

Justin Israel

unread,
Aug 14, 2014, 2:31:56 AM8/14/14
to python_in...@googlegroups.com
Sure. Your application can choose to store any kind of data it wants to, persistently, between launches. So if you want it to be able to store user commands, then you just have to decide where you are going to keep them. 


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

likage

unread,
Aug 14, 2014, 2:59:03 AM8/14/14
to python_in...@googlegroups.com
I remember that there is a time when I tried using shelfTabLayout (http://download.autodesk.com/us/maya/2011help/CommandsPython/shelfTabLayout.html), I wrote it in a similar fashion as the code above, however the changes would be integrating the shelfTabLayout into the code.

Not sure if I am making sense, basically, I wrote it separately, one for the shelfTabLayout and the other for the actual UI. I am unable to remember how I wrote, but there is a time where it kinda works but it is not storing the shelf icons I added in if I closed off my Maya session or the UI itself.

Then again, I am a bit stumped if I should add this into my UI, or should I add in other stuff? Currently I only have a viewport, outliner and hyperPanel in my UI



On Thursday, August 14, 2014 2:31:56 PM UTC+8, Justin Israel wrote:
Sure. Your application can choose to store any kind of data it wants to, persistently, between launches. So if you want it to be able to store user commands, then you just have to decide where you are going to keep them. 
On Thu, Aug 14, 2014 at 6:19 PM, likage <dissid...@gmail.com> wrote:
I see.

Just one last question though, using my current code, is it possible to have a tab where users can create and saved in their custom commands into this ui of mine instead of having it in the shelf?




On Thursday, August 14, 2014 10:22:03 AM UTC+8, Justin Israel wrote:
They aren't in the docs because they actually aren't part of the API proper:

whatIs GraphEditor;
// Result: Run Time Command // 
whatIs TextureViewWindow;
// Result: Run Time Command //




On Thu, Aug 14, 2014 at 2:07 PM, likage <dissid...@gmail.com> wrote:
HI, if that is the case, there are a few commands that I have tried like cmds.GraphEditor() however I am unable to find any documentation on it despite that I am able to run it in the script editor. Tried incorporating it into my code, same problem as listed in my first post.

So can I just assume that it is having the same description as this Texture Editor?



On Wednesday, August 13, 2014 4:03:18 AM UTC+8, Justin Israel wrote:
The cmds.TextureViewWindow() doesn't return anything. It only shows the singleton texture editor. The docs say only one can exist at any time:

This would mean that if you were to embed it into your own UI, it would steal from anywhere else that is showing it, and likewise if anywhere else wanted to show it, your UI would lose the widget.



On Tue, Aug 12, 2014 at 11:06 PM, likage <dissid...@gmail.com> wrote:




--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages