diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-06-05 11:28:26 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-06-05 11:28:26 +0300 |
commit | 6262b2bf7cffffdf0bb4dfac1548a539c7ba5f68 (patch) | |
tree | 269c1cd3f1e1156d5f651e0c3da8de5c00840858 | |
parent | 0387abd20fae495b0edeb71f12910e755be0f0a5 (diff) |
initial empty particle nodes modifier
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_modifier.py | 3 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 1 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_modifier_types.h | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 14 | ||||
-rw-r--r-- | source/blender/modifiers/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/modifiers/MOD_modifiertypes.h | 1 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_nodeparticles.c | 97 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_util.c | 1 |
8 files changed, 123 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index ccec7f9af7c..2d64e41826a 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -1663,6 +1663,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): props.object_name = ob.name props.modifier_name = md.name + def NODE_PARTICLES(self, layout, ob, md): + layout.label(text="Hello World") + class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel): bl_label = "Modifiers" diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 11047ef78fa..37a78525b4c 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -2009,6 +2009,7 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te) case eModifierType_ShapeKey: case eModifierType_FunctionDeform: case eModifierType_FunctionPoints: + case eModifierType_NodeParticles: case NUM_MODIFIER_TYPES: data.icon = ICON_DOT; diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index e5a472552f9..bd6faebaf59 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -90,6 +90,7 @@ typedef enum ModifierType { eModifierType_WeightedNormal = 54, eModifierType_FunctionDeform = 55, eModifierType_FunctionPoints = 56, + eModifierType_NodeParticles = 57, NUM_MODIFIER_TYPES } ModifierType; @@ -1963,4 +1964,8 @@ typedef struct FunctionPointsModifierData { struct bNodeTree *function_tree; } FunctionPointsModifierData; +typedef struct NodeParticlesModifierData { + ModifierData modifier; +} NodeParticlesModifierData; + #endif /* __DNA_MODIFIER_TYPES_H__ */ diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 96e9f393c2b..7af6b83898d 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -147,6 +147,7 @@ const EnumPropertyItem rna_enum_object_modifier_type_items[] = { {eModifierType_Smoke, "SMOKE", ICON_MOD_SMOKE, "Smoke", ""}, {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""}, {eModifierType_Surface, "SURFACE", ICON_MODIFIER, "Surface", ""}, + {eModifierType_NodeParticles, "NODE_PARTICLES", ICON_NONE, "Node Particles", ""}, {0, NULL, 0, NULL, NULL}, }; @@ -579,6 +580,8 @@ static StructRNA *rna_Modifier_refine(struct PointerRNA *ptr) return &RNA_FunctionDeformModifier; case eModifierType_FunctionPoints: return &RNA_FunctionPointsModifier; + case eModifierType_NodeParticles: + return &RNA_NodeParticlesModifier; /* Default */ case eModifierType_None: case eModifierType_ShapeKey: @@ -5970,6 +5973,16 @@ static void rna_def_modifier_function_points(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } +static void rna_def_modifier_node_particles(BlenderRNA *brna) +{ + StructRNA *srna; + + srna = RNA_def_struct(brna, "NodeParticlesModifier", "Modifier"); + RNA_def_struct_ui_text(srna, "Node Particles Modifier", ""); + RNA_def_struct_sdna(srna, "NodeParticlesModifierData"); + RNA_def_struct_ui_icon(srna, ICON_NONE); +} + void RNA_def_modifier(BlenderRNA *brna) { StructRNA *srna; @@ -6097,6 +6110,7 @@ void RNA_def_modifier(BlenderRNA *brna) rna_def_modifier_weightednormal(brna); rna_def_modifier_function_deform(brna); rna_def_modifier_function_points(brna); + rna_def_modifier_node_particles(brna); } #endif diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt index 2a1e46d6505..9b0411b5aa8 100644 --- a/source/blender/modifiers/CMakeLists.txt +++ b/source/blender/modifiers/CMakeLists.txt @@ -73,6 +73,7 @@ set(SRC intern/MOD_meshsequencecache.c intern/MOD_mirror.c intern/MOD_multires.c + intern/MOD_nodeparticles.c intern/MOD_none.c intern/MOD_normal_edit.c intern/MOD_ocean.c diff --git a/source/blender/modifiers/MOD_modifiertypes.h b/source/blender/modifiers/MOD_modifiertypes.h index 0a3313e7810..a9aaa2f69ec 100644 --- a/source/blender/modifiers/MOD_modifiertypes.h +++ b/source/blender/modifiers/MOD_modifiertypes.h @@ -83,6 +83,7 @@ extern ModifierTypeInfo modifierType_SurfaceDeform; extern ModifierTypeInfo modifierType_WeightedNormal; extern ModifierTypeInfo modifierType_FunctionDeform; extern ModifierTypeInfo modifierType_FunctionPoints; +extern ModifierTypeInfo modifierType_NodeParticles; /* MOD_util.c */ void modifier_type_init(ModifierTypeInfo *types[]); diff --git a/source/blender/modifiers/intern/MOD_nodeparticles.c b/source/blender/modifiers/intern/MOD_nodeparticles.c new file mode 100644 index 00000000000..6cc94f4be77 --- /dev/null +++ b/source/blender/modifiers/intern/MOD_nodeparticles.c @@ -0,0 +1,97 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2019 by the Blender Foundation. + * All rights reserved. + * ***** END GPL LICENSE BLOCK ***** + * + */ + +/** \file blender/modifiers/intern/MOD_nodeparticles.c + * \ingroup modifiers + * + */ + +#include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" +#include "DNA_modifier_types.h" +#include "DNA_object_types.h" + +#include "BKE_mesh.h" +#include "BKE_modifier.h" + +#include "BLI_math.h" + +#include "MOD_util.h" + +static Mesh *applyModifier(ModifierData *UNUSED(md), + const struct ModifierEvalContext *UNUSED(ctx), + Mesh *UNUSED(mesh)) +{ + Mesh *mesh = BKE_mesh_new_nomain(1, 0, 0, 0, 0); + float point[] = {1, 2, 3}; + copy_v3_v3(mesh->mvert[0].co, point); + return mesh; +} + +static void initData(ModifierData *UNUSED(md)) +{ +} + +static bool dependsOnTime(ModifierData *UNUSED(md)) +{ + return false; +} + +static void updateDepsgraph(ModifierData *UNUSED(md), + const ModifierUpdateDepsgraphContext *UNUSED(ctx)) +{ +} + +static void foreachIDLink(ModifierData *UNUSED(md), + Object *UNUSED(ob), + IDWalkFunc UNUSED(walk), + void *UNUSED(userData)) +{ +} + +ModifierTypeInfo modifierType_NodeParticles = { + /* name */ "Node Particles", + /* structName */ "NodeParticlesModifierData", + /* structSize */ sizeof(NodeParticlesModifierData), + /* type */ eModifierTypeType_Constructive, + /* flags */ eModifierTypeFlag_AcceptsMesh, + /* copyData */ modifier_copyData_generic, + + /* deformVerts */ NULL, + /* deformMatrices */ NULL, + /* deformVertsEM */ NULL, + /* deformMatricesEM */ NULL, + /* applyModifier */ applyModifier, + + /* initData */ initData, + /* requiredDataMask */ NULL, + /* freeData */ NULL, + /* isDisabled */ NULL, + /* updateDepsgraph */ updateDepsgraph, + /* dependsOnTime */ dependsOnTime, + /* dependsOnNormals */ NULL, + /* foreachObjectLink */ NULL, + /* foreachIDLink */ foreachIDLink, + /* foreachTexLink */ NULL, + /* freeRuntimeData */ NULL, +}; diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c index ea61e139ef9..aace7f48f24 100644 --- a/source/blender/modifiers/intern/MOD_util.c +++ b/source/blender/modifiers/intern/MOD_util.c @@ -309,5 +309,6 @@ void modifier_type_init(ModifierTypeInfo *types[]) INIT_TYPE(WeightedNormal); INIT_TYPE(FunctionDeform); INIT_TYPE(FunctionPoints); + INIT_TYPE(NodeParticles); #undef INIT_TYPE } |