* Fix header menu spacing bug, and make it consistent for all headers.
* For consistency, always put menus first in the header, then any enums
to switch the type of data displayed.
* Node editor header ported to python layout. Still quite a few
operators missing to make the menus complete.
* RNA wrapped node editor, and added use_nodes property to material
and scene.
this works for the calling operators from python and using the RNA api.
bpy.ops.CONSOLE_exec() is now bpy.ops.console.exec()
eg.
split.itemO("PARTICLE_OT_editable_set", text="Free Edit") becomes... split.itemO("particle.editable_set", text="Free Edit")
For now any operator thats called checks if its missing _OT_ and assumes its python syntax and converts it before doing the lookup.
bpy.ops is a python class in release/ui/bpy_ops.py which does the fake submodules and conversion, the C operator api is at bpy.__ops__
personally Id still rather rename C id-names not to contain the _OT_ text which would avoid the conversion, its called a lot since the UI has to convert the operators.
* interactive console python console.
* display reports and filter types. defaults to operator display so you can see the python commands for tools as you use them,
eventually it should be possible to select commands and make macto/tools from them.
Example use of autocomp. b<tab>, bpy.<tab>, bpy.<tab>, bpy.data.<tab> etc.
basic instructions are printed when opening the console.
Details...
* Console exec and autocomp are done with operators written in python.
* added CTX_wm_reports() to get the global report list.
* The window manager had a report ListBase but reports have their own struct, switched to allocate and assign when initializing the WM since the type is not available in DNA.
* changed report types flags for easier display filtering.
* added report type RPT_OPERATOR
* logging operators also adds a python-syntax report into CTX_wm_reports() so they can be displayed in the console as well as calling a notifier for console to redraw.
* RnaAPI context.area.tag_redraw() to redraw the current area from a python operator.
Todo...
* better interactions with the console, scrolling, copy/paste.
* the text displayed doesnt load back.
* colors need to be themed.
* scroll limit needs to be a user pref.
* only tested with cmake and scons.
The autocomplete function is generic and could be made into its own module.
Examples:
b -> bpy
bpy.data.mes -> bpy.data.meshes
bpy.ops.OB -> bpy.ops.OBJECT_OT_
bpy.data.objects[0].a -> (options)
active_material, active_material_index, active_particle_system, active_particle_system_index, active_shape_key, active_shape_key_index, active_vertex_group, active_vertex_group_index, animation_data
Shift+Enter in the text editor executes the TEXT_OT_line_console operator defined in space_text.py
The operator's class stores a namespace for each text block.
Eventually this should have its own input rather then using the text editor.
Tested with py3.1 and 2.6
TEXT_OT_insert was only using the first char from a string, added support for inserting strings.
* Search popup + autocomplete for bones, vertex groups, etc. This
is done with layout.item_pointerR, specifying an RNA collection to
take the items from. Used by constraints and modifiers.
* Some tests with the List template, ignore those for now..
* Added SCROLL button type, use like a NUMSLI basically, with
a1 used to define the scroller size.
* Add scroll and toggle colors to the Theme (toggle was set to
draw like radio in a recent commit, but it's the intention
these look different).
* Added rudimentary list template, used for object material
slots, this is WIP though.
* In popup menu, split text with line breaks over multiple
lines, makes python errors display slightly nicer.
* layout.split() now takes a percentage argument to control
the split position.
* ID template now works for more than just the Text ID type,
includes and icon, and some other fixes.
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
* Headers and menus can now be created in python.
* Replaced the uiMenuItem functions to create menus with equivalent
uiItem functions using a layout, removing duplicated code.
* More uiItem functions are now exposed to python.
* The text editor header, panels and one of its menus are now created
in space_text.py.
* Buttons window data context icon new changes depending on active
object.
Issues
* Icons are not wrapped yet, hardcoded ints at the moment.
* The ID browse template is unfinished.