2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
* Copyright 2008 Blender Foundation. All rights reserved. */
|
2011-02-21 07:25:24 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup editors
|
2011-02-21 07:25:24 +00:00
|
|
|
*/
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#pragma once
|
2008-01-01 18:29:19 +00:00
|
|
|
|
2020-05-08 18:16:39 +02:00
|
|
|
#include "BLI_compiler_attrs.h"
|
|
|
|
|
#include "DNA_object_enums.h"
|
2022-02-15 12:32:15 +01:00
|
|
|
#include "DNA_userdef_enums.h"
|
2020-05-08 18:16:39 +02:00
|
|
|
|
2010-10-05 00:05:14 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2017-11-09 15:44:56 -02:00
|
|
|
struct Base;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct Depsgraph;
|
|
|
|
|
struct EnumPropertyItem;
|
2012-07-25 19:45:34 +00:00
|
|
|
struct ID;
|
2010-08-01 12:47:49 +00:00
|
|
|
struct Main;
|
2009-05-21 15:36:16 +00:00
|
|
|
struct ModifierData;
|
2010-08-01 12:47:49 +00:00
|
|
|
struct Object;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct PointerRNA;
|
|
|
|
|
struct PropertyRNA;
|
2010-08-01 12:47:49 +00:00
|
|
|
struct ReportList;
|
|
|
|
|
struct Scene;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct ShaderFxData;
|
2018-11-25 09:50:34 -02:00
|
|
|
struct View3D;
|
2017-11-22 10:52:39 -02:00
|
|
|
struct ViewLayer;
|
2019-08-22 13:45:31 +10:00
|
|
|
struct XFormObjectData;
|
2012-10-10 03:13:02 +00:00
|
|
|
struct bConstraint;
|
|
|
|
|
struct bContext;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct bFaceMap;
|
2012-10-10 03:13:02 +00:00
|
|
|
struct bPoseChannel;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct uiLayout;
|
2021-08-26 12:39:45 +10:00
|
|
|
struct wmEvent;
|
2010-08-01 12:47:49 +00:00
|
|
|
struct wmKeyConfig;
|
|
|
|
|
struct wmOperator;
|
|
|
|
|
struct wmOperatorType;
|
2013-06-23 15:37:08 +00:00
|
|
|
|
2009-01-30 15:01:14 +00:00
|
|
|
/* object_edit.c */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
|
|
|
|
/** `context.object` */
|
2020-07-03 11:58:43 -04:00
|
|
|
struct Object *ED_object_context(const struct bContext *C);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Find the correct active object per context (`context.object` or `context.active_object`)
|
|
|
|
|
* \note context can be NULL when called from a enum with #PROP_ENUM_NO_CONTEXT.
|
|
|
|
|
*/
|
2020-07-03 11:58:43 -04:00
|
|
|
struct Object *ED_object_active_context(const struct bContext *C);
|
2018-12-14 10:30:06 +11:00
|
|
|
void ED_collection_hide_menu_draw(const struct bContext *C, struct uiLayout *layout);
|
2010-03-31 00:55:01 +00:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Return an array of objects:
|
|
|
|
|
* - When in the property space, return the pinned or active object.
|
|
|
|
|
* - When in edit-mode/pose-mode, return an array of objects in the mode.
|
|
|
|
|
* - Otherwise return selected objects,
|
|
|
|
|
* the callers \a filter_fn needs to check of they are editable
|
|
|
|
|
* (assuming they need to be modified).
|
|
|
|
|
*/
|
2020-08-30 17:39:12 +10:00
|
|
|
Object **ED_object_array_in_mode_or_selected(struct bContext *C,
|
2021-06-30 16:37:14 +10:00
|
|
|
bool (*filter_fn)(const struct Object *ob,
|
|
|
|
|
void *user_data),
|
2020-08-30 17:39:12 +10:00
|
|
|
void *filter_user_data,
|
|
|
|
|
uint *r_objects_len);
|
|
|
|
|
|
2018-12-13 10:37:01 +11:00
|
|
|
/* object_utils.c */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2018-12-13 10:37:01 +11:00
|
|
|
bool ED_object_calc_active_center_for_editmode(struct Object *obedit,
|
2022-01-07 11:38:08 +11:00
|
|
|
bool select_only,
|
2018-12-13 10:37:01 +11:00
|
|
|
float r_center[3]);
|
|
|
|
|
bool ED_object_calc_active_center_for_posemode(struct Object *ob,
|
2022-01-07 11:38:08 +11:00
|
|
|
bool select_only,
|
2018-12-13 10:37:01 +11:00
|
|
|
float r_center[3]);
|
2022-01-07 11:38:08 +11:00
|
|
|
bool ED_object_calc_active_center(struct Object *ob, bool select_only, float r_center[3]);
|
2018-12-13 10:37:01 +11:00
|
|
|
|
2020-02-01 13:34:27 +11:00
|
|
|
/* Object Data Container helper API. */
|
|
|
|
|
struct XFormObjectData_Container;
|
|
|
|
|
struct XFormObjectData_Container *ED_object_data_xform_container_create(void);
|
|
|
|
|
void ED_object_data_xform_container_destroy(struct XFormObjectData_Container *xds);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* This may be called multiple times with the same data.
|
|
|
|
|
* Each time, the original transformations are re-applied, instead of accumulating the changes.
|
|
|
|
|
*/
|
2020-02-01 13:34:27 +11:00
|
|
|
void ED_object_data_xform_container_update_all(struct XFormObjectData_Container *xds,
|
|
|
|
|
struct Main *bmain,
|
|
|
|
|
struct Depsgraph *depsgraph);
|
|
|
|
|
void ED_object_data_xform_container_item_ensure(struct XFormObjectData_Container *xds,
|
|
|
|
|
struct Object *ob);
|
|
|
|
|
|
|
|
|
|
/* Object Skip-Child Container helper API. */
|
|
|
|
|
enum {
|
|
|
|
|
/**
|
|
|
|
|
* The parent is transformed, this is held in place.
|
|
|
|
|
*/
|
|
|
|
|
XFORM_OB_SKIP_CHILD_PARENT_IS_XFORM = 1,
|
|
|
|
|
/**
|
|
|
|
|
* The same as #XFORM_OB_SKIP_CHILD_PARENT_IS_XFORM,
|
|
|
|
|
* however this objects parent isn't transformed directly.
|
|
|
|
|
*/
|
|
|
|
|
XFORM_OB_SKIP_CHILD_PARENT_IS_XFORM_INDIRECT = 3,
|
|
|
|
|
/**
|
|
|
|
|
* Use the parent invert matrix to apply transformation,
|
|
|
|
|
* this is needed, because breaks in the selection chain prevents this from being transformed.
|
|
|
|
|
* This is used to add the transform which would have been added
|
|
|
|
|
* if there weren't breaks in the parent/child chain.
|
|
|
|
|
*/
|
|
|
|
|
XFORM_OB_SKIP_CHILD_PARENT_APPLY = 2,
|
|
|
|
|
};
|
|
|
|
|
struct XFormObjectSkipChild_Container;
|
|
|
|
|
struct XFormObjectSkipChild_Container *ED_object_xform_skip_child_container_create(void);
|
|
|
|
|
void ED_object_xform_skip_child_container_item_ensure_from_array(
|
|
|
|
|
struct XFormObjectSkipChild_Container *xcs,
|
|
|
|
|
struct ViewLayer *view_layer,
|
|
|
|
|
struct Object **objects,
|
|
|
|
|
uint objects_len);
|
|
|
|
|
void ED_object_xform_skip_child_container_destroy(struct XFormObjectSkipChild_Container *xcs);
|
|
|
|
|
void ED_object_xform_skip_child_container_update_all(struct XFormObjectSkipChild_Container *xcs,
|
|
|
|
|
struct Main *bmain,
|
|
|
|
|
struct Depsgraph *depsgraph);
|
|
|
|
|
void ED_object_xform_skip_child_container_item_ensure(struct XFormObjectSkipChild_Container *xcs,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct Object *ob_parent_recurse,
|
|
|
|
|
int mode);
|
|
|
|
|
|
2021-10-27 04:19:45 +11:00
|
|
|
void ED_object_xform_array_m4(struct Object **objects, uint objects_len, const float matrix[4][4]);
|
|
|
|
|
|
2010-03-31 00:55:01 +00:00
|
|
|
/* object_ops.c */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2008-12-23 19:47:33 +00:00
|
|
|
void ED_operatortypes_object(void);
|
2009-10-12 12:54:08 +00:00
|
|
|
void ED_operatormacros_object(void);
|
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(struct wmKeyConfig *keyconf);
|
2008-12-23 19:47:33 +00:00
|
|
|
|
2012-01-22 10:20:30 +00:00
|
|
|
/* object_relations.c */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
2012-01-22 10:20:30 +00:00
|
|
|
typedef enum eParentType {
|
|
|
|
|
PAR_OBJECT,
|
|
|
|
|
PAR_ARMATURE,
|
|
|
|
|
PAR_ARMATURE_NAME,
|
|
|
|
|
PAR_ARMATURE_ENVELOPE,
|
|
|
|
|
PAR_ARMATURE_AUTO,
|
|
|
|
|
PAR_BONE,
|
2013-02-12 14:42:46 +00:00
|
|
|
PAR_BONE_RELATIVE,
|
2012-01-22 10:20:30 +00:00
|
|
|
PAR_CURVE,
|
|
|
|
|
PAR_FOLLOW,
|
|
|
|
|
PAR_PATH_CONST,
|
|
|
|
|
PAR_LATTICE,
|
|
|
|
|
PAR_VERTEX,
|
2015-06-23 17:35:55 +02:00
|
|
|
PAR_VERTEX_TRI,
|
2012-01-22 10:20:30 +00:00
|
|
|
} eParentType;
|
|
|
|
|
|
2017-12-04 17:19:34 +11:00
|
|
|
typedef enum eObjectSelect_Mode {
|
2017-11-08 12:16:49 -02:00
|
|
|
BA_DESELECT = 0,
|
|
|
|
|
BA_SELECT = 1,
|
|
|
|
|
BA_INVERT = 2,
|
|
|
|
|
} eObjectSelect_Mode;
|
|
|
|
|
|
2020-03-12 10:51:49 +01:00
|
|
|
typedef enum eObClearParentTypes {
|
|
|
|
|
CLEAR_PARENT_ALL = 0,
|
|
|
|
|
CLEAR_PARENT_KEEP_TRANSFORM,
|
|
|
|
|
CLEAR_PARENT_INVERSE,
|
|
|
|
|
} eObClearParentTypes;
|
|
|
|
|
|
2012-10-10 03:13:02 +00:00
|
|
|
#ifdef __RNA_TYPES_H__
|
2012-01-22 10:20:30 +00:00
|
|
|
extern struct EnumPropertyItem prop_clear_parent_types[];
|
|
|
|
|
extern struct EnumPropertyItem prop_make_parent_types[];
|
2012-10-10 03:13:02 +00:00
|
|
|
#endif
|
2012-01-22 10:20:30 +00:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Set the object's parent, return true if successful.
|
|
|
|
|
*/
|
2017-07-21 11:53:13 +02:00
|
|
|
bool ED_object_parent_set(struct ReportList *reports,
|
|
|
|
|
const struct bContext *C,
|
|
|
|
|
struct Scene *scene,
|
2021-03-05 09:47:50 +01:00
|
|
|
struct Object *const ob,
|
|
|
|
|
struct Object *const par,
|
2014-10-10 18:26:46 +02:00
|
|
|
int partype,
|
2022-01-07 11:38:08 +11:00
|
|
|
bool xmirror,
|
|
|
|
|
bool keep_transform,
|
2014-10-10 18:26:46 +02:00
|
|
|
const int vert_par[3]);
|
2022-01-07 11:38:08 +11:00
|
|
|
void ED_object_parent_clear(struct Object *ob, int type);
|
2012-01-22 10:20:30 +00:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Simple API for object selection, rather than just using the flag
|
|
|
|
|
* this takes into account the 'restrict selection in 3d view' flag.
|
|
|
|
|
* deselect works always, the restriction just prevents selection
|
|
|
|
|
*
|
|
|
|
|
* \note Caller must send a `NC_SCENE | ND_OB_SELECT` notifier
|
|
|
|
|
* (or a `NC_SCENE | ND_OB_VISIBLE` in case of visibility toggling).
|
|
|
|
|
*/
|
2017-11-08 12:16:49 -02:00
|
|
|
void ED_object_base_select(struct Base *base, eObjectSelect_Mode mode);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Change active base, it includes the notifier
|
|
|
|
|
*/
|
Render Layers and Collections (merge from render-layers)
Design Documents
----------------
* https://wiki.blender.org/index.php/Dev:2.8/Source/Layers
* https://wiki.blender.org/index.php/Dev:2.8/Source/DataDesignRevised
User Commit Log
---------------
* New Layer and Collection system to replace render layers and viewport layers.
* A layer is a set of collections of objects (and their drawing options) required for specific tasks.
* A collection is a set of objects, equivalent of the old layers in Blender. A collection can be shared across multiple layers.
* All Scenes have a master collection that all other collections are children of.
* New collection "context" tab (in Properties Editor)
* New temporary viewport "collections" panel to control per-collection
visibility
Missing User Features
---------------------
* Collection "Filter"
Option to add objects based on their names
* Collection Manager operators
The existing buttons are placeholders
* Collection Manager drawing
The editor main region is empty
* Collection Override
* Per-Collection engine settings
This will come as a separate commit, as part of the clay-engine branch
Dev Commit Log
--------------
* New DNA file (DNA_layer_types.h) with the new structs
We are replacing Base by a new extended Base while keeping it backward
compatible with some legacy settings (i.e., lay, flag_legacy).
Renamed all Base to BaseLegacy to make it clear the areas of code that
still need to be converted
Note: manual changes were required on - deg_builder_nodes.h, rna_object.c, KX_Light.cpp
* Unittesting for main syncronization requirements
- read, write, add/copy/remove objects, copy scene, collection
link/unlinking, context)
* New Editor: Collection Manager
Based on patch by Julian Eisel
This is extracted from the layer-manager branch. With the following changes:
- Renamed references of layer manager to collections manager
- I doesn't include the editors/space_collections/ draw and util files
- The drawing code itself will be implemented separately by Julian
* Base / Object:
A little note about them. Original Blender code would try to keep them
in sync through the code, juggling flags back and forth. This will now
be handled by Depsgraph, keeping Object and Bases more separated
throughout the non-rendering code.
Scene.base is being cleared in doversion, and the old viewport drawing
code was poorly converted to use the new bases while the new viewport
code doesn't get merged and replace the old one.
Python API Changes
------------------
```
- scene.layers
+ # no longer exists
- scene.objects
+ scene.scene_layers.active.objects
- scene.objects.active
+ scene.render_layers.active.objects.active
- bpy.context.scene.objects.link()
+ bpy.context.scene_collection.objects.link()
- bpy_extras.object_utils.object_data_add(context, obdata, operator=None, use_active_layer=True, name=None)
+ bpy_extras.object_utils.object_data_add(context, obdata, operator=None, name=None)
- bpy.context.object.select
+ bpy.context.object.select = True
+ bpy.context.object.select = False
+ bpy.context.object.select_get()
+ bpy.context.object.select_set(action='SELECT')
+ bpy.context.object.select_set(action='DESELECT')
-AddObjectHelper.layers
+ # no longer exists
```
2017-02-07 10:18:38 +01:00
|
|
|
void ED_object_base_activate(struct bContext *C, struct Base *base);
|
2021-01-22 11:33:33 +11:00
|
|
|
void ED_object_base_activate_with_mode_exit_if_needed(struct bContext *C, struct Base *base);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Call when the active base has changed.
|
|
|
|
|
*/
|
2019-07-05 16:25:54 +10:00
|
|
|
void ED_object_base_active_refresh(struct Main *bmain,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct ViewLayer *view_layer);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Remove base from a specific scene.
|
|
|
|
|
* \note now unlinks constraints as well.
|
|
|
|
|
*/
|
2017-11-09 13:11:20 -02:00
|
|
|
void ED_object_base_free_and_unlink(struct Main *bmain, struct Scene *scene, struct Object *ob);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Remove base from a specific scene.
|
|
|
|
|
* `ob` must not be indirectly used.
|
|
|
|
|
*/
|
2021-03-27 13:38:44 +11:00
|
|
|
void ED_object_base_free_and_unlink_no_indirect_check(struct Main *bmain,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob);
|
2018-11-25 09:50:34 -02:00
|
|
|
bool ED_object_base_deselect_all_ex(struct ViewLayer *view_layer,
|
|
|
|
|
struct View3D *v3d,
|
|
|
|
|
int action,
|
|
|
|
|
bool *r_any_visible);
|
|
|
|
|
bool ED_object_base_deselect_all(struct ViewLayer *view_layer, struct View3D *v3d, int action);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Single object duplicate, if `dupflag == 0`, fully linked, else it uses the flags given.
|
|
|
|
|
* Leaves selection of base/object unaltered.
|
|
|
|
|
* \note don't call this within a loop since clear_* funcs loop over the entire database.
|
|
|
|
|
* \note caller must do `DAG_relations_tag_update(bmain);`
|
|
|
|
|
* this is not done automatic since we may duplicate many objects in a batch.
|
|
|
|
|
*/
|
2017-11-23 13:51:49 -02:00
|
|
|
struct Base *ED_object_add_duplicate(struct Main *bmain,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct ViewLayer *view_layer,
|
|
|
|
|
struct Base *base,
|
2022-01-07 11:38:08 +11:00
|
|
|
eDupli_ID_Flags dupflag);
|
2009-01-05 15:19:31 +00:00
|
|
|
|
2022-01-07 11:38:08 +11:00
|
|
|
void ED_object_parent(struct Object *ob, struct Object *parent, int type, const char *substr);
|
2021-08-04 08:58:19 +02:00
|
|
|
char *ED_object_ot_drop_named_material_tooltip(struct bContext *C,
|
2022-05-24 15:13:20 +02:00
|
|
|
const char *name,
|
2021-10-25 10:07:00 -03:00
|
|
|
const int mval[2]);
|
2009-01-05 15:19:31 +00:00
|
|
|
|
2009-01-01 18:05:12 +00:00
|
|
|
/* bitflags for enter/exit editmode */
|
2018-04-10 20:13:31 +02:00
|
|
|
enum {
|
|
|
|
|
EM_FREEDATA = (1 << 0),
|
2019-01-31 15:36:24 +11:00
|
|
|
EM_NO_CONTEXT = (1 << 1),
|
2018-04-10 20:13:31 +02:00
|
|
|
};
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* \param flag:
|
|
|
|
|
* - If #EM_FREEDATA isn't in the flag, use ED_object_editmode_load directly.
|
|
|
|
|
*/
|
2018-05-30 08:49:34 +02:00
|
|
|
bool ED_object_editmode_exit_ex(struct Main *bmain,
|
2018-06-06 16:25:28 +02:00
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *obedit,
|
|
|
|
|
int flag);
|
2018-05-30 08:41:06 +02:00
|
|
|
bool ED_object_editmode_exit(struct bContext *C, int flag);
|
2018-04-16 16:27:55 +02:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Support freeing edit-mode data without flushing it back to the object.
|
|
|
|
|
*
|
|
|
|
|
* \return true if data was freed.
|
|
|
|
|
*/
|
2021-04-08 19:52:33 +10:00
|
|
|
bool ED_object_editmode_free_ex(struct Main *bmain, struct Object *obedit);
|
|
|
|
|
|
2021-01-22 17:31:04 +11:00
|
|
|
bool ED_object_editmode_exit_multi_ex(struct Main *bmain,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct ViewLayer *view_layer,
|
|
|
|
|
int flag);
|
|
|
|
|
bool ED_object_editmode_exit_multi(struct bContext *C, int flag);
|
|
|
|
|
|
2018-06-01 17:26:36 +02:00
|
|
|
bool ED_object_editmode_enter_ex(struct Main *bmain,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
int flag);
|
2018-05-30 08:41:06 +02:00
|
|
|
bool ED_object_editmode_enter(struct bContext *C, int flag);
|
2018-06-01 17:08:38 +02:00
|
|
|
bool ED_object_editmode_load(struct Main *bmain, struct Object *obedit);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2018-02-16 20:24:38 +11:00
|
|
|
void ED_object_vpaintmode_enter_ex(struct Main *bmain,
|
2018-06-11 14:39:38 +02:00
|
|
|
struct Depsgraph *depsgraph,
|
2018-04-05 18:20:27 +02:00
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob);
|
2019-08-02 11:33:57 +10:00
|
|
|
void ED_object_vpaintmode_enter(struct bContext *C, struct Depsgraph *depsgraph);
|
2018-02-16 20:24:38 +11:00
|
|
|
void ED_object_wpaintmode_enter_ex(struct Main *bmain,
|
2018-06-11 14:39:38 +02:00
|
|
|
struct Depsgraph *depsgraph,
|
2018-04-05 18:20:27 +02:00
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob);
|
2019-08-02 11:33:57 +10:00
|
|
|
void ED_object_wpaintmode_enter(struct bContext *C, struct Depsgraph *depsgraph);
|
2018-02-16 20:24:38 +11:00
|
|
|
|
2018-04-05 18:20:27 +02:00
|
|
|
void ED_object_vpaintmode_exit_ex(struct Object *ob);
|
2018-02-16 20:24:38 +11:00
|
|
|
void ED_object_vpaintmode_exit(struct bContext *C);
|
2018-04-05 18:20:27 +02:00
|
|
|
void ED_object_wpaintmode_exit_ex(struct Object *ob);
|
2018-02-16 20:24:38 +11:00
|
|
|
void ED_object_wpaintmode_exit(struct bContext *C);
|
|
|
|
|
|
2020-06-04 21:13:00 +10:00
|
|
|
void ED_object_texture_paint_mode_enter_ex(struct Main *bmain, struct Scene *scene, Object *ob);
|
|
|
|
|
void ED_object_texture_paint_mode_enter(struct bContext *C);
|
|
|
|
|
|
|
|
|
|
void ED_object_texture_paint_mode_exit_ex(struct Main *bmain, struct Scene *scene, Object *ob);
|
|
|
|
|
void ED_object_texture_paint_mode_exit(struct bContext *C);
|
|
|
|
|
|
2021-05-07 10:44:13 +10:00
|
|
|
bool ED_object_particle_edit_mode_supported(const Object *ob);
|
2020-06-04 21:13:00 +10:00
|
|
|
void ED_object_particle_edit_mode_enter_ex(struct Depsgraph *depsgraph,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
Object *ob);
|
|
|
|
|
void ED_object_particle_edit_mode_enter(struct bContext *C);
|
|
|
|
|
|
|
|
|
|
void ED_object_particle_edit_mode_exit_ex(struct Scene *scene, Object *ob);
|
|
|
|
|
void ED_object_particle_edit_mode_exit(struct bContext *C);
|
|
|
|
|
|
2018-03-06 19:04:43 +11:00
|
|
|
void ED_object_sculptmode_enter_ex(struct Main *bmain,
|
2018-06-08 14:38:57 +02:00
|
|
|
struct Depsgraph *depsgraph,
|
2019-02-07 17:54:53 +11:00
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob,
|
2022-01-07 11:38:08 +11:00
|
|
|
bool force_dyntopo,
|
2018-03-06 19:04:43 +11:00
|
|
|
struct ReportList *reports);
|
2019-08-02 11:33:57 +10:00
|
|
|
void ED_object_sculptmode_enter(struct bContext *C,
|
|
|
|
|
struct Depsgraph *depsgraph,
|
|
|
|
|
struct ReportList *reports);
|
2019-05-31 12:28:31 +02:00
|
|
|
void ED_object_sculptmode_exit_ex(struct Main *bmain,
|
|
|
|
|
struct Depsgraph *depsgraph,
|
2018-04-05 18:20:27 +02:00
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob);
|
2019-08-02 11:33:57 +10:00
|
|
|
void ED_object_sculptmode_exit(struct bContext *C, struct Depsgraph *depsgraph);
|
2018-02-16 23:37:47 +11:00
|
|
|
|
2012-05-26 22:21:56 +00:00
|
|
|
void ED_object_location_from_view(struct bContext *C, float loc[3]);
|
2022-01-07 11:38:08 +11:00
|
|
|
void ED_object_rotation_from_quat(float rot[3], const float quat[4], char align_axis);
|
|
|
|
|
void ED_object_rotation_from_view(struct bContext *C, float rot[3], char align_axis);
|
2020-04-20 15:26:37 +02:00
|
|
|
void ED_object_base_init_transform_on_add(struct Object *object,
|
2019-08-02 15:13:59 +02:00
|
|
|
const float loc[3],
|
|
|
|
|
const float rot[3]);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Uses context to figure out transform for primitive.
|
|
|
|
|
* Returns standard diameter.
|
|
|
|
|
*/
|
2015-02-10 02:38:21 +11:00
|
|
|
float ED_object_new_primitive_matrix(struct bContext *C,
|
2020-09-04 20:59:13 +02:00
|
|
|
struct Object *obedit,
|
2015-02-10 02:38:21 +11:00
|
|
|
const float loc[3],
|
|
|
|
|
const float rot[3],
|
Fix T84638: Wrong scale for primitives with radius
Creating some primitives allows for a scale value (via python) that will
scale the object accordingly. For objects with a radius parameter
(like cylinders, spheres, etc.) passing a scale different to (1,1,1)
would result in unexpected behavior.
For example:
`>>> bpy.ops.mesh.primitive_uv_sphere_add(radius=2, scale=(1,1,2))`
We would expect this to create a sphere with a radius of 2
(dimensions 4,4,4) and then be scaled *2 along the z-axis
(dimensions 4,4,8). But this would previously create a scaled sphere
with dimensions (2,2,4).
The scale was simply divided by two. Maybe because the "radius"
parameter for creating the primitives was confusingly named "diameter"
(but used as the radius).
The fix adds a scale parameter to `ED_object_new_primitive_matrix`
and also renames the wrongly named "diameter" parameters to "radius".
Reviewed By: campbellbarton
Maniphest Tasks: T84638
Ref D10093
2021-09-13 17:50:41 +10:00
|
|
|
const float scale[3],
|
2015-02-10 02:38:21 +11:00
|
|
|
float primmat[4][4]);
|
2015-06-21 16:06:44 +02:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Avoid allowing too much insane values even by typing (typos can hang/crash Blender otherwise).
|
|
|
|
|
*/
|
2015-06-21 16:06:44 +02:00
|
|
|
#define OBJECT_ADD_SIZE_MAXF 1.0e12f
|
|
|
|
|
|
2018-11-15 17:44:50 +11:00
|
|
|
void ED_object_add_unit_props_size(struct wmOperatorType *ot);
|
2020-05-21 18:18:00 +10:00
|
|
|
void ED_object_add_unit_props_radius_ex(struct wmOperatorType *ot, float default_value);
|
2018-11-15 17:44:50 +11:00
|
|
|
void ED_object_add_unit_props_radius(struct wmOperatorType *ot);
|
2013-09-16 00:18:09 +00:00
|
|
|
void ED_object_add_generic_props(struct wmOperatorType *ot, bool do_editmode);
|
Fix T37879: Default UV generation for mesh primitives.
Adds default-generated UVs to mesh primitives (cone, cylinder, icosphere, uvsphere, cube, circle, grid)
when they are added to the scene, since some of them can be pretty awkward to unwrap manually.
Original patch: Liam Mitchell (CommanderCorianderSalamander).
Main review work: Campbell Barton (campbellbarton).
Finalization, fixes and cleanup: Bastien Montagne (mont29).
Reviewers: mont29, #mesh_modeling, campbellbarton
Reviewed By: mont29, campbellbarton
Subscribers: lkruel, campbellbarton, michaelknubben, kevindietrich
Maniphest Tasks: T37879
Differential Revision: https://developer.blender.org/D481
2015-12-04 23:49:55 +01:00
|
|
|
void ED_object_add_mesh_props(struct wmOperatorType *ot);
|
2018-12-07 12:59:04 +11:00
|
|
|
bool ED_object_add_generic_get_opts(struct bContext *C,
|
|
|
|
|
struct wmOperator *op,
|
2022-01-07 11:38:08 +11:00
|
|
|
char view_align_axis,
|
2021-06-13 14:47:18 +10:00
|
|
|
float r_loc[3],
|
|
|
|
|
float r_rot[3],
|
|
|
|
|
float r_scale[3],
|
|
|
|
|
bool *r_enter_editmode,
|
|
|
|
|
unsigned short *r_local_view_bits,
|
|
|
|
|
bool *r_is_view_aligned);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* For object add primitive operators, or for object creation when `obdata != NULL`.
|
|
|
|
|
* \param obdata: Assigned to #Object.data, with increased user count.
|
|
|
|
|
*
|
|
|
|
|
* \note Do not call undo push in this function (users of this function have to).
|
|
|
|
|
*/
|
2020-09-07 13:45:14 +10:00
|
|
|
struct Object *ED_object_add_type_with_obdata(struct bContext *C,
|
2022-01-07 11:38:08 +11:00
|
|
|
int type,
|
2020-09-07 13:45:14 +10:00
|
|
|
const char *name,
|
|
|
|
|
const float loc[3],
|
|
|
|
|
const float rot[3],
|
2022-01-07 11:38:08 +11:00
|
|
|
bool enter_editmode,
|
|
|
|
|
ushort local_view_bits,
|
2020-09-07 13:45:14 +10:00
|
|
|
struct ID *obdata);
|
2014-09-01 20:09:31 +10:00
|
|
|
struct Object *ED_object_add_type(struct bContext *C,
|
2022-01-07 11:38:08 +11:00
|
|
|
int type,
|
2015-05-04 12:25:33 +10:00
|
|
|
const char *name,
|
|
|
|
|
const float loc[3],
|
|
|
|
|
const float rot[3],
|
2022-01-07 11:38:08 +11:00
|
|
|
bool enter_editmode,
|
|
|
|
|
unsigned short local_view_bits)
|
2015-05-04 12:25:33 +10:00
|
|
|
ATTR_NONNULL(1) ATTR_RETURNS_NONNULL;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Not an especially efficient function, only added so the single user button can be functional.
|
|
|
|
|
*/
|
2013-04-24 23:09:25 +00:00
|
|
|
void ED_object_single_user(struct Main *bmain, struct Scene *scene, struct Object *ob);
|
2008-01-01 18:29:19 +00:00
|
|
|
|
2022-03-30 11:06:10 +02:00
|
|
|
void ED_object_single_obdata_user(struct Main *bmain, struct Scene *scene, struct Object *ob);
|
|
|
|
|
|
2010-01-19 11:31:49 +00:00
|
|
|
/* object motion paths */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Clear motion paths for all objects.
|
|
|
|
|
*/
|
2016-02-26 01:07:26 +13:00
|
|
|
void ED_objects_clear_paths(struct bContext *C, bool only_selected);
|
2019-09-20 12:48:28 +02:00
|
|
|
|
|
|
|
|
/* Corresponds to eAnimvizCalcRange. */
|
|
|
|
|
typedef enum eObjectPathCalcRange {
|
|
|
|
|
OBJECT_PATH_CALC_RANGE_CURRENT_FRAME,
|
|
|
|
|
OBJECT_PATH_CALC_RANGE_CHANGED,
|
|
|
|
|
OBJECT_PATH_CALC_RANGE_FULL,
|
|
|
|
|
} eObjectPathCalcRange;
|
|
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* For the objects with animation: update paths for those that have got them
|
|
|
|
|
* This should selectively update paths that exist.
|
|
|
|
|
*
|
|
|
|
|
* To be called from various tools that do incremental updates
|
|
|
|
|
*/
|
2018-09-14 14:03:31 +02:00
|
|
|
void ED_objects_recalculate_paths(struct bContext *C,
|
|
|
|
|
struct Scene *scene,
|
2021-10-18 14:23:23 +02:00
|
|
|
eObjectPathCalcRange range,
|
|
|
|
|
struct ListBase *ld_objects);
|
|
|
|
|
|
|
|
|
|
void ED_objects_recalculate_paths_selected(struct bContext *C,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
eObjectPathCalcRange range);
|
|
|
|
|
|
|
|
|
|
void ED_objects_recalculate_paths_visible(struct bContext *C,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
eObjectPathCalcRange range);
|
2010-01-19 11:31:49 +00:00
|
|
|
|
2009-01-10 19:34:23 +00:00
|
|
|
/* constraints */
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* If object is in pose-mode, return active bone constraints, else object constraints.
|
|
|
|
|
* No constraints are returned for a bone on an inactive bone-layer.
|
|
|
|
|
*/
|
2020-09-09 13:52:37 +02:00
|
|
|
struct ListBase *ED_object_constraint_active_list(struct Object *ob);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Get the constraints for the active pose bone. Bone may be on an inactive bone-layer
|
|
|
|
|
* (unlike #ED_object_constraint_active_list, such constraints are not excluded here).
|
|
|
|
|
*/
|
2020-09-09 13:52:37 +02:00
|
|
|
struct ListBase *ED_object_pose_constraint_list(const struct bContext *C);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Find the list that a given constraint belongs to,
|
|
|
|
|
* and/or also get the posechannel this is from (if applicable).
|
|
|
|
|
*/
|
2020-06-05 18:57:12 +10:00
|
|
|
struct ListBase *ED_object_constraint_list_from_constraint(struct Object *ob,
|
|
|
|
|
struct bConstraint *con,
|
|
|
|
|
struct bPoseChannel **r_pchan);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Single constraint.
|
|
|
|
|
*/
|
2020-06-05 18:57:12 +10:00
|
|
|
struct bConstraint *ED_object_constraint_active_get(struct Object *ob);
|
2009-05-27 00:03:49 +00:00
|
|
|
|
2018-05-31 12:27:47 +02:00
|
|
|
void object_test_constraints(struct Main *bmain, struct Object *ob);
|
2009-05-27 00:03:49 +00:00
|
|
|
|
2020-06-05 18:57:12 +10:00
|
|
|
void ED_object_constraint_active_set(struct Object *ob, struct bConstraint *con);
|
2018-05-31 12:27:47 +02:00
|
|
|
void ED_object_constraint_update(struct Main *bmain, struct Object *ob);
|
2013-02-22 00:51:58 +00:00
|
|
|
void ED_object_constraint_dependency_update(struct Main *bmain, struct Object *ob);
|
2009-01-10 19:34:23 +00:00
|
|
|
|
2018-05-31 12:27:47 +02:00
|
|
|
void ED_object_constraint_tag_update(struct Main *bmain,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct bConstraint *con);
|
2015-03-19 18:28:49 +05:00
|
|
|
void ED_object_constraint_dependency_tag_update(struct Main *bmain,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct bConstraint *con);
|
|
|
|
|
|
2022-01-07 11:38:08 +11:00
|
|
|
bool ED_object_constraint_move_to_index(struct Object *ob, struct bConstraint *con, int index);
|
2020-09-15 15:09:41 -06:00
|
|
|
void ED_object_constraint_link(struct Main *bmain,
|
|
|
|
|
struct Object *ob_dst,
|
|
|
|
|
struct ListBase *dst,
|
|
|
|
|
struct ListBase *src);
|
|
|
|
|
void ED_object_constraint_copy_for_object(struct Main *bmain,
|
|
|
|
|
struct Object *ob_dst,
|
|
|
|
|
struct bConstraint *con);
|
|
|
|
|
void ED_object_constraint_copy_for_pose(struct Main *bmain,
|
|
|
|
|
struct Object *ob_dst,
|
|
|
|
|
struct bPoseChannel *pchan,
|
|
|
|
|
struct bConstraint *con);
|
|
|
|
|
|
2018-03-02 14:55:53 +11:00
|
|
|
/* object_modes.c */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Checks the mode to be set is compatible with the object
|
|
|
|
|
* should be made into a generic function
|
|
|
|
|
*/
|
2018-03-02 13:53:17 +11:00
|
|
|
bool ED_object_mode_compat_test(const struct Object *ob, eObjectMode mode);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Sets the mode to a compatible state (use before entering the mode).
|
|
|
|
|
*
|
|
|
|
|
* This is so each mode's exec function can call
|
|
|
|
|
*/
|
2018-04-05 18:20:27 +02:00
|
|
|
bool ED_object_mode_compat_set(struct bContext *C,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
eObjectMode mode,
|
|
|
|
|
struct ReportList *reports);
|
2020-06-03 15:23:26 +10:00
|
|
|
bool ED_object_mode_set_ex(struct bContext *C,
|
|
|
|
|
eObjectMode mode,
|
|
|
|
|
bool use_undo,
|
|
|
|
|
struct ReportList *reports);
|
|
|
|
|
bool ED_object_mode_set(struct bContext *C, eObjectMode mode);
|
2018-03-02 13:53:17 +11:00
|
|
|
|
2018-03-02 14:55:53 +11:00
|
|
|
void ED_object_mode_generic_exit(struct Main *bmain,
|
2018-04-06 12:07:27 +02:00
|
|
|
struct Depsgraph *depsgraph,
|
2018-04-05 18:20:27 +02:00
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob);
|
2021-06-30 16:37:14 +10:00
|
|
|
bool ED_object_mode_generic_has_data(struct Depsgraph *depsgraph, const struct Object *ob);
|
2018-03-02 14:55:53 +11:00
|
|
|
|
2020-09-03 14:59:34 +02:00
|
|
|
void ED_object_posemode_set_for_weight_paint(struct bContext *C,
|
2020-09-06 02:21:27 +10:00
|
|
|
struct Main *bmain,
|
|
|
|
|
struct Object *ob,
|
2022-01-07 11:38:08 +11:00
|
|
|
bool is_mode_set);
|
2020-09-03 14:59:34 +02:00
|
|
|
|
2009-05-21 15:34:09 +00:00
|
|
|
/* object_modifier.c */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
2009-11-22 13:44:09 +00:00
|
|
|
enum {
|
2012-05-12 20:39:39 +00:00
|
|
|
MODIFIER_APPLY_DATA = 1,
|
2019-02-03 14:01:45 +11:00
|
|
|
MODIFIER_APPLY_SHAPE,
|
2011-09-10 09:38:38 +00:00
|
|
|
};
|
2009-11-22 13:44:09 +00:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Add a modifier to given object, including relevant extra processing needed by some physics types
|
|
|
|
|
* (particles, simulations...).
|
|
|
|
|
*
|
|
|
|
|
* \param scene: is only used to set current frame in some cases, and may be NULL.
|
|
|
|
|
*/
|
2018-02-19 12:20:18 +11:00
|
|
|
struct ModifierData *ED_object_modifier_add(struct ReportList *reports,
|
|
|
|
|
struct Main *bmain,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
const char *name,
|
|
|
|
|
int type);
|
2014-02-01 01:45:09 +11:00
|
|
|
bool ED_object_modifier_remove(struct ReportList *reports,
|
|
|
|
|
struct Main *bmain,
|
2020-07-09 11:44:11 +02:00
|
|
|
struct Scene *scene,
|
2014-02-01 01:45:09 +11:00
|
|
|
struct Object *ob,
|
|
|
|
|
struct ModifierData *md);
|
2020-07-09 11:44:11 +02:00
|
|
|
void ED_object_modifier_clear(struct Main *bmain, struct Scene *scene, struct Object *ob);
|
2020-06-05 10:41:03 -04:00
|
|
|
bool ED_object_modifier_move_down(struct ReportList *reports,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct ModifierData *md);
|
|
|
|
|
bool ED_object_modifier_move_up(struct ReportList *reports,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct ModifierData *md);
|
|
|
|
|
bool ED_object_modifier_move_to_index(struct ReportList *reports,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct ModifierData *md,
|
2022-01-07 11:38:08 +11:00
|
|
|
int index);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2022-05-31 17:40:02 +10:00
|
|
|
bool ED_object_modifier_convert_psys_to_mesh(struct ReportList *reports,
|
|
|
|
|
struct Main *bmain,
|
|
|
|
|
struct Depsgraph *depsgraph,
|
|
|
|
|
struct ViewLayer *view_layer,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct ModifierData *md);
|
2020-02-24 15:01:34 +01:00
|
|
|
bool ED_object_modifier_apply(struct Main *bmain,
|
|
|
|
|
struct ReportList *reports,
|
|
|
|
|
struct Depsgraph *depsgraph,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct ModifierData *md,
|
2020-07-01 17:38:07 +03:00
|
|
|
int mode,
|
|
|
|
|
bool keep_modifier);
|
2021-01-08 23:09:31 -06:00
|
|
|
bool ED_object_modifier_copy(struct ReportList *reports,
|
|
|
|
|
struct Main *bmain,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct ModifierData *md);
|
2020-09-15 15:14:32 -06:00
|
|
|
void ED_object_modifier_link(struct bContext *C, struct Object *ob_dst, struct Object *ob_src);
|
2020-09-19 16:27:56 -06:00
|
|
|
void ED_object_modifier_copy_to_object(struct bContext *C,
|
|
|
|
|
struct Object *ob_dst,
|
2020-09-15 15:14:32 -06:00
|
|
|
struct Object *ob_src,
|
|
|
|
|
struct ModifierData *md);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* If the object data of 'orig_ob' has other users, run 'callback' on
|
|
|
|
|
* each of them.
|
|
|
|
|
*
|
|
|
|
|
* If include_orig is true, the callback will run on 'orig_ob' too.
|
|
|
|
|
*
|
|
|
|
|
* If the callback ever returns true, iteration will stop and the
|
|
|
|
|
* function value will be true. Otherwise the function returns false.
|
|
|
|
|
*/
|
2018-02-06 17:57:07 +11:00
|
|
|
bool ED_object_iter_other(struct Main *bmain,
|
2018-04-05 18:20:27 +02:00
|
|
|
struct Object *orig_ob,
|
2022-01-07 11:38:08 +11:00
|
|
|
bool include_orig,
|
2018-04-05 18:20:27 +02:00
|
|
|
bool (*callback)(struct Object *ob, void *callback_data),
|
2018-02-06 17:57:07 +11:00
|
|
|
void *callback_data);
|
2012-06-24 20:18:32 +00:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Use with #ED_object_iter_other(). Sets the total number of levels
|
|
|
|
|
* for any multi-res modifiers on the object to the int pointed to by callback_data.
|
|
|
|
|
*/
|
2018-04-05 18:20:27 +02:00
|
|
|
bool ED_object_multires_update_totlevels_cb(struct Object *ob, void *totlevel_v);
|
2012-06-24 20:18:32 +00:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
/* object_greasepencil_modifier.c */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
struct GpencilModifierData *ED_object_gpencil_modifier_add(struct ReportList *reports,
|
|
|
|
|
struct Main *bmain,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
const char *name,
|
|
|
|
|
int type);
|
|
|
|
|
bool ED_object_gpencil_modifier_remove(struct ReportList *reports,
|
|
|
|
|
struct Main *bmain,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct GpencilModifierData *md);
|
|
|
|
|
void ED_object_gpencil_modifier_clear(struct Main *bmain, struct Object *ob);
|
2021-02-16 23:02:33 -06:00
|
|
|
bool ED_object_gpencil_modifier_move_down(struct ReportList *reports,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct GpencilModifierData *md);
|
|
|
|
|
bool ED_object_gpencil_modifier_move_up(struct ReportList *reports,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct GpencilModifierData *md);
|
2020-06-19 14:42:08 -04:00
|
|
|
bool ED_object_gpencil_modifier_move_to_index(struct ReportList *reports,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct GpencilModifierData *md,
|
2022-01-07 11:38:08 +11:00
|
|
|
int index);
|
2021-02-16 23:02:33 -06:00
|
|
|
bool ED_object_gpencil_modifier_apply(struct Main *bmain,
|
|
|
|
|
struct ReportList *reports,
|
|
|
|
|
struct Depsgraph *depsgraph,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct GpencilModifierData *md,
|
|
|
|
|
int mode);
|
|
|
|
|
bool ED_object_gpencil_modifier_copy(struct ReportList *reports,
|
2017-05-31 01:31:14 +10:00
|
|
|
struct Object *ob,
|
2021-02-16 23:02:33 -06:00
|
|
|
struct GpencilModifierData *md);
|
2020-09-15 15:14:32 -06:00
|
|
|
void ED_object_gpencil_modifier_copy_to_object(struct Object *ob_dst,
|
|
|
|
|
struct GpencilModifierData *md);
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
/* object_shader_fx.c */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
struct ShaderFxData *ED_object_shaderfx_add(struct ReportList *reports,
|
|
|
|
|
struct Main *bmain,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
const char *name,
|
|
|
|
|
int type);
|
|
|
|
|
bool ED_object_shaderfx_remove(struct ReportList *reports,
|
2018-02-19 12:20:18 +11:00
|
|
|
struct Main *bmain,
|
2017-05-31 01:31:14 +10:00
|
|
|
struct Object *ob,
|
2018-07-31 10:22:19 +02:00
|
|
|
struct ShaderFxData *fx);
|
2013-02-22 00:51:58 +00:00
|
|
|
void ED_object_shaderfx_clear(struct Main *bmain, struct Object *ob);
|
2018-03-06 19:04:43 +11:00
|
|
|
int ED_object_shaderfx_move_down(struct ReportList *reports,
|
2017-05-31 01:31:14 +10:00
|
|
|
struct Object *ob,
|
2018-07-31 10:22:19 +02:00
|
|
|
struct ShaderFxData *fx);
|
2018-03-06 19:04:43 +11:00
|
|
|
int ED_object_shaderfx_move_up(struct ReportList *reports,
|
2018-07-31 10:22:19 +02:00
|
|
|
struct Object *ob,
|
|
|
|
|
struct ShaderFxData *fx);
|
2020-06-19 15:07:13 -04:00
|
|
|
bool ED_object_shaderfx_move_to_index(struct ReportList *reports,
|
|
|
|
|
struct Object *ob,
|
|
|
|
|
struct ShaderFxData *fx,
|
2022-01-07 11:38:08 +11:00
|
|
|
int index);
|
2020-09-15 14:50:21 -06:00
|
|
|
void ED_object_shaderfx_link(struct Object *dst, struct Object *src);
|
|
|
|
|
void ED_object_shaderfx_copy(struct Object *dst, struct ShaderFxData *fx);
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2012-10-10 03:13:02 +00:00
|
|
|
/* object_select.c */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2012-07-25 19:45:34 +00:00
|
|
|
void ED_object_select_linked_by_id(struct bContext *C, struct ID *id);
|
|
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
const struct EnumPropertyItem *ED_object_vgroup_selection_itemf_helper(
|
2013-06-23 15:37:08 +00:00
|
|
|
const struct bContext *C,
|
|
|
|
|
struct PointerRNA *ptr,
|
|
|
|
|
struct PropertyRNA *prop,
|
2014-01-04 18:08:43 +11:00
|
|
|
bool *r_free,
|
2022-01-07 11:38:08 +11:00
|
|
|
unsigned int selection_mask);
|
2013-06-12 09:52:37 +00:00
|
|
|
|
2018-02-19 12:20:18 +11:00
|
|
|
void ED_object_check_force_modifiers(struct Main *bmain,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct Object *object);
|
2013-11-19 17:19:06 +06:00
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* If id is not already an Object, try to find an object that uses it as data.
|
|
|
|
|
* Prefers active, then selected, then visible/selectable.
|
|
|
|
|
*/
|
2018-11-20 17:34:56 +11:00
|
|
|
struct Base *ED_object_find_first_by_data_id(struct ViewLayer *view_layer, struct ID *id);
|
|
|
|
|
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Select and make the target object active in the view layer.
|
|
|
|
|
* If already selected, selection isn't changed.
|
|
|
|
|
*
|
|
|
|
|
* \returns false if not found in current view layer
|
|
|
|
|
*/
|
2022-01-07 11:38:08 +11:00
|
|
|
bool ED_object_jump_to_object(struct bContext *C, struct Object *ob, bool reveal_hidden);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Select and make the target object and bone active.
|
|
|
|
|
* Switches to Pose mode if in Object mode so the selection is visible.
|
|
|
|
|
* Un-hides the target bone and bone layer if necessary.
|
|
|
|
|
*
|
|
|
|
|
* \returns false if object not in layer, bone not found, or other error
|
|
|
|
|
*/
|
2016-02-26 01:07:26 +13:00
|
|
|
bool ED_object_jump_to_bone(struct bContext *C,
|
2018-11-21 13:04:03 +11:00
|
|
|
struct Object *ob,
|
|
|
|
|
const char *bone_name,
|
2022-01-07 11:38:08 +11:00
|
|
|
bool reveal_hidden);
|
2018-11-20 17:34:56 +11:00
|
|
|
|
2017-05-31 01:31:14 +10:00
|
|
|
/* object_facemap_ops.c */
|
2021-12-09 00:55:11 +11:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called while not in edit-mode.
|
|
|
|
|
*/
|
2017-05-31 01:31:14 +10:00
|
|
|
void ED_object_facemap_face_add(struct Object *ob, struct bFaceMap *fmap, int facenum);
|
2021-12-09 00:55:11 +11:00
|
|
|
/**
|
|
|
|
|
* Called while not in edit-mode.
|
|
|
|
|
*/
|
2017-05-31 01:31:14 +10:00
|
|
|
void ED_object_facemap_face_remove(struct Object *ob, struct bFaceMap *fmap, int facenum);
|
|
|
|
|
|
2019-08-22 13:45:31 +10:00
|
|
|
/* object_data_transform.c */
|
2022-04-04 13:17:03 +10:00
|
|
|
|
2019-11-21 21:03:03 +11:00
|
|
|
struct XFormObjectData *ED_object_data_xform_create_ex(struct ID *id, bool is_edit_mode);
|
2019-08-22 13:45:31 +10:00
|
|
|
struct XFormObjectData *ED_object_data_xform_create(struct ID *id);
|
2019-11-21 21:03:03 +11:00
|
|
|
struct XFormObjectData *ED_object_data_xform_create_from_edit_mode(ID *id);
|
|
|
|
|
|
2020-07-25 16:35:52 +10:00
|
|
|
void ED_object_data_xform_destroy(struct XFormObjectData *xod_base);
|
2019-08-22 13:45:31 +10:00
|
|
|
|
|
|
|
|
void ED_object_data_xform_by_mat4(struct XFormObjectData *xod, const float mat[4][4]);
|
|
|
|
|
|
2019-11-21 21:03:03 +11:00
|
|
|
void ED_object_data_xform_restore(struct XFormObjectData *xod);
|
|
|
|
|
void ED_object_data_xform_tag_update(struct XFormObjectData *xod);
|
|
|
|
|
|
2010-10-05 00:05:14 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|