[Bf-blender-cvs] [d30baf6] openvdb: Merge branch 'master' into openvdb

Lukas Tönne noreply at git.blender.org
Wed Nov 16 16:36:55 CET 2016


Commit: d30baf60c662915772e7952c1b715c461cb979ff
Author: Lukas Tönne
Date:   Wed Nov 16 16:36:43 2016 +0100
Branches: openvdb
https://developer.blender.org/rBd30baf60c662915772e7952c1b715c461cb979ff

Merge branch 'master' into openvdb

===================================================================



===================================================================

diff --cc source/blender/makesdna/DNA_smoke_types.h
index 8f197c8,c95e0a1..fb81e2b
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@@ -193,11 -210,13 +210,15 @@@ typedef struct SmokeDomainSettings 
  	float slice_per_voxel;
  	float slice_depth;
  	float display_thickness;
+ 
+ 	struct ColorBand *coba;
  	float vector_scale;
  	char vector_draw_type;
- 	char pad2[3];
+ 	char use_coba;
+ 	char coba_field;  /* simulation field used for the color mapping */
+ 	char pad2;
 +
 +	char cache_filename[1024];
  } SmokeDomainSettings;
  
  
diff --cc source/blender/makesrna/intern/rna_smoke.c
index ce18c86,6db370f..15950e6
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@@ -383,15 -385,17 +385,26 @@@ static void rna_SmokeFlow_uvlayer_set(P
  	rna_object_uvlayer_name_set(ptr, value, flow->uvlayer_name, sizeof(flow->uvlayer_name));
  }
  
+ static void rna_Smoke_use_color_ramp_set(PointerRNA *ptr, int value)
+ {
+ 	SmokeDomainSettings *sds = (SmokeDomainSettings *)ptr->data;
+ 
+ 	sds->use_coba = value;
+ 
+ 	if (value && sds->coba == NULL) {
+ 		sds->coba = add_colorband(false);
+ 	}
+ }
+ 
 +static void rna_SmokeModifier_cache_filename_get(PointerRNA *ptr, char *filename)
 +{
-        SmokeDomainSettings *sds = (SmokeDomainSettings *)ptr->data;
-        PTCacheID pid;
++	SmokeDomainSettings *sds = (SmokeDomainSettings *)ptr->data;
++	PTCacheID pid;
 +
-        BKE_ptcache_id_from_smoke(&pid, ptr->id.data, sds->smd);
-        ptcache_filename(&pid, filename, sds->smd->time, 1, 1);
++	BKE_ptcache_id_from_smoke(&pid, ptr->id.data, sds->smd);
++	ptcache_filename(&pid, filename, sds->smd->time, 1, 1);
 +}
 +
  #else
  
  static void rna_def_smoke_domain_settings(BlenderRNA *brna)
@@@ -815,11 -819,40 +828,46 @@@
  	RNA_def_property_ui_text(prop, "Scale", "Multiplier for scaling the vectors");
  	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
  
+ 	/* --------- Color mapping. --------- */
+ 
+ 	prop = RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE);
+ 	RNA_def_property_boolean_sdna(prop, NULL, "use_coba", 0);
+ 	RNA_def_property_boolean_funcs(prop, NULL, "rna_Smoke_use_color_ramp_set");
+ 	RNA_def_property_ui_text(prop, "Use Color Ramp",
+ 	                         "Render a simulation field while mapping its voxels values to the colors of a ramp");
+ 	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
+ 
+ 	static EnumPropertyItem coba_field_items[] = {
+ 	    {FLUID_FIELD_COLOR_R, "COLOR_R", 0, "Red", "Red component of the color field"},
+ 	    {FLUID_FIELD_COLOR_G, "COLOR_G", 0, "Green", "Green component of the color field"},
+ 	    {FLUID_FIELD_COLOR_B, "COLOR_B", 0, "Blue", "Blue component of the color field"},
+ 		{FLUID_FIELD_DENSITY, "DENSITY", 0, "Density", "Quantity of soot in the fluid"},
+ 	    {FLUID_FIELD_FLAME, "FLAME", 0, "Flame", "Flame field"},
+ 	    {FLUID_FIELD_FUEL, "FUEL", 0, "Fuel", "Fuel field"},
+ 	    {FLUID_FIELD_HEAT, "HEAT", 0, "Heat", "Temperature of the fluid"},
+ 	    {FLUID_FIELD_VELOCITY_X, "VELOCITY_X", 0, "X Velocity", "X component of the velocity field"},
+ 	    {FLUID_FIELD_VELOCITY_Y, "VELOCITY_Y", 0, "Y Velocity", "Y component of the velocity field"},
+ 	    {FLUID_FIELD_VELOCITY_Z, "VELOCITY_Z", 0, "Z Velocity", "Z component of the velocity field"},
+ 		{0, NULL, 0, NULL, NULL}
+ 	};
+ 
+ 	prop = RNA_def_property(srna, "coba_field", PROP_ENUM, PROP_NONE);
+ 	RNA_def_property_enum_sdna(prop, NULL, "coba_field");
+ 	RNA_def_property_enum_items(prop, coba_field_items);
+ 	RNA_def_property_ui_text(prop, "Field", "Simulation field to color map");
+ 	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
+ 
+ 	prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
+ 	RNA_def_property_pointer_sdna(prop, NULL, "coba");
+ 	RNA_def_property_struct_type(prop, "ColorRamp");
+ 	RNA_def_property_ui_text(prop, "Color Ramp", "");
+ 	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
++
 +	prop = RNA_def_property(srna, "cache_filename", PROP_STRING, PROP_NONE);
 +	RNA_def_property_string_maxlength(prop, 1024);
 +	RNA_def_property_string_funcs(prop, "rna_SmokeModifier_cache_filename_get", NULL, NULL);
 +	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +	RNA_def_property_ui_text(prop, "Filename", "Path to the .blend file");
  }
  
  static void rna_def_smoke_flow_settings(BlenderRNA *brna)




More information about the Bf-blender-cvs mailing list