Commit Graph

16498 Commits

Author SHA1 Message Date
Joshua Leung
2db495d4e3 Anim Editors: A few more hotkey tweaks 2009-04-12 08:21:22 +00:00
Joshua Leung
db3abe9456 Graph Editor:
* Column select (ALT-RMB) works again, and in conjunction with 'extend' (i.e. SHIFT) to add to selection instead of just replacing
* Select all keyframes in curve (CTRL-ALT-RMB) now works
2009-04-12 08:17:46 +00:00
Joshua Leung
dcb07e387d Action Editor: Selection tools cleanup
* Cleaned up the code for selecting keyframes
* Click-column-select (Alt-RMB) now works

* Also, moved a function used in both Action/DopeSheet and Graph editors to the Animation module
2009-04-12 06:47:25 +00:00
Guillermo S. Romero
e0d794b31e Slight improvements in release creation.
Version string is compatible with all previous releases, but report
subversion if not 0.
Keep distribution dir so you can run from there without needed of unpack,
and make messages and cmds be in sync.
2009-04-11 19:04:59 +00:00
Campbell Barton
3f98b7ac35 Added back importing UI scripts rather then running,
The bug was todo with bpy.data and bpy.types becoming invalid, temporary fix is to re-assign them to the bpy module before running python operators or panels.
will look into a nicer way to get this working.
2009-04-11 16:17:39 +00:00
Shaul Kedem
91d6e68830 changed parts x parts y and threads to be minimum of 1, thnx DingTo 2009-04-11 16:10:15 +00:00
Elia Sarti
c848ea953d 2.5 / RNA
API, added support for return values for RNA_function_call_direct and completed the code. Didn't test it though.

