Commit Graph

15187 Commits

Author SHA1 Message Date
Martin Poirier
6f8cc8a8ad Forgot this new file in last commit 2008-12-29 04:14:27 +00:00
Campbell Barton
65fbab9f4d added RNA access to operators pointers to be documented with epy_doc_gen.py.
eg: print (bpyoperator.VIEW3D_OT_viewnumpad.rna.__members__)

docs for bpyoperator
http://www.graphicall.org/ftp/ideasman42/html/bpyoperator-module.html
2008-12-29 03:24:13 +00:00
Martin Poirier
b6b61681ef 2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support

I've only tested Scons support, though Makefil *should* work, I *think*.

Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
2008-12-29 01:41:28 +00:00
Joshua Leung
97a82102d4 2.5 - Action Editor / Animation Stuff:
* Brought back clean (OKEY), sample (Shift-OKEY), and delete (XKEY/DELKEY) tools for the Action Editor. 
Currently clean uses a predefined threshold (as a rna-prop, though it's still lacking the popup to set this when it is called)

* Added new file for 'destructive' keyframe operations/tools. 

* Got keyframing.c compiling. Now, some of these tools need to be operatorised. Also, the API there might change when enough of the system is stable for RNA-IPO work to take place (so that it can be tested).
2008-12-29 01:19:25 +00:00
Nathan Letwory
87cae4caed 2.5 / Nodes
* enable more code (button callbacks, will probably undergo revision)
2008-12-29 00:55:23 +00:00
Michael Fox
aa1c405b7a 2.5
********
-ported the selection functions to use context data loops
-removed unused functions
-added select by layer (alt-numpad *), hardcoded to layer 2 until appropriate popup is available
- normal select is still the same, need to untangle it badly, and add extend to it for multiple selection, group selections, activations etc etc
2008-12-29 00:45:00 +00:00
Nathan Letwory
b8ab364bd5 2.5 / Nodes
* patch reading of old files so nodes open up properly.
2008-12-29 00:03:05 +00:00
Nathan Letwory
4b3a37db14 2.5 / Nodes
* header: better positioning of buttons, new drawing style was mixing up for old positions.
2008-12-28 23:49:51 +00:00
Matt Ebb
e8bf295ec9 More button code cleaning and tweaks
* now the rounded and round shaded themes use the same drawing backend
* fixed a problem with menu and number button triangles not accounting for buttons zoom
2008-12-28 23:14:37 +00:00
Joshua Leung
750bb40de3 2.5 Outliner - Mouse Clicks work again
A typo in the outliner_active poll() callback meant that the events were being skipped.
2008-12-28 22:26:02 +00:00
Nathan Letwory
2529d90985 2.5 / Nodes
* Operator to toggle node visibility (hide/unhide)
2008-12-28 21:41:33 +00:00
Nathan Letwory
2eaf79a53d 2.5 / Nodes
* shift-select operator, inheriting from normal select operator.
2008-12-28 20:49:37 +00:00
Diego Borghetti
f4d5da91f4 Tweak here.. tweak there.. and hope that the damn focus bug is fixed now!!
Also check that this bug cause (with some window manager) that blender
work really bad, for example change from one area to another with a popup
menu open make the view hmhm "blink" (show and unshow the menu when you move
the mouse) and when you return the menu is open.. also other things that
now work fine.
2008-12-28 19:16:07 +00:00
Ton Roosendaal
9b2dec9631 2.5
Recode of 'select all objects by type' to show
how to use itterators.
2008-12-28 18:10:24 +00:00
Andrea Weikert
7209837f2e 2.5
fix for win32 firing size event with undefined size.
2008-12-28 15:28:09 +00:00
Ton Roosendaal
149651b2f2 2.5
Quick bugfix: notifiers was reading NULL pointer after a file read.
2008-12-28 14:41:33 +00:00
Nathan Letwory
f7307c13e3 2.5 / Nodes
* tag region for redraw after select.
2008-12-28 13:24:44 +00:00
Campbell Barton
f9fd3d7139 minor changes and error checking.
tested first PyOperator, basics work now, invoke/exec can be used to make an operator that edits RNA or calls other operators.
2008-12-28 13:03:37 +00:00
Joshua Leung
1e463b22eb 2.5 - Action Editor:
* Added set-extrapolation operator. For now, this uses the Shift-E hotkey.
* Removed some unused code from keyframes_edit.c
2008-12-28 11:51:41 +00:00
Ton Roosendaal
f3fe2d0559 2.5
- New icons code crashed when using old (smaller) files, added a check
  and warning print for this case.
2008-12-28 11:28:44 +00:00
Andrea Weikert
7a7fb5add9 2.5 MSVC9 projectfiles
updates:
* BPY_python: bpy_opwrapper.c, bpy_util.c
* editors/space_action: action_edit_keyframes.c
* editors/space_node: node_ops.c, node_select.c
2008-12-28 11:27:54 +00:00
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
872d191113 * /W4 accidently slipped through. 2008-12-28 00:18:59 +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