Cleanup: use const for typeinfo
This commit is contained in:
@@ -108,8 +108,8 @@ typedef struct bConstraintTypeInfo {
|
|||||||
} bConstraintTypeInfo;
|
} bConstraintTypeInfo;
|
||||||
|
|
||||||
/* Function Prototypes for bConstraintTypeInfo's */
|
/* Function Prototypes for bConstraintTypeInfo's */
|
||||||
bConstraintTypeInfo *BKE_constraint_typeinfo_get(struct bConstraint *con);
|
const bConstraintTypeInfo *BKE_constraint_typeinfo_get(struct bConstraint *con);
|
||||||
bConstraintTypeInfo *BKE_constraint_typeinfo_from_type(int type);
|
const bConstraintTypeInfo *BKE_constraint_typeinfo_from_type(int type);
|
||||||
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------- */
|
||||||
|
@@ -172,8 +172,8 @@ typedef enum eFMI_Requirement_Flags {
|
|||||||
} eFMI_Requirement_Flags;
|
} eFMI_Requirement_Flags;
|
||||||
|
|
||||||
/* Function Prototypes for FModifierTypeInfo's */
|
/* Function Prototypes for FModifierTypeInfo's */
|
||||||
FModifierTypeInfo *fmodifier_get_typeinfo(struct FModifier *fcm);
|
const FModifierTypeInfo *fmodifier_get_typeinfo(struct FModifier *fcm);
|
||||||
FModifierTypeInfo *get_fmodifier_typeinfo(int type);
|
const FModifierTypeInfo *get_fmodifier_typeinfo(int type);
|
||||||
|
|
||||||
/* ---------------------- */
|
/* ---------------------- */
|
||||||
|
|
||||||
|
@@ -312,7 +312,7 @@ typedef struct ModifierTypeInfo {
|
|||||||
/* Initialize modifier's global data (type info and some common global storages). */
|
/* Initialize modifier's global data (type info and some common global storages). */
|
||||||
void BKE_modifier_init(void);
|
void BKE_modifier_init(void);
|
||||||
|
|
||||||
ModifierTypeInfo *modifierType_getInfo(ModifierType type);
|
const ModifierTypeInfo *modifierType_getInfo(ModifierType type);
|
||||||
|
|
||||||
/* Modifier utility calls, do call through type pointer and return
|
/* Modifier utility calls, do call through type pointer and return
|
||||||
* default values if pointer is optional.
|
* default values if pointer is optional.
|
||||||
|
@@ -433,7 +433,7 @@ typedef struct SequenceModifierTypeInfo {
|
|||||||
void (*apply) (struct SequenceModifierData *smd, struct ImBuf *ibuf, struct ImBuf *mask);
|
void (*apply) (struct SequenceModifierData *smd, struct ImBuf *ibuf, struct ImBuf *mask);
|
||||||
} SequenceModifierTypeInfo;
|
} SequenceModifierTypeInfo;
|
||||||
|
|
||||||
struct SequenceModifierTypeInfo *BKE_sequence_modifier_type_info_get(int type);
|
const struct SequenceModifierTypeInfo *BKE_sequence_modifier_type_info_get(int type);
|
||||||
|
|
||||||
struct SequenceModifierData *BKE_sequence_modifier_new(struct Sequence *seq, const char *name, int type);
|
struct SequenceModifierData *BKE_sequence_modifier_new(struct Sequence *seq, const char *name, int type);
|
||||||
bool BKE_sequence_modifier_remove(struct Sequence *seq, struct SequenceModifierData *smd);
|
bool BKE_sequence_modifier_remove(struct Sequence *seq, struct SequenceModifierData *smd);
|
||||||
|
@@ -931,7 +931,7 @@ DerivedMesh *mesh_create_derived_for_modifier(Scene *scene, Object *ob,
|
|||||||
ModifierData *md, int build_shapekey_layers)
|
ModifierData *md, int build_shapekey_layers)
|
||||||
{
|
{
|
||||||
Mesh *me = ob->data;
|
Mesh *me = ob->data;
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
DerivedMesh *dm;
|
DerivedMesh *dm;
|
||||||
KeyBlock *kb;
|
KeyBlock *kb;
|
||||||
|
|
||||||
@@ -1585,7 +1585,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
|
|||||||
|
|
||||||
/* Apply all leading deforming modifiers */
|
/* Apply all leading deforming modifiers */
|
||||||
for (; md; md = md->next, curr = curr->next) {
|
for (; md; md = md->next, curr = curr->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
md->scene = scene;
|
md->scene = scene;
|
||||||
|
|
||||||
@@ -1639,7 +1639,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
|
|||||||
clothorcodm = NULL;
|
clothorcodm = NULL;
|
||||||
|
|
||||||
for (; md; md = md->next, curr = curr->next) {
|
for (; md; md = md->next, curr = curr->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
md->scene = scene;
|
md->scene = scene;
|
||||||
|
|
||||||
@@ -2000,7 +2000,7 @@ float (*editbmesh_get_vertex_cos(BMEditMesh *em, int *r_numVerts))[3]
|
|||||||
|
|
||||||
bool editbmesh_modifier_is_enabled(Scene *scene, ModifierData *md, DerivedMesh *dm)
|
bool editbmesh_modifier_is_enabled(Scene *scene, ModifierData *md, DerivedMesh *dm)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
int required_mode = eModifierMode_Realtime | eModifierMode_Editmode;
|
int required_mode = eModifierMode_Realtime | eModifierMode_Editmode;
|
||||||
|
|
||||||
if (!modifier_isEnabled(scene, md, required_mode)) return 0;
|
if (!modifier_isEnabled(scene, md, required_mode)) return 0;
|
||||||
@@ -2059,7 +2059,7 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
|
|||||||
|
|
||||||
curr = datamasks;
|
curr = datamasks;
|
||||||
for (i = 0; md; i++, md = md->next, curr = curr->next) {
|
for (i = 0; md; i++, md = md->next, curr = curr->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
md->scene = scene;
|
md->scene = scene;
|
||||||
|
|
||||||
|
@@ -1700,7 +1700,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
|
|||||||
|
|
||||||
/* constraints - set target ob pointer to own object */
|
/* constraints - set target ob pointer to own object */
|
||||||
for (con = pchanw.constraints.first; con; con = con->next) {
|
for (con = pchanw.constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
|
@@ -4318,7 +4318,7 @@ static void constraints_init_typeinfo(void)
|
|||||||
/* This function should be used for getting the appropriate type-info when only
|
/* This function should be used for getting the appropriate type-info when only
|
||||||
* a constraint type is known
|
* a constraint type is known
|
||||||
*/
|
*/
|
||||||
bConstraintTypeInfo *BKE_constraint_typeinfo_from_type(int type)
|
const bConstraintTypeInfo *BKE_constraint_typeinfo_from_type(int type)
|
||||||
{
|
{
|
||||||
/* initialize the type-info list? */
|
/* initialize the type-info list? */
|
||||||
if (CTI_INIT) {
|
if (CTI_INIT) {
|
||||||
@@ -4343,7 +4343,7 @@ bConstraintTypeInfo *BKE_constraint_typeinfo_from_type(int type)
|
|||||||
/* This function should always be used to get the appropriate type-info, as it
|
/* This function should always be used to get the appropriate type-info, as it
|
||||||
* has checks which prevent segfaults in some weird cases.
|
* has checks which prevent segfaults in some weird cases.
|
||||||
*/
|
*/
|
||||||
bConstraintTypeInfo *BKE_constraint_typeinfo_get(bConstraint *con)
|
const bConstraintTypeInfo *BKE_constraint_typeinfo_get(bConstraint *con)
|
||||||
{
|
{
|
||||||
/* only return typeinfo for valid constraints */
|
/* only return typeinfo for valid constraints */
|
||||||
if (con)
|
if (con)
|
||||||
@@ -4373,7 +4373,7 @@ static void con_unlink_refs_cb(bConstraint *UNUSED(con), ID **idpoin, bool is_re
|
|||||||
void BKE_constraint_free_data_ex(bConstraint *con, bool do_id_user)
|
void BKE_constraint_free_data_ex(bConstraint *con, bool do_id_user)
|
||||||
{
|
{
|
||||||
if (con->data) {
|
if (con->data) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
|
|
||||||
if (cti) {
|
if (cti) {
|
||||||
/* perform any special freeing constraint may have */
|
/* perform any special freeing constraint may have */
|
||||||
@@ -4447,7 +4447,7 @@ bool BKE_constraint_remove_ex(ListBase *list, Object *ob, bConstraint *con, bool
|
|||||||
static bConstraint *add_new_constraint_internal(const char *name, short type)
|
static bConstraint *add_new_constraint_internal(const char *name, short type)
|
||||||
{
|
{
|
||||||
bConstraint *con = MEM_callocN(sizeof(bConstraint), "Constraint");
|
bConstraint *con = MEM_callocN(sizeof(bConstraint), "Constraint");
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_from_type(type);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_from_type(type);
|
||||||
const char *newName;
|
const char *newName;
|
||||||
|
|
||||||
/* Set up a generic constraint datablock */
|
/* Set up a generic constraint datablock */
|
||||||
@@ -4574,7 +4574,7 @@ void BKE_constraints_id_loop(ListBase *conlist, ConstraintIDFunc func, void *use
|
|||||||
bConstraint *con;
|
bConstraint *con;
|
||||||
|
|
||||||
for (con = conlist->first; con; con = con->next) {
|
for (con = conlist->first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
|
|
||||||
if (cti) {
|
if (cti) {
|
||||||
if (cti->id_looper)
|
if (cti->id_looper)
|
||||||
@@ -4609,7 +4609,7 @@ void BKE_constraints_copy(ListBase *dst, const ListBase *src, bool do_extern)
|
|||||||
BLI_duplicatelist(dst, src);
|
BLI_duplicatelist(dst, src);
|
||||||
|
|
||||||
for (con = dst->first, srccon = src->first; con && srccon; srccon = srccon->next, con = con->next) {
|
for (con = dst->first, srccon = src->first; con && srccon; srccon = srccon->next, con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
|
|
||||||
/* make a new copy of the constraint's data */
|
/* make a new copy of the constraint's data */
|
||||||
con->data = MEM_dupallocN(con->data);
|
con->data = MEM_dupallocN(con->data);
|
||||||
@@ -4724,7 +4724,7 @@ bool BKE_constraints_proxylocked_owner(Object *ob, bPoseChannel *pchan)
|
|||||||
*/
|
*/
|
||||||
void BKE_constraint_target_matrix_get(Scene *scene, bConstraint *con, int index, short ownertype, void *ownerdata, float mat[4][4], float ctime)
|
void BKE_constraint_target_matrix_get(Scene *scene, bConstraint *con, int index, short ownertype, void *ownerdata, float mat[4][4], float ctime)
|
||||||
{
|
{
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintOb *cob;
|
bConstraintOb *cob;
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
@@ -4791,7 +4791,7 @@ void BKE_constraint_target_matrix_get(Scene *scene, bConstraint *con, int index,
|
|||||||
/* Get the list of targets required for solving a constraint */
|
/* Get the list of targets required for solving a constraint */
|
||||||
void BKE_constraint_targets_for_solving_get(bConstraint *con, bConstraintOb *cob, ListBase *targets, float ctime)
|
void BKE_constraint_targets_for_solving_get(bConstraint *con, bConstraintOb *cob, ListBase *targets, float ctime)
|
||||||
{
|
{
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
|
|
||||||
if (cti && cti->get_constraint_targets) {
|
if (cti && cti->get_constraint_targets) {
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
@@ -4836,7 +4836,7 @@ void BKE_constraints_solve(ListBase *conlist, bConstraintOb *cob, float ctime)
|
|||||||
|
|
||||||
/* loop over available constraints, solving and blending them */
|
/* loop over available constraints, solving and blending them */
|
||||||
for (con = conlist->first; con; con = con->next) {
|
for (con = conlist->first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
|
|
||||||
/* these we can skip completely (invalid constraints...) */
|
/* these we can skip completely (invalid constraints...) */
|
||||||
|
@@ -266,7 +266,7 @@ int editbmesh_get_first_deform_matrices(Scene *scene, Object *ob, BMEditMesh *em
|
|||||||
* modifiers with on cage editing that are enabled and support computing
|
* modifiers with on cage editing that are enabled and support computing
|
||||||
* deform matrices */
|
* deform matrices */
|
||||||
for (i = 0; md && i <= cageIndex; i++, md = md->next) {
|
for (i = 0; md && i <= cageIndex; i++, md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
if (!editbmesh_modifier_is_enabled(scene, md, dm))
|
if (!editbmesh_modifier_is_enabled(scene, md, dm))
|
||||||
continue;
|
continue;
|
||||||
@@ -322,7 +322,7 @@ int BKE_sculpt_get_first_deform_matrices(Scene *scene, Object *ob, float (**defo
|
|||||||
md = modifiers_getVirtualModifierList(ob, &virtualModifierData);
|
md = modifiers_getVirtualModifierList(ob, &virtualModifierData);
|
||||||
|
|
||||||
for (; md; md = md->next) {
|
for (; md; md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
if (!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
|
if (!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
|
||||||
|
|
||||||
@@ -343,7 +343,7 @@ int BKE_sculpt_get_first_deform_matrices(Scene *scene, Object *ob, float (**defo
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (; md; md = md->next) {
|
for (; md; md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
if (!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
|
if (!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
|
||||||
|
|
||||||
@@ -377,7 +377,7 @@ void BKE_crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[
|
|||||||
Mesh *me = (Mesh *)ob->data;
|
Mesh *me = (Mesh *)ob->data;
|
||||||
|
|
||||||
for (; md; md = md->next) {
|
for (; md; md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
if (!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
|
if (!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
|
||||||
|
|
||||||
|
@@ -512,7 +512,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Main *bmain, Sc
|
|||||||
|
|
||||||
for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
|
for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
|
||||||
for (con = pchan->constraints.first; con; con = con->next) {
|
for (con = pchan->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
@@ -574,7 +574,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Main *bmain, Sc
|
|||||||
ModifierData *md;
|
ModifierData *md;
|
||||||
|
|
||||||
for (md = ob->modifiers.first; md; md = md->next) {
|
for (md = ob->modifiers.first; md; md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
if (mti->updateDepgraph) mti->updateDepgraph(md, dag, bmain, scene, ob, node);
|
if (mti->updateDepgraph) mti->updateDepgraph(md, dag, bmain, scene, ob, node);
|
||||||
}
|
}
|
||||||
@@ -823,7 +823,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Main *bmain, Sc
|
|||||||
|
|
||||||
/* object constraints */
|
/* object constraints */
|
||||||
for (con = ob->constraints.first; con; con = con->next) {
|
for (con = ob->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
@@ -2011,7 +2011,7 @@ static void dag_object_time_update_flags(Main *bmain, Scene *scene, Object *ob)
|
|||||||
if (ob->constraints.first) {
|
if (ob->constraints.first) {
|
||||||
bConstraint *con;
|
bConstraint *con;
|
||||||
for (con = ob->constraints.first; con; con = con->next) {
|
for (con = ob->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
@@ -2532,7 +2532,7 @@ static void dag_id_flush_update(Main *bmain, Scene *sce, ID *id)
|
|||||||
for (obt = bmain->object.first; obt; obt = obt->id.next) {
|
for (obt = bmain->object.first; obt; obt = obt->id.next) {
|
||||||
bConstraint *con;
|
bConstraint *con;
|
||||||
for (con = obt->constraints.first; con; con = con->next) {
|
for (con = obt->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
if (ELEM(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER,
|
if (ELEM(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER,
|
||||||
CONSTRAINT_TYPE_OBJECTSOLVER))
|
CONSTRAINT_TYPE_OBJECTSOLVER))
|
||||||
{
|
{
|
||||||
@@ -2916,7 +2916,7 @@ void DAG_pose_sort(Object *ob)
|
|||||||
addtoroot = 0;
|
addtoroot = 0;
|
||||||
}
|
}
|
||||||
for (con = pchan->constraints.first; con; con = con->next) {
|
for (con = pchan->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
|
@@ -764,7 +764,7 @@ static ModifierData *curve_get_tessellate_point(Scene *scene, Object *ob,
|
|||||||
|
|
||||||
pretessellatePoint = NULL;
|
pretessellatePoint = NULL;
|
||||||
for (; md; md = md->next) {
|
for (; md; md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
if (!modifier_isEnabled(scene, md, required_mode))
|
if (!modifier_isEnabled(scene, md, required_mode))
|
||||||
continue;
|
continue;
|
||||||
@@ -833,7 +833,7 @@ static void curve_calc_modifiers_pre(Scene *scene, Object *ob, ListBase *nurb,
|
|||||||
|
|
||||||
if (pretessellatePoint) {
|
if (pretessellatePoint) {
|
||||||
for (; md; md = md->next) {
|
for (; md; md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
md->scene = scene;
|
md->scene = scene;
|
||||||
|
|
||||||
@@ -934,7 +934,7 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *nurb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (; md; md = md->next) {
|
for (; md; md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
ModifierApplyFlag appf = app_flag;
|
ModifierApplyFlag appf = app_flag;
|
||||||
|
|
||||||
md->scene = scene;
|
md->scene = scene;
|
||||||
@@ -1165,7 +1165,7 @@ static void curve_calc_orcodm(Scene *scene, Object *ob, DerivedMesh *dm_final,
|
|||||||
orcodm = create_orco_dm(scene, ob);
|
orcodm = create_orco_dm(scene, ob);
|
||||||
|
|
||||||
for (; md; md = md->next) {
|
for (; md; md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
md->scene = scene;
|
md->scene = scene;
|
||||||
|
|
||||||
|
@@ -527,7 +527,7 @@ static int subframe_updateObject(Scene *scene, Object *ob, int flags, int parent
|
|||||||
|
|
||||||
/* also update constraint targets */
|
/* also update constraint targets */
|
||||||
for (con = ob->constraints.first; con; con = con->next) {
|
for (con = ob->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
|
|
||||||
if (cti && cti->get_constraint_targets) {
|
if (cti && cti->get_constraint_targets) {
|
||||||
|
@@ -1531,7 +1531,7 @@ static DriverVarTypeInfo dvar_types[MAX_DVAR_TYPES] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Get driver variable typeinfo */
|
/* Get driver variable typeinfo */
|
||||||
static DriverVarTypeInfo *get_dvar_typeinfo(int type)
|
static const DriverVarTypeInfo *get_dvar_typeinfo(int type)
|
||||||
{
|
{
|
||||||
/* check if valid type */
|
/* check if valid type */
|
||||||
if ((type >= 0) && (type < MAX_DVAR_TYPES))
|
if ((type >= 0) && (type < MAX_DVAR_TYPES))
|
||||||
@@ -1575,7 +1575,7 @@ void driver_free_variable(ChannelDriver *driver, DriverVar *dvar)
|
|||||||
/* Change the type of driver variable */
|
/* Change the type of driver variable */
|
||||||
void driver_change_variable_type(DriverVar *dvar, int type)
|
void driver_change_variable_type(DriverVar *dvar, int type)
|
||||||
{
|
{
|
||||||
DriverVarTypeInfo *dvti = get_dvar_typeinfo(type);
|
const DriverVarTypeInfo *dvti = get_dvar_typeinfo(type);
|
||||||
|
|
||||||
/* sanity check */
|
/* sanity check */
|
||||||
if (ELEM(NULL, dvar, dvti))
|
if (ELEM(NULL, dvar, dvti))
|
||||||
@@ -1699,7 +1699,7 @@ ChannelDriver *fcurve_copy_driver(ChannelDriver *driver)
|
|||||||
/* Evaluate a Driver Variable to get a value that contributes to the final */
|
/* Evaluate a Driver Variable to get a value that contributes to the final */
|
||||||
float driver_get_variable_value(ChannelDriver *driver, DriverVar *dvar)
|
float driver_get_variable_value(ChannelDriver *driver, DriverVar *dvar)
|
||||||
{
|
{
|
||||||
DriverVarTypeInfo *dvti;
|
const DriverVarTypeInfo *dvti;
|
||||||
|
|
||||||
/* sanity check */
|
/* sanity check */
|
||||||
if (ELEM(NULL, driver, dvar))
|
if (ELEM(NULL, driver, dvar))
|
||||||
|
@@ -1040,7 +1040,7 @@ static void fmods_init_typeinfo(void)
|
|||||||
/* This function should be used for getting the appropriate type-info when only
|
/* This function should be used for getting the appropriate type-info when only
|
||||||
* a F-Curve modifier type is known
|
* a F-Curve modifier type is known
|
||||||
*/
|
*/
|
||||||
FModifierTypeInfo *get_fmodifier_typeinfo(int type)
|
const FModifierTypeInfo *get_fmodifier_typeinfo(int type)
|
||||||
{
|
{
|
||||||
/* initialize the type-info list? */
|
/* initialize the type-info list? */
|
||||||
if (FMI_INIT) {
|
if (FMI_INIT) {
|
||||||
@@ -1065,7 +1065,7 @@ FModifierTypeInfo *get_fmodifier_typeinfo(int type)
|
|||||||
/* This function should always be used to get the appropriate type-info, as it
|
/* This function should always be used to get the appropriate type-info, as it
|
||||||
* has checks which prevent segfaults in some weird cases.
|
* has checks which prevent segfaults in some weird cases.
|
||||||
*/
|
*/
|
||||||
FModifierTypeInfo *fmodifier_get_typeinfo(FModifier *fcm)
|
const FModifierTypeInfo *fmodifier_get_typeinfo(FModifier *fcm)
|
||||||
{
|
{
|
||||||
/* only return typeinfo for valid modifiers */
|
/* only return typeinfo for valid modifiers */
|
||||||
if (fcm)
|
if (fcm)
|
||||||
@@ -1079,7 +1079,7 @@ FModifierTypeInfo *fmodifier_get_typeinfo(FModifier *fcm)
|
|||||||
/* Add a new F-Curve Modifier to the given F-Curve of a certain type */
|
/* Add a new F-Curve Modifier to the given F-Curve of a certain type */
|
||||||
FModifier *add_fmodifier(ListBase *modifiers, int type)
|
FModifier *add_fmodifier(ListBase *modifiers, int type)
|
||||||
{
|
{
|
||||||
FModifierTypeInfo *fmi = get_fmodifier_typeinfo(type);
|
const FModifierTypeInfo *fmi = get_fmodifier_typeinfo(type);
|
||||||
FModifier *fcm;
|
FModifier *fcm;
|
||||||
|
|
||||||
/* sanity checks */
|
/* sanity checks */
|
||||||
@@ -1119,7 +1119,7 @@ FModifier *add_fmodifier(ListBase *modifiers, int type)
|
|||||||
/* Make a copy of the specified F-Modifier */
|
/* Make a copy of the specified F-Modifier */
|
||||||
FModifier *copy_fmodifier(FModifier *src)
|
FModifier *copy_fmodifier(FModifier *src)
|
||||||
{
|
{
|
||||||
FModifierTypeInfo *fmi = fmodifier_get_typeinfo(src);
|
const FModifierTypeInfo *fmi = fmodifier_get_typeinfo(src);
|
||||||
FModifier *dst;
|
FModifier *dst;
|
||||||
|
|
||||||
/* sanity check */
|
/* sanity check */
|
||||||
@@ -1153,7 +1153,7 @@ void copy_fmodifiers(ListBase *dst, ListBase *src)
|
|||||||
BLI_duplicatelist(dst, src);
|
BLI_duplicatelist(dst, src);
|
||||||
|
|
||||||
for (fcm = dst->first, srcfcm = src->first; fcm && srcfcm; srcfcm = srcfcm->next, fcm = fcm->next) {
|
for (fcm = dst->first, srcfcm = src->first; fcm && srcfcm; srcfcm = srcfcm->next, fcm = fcm->next) {
|
||||||
FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
const FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
||||||
|
|
||||||
/* make a new copy of the F-Modifier's data */
|
/* make a new copy of the F-Modifier's data */
|
||||||
fcm->data = MEM_dupallocN(fcm->data);
|
fcm->data = MEM_dupallocN(fcm->data);
|
||||||
@@ -1167,7 +1167,7 @@ void copy_fmodifiers(ListBase *dst, ListBase *src)
|
|||||||
/* Remove and free the given F-Modifier from the given stack */
|
/* Remove and free the given F-Modifier from the given stack */
|
||||||
bool remove_fmodifier(ListBase *modifiers, FModifier *fcm)
|
bool remove_fmodifier(ListBase *modifiers, FModifier *fcm)
|
||||||
{
|
{
|
||||||
FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
const FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
||||||
|
|
||||||
/* sanity check */
|
/* sanity check */
|
||||||
if (fcm == NULL)
|
if (fcm == NULL)
|
||||||
@@ -1266,7 +1266,7 @@ bool list_has_suitable_fmodifier(ListBase *modifiers, int mtype, short acttype)
|
|||||||
|
|
||||||
/* find the first mdifier fitting these criteria */
|
/* find the first mdifier fitting these criteria */
|
||||||
for (fcm = modifiers->first; fcm; fcm = fcm->next) {
|
for (fcm = modifiers->first; fcm; fcm = fcm->next) {
|
||||||
FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
const FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
||||||
short mOk = 1, aOk = 1; /* by default 1, so that when only one test, won't fail */
|
short mOk = 1, aOk = 1; /* by default 1, so that when only one test, won't fail */
|
||||||
|
|
||||||
/* check if applicable ones are fullfilled */
|
/* check if applicable ones are fullfilled */
|
||||||
@@ -1296,7 +1296,7 @@ FModifierStackStorage *evaluate_fmodifiers_storage_new(ListBase *modifiers)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (fcm = modifiers->last; fcm; fcm = fcm->prev) {
|
for (fcm = modifiers->last; fcm; fcm = fcm->prev) {
|
||||||
FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
const FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
||||||
|
|
||||||
if (fmi == NULL) {
|
if (fmi == NULL) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1410,7 +1410,7 @@ float evaluate_time_fmodifiers(FModifierStackStorage *storage, ListBase *modifie
|
|||||||
* (such as multiple 'stepped' modifiers in sequence, causing different stepping rates)
|
* (such as multiple 'stepped' modifiers in sequence, causing different stepping rates)
|
||||||
*/
|
*/
|
||||||
for (fcm = modifiers->last; fcm; fcm = fcm->prev) {
|
for (fcm = modifiers->last; fcm; fcm = fcm->prev) {
|
||||||
FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
const FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
||||||
|
|
||||||
if (fmi == NULL)
|
if (fmi == NULL)
|
||||||
continue;
|
continue;
|
||||||
@@ -1458,7 +1458,7 @@ void evaluate_value_fmodifiers(FModifierStackStorage *storage, ListBase *modifie
|
|||||||
|
|
||||||
/* evaluate modifiers */
|
/* evaluate modifiers */
|
||||||
for (fcm = modifiers->first; fcm; fcm = fcm->next) {
|
for (fcm = modifiers->first; fcm; fcm = fcm->next) {
|
||||||
FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
const FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
||||||
|
|
||||||
if (fmi == NULL)
|
if (fmi == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
@@ -1069,7 +1069,7 @@ void BKE_lattice_modifiers_calc(Scene *scene, Object *ob)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (; md; md = md->next) {
|
for (; md; md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
md->scene = scene;
|
md->scene = scene;
|
||||||
|
|
||||||
|
@@ -101,7 +101,7 @@ void BKE_modifier_init(void)
|
|||||||
virtualModifierCommonData.smd.modifier.mode |= eModifierMode_Virtual;
|
virtualModifierCommonData.smd.modifier.mode |= eModifierMode_Virtual;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModifierTypeInfo *modifierType_getInfo(ModifierType type)
|
const ModifierTypeInfo *modifierType_getInfo(ModifierType type)
|
||||||
{
|
{
|
||||||
/* type unsigned, no need to check < 0 */
|
/* type unsigned, no need to check < 0 */
|
||||||
if (type < NUM_MODIFIER_TYPES && modifier_types[type]->name[0] != '\0') {
|
if (type < NUM_MODIFIER_TYPES && modifier_types[type]->name[0] != '\0') {
|
||||||
@@ -116,7 +116,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type)
|
|||||||
|
|
||||||
ModifierData *modifier_new(int type)
|
ModifierData *modifier_new(int type)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(type);
|
||||||
ModifierData *md = MEM_callocN(mti->structSize, mti->structName);
|
ModifierData *md = MEM_callocN(mti->structSize, mti->structName);
|
||||||
|
|
||||||
/* note, this name must be made unique later */
|
/* note, this name must be made unique later */
|
||||||
@@ -135,7 +135,7 @@ ModifierData *modifier_new(int type)
|
|||||||
|
|
||||||
void modifier_free(ModifierData *md)
|
void modifier_free(ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
if (mti->freeData) mti->freeData(md);
|
if (mti->freeData) mti->freeData(md);
|
||||||
if (md->error) MEM_freeN(md->error);
|
if (md->error) MEM_freeN(md->error);
|
||||||
@@ -146,7 +146,7 @@ void modifier_free(ModifierData *md)
|
|||||||
bool modifier_unique_name(ListBase *modifiers, ModifierData *md)
|
bool modifier_unique_name(ListBase *modifiers, ModifierData *md)
|
||||||
{
|
{
|
||||||
if (modifiers && md) {
|
if (modifiers && md) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
return BLI_uniquename(modifiers, md, DATA_(mti->name), '.', offsetof(ModifierData, name), sizeof(md->name));
|
return BLI_uniquename(modifiers, md, DATA_(mti->name), '.', offsetof(ModifierData, name), sizeof(md->name));
|
||||||
}
|
}
|
||||||
@@ -155,14 +155,14 @@ bool modifier_unique_name(ListBase *modifiers, ModifierData *md)
|
|||||||
|
|
||||||
bool modifier_dependsOnTime(ModifierData *md)
|
bool modifier_dependsOnTime(ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
return mti->dependsOnTime && mti->dependsOnTime(md);
|
return mti->dependsOnTime && mti->dependsOnTime(md);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool modifier_supportsMapping(ModifierData *md)
|
bool modifier_supportsMapping(ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
return (mti->type == eModifierTypeType_OnlyDeform ||
|
return (mti->type == eModifierTypeType_OnlyDeform ||
|
||||||
(mti->flags & eModifierTypeFlag_SupportsMapping));
|
(mti->flags & eModifierTypeFlag_SupportsMapping));
|
||||||
@@ -170,7 +170,7 @@ bool modifier_supportsMapping(ModifierData *md)
|
|||||||
|
|
||||||
bool modifier_isPreview(ModifierData *md)
|
bool modifier_isPreview(ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
/* Constructive modifiers are highly likely to also modify data like vgroups or vcol! */
|
/* Constructive modifiers are highly likely to also modify data like vgroups or vcol! */
|
||||||
if (!((mti->flags & eModifierTypeFlag_UsesPreview) || (mti->type == eModifierTypeType_Constructive))) {
|
if (!((mti->flags & eModifierTypeFlag_UsesPreview) || (mti->type == eModifierTypeType_Constructive))) {
|
||||||
@@ -221,7 +221,7 @@ void modifiers_foreachObjectLink(Object *ob, ObjectWalkFunc walk,
|
|||||||
ModifierData *md = ob->modifiers.first;
|
ModifierData *md = ob->modifiers.first;
|
||||||
|
|
||||||
for (; md; md = md->next) {
|
for (; md; md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
if (mti->foreachObjectLink)
|
if (mti->foreachObjectLink)
|
||||||
mti->foreachObjectLink(md, ob, walk, userData);
|
mti->foreachObjectLink(md, ob, walk, userData);
|
||||||
@@ -233,7 +233,7 @@ void modifiers_foreachIDLink(Object *ob, IDWalkFunc walk, void *userData)
|
|||||||
ModifierData *md = ob->modifiers.first;
|
ModifierData *md = ob->modifiers.first;
|
||||||
|
|
||||||
for (; md; md = md->next) {
|
for (; md; md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
if (mti->foreachIDLink) mti->foreachIDLink(md, ob, walk, userData);
|
if (mti->foreachIDLink) mti->foreachIDLink(md, ob, walk, userData);
|
||||||
else if (mti->foreachObjectLink) {
|
else if (mti->foreachObjectLink) {
|
||||||
@@ -249,7 +249,7 @@ void modifiers_foreachTexLink(Object *ob, TexWalkFunc walk, void *userData)
|
|||||||
ModifierData *md = ob->modifiers.first;
|
ModifierData *md = ob->modifiers.first;
|
||||||
|
|
||||||
for (; md; md = md->next) {
|
for (; md; md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
if (mti->foreachTexLink)
|
if (mti->foreachTexLink)
|
||||||
mti->foreachTexLink(md, ob, walk, userData);
|
mti->foreachTexLink(md, ob, walk, userData);
|
||||||
@@ -261,7 +261,7 @@ void modifiers_foreachTexLink(Object *ob, TexWalkFunc walk, void *userData)
|
|||||||
*/
|
*/
|
||||||
void modifier_copyData_generic(const ModifierData *md_src, ModifierData *md_dst)
|
void modifier_copyData_generic(const ModifierData *md_src, ModifierData *md_dst)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md_src->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md_src->type);
|
||||||
const size_t data_size = sizeof(ModifierData);
|
const size_t data_size = sizeof(ModifierData);
|
||||||
const char *md_src_data = ((const char *)md_src) + data_size;
|
const char *md_src_data = ((const char *)md_src) + data_size;
|
||||||
char *md_dst_data = ((char *)md_dst) + data_size;
|
char *md_dst_data = ((char *)md_dst) + data_size;
|
||||||
@@ -271,7 +271,7 @@ void modifier_copyData_generic(const ModifierData *md_src, ModifierData *md_dst)
|
|||||||
|
|
||||||
void modifier_copyData(ModifierData *md, ModifierData *target)
|
void modifier_copyData(ModifierData *md, ModifierData *target)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
target->mode = md->mode;
|
target->mode = md->mode;
|
||||||
|
|
||||||
@@ -282,7 +282,7 @@ void modifier_copyData(ModifierData *md, ModifierData *target)
|
|||||||
|
|
||||||
bool modifier_supportsCage(struct Scene *scene, ModifierData *md)
|
bool modifier_supportsCage(struct Scene *scene, ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
md->scene = scene;
|
md->scene = scene;
|
||||||
|
|
||||||
@@ -293,7 +293,7 @@ bool modifier_supportsCage(struct Scene *scene, ModifierData *md)
|
|||||||
|
|
||||||
bool modifier_couldBeCage(struct Scene *scene, ModifierData *md)
|
bool modifier_couldBeCage(struct Scene *scene, ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
md->scene = scene;
|
md->scene = scene;
|
||||||
|
|
||||||
@@ -305,13 +305,13 @@ bool modifier_couldBeCage(struct Scene *scene, ModifierData *md)
|
|||||||
|
|
||||||
bool modifier_isSameTopology(ModifierData *md)
|
bool modifier_isSameTopology(ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
return ELEM(mti->type, eModifierTypeType_OnlyDeform, eModifierTypeType_NonGeometrical);
|
return ELEM(mti->type, eModifierTypeType_OnlyDeform, eModifierTypeType_NonGeometrical);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool modifier_isNonGeometrical(ModifierData *md)
|
bool modifier_isNonGeometrical(ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
return (mti->type == eModifierTypeType_NonGeometrical);
|
return (mti->type == eModifierTypeType_NonGeometrical);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,7 +353,7 @@ int modifiers_getCageIndex(struct Scene *scene, Object *ob, int *r_lastPossibleC
|
|||||||
|
|
||||||
/* Find the last modifier acting on the cage. */
|
/* Find the last modifier acting on the cage. */
|
||||||
for (i = 0; md; i++, md = md->next) {
|
for (i = 0; md; i++, md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
bool supports_mapping;
|
bool supports_mapping;
|
||||||
|
|
||||||
md->scene = scene;
|
md->scene = scene;
|
||||||
@@ -411,7 +411,7 @@ bool modifiers_isParticleEnabled(Object *ob)
|
|||||||
|
|
||||||
bool modifier_isEnabled(struct Scene *scene, ModifierData *md, int required_mode)
|
bool modifier_isEnabled(struct Scene *scene, ModifierData *md, int required_mode)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
md->scene = scene;
|
md->scene = scene;
|
||||||
|
|
||||||
@@ -432,7 +432,7 @@ CDMaskLink *modifiers_calcDataMasks(struct Scene *scene, Object *ob, ModifierDat
|
|||||||
|
|
||||||
/* build a list of modifier data requirements in reverse order */
|
/* build a list of modifier data requirements in reverse order */
|
||||||
for (; md; md = md->next) {
|
for (; md; md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
curr = MEM_callocN(sizeof(CDMaskLink), "CDMaskLink");
|
curr = MEM_callocN(sizeof(CDMaskLink), "CDMaskLink");
|
||||||
|
|
||||||
@@ -626,7 +626,7 @@ bool modifiers_usesArmature(Object *ob, bArmature *arm)
|
|||||||
|
|
||||||
bool modifier_isCorrectableDeformed(ModifierData *md)
|
bool modifier_isCorrectableDeformed(ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
return (mti->deformMatricesEM != NULL);
|
return (mti->deformMatricesEM != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -736,7 +736,7 @@ struct DerivedMesh *modwrap_applyModifier(
|
|||||||
struct DerivedMesh *dm,
|
struct DerivedMesh *dm,
|
||||||
ModifierApplyFlag flag)
|
ModifierApplyFlag flag)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
BLI_assert(CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
|
BLI_assert(CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
|
||||||
|
|
||||||
if (mti->dependsOnNormals && mti->dependsOnNormals(md)) {
|
if (mti->dependsOnNormals && mti->dependsOnNormals(md)) {
|
||||||
@@ -751,7 +751,7 @@ struct DerivedMesh *modwrap_applyModifierEM(
|
|||||||
DerivedMesh *dm,
|
DerivedMesh *dm,
|
||||||
ModifierApplyFlag flag)
|
ModifierApplyFlag flag)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
BLI_assert(CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
|
BLI_assert(CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
|
||||||
|
|
||||||
if (mti->dependsOnNormals && mti->dependsOnNormals(md)) {
|
if (mti->dependsOnNormals && mti->dependsOnNormals(md)) {
|
||||||
@@ -766,7 +766,7 @@ void modwrap_deformVerts(
|
|||||||
float (*vertexCos)[3], int numVerts,
|
float (*vertexCos)[3], int numVerts,
|
||||||
ModifierApplyFlag flag)
|
ModifierApplyFlag flag)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
BLI_assert(!dm || CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
|
BLI_assert(!dm || CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
|
||||||
|
|
||||||
if (dm && mti->dependsOnNormals && mti->dependsOnNormals(md)) {
|
if (dm && mti->dependsOnNormals && mti->dependsOnNormals(md)) {
|
||||||
@@ -780,7 +780,7 @@ void modwrap_deformVertsEM(
|
|||||||
struct BMEditMesh *em, DerivedMesh *dm,
|
struct BMEditMesh *em, DerivedMesh *dm,
|
||||||
float (*vertexCos)[3], int numVerts)
|
float (*vertexCos)[3], int numVerts)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
BLI_assert(!dm || CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
|
BLI_assert(!dm || CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
|
||||||
|
|
||||||
if (dm && mti->dependsOnNormals && mti->dependsOnNormals(md)) {
|
if (dm && mti->dependsOnNormals && mti->dependsOnNormals(md)) {
|
||||||
|
@@ -280,7 +280,7 @@ static MDisps *multires_mdisps_initialize_hidden(Mesh *me, int level)
|
|||||||
DerivedMesh *get_multires_dm(Scene *scene, MultiresModifierData *mmd, Object *ob)
|
DerivedMesh *get_multires_dm(Scene *scene, MultiresModifierData *mmd, Object *ob)
|
||||||
{
|
{
|
||||||
ModifierData *md = (ModifierData *)mmd;
|
ModifierData *md = (ModifierData *)mmd;
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
DerivedMesh *tdm = mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
|
DerivedMesh *tdm = mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
|
||||||
DerivedMesh *dm;
|
DerivedMesh *dm;
|
||||||
|
|
||||||
@@ -429,7 +429,7 @@ int multiresModifier_reshape(Scene *scene, MultiresModifierData *mmd, Object *ds
|
|||||||
int multiresModifier_reshapeFromDeformMod(Scene *scene, MultiresModifierData *mmd,
|
int multiresModifier_reshapeFromDeformMod(Scene *scene, MultiresModifierData *mmd,
|
||||||
Object *ob, ModifierData *md)
|
Object *ob, ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
DerivedMesh *dm, *ndm;
|
DerivedMesh *dm, *ndm;
|
||||||
int numVerts, result;
|
int numVerts, result;
|
||||||
float (*deformedVerts)[3];
|
float (*deformedVerts)[3];
|
||||||
|
@@ -234,7 +234,7 @@ void BKE_object_modifier_hook_reset(Object *ob, HookModifierData *hmd)
|
|||||||
|
|
||||||
bool BKE_object_support_modifier_type_check(Object *ob, int modifier_type)
|
bool BKE_object_support_modifier_type_check(Object *ob, int modifier_type)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti;
|
const ModifierTypeInfo *mti;
|
||||||
|
|
||||||
mti = modifierType_getInfo(modifier_type);
|
mti = modifierType_getInfo(modifier_type);
|
||||||
|
|
||||||
@@ -531,7 +531,7 @@ void BKE_object_unlink(Object *ob)
|
|||||||
bPoseChannel *pchan;
|
bPoseChannel *pchan;
|
||||||
for (pchan = obt->pose->chanbase.first; pchan; pchan = pchan->next) {
|
for (pchan = obt->pose->chanbase.first; pchan; pchan = pchan->next) {
|
||||||
for (con = pchan->constraints.first; con; con = con->next) {
|
for (con = pchan->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
@@ -562,7 +562,7 @@ void BKE_object_unlink(Object *ob)
|
|||||||
sca_remove_ob_poin(obt, ob);
|
sca_remove_ob_poin(obt, ob);
|
||||||
|
|
||||||
for (con = obt->constraints.first; con; con = con->next) {
|
for (con = obt->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
@@ -1408,7 +1408,7 @@ static void copy_object_pose(Object *obn, Object *ob)
|
|||||||
chan->flag &= ~(POSE_LOC | POSE_ROT | POSE_SIZE);
|
chan->flag &= ~(POSE_LOC | POSE_ROT | POSE_SIZE);
|
||||||
|
|
||||||
for (con = chan->constraints.first; con; con = con->next) {
|
for (con = chan->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
@@ -2221,7 +2221,7 @@ static void give_parvert(Object *par, int nr, float vec[3])
|
|||||||
md != NULL;
|
md != NULL;
|
||||||
md = md->next)
|
md = md->next)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
/* TODO(sergey): Check for disabled modifiers. */
|
/* TODO(sergey): Check for disabled modifiers. */
|
||||||
if (mti->type != eModifierTypeType_OnlyDeform && md->next != NULL) {
|
if (mti->type != eModifierTypeType_OnlyDeform && md->next != NULL) {
|
||||||
use_special_ss_case = false;
|
use_special_ss_case = false;
|
||||||
@@ -3674,7 +3674,7 @@ int BKE_object_is_deform_modified(Scene *scene, Object *ob)
|
|||||||
md && (flag != (eModifierMode_Render | eModifierMode_Realtime));
|
md && (flag != (eModifierMode_Render | eModifierMode_Realtime));
|
||||||
md = md->next)
|
md = md->next)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
bool can_deform = mti->type == eModifierTypeType_OnlyDeform ||
|
bool can_deform = mti->type == eModifierTypeType_OnlyDeform ||
|
||||||
is_modifier_animated;
|
is_modifier_animated;
|
||||||
|
|
||||||
|
@@ -720,7 +720,7 @@ static bool sculpt_modifiers_active(Scene *scene, Sculpt *sd, Object *ob)
|
|||||||
|
|
||||||
/* exception for shape keys because we can edit those */
|
/* exception for shape keys because we can edit those */
|
||||||
for (; md; md = md->next) {
|
for (; md; md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
if (!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
|
if (!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
|
||||||
if (ELEM(md->type, eModifierType_ShapeKey, eModifierType_Multires)) continue;
|
if (ELEM(md->type, eModifierType_ShapeKey, eModifierType_Multires)) continue;
|
||||||
|
|
||||||
|
@@ -563,7 +563,7 @@ static void sequence_modifier_type_info_init(void)
|
|||||||
#undef INIT_TYPE
|
#undef INIT_TYPE
|
||||||
}
|
}
|
||||||
|
|
||||||
SequenceModifierTypeInfo *BKE_sequence_modifier_type_info_get(int type)
|
const SequenceModifierTypeInfo *BKE_sequence_modifier_type_info_get(int type)
|
||||||
{
|
{
|
||||||
if (!modifierTypesInit) {
|
if (!modifierTypesInit) {
|
||||||
sequence_modifier_type_info_init();
|
sequence_modifier_type_info_init();
|
||||||
@@ -576,7 +576,7 @@ SequenceModifierTypeInfo *BKE_sequence_modifier_type_info_get(int type)
|
|||||||
SequenceModifierData *BKE_sequence_modifier_new(Sequence *seq, const char *name, int type)
|
SequenceModifierData *BKE_sequence_modifier_new(Sequence *seq, const char *name, int type)
|
||||||
{
|
{
|
||||||
SequenceModifierData *smd;
|
SequenceModifierData *smd;
|
||||||
SequenceModifierTypeInfo *smti = BKE_sequence_modifier_type_info_get(type);
|
const SequenceModifierTypeInfo *smti = BKE_sequence_modifier_type_info_get(type);
|
||||||
|
|
||||||
smd = MEM_callocN(smti->struct_size, "sequence modifier");
|
smd = MEM_callocN(smti->struct_size, "sequence modifier");
|
||||||
|
|
||||||
@@ -623,7 +623,7 @@ void BKE_sequence_modifier_clear(Sequence *seq)
|
|||||||
|
|
||||||
void BKE_sequence_modifier_free(SequenceModifierData *smd)
|
void BKE_sequence_modifier_free(SequenceModifierData *smd)
|
||||||
{
|
{
|
||||||
SequenceModifierTypeInfo *smti = BKE_sequence_modifier_type_info_get(smd->type);
|
const SequenceModifierTypeInfo *smti = BKE_sequence_modifier_type_info_get(smd->type);
|
||||||
|
|
||||||
if (smti && smti->free_data) {
|
if (smti && smti->free_data) {
|
||||||
smti->free_data(smd);
|
smti->free_data(smd);
|
||||||
@@ -634,7 +634,7 @@ void BKE_sequence_modifier_free(SequenceModifierData *smd)
|
|||||||
|
|
||||||
void BKE_sequence_modifier_unique_name(Sequence *seq, SequenceModifierData *smd)
|
void BKE_sequence_modifier_unique_name(Sequence *seq, SequenceModifierData *smd)
|
||||||
{
|
{
|
||||||
SequenceModifierTypeInfo *smti = BKE_sequence_modifier_type_info_get(smd->type);
|
const SequenceModifierTypeInfo *smti = BKE_sequence_modifier_type_info_get(smd->type);
|
||||||
|
|
||||||
BLI_uniquename(&seq->modifiers, smd, CTX_DATA_(BLF_I18NCONTEXT_ID_SEQUENCE, smti->name), '.',
|
BLI_uniquename(&seq->modifiers, smd, CTX_DATA_(BLF_I18NCONTEXT_ID_SEQUENCE, smti->name), '.',
|
||||||
offsetof(SequenceModifierData, name), sizeof(smd->name));
|
offsetof(SequenceModifierData, name), sizeof(smd->name));
|
||||||
@@ -656,7 +656,7 @@ ImBuf *BKE_sequence_modifier_apply_stack(const SeqRenderData *context, Sequence
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (smd = seq->modifiers.first; smd; smd = smd->next) {
|
for (smd = seq->modifiers.first; smd; smd = smd->next) {
|
||||||
SequenceModifierTypeInfo *smti = BKE_sequence_modifier_type_info_get(smd->type);
|
const SequenceModifierTypeInfo *smti = BKE_sequence_modifier_type_info_get(smd->type);
|
||||||
|
|
||||||
/* could happen if modifier is being removed or not exists in current version of blender */
|
/* could happen if modifier is being removed or not exists in current version of blender */
|
||||||
if (!smti)
|
if (!smti)
|
||||||
@@ -692,7 +692,7 @@ void BKE_sequence_modifier_list_copy(Sequence *seqn, Sequence *seq)
|
|||||||
|
|
||||||
for (smd = seq->modifiers.first; smd; smd = smd->next) {
|
for (smd = seq->modifiers.first; smd; smd = smd->next) {
|
||||||
SequenceModifierData *smdn;
|
SequenceModifierData *smdn;
|
||||||
SequenceModifierTypeInfo *smti = BKE_sequence_modifier_type_info_get(smd->type);
|
const SequenceModifierTypeInfo *smti = BKE_sequence_modifier_type_info_get(smd->type);
|
||||||
|
|
||||||
smdn = MEM_dupallocN(smd);
|
smdn = MEM_dupallocN(smd);
|
||||||
|
|
||||||
|
@@ -972,7 +972,7 @@ static bool subframe_updateObject(Scene *scene, Object *ob, int update_mesh, int
|
|||||||
|
|
||||||
/* also update constraint targets */
|
/* also update constraint targets */
|
||||||
for (con = ob->constraints.first; con; con = con->next) {
|
for (con = ob->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
|
|
||||||
if (cti && cti->get_constraint_targets) {
|
if (cti && cti->get_constraint_targets) {
|
||||||
|
@@ -597,7 +597,7 @@ static void write_fmodifiers(WriteData *wd, ListBase *fmodifiers)
|
|||||||
|
|
||||||
/* Modifiers */
|
/* Modifiers */
|
||||||
for (fcm= fmodifiers->first; fcm; fcm= fcm->next) {
|
for (fcm= fmodifiers->first; fcm; fcm= fcm->next) {
|
||||||
FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm);
|
const FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm);
|
||||||
|
|
||||||
/* Write the specific data */
|
/* Write the specific data */
|
||||||
if (fmi && fcm->data) {
|
if (fmi && fcm->data) {
|
||||||
@@ -1404,7 +1404,7 @@ static void write_constraints(WriteData *wd, ListBase *conlist)
|
|||||||
bConstraint *con;
|
bConstraint *con;
|
||||||
|
|
||||||
for (con=conlist->first; con; con=con->next) {
|
for (con=conlist->first; con; con=con->next) {
|
||||||
bConstraintTypeInfo *cti= BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti= BKE_constraint_typeinfo_get(con);
|
||||||
|
|
||||||
/* Write the specific data */
|
/* Write the specific data */
|
||||||
if (cti && con->data) {
|
if (cti && con->data) {
|
||||||
@@ -1500,7 +1500,7 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
|
|||||||
|
|
||||||
if (modbase == NULL) return;
|
if (modbase == NULL) return;
|
||||||
for (md=modbase->first; md; md= md->next) {
|
for (md=modbase->first; md; md= md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
if (mti == NULL) return;
|
if (mti == NULL) return;
|
||||||
|
|
||||||
writestruct(wd, DATA, mti->structName, 1, md);
|
writestruct(wd, DATA, mti->structName, 1, md);
|
||||||
@@ -2287,7 +2287,7 @@ static void write_sequence_modifiers(WriteData *wd, ListBase *modbase)
|
|||||||
SequenceModifierData *smd;
|
SequenceModifierData *smd;
|
||||||
|
|
||||||
for (smd = modbase->first; smd; smd = smd->next) {
|
for (smd = modbase->first; smd; smd = smd->next) {
|
||||||
SequenceModifierTypeInfo *smti = BKE_sequence_modifier_type_info_get(smd->type);
|
const SequenceModifierTypeInfo *smti = BKE_sequence_modifier_type_info_get(smd->type);
|
||||||
|
|
||||||
if (smti) {
|
if (smti) {
|
||||||
writestruct(wd, DATA, smti->struct_name, 1, smd);
|
writestruct(wd, DATA, smti->struct_name, 1, smd);
|
||||||
|
@@ -185,7 +185,7 @@ void AnimationExporter::make_anim_frames_from_targets(Object *ob, std::vector<fl
|
|||||||
for (con = (bConstraint *)conlist->first; con; con = con->next) {
|
for (con = (bConstraint *)conlist->first; con; con = con->next) {
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
|
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
|
|
||||||
if (!validateConstraints(con)) continue;
|
if (!validateConstraints(con)) continue;
|
||||||
|
|
||||||
@@ -1526,7 +1526,7 @@ void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, i
|
|||||||
bool AnimationExporter::validateConstraints(bConstraint *con)
|
bool AnimationExporter::validateConstraints(bConstraint *con)
|
||||||
{
|
{
|
||||||
bool valid = true;
|
bool valid = true;
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
/* these we can skip completely (invalid constraints...) */
|
/* these we can skip completely (invalid constraints...) */
|
||||||
if (cti == NULL) valid = false;
|
if (cti == NULL) valid = false;
|
||||||
if (con->flag & (CONSTRAINT_DISABLE | CONSTRAINT_OFF)) valid = false;
|
if (con->flag & (CONSTRAINT_DISABLE | CONSTRAINT_OFF)) valid = false;
|
||||||
@@ -1545,7 +1545,7 @@ void AnimationExporter::calc_ob_mat_at_time(Object *ob, float ctime , float mat[
|
|||||||
for (con = (bConstraint *)conlist->first; con; con = con->next) {
|
for (con = (bConstraint *)conlist->first; con; con = con->next) {
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
|
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
|
|
||||||
if (cti && cti->get_constraint_targets) {
|
if (cti && cti->get_constraint_targets) {
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
@@ -78,7 +78,7 @@
|
|||||||
static void validate_fmodifier_cb(bContext *UNUSED(C), void *fcm_v, void *UNUSED(arg))
|
static void validate_fmodifier_cb(bContext *UNUSED(C), void *fcm_v, void *UNUSED(arg))
|
||||||
{
|
{
|
||||||
FModifier *fcm = (FModifier *)fcm_v;
|
FModifier *fcm = (FModifier *)fcm_v;
|
||||||
FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
const FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
||||||
|
|
||||||
/* call the verify callback on the modifier if applicable */
|
/* call the verify callback on the modifier if applicable */
|
||||||
if (fmi && fmi->verify_data)
|
if (fmi && fmi->verify_data)
|
||||||
@@ -555,7 +555,7 @@ static void draw_modifier__stepped(uiLayout *layout, ID *id, FModifier *fcm, sho
|
|||||||
|
|
||||||
void ANIM_uiTemplate_fmodifier_draw(uiLayout *layout, ID *id, ListBase *modifiers, FModifier *fcm)
|
void ANIM_uiTemplate_fmodifier_draw(uiLayout *layout, ID *id, ListBase *modifiers, FModifier *fcm)
|
||||||
{
|
{
|
||||||
FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
const FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
||||||
uiLayout *box, *row, *sub, *col;
|
uiLayout *box, *row, *sub, *col;
|
||||||
uiBlock *block;
|
uiBlock *block;
|
||||||
uiBut *but;
|
uiBut *but;
|
||||||
|
@@ -308,7 +308,7 @@ void updateDuplicateSubtargetObjects(EditBone *dupBone, ListBase *editbones, Obj
|
|||||||
/* does this constraint have a subtarget in
|
/* does this constraint have a subtarget in
|
||||||
* this armature?
|
* this armature?
|
||||||
*/
|
*/
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(curcon);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(curcon);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
|
@@ -1264,7 +1264,7 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (con = pchan->constraints.first; con; con = con->next) {
|
for (con = pchan->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
|
@@ -104,7 +104,7 @@ static void constraint_bone_name_fix(Object *ob, ListBase *conlist, const char *
|
|||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
for (curcon = conlist->first; curcon; curcon = curcon->next) {
|
for (curcon = conlist->first; curcon; curcon = curcon->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(curcon);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(curcon);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
|
|
||||||
/* constraint targets */
|
/* constraint targets */
|
||||||
|
@@ -78,7 +78,7 @@ static void joined_armature_fix_links_constraints(
|
|||||||
bConstraint *con;
|
bConstraint *con;
|
||||||
|
|
||||||
for (con = lb->first; con; con = con->next) {
|
for (con = lb->first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
@@ -435,7 +435,7 @@ static void separated_armature_fix_links(Object *origArm, Object *newArm)
|
|||||||
if (ob->type == OB_ARMATURE) {
|
if (ob->type == OB_ARMATURE) {
|
||||||
for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
|
for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
|
||||||
for (con = pchan->constraints.first; con; con = con->next) {
|
for (con = pchan->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
@@ -473,7 +473,7 @@ static void separated_armature_fix_links(Object *origArm, Object *newArm)
|
|||||||
/* fix object-level constraints */
|
/* fix object-level constraints */
|
||||||
if (ob != origArm) {
|
if (ob != origArm) {
|
||||||
for (con = ob->constraints.first; con; con = con->next) {
|
for (con = ob->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
|
@@ -707,7 +707,7 @@ static void RIG_reconnectControlBones(RigGraph *rg)
|
|||||||
/* DO SOME MAGIC HERE */
|
/* DO SOME MAGIC HERE */
|
||||||
for (pchan = rg->ob->pose->chanbase.first; pchan; pchan = pchan->next) {
|
for (pchan = rg->ob->pose->chanbase.first; pchan; pchan = pchan->next) {
|
||||||
for (con = pchan->constraints.first; con; con = con->next) {
|
for (con = pchan->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
@@ -832,7 +832,7 @@ static void RIG_reconnectControlBones(RigGraph *rg)
|
|||||||
/* DO SOME MAGIC HERE */
|
/* DO SOME MAGIC HERE */
|
||||||
for (pchan = rg->ob->pose->chanbase.first; pchan; pchan = pchan->next) {
|
for (pchan = rg->ob->pose->chanbase.first; pchan; pchan = pchan->next) {
|
||||||
for (con = pchan->constraints.first; con; con = con->next) {
|
for (con = pchan->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
|
@@ -458,7 +458,7 @@ static int pose_select_constraint_target_exec(bContext *C, wmOperator *UNUSED(op
|
|||||||
{
|
{
|
||||||
if (pchan->bone->flag & BONE_SELECTED) {
|
if (pchan->bone->flag & BONE_SELECTED) {
|
||||||
for (con = pchan->constraints.first; con; con = con->next) {
|
for (con = pchan->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
|
@@ -823,7 +823,7 @@ static int modifier_is_simulation(ModifierData *md)
|
|||||||
static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
|
static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
|
||||||
ModifierData *md, int index, int cageIndex, int lastCageIndex)
|
ModifierData *md, int index, int cageIndex, int lastCageIndex)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
PointerRNA ptr;
|
PointerRNA ptr;
|
||||||
uiBut *but;
|
uiBut *but;
|
||||||
uiBlock *block;
|
uiBlock *block;
|
||||||
@@ -1095,7 +1095,7 @@ static void constraint_active_func(bContext *UNUSED(C), void *ob_v, void *con_v)
|
|||||||
static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
|
static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
|
||||||
{
|
{
|
||||||
bPoseChannel *pchan = BKE_pose_channel_active(ob);
|
bPoseChannel *pchan = BKE_pose_channel_active(ob);
|
||||||
bConstraintTypeInfo *cti;
|
const bConstraintTypeInfo *cti;
|
||||||
uiBlock *block;
|
uiBlock *block;
|
||||||
uiLayout *result = NULL, *col, *box, *row;
|
uiLayout *result = NULL, *col, *box, *row;
|
||||||
PointerRNA ptr;
|
PointerRNA ptr;
|
||||||
|
@@ -226,7 +226,7 @@ static void update_pyconstraint_cb(void *arg1, void *arg2)
|
|||||||
/* helper function for add_constriant - sets the last target for the active constraint */
|
/* helper function for add_constriant - sets the last target for the active constraint */
|
||||||
static void set_constraint_nth_target(bConstraint *con, Object *target, const char subtarget[], int index)
|
static void set_constraint_nth_target(bConstraint *con, Object *target, const char subtarget[], int index)
|
||||||
{
|
{
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
int num_targets, i;
|
int num_targets, i;
|
||||||
@@ -262,7 +262,7 @@ static void set_constraint_nth_target(bConstraint *con, Object *target, const ch
|
|||||||
|
|
||||||
static void test_constraint(Object *owner, bPoseChannel *pchan, bConstraint *con, int type)
|
static void test_constraint(Object *owner, bPoseChannel *pchan, bConstraint *con, int type)
|
||||||
{
|
{
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
bool check_targets = true;
|
bool check_targets = true;
|
||||||
|
@@ -96,7 +96,7 @@ static void modifier_skin_customdata_delete(struct Object *ob);
|
|||||||
ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *scene, Object *ob, const char *name, int type)
|
ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *scene, Object *ob, const char *name, int type)
|
||||||
{
|
{
|
||||||
ModifierData *md = NULL, *new_md = NULL;
|
ModifierData *md = NULL, *new_md = NULL;
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(type);
|
||||||
|
|
||||||
/* only geometry objects should be able to get modifiers [#25291] */
|
/* only geometry objects should be able to get modifiers [#25291] */
|
||||||
if (!ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) {
|
if (!ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) {
|
||||||
@@ -368,10 +368,10 @@ void ED_object_modifier_clear(Main *bmain, Object *ob)
|
|||||||
int ED_object_modifier_move_up(ReportList *reports, Object *ob, ModifierData *md)
|
int ED_object_modifier_move_up(ReportList *reports, Object *ob, ModifierData *md)
|
||||||
{
|
{
|
||||||
if (md->prev) {
|
if (md->prev) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
if (mti->type != eModifierTypeType_OnlyDeform) {
|
if (mti->type != eModifierTypeType_OnlyDeform) {
|
||||||
ModifierTypeInfo *nmti = modifierType_getInfo(md->prev->type);
|
const ModifierTypeInfo *nmti = modifierType_getInfo(md->prev->type);
|
||||||
|
|
||||||
if (nmti->flags & eModifierTypeFlag_RequiresOriginalData) {
|
if (nmti->flags & eModifierTypeFlag_RequiresOriginalData) {
|
||||||
BKE_report(reports, RPT_WARNING, "Cannot move above a modifier requiring original data");
|
BKE_report(reports, RPT_WARNING, "Cannot move above a modifier requiring original data");
|
||||||
@@ -389,10 +389,10 @@ int ED_object_modifier_move_up(ReportList *reports, Object *ob, ModifierData *md
|
|||||||
int ED_object_modifier_move_down(ReportList *reports, Object *ob, ModifierData *md)
|
int ED_object_modifier_move_down(ReportList *reports, Object *ob, ModifierData *md)
|
||||||
{
|
{
|
||||||
if (md->next) {
|
if (md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
if (mti->flags & eModifierTypeFlag_RequiresOriginalData) {
|
if (mti->flags & eModifierTypeFlag_RequiresOriginalData) {
|
||||||
ModifierTypeInfo *nmti = modifierType_getInfo(md->next->type);
|
const ModifierTypeInfo *nmti = modifierType_getInfo(md->next->type);
|
||||||
|
|
||||||
if (nmti->type != eModifierTypeType_OnlyDeform) {
|
if (nmti->type != eModifierTypeType_OnlyDeform) {
|
||||||
BKE_report(reports, RPT_WARNING, "Cannot move beyond a non-deforming modifier");
|
BKE_report(reports, RPT_WARNING, "Cannot move beyond a non-deforming modifier");
|
||||||
@@ -518,7 +518,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene *
|
|||||||
|
|
||||||
static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, ModifierData *md)
|
static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
md->scene = scene;
|
md->scene = scene;
|
||||||
|
|
||||||
@@ -578,7 +578,7 @@ static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, M
|
|||||||
|
|
||||||
static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob, ModifierData *md)
|
static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob, ModifierData *md)
|
||||||
{
|
{
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
|
|
||||||
md->scene = scene;
|
md->scene = scene;
|
||||||
|
|
||||||
@@ -742,7 +742,7 @@ static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *UNUSED(ptr)
|
|||||||
{
|
{
|
||||||
Object *ob = ED_object_active_context(C);
|
Object *ob = ED_object_active_context(C);
|
||||||
EnumPropertyItem *item = NULL, *md_item, *group_item = NULL;
|
EnumPropertyItem *item = NULL, *md_item, *group_item = NULL;
|
||||||
ModifierTypeInfo *mti;
|
const ModifierTypeInfo *mti;
|
||||||
int totitem = 0, a;
|
int totitem = 0, a;
|
||||||
|
|
||||||
if (!ob)
|
if (!ob)
|
||||||
|
@@ -4746,7 +4746,7 @@ static int sculpt_dynamic_topology_toggle_invoke(bContext *C, wmOperator *op, co
|
|||||||
|
|
||||||
/* exception for shape keys because we can edit those */
|
/* exception for shape keys because we can edit those */
|
||||||
for (; md; md = md->next) {
|
for (; md; md = md->next) {
|
||||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||||
if (!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
|
if (!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
|
||||||
|
|
||||||
if (mti->type == eModifierTypeType_Constructive) {
|
if (mti->type == eModifierTypeType_Constructive) {
|
||||||
|
@@ -2042,7 +2042,7 @@ static void object_solver_inverted_matrix(Scene *scene, Object *ob, float invmat
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
for (con = ob->constraints.first; con; con = con->next) {
|
for (con = ob->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
|
|
||||||
if (!cti)
|
if (!cti)
|
||||||
continue;
|
continue;
|
||||||
@@ -2073,7 +2073,7 @@ static Object *object_solver_camera(Scene *scene, Object *ob)
|
|||||||
bConstraint *con;
|
bConstraint *con;
|
||||||
|
|
||||||
for (con = ob->constraints.first; con; con = con->next) {
|
for (con = ob->constraints.first; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
|
|
||||||
if (!cti)
|
if (!cti)
|
||||||
continue;
|
continue;
|
||||||
|
@@ -2248,7 +2248,7 @@ static EnumPropertyItem *graph_fmodifier_itemf(bContext *C, PointerRNA *UNUSED(p
|
|||||||
|
|
||||||
/* start from 1 to skip the 'Invalid' modifier type */
|
/* start from 1 to skip the 'Invalid' modifier type */
|
||||||
for (i = 1; i < FMODIFIER_NUM_TYPES; i++) {
|
for (i = 1; i < FMODIFIER_NUM_TYPES; i++) {
|
||||||
FModifierTypeInfo *fmi = get_fmodifier_typeinfo(i);
|
const FModifierTypeInfo *fmi = get_fmodifier_typeinfo(i);
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
/* check if modifier is valid for this context */
|
/* check if modifier is valid for this context */
|
||||||
|
@@ -2189,7 +2189,7 @@ static int nla_fmodifier_add_invoke(bContext *C, wmOperator *UNUSED(op), const w
|
|||||||
|
|
||||||
/* start from 1 to skip the 'Invalid' modifier type */
|
/* start from 1 to skip the 'Invalid' modifier type */
|
||||||
for (i = 1; i < FMODIFIER_NUM_TYPES; i++) {
|
for (i = 1; i < FMODIFIER_NUM_TYPES; i++) {
|
||||||
FModifierTypeInfo *fmi = get_fmodifier_typeinfo(i);
|
const FModifierTypeInfo *fmi = get_fmodifier_typeinfo(i);
|
||||||
|
|
||||||
/* check if modifier is valid for this context */
|
/* check if modifier is valid for this context */
|
||||||
if (fmi == NULL)
|
if (fmi == NULL)
|
||||||
|
@@ -7922,7 +7922,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(curcon);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(curcon);
|
||||||
|
|
||||||
if ((cti && cti->get_constraint_targets) && (curcon->flag & CONSTRAINT_EXPAND)) {
|
if ((cti && cti->get_constraint_targets) && (curcon->flag & CONSTRAINT_EXPAND)) {
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
|
@@ -2516,8 +2516,8 @@ static void protectedQuaternionBits(short protectflag, float quat[4], const floa
|
|||||||
static void constraintTransLim(TransInfo *t, TransData *td)
|
static void constraintTransLim(TransInfo *t, TransData *td)
|
||||||
{
|
{
|
||||||
if (td->con) {
|
if (td->con) {
|
||||||
bConstraintTypeInfo *ctiLoc = BKE_constraint_typeinfo_from_type(CONSTRAINT_TYPE_LOCLIMIT);
|
const bConstraintTypeInfo *ctiLoc = BKE_constraint_typeinfo_from_type(CONSTRAINT_TYPE_LOCLIMIT);
|
||||||
bConstraintTypeInfo *ctiDist = BKE_constraint_typeinfo_from_type(CONSTRAINT_TYPE_DISTLIMIT);
|
const bConstraintTypeInfo *ctiDist = BKE_constraint_typeinfo_from_type(CONSTRAINT_TYPE_DISTLIMIT);
|
||||||
|
|
||||||
bConstraintOb cob = {NULL};
|
bConstraintOb cob = {NULL};
|
||||||
bConstraint *con;
|
bConstraint *con;
|
||||||
@@ -2532,7 +2532,7 @@ static void constraintTransLim(TransInfo *t, TransData *td)
|
|||||||
|
|
||||||
/* Evaluate valid constraints */
|
/* Evaluate valid constraints */
|
||||||
for (con = td->con; con; con = con->next) {
|
for (con = td->con; con; con = con->next) {
|
||||||
bConstraintTypeInfo *cti = NULL;
|
const bConstraintTypeInfo *cti = NULL;
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
|
|
||||||
/* only consider constraint if enabled */
|
/* only consider constraint if enabled */
|
||||||
@@ -2619,7 +2619,7 @@ static void constraintob_from_transdata(bConstraintOb *cob, TransData *td)
|
|||||||
static void constraintRotLim(TransInfo *UNUSED(t), TransData *td)
|
static void constraintRotLim(TransInfo *UNUSED(t), TransData *td)
|
||||||
{
|
{
|
||||||
if (td->con) {
|
if (td->con) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_from_type(CONSTRAINT_TYPE_ROTLIMIT);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_from_type(CONSTRAINT_TYPE_ROTLIMIT);
|
||||||
bConstraintOb cob;
|
bConstraintOb cob;
|
||||||
bConstraint *con;
|
bConstraint *con;
|
||||||
bool do_limit = false;
|
bool do_limit = false;
|
||||||
@@ -2686,7 +2686,7 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td)
|
|||||||
static void constraintSizeLim(TransInfo *t, TransData *td)
|
static void constraintSizeLim(TransInfo *t, TransData *td)
|
||||||
{
|
{
|
||||||
if (td->con && td->ext) {
|
if (td->con && td->ext) {
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_from_type(CONSTRAINT_TYPE_SIZELIMIT);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_from_type(CONSTRAINT_TYPE_SIZELIMIT);
|
||||||
bConstraintOb cob = {NULL};
|
bConstraintOb cob = {NULL};
|
||||||
bConstraint *con;
|
bConstraint *con;
|
||||||
float size_sign[3], size_abs[3];
|
float size_sign[3], size_abs[3];
|
||||||
|
@@ -323,7 +323,7 @@ static EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *UNUSED(C),
|
|||||||
PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
|
PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
|
||||||
{
|
{
|
||||||
bConstraint *con = (bConstraint *)ptr->data;
|
bConstraint *con = (bConstraint *)ptr->data;
|
||||||
bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con);
|
||||||
ListBase targets = {NULL, NULL};
|
ListBase targets = {NULL, NULL};
|
||||||
bConstraintTarget *ct;
|
bConstraintTarget *ct;
|
||||||
|
|
||||||
|
@@ -574,7 +574,7 @@ static void rna_FModifier_blending_range(PointerRNA *ptr, float *min, float *max
|
|||||||
static void rna_FModifier_verify_data_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
static void rna_FModifier_verify_data_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
FModifier *fcm = (FModifier *)ptr->data;
|
FModifier *fcm = (FModifier *)ptr->data;
|
||||||
FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
const FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
|
||||||
|
|
||||||
/* call the verify callback on the modifier if applicable */
|
/* call the verify callback on the modifier if applicable */
|
||||||
if (fmi && fmi->verify_data)
|
if (fmi && fmi->verify_data)
|
||||||
|
Reference in New Issue
Block a user