Returns works exact the same way as other parameters for format strings except you put a R in front of it. For instance for a function that accepts two vectors and returns a vector you use a format like "f[4]f[4]Rf[4]". 
I'm thinking about allowing arbitrary white space in the format string (or use comas as separators) to make it more readable. 
The return format *must* always come last and of course the corresponding argument you pass to the function has to be a pointer so that it can be filled with the return value.
2009-04-11 15:46:35 +00:00
Campbell Barton
a406c15d93 Python Api
own error with refcounting and raise an error when bpy.types cant generate a subtype (though it shouldn't happen)
2009-04-11 15:05:42 +00:00
Ton Roosendaal
f28a6a90f1 2.5
Styles/fonts will be saved in userdef, but not yet... forgot to
zero pointers on read, causing crash on .B.blend read saved in 2.5
2009-04-11 14:43:03 +00:00
Elia Sarti
8132ca62df hem.. other small fix 2009-04-11 13:24:02 +00:00
Elia Sarti
288f772350 2.5 / RNA
Committing quick RNA function calling RNA_function_call_direct* functions set à la fprintf.

It works like this (with ptr being an RNA pointer to some ID):

RNA_function_call_direct_lookup(ptr, "rename", "s", "MyCamera");

the format specifier would not be strictly needed but I prefer to keep this as it gives nice error handling in case some RNA function changes. 
Format strings are very easy and similar to python ones:
"b" for booleans
"i" for integers
"f" for floats
"s" for strings
"e" for enums (using int values)
"O" for pointers (using O as in py, we can change to P)
"N" special NULL parameter, valid to skip optional parameters
For bools, ints and floats you can use a special format specifier with [n] where n is the size of an array of that type. For instance "f[4]" to set a location/vector (it expects a pointer to float* holding the array).

Return values still have to be implemented.
Also I know the name is a bit long maybe we can cut it up at RNA_call_direct or simply RNA_call.
2009-04-11 12:44:01 +00:00
Campbell Barton
963e217c2a undo previous commit, changing running the script to importing it somehow made it crash when running the class functions. will look into this further. 2009-04-11 10:01:49 +00:00
Joseph Eagar
59578bfad2 as per discussion with ton, the editmesh accessors now live
in blenkernel.
2009-04-11 08:26:51 +00:00
Joshua Leung
fc02e980f4 Drivers: Errors + UI Tweaks
* Invalid drivers are now tagged accordingly and are not evaluated until they are manually refreshed using the 'Update Dependencies' button
* Drivers with errors have a error warning shown in their UI
* Rearranged the UI buttons a bit for drivers, adding support for a 'remove' driver button.
2009-04-11 06:48:39 +00:00
Campbell Barton
9d922b4c24 Changed the script UI registration to import rather then run each python script,
this means it caches the compiled pyc files after importing fro the first time.

My times for importing 501 buttons_objects.py files were.
- running each as a script 1.9sec
- importing for the first time 1.8sec
- importing a second time (using pyc files) 0.57sec

Also added "bpy" to sys.modules so it can be imported.
2009-04-11 05:46:40 +00:00
Brecht Van Lommel
c7b587105f UI:
* Added very basic loading of .py files on startup to define panels.
  It now executes all .py files in .blender/ui on startup. Right now
  this contains the object buttons, the C code for it is commented out.

  These files should get embedded in the blender executable as well
  eventually, that's a bit more complicated so this works for now.

* For scons and cmake it seems to copy & find the files OK, for make
  only "make release" works (same with scripts/ folder it seems).

* Added BLI_gethome_folder function in BLI_util.h. This is adapted
  from bpy_gethome, and gives the path to a folder in .blender like
  scripts or ui.

There's plenty of things to figure out here about paths, embedding,
caching, user configs ...
2009-04-11 02:18:24 +00:00
Brecht Van Lommel
3ed5e21537 UI:
* Template slots are no longer specified per item, but are
  a state now, set with uiTemplateSlot.
* Some renaming of Layout functions for consistency.
* Fix for roundbox in stack template, now is always behind
  the other buttons.
* Improved python API for layout:
  http://www.pasteall.org/5008/python
2009-04-11 01:52:27 +00:00
Brecht Van Lommel
9814ea4bcb RNA: python support for REQUIRED flag for function parameters. 2009-04-11 01:45:05 +00:00
Brecht Van Lommel
344449e483 RNA:
* Added REQUIRED flag for function parameters.
* Made dupliframes/verts/faces/groups an enum, and make it editable.
* Enum bitflags were broken, fixed.
2009-04-11 01:43:50 +00:00
Joshua Leung
728767bad7 2.5 Drivers:
* Fixed bug with setting the active F-Curve
* UI for editing drivers now works
2009-04-11 00:29:21 +00:00
Guillermo S. Romero
5836cba0a5 Syntax error, unexpected ). 2009-04-10 18:47:33 +00:00
Elia Sarti
a55feb91de 2.5 / RNA
Corrected a description.
2009-04-10 18:03:24 +00:00
Ton Roosendaal
a14630c9d3 2.5
Quick hack to enable zoom in buttons window again.
It uses bad old conventions for fixed panel width still, view2d has
to be tweaked for new system. But, it shows layout to work. :)
2009-04-10 17:39:37 +00:00
Ton Roosendaal
4e81404d7e 2.5
Grand cleanup: 
- removal of FTF and ftfont dir
- removal of text.c which wrapped it
- wrapped old text drawing code temporarily, need to decide how 'style'
  will behave per editor when you draw strings outside interface code.... 
  wouldn't be very useful to set fonts locally all over?
2009-04-10 16:30:28 +00:00
Ton Roosendaal
6124933781 2.5
Nicer implementation of blurred font draw, moved to blenfont
module. Set it with BLF_blur(value). Current kernels implemented
are 3 and 5 only. Blenfont module can extend this once.
2009-04-10 14:27:29 +00:00
Ton Roosendaal
d2cc19dcc6 2.5
More font style work;

- hooked up almost all ui buttons code to new font
  system, including text clipping
- panel headers scale now too to smaller fonts
- added further style hints, for shadow/emboss. Is all going to
  be in UI designer control!
- for fun; changed layout engine to spread vertical buttons in
  window width

Next: removal of all usage of old font system, using 'styles'.
Will also move font blurring to blenfont module.
2009-04-10 14:06:24 +00:00
Joshua Leung
a4c4ee2f99 2.5 Drivers - Widget Colours
* Widgets now get coloured when driven. The colour used is debatable, but I've just set it to a purplish colour so that it's easy to distinguish from animated/keyframes/highlight colours.

