2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2008-12-23 19:47:33 +00:00
|
|
|
* 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
|
2018-06-01 18:19:39 +02:00
|
|
|
* of the License, or (at your option) any later version.
|
2008-12-23 19:47:33 +00:00
|
|
|
*
|
|
|
|
* 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,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-12-23 19:47:33 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup edobj
|
2011-02-27 20:29:51 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2008-12-23 19:47:33 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
#include "DNA_object_types.h"
|
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
|
2011-01-07 18:36:47 +00:00
|
|
|
#include "BLI_utildefines.h"
|
2008-12-23 19:47:33 +00:00
|
|
|
|
|
|
|
#include "BKE_context.h"
|
|
|
|
|
|
|
|
#include "RNA_access.h"
|
2018-07-25 11:02:12 +10:00
|
|
|
#include "RNA_enum_types.h"
|
2008-12-23 19:47:33 +00:00
|
|
|
|
|
|
|
#include "WM_api.h"
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
|
|
#include "ED_screen.h"
|
2018-08-14 10:28:41 +10:00
|
|
|
#include "ED_select_utils.h"
|
2008-12-23 19:47:33 +00:00
|
|
|
#include "ED_object.h"
|
|
|
|
|
2018-02-06 17:53:19 +11:00
|
|
|
#include "DEG_depsgraph.h"
|
|
|
|
|
2008-12-23 19:47:33 +00:00
|
|
|
#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);
|
2011-05-03 07:09:02 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_transform_apply);
|
2017-08-06 19:47:25 +10:00
|
|
|
WM_operatortype_append(OBJECT_OT_transform_axis_target);
|
2009-12-03 21:56:04 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_origin_set);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-08-16 05:48:07 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_mode_set);
|
2018-05-29 17:25:19 +02:00
|
|
|
WM_operatortype_append(OBJECT_OT_mode_set_or_submode);
|
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_shade_smooth);
|
|
|
|
WM_operatortype_append(OBJECT_OT_shade_flat);
|
2010-01-19 11:31:49 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_paths_calculate);
|
2012-05-06 04:18:13 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_paths_update);
|
2010-01-19 11:31:49 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_paths_clear);
|
2018-08-20 16:12:37 +12:00
|
|
|
WM_operatortype_append(OBJECT_OT_paths_range_update);
|
2011-01-23 14:04:31 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_forcefield_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
|
|
|
|
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_make_local);
|
2018-01-16 17:10:36 +01:00
|
|
|
WM_operatortype_append(OBJECT_OT_make_override_static);
|
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
|
|
|
|
2009-03-24 12:16:58 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_select_random);
|
2009-11-29 22:16:29 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_select_all);
|
2018-03-29 17:41:17 -03:00
|
|
|
WM_operatortype_append(OBJECT_OT_select_same_collection);
|
2009-03-24 12:16:58 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_select_by_type);
|
|
|
|
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);
|
2016-01-14 09:38:26 +11:00
|
|
|
WM_operatortype_append(OBJECT_OT_select_more);
|
|
|
|
WM_operatortype_append(OBJECT_OT_select_less);
|
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
|
|
|
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
WM_operatortype_append(COLLECTION_OT_create);
|
|
|
|
WM_operatortype_append(COLLECTION_OT_objects_remove_all);
|
|
|
|
WM_operatortype_append(COLLECTION_OT_objects_remove);
|
|
|
|
WM_operatortype_append(COLLECTION_OT_objects_add_active);
|
|
|
|
WM_operatortype_append(COLLECTION_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);
|
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-18 09:28:04 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_armature_add);
|
Clean up in "add object" code:
* Get rid of ED_object_add_generic_invoke() and all invoke callbacks using it, it was doing nothing exec() callbacks would not do. In fact, its only action (setting part of common add ops properties, like loc, layers, etc.) was needed too by direct exec call, so it was done twice in case of using invoke()!
* Replace custom invoke code for metaballs by WM_menu_invoke helper (as already used by lamps).
* Add a new OBJECT_OT_empty_add op, to allow direct addition of empties of a given drawtype.
* And some general code cleanup (like trailing spaces, empty lines, ...).
Did quite a bunch of tests/verifications, but obviously could not tackle all possible scenarios... Anyway, if any, bugs should arize quite quickly (but I don’t expect any! :p ).
2012-10-05 12:59:09 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_empty_add);
|
2017-06-12 20:59:54 +10:00
|
|
|
WM_operatortype_append(OBJECT_OT_lightprobe_add);
|
2013-02-24 23:18:21 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_drop_named_image);
|
2018-07-31 10:22:19 +02:00
|
|
|
WM_operatortype_append(OBJECT_OT_gpencil_add);
|
2018-06-27 14:41:53 +02:00
|
|
|
WM_operatortype_append(OBJECT_OT_light_add);
|
2010-01-11 06:57:41 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_camera_add);
|
2011-08-01 11:44:20 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_speaker_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);
|
Drag and drop 2.5 integration! Finally, slashdot regulars can use
Blender too now! :)
** Drag works as follows:
- drag-able items are defined by the standard interface ui toolkit
- each button can get this feature, via uiButSetDragXXX(but, ...).
There are calls to define drag-able images, ID blocks, RNA paths,
file paths, and so on. By default you drag an icon, exceptionally
an ImBuf
- Drag items are registered centrally in the WM, it allows more drag
items simultaneous too, but not implemented
** Drop works as follows:
- On mouse release, and if drag items exist in the WM, it converts
the mouse event to an EVT_DROP type. This event then gets the full
drag info as customdata
- drop regions are defined with WM_dropbox_add(), similar to keymaps
you can make a "drop map" this way, which become 'drop map handlers'
in the queues.
- next to that the UI kit handles some common button types (like
accepting ID or names) to be catching a drop event too.
- Every "drop box" has two callbacks:
- poll() = check if the event drag data is relevant for this box
- copy() = fill in custom properties in the dropbox to initialize
an operator
- The dropbox handler then calls its standard Operator with its
dropbox properties.
** Currently implemented
Drag items:
- ID icons in browse buttons
- ID icons in context menu of properties region
- ID icons in outliner and rna viewer
- FileBrowser icons
- FileBrowser preview images
Drag-able icons are subtly visualized by making them brighter a bit
on mouse-over. In case the icon is a button or UI element too (most
cases), the drag-able feature will make the item react to
mouse-release instead of mouse-press.
Drop options:
- UI buttons: ID and text buttons (paste name)
- View3d: Object ID drop copies object
- View3d: Material ID drop assigns to object under cursor
- View3d: Image ID drop assigns to object UV texture under cursor
- Sequencer: Path drop will add either Image or Movie strip
- Image window: Path drop will open image
** Drag and drop Notes:
- Dropping into another Blender window (from same application) works
too. I've added code that passes on mousemoves and clicks to other
windows, without activating them though. This does make using multi-window
Blender a bit friendler.
- Dropping a file path to an image, is not the same as dropping an
Image ID... keep this in mind. Sequencer for example wants paths to
be dropped, textures in 3d window wants an Image ID.
- Although drop boxes could be defined via Python, I suggest they're
part of the UI and editor design (= how we want an editor to work), and
not default offered configurable like keymaps.
- At the moment only one item can be dragged at a time. This is for
several reasons.... For one, Blender doesn't have a well defined
uniform way to define "what is selected" (files, outliner items, etc).
Secondly there's potential conflicts on what todo when you drop mixed
drag sets on spots. All undefined stuff... nice for later.
- Example to bypass the above: a collection of images that form a strip,
should be represented in filewindow as a single sequence anyway.
This then will fit well and gets handled neatly by design.
- Another option to check is to allow multiple options per drop... it
could show the operator as a sort of menu, allowing arrow or scrollwheel
to choose. For time being I'd prefer to try to design a singular drop
though, just offer only one drop action per data type on given spots.
- What does work already, but a tad slow, is to use a function that
detects an object (type) under cursor, so a drag item's option can be
further refined (like drop object on object = parent). (disabled)
** More notes
- Added saving for Region layouts (like split points for toolbar)
- Label buttons now handle mouse over
- File list: added full path entry for drop feature.
- Filesel bugfix: wm_operator_exec() got called there and fully handled,
while WM event code tried same. Added new OPERATOR_HANDLED flag for this.
Maybe python needs it too?
- Cocoa: added window move event, so multi-win setups work OK (didnt save).
- Interface_handlers.c: removed win->active
- Severe area copy bug: area handlers were not set to NULL
- Filesel bugfix: next/prev folder list was not copied on area copies
** Leftover todos
- Cocoa windows seem to hang on cases still... needs check
- Cocoa 'draw overlap' swap doesn't work
- Cocoa window loses focus permanently on using Spotlight
(for these reasons, makefile building has Carbon as default atm)
- ListView templates in UI cannot become dragged yet, needs review...
it consists of two overlapping UI elements, preventing handling icon clicks.
- There's already Ghost library code to handle dropping from OS
into Blender window. I've noticed this code is unfinished for Macs, but
seems to be complete for Windows. Needs test... currently, an external
drop event will print in console when succesfully delivered to Blender's WM.
2010-01-26 18:18:21 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_add_named);
|
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);
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
WM_operatortype_append(OBJECT_OT_collection_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);
|
2009-11-28 04:04:01 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_join_shapes);
|
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_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);
|
2016-12-28 17:30:58 +01:00
|
|
|
WM_operatortype_append(OBJECT_OT_modifier_convert);
|
2009-07-02 19:41:31 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_modifier_copy);
|
2009-05-23 07:12:55 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_multires_subdivide);
|
2009-12-21 15:55:10 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_multires_reshape);
|
2009-09-03 17:45:04 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_multires_higher_levels_delete);
|
2011-01-07 21:12:47 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_multires_base_apply);
|
2010-06-09 14:04:34 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_multires_external_save);
|
|
|
|
WM_operatortype_append(OBJECT_OT_multires_external_pack);
|
2012-05-22 15:29:44 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_skin_root_mark);
|
|
|
|
WM_operatortype_append(OBJECT_OT_skin_loose_mark_clear);
|
|
|
|
WM_operatortype_append(OBJECT_OT_skin_radii_equalize);
|
2012-05-22 15:29:57 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_skin_armature_create);
|
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* grease pencil modifiers */
|
|
|
|
WM_operatortype_append(OBJECT_OT_gpencil_modifier_add);
|
|
|
|
WM_operatortype_append(OBJECT_OT_gpencil_modifier_remove);
|
|
|
|
WM_operatortype_append(OBJECT_OT_gpencil_modifier_move_up);
|
|
|
|
WM_operatortype_append(OBJECT_OT_gpencil_modifier_move_down);
|
|
|
|
WM_operatortype_append(OBJECT_OT_gpencil_modifier_apply);
|
|
|
|
WM_operatortype_append(OBJECT_OT_gpencil_modifier_copy);
|
|
|
|
|
|
|
|
/* shader fx */
|
|
|
|
WM_operatortype_append(OBJECT_OT_shaderfx_add);
|
|
|
|
WM_operatortype_append(OBJECT_OT_shaderfx_remove);
|
|
|
|
WM_operatortype_append(OBJECT_OT_shaderfx_move_up);
|
|
|
|
WM_operatortype_append(OBJECT_OT_shaderfx_move_down);
|
|
|
|
|
2015-03-29 04:44:05 +11:00
|
|
|
WM_operatortype_append(OBJECT_OT_correctivesmooth_bind);
|
2009-08-21 02:51:56 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_meshdeform_bind);
|
|
|
|
WM_operatortype_append(OBJECT_OT_explode_refresh);
|
2011-11-13 12:17:27 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_ocean_bake);
|
2018-06-04 09:31:30 +02: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);
|
2010-05-27 11:56:31 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_constraints_copy);
|
|
|
|
WM_operatortype_append(POSE_OT_constraints_copy);
|
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);
|
2011-12-15 16:09:57 +00:00
|
|
|
WM_operatortype_append(CONSTRAINT_OT_objectsolver_set_inverse);
|
|
|
|
WM_operatortype_append(CONSTRAINT_OT_objectsolver_clear_inverse);
|
2012-10-05 14:51:35 +00:00
|
|
|
WM_operatortype_append(CONSTRAINT_OT_followpath_path_animate);
|
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);
|
2013-07-01 13:02:53 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_assign_new);
|
2009-07-01 22:25:49 +00:00
|
|
|
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);
|
2010-02-09 22:00:19 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_copy_to_selected);
|
2009-07-01 22:25:49 +00:00
|
|
|
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);
|
2011-09-14 08:21:21 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_lock);
|
2011-07-29 17:36:49 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_fix);
|
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);
|
2015-06-25 16:10:18 +10:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_smooth);
|
2009-10-20 10:19:48 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_clean);
|
2013-11-17 14:54:42 +11:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_quantize);
|
2012-10-09 10:56:35 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_limit_total);
|
2010-01-15 17:28:00 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_mirror);
|
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);
|
2010-02-02 21:43:26 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_sort);
|
2010-05-04 12:31:24 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_group_move);
|
2013-06-23 15:37:08 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_weight_paste);
|
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_weight_delete);
|
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_weight_set_active);
|
2013-06-25 22:28:20 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_weight_normalize_active_vertex);
|
2013-06-23 15:37:08 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_vertex_weight_copy);
|
2009-07-01 22:25:49 +00:00
|
|
|
|
2017-05-30 17:58:24 +10:00
|
|
|
WM_operatortype_append(OBJECT_OT_face_map_add);
|
|
|
|
WM_operatortype_append(OBJECT_OT_face_map_remove);
|
|
|
|
WM_operatortype_append(OBJECT_OT_face_map_assign);
|
|
|
|
WM_operatortype_append(OBJECT_OT_face_map_remove_from);
|
|
|
|
WM_operatortype_append(OBJECT_OT_face_map_select);
|
|
|
|
WM_operatortype_append(OBJECT_OT_face_map_deselect);
|
|
|
|
WM_operatortype_append(OBJECT_OT_face_map_move);
|
|
|
|
|
2015-05-26 17:55:34 +10:00
|
|
|
WM_operatortype_append(TRANSFORM_OT_vertex_warp);
|
2013-11-20 12:25:07 +11:00
|
|
|
|
2018-03-28 14:54:17 -03:00
|
|
|
WM_operatortype_append(OBJECT_OT_move_to_collection);
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
WM_operatortype_append(OBJECT_OT_link_to_collection);
|
2018-03-28 14:54:17 -03:00
|
|
|
|
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);
|
2012-04-05 06:10:15 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_shape_key_retime);
|
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
|
|
|
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
WM_operatortype_append(OBJECT_OT_collection_add);
|
|
|
|
WM_operatortype_append(OBJECT_OT_collection_link);
|
|
|
|
WM_operatortype_append(OBJECT_OT_collection_remove);
|
|
|
|
WM_operatortype_append(OBJECT_OT_collection_unlink);
|
|
|
|
WM_operatortype_append(OBJECT_OT_collection_objects_select);
|
2009-11-16 13:59:27 +00:00
|
|
|
|
2013-02-17 07:17:04 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_hook_add_selob);
|
|
|
|
WM_operatortype_append(OBJECT_OT_hook_add_newob);
|
2009-11-22 06:20:56 +00:00
|
|
|
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-12-30 14:37:25 +00:00
|
|
|
|
|
|
|
WM_operatortype_append(OBJECT_OT_bake_image);
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 19:05:07 -02:00
|
|
|
WM_operatortype_append(OBJECT_OT_bake);
|
Drag and drop 2.5 integration! Finally, slashdot regulars can use
Blender too now! :)
** Drag works as follows:
- drag-able items are defined by the standard interface ui toolkit
- each button can get this feature, via uiButSetDragXXX(but, ...).
There are calls to define drag-able images, ID blocks, RNA paths,
file paths, and so on. By default you drag an icon, exceptionally
an ImBuf
- Drag items are registered centrally in the WM, it allows more drag
items simultaneous too, but not implemented
** Drop works as follows:
- On mouse release, and if drag items exist in the WM, it converts
the mouse event to an EVT_DROP type. This event then gets the full
drag info as customdata
- drop regions are defined with WM_dropbox_add(), similar to keymaps
you can make a "drop map" this way, which become 'drop map handlers'
in the queues.
- next to that the UI kit handles some common button types (like
accepting ID or names) to be catching a drop event too.
- Every "drop box" has two callbacks:
- poll() = check if the event drag data is relevant for this box
- copy() = fill in custom properties in the dropbox to initialize
an operator
- The dropbox handler then calls its standard Operator with its
dropbox properties.
** Currently implemented
Drag items:
- ID icons in browse buttons
- ID icons in context menu of properties region
- ID icons in outliner and rna viewer
- FileBrowser icons
- FileBrowser preview images
Drag-able icons are subtly visualized by making them brighter a bit
on mouse-over. In case the icon is a button or UI element too (most
cases), the drag-able feature will make the item react to
mouse-release instead of mouse-press.
Drop options:
- UI buttons: ID and text buttons (paste name)
- View3d: Object ID drop copies object
- View3d: Material ID drop assigns to object under cursor
- View3d: Image ID drop assigns to object UV texture under cursor
- Sequencer: Path drop will add either Image or Movie strip
- Image window: Path drop will open image
** Drag and drop Notes:
- Dropping into another Blender window (from same application) works
too. I've added code that passes on mousemoves and clicks to other
windows, without activating them though. This does make using multi-window
Blender a bit friendler.
- Dropping a file path to an image, is not the same as dropping an
Image ID... keep this in mind. Sequencer for example wants paths to
be dropped, textures in 3d window wants an Image ID.
- Although drop boxes could be defined via Python, I suggest they're
part of the UI and editor design (= how we want an editor to work), and
not default offered configurable like keymaps.
- At the moment only one item can be dragged at a time. This is for
several reasons.... For one, Blender doesn't have a well defined
uniform way to define "what is selected" (files, outliner items, etc).
Secondly there's potential conflicts on what todo when you drop mixed
drag sets on spots. All undefined stuff... nice for later.
- Example to bypass the above: a collection of images that form a strip,
should be represented in filewindow as a single sequence anyway.
This then will fit well and gets handled neatly by design.
- Another option to check is to allow multiple options per drop... it
could show the operator as a sort of menu, allowing arrow or scrollwheel
to choose. For time being I'd prefer to try to design a singular drop
though, just offer only one drop action per data type on given spots.
- What does work already, but a tad slow, is to use a function that
detects an object (type) under cursor, so a drag item's option can be
further refined (like drop object on object = parent). (disabled)
** More notes
- Added saving for Region layouts (like split points for toolbar)
- Label buttons now handle mouse over
- File list: added full path entry for drop feature.
- Filesel bugfix: wm_operator_exec() got called there and fully handled,
while WM event code tried same. Added new OPERATOR_HANDLED flag for this.
Maybe python needs it too?
- Cocoa: added window move event, so multi-win setups work OK (didnt save).
- Interface_handlers.c: removed win->active
- Severe area copy bug: area handlers were not set to NULL
- Filesel bugfix: next/prev folder list was not copied on area copies
** Leftover todos
- Cocoa windows seem to hang on cases still... needs check
- Cocoa 'draw overlap' swap doesn't work
- Cocoa window loses focus permanently on using Spotlight
(for these reasons, makefile building has Carbon as default atm)
- ListView templates in UI cannot become dragged yet, needs review...
it consists of two overlapping UI elements, preventing handling icon clicks.
- There's already Ghost library code to handle dropping from OS
into Blender window. I've noticed this code is unfinished for Macs, but
seems to be complete for Windows. Needs test... currently, an external
drop event will print in console when succesfully delivered to Blender's WM.
2010-01-26 18:18:21 +00:00
|
|
|
WM_operatortype_append(OBJECT_OT_drop_named_material);
|
2014-08-21 17:00:35 +10:00
|
|
|
WM_operatortype_append(OBJECT_OT_unlink_data);
|
2013-11-24 07:00:49 +11:00
|
|
|
WM_operatortype_append(OBJECT_OT_laplaciandeform_bind);
|
2013-12-17 14:42:47 -08:00
|
|
|
|
2015-05-26 17:55:34 +10:00
|
|
|
WM_operatortype_append(TRANSFORM_OT_vertex_random);
|
Transfer Data: add main core code and operators.
This add code needed to map a CD data layout from source mesh towards destination one,
and code needed to actually transfer data, using BKE's mesh remap generated data.
This allows to transfer most CD layers (vgroups, vcols, uvs...) as well as fake, boolean ones
(like smooth/sharp edges/faces, etc.). Some types are not yet transferable, mainly
shape keys, this is known TODO.
Data transfer can also use some advanced mixing in some cases (mostly, vgroups and vcols).
Notes:
* New transfer operators transfer data from active object towards selected ones.
* Modifier will be committed separately.
* Old weight transfer code (for vgroups) is kept for now, mostly because it is the only
usable one in weightpaint mode (it transfers from selected object to active one,
this is not sensible in Object mode, but needed in WeightPaint one). This will be addressed soon.
Again, heavily reviewed and enhanced by Campbell, thanks!
2015-01-09 19:11:40 +01:00
|
|
|
|
|
|
|
WM_operatortype_append(OBJECT_OT_data_transfer);
|
|
|
|
WM_operatortype_append(OBJECT_OT_datalayout_transfer);
|
2017-02-27 12:39:14 -03:00
|
|
|
WM_operatortype_append(OBJECT_OT_surfacedeform_bind);
|
Objects: restore H key per object hiding.
H hides selected objects, Shift+H hides unselected objects, and Alt+H
reveals hidden objects.
This hiding state is distinct from restrict viewport and render, and
meant for temporarily hiding objects without affecting more persistent
collection hiding.
Object hiding is per view-layer, same as selection. It affects the
viewport and any preview renders in there, but not final renders.
In the outliner, different icons are now used for temporary hiding, and
restrict viewport and render. Hidden objects are greyed out.
Remaining design issues:
* For lamps we probably still want to keep their effect on the scene,
currently they are fully disabled by hiding. Arguably mesh lights or
even objects being reflected or casting shadows are not that different
but perhaps the special lamp exception from local view should remain.
* We need a feature still to disabled this hiding for specific viewports,
for render or animation preview where you want to see the entire scene
while working in another view.
* We need a new icon for restrict viewport, for now it uses a grid similar
to the 2.4 icon.
* Hiding objects does not preserve selection state as it did in 2.7,
it's probably convenient to support this again?
2018-05-14 23:36:56 +02:00
|
|
|
|
|
|
|
WM_operatortype_append(OBJECT_OT_hide_view_clear);
|
|
|
|
WM_operatortype_append(OBJECT_OT_hide_view_set);
|
Objects: support for hiding all objects in a collection.
In the outliner there are now icons for it, Ctrl+Click isolates a
single collections.
In the 3D view, Ctrl+H key opens a menu that is more or less the
equivalent of the old layer buttons in the header. Regular Click isolates
the collection, Shift+Click toggle the collection visibility. Pressing
number keys and letters works in this menu, which can help for quickly
selecting a specific collection.
Shortcuts for quick switching by just pressing 1/2/3/.. keys are available
again. The order can be confusing with nested collections, but that seems
unavoidable. The first numbers control the top level collections, and then
sub collections if numbers are left.
Remaining design issues:
* The 3D view menu needs to be improved: support for sub collections,
staying open on shift+click, access from the 3D view header somewhere,
shortcut key display.
* Currently collection hiding just controls per-object hiding, we plan
to separate this state still so alt+H doesn't affect collection hiding.
2018-06-18 19:49:53 +02:00
|
|
|
WM_operatortype_append(OBJECT_OT_hide_collection);
|
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;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-05-05 19:26:53 +00:00
|
|
|
ot = WM_operatortype_append_macro("OBJECT_OT_duplicate_move", "Duplicate Objects",
|
|
|
|
"Duplicate selected objects and move them", OPTYPE_UNDO | OPTYPE_REGISTER);
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ot) {
|
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_operatortype_macro_define(ot, "OBJECT_OT_duplicate");
|
2012-03-24 02:51:46 +00:00
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
2009-10-30 17:48:50 +00:00
|
|
|
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... */
|
2012-05-05 19:26:53 +00:00
|
|
|
ot = WM_operatortype_append_macro("OBJECT_OT_duplicate_move_linked", "Duplicate Linked",
|
|
|
|
"Duplicate selected objects and move them", OPTYPE_UNDO | OPTYPE_REGISTER);
|
2012-03-24 06:38:07 +00:00
|
|
|
if (ot) {
|
2012-03-24 02:51:46 +00:00
|
|
|
otmacro = WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate");
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(otmacro->ptr, "linked", true);
|
2012-03-24 02:51:46 +00:00
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
2009-10-30 17:48:50 +00:00
|
|
|
RNA_enum_set(otmacro->ptr, "proportional", PROP_EDIT_OFF);
|
2009-10-20 21:12:09 +00:00
|
|
|
}
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2008-12-23 19:47:33 +00:00
|
|
|
}
|
|
|
|
|
2018-07-02 11:47:00 +02:00
|
|
|
static bool object_mode_poll(bContext *C)
|
2009-09-17 21:36:02 +00:00
|
|
|
{
|
2012-04-28 15:42:27 +00:00
|
|
|
Object *ob = CTX_data_active_object(C);
|
2018-04-05 18:20:27 +02:00
|
|
|
return (!ob || ob->mode == OB_MODE_OBJECT);
|
2009-09-17 21:36:02 +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
|
|
|
void ED_keymap_object(wmKeyConfig *keyconf)
|
2008-12-23 19:47:33 +00:00
|
|
|
{
|
2009-09-17 21:36:02 +00:00
|
|
|
wmKeyMap *keymap;
|
2018-05-29 17:25:19 +02:00
|
|
|
|
2009-11-23 02:27:52 +00:00
|
|
|
/* Objects, Regardless of Mode -------------------------------------------------- */
|
2018-08-31 13:36:14 +10:00
|
|
|
keymap = WM_keymap_ensure(keyconf, "Object Non-modal", 0, 0);
|
2018-05-29 17:25:19 +02:00
|
|
|
|
2009-11-23 02:27:52 +00:00
|
|
|
/* Object Mode ---------------------------------------------------------------- */
|
2009-01-01 13:15:35 +00:00
|
|
|
/* Note: this keymap gets disabled in non-objectmode, */
|
2018-08-31 13:36:14 +10:00
|
|
|
keymap = WM_keymap_ensure(keyconf, "Object Mode", 0, 0);
|
2012-03-24 02:51:46 +00:00
|
|
|
keymap->poll = object_mode_poll;
|
2018-07-25 11:02:12 +10:00
|
|
|
}
|