2023-11-15 18:46:07 +01:00
|
|
|
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-11-16 18:29:52 +01:00
|
|
|
#include "BLI_array.hh"
|
|
|
|
#include "BLI_math_matrix_types.hh"
|
2023-11-15 18:46:07 +01:00
|
|
|
#include "BLI_math_vector_types.hh"
|
|
|
|
|
|
|
|
#include "DNA_customdata_types.h" /* #CustomData_MeshMasks. */
|
|
|
|
|
|
|
|
struct BoundBox;
|
|
|
|
struct bGPdata;
|
|
|
|
struct Curve;
|
|
|
|
struct CurveCache;
|
|
|
|
struct ID;
|
|
|
|
struct Mesh;
|
|
|
|
struct PoseBackup;
|
|
|
|
|
|
|
|
namespace blender::bke {
|
|
|
|
|
|
|
|
struct GeometrySet;
|
|
|
|
|
|
|
|
struct ObjectRuntime {
|
|
|
|
/**
|
|
|
|
* The custom data layer mask that was last used
|
|
|
|
* to calculate data_eval and mesh_deform_eval.
|
|
|
|
*/
|
2023-11-16 18:29:52 +01:00
|
|
|
CustomData_MeshMasks last_data_mask = {};
|
2023-11-15 18:46:07 +01:00
|
|
|
|
|
|
|
/** Did last modifier stack generation need mapping support? */
|
2023-11-16 18:29:52 +01:00
|
|
|
char last_need_mapping = false;
|
2023-11-15 18:46:07 +01:00
|
|
|
|
|
|
|
/** Only used for drawing the parent/child help-line. */
|
2023-11-16 18:29:52 +01:00
|
|
|
float3 parent_display_origin;
|
2023-11-15 18:46:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Selection id of this object. It might differ between an evaluated and its original object,
|
|
|
|
* when the object is being instanced.
|
|
|
|
*/
|
2023-11-16 18:29:52 +01:00
|
|
|
int select_id = -1;
|
2023-11-15 18:46:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Denotes whether the evaluated data is owned by this object or is referenced and owned by
|
|
|
|
* somebody else.
|
|
|
|
*/
|
2023-11-16 18:29:52 +01:00
|
|
|
char is_data_eval_owned = false;
|
2023-11-15 18:46:07 +01:00
|
|
|
|
|
|
|
/** Start time of the mode transfer overlay animation. */
|
2023-11-16 18:29:52 +01:00
|
|
|
double overlay_mode_transfer_start_time = 0.0f;
|
2023-11-15 18:46:07 +01:00
|
|
|
|
|
|
|
/** Axis aligned bound-box (in local-space). */
|
2023-11-16 18:29:52 +01:00
|
|
|
BoundBox *bb = nullptr;
|
2023-11-15 18:46:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Original data pointer, before object->data was changed to point
|
|
|
|
* to data_eval.
|
|
|
|
* Is assigned by dependency graph's copy-on-write evaluation.
|
|
|
|
*/
|
2023-11-16 18:29:52 +01:00
|
|
|
ID *data_orig = nullptr;
|
2023-11-15 18:46:07 +01:00
|
|
|
/**
|
|
|
|
* Object data structure created during object evaluation. It has all modifiers applied.
|
|
|
|
* The type is determined by the type of the original object.
|
|
|
|
*/
|
2023-11-16 18:29:52 +01:00
|
|
|
ID *data_eval = nullptr;
|
2023-11-15 18:46:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Objects can evaluate to a geometry set instead of a single ID. In those cases, the evaluated
|
|
|
|
* geometry set will be stored here. An ID of the correct type is still stored in #data_eval.
|
|
|
|
* #geometry_set_eval might reference the ID pointed to by #data_eval as well, but does not own
|
|
|
|
* the data.
|
|
|
|
*/
|
2023-11-16 18:29:52 +01:00
|
|
|
GeometrySet *geometry_set_eval = nullptr;
|
2023-11-15 18:46:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Mesh structure created during object evaluation.
|
|
|
|
* It has deformation only modifiers applied on it.
|
|
|
|
*/
|
2023-11-16 18:29:52 +01:00
|
|
|
Mesh *mesh_deform_eval = nullptr;
|
2023-11-15 18:46:07 +01:00
|
|
|
|
|
|
|
/* Evaluated mesh cage in edit mode. */
|
2023-11-16 18:29:52 +01:00
|
|
|
Mesh *editmesh_eval_cage = nullptr;
|
2023-11-15 18:46:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Original grease pencil bGPdata pointer, before object->data was changed to point
|
|
|
|
* to gpd_eval.
|
|
|
|
* Is assigned by dependency graph's copy-on-write evaluation.
|
|
|
|
*/
|
2023-11-16 18:29:52 +01:00
|
|
|
bGPdata *gpd_orig = nullptr;
|
2023-11-15 18:46:07 +01:00
|
|
|
/**
|
|
|
|
* bGPdata structure created during object evaluation.
|
|
|
|
* It has all modifiers applied.
|
|
|
|
*/
|
2023-11-16 18:29:52 +01:00
|
|
|
bGPdata *gpd_eval = nullptr;
|
2023-11-15 18:46:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is a mesh representation of corresponding object.
|
|
|
|
* It created when Python calls `object.to_mesh()`.
|
|
|
|
*/
|
2023-11-16 18:29:52 +01:00
|
|
|
Mesh *object_as_temp_mesh = nullptr;
|
2023-11-15 18:46:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Backup of the object's pose (might be a subset, i.e. not contain all bones).
|
|
|
|
*
|
|
|
|
* Created by `BKE_pose_backup_create_on_object()`. This memory is owned by the Object.
|
|
|
|
* It is freed along with the object, or when `BKE_pose_backup_clear()` is called.
|
|
|
|
*/
|
2023-11-16 18:29:52 +01:00
|
|
|
PoseBackup *pose_backup = nullptr;
|
2023-11-15 18:46:07 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is a curve representation of corresponding object.
|
|
|
|
* It created when Python calls `object.to_curve()`.
|
|
|
|
*/
|
2023-11-16 18:29:52 +01:00
|
|
|
::Curve *object_as_temp_curve = nullptr;
|
2023-11-15 18:46:07 +01:00
|
|
|
|
|
|
|
/** Runtime evaluated curve-specific data, not stored in the file. */
|
2023-11-16 18:29:52 +01:00
|
|
|
CurveCache *curve_cache = nullptr;
|
2023-11-15 18:46:07 +01:00
|
|
|
|
2023-11-16 18:29:52 +01:00
|
|
|
unsigned short local_collections_bits = 0;
|
2023-11-15 18:46:07 +01:00
|
|
|
|
2023-11-16 18:29:52 +01:00
|
|
|
Array<float3x3, 0> crazyspace_deform_imats;
|
|
|
|
Array<float3, 0> crazyspace_deform_cos;
|
2023-11-15 18:46:07 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace blender::bke
|