* New drivers are given generator F-Curve modifiers by default so that they at least show up in the view.
2009-04-10 13:16:50 +00:00
Joshua Leung
6593bbaca2 2.5 - Groundwork for Adding/Removing Drivers
Drivers can now be Added/Removed from buttons using the D/Alt-D hotkeys, and also through the menu. Driver settings (i.e. the target) are not set by default. To set those, go to the Graph Editor (see notes).

Notes:
* Buildsystem maintainers - I've added a new file "editors/animation/drivers.c"
* Widget colours for the driven-setting indications are needed 
* To see the new drivers, go into Graph Editor -> "Drivers" mode. Currently, there's a little bug there which prevents editing of the new drivers.
2009-04-10 13:08:12 +00:00
Joshua Leung
be8b7ead51 Action Editor - Part 2 of Code Cleanups
Nothing much to see here... there's still a few things to recode a bit nicer...
2009-04-10 12:06:31 +00:00
Joshua Leung
487561882d Animation Editors - Part 1 of Code Cleanups
* Fixed a few typos in the code
* Switched the meaning of the Ctrl and Alt modifiers when selecting keyframes. 
- Ctrl is now select all keyframes on one side of time cursor
- Alt is now select all keyframes at same time as a particular keyframe. 

TODO:
While testing these changes, I've found that this column-select is not working yet as the tolerances are too low. This will be rectified soon.
2009-04-10 03:34:20 +00:00
Elia Sarti
92e17f1fa9 2.5 / RNA
DNA_texture_types almost finished, missing still plugin type.
I noticed many texture share the same noise settings maybe this can be grouped into a common function.
Also testing out first commit.
2009-04-09 20:33:39 +00:00
Ton Roosendaal
79c30a0752 2.5
WIP commit for UI drawing.

- Hooked up Diego's new Font API
- Added Style definitions for fonts, currently it uses
  a different font for panel titles to show it.
- Styles are in Userdef now too, still not finished 
- Userdef "DPI" will offer global control over font size,
  to match monitor size/resolution. It's meant to scale
  widgets and headers too btw, later.
- Lots of code removed for old fonts, but that's unfinished.

On todo: too much to mention, will continue happily tomorrow!
2009-04-09 18:11:18 +00:00
Campbell Barton
46d8c1ebc7 talked to vekoon and he's ok about using pythons CFunction rather then our own pytype.
If printing PyTypes becomes important we can do it a different way which is still less then 10 lines.
2009-04-09 17:31:23 +00:00
Campbell Barton
bca1ca9d1e Added rna functions so they get included in a dir(rna_struct) from python.
Added a check that a panel panel is a subclass of bpy.types.Panel (need a better way to access this type)
2009-04-09 16:52:18 +00:00
Brecht Van Lommel
26568d0303 RNA: makefiles aren't working correct on Mac currently,
temporary workaround.
2009-04-09 13:32:14 +00:00
Campbell Barton
9196d88242 Experimental removal of pyrna_func_Type (ifdef'd out)
Since adding a new type gives quite a lot of extra boiler plate functions.

Return PyCFunction's main disadvantage is it does not have a uniqie name when you print it.
2009-04-09 13:20:48 +00:00
Joshua Leung
84f3e7d94d 2.5 Bugfix: Trying to insert/delete keyframes on old-style buttons would crash
Fixed the problems with using uninitialised vars in the calls for inserting keyframes from buttons. Oldstyle buttons (i.e. those without any RNA links, such as the 3D-View header buttons) would crash otherwise.
2009-04-09 11:36:12 +00:00
Joshua Leung
a59ee83916 Animation Editors - Bugfixes:
* Collapse selected channels should now work for most channels. It still doesn't work for Action Groups for some reason...
* Objects are now deemed to only be selected in Animation Editors if the are selected (i.e. if they are active but not selected, they are no longer considered to be selected)
* Outliner updates when scrubbing the TimeLine. As a consequence, anim playback with an Outliner open is a bit slower now.
2009-04-09 07:26:49 +00:00
Brecht Van Lommel
41b8259580 2.5: clipboard fix to only do the conversion to \r\n line endings on windows. 2009-04-08 18:48:17 +00:00
Brecht Van Lommel
25d0720dc4 2.5:
* Fix to make python panels callbacks get the actual
  blender Panel as an argument, instead of any instance.
* Fix for callback validation in python 2.5, worked OK
  in python 3.0 but gave error in 2.5 because it's a
  method instead of a function there.
2009-04-08 18:45:41 +00:00
Ton Roosendaal
d979085614 2.5
- Updated panel tabbing code to at least make it work again
- And some more minor UI tweaks
2009-04-08 16:51:35 +00:00
Brecht Van Lommel
9b3b52dfd6 RNA:
* Added the build system code to compile files named
  editors/*/*_api.c into the makesrna preprocessing.

  The reason to do this is to keep operators and API
  close together, but it doesn't fit well with the build
  system, especially Makefiles use an ugly hack here.

* Some fixes to pass an RNA AnyType through the API,
  this will give a PointerRNA, for use in the interface
  code for example.

* Added RNA wrapping of some UI template code as a test.
2009-04-08 16:40:46 +00:00
Joshua Leung
4b2072bec3 Animation Editors: Restored operators to expand and collapse channels
There are two operators: one for expanding channels and one for collapsing them. These operators each have a property, "All", which specifies if they should expand/collapse all channels regardless of selection.

TODO:
* A few of the sub-object channel types still needs to be supported by this.
2009-04-08 12:35:38 +00:00
Joshua Leung
0f4a07afb9 Builtin KeyingSets Bugfix:
* Builtin KeyingSet for Scale works now. Was using the wrong RNA-paths
* Added LocRotScale builtin KeyingSet
2009-04-08 12:01:23 +00:00
Joshua Leung
ad2c860baf Graph Editor: 'Ghost Curves' functionality from Apricot
This feature takes a 'snapshot' of the visible+selected F-Curves, and displays these in the background as 'ghosts curves' in the background. Such curves are drawn semi-transparent, slightly darker, and with dotted lines. 

To use, simply click the 'curve' button beside the Auto-Snapping selector. To clear, simply click that button again (with a different icon now). 

These 'ghost curves' are stored per Graph Editor instance, and are not saved to file (i.e. per session only). They are useful to be used as guides when refining the shape of existing curves.
2009-04-08 01:07:46 +00:00
Campbell Barton
c80133e1bc Added a message when people try build docs outside of blender 2009-04-07 23:22:20 +00:00
Ton Roosendaal
654a30aa2d 2.5
- Widgets now draw projected themselves, putting window/region matrix
  on 1:1 pixelspace. This allows zoomable buttons, but crispy.
- Note: text in smaller buttons dont get clipped correct now, WIP
- Fixed error with button types in some  menus.
- removed temp UI_2_50 define hack.
2009-04-07 17:08:26 +00:00
Campbell Barton
7c74d1dfa3 py <2.5 dont have lenfunc 2009-04-07 17:08:24 +00:00
Brecht Van Lommel
0482325805 RNA: fix for compile error on msvc, and a warning fix. 2009-04-07 15:20:12 +00:00
Diego Borghetti
59190778a8 New Bitmap draw mode for Freetype2 fonts.
The library can load any font supported by the Freetype2 library or
used the internal bitmap font.

With both types it's possible draw the text as texture or bitmap,
and using texture it's possible rotate, scale and clipping text.

Still have things to fix/add, but I think it's ready to move-on
and start droping the old api, most of (if it's not all) the
editors/interface/text.c will be remove, but some things still
has to be define, like:

 * Where is store the fonts ? (default font, panel font, filesel font, etc)
   I mean, every space have own fonts ? or we keep it on the context ?
   It's not a really problem from the blenfont side, because every font
   have reference number, so it's load only the first time.

 * What we do about gettext ?
   Keep the old system that call gettext inside the blenfont or replace
   it for _() in the Blender source ?
   Also things like pupmen has to be take care, if we want translate the menu.

Ok, time to sleep, back tomorrow to start moving the things :)
2009-04-07 08:42:28 +00:00