[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57359] trunk/blender/source/blender/ modifiers/intern: Follow up to r57354: WeightVG and Wave modifiers too need to handle tex id refcount ; )
Bastien Montagne
montagne29 at wanadoo.fr
Mon Jun 10 20:12:07 CEST 2013
Revision: 57359
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57359
Author: mont29
Date: 2013-06-10 18:12:07 +0000 (Mon, 10 Jun 2013)
Log Message:
-----------
Follow up to r57354: WeightVG and Wave modifiers too need to handle tex id refcount ;)
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57354
Modified Paths:
--------------
trunk/blender/source/blender/modifiers/intern/MOD_wave.c
trunk/blender/source/blender/modifiers/intern/MOD_weightvgedit.c
trunk/blender/source/blender/modifiers/intern/MOD_weightvgmix.c
trunk/blender/source/blender/modifiers/intern/MOD_weightvgproximity.c
Modified: trunk/blender/source/blender/modifiers/intern/MOD_wave.c
===================================================================
--- trunk/blender/source/blender/modifiers/intern/MOD_wave.c 2013-06-10 17:48:41 UTC (rev 57358)
+++ trunk/blender/source/blender/modifiers/intern/MOD_wave.c 2013-06-10 18:12:07 UTC (rev 57359)
@@ -43,9 +43,10 @@
#include "BLI_string.h"
+#include "BKE_deform.h"
#include "BKE_DerivedMesh.h"
+#include "BKE_library.h"
#include "BKE_object.h"
-#include "BKE_deform.h"
#include "BKE_scene.h"
#include "depsgraph_private.h"
@@ -77,6 +78,14 @@
wmd->defgrp_name[0] = 0;
}
+static void freeData(ModifierData *md)
+{
+ WaveModifierData *wmd = (WaveModifierData *) md;
+ if (wmd->texture) {
+ id_us_min(&wmd->texture->id);
+ }
+}
+
static void copyData(ModifierData *md, ModifierData *target)
{
WaveModifierData *wmd = (WaveModifierData *) md;
@@ -98,6 +107,10 @@
twmd->map_object = wmd->map_object;
twmd->texmapping = wmd->texmapping;
BLI_strncpy(twmd->defgrp_name, wmd->defgrp_name, sizeof(twmd->defgrp_name));
+
+ if (twmd->texture) {
+ id_us_plus(&twmd->texture->id);
+ }
}
static bool dependsOnTime(ModifierData *UNUSED(md))
@@ -378,7 +391,7 @@
/* applyModifierEM */ NULL,
/* initData */ initData,
/* requiredDataMask */ requiredDataMask,
- /* freeData */ NULL,
+ /* freeData */ freeData,
/* isDisabled */ NULL,
/* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ dependsOnTime,
Modified: trunk/blender/source/blender/modifiers/intern/MOD_weightvgedit.c
===================================================================
--- trunk/blender/source/blender/modifiers/intern/MOD_weightvgedit.c 2013-06-10 17:48:41 UTC (rev 57358)
+++ trunk/blender/source/blender/modifiers/intern/MOD_weightvgedit.c 2013-06-10 18:12:07 UTC (rev 57359)
@@ -43,6 +43,7 @@
#include "BKE_cdderivedmesh.h"
#include "BKE_colortools.h" /* CurveMapping. */
#include "BKE_deform.h"
+#include "BKE_library.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_texture.h" /* Texture masking. */
@@ -77,6 +78,10 @@
{
WeightVGEditModifierData *wmd = (WeightVGEditModifierData *) md;
curvemapping_free(wmd->cmap_curve);
+
+ if (wmd->mask_texture) {
+ id_us_min(&wmd->mask_texture->id);
+ }
}
static void copyData(ModifierData *md, ModifierData *target)
@@ -102,6 +107,10 @@
twmd->mask_tex_mapping = wmd->mask_tex_mapping;
twmd->mask_tex_map_obj = wmd->mask_tex_map_obj;
BLI_strncpy(twmd->mask_tex_uvlayer_name, wmd->mask_tex_uvlayer_name, sizeof(twmd->mask_tex_uvlayer_name));
+
+ if (twmd->mask_texture) {
+ id_us_plus(&twmd->mask_texture->id);
+ }
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
Modified: trunk/blender/source/blender/modifiers/intern/MOD_weightvgmix.c
===================================================================
--- trunk/blender/source/blender/modifiers/intern/MOD_weightvgmix.c 2013-06-10 17:48:41 UTC (rev 57358)
+++ trunk/blender/source/blender/modifiers/intern/MOD_weightvgmix.c 2013-06-10 18:12:07 UTC (rev 57359)
@@ -39,6 +39,7 @@
#include "BKE_cdderivedmesh.h"
#include "BKE_deform.h"
+#include "BKE_library.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_texture.h" /* Texture masking. */
@@ -123,6 +124,14 @@
wmd->mask_tex_mapping = MOD_DISP_MAP_LOCAL;
}
+static void freeData(ModifierData *md)
+{
+ WeightVGMixModifierData *wmd = (WeightVGMixModifierData *) md;
+ if (wmd->mask_texture) {
+ id_us_min(&wmd->mask_texture->id);
+ }
+}
+
static void copyData(ModifierData *md, ModifierData *target)
{
WeightVGMixModifierData *wmd = (WeightVGMixModifierData *) md;
@@ -142,6 +151,10 @@
twmd->mask_tex_mapping = wmd->mask_tex_mapping;
twmd->mask_tex_map_obj = wmd->mask_tex_map_obj;
BLI_strncpy(twmd->mask_tex_uvlayer_name, wmd->mask_tex_uvlayer_name, sizeof(twmd->mask_tex_uvlayer_name));
+
+ if (twmd->mask_texture) {
+ id_us_plus(&twmd->mask_texture->id);
+ }
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
@@ -418,7 +431,7 @@
/* applyModifierEM */ NULL,
/* initData */ initData,
/* requiredDataMask */ requiredDataMask,
- /* freeData */ NULL,
+ /* freeData */ freeData,
/* isDisabled */ isDisabled,
/* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ dependsOnTime,
Modified: trunk/blender/source/blender/modifiers/intern/MOD_weightvgproximity.c
===================================================================
--- trunk/blender/source/blender/modifiers/intern/MOD_weightvgproximity.c 2013-06-10 17:48:41 UTC (rev 57358)
+++ trunk/blender/source/blender/modifiers/intern/MOD_weightvgproximity.c 2013-06-10 18:12:07 UTC (rev 57359)
@@ -47,6 +47,7 @@
#include "BKE_cdderivedmesh.h"
#include "BKE_deform.h"
+#include "BKE_library.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_shrinkwrap.h" /* For SpaceTransform stuff. */
@@ -242,6 +243,14 @@
wmd->max_dist = 1.0f; /* vert arbitrary distance, but don't use 0 */
}
+static void freeData(ModifierData *md)
+{
+ WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *) md;
+ if (wmd->mask_texture) {
+ id_us_min(&wmd->mask_texture->id);
+ }
+}
+
static void copyData(ModifierData *md, ModifierData *target)
{
WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *) md;
@@ -263,6 +272,10 @@
BLI_strncpy(twmd->mask_tex_uvlayer_name, wmd->mask_tex_uvlayer_name, sizeof(twmd->mask_tex_uvlayer_name));
twmd->min_dist = wmd->min_dist;
twmd->max_dist = wmd->max_dist;
+
+ if (twmd->mask_texture) {
+ id_us_plus(&twmd->mask_texture->id);
+ }
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
@@ -563,7 +576,7 @@
/* applyModifierEM */ NULL,
/* initData */ initData,
/* requiredDataMask */ requiredDataMask,
- /* freeData */ NULL,
+ /* freeData */ freeData,
/* isDisabled */ isDisabled,
/* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ dependsOnTime,
More information about the Bf-blender-cvs
mailing list