Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_volume.c
| Show All 35 Lines | |||||
| #ifdef RNA_RUNTIME | #ifdef RNA_RUNTIME | ||||
| # include "DEG_depsgraph.h" | # include "DEG_depsgraph.h" | ||||
| # include "DEG_depsgraph_build.h" | # include "DEG_depsgraph_build.h" | ||||
| # include "WM_api.h" | # include "WM_api.h" | ||||
| # include "WM_types.h" | # include "WM_types.h" | ||||
| static char *rna_VolumeRender_path(PointerRNA *ptr) | |||||
| { | |||||
| return BLI_strdup("render"); | |||||
| } | |||||
| static char *rna_VolumeDisplay_path(PointerRNA *ptr) | |||||
| { | |||||
| return BLI_strdup("display"); | |||||
| } | |||||
| /* Updates */ | /* Updates */ | ||||
| static void rna_Volume_update_display(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | static void rna_Volume_update_display(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| { | { | ||||
| Volume *volume = (Volume *)ptr->owner_id; | Volume *volume = (Volume *)ptr->owner_id; | ||||
| WM_main_add_notifier(NC_GEOM | ND_DATA, volume); | WM_main_add_notifier(NC_GEOM | ND_DATA, volume); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 314 Lines • ▼ Show 20 Lines | |||||
| static void rna_def_volume_display(BlenderRNA *brna) | static void rna_def_volume_display(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "VolumeDisplay", NULL); | srna = RNA_def_struct(brna, "VolumeDisplay", NULL); | ||||
| RNA_def_struct_ui_text(srna, "Volume Display", "Volume object display settings for 3D viewport"); | RNA_def_struct_ui_text(srna, "Volume Display", "Volume object display settings for 3D viewport"); | ||||
| RNA_def_struct_sdna(srna, "VolumeDisplay"); | RNA_def_struct_sdna(srna, "VolumeDisplay"); | ||||
| RNA_def_struct_path_func(srna, "rna_VolumeDisplay_path"); | |||||
| prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | ||||
| RNA_def_property_range(prop, 0.00001, FLT_MAX); | RNA_def_property_range(prop, 0.00001, FLT_MAX); | ||||
| RNA_def_property_ui_range(prop, 0.1, 100.0, 1, 3); | RNA_def_property_ui_range(prop, 0.1, 100.0, 1, 3); | ||||
| RNA_def_property_ui_text(prop, "Density", "Thickness of volume display in the viewport"); | RNA_def_property_ui_text(prop, "Density", "Thickness of volume display in the viewport"); | ||||
| RNA_def_property_update(prop, 0, "rna_Volume_update_display"); | RNA_def_property_update(prop, 0, "rna_Volume_update_display"); | ||||
| ▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | |||||
| static void rna_def_volume_render(BlenderRNA *brna) | static void rna_def_volume_render(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "VolumeRender", NULL); | srna = RNA_def_struct(brna, "VolumeRender", NULL); | ||||
| RNA_def_struct_ui_text(srna, "Volume Render", "Volume object render settings"); | RNA_def_struct_ui_text(srna, "Volume Render", "Volume object render settings"); | ||||
| RNA_def_struct_sdna(srna, "VolumeRender"); | RNA_def_struct_sdna(srna, "VolumeRender"); | ||||
| RNA_def_struct_path_func(srna, "rna_VolumeRender_path"); | |||||
| static const EnumPropertyItem space_items[] = { | static const EnumPropertyItem space_items[] = { | ||||
| {VOLUME_SPACE_OBJECT, | {VOLUME_SPACE_OBJECT, | ||||
| "OBJECT", | "OBJECT", | ||||
| 0, | 0, | ||||
| "Object", | "Object", | ||||
| "Keep volume opacity and detail the same regardless of object scale"}, | "Keep volume opacity and detail the same regardless of object scale"}, | ||||
| {VOLUME_SPACE_WORLD, | {VOLUME_SPACE_WORLD, | ||||
| ▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines | |||||