Commit Graph

12885 Commits

Author SHA1 Message Date
Joshua Leung
3b7d1afbd8 2.5 - Version patch for reading old .blend files (for some animsys2 changes) was being done for the wrong sub-version. 2008-12-28 11:08:56 +00:00
Michael Fox
f7a29be3b8 just silenced a warning, thx kaito for pointing it out 2008-12-28 10:49:58 +00:00
Michael Fox
c8d38e7305 2.5
*******
small commit - Select By Type Operator ( ctrl-numpad * )
2008-12-28 10:30:05 +00:00
Campbell Barton
d8fa5f3db7 include order is important here :/ 2008-12-28 08:49:41 +00:00
Campbell Barton
f7f9d6a68d missing bpy_compat.h for <3.0 py 2008-12-28 08:46:38 +00:00
Campbell Barton
625f477554 PyOperator invoke function now receives the wmEvent and default properties as 2 python dictionary args.
the Python invoke function can then edit the properties based on the event, once its finished the properties are copied back to the operator.

python exec and invoke functions can now return RUNNING_MODAL, CANCELLED, FINISHED, PASS_THROUGH flags

Still need to look into how python operators can make use of invoke/exec for a practical case. (Need to bring back the popup menu's)
2008-12-28 08:41:49 +00:00
Joshua Leung
61b3c4fefc 2.5 - Action Editor: Bringing back more operators
* Added 'set handle-type' operator. Currently, all possible handle types are all set using a menu and HKEY. This will need to be reviewed at some point, but I think it should be easier for users to remember 1 hotkey for this, rather than 4 scattered around the place.

* Added 'set interpolation' operator. This uses the Shift-T hotkey as before (for now). As in AnimSys2, this sets per-keyframe interpolation.

* Remapped toggle frames/time-codes operator to Ctrl-T key. This may still change, but the TKEY needs to be free for transform tool here.
2008-12-28 08:15:29 +00:00
Matt Ebb
fb32420330 2.5 - Reworked the icon system a bit
* After several hours of manual dragging and typing the icon file is now 
enlarged and completely reorganised logically, rather than scattered 
throughout. This should provide a lot more room for growth, and is  a 
lot easier to work with (also allowing more space for toggle buttons 
that require two icon slots next to each other). The icon grid has now 
25 x 24 icons - hopefully this might last us for a couple more years :)

Some of the naming of icon defines is a bit ancient and can be cleaned 
up a bit further. Other devs, if when bringing spaces back, it's 
finding the wrong icon, or missing a define, try and look to see if 
it's already existing in the new icon file, or drop me a note and I'll 
fix it up.

Note: after these changes, older custom blender 2.4 icon 
files won't work and will need to be updated to the new layout.

* Enlarged the icons themselves from 15x16 pixels to 16x16 pixels (icon 
designer request). This is a more standard size, and is easier to fit 
stuff in proportionally.

* Added a bunch more of jendrzych's icons that weren't added previously 
since there wasn't space in the icon file (including a few more 
modifier icons)

* Tweaked the outliner somewhat, so that instead of just showing a 
generic 'object' icon for all objects, it shows 'object type' icons, 
per object type. This makes the outliner a lot more useful for browsing 
at a glance - a huge row of identical 'object' icons doesn't really 
give much useful information. See here:

http://mke3.net/blender/devel/2.5/outliner_obtypes.png
2008-12-28 07:39:23 +00:00
Joshua Leung
452f1d1ea9 2.5
- Action Editor: Snap Current Frame to Selected Keyframes
- Change time operator - removed old unnecessary code
2008-12-28 04:13:18 +00:00
Michael Fox
bb02d1fd4f 2.5
******
Ported object selection tools
 - (de)select all
 - invert selection (ctrl-i)
 - select random ( numpad *)

each selection tool is own operator , mouse selection is seperated again to own operator

select random has the hard coded fac of 50 as there is no number popup developed yet

to be ported: select by layer and select by type
2008-12-28 01:28:31 +00:00
Nathan Letwory
e3ddc08e5f * hrmpfs :] 2008-12-28 00:42:01 +00:00
Nathan Letwory
12b7905411 * clean up some warnings. 2008-12-28 00:38:12 +00:00
Nathan Letwory
4e94930715 2.5 / Nodes
* WIP selection operator.
  - selection is made, but redraw is still missing.
