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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_modifier.c')
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c96
1 files changed, 15 insertions, 81 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index ee44e71042c..3708a7dc637 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -755,6 +755,7 @@ RNA_MOD_VGROUP_NAME_SET(LaplacianDeform, anchor_grp_name);
RNA_MOD_VGROUP_NAME_SET(LaplacianSmooth, defgrp_name);
RNA_MOD_VGROUP_NAME_SET(Lattice, name);
RNA_MOD_VGROUP_NAME_SET(Mask, vgroup);
+RNA_MOD_VGROUP_NAME_SET(MeshCache, defgrp_name);
RNA_MOD_VGROUP_NAME_SET(MeshDeform, defgrp_name);
RNA_MOD_VGROUP_NAME_SET(NormalEdit, defgrp_name);
RNA_MOD_VGROUP_NAME_SET(Shrinkwrap, vgroup_name);
@@ -1600,51 +1601,6 @@ static bool rna_Modifier_show_expanded_get(PointerRNA *ptr)
return md->ui_expand_flag & UI_PANEL_DATA_EXPAND_ROOT;
}
-static int rna_MeshSequenceCacheModifier_has_velocity_get(PointerRNA *ptr)
-{
-# ifdef WITH_ALEMBIC
- MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *)ptr->data;
- return ABC_has_vec3_array_property_named(mcmd->reader, mcmd->cache_file->velocity_name);
-# else
- return false;
- UNUSED_VARS(ptr);
-# endif
-}
-
-static int rna_MeshSequenceCacheModifier_read_velocity_get(PointerRNA *ptr)
-{
-# ifdef WITH_ALEMBIC
- MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *)ptr->data;
-
- if (mcmd->num_vertices == 0) {
- return 0;
- }
-
- if (mcmd->vertex_velocities) {
- MEM_freeN(mcmd->vertex_velocities);
- }
-
- mcmd->vertex_velocities = MEM_mallocN(sizeof(MeshCacheVertexVelocity) * mcmd->num_vertices,
- "Mesh Cache Velocities");
-
- int num_read = ABC_read_velocity_cache(mcmd->reader,
- mcmd->cache_file->velocity_name,
- mcmd->last_lookup_time,
- mcmd->velocity_scale * mcmd->velocity_delta,
- mcmd->num_vertices,
- (float *)mcmd->vertex_velocities);
-
- if (num_read == -1 || num_read != mcmd->num_vertices) {
- return false;
- }
-
- return true;
-# else
- return false;
- UNUSED_VARS(ptr);
-# endif
-}
-
static bool rna_NodesModifier_node_group_poll(PointerRNA *UNUSED(ptr), PointerRNA value)
{
bNodeTree *ntree = value.data;
@@ -6059,6 +6015,20 @@ static void rna_def_modifier_meshcache(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Influence", "Influence of the deformation");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+ prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
+ RNA_def_property_ui_text(
+ prop,
+ "Vertex Group",
+ "Name of the Vertex Group which determines the influence of the modifier per point");
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshCacheModifier_defgrp_name_set");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MESHCACHE_INVERT_VERTEX_GROUP);
+ RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
/* -------------------------------------------------------------------- */
/* Axis Conversion */
prop = RNA_def_property(srna, "forward_axis", PROP_ENUM, PROP_NONE);
@@ -6117,22 +6087,6 @@ static void rna_def_modifier_meshcache(BlenderRNA *brna)
RNA_define_lib_overridable(false);
}
-static void rna_def_mesh_cache_velocities(BlenderRNA *brna)
-{
- StructRNA *srna;
- PropertyRNA *prop;
-
- srna = RNA_def_struct(brna, "MeshCacheVertexVelocity", NULL);
- RNA_def_struct_ui_text(srna, "Mesh Cache Velocity", "Velocity attribute of an Alembic mesh");
- RNA_def_struct_ui_icon(srna, ICON_VERTEXSEL);
-
- prop = RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY);
- RNA_def_property_array(prop, 3);
- RNA_def_property_float_sdna(prop, NULL, "vel");
- RNA_def_property_ui_text(prop, "Velocity", "");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-}
-
static void rna_def_modifier_meshseqcache(BlenderRNA *brna)
{
StructRNA *srna;
@@ -6189,26 +6143,6 @@ static void rna_def_modifier_meshseqcache(BlenderRNA *brna)
"Multiplier used to control the magnitude of the velocity vectors for time effects");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- /* -------------------------- Velocity Vectors -------------------------- */
-
- prop = RNA_def_property(srna, "vertex_velocities", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_collection_sdna(prop, NULL, "vertex_velocities", "num_vertices");
- RNA_def_property_struct_type(prop, "MeshCacheVertexVelocity");
- RNA_def_property_ui_text(
- prop, "Fluid Mesh Vertices", "Vertices of the fluid mesh generated by simulation");
-
- rna_def_mesh_cache_velocities(brna);
-
- prop = RNA_def_property(srna, "has_velocity", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_ui_text(prop, "Has Velocity Cache", "");
- RNA_def_property_boolean_funcs(prop, "rna_MeshSequenceCacheModifier_has_velocity_get", NULL);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-
- prop = RNA_def_property(srna, "read_velocity", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_ui_text(prop, "Read Velocity Cache", "");
- RNA_def_property_boolean_funcs(prop, "rna_MeshSequenceCacheModifier_read_velocity_get", NULL);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-
RNA_define_lib_overridable(false);
}