2008-12-23 19:47:33 +00:00
|
|
|
/**
|
|
|
|
* $Id:
|
|
|
|
*
|
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
|
|
#include "DNA_object_types.h"
|
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
#include "DNA_screen_types.h"
|
|
|
|
#include "DNA_space_types.h"
|
|
|
|
#include "DNA_userdef_types.h"
|
|
|
|
#include "DNA_view3d_types.h"
|
|
|
|
#include "DNA_windowmanager_types.h"
|
|
|
|
|
2009-11-10 20:43:45 +00:00
|
|
|
#include "BLI_math.h"
|
2008-12-23 19:47:33 +00:00
|
|
|
#include "BLI_blenlib.h"
|
|
|
|
|
|
|
|
#include "BKE_context.h"
|
|
|
|
#include "BKE_global.h"
|
|
|
|
#include "BKE_utildefines.h"
|
|
|
|
|
|
|
|
#include "RNA_access.h"
|
|
|
|
#include "RNA_define.h"
|
|
|
|
|
|
|
|
#include "WM_api.h"
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
|
|
#include "ED_screen.h"
|
|
|
|
#include "ED_object.h"
|
|
|
|
|
|
|
|
#include "object_intern.h"
|
|
|
|
|
|
|
|
|
|
|
|
/* ************************** registration **********************************/
|
|
|
|
|
2009-01-02 03:16:38 +00:00
|
|
|
|
2008-12-23 19:47:33 +00:00
|
|
|
void ED_operatortypes_object(void)
|
|
|
|
{
|
2.5: Object module
* Split object_edit.c into multiple files:
object_add.c, object_edit.c, object_hook.c, object_relations.c,
object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
* vertex group menu and set active
* apply location, rotation, scale, visual transform (location is new)
* make local
* make vertex parent
* move to layer
* convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
up here...
2009-09-09 11:52:56 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_location_clear);
|
|
|
|
WM_operatortype_append(OBJECT_OT_rotation_clear);
|
|
|
|
WM_operatortype_append(OBJECT_OT_scale_clear);
|
|
|
|
WM_operatortype_append(OBJECT_OT_origin_clear);
|
|
|
|
WM_operatortype_append(OBJECT_OT_visual_transform_apply);
|
|
|
|
WM_operatortype_append(OBJECT_OT_location_apply);
|
|
|
|
WM_operatortype_append(OBJECT_OT_scale_apply);
|
|
|
|
WM_operatortype_append(OBJECT_OT_rotation_apply);
|
|
|
|
WM_operatortype_append(OBJECT_OT_center_set);
|
2.5
Operator goodies!
--- Macro operators
Operators now can consist of multiple operators. Such a macro operator
is identical and behaves identical to other opererators. Macros can
also be constructed of macros even! Currently only hardcoded macros are
implemented, this to solve combined operators such as 'add duplicate' or
'extrude' (both want a transform appended).
Usage is simple:
- WM_operatortype_append_macro() : add new operatortype, name, flags
- WM_operatortype_macro_define() : add existing operator to macro
(Note: macro_define will also allow properties to be set, doesnt work
right now)
On converting the macro wmOperatorType to a real operator, it makes a
list of all operators, and the standard macro callbacks (exec, invoke,
modal, poll) just will use all.
Important note; switching to a modal operator only works as last in the
chain now!
Macros implemented for duplicate, extrude and rip. Tool menu works fine
for it, also the redo hotkey F4 works properly.
--- Operator redo fix
The operators use the undo system to switch back, but this could give
errors if other actions added undo pushes (buttons, outliner). Now the
redo for operator searches back for the correct undo level.
This fixes issues with many redos.
Note for brecht: removed the ED_undo_push for buttons... it was called
on *every* button now, which is probably too much? For example, using
the 'toolbar' redo also caused this...
2009-07-29 17:56:38 +00:00
|
|
|
|
2009-08-16 05:48:07 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_mode_set);
|
2009-01-25 15:41:17 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_editmode_toggle);
|
2009-07-25 13:40:59 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_posemode_toggle);
|
2.5: Object module
* Split object_edit.c into multiple files:
object_add.c, object_edit.c, object_hook.c, object_relations.c,
object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
* vertex group menu and set active
* apply location, rotation, scale, visual transform (location is new)
* make local
* make vertex parent
* move to layer
* convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
up here...
2009-09-09 11:52:56 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_proxy_make);
|
|
|
|
WM_operatortype_append(OBJECT_OT_restrictview_clear);
|
|
|
|
WM_operatortype_append(OBJECT_OT_restrictview_set);
|
|
|
|
WM_operatortype_append(OBJECT_OT_shade_smooth);
|
|
|
|
WM_operatortype_append(OBJECT_OT_shade_flat);
|
|
|
|
|
2009-03-22 23:41:05 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_parent_set);
|
2009-10-26 11:20:16 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_parent_no_inverse_set);
|
2009-03-22 23:41:05 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_parent_clear);
|
2.5: Object module
* Split object_edit.c into multiple files:
object_add.c, object_edit.c, object_hook.c, object_relations.c,
object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
* vertex group menu and set active
* apply location, rotation, scale, visual transform (location is new)
* make local
* make vertex parent
* move to layer
* convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
up here...
2009-09-09 11:52:56 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_parent_set);
|
2009-03-22 23:41:05 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_track_set);
|
|
|
|
WM_operatortype_append(OBJECT_OT_track_clear);
|
2.5: Object module
* Split object_edit.c into multiple files:
object_add.c, object_edit.c, object_hook.c, object_relations.c,
object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
* vertex group menu and set active
* apply location, rotation, scale, visual transform (location is new)
* make local
* make vertex parent
* move to layer
* convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
up here...
2009-09-09 11:52:56 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_slow_parent_set);
|
|
|
|
WM_operatortype_append(OBJECT_OT_slow_parent_clear);
|
|
|
|
WM_operatortype_append(OBJECT_OT_make_local);
|
2009-10-16 10:00:45 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_make_single_user);
|
2009-11-04 10:25:57 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_make_links_scene);
|
|
|
|
WM_operatortype_append(OBJECT_OT_make_links_data);
|
2.5: Object module
* Split object_edit.c into multiple files:
object_add.c, object_edit.c, object_hook.c, object_relations.c,
object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
* vertex group menu and set active
* apply location, rotation, scale, visual transform (location is new)
* make local
* make vertex parent
* move to layer
* convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
up here...
2009-09-09 11:52:56 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_move_to_layer);
|
|
|
|
|
2009-07-08 21:31:28 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_select_inverse);
|
2009-03-24 12:16:58 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_select_random);
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_select_all_toggle);
|
2009-03-24 12:16:58 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_select_by_type);
|
|
|
|
WM_operatortype_append(OBJECT_OT_select_by_layer);
|
|
|
|
WM_operatortype_append(OBJECT_OT_select_linked);
|
2009-07-11 11:31:49 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_select_grouped);
|
2009-09-03 10:42:53 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_select_mirror);
|
2009-09-16 01:15:30 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_select_name); /* XXX - weak, not compat with linked objects */
|
2.5: Object module
* Split object_edit.c into multiple files:
object_add.c, object_edit.c, object_hook.c, object_relations.c,
object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
* vertex group menu and set active
* apply location, rotation, scale, visual transform (location is new)
* make local
* make vertex parent
* move to layer
* convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
up here...
2009-09-09 11:52:56 +00:00
|
|
|
|
2009-11-02 11:14:22 +00:00
|
|
|
WM_operatortype_append(GROUP_OT_create);
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_operatortype_append(GROUP_OT_objects_remove);
|
2009-01-20 10:50:36 +00:00
|
|
|
WM_operatortype_append(GROUP_OT_objects_add_active);
|
|
|
|
WM_operatortype_append(GROUP_OT_objects_remove_active);
|
2009-02-04 17:40:50 +00:00
|
|
|
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_delete);
|
2009-01-25 20:22:05 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_curve_add);
|
2.5: Text edit mode operators back. Took me a while getting
them nicely repeatable, and splitting up the big edit_text
operator into individual operator so it's all nicely scriptable,
documented, configurable, etc..
* Insert Text, Line Break, Insert Lorem
* Toggle Case, Set Case, Toggle Style, Set Style, Set Material
* Copy Text, Cut Text, Paste Text, Paste File, Paste Buffer
* Move, Move Select, Delete
* Change Spacing, Change Character
Notes
* Text (datablock) to Object doesn't work yet, will need to
implement text editor context for that.
* Some shortcut keys don't work because screen/wm overrides them,
ctrl+x, ctrl+left/right. That override goes top down which works
well for some cases, but here we need to override in the other
direction.
* There's no unicode support in RNA, or the user interface code
for that matter, but text strings can contain these characters.
At the moment it stores a UTF-8 string in char arrays, which is
supposed to be nicely compatible with ascii. Seems reasonable to
add support for UTF-8 in the interface code, python bindings, ..
eventually?
2009-02-17 19:55:20 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_text_add);
|
2009-02-13 17:37:01 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_surface_add);
|
2009-02-18 09:28:04 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_armature_add);
|
2009-09-21 10:54:15 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_lamp_add);
|
2.5: Object module
* Split object_edit.c into multiple files:
object_add.c, object_edit.c, object_hook.c, object_relations.c,
object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
* vertex group menu and set active
* apply location, rotation, scale, visual transform (location is new)
* make local
* make vertex parent
* move to layer
* convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
up here...
2009-09-09 11:52:56 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_add);
|
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_effector_add);
|
2009-10-07 14:40:27 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_group_instance_add);
|
2009-07-29 12:35:09 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_metaball_add);
|
2.5: Object module
* Split object_edit.c into multiple files:
object_add.c, object_edit.c, object_hook.c, object_relations.c,
object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
* vertex group menu and set active
* apply location, rotation, scale, visual transform (location is new)
* make local
* make vertex parent
* move to layer
* convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
up here...
2009-09-09 11:52:56 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_duplicates_make_real);
|
|
|
|
WM_operatortype_append(OBJECT_OT_duplicate);
|
|
|
|
WM_operatortype_append(OBJECT_OT_join);
|
|
|
|
WM_operatortype_append(OBJECT_OT_convert);
|
2009-04-27 18:05:58 +00:00
|
|
|
|
|
|
|
WM_operatortype_append(OBJECT_OT_modifier_add);
|
2009-07-02 19:41:31 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_modifier_remove);
|
|
|
|
WM_operatortype_append(OBJECT_OT_modifier_move_up);
|
|
|
|
WM_operatortype_append(OBJECT_OT_modifier_move_down);
|
|
|
|
WM_operatortype_append(OBJECT_OT_modifier_apply);
|
|
|
|
WM_operatortype_append(OBJECT_OT_modifier_convert);
|
|
|
|
WM_operatortype_append(OBJECT_OT_modifier_copy);
|
2009-05-23 07:12:55 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_multires_subdivide);
|
2009-09-03 17:45:04 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_multires_higher_levels_delete);
|
2009-08-21 02:51:56 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_meshdeform_bind);
|
|
|
|
WM_operatortype_append(OBJECT_OT_explode_refresh);
|
2009-11-22 06:20:56 +00:00
|
|
|
|
2009-05-27 00:03:49 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_constraint_add);
|
2009-07-20 12:42:31 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_constraint_add_with_targets);
|
2009-07-14 20:27:28 +00:00
|
|
|
WM_operatortype_append(POSE_OT_constraint_add);
|
2009-07-20 12:42:31 +00:00
|
|
|
WM_operatortype_append(POSE_OT_constraint_add_with_targets);
|
2009-07-19 07:20:21 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_constraints_clear);
|
|
|
|
WM_operatortype_append(POSE_OT_constraints_clear);
|
2009-07-21 04:21:07 +00:00
|
|
|
WM_operatortype_append(POSE_OT_ik_add);
|
|
|
|
WM_operatortype_append(POSE_OT_ik_clear);
|
2009-07-11 12:54:17 +00:00
|
|
|
WM_operatortype_append(CONSTRAINT_OT_delete);
|
|
|
|
WM_operatortype_append(CONSTRAINT_OT_move_up);
|
|
|
|
WM_operatortype_append(CONSTRAINT_OT_move_down);
|
2009-07-26 11:57:27 +00:00
|
|
|
WM_operatortype_append(CONSTRAINT_OT_stretchto_reset);
|
|
|
|
WM_operatortype_append(CONSTRAINT_OT_limitdistance_reset);
|
2009-07-11 11:52:20 +00:00
|
|
|
WM_operatortype_append(CONSTRAINT_OT_childof_set_inverse);
|
|
|
|
WM_operatortype_append(CONSTRAINT_OT_childof_clear_inverse);
|
2009-07-01 22:25:49 +00:00
|
|
|
|
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_add);
|
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_remove);
|
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_assign);
|
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_remove_from);
|
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_select);
|
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_deselect);
|
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_copy_to_linked);
|
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_copy);
|
2009-10-20 10:19:48 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_normalize);
|
2009-10-20 13:59:26 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_normalize_all);
|
2009-10-20 10:19:48 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_invert);
|
2009-11-20 05:09:57 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_levels);
|
2009-10-20 16:31:03 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_blend);
|
2009-10-20 10:19:48 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_clean);
|
2.5: Object module
* Split object_edit.c into multiple files:
object_add.c, object_edit.c, object_hook.c, object_relations.c,
object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
* vertex group menu and set active
* apply location, rotation, scale, visual transform (location is new)
* make local
* make vertex parent
* move to layer
* convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
up here...
2009-09-09 11:52:56 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_set_active);
|
2009-07-01 22:25:49 +00:00
|
|
|
|
2009-08-26 12:51:27 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_game_property_new);
|
|
|
|
WM_operatortype_append(OBJECT_OT_game_property_remove);
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_shape_key_add);
|
|
|
|
WM_operatortype_append(OBJECT_OT_shape_key_remove);
|
2009-10-16 10:29:41 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_shape_key_clear);
|
2009-10-16 13:04:59 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_shape_key_mirror);
|
2009-10-21 14:33:52 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_shape_key_move);
|
2009-07-03 15:23:33 +00:00
|
|
|
|
|
|
|
WM_operatortype_append(LATTICE_OT_select_all_toggle);
|
|
|
|
WM_operatortype_append(LATTICE_OT_make_regular);
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
|
|
|
|
WM_operatortype_append(OBJECT_OT_group_add);
|
|
|
|
WM_operatortype_append(OBJECT_OT_group_remove);
|
2009-11-16 13:59:27 +00:00
|
|
|
|
2009-11-22 06:20:56 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_hook_add_selobj);
|
|
|
|
WM_operatortype_append(OBJECT_OT_hook_add_newobj);
|
|
|
|
WM_operatortype_append(OBJECT_OT_hook_remove);
|
|
|
|
WM_operatortype_append(OBJECT_OT_hook_select);
|
|
|
|
WM_operatortype_append(OBJECT_OT_hook_assign);
|
|
|
|
WM_operatortype_append(OBJECT_OT_hook_reset);
|
|
|
|
WM_operatortype_append(OBJECT_OT_hook_recenter);
|
2009-10-12 12:54:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ED_operatormacros_object(void)
|
|
|
|
{
|
|
|
|
wmOperatorType *ot;
|
2009-10-20 21:12:09 +00:00
|
|
|
wmOperatorTypeMacro *otmacro;
|
2.5
Operator goodies!
--- Macro operators
Operators now can consist of multiple operators. Such a macro operator
is identical and behaves identical to other opererators. Macros can
also be constructed of macros even! Currently only hardcoded macros are
implemented, this to solve combined operators such as 'add duplicate' or
'extrude' (both want a transform appended).
Usage is simple:
- WM_operatortype_append_macro() : add new operatortype, name, flags
- WM_operatortype_macro_define() : add existing operator to macro
(Note: macro_define will also allow properties to be set, doesnt work
right now)
On converting the macro wmOperatorType to a real operator, it makes a
list of all operators, and the standard macro callbacks (exec, invoke,
modal, poll) just will use all.
Important note; switching to a modal operator only works as last in the
chain now!
Macros implemented for duplicate, extrude and rip. Tool menu works fine
for it, also the redo hotkey F4 works properly.
--- Operator redo fix
The operators use the undo system to switch back, but this could give
errors if other actions added undo pushes (buttons, outliner). Now the
redo for operator searches back for the correct undo level.
This fixes issues with many redos.
Note for brecht: removed the ED_undo_push for buttons... it was called
on *every* button now, which is probably too much? For example, using
the 'toolbar' redo also caused this...
2009-07-29 17:56:38 +00:00
|
|
|
|
2009-09-10 14:20:21 +00:00
|
|
|
ot= WM_operatortype_append_macro("OBJECT_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
|
2.5
Operator goodies!
--- Macro operators
Operators now can consist of multiple operators. Such a macro operator
is identical and behaves identical to other opererators. Macros can
also be constructed of macros even! Currently only hardcoded macros are
implemented, this to solve combined operators such as 'add duplicate' or
'extrude' (both want a transform appended).
Usage is simple:
- WM_operatortype_append_macro() : add new operatortype, name, flags
- WM_operatortype_macro_define() : add existing operator to macro
(Note: macro_define will also allow properties to be set, doesnt work
right now)
On converting the macro wmOperatorType to a real operator, it makes a
list of all operators, and the standard macro callbacks (exec, invoke,
modal, poll) just will use all.
Important note; switching to a modal operator only works as last in the
chain now!
Macros implemented for duplicate, extrude and rip. Tool menu works fine
for it, also the redo hotkey F4 works properly.
--- Operator redo fix
The operators use the undo system to switch back, but this could give
errors if other actions added undo pushes (buttons, outliner). Now the
redo for operator searches back for the correct undo level.
This fixes issues with many redos.
Note for brecht: removed the ED_undo_push for buttons... it was called
on *every* button now, which is probably too much? For example, using
the 'toolbar' redo also caused this...
2009-07-29 17:56:38 +00:00
|
|
|
if(ot) {
|
|
|
|
WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate");
|
2009-10-30 17:48:50 +00:00
|
|
|
otmacro= WM_operatortype_macro_define(ot, "TFM_OT_translate");
|
|
|
|
RNA_enum_set(otmacro->ptr, "proportional", PROP_EDIT_OFF);
|
2.5
Operator goodies!
--- Macro operators
Operators now can consist of multiple operators. Such a macro operator
is identical and behaves identical to other opererators. Macros can
also be constructed of macros even! Currently only hardcoded macros are
implemented, this to solve combined operators such as 'add duplicate' or
'extrude' (both want a transform appended).
Usage is simple:
- WM_operatortype_append_macro() : add new operatortype, name, flags
- WM_operatortype_macro_define() : add existing operator to macro
(Note: macro_define will also allow properties to be set, doesnt work
right now)
On converting the macro wmOperatorType to a real operator, it makes a
list of all operators, and the standard macro callbacks (exec, invoke,
modal, poll) just will use all.
Important note; switching to a modal operator only works as last in the
chain now!
Macros implemented for duplicate, extrude and rip. Tool menu works fine
for it, also the redo hotkey F4 works properly.
--- Operator redo fix
The operators use the undo system to switch back, but this could give
errors if other actions added undo pushes (buttons, outliner). Now the
redo for operator searches back for the correct undo level.
This fixes issues with many redos.
Note for brecht: removed the ED_undo_push for buttons... it was called
on *every* button now, which is probably too much? For example, using
the 'toolbar' redo also caused this...
2009-07-29 17:56:38 +00:00
|
|
|
}
|
2009-10-20 21:12:09 +00:00
|
|
|
|
|
|
|
/* grr, should be able to pass options on... */
|
|
|
|
ot= WM_operatortype_append_macro("OBJECT_OT_duplicate_move_linked", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
|
|
|
|
if(ot) {
|
|
|
|
otmacro= WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate");
|
|
|
|
RNA_boolean_set(otmacro->ptr, "linked", 1);
|
2009-10-30 17:48:50 +00:00
|
|
|
otmacro= WM_operatortype_macro_define(ot, "TFM_OT_translate");
|
|
|
|
RNA_enum_set(otmacro->ptr, "proportional", PROP_EDIT_OFF);
|
2009-10-20 21:12:09 +00:00
|
|
|
}
|
2008-12-23 19:47:33 +00:00
|
|
|
}
|
|
|
|
|
2009-09-17 21:36:02 +00:00
|
|
|
static int object_mode_poll(bContext *C)
|
|
|
|
{
|
|
|
|
Object *ob= CTX_data_active_object(C);
|
|
|
|
return (!ob || ob->mode == OB_MODE_OBJECT);
|
|
|
|
}
|
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
void ED_keymap_object(wmKeyConfig *keyconf)
|
2008-12-23 19:47:33 +00:00
|
|
|
{
|
2009-09-17 21:36:02 +00:00
|
|
|
wmKeyMap *keymap;
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
wmKeyMapItem *kmi;
|
2008-12-23 19:47:33 +00:00
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
keymap= WM_keymap_find(keyconf, "Object Non-modal", 0, 0);
|
2009-09-17 21:36:02 +00:00
|
|
|
|
2009-01-01 13:15:35 +00:00
|
|
|
/* Note: this keymap works disregarding mode */
|
2009-11-03 11:00:10 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0);
|
|
|
|
RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT);
|
|
|
|
RNA_boolean_set(kmi->ptr, "toggle", 1);
|
|
|
|
|
|
|
|
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
RNA_enum_set(kmi->ptr, "mode", OB_MODE_POSE);
|
|
|
|
RNA_boolean_set(kmi->ptr, "toggle", 1);
|
|
|
|
|
|
|
|
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", VKEY, KM_PRESS, 0, 0);
|
|
|
|
RNA_enum_set(kmi->ptr, "mode", OB_MODE_VERTEX_PAINT);
|
|
|
|
RNA_boolean_set(kmi->ptr, "toggle", 1);
|
2009-08-22 02:53:14 +00:00
|
|
|
|
|
|
|
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", VKEY, KM_PRESS, 0, 0);
|
|
|
|
RNA_enum_set(kmi->ptr, "mode", OB_MODE_VERTEX_PAINT);
|
|
|
|
RNA_boolean_set(kmi->ptr, "toggle", 1);
|
|
|
|
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
RNA_enum_set(kmi->ptr, "mode", OB_MODE_WEIGHT_PAINT);
|
|
|
|
RNA_boolean_set(kmi->ptr, "toggle", 1);
|
|
|
|
|
2009-07-20 12:42:31 +00:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_center_set", CKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_CTRL, 0);
|
2009-01-01 13:15:35 +00:00
|
|
|
|
|
|
|
/* Note: this keymap gets disabled in non-objectmode, */
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
keymap= WM_keymap_find(keyconf, "Object Mode", 0, 0);
|
2009-09-17 21:36:02 +00:00
|
|
|
keymap->poll= object_mode_poll;
|
2009-01-01 13:15:35 +00:00
|
|
|
|
2009-10-30 17:48:50 +00:00
|
|
|
/* object mode supports PET now */
|
|
|
|
ED_object_generic_keymap(keyconf, keymap, TRUE);
|
|
|
|
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
|
2009-07-08 21:31:28 +00:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0);
|
2009-03-24 12:16:58 +00:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_select_linked", LKEY, KM_PRESS, KM_SHIFT, 0);
|
2009-07-11 11:31:49 +00:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0);
|
2009-09-03 10:42:53 +00:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_select_mirror", MKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
|
2009-01-13 09:48:25 +00:00
|
|
|
|
2009-03-22 23:41:05 +00:00
|
|
|
WM_keymap_verify_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
|
2009-10-26 11:20:16 +00:00
|
|
|
WM_keymap_verify_item(keymap, "OBJECT_OT_parent_no_inverse_set", PKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
|
2009-03-22 23:41:05 +00:00
|
|
|
WM_keymap_verify_item(keymap, "OBJECT_OT_parent_clear", PKEY, KM_PRESS, KM_ALT, 0);
|
|
|
|
WM_keymap_verify_item(keymap, "OBJECT_OT_track_set", TKEY, KM_PRESS, KM_CTRL, 0);
|
2009-07-14 20:27:28 +00:00
|
|
|
WM_keymap_verify_item(keymap, "OBJECT_OT_track_clear", TKEY, KM_PRESS, KM_ALT, 0);
|
2008-12-23 19:47:33 +00:00
|
|
|
|
2009-07-20 12:42:31 +00:00
|
|
|
WM_keymap_verify_item(keymap, "OBJECT_OT_constraint_add_with_targets", CKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
|
|
|
|
WM_keymap_verify_item(keymap, "OBJECT_OT_constraints_clear", CKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
|
2009-07-19 13:06:18 +00:00
|
|
|
|
2009-03-22 23:41:05 +00:00
|
|
|
WM_keymap_verify_item(keymap, "OBJECT_OT_location_clear", GKEY, KM_PRESS, KM_ALT, 0);
|
|
|
|
WM_keymap_verify_item(keymap, "OBJECT_OT_rotation_clear", RKEY, KM_PRESS, KM_ALT, 0);
|
|
|
|
WM_keymap_verify_item(keymap, "OBJECT_OT_scale_clear", SKEY, KM_PRESS, KM_ALT, 0);
|
|
|
|
WM_keymap_verify_item(keymap, "OBJECT_OT_origin_clear", OKEY, KM_PRESS, KM_ALT, 0);
|
2009-01-02 03:16:38 +00:00
|
|
|
|
2009-07-10 13:56:29 +00:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_restrictview_clear", HKEY, KM_PRESS, KM_ALT, 0);
|
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_restrictview_set", HKEY, KM_PRESS, 0, 0);
|
|
|
|
RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_restrictview_set", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
|
2009-10-07 10:54:43 +00:00
|
|
|
|
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_move_to_layer", MKEY, KM_PRESS, 0, 0);
|
2009-01-15 16:07:39 +00:00
|
|
|
|
2009-09-15 12:45:05 +00:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, 0, 0);
|
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
2009-11-17 15:29:55 +00:00
|
|
|
WM_keymap_add_menu(keymap, "INFO_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0);
|
2009-10-08 19:06:32 +00:00
|
|
|
|
2009-10-16 10:00:45 +00:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_duplicates_make_real", AKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
|
|
|
|
|
2009-11-17 15:29:55 +00:00
|
|
|
WM_keymap_add_menu(keymap, "VIEW3D_MT_object_apply", AKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
WM_keymap_add_menu(keymap, "VIEW3D_MT_make_single_user", UKEY, KM_PRESS, 0, 0);
|
|
|
|
WM_keymap_add_menu(keymap, "VIEW3D_MT_make_links", LKEY, KM_PRESS, KM_CTRL, 0);
|
2009-10-16 10:00:45 +00:00
|
|
|
|
2.5
Operator goodies!
--- Macro operators
Operators now can consist of multiple operators. Such a macro operator
is identical and behaves identical to other opererators. Macros can
also be constructed of macros even! Currently only hardcoded macros are
implemented, this to solve combined operators such as 'add duplicate' or
'extrude' (both want a transform appended).
Usage is simple:
- WM_operatortype_append_macro() : add new operatortype, name, flags
- WM_operatortype_macro_define() : add existing operator to macro
(Note: macro_define will also allow properties to be set, doesnt work
right now)
On converting the macro wmOperatorType to a real operator, it makes a
list of all operators, and the standard macro callbacks (exec, invoke,
modal, poll) just will use all.
Important note; switching to a modal operator only works as last in the
chain now!
Macros implemented for duplicate, extrude and rip. Tool menu works fine
for it, also the redo hotkey F4 works properly.
--- Operator redo fix
The operators use the undo system to switch back, but this could give
errors if other actions added undo pushes (buttons, outliner). Now the
redo for operator searches back for the correct undo level.
This fixes issues with many redos.
Note for brecht: removed the ED_undo_push for buttons... it was called
on *every* button now, which is probably too much? For example, using
the 'toolbar' redo also caused this...
2009-07-29 17:56:38 +00:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
|
2009-10-20 21:12:09 +00:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_duplicate_move_linked", DKEY, KM_PRESS, KM_ALT, 0);
|
|
|
|
|
2009-07-13 00:40:20 +00:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_join", JKEY, KM_PRESS, KM_CTRL, 0);
|
2009-09-22 04:40:16 +00:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_convert", CKEY, KM_PRESS, KM_ALT, 0);
|
2009-07-28 03:54:40 +00:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_proxy_make", PKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
|
2009-10-16 10:00:45 +00:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_make_local", LKEY, KM_PRESS, 0, 0);
|
|
|
|
|
2.5: Blender "Animato" - New Animation System
Finally, here is the basic (functional) prototype of the new animation system which will allow for the infamous "everything is animatable", and which also addresses several of the more serious shortcomings of the old system. Unfortunately, this will break old animation files (especially right now, as I haven't written the version patching code yet), however, this is for the future.
Highlights of the new system:
* Scrapped IPO-Curves/IPO/(Action+Constraint-Channels)/Action system, and replaced it with F-Curve/Action.
- F-Curves (animators from other packages will feel at home with this name) replace IPO-Curves.
- The 'new' Actions, act as the containers for F-Curves, so that they can be reused. They are therefore more akin to the old 'IPO' blocks, except they do not have the blocktype restriction, so you can store materials/texture/geometry F-Curves in the same Action as Object transforms, etc.
* F-Curves use RNA-paths for Data Access, hence allowing "every" (where sensible/editable that is) user-accessible setting from RNA to be animated.
* Drivers are no longer mixed with Animation Data, so rigs will not be that easily broken and several dependency problems can be eliminated. (NOTE: drivers haven't been hooked up yet, but the code is in place)
* F-Curve modifier system allows useful 'large-scale' manipulation of F-Curve values, including (I've only included implemented ones here): envelope deform (similar to lattices to allow broad-scale reshaping of curves), curve generator (polynomial or py-expression), cycles (replacing the old cyclic extrapolation modes, giving more control over this). (NOTE: currently this cannot be tested, as there's not access to them, but the code is all in place)
* NLA system with 'tracks' (i.e. layers), and multiple strips per track. (NOTE: NLA system is not yet functional, as it's only partially coded still)
There are more nice things that I will be preparing some nice docs for soon, but for now, check for more details:
http://lists.blender.org/pipermail/bf-taskforce25/2009-January/000260.html
So, what currently works:
* I've implemented two basic operators for the 3D-view only to Insert and Delete Keyframes. These are tempolary ones only that will be replaced in due course with 'proper' code.
* Object Loc/Rot/Scale can be keyframed. Also, the colour of the 'active' material (Note: this should really be for nth material instead, but that doesn't work yet in RNA) can also be keyframed into the same datablock.
* Standard animation refresh (i.e. animation resulting from NLA and Action evaluation) is now done completely separate from drivers before anything else is done after a frame change. Drivers are handled after this in a separate pass, as dictated by depsgraph flags, etc.
Notes:
* Drivers haven't been hooked up yet
* Only objects and data directly linked to objects can be animated.
* Depsgraph will need further tweaks. Currently, I've only made sure that it will update some things in the most basic cases (i.e. frame change).
* Animation Editors are currently broken (in terms of editing stuff). This will be my next target (priority to get Dopesheet working first, then F-Curve editor - i.e. old IPO Editor)
* I've had to put in large chunks of XXX sandboxing for old animation system code all around the place. This will be cleaned up in due course, as some places need special review.
In particular, the particles and sequencer code have far too many manual calls to calculate + flush animation info, which is really bad (this is a 'please explain yourselves' call to Physics coders!).
2009-01-17 03:12:50 +00:00
|
|
|
// XXX this should probably be in screen instead... here for testing purposes in the meantime... - Aligorith
|
2009-03-31 22:36:13 +00:00
|
|
|
WM_keymap_verify_item(keymap, "ANIM_OT_insert_keyframe_menu", IKEY, KM_PRESS, 0, 0);
|
2009-07-24 08:05:56 +00:00
|
|
|
WM_keymap_verify_item(keymap, "ANIM_OT_delete_keyframe_v3d", IKEY, KM_PRESS, KM_ALT, 0);
|
2009-01-20 03:41:23 +00:00
|
|
|
|
2009-11-02 11:14:22 +00:00
|
|
|
WM_keymap_verify_item(keymap, "GROUP_OT_create", GKEY, KM_PRESS, KM_CTRL, 0);
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_keymap_verify_item(keymap, "GROUP_OT_objects_remove", GKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
|
2009-01-20 10:50:36 +00:00
|
|
|
WM_keymap_verify_item(keymap, "GROUP_OT_objects_add_active", GKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
|
|
|
|
WM_keymap_verify_item(keymap, "GROUP_OT_objects_remove_active", GKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0);
|
|
|
|
|
2009-07-03 15:23:33 +00:00
|
|
|
/* Lattice */
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
keymap= WM_keymap_find(keyconf, "Lattice", 0, 0);
|
2009-09-17 21:36:02 +00:00
|
|
|
keymap->poll= ED_operator_editlattice;
|
2009-07-03 15:23:33 +00:00
|
|
|
|
|
|
|
WM_keymap_add_item(keymap, "LATTICE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
|
2009-10-20 20:59:02 +00:00
|
|
|
|
|
|
|
ED_object_generic_keymap(keyconf, keymap, TRUE);
|
2008-12-23 19:47:33 +00:00
|
|
|
}
|
|
|
|
|
2009-10-13 15:30:19 +00:00
|
|
|
void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap, int do_pet)
|
|
|
|
{
|
|
|
|
wmKeyMapItem *km;
|
|
|
|
|
2009-11-21 13:01:28 +00:00
|
|
|
/* snap */
|
|
|
|
km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0);
|
|
|
|
RNA_string_set(km->ptr, "path", "scene.tool_settings.snap");
|
|
|
|
|
2009-10-13 15:30:19 +00:00
|
|
|
/* used by mesh, curve & lattice only */
|
|
|
|
if(do_pet) {
|
|
|
|
/* context ops */
|
|
|
|
km = WM_keymap_add_item(keymap, "WM_OT_context_cycle_enum", OKEY, KM_PRESS, KM_SHIFT, 0);
|
|
|
|
RNA_string_set(km->ptr, "path", "scene.tool_settings.proportional_editing_falloff");
|
|
|
|
|
2009-10-14 20:09:21 +00:00
|
|
|
km = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, 0, 0);
|
2009-10-13 15:30:19 +00:00
|
|
|
RNA_string_set(km->ptr, "path", "scene.tool_settings.proportional_editing");
|
2009-10-14 20:09:21 +00:00
|
|
|
RNA_string_set(km->ptr, "value_1", "DISABLED");
|
|
|
|
RNA_string_set(km->ptr, "value_2", "ENABLED");
|
2009-10-13 15:30:19 +00:00
|
|
|
|
2009-10-14 20:09:21 +00:00
|
|
|
km = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, KM_ALT, 0);
|
2009-10-13 15:30:19 +00:00
|
|
|
RNA_string_set(km->ptr, "path", "scene.tool_settings.proportional_editing");
|
2009-10-14 20:09:21 +00:00
|
|
|
RNA_string_set(km->ptr, "value_1", "DISABLED");
|
|
|
|
RNA_string_set(km->ptr, "value_2", "CONNECTED");
|
2009-10-13 15:30:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|