Commit: f52f428582ef72d95645adaa3027a641630a8669
Author: Sriharsha Kotcharlakot
Date: Wed Aug 12 19:03:20 2020 +0530
Branches: soc-2020-fluid-tools
https://developer.blender.org/rBf52f428582ef72d95645adaa3027a641630a8669
Cleanup: Minor naming update in viewport fluid vector display options
===================================================================
M release/scripts/startup/bl_ui/properties_physics_fluid.py
M source/blender/blenkernel/intern/fluid.c
M source/blender/draw/engines/overlay/overlay_extra.c
M source/blender/draw/intern/draw_fluid.c
M source/blender/makesdna/DNA_fluid_types.h
M source/blender/makesrna/intern/rna_fluid.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py
b/release/scripts/startup/bl_ui/properties_physics_fluid.py
index 9da3afcbc3a..216890a5ef1 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fluid.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py
@@ -1341,9 +1341,9 @@ class
PHYSICS_PT_viewport_display_debug(PhysicButtonsPanel, Panel):
col = flow.column()
col.active = domain.show_velocity
col.prop(domain, "vector_display_type", text="Display As")
- col.prop(domain, "vector_grid_type", text="Grid Type")
+ col.prop(domain, "vector_field", text="Field")
- if not domain.use_guide and domain.vector_grid_type ==
'GUIDE_VELOCITY':
+ if not domain.use_guide and domain.vector_field == 'GUIDE_VELOCITY':
note = layout.split()
note.label(icon='INFO', text="Enable Guides first! Defaulting to
Fluid Velocity.")
diff --git a/source/blender/blenkernel/intern/fluid.c
b/source/blender/blenkernel/intern/fluid.c
index b925fcde6e6..2510644f440 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -5016,7 +5016,7 @@ void BKE_fluid_modifier_create_type_data(struct
FluidModifierData *fmd)
fmd->domain->grid_scale = 1.0f;
fmd->domain->vector_scale = 1.0f;
fmd->domain->vector_draw_type = VECTOR_DRAW_NEEDLE;
- fmd->domain->vector_draw_grid_type = VECTOR_DRAW_GRID_FLUID_VELOCITY;
+ fmd->domain->vector_field = FLUID_DOMAIN_VECTOR_FIELD_VELOCITY;
fmd->domain->vector_scale_with_magnitude = true;
fmd->domain->vector_draw_mac_components = VECTOR_DRAW_MAC_X |
VECTOR_DRAW_MAC_Y |
VECTOR_DRAW_MAC_Z;
@@ -5269,7 +5269,7 @@ void BKE_fluid_modifier_copy(const struct
FluidModifierData *fmd,
}
tfds->vector_scale = fds->vector_scale;
tfds->vector_draw_type = fds->vector_draw_type;
- tfds->vector_draw_grid_type = fds->vector_draw_grid_type;
+ tfds->vector_field = fds->vector_field;
tfds->vector_scale_with_magnitude = fds->vector_scale_with_magnitude;
tfds->vector_draw_mac_components = fds->vector_draw_mac_components;
tfds->use_coba = fds->use_coba;
diff --git a/source/blender/draw/engines/overlay/overlay_extra.c
b/source/blender/draw/engines/overlay/overlay_extra.c
index 5770045ec28..e08bb94d291 100644
--- a/source/blender/draw/engines/overlay/overlay_extra.c
+++ b/source/blender/draw/engines/overlay/overlay_extra.c
@@ -1430,7 +1430,7 @@ static void OVERLAY_volume_extra(OVERLAY_ExtraCallBuffers
*cb,
const bool draw_mac_x = (fds->vector_draw_mac_components &
VECTOR_DRAW_MAC_X);
const bool draw_mac_y = (fds->vector_draw_mac_components &
VECTOR_DRAW_MAC_Y);
const bool draw_mac_z = (fds->vector_draw_mac_components &
VECTOR_DRAW_MAC_Z);
- const bool cell_centered = (fds->vector_draw_grid_type ==
VECTOR_DRAW_GRID_FORCE);
+ const bool cell_centered = (fds->vector_field ==
FLUID_DOMAIN_VECTOR_FIELD_FORCE);
int line_count = 1;
if (use_needle) {
line_count = 6;
diff --git a/source/blender/draw/intern/draw_fluid.c
b/source/blender/draw/intern/draw_fluid.c
index a2dd8a8fed4..d22440ef4b9 100644
--- a/source/blender/draw/intern/draw_fluid.c
+++ b/source/blender/draw/intern/draw_fluid.c
@@ -305,19 +305,19 @@ static bool get_smoke_velocity_field(FluidDomainSettings
*fds,
float **r_velocity_y,
float **r_velocity_z)
{
- const char grid_type = fds->vector_draw_grid_type;
- switch (grid_type) {
- case VECTOR_DRAW_GRID_FLUID_VELOCITY:
+ const char vector_field = fds->vector_field;
+ switch (vector_field) {
+ case FLUID_DOMAIN_VECTOR_FIELD_VELOCITY:
*r_velocity_x = manta_get_velocity_x(fds->fluid);
*r_velocity_y = manta_get_velocity_y(fds->fluid);
*r_velocity_z = manta_get_velocity_z(fds->fluid);
break;
- case VECTOR_DRAW_GRID_GUIDE_VELOCITY:
+ case FLUID_DOMAIN_VECTOR_FIELD_GUIDE_VELOCITY:
*r_velocity_x = manta_get_guide_velocity_x(fds->fluid);
*r_velocity_y = manta_get_guide_velocity_y(fds->fluid);
*r_velocity_z = manta_get_guide_velocity_z(fds->fluid);
break;
- case VECTOR_DRAW_GRID_FORCE:
+ case FLUID_DOMAIN_VECTOR_FIELD_FORCE:
*r_velocity_x = manta_get_force_x(fds->fluid);
*r_velocity_y = manta_get_force_y(fds->fluid);
*r_velocity_z = manta_get_force_z(fds->fluid);
@@ -443,7 +443,7 @@ void DRW_smoke_ensure_velocity(FluidModifierData *fmd)
float *vel_x = NULL, *vel_y = NULL, *vel_z = NULL;
if (!get_smoke_velocity_field(fds, &vel_x, &vel_y, &vel_z)) {
- fds->vector_draw_grid_type = VECTOR_DRAW_GRID_FLUID_VELOCITY;
+ fds->vector_field = FLUID_DOMAIN_VECTOR_FIELD_VELOCITY;
get_smoke_velocity_field(fds, &vel_x, &vel_y, &vel_z);
}
diff --git a/source/blender/makesdna/DNA_fluid_types.h
b/source/blender/makesdna/DNA_fluid_types.h
index 14266427c74..54c4e0286ea 100644
--- a/source/blender/makesdna/DNA_fluid_types.h
+++ b/source/blender/makesdna/DNA_fluid_types.h
@@ -99,10 +99,11 @@ enum {
VECTOR_DRAW_MAC_Z = (1 << 2),
};
+/* Fluid domain vector fields. */
enum {
- VECTOR_DRAW_GRID_FLUID_VELOCITY = 0,
- VECTOR_DRAW_GRID_GUIDE_VELOCITY = 1,
- VECTOR_DRAW_GRID_FORCE = 2,
+ FLUID_DOMAIN_VECTOR_FIELD_VELOCITY = 0,
+ FLUID_DOMAIN_VECTOR_FIELD_GUIDE_VELOCITY = 1,
+ FLUID_DOMAIN_VECTOR_FIELD_FORCE = 2,
};
enum {
@@ -651,7 +652,7 @@ typedef struct FluidDomainSettings {
char show_gridlines;
char draw_velocity;
char vector_draw_type;
- char vector_draw_grid_type;
+ char vector_field; /* Simulation field used for vector display. */
char vector_scale_with_magnitude;
char vector_draw_mac_components;
char use_coba;
diff --git a/source/blender/makesrna/intern/rna_fluid.c
b/source/blender/makesrna/intern/rna_fluid.c
index cb118b74251..efabe3a1265 100644
--- a/source/blender/makesrna/intern/rna_fluid.c
+++ b/source/blender/makesrna/intern/rna_fluid.c
@@ -1351,18 +1351,18 @@ static void rna_def_fluid_domain_settings(BlenderRNA
*brna)
{0, NULL, 0, NULL, NULL},
};
- static const EnumPropertyItem vector_draw_grid_items[] = {
- {VECTOR_DRAW_GRID_FLUID_VELOCITY,
+ static const EnumPropertyItem vector_field_items[] = {
+ {FLUID_DOMAIN_VECTOR_FIELD_VELOCITY,
"FLUID_VELOCITY",
0,
"Fluid Velocity",
- "Display fluid velocity grid"},
- {VECTOR_DRAW_GRID_GUIDE_VELOCITY,
+ "Velocity field of the fluid domain"},
+ {FLUID_DOMAIN_VECTOR_FIELD_GUIDE_VELOCITY,
"GUIDE_VELOCITY",
0,
"Guide Velocity",
- "Display guide velocity grid"},
- {VECTOR_DRAW_GRID_FORCE, "FORCE", 0, "Force", "Display external forces"},
+ "Guide velocity field of the fluid domain"},
+ {FLUID_DOMAIN_VECTOR_FIELD_FORCE, "FORCE", 0, "Force", "Force field of
the fluid domain"},
{0, NULL, 0, NULL, NULL},
};
@@ -2506,10 +2506,10 @@ static void rna_def_fluid_domain_settings(BlenderRNA
*brna)
RNA_def_property_ui_text(prop, "Display Type", "");
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
- prop = RNA_def_property(srna, "vector_grid_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "vector_draw_grid_type");
- RNA_def_property_enum_items(prop, vector_draw_grid_items);
- RNA_def_property_ui_text(prop, "Grid Type", "Type of vector grid to be
displayed");
+ prop = RNA_def_property(srna, "vector_field", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "vector_field");
+ RNA_def_property_enum_items(prop, vector_field_items);
+ RNA_def_property_ui_text(prop, "Field", "Vector field to be represented by
the display vectors");
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
prop = RNA_def_property(srna, "vector_scale_with_magnitude", PROP_BOOLEAN,
PROP_NONE);
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs