Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-08-12 18:57:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-12 18:57:19 +0400
commit32254596d4de9558b7af81bfe69db5d160a97769 (patch)
tree022629de72b05ce7bf7165ed43a123435de7b9ab /source/blender/blenkernel/intern
parent82688e61fc330022bd8685a5a137fca024a60b8a (diff)
replace ELEM8(gs, ID_ME, ID_CU, ID_MB, ID_LT, ID_LA, ID_CA, ID_TXT, ID_SPK) with macro: OB_DATA_SUPPORT_ID()
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c3
-rw-r--r--source/blender/blenkernel/intern/material.c9
2 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 87ebc597ecd..b22e24e15d4 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -2596,7 +2596,8 @@ static void dag_id_flush_update(Scene *sce, ID *id)
if (id) {
idtype = GS(id->name);
- if (ELEM8(idtype, ID_ME, ID_CU, ID_MB, ID_LA, ID_LT, ID_CA, ID_AR, ID_SPK)) {
+
+ if (OB_DATA_SUPPORT_ID(idtype)) {
for (obt = bmain->object.first; obt; obt = obt->id.next) {
if (!(ob && obt == ob) && obt->data == id) {
obt->recalc |= OB_RECALC_DATA;
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index f97dd2f859d..f888cf60a24 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -494,6 +494,9 @@ short *give_totcolp(Object *ob)
/* same as above but for ID's */
Material ***give_matarar_id(ID *id)
{
+ /* ensure we don't try get materials from non-obdata */
+ BLI_assert(OB_DATA_SUPPORT_ID(GS(id->name)));
+
switch (GS(id->name)) {
case ID_ME:
return &(((Mesh *)id)->mat);
@@ -510,6 +513,9 @@ Material ***give_matarar_id(ID *id)
short *give_totcolp_id(ID *id)
{
+ /* ensure we don't try get materials from non-obdata */
+ BLI_assert(OB_DATA_SUPPORT_ID(GS(id->name)));
+
switch (GS(id->name)) {
case ID_ME:
return &(((Mesh *)id)->totcol);
@@ -526,6 +532,9 @@ short *give_totcolp_id(ID *id)
static void data_delete_material_index_id(ID *id, short index)
{
+ /* ensure we don't try get materials from non-obdata */
+ BLI_assert(OB_DATA_SUPPORT_ID(GS(id->name)));
+
switch (GS(id->name)) {
case ID_ME:
BKE_mesh_delete_material_index((Mesh *)id, index);