Commit Graph

15 Commits

Author SHA1 Message Date
Campbell Barton
ade8f5197a Engine specific panel's
- All of this is in python and easy to change.
- each panel class has a set() of compatible engines.
- this set is checked for the poll function
- external engines can add themselves to this panels compatible engines
eg.
 buttons_world.WORLD_PT_mist.COMPAT_ENGINES.add('POVRAY_RENDER')

I tried doing this by subclassing each panel and replacing only the poll function to reference 'POVRAY_RENDER' but it became fairly complicated and meant registering many of the same panels under different names.

Added mist support to povray.
2009-07-30 08:10:10 +00:00
Campbell Barton
cacc5f782a - console remove doubles with command history
- povray file removal was uncommented
2009-07-29 00:37:37 +00:00
Thomas Dinges
b666f55e0e 2.5 Layout files:
* Removed __idname__ from all panels. 
Note: Operator classes still need that id. Don't remove it there.
2009-07-26 16:31:48 +00:00
Campbell Barton
a934773475 - console scrollback userpref
- copy coperator for the console (Ctrl+C and from the menu)
2009-07-26 04:31:46 +00:00
Campbell Barton
f7b90c0f41 - report header buttons were not drawing.
- shift+b in the console would do border zoom (rather then upper case B), fixed by making v2d's border zoom check if the v2d's zoom is locked.
- blender in debug mode registers all operators, useful for testing.
2009-07-24 23:07:18 +00:00
Campbell Barton
712298abd2 autocomplete wasn't working 2009-07-23 12:31:45 +00:00
Campbell Barton
e4b7997277 py console wasnt working since r21743 2009-07-21 15:52:15 +00:00
Brecht Van Lommel
1f4fa869e4 2.5: RNA & UI
* Revert lamp sampling/buffers change. The right enum items should
  be defined in RNA, not the layout, so that it works in outliner,
  python api too.
* Also changed type popup to radio buttons again, and removed the
  icons. This is more consistent, and I don't think it's a good idea
  to start using icons for these things, too much clutter.

* Replace Mesh with Normals panel in the mesh buttons.
* Remove Material panel from mesh buttons.
* Added name fields for shape/vgroup/vcol/uv.
* Spacing tweak to Object and Bone names.

* Fix some naming conflicts in RNA, with "name" and "type" properties
  being defined twice in the same struct.

* context.scene.tool_settings -> context.tool_settings.
2009-07-21 00:55:20 +00:00
Campbell Barton
d9a7e5144f Python operators
- simplified C operator API bpy.__ops__ since its wrapped by python now.
- needs the class to have an __idname__ rather then __name__ (like menus, headers)
- convert python names "console.exec" into blender names "CONSOLE_OT_exec" when registering (store the blender name as class.__idname_bl__, users scripters wont notice)
- bpy.props.props ???, removed
2009-07-19 13:32:02 +00:00
Campbell Barton
d7564761c0 operator macro playback (run operator reports in the console)
- reports can be selected with RMB, Border (bkey) and (de)select all.
- delete reports (X key)
- run operators in the console (R key)
- copy reports (Ctrl+C), can be pasted in the text editor an run with alt+p

Details
- Added "selected_editable_objects" and "selected_editable_bases" to screen_context.c, use the scene layers, this was needed for duplicate to run outside the 3D view.
- RNA_property_as_string converted an array of 1 into "(num)" need a comma so python sees it as a tuple - "(num,)"
- add flag to reports, use for seletion atm.

opens a new world of context bugs :)
2009-07-19 00:49:44 +00:00
Campbell Barton
a705f64245 python access to operators now hides the _OT_ syntax, eg. SOME_OT_operator -> some.operator
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.
2009-07-17 12:26:40 +00:00
Campbell Barton
ef28383ab9 grr, py 2.5 2.6 and 3.x need different StringIO's 2009-07-16 23:04:29 +00:00
Campbell Barton
deb180e37f - Scrollbars for the console (use View2D functions)
- Set View2D operators not to register, got in the way a lot with the console.
- Made autocomplete Ctrl+Enter so Tab can be used.
- Should work with python 2.5 now. (patch from Vilda)
- Moved report struct definitions into DNA_windowmanager_types.h, could also have DNA_report_types.h however the reports are not saved, its just needed so the report list can be used in the wmWindowManager struct. Fixes a crash reported by ZanQdo.
- Store the report message length in the report so calculating the total height including word wrap is not so slow.
2009-07-16 22:47:27 +00:00
Campbell Barton
88e3e8c1c9 - use outliner colors (with subtle stripes) for report so you can see divisions between operators with wrapping.
- added class option for PyOperators __register__ so you can set if py operators are logged in the console.
- PyOperators was refcounting in a more readable but incorrect way. in some cases would be possible to crash so better not drop the reference before using the value.
- console zoom operator was registering which meant zooming in to see some text would push it away :)
2009-07-16 07:11:46 +00:00
Campbell Barton
2f74b5a260 Console Space Type
* 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.
2009-07-16 00:50:27 +00:00