4
$\begingroup$

I am trying to add a button on the tool panel for material which should open the material editor in a dialog box, which should be resizeable.

I can do the button but am having trouble creating the dialog box.

I tried to Do this by making duplicate window and dislplaying the properties editor in full screen but it takes up the whole screen.

I can make simple scripts in blender but don' know how to this.

Any help is much apreciated.

import bpy
from bpy.types import Header  

bpy.ops.wm.window_duplicate()  
bpy.ops.screen.screen_full_area()  
bpy.context.area.type='PROPERTIES'  
$\endgroup$

1 Answer 1

5
$\begingroup$

This is where terminology is important (area vs. window). Your current Blender window is full screen, so duplicating that window results in another full screen window. You might have better success if you try the bpy.ops.screen.area_dupli() operator and duplicate the area that contains the existing Properties Editor in your layout. The only caveat is that you need to first set that as your active area.

$\endgroup$
2
  • 2
    $\begingroup$ You can use a context override to avoid changing the active area! But I would actually try to find an existing area of a certain type first, and if there's none, duplicate the one with the largest area: pasteall.org/51468/python $\endgroup$
    – CodeManX
    Commented May 9, 2014 at 15:43
  • $\begingroup$ Huh, it worked. Now how can I switch to material screen if an object is selected and I press the button. $\endgroup$
    – user3424
    Commented May 10, 2014 at 15:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .