Ya if you just want to create new outliner panels using cmds.outlinerPanel, 
then it will give you the object name as a result of the call. 

On Sep 24, 2012, at 10:50 AM, Jesse Capper <[email protected]> wrote:

> I guess I was hoping to check that a newly created outliner was visible for 
> the off chance that there were multiple outliner panels that existed and I 
> wasn't sure which one was just made visible. Though since 
> cmds.OutlinerWindow() creates the main outliner I'm guessing that it will 
> always be there first item in the return value of 
> cmds.getPanel(typ='outlinerPanel').
> 
> It was more of a curiosity than not having a solution.
> 
> On Friday, September 21, 2012 4:54:27 PM UTC-7, Justin Israel wrote:
>> 
>> Is your goal just to get the name of the Outliner panel after you 
>> create it? The problem is that the window is probably being put into 
>> an event queue and not being shown until controls returns back again. 
>> You can tell because no matter how long you put a sleep in there, it 
>> will not show until the sleep is done. 
>> 
>> This works because it is not based on visibility. Just the fact that 
>> the object exists: 
>> 
>> cmds.OutlinerWindow() 
>> print cmds.getPanel(typ='outlinerPanel') 
>> 
>> 
>> On Fri, Sep 21, 2012 at 4:30 PM, Jesse Capper <[email protected]> wrote: 
>> > I was checking out a question someone had on tech-artists and came across 
>> > some behavior that I don't understand and hoped someone could enlighten 
>> > me. 
>> > With the outliner closed, if I run: 
>> > 
>> > cmds.OutlinerWindow() 
>> > print cmds.getPanel(vis=True) 
>> > 
>> > cmds.getPanel doesn't contain the newly visible outliner. If I call 
>> > OutlinerWindow() twice, and then getPanel: 
>> > 
>> > cmds.OutlinerWindow() 
>> > cmds.OutlinerWindow() 
>> > print cmds.getPanel(vis=True) 
>> > 
>> > cmds.getPanel will now contain the newly visible outliner. I tried using 
>> > time.sleep, but that didn't help. 
>> > If I execute cmds.OutlinerWindow() by itself and then execute 
>> > cmds.getPanel(vis=True), it will appear in the panel list. It's only when 
>> > they are executed together that it doesn't appear in the panel list. 
>> > 
>> > Anyone know why? Is there a better way to create the outliner? 
>> > 
>> > -- 
>> > view archives: http://groups.google.com/group/python_inside_maya 
>> > change your subscription settings: 
>> > http://groups.google.com/group/python_inside_maya/subscribe
> 
> -- 
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings: 
> http://groups.google.com/group/python_inside_maya/subscribe

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to