From fc442dbd51a5ef71757a1a179222f358b6efdc8c Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sun, 30 Dec 2012 18:27:33 +0000 Subject: Add DNA/RNA/BKE infrastructure for dynamic-topology sculpt mode * Add a detail_size field to the Sculpt struct, two new sculpt flags, and a Mesh flag for dynamic-topology mode; that's it for file-level changes needed by dynamic topology * Add RNA for the new DNA field and flags * Add a new icon for dynamic-topology created by Julio Iglesias. TODO: update the icon for the new SVG icon format * Add a SculptSession function for converting from BMesh to Mesh, handles reordering mesh elements and setting face shading --- source/blender/makesrna/intern/rna_object.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/blender/makesrna/intern/rna_object.c') diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 4918aabdb1f..6e81e866118 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -48,6 +48,7 @@ #include "BLI_utildefines.h" +#include "BKE_paint.h" #include "BKE_tessmesh.h" #include "BKE_group.h" /* needed for object_in_group() */ @@ -1436,6 +1437,12 @@ int rna_DupliObject_index_get(PointerRNA *ptr) return dob->persistent_id[0]; } +int rna_Object_use_dynamic_topology_sculpting_get(PointerRNA *ptr) +{ + SculptSession *ss = ((Object*)ptr->id.data)->sculpt; + return (ss && ss->bm); +} + #else static int rna_matrix_dimsize_4x4[] = {4, 4}; @@ -2629,6 +2636,12 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Active Shape Key Index", "Current shape key index"); RNA_def_property_update(prop, 0, "rna_Object_active_shape_update"); + /* sculpt */ + prop = RNA_def_property(srna, "use_dynamic_topology_sculpting", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_Object_use_dynamic_topology_sculpting_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Dynamic Topology Sculpting", NULL); + RNA_api_object(srna); } -- cgit v1.2.3