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:
authorMatt Ebb <matt@mke3.net>2010-06-01 10:07:22 +0400
committerMatt Ebb <matt@mke3.net>2010-06-01 10:07:22 +0400
commiteab7f6d3c2f1a2ecfce6976f2b6d50a5ea5d2fcb (patch)
tree87d5441225b16ccb2afafcb5723fa2306b9c18a8 /source/blender/makesrna/intern/rna_texture.c
parent80a89d2de50e46d65940864d18ced946eec29ba7 (diff)
Fix [#22469] Crashes with "segmentation fault" when opening an image for Voxel Data texture of type Image sequence
Cleaned up the code here, made it more efficient and more reliable with threaded render.
Diffstat (limited to 'source/blender/makesrna/intern/rna_texture.c')
-rw-r--r--source/blender/makesrna/intern/rna_texture.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index 5e58403e41b..32221e51cb9 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -75,6 +75,7 @@ EnumPropertyItem texture_type_items[] = {
#include "RNA_access.h"
#include "BKE_depsgraph.h"
+#include "BKE_image.h"
#include "BKE_texture.h"
#include "BKE_main.h"
@@ -131,6 +132,22 @@ static void rna_Texture_update(Main *bmain, Scene *scene, PointerRNA *ptr)
WM_main_add_notifier(NC_TEXTURE, tex);
}
+static void rna_Texture_voxeldata_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Tex *tex= ptr->id.data;
+
+ tex->vd->ok = 0;
+ rna_Texture_update(bmain, scene, ptr);
+}
+
+static void rna_Texture_voxeldata_image_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Tex *tex= ptr->id.data;
+
+ tex->ima->source = IMA_SRC_SEQUENCE;
+ rna_Texture_voxeldata_update(bmain, scene, ptr);
+}
+
/* Used for Texture Properties, used (also) for/in Nodes */
static void rna_Texture_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
@@ -1593,7 +1610,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "smoked_type");
RNA_def_property_enum_items(prop, smoked_type_items);
RNA_def_property_ui_text(prop, "Source", "Simulation value to be used as a texture");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "extend");
@@ -1611,34 +1628,34 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "file_format");
RNA_def_property_enum_items(prop, file_format_items);
RNA_def_property_ui_text(prop, "File Format", "Format of the source data set to render ");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "source_path", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "source_path");
RNA_def_property_ui_text(prop, "Source Path", "The external source data file to use");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resol");
RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "still", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_VD_STILL);
RNA_def_property_ui_text(prop, "Still Frame Only", "Always render a still frame from the voxel data sequence");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "still_frame_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "still_frame");
RNA_def_property_range(prop, -MAXFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Still Frame Number", "The frame number to always use");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
prop= RNA_def_property(srna, "domain_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_ui_text(prop, "Domain Object", "Object used as the smoke simulation domain");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
srna= RNA_def_struct(brna, "VoxelDataTexture", "Texture");
@@ -1656,12 +1673,12 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Image");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Image", "");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_image_update");
prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
- RNA_def_property_update(prop, 0, "rna_Texture_update");
+ RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update");
}
static void rna_def_texture(BlenderRNA *brna)