Commit Graph

25 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
117fdd8072 * projection paint options in the toolbar
* renamed  __no_header__ -> __show_header__
2009-07-26 03:54:17 +00:00
Brecht Van Lommel
366a64959c 2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.

* Top header now has an engine menu, to choose between the blender
  render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
  only properties that work in the game engine, and similarly for
  the render engine.
* Moved panels from the logic space and game tabs to the physics,
  scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
  specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
Dalai Felinto
9a9d118bbf BGE panels: wip
Logic Panel:
- world settings (moved from world)
 ... that includes physic engine selection + gravity
- game player (from gamesettings, it wasn't wrapped)
- stereo/dome (from gamesettings, it wasn't wrapped)
 ... separated stereom into stereoflag and stereomode
- properties
 ... (didn't touch it)

Buttons Game Panel:
(wip panel)
- Physics (moved from Logic Panel)
 ... it will be a datablock in the future (right Campbell ?)
- Material Physics (not currently implemented)
 ... a datablock link to the materials of an object + the dynamic physic variables

* NOTE:
in readfile.c::do_version I couldn't do if(scene->world). There is something wrong with scenes with an unlinked world. So so far we are ignoring the old values....
2009-07-20 20:28:29 +00:00
Campbell Barton
33bfd7397b BGE Button types panel, can edit existing buttons but not add new ones yet.
World Physics panel too though Im not sure if we'll eventually move this into another struct.
2009-07-20 16:21:55 +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
Brecht Van Lommel
d091856486 2.5: Buttons Window
* Fix poll() callback changes in recent commit, note that these have
  to work with pinned context too.
* Hide header for context panels in py layout.
* Don't jump back when collapsing a panel, allow the view to be
  over some empty space until you scroll back.
* Fix follow context icon, order had to be reversed in icon file.
* ID template now has icon as part of browse button instead of
  outside the buttons.
2009-07-09 19:45:27 +00:00
Thomas Dinges
403dc0f25a 2.5 Buttons:
* Fixed some Bugs from Commit 21458. 

* Show Preview Render only when there is an active id block. 

* Some Code Cleanup (especially in polls). Please try to keep it clean ;-)
2009-07-09 16:09:44 +00:00
Campbell Barton
4a3f56a29d patch from William, panel names need to be unique 2009-07-09 09:42:34 +00:00
Campbell Barton
9f592e4f62 Patch from William
"moving the ID browser into its own panel. Eventually these panels should loose their headers to distinguish them from other, normal panels. Also a few other fixes for bones and armature panels."
2009-07-09 09:07:25 +00:00
Brecht Van Lommel
272fac8fd6 UI: some API functions don't require explicit context passing anymore. 2009-06-23 00:19:10 +00:00
Brecht Van Lommel
5ea992df98 UI:
* Fix context.cloth, was not being set correct.
* Fix errors with context pinning, scripts should
  not assume context.object to be there.
* Always show preview even if e.g. the material is not
  set, to keep ID buttons from jumping while you're
  using them.
2009-06-18 14:20:25 +00:00
Thomas Dinges
c3c38155ad 2.5 Buttons:
* Added more material buttons by William. Thanks.
I made some minor adjustments and added Specular Shader Model RNA. 

* Code cleanup and some consistency tweaks of button files.
Notes: Preview render now only shows up when there is an active world, material, texture or lamp.
* Made sure initial panels with ID Datablocks are shown, even when no block is active.
2009-06-13 21:22:21 +00:00
Brecht Van Lommel
eecf7722b6 UI Buttons:
* Context now allows pinning a datablock, independent of
  selection.
* Initial ID browse buttons for most buttons tabs.
* Browsing from world to texture now displays world textures
  again, but is a bit of a hack, not sure there is a right
  way to do this.
* There's a button to switch between active materials and
  textures now, only temporary though.
* There's some code to put context part in own region,
  disabled still because it doesn't work that well yet.
2009-06-07 13:36:12 +00:00
Brecht Van Lommel
dc7d0ef474 UI:
* Add Lamp Fallof Curve and Texture Color Ramp panels.
* Use button space context data.
* A few other minor python layout script updates.
2009-06-03 00:17:35 +00:00
Thomas Dinges
a5c60e3405 2.5 Buttons:
* Some world button tweaks by William Reynish. Thanks! 

* Quality slider in scene buttons gets hidden again.
2009-05-31 16:40:28 +00:00
Brecht Van Lommel
276a75ae07 UI:
* Added panels with dummy preview template.
* Added constraints panel for bones next to objects, though it
  doesn't work that well yet, the operators and code need to be
  changed so they don't assume it is one or the other in/out
  of posemode.
* Added some graying out in the scene and world buttons.
2009-05-28 23:45:50 +00:00
Matt Ebb
e49c0b495a Reverted last buttons commit after chatting with Thomas :)
note: The new 'Toggle' options in the UI api should be 
avoided for normal text buttons, and used sparingly 
otherwise. We want to avoid having two inconsistent 
appearances for the same type of buttons.
2009-05-27 11:21:34 +00:00
Thomas Dinges
3e6d23562c 2.5 Buttons:
* Changed some checkboxes into Toggle Buttons.
2009-05-27 09:37:48 +00:00
Thomas Dinges
ef01c5bf0a 2.5 Buttons Code:
* Code Cleanup.
* Tiny layout changes.
* Added proper context for bone, curve, mesh and text objects. 

* Fixed Sun/Sky context.
2009-05-24 12:37:55 +00:00
Brecht Van Lommel
0a13c162b1 UI: added support for enable buttons in the panel header. 2009-05-20 14:46:49 +00:00
Matt Ebb
2e91f1b155 Assorted UI tweaks/cleanups 2009-05-20 13:56:22 +00:00
Brecht Van Lommel
b4d46e5ded UI: Layout Engine
* 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.
2009-05-15 11:19:59 +00:00
Thomas Dinges
33322ad1ff 2.5 Buttons:
* Some minor code cleanup
* More tweaks to match the Layout Guidelines "Dependencies ".
2009-05-05 04:07:08 +00:00
Brecht Van Lommel
58cdd37f52 UI:
* Made separator item work horizontal & vertical.
* Add colon (:) automatic for int/float/enum/string.
* Added space variables to uiStyle and use them in the
  layout engine.

* Added initial World buttons by Thomas Dinges, thanks!
* Added some code for modifiers in the Object Data context.
  This will become a template though.
* Use a common poll() callback in the scripts to reduce code.
2009-04-27 18:05:58 +00:00