2008-12-28 00:08:34 +00:00
Nathan Letwory
ad480556e5 2.5 / SCons
* make sure we can build WITH_BF_PYTHON=False
2008-12-27 20:22:22 +00:00
Ton Roosendaal
b97ee36f8d 2.5
Anim playback part 1 (needs more test, will do after commit)

- added the update_for_new_frame() back
- proper evaluation of time change notifier in WM level
- fixed redraw flushes for menus while animation plays.
2008-12-27 17:43:05 +00:00
Campbell Barton
b7c7057f3e * converting operator props to strings was using a float as in int.
* PyOperators were always calling the python functions with default args.
* Made operator prints only happen when G.f & G_DEBUG is enabled.
2008-12-27 16:35:15 +00:00
Ton Roosendaal
f0f451fc16 2.5
Notifier system upgrade, based on Brecht's doc.
Implementation notes:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers#Implementation

In short: let's try to strictly communicate in a notifier what happened.
The listeners then can act themselves. It also means that a frame-changed
notifier doesn't send out redraws, the editors themselves can decide.
2008-12-27 16:09:56 +00:00
Campbell Barton
0714d28236 python operators (in bpy_opwrapper.*)
This means you can define an operator in python that is called from C or Python - like any other operator.

Python functions for invoke and exec can be registered with an operator name.

keywords are read from the python exec() function, then used to create operator properties. The default python values are used to set the property type and defaults.

def exec(size=2.0, text="blah"): ...

is equivalent to...
prop = RNA_def_property(ot->srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_default(prop, 2.0f);

prop = RNA_def_property(ot->srna, "size", PROP_STRING, PROP_NONE);
RNA_def_property_string_default(prop, "blah");


TODO -
* make use of events
* return OPERATOR_CANCELLED/OPERATOR_FINISHED.. etc
* add support for array args
* more testing
2008-12-27 14:52:49 +00:00
Joshua Leung
86886cbc55 2.5 - Action Editor
* Started porting back keyframe editing tools for the Action Editor/Dopesheet. Currently, only Snap (Shift-S) and Mirror (Shift-M) are functional.

* Added keyframe-editing API method for ensuring that all IPO-curves are left in a valid state after modifiying the values of their keyframes.

* Added operator-register flags for most of the operators. Only mouse-select doesn't have it for now (as there's not much useful info stored, and no exec callback).
2008-12-27 11:44:00 +00:00
Michael Fox
032adf70d9 2.5
*******

Made the framework for selection operations ( invert selection, select random) to be handled by a single operator, atm only normal/mouse selection is possible

to be ported
 - invert selection
 - select random
 - select by layer
 - select by type
2008-12-27 10:54:32 +00:00
Joshua Leung
b6ac77f602 2.5 - Assorted comments, and made the default size of the Action Editor more sensible. 2008-12-27 05:24:03 +00:00
Campbell Barton
a2369a5e01 run python when starting blender like 2.4x does (was start/stopping python for each script before)
This way python can call the operator to run other scripts
eg...
 bpyoperator.SCRIPT_OT_run_pyfile(filename = "myop.py")
2008-12-27 04:55:45 +00:00
Joshua Leung
017cb7a394 View2d: Tweaked operators/keymaps to allow so that view will scroll when zooming the view is not possible. 2008-12-27 04:30:26 +00:00
Michael Fox
8bd12ebc3e 2.5
******

Set the render border operator

- Hotkey same as old (shift-b)
- behavior is the same as old, even draws the same
2008-12-27 01:29:56 +00:00
Nathan Letwory
27a9ac81c6 2.5 / Nodes
* bring back more code that got lost after careless revision jumping.
2008-12-26 20:50:06 +00:00
Nathan Letwory
5fdda0bb05 2.5
* when tracking a crasher I did svn update to specific revisions, updating back and forth somehow made some of my changes disappear in bitheaven. Bringing back aspect once again (rest of todays commit will follow soon).
2008-12-26 20:44:27 +00:00
Nathan Letwory
ec66752f49 2.5
* fix some warnings to satisfy scons/msvc
2008-12-26 20:39:29 +00:00
Brecht Van Lommel
82cf2aebba RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.

Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".


Defining the operator property:

prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);


Adding values:

PointerRNA itemptr;
float loc[2] = {1, 1},

RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);


Iterating:

RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];

	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
2008-12-26 20:38:52 +00:00
Brecht Van Lommel
254fc41b56 UI: fix potential crasher in UI panel commit. 2008-12-26 20:25:02 +00:00
Ton Roosendaal
da078552d4 2.5
- Added 3d cursor operator (no exec, waiting for vector property!)
- Added default editor callbacks, for the poll() function.

Example:

   ot->poll= ED_operator_view3d_active;

I'll add later more, per module, such as OBJECT_active, which
can be called without WM active
2008-12-26 19:07:31 +00:00
Ton Roosendaal
6086c31fd3 2.5
Brought back 'smooth view'. Took some hours to untangle it all,
code was spread all over, instead of localized in 1 call. Tsk!
Still not perfect, but at least more in control. For the hackers;
check void smooth_view() in view3d_view.c, here all 3d view
stuff should be handled, so it can optionally use animating.

For the users: 'smooth view' now plays at a maximum of 30 hz,
and doesn't block anymore. So even slow animated views remain
responsive if you press many numpad keys.
2008-12-26 18:15:46 +00:00
Nathan Letwory
ce733db5cb 2.5 / Nodes
* fix icon scaling -> SpaceNode aspect.
* bring back a bit more code
2008-12-26 18:00:38 +00:00
Campbell Barton
2431c6667c * Added bSound to rna (still need to do bSample and bSoundListener structs)
* rna epy doc-gen was failing when trying to sort None
2008-12-26 16:50:05 +00:00
Brecht Van Lommel
e4b20f0180 2.5: various warning fixes. There was one actual bug in a few different
places, using sprintf with strings like ID names as the format string
(note that this name can contain a % character).
2008-12-26 14:19:25 +00:00
Campbell Barton
63f84cf26d crash when running operators with no window 2008-12-26 13:50:32 +00:00
Ton Roosendaal
bf956bb475 2.5
Timers: added extra 'event type' argument to call to add a timer:
WM_event_add_window_timer(win, event_type, interval)

This way other timer systems don't generate overhead on the queues.
(button timers were creating unused animation-playback operators)
2008-12-26 13:29:47 +00:00
Brecht Van Lommel
2335092456 UI: Panels
* API and usage is basically the same still.
* Panels were moved to region level. I first thought of keeping them at area
  level, but having them at region level it's simpler to handle events and do
  drawing, and also to integrate with view2d. They can still become area level
  overlapping regions, if we make a floating (or docked) region that can
  contain panels.
* Added back a few panels from the scene buttons for testing.

Issues still:
* The view2d handling and alignment refresh of panels is not correct yet in the
  buttons window. 
* I did not yet bring back the block handlers system. It was basically a system
  that stored which panel was open and where the events for that panel would go.
  Just a few functions, but not sure how it fits in 2.5.
* There was a case where dragging panels would not properly remove the window
  level handler, but could not redo anymore even though I don't think I fixed
  it.
* Some text in the panels goes past the end of the button, that is due to the
  checkmark button drawing, not related to this commit.

Other UI code changes:
* Renamed interface.h to interface_intern.h for consistency.
* Fixed some issues with freeing of blocks when they changed due to context.
* uiDrawBlock now takes a context pointer (mostly for block drawextra).
2008-12-26 13:11:04 +00:00
Campbell Barton
7715e45a7a removed ED_ prefix from script operator.
python operator api was crashing when unknown operators were called.
2008-12-26 12:39:53 +00:00
Ton Roosendaal
d6704568f8 2.5
Operator calls: extended WM_operator_name_call() with options whether to
call the exec() (operate immediate) or invoke() (check user input) entry.

This will allow python to use it more efficiently, but also solves the
dreaded pulldown case that showed another menu for confirmation.

New names to learn: :)
WM_OP_EXEC_DEFAULT
WM_OP_INVOKE_DEFAULT

on todo still: allow hotkey definitions to do same.
2008-12-26 12:21:06 +00:00
Joshua Leung
1d176259cb 2.5 -
Renaming operators to follow new naming convention set out by Ton
2008-12-26 11:33:41 +00:00
Brecht Van Lommel
c0475a7859 2.5: fix/workaround for crashes with open recent popup, due
to usage of free'd area/region.
2008-12-26 11:32:20 +00:00
Ton Roosendaal
5006875f53 2.5
- fix Makefile for space_script
- renamed operators for modules i maintain. (stripped ED_)
2008-12-26 11:11:21 +00:00
Joshua Leung
34baf51dcb 2.5 - Action Editor: All Keyframe Selection Tools Ported
User Notes (for using tools whose behaviour has changed):
* Mouse Selection Tools: 
1) Click on keyframe to modify its selection. Holding the 'Shift' modifier when doing so, will result in keyframe selection being toggled instead of replacing existing selections.
2) Click on either side of the current frame indicator while holding the 'Alt' modifier. This will select only all the keyframes on the relevant side of the current frame indicator.
3) Click on a keyframe while holding the 'Ctrl' modifier. This will select all the keyframes that fall on that frame.

* Borderselect Tools 
1) BKEY selects all the keyframes within the specified range (as per normal)
2) ALT-BKEY will select either all the keyframes in the frame-range specified or the channel range specified, depending on which axis of the select region was larger. This method is prejudiced towards frame-range selection.

Code Notes:
* Finished porting over all of the remaining keyframe selection tools, and recoded the ported ones to make them easier to use (after running into some technical limitations)

* Simplified the way to check if 'animation context' is valid by moving a necessary check into that function.

* Refactored internal keyframe-looping tools to reduce the amount of code needed per tool to edit keyframes, removing a lot of the unnecessary bulk. Now, the ipo/icu_keys_bezier_loop functions recieve a few more arguments (1st arg is pointer to generic customdata, and another defines a validation callback which makes it easier to reuse some of the select callbacks).

* Added 'totrect' adjustment for number of channels being shown in Action Editor, so that scrolling will be limited to where there is data (and also so that scroller displays more relevant context info). 
For this to work, filtering channels now returns the number of channels extracted. This may come into use for other tools if there's such a need.

* I still need to port over some code for markers, which is required for some of the tools which use them. For now, those tools do nothing.

* Grease-Pencil editing mode in Action Editor is currently non-functional (code is commented out due to missing dependencies). This is currently pending the re-implementation of Grease Pencil in 2.5
2008-12-26 10:55:07 +00:00
Michael Fox
1dbbffb4be My very first commit (kinda cool ) just to test my commit rights and to go through the motions of commiting
just a single comment to seperate the ED_VIEW3D_OT_viewnumpad operator code from the rest so its easier to read
2008-12-26 10:31:44 +00:00
Campbell Barton
0054e6d354 * added RNA_property_as_string to rna_access.c - can print most types except for pointers and collections.
* WM_operator_pystring to print the python func+args for an operator
* call WM_operator_print(op) in wm_operator_invoke(), simple echo mode should be moved later.
2008-12-26 03:56:52 +00:00
Nathan Letwory
27d0394ba4 2.5 / RNA
* two more small warning fixes.
2008-12-26 02:06:54 +00:00
Nathan Letwory
1d3670417b 2.5 / RNA
* assorted fixes for resolving compile warnings
* in rna_armature setting for envelope weight was bug, since it was setting dist instead.
2008-12-26 02:02:06 +00:00
Nathan Letwory
2a2e720586 2.5 / RNA / Nodes
* some work on node types.
2008-12-26 01:37:05 +00:00
Nathan Letwory
9104f67ff9 2.5 / SCons
* Silence warning
  - there's no blc lib anymore :) Player won't build now anyway, as some bad level calls need to be cleaned up.
2008-12-26 00:12:25 +00:00
Nathan Letwory
d464148259 2.5 / RNA / Material
* Flare settings
* some code reorganisation for readability.
2008-12-26 00:10:29 +00:00