Commit Graph

16572 Commits

Author SHA1 Message Date
Brecht Van Lommel
7555bfa793 UI: fix for back buffer option in scene buttons, by Thomas Dinges. 2009-04-20 13:16:17 +00:00
Ton Roosendaal
0c9de2396a 2.5
Node title and socket labels are now following Style/Font as well, and
scale correctly.
2009-04-20 12:03:55 +00:00
Ton Roosendaal
bc06159431 2.5
Fixes:

- HSV picker didn't work. Old option "No Hilite" for buttons made it not
  being checked for input anymore. Needs to be on attention list!

- Node editor wasn't drawing buttons correctly. Two things to keep track
  off:
  - Use wmLoadIdentity(), not glLoadIdentity()
  - I've added a wmPushMatrix() and wmPopMatrix() version for correct
    wm-compatible push/pop. Only one level for now.
2009-04-20 11:39:18 +00:00
Joshua Leung
4b45c57bb6 Drivers - Rotational Difference
Restored the code to get this working. I haven't tested this to verify it, but it 'should' work...


Also, deleted old gpencil.c file in editors, since it was causing compiling errors.
2009-04-20 10:45:25 +00:00
Ton Roosendaal
f2f95caf30 Forgot to add the new gpencil files! :) 2009-04-20 10:20:18 +00:00
Ton Roosendaal
74b12d1d6d 2.5
Patch from Joshua, converting Grease Pencil to 2.5.
All GP data now is an ID block, allowing re-use, link and append.
For better contextual control within 2.5, these GP ID's will get
linked to actual data, like NodeTrees, Scenes, Images or Objects.
That will ensure Undo works, and opens up exciting new use cases
as well. :)

Patch note: on reading files, GPencils linked from editors will
get moved to the main library, using standard naming (indicating
where it was used), and with "Fake User" set. That way the user
can manually relink the pencils where appropriate.
We can check on just linking GP to some default, like 3d window
pencils to Scene? Nice to experiment with.

Notes for Joshua:
- for reading old GPencil, it has to use old code as well, meaning
  to tread data as "indirect data, within another ID".
- Saving ID data means the chunk in file BHead needs the ID_GD code,
  and not "DATA", which indicates 'indirect data'. That's the file
  format spec.
- I've added do_versions_gpencil_2_50(), feel free to further tweak
  things here, like linking things to scene or so.
- Formerly GPencil saved 2.50 files won't convert gpencil
2009-04-20 10:13:55 +00:00
Joshua Leung
332e001989 Drivers: "Scripted Expression" drivers (i.e. PyDrivers) work again
Now it is possible to write a Python Expression using the variable names for driver targets (see mockup from initial commit) to substitute the appropriate values into the expression.

In the __global__ namespace for PyDriver evaluation, the following modules are available:
* __builtins__ - i.e. the builtin Python functions
* bpy - new Python API
* math or m - math module

For example:
Consider a driver with three targets, named: A, B, C
Now, you could write an expression like:
   C if A < 5 else B
or even:
   2*C if A < 5 or A > 20 else m.PI*B

Of course, you don't have to have three targets, the above was just an example.

TODO:
* Bring back way to load pydrivers.py
* Blender.Noise equivalent would be nice to have

P.S.  I hope I haven't made any terrible Python API coding errors here (i.e. mem leaks, etc.)
2009-04-20 09:17:43 +00:00
Michael Fox
6482206078 Added some missing rna entries for scene, and added them to the scene buttons with some missing elements aswell 2009-04-20 04:58:22 +00:00
Joshua Leung
828581fa07 Drivers: Editing ops in the Outliner
In much the same way as Keying Sets are defined in the Outliner, you can now select items in the Datablocks view of the Outliner, and use the D/Alt-D hotkeys to Add/Remove drivers (repectively). This is useful for settings which don't have buttons yet (in the buttons window).
2009-04-20 03:52:13 +00:00
Joshua Leung
387aad7275 A bit more F-Modifier wrapping... 2009-04-20 03:29:45 +00:00
Joseph Eagar
5146540095 changed some {} to {0}, these were causing errors on msvc. also got rid of some spurious prototypes I forgot to get rid off. 2009-04-19 20:09:31 +00:00
Brecht Van Lommel
f1979f45ec RNA:
* Wrapped HeaderType/Header.
* Some tweaks to get type properties wrapped with less code.
* Made Panel space and region types enum instead of string.
2009-04-19 17:12:16 +00:00
Brecht Van Lommel
adff6aeb1c RNA: Generic Type Registration
The Python API to define Panels and Operators is based on subclassing,
this makes that system more generic, and based on RNA. Hopefully that
will make it easy to make various parts of Blender more extensible.

* The system simply uses RNA properties and functions and marks them
  with REGISTER to make them part of the type registration process.
  Additionally, the struct must provide a register/unregister callback
  to create/free the PanelType or similar.
* From the python side there were some small changes, mainly that
  registration now goes trough bpy.types.register instead of
  bpy.ui.addPanel.

* Only Panels have been wrapped this way now.  Check rna_ui.c to see
  how this code works. There's still some rough edges and possibilities
  to make it cleaner, though it works without any manual python code.
* Started some docs here:

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNATypeRegistration

* Also changed some RNA_property and RNA_struct functions to not
  require a PointerRNA anymore, where they were not required (which
  is actually the cause of most changed files).
2009-04-19 13:37:59 +00:00
Joshua Leung
d880257d16 Graph Editor: UI bugfixes
* Fixed a few alignment/size issues
* Number buttons work nicely again. Added temporary define for floating point limits here...
2009-04-19 12:26:31 +00:00
Joshua Leung
c94a8ad620 RNA - F-Curve Modifier Wrapping
* Separated F-Curve specific wrapping out to its own file
* Wrapped some F-Curve Modifiers (others to follow shortly)
2009-04-19 10:44:07 +00:00
Andrea Weikert
629c4bf8bf 2.5 MSVC9 projectfiles
* long time due: copy the executables to the install/msvc9 or install/msvc9d dir instead of keeping them in the source tree in the bin folder!
* copy the new ui scripts to the install dir
2009-04-18 10:08:19 +00:00
Andrea Weikert
73f4401ac3 2.5 MSVC9 projectfiles
- added editors/keyingsets.c
2009-04-18 08:40:14 +00:00
Nathan Letwory
bac34bc7e7 2.5 / win64
* make sure right libname is used for gettext.
2009-04-18 00:26:15 +00:00
Brecht Van Lommel
685beb686b UI: fix for mistake in last panel commit. 2009-04-17 13:37:03 +00:00
Brecht Van Lommel
0db7c68106 UI:
* Forgot to finish this code yesterday, dragging panels was
  broken. This is fixed and new panels are now inserted after
  the last added one, inbetween others rather than at the end.
2009-04-17 11:59:25 +00:00
Joshua Leung
7cb8b3910d 2.5 Animation UI Tweaks:
* Added back backgrounds behind buttons for modifiers and driver targets
* 'Protect' toggle doesn't draw for F-Curves with no keyframes to prevent editing on anymore
* Inserting keyframes on objects using builtin keyingsets now use the right names
2009-04-17 02:13:35 +00:00
Brecht Van Lommel
6386186d25 UI:
* Broke loading buttons_scene.py in last commit.
* Fix issue with space not being distributed equally
  in the layout engine.
2009-04-16 21:58:06 +00:00
Nathan Letwory
cd83474960 2.5 / SCons
* ui layout scripts were not copied to bundle on OSX
  patch by Stephan Kassemeyer on ML
2009-04-16 21:51:20 +00:00
Brecht Van Lommel
38b6f8f167 UI:
* For new buttons spaces, automatically set horizontal/vertical
  align depending on size, instead of free.

* Cleaned up the UI panel API. There's now a new uiBeginPanel
  function which takes a panel type, and a uiEndPanel which takes
  the final size. uiNewPanel* functions will be phased out.
* Animate the re-alignment when a panel size changes, e.g. when
  enabling dupliframes.

* Load ui scripts from the release/ folder first if it is
  available. This makes it easier to edit ui scripts, since it
  will directly use the original files which avoids having to
  run the build system.
* Improve editing of panel types while blender is open. That
  means fixing some issues with lacking updates, overlaps, strange
  ordering. It even does an animation now when the panel resizes.
2009-04-16 21:39:45 +00:00
Ton Roosendaal
a565154a87 Removed space for target binary name 2009-04-16 15:49:31 +00:00
Diego Borghetti
34dfeb7d50 Remove ftfont from Makefile, it's not there anymore. 2009-04-16 15:01:51 +00:00
Campbell Barton
82f710fb33 merged pyrna_py_to_param and pyrna_py_to_prop since they are almost the same 2009-04-16 13:21:18 +00:00
Joshua Leung
f47ab4f0ae 2.5:
* Added extra parameter to generic unique name finding function BLI_uniquename() for specifying the delimeter between non-unique parts of the name and digits.

* Driver target variables now get unique names by default.
2009-04-16 13:10:08 +00:00
Brecht Van Lommel
23af7214d3 2.5:
* Also look in ./release for scripts instead of next to executable.
* Some warning fixes.
2009-04-16 13:01:50 +00:00
Joshua Leung
bc347d380d Drivers: Depsgraph building works again
Cleaned up the code for adding driver relationships in the Depsgraph (see! I said it was going to be easy). Now, adding drivers works nicely.
2009-04-16 12:49:12 +00:00
Joshua Leung
eed6adbb48 Drivers: UI working + bugfixes
* The UI for adding and modifying drivers is now functional, and reflects the new way they work. It has also been tidied up a bit (from the previous incarnation), with RNA buttons starting to be used (currently limited to the 'Path' settings).
* Fixed errors in RNA wrapping for drivers
2009-04-16 12:38:44 +00:00
Brecht Van Lommel
26a8c63eae UI:
* Don't call generic layout hints templates anymore, i.e.
  TemplateRow becomes Row, etc.
* Added more general layout nesting, using uiLayoutSplit()
  and uiLayoutBox() functions, for which the sublayouts
  can then be accessed using uiLayoutSub(), to put items
  in those sublayouts.
* Some steps to make the layout decisions, like which items
  to put in which columns, independent of the width of the
  window or the text in the buttons. We want the layout to
  be stable under resizes and translations.
* Added an "expand" parameter to uiItemR, used now to expand
  enums into a row instead of using a menu.
2009-04-16 12:17:58 +00:00
Nathan Letwory
db7d0108c2 2.5 / SCons
* make sure makesdna and makesrna work on windows in directories with spaces in them.
2009-04-16 10:45:21 +00:00
Joshua Leung
079304d199 Animato - Drivers with Multiple Targets:
Drivers now support multiple targets which act as 'variables'. The targets have a short 'name' (see later), and reference some property (in much the same way as F-Curves do, using RNA-Paths) which acts as the 'value'. 

These named variables can then be used in a Python Expression which relates them to each other for more fine-grained control over the result of the driver. By using only the names of these variables in the expressions, we are able to define expressions/relationships in a much more readable way, as data access is separated from data use. This makes the underlying relationships easier to understand.

By default, if no Python Expression is given, the variables are simply averaged together, so old files won't break. :)

For example, check the following diagram (thanks Cessen/Nathan V from Peach team):
http://download.blender.org/ftp/incoming/250_drivers_mockup_cessen.png


TODO List:
* Depsgraph building for new driver relationships doesn't work yet. This needs to be recoded again, but this new system makes this much easier, since the targets are clearly defined (i.e. no need to parse py expressions to get list of objects)
* Graph Editor interface for editing these needs to be rewritten
* Python function for evaluating these expressions is needed (Campbell?)
2009-04-16 07:37:06 +00:00
Campbell Barton
88d394d47d Need to update the RNA pointers before running scripts 2009-04-16 01:42:53 +00:00
Joshua Leung
a7916f4a3d PoseLib: Fixed up RNA-properties for this operator so that it can be repeated using the exec() callback added in previous commit. 2009-04-16 00:53:22 +00:00
Joshua Leung
f2e40f7234 2.5 PoseLib/KeyingSets bugfixes:
* Replaced a quicky hack needed to get PoseLib working with a proper new group-naming option for KeyingSets. Now, all builtin KeyingSets will use the name of the data (i.e. Object or PoseChannel) as the name of the group new channels are added to

* Fixed a bug with LocRotScale builtin KeyingSet, which meant that scale keyframes were not getting added.

* TAB key (toggle original pose) now works again. Previously, events were flying past too quickly.
2009-04-16 00:33:40 +00:00
Michael Fox
ec11cf9524 2.5
*****
Made selection operators use extend/exclusive (where appropriate)
2009-04-16 00:00:45 +00:00
Daniel Genrich
ebcd08eb4a RNA fixes provided by Thomas Dinges / DingTo - Thanks! 2009-04-15 21:03:23 +00:00
Ton Roosendaal
09015aa8ab 2.5
- Fun for testers: Added "Redo Operator" Panel in view3d 'nkey' region.
  It's going to be part of tools UI I know, but this will give good
  tests of what goes on with operators. I had to add small fixes in 
  Transform for it already. :)
  One important issue to note is that it lists every operator, also from
  non-3D-window ops. Needs checked or classified somehow.

- Fix: removed bad 2.4x hack from how pulldown menus were defined. Made
  widget code cleaner, and will show menus like SHIFT+A correct now.
2009-04-15 17:53:12 +00:00
Brecht Van Lommel
41dd360420 2.5: Operator naming, reviewed some of the recent changes
by Shaul, did some minor tweaks.
2009-04-15 15:40:31 +00:00
Brecht Van Lommel
4e4e8ef98f RNA:
* For RNA wrapped functions, the prototypes of the original
  function being wrapped is now generated as well. This is
  an extra check to ensure that the function is correctly
  wrapped. It's printed after the function is used to still
  get proper warnings in case the #include for it is missing.
2009-04-15 15:12:42 +00:00
Brecht Van Lommel
8b1207d500 UI:
* Converted scene buttons layout code to use python.
2009-04-15 15:10:31 +00:00
Brecht Van Lommel
874c9e8c58 UI:
* Added simple row template to layout buttons
  in a horizontal row, so you don't need to use
  columns for it.
2009-04-15 15:09:36 +00:00
Ton Roosendaal
ad164a5261 2.5
Fixed & upgraded tooltips to new drawing system.
Also fixed small error in menu shadows. Rounding of shadow below
menu went wrong.
2009-04-15 14:43:54 +00:00
Shaul Kedem
677300f044 cmake support for python25_d.lib in debug on win32. other platforms should work as always 2009-04-15 13:11:08 +00:00
Joshua Leung
b68fb5df74 Action Constraint: Optimisation attempt
Following on from the methods added specially for PoseLib to only execute the F-Curves in a given Action Group, I've attempted to use this for evaluating Action Constraints on Pose Channels. This does rely on the F-Curves being in groups named according to name of the Pose Channel of interest, hence, we may need some way to be able to fine tune this later. 

Preliminary tests seem to be promising, with rigs with quite a few action constraints being slightly more responsive (subjective test though). Please test thoroughly.
2009-04-15 12:59:49 +00:00
Joshua Leung
1680f5f2b0 PoseLib: Fixed lingering bugs with Browsing (Ctrl-L)
* Bug with confirming was due to mixed up order for events handling and updates for drawing. Now events are handled before relevant updates are done for drawing, since these only get called when an event occurs.

* View manipulations work again, and in a much nicer way thanks to the OPERATOR_PASS_THROUGH flags :)

* Search seems to work much better now again too...
2009-04-15 12:38:04 +00:00
Joshua Leung
4c66f26230 PoseLib: Interactively browsing poses with Ctrl-L now mostly works again
This (most important part) of PoseLib now mostly works again. It even works for PoseLibs saved with the old animation system.

However, there are a few annoying bugs that need to be addressed still:
* When 'confirming' poses, the pose changes to the next one before PoseLib exits. I'm not quite sure where this is coming from yet...
* There are still a few minor bugs in the search-string code that will get ironed out
* AutoKeyframing doesn't work yet for this
2009-04-15 12:04:10 +00:00
Joilnen Leite
1f95600c5a Fixing linux compiling 2009-04-15 10:18:58 +00:00