24struct DummyVolumeGridData;
33 {
VOLUME_GRID_MASK,
"MASK", 0,
"Mask",
"No data, boolean mask of active voxels"},
40 "Points (Unsupported)",
41 "Points grid, currently unsupported by volume objects"},
43 {0,
nullptr, 0,
nullptr,
nullptr},
68static std::optional<std::string> rna_VolumeRender_path(
const PointerRNA * )
73static std::optional<std::string> rna_VolumeDisplay_path(
const PointerRNA * )
82 Volume *volume = id_cast<Volume *>(ptr->owner_id);
88 Volume *volume = id_cast<Volume *>(ptr->owner_id);
96 rna_Volume_update_filepath(bmain, scene, ptr);
100static void rna_Volume_velocity_grid_set(
PointerRNA *ptr,
const char *value)
111static void rna_VolumeGrid_name_get(
PointerRNA *ptr,
char *value)
113 auto *grid =
static_cast<const bke::VolumeGridData *
>(ptr->data);
117static int rna_VolumeGrid_name_length(
PointerRNA *ptr)
119 auto *grid =
static_cast<const bke::VolumeGridData *
>(ptr->data);
123static int rna_VolumeGrid_data_type_get(
PointerRNA *ptr)
125 const auto *grid =
static_cast<const bke::VolumeGridData *
>(ptr->data);
129static int rna_VolumeGrid_channels_get(
PointerRNA *ptr)
131 const auto *grid =
static_cast<const bke::VolumeGridData *
>(ptr->data);
135static void rna_VolumeGrid_matrix_object_get(
PointerRNA *ptr,
float *value)
137 auto *grid =
static_cast<const bke::VolumeGridData *
>(ptr->data);
141static bool rna_VolumeGrid_is_loaded_get(
PointerRNA *ptr)
143 auto *grid =
static_cast<const bke::VolumeGridData *
>(ptr->data);
147static bool rna_VolumeGrid_load(
ID * , DummyVolumeGridData *dummy_grid)
149 auto *grid =
reinterpret_cast<const bke::VolumeGridData *
>(dummy_grid);
154static void rna_VolumeGrid_unload(
ID * , DummyVolumeGridData * )
166 iter->internal.count.ptr = volume;
168 iter->valid = (iter->internal.count.item < num_grids);
173 Volume *volume =
static_cast<Volume *
>(iter->internal.count.ptr);
175 iter->internal.count.item++;
176 iter->valid = (iter->internal.count.item < num_grids);
183 Volume *volume =
static_cast<Volume *
>(iter->internal.count.ptr);
188static int rna_Volume_grids_length(
PointerRNA *ptr)
196static void rna_VolumeGrids_active_index_range(
206static int rna_VolumeGrids_active_index_get(
PointerRNA *ptr)
210 return clamp_i(volume->active_grid, 0,
max_ii(num_grids - 1, 0));
213static void rna_VolumeGrids_active_index_set(
PointerRNA *ptr,
int value)
216 volume->active_grid = value;
221static bool rna_VolumeGrids_is_loaded_get(
PointerRNA *ptr)
229static void rna_VolumeGrids_error_message_get(
PointerRNA *ptr,
char *value)
235static int rna_VolumeGrids_error_message_length(
PointerRNA *ptr)
242static void rna_VolumeGrids_frame_filepath_get(
PointerRNA *ptr,
char *value)
248static int rna_VolumeGrids_frame_filepath_length(
PointerRNA *ptr)
254static bool rna_Volume_load(
Volume *volume,
Main *bmain)
259static bool rna_Volume_save(
Volume *volume,
Main *bmain,
ReportList *reports,
const char *filepath)
283 prop,
"rna_VolumeGrid_name_get",
"rna_VolumeGrid_name_length",
nullptr);
304 prop,
"Matrix Object",
"Transformation matrix from voxel index to object space");
317 parm =
RNA_def_boolean(func,
"success",
false,
"",
"True if grid tree was successfully loaded");
323 func,
"Unload grid tree and voxel data from memory, leaving only metadata");
338 "rna_VolumeGrids_active_index_get",
339 "rna_VolumeGrids_active_index_set",
340 "rna_VolumeGrids_active_index_range");
347 prop,
"rna_VolumeGrids_error_message_get",
"rna_VolumeGrids_error_message_length",
nullptr);
349 prop,
"Error Message",
"If loading grids failed, error message with details");
361 "Frame number that volume grids will be loaded at, based on scene time "
362 "and volume parameters");
368 "rna_VolumeGrids_frame_filepath_get",
369 "rna_VolumeGrids_frame_filepath_length",
374 "Volume file used for loading the volume at the current frame. Empty "
375 "if the volume has not be loaded or the frame only exists in memory.");
384 parm =
RNA_def_boolean(func,
"success",
false,
"",
"True if grid list was successfully loaded");
395 parm =
RNA_def_boolean(func,
"success",
false,
"",
"True if grid list was successfully loaded");
422 "Display single bounding box for the entire grid"},
427 "Display bounding boxes for nodes in the volume tree"},
432 "Display points for nodes in the volume tree"},
433 {0,
nullptr, 0,
nullptr,
nullptr},
441 "Display one box or point for each intermediate tree node"},
447 {0,
nullptr, 0,
nullptr,
nullptr},
456 "Smoothed high quality interpolation, but slower"},
458 {0,
nullptr, 0,
nullptr,
nullptr},
466 "Adjust slice direction according to the view direction"},
470 {0,
nullptr, 0,
nullptr,
nullptr},
486 prop,
"Interpolation",
"Interpolation method to use for volumes in solid mode");
520 {0,
nullptr, 0,
nullptr,
nullptr},
527 "Specify volume data precision. Lower values reduce memory consumption "
528 "at the cost of detail.");
536 "Keep volume opacity and detail the same regardless of object scale"},
541 "Specify volume step size and density in world space"},
542 {0,
nullptr, 0,
nullptr,
nullptr},
548 prop,
"Space",
"Specify volume density and step size in object or world space");
557 "Distance between volume samples. Lower values render more detail at "
558 "the cost of performance. If set to zero, the step size is "
559 "automatically determined based on voxel size.");
569 "Value under which voxels are considered empty space to optimize rendering");
597 prop,
"Sequence",
"Whether the cache is separated in a series of files");
604 prop,
"Start Frame",
"Global starting frame of the sequence, assuming first has a #1");
615 prop,
"Offset",
"Offset the number of the frame to use in the animation");
624 "Repeat the start frame before, and the end frame after the frame range"},
630 "Repeat the frames, reversing the playback direction every other cycle"},
631 {0,
nullptr, 0,
nullptr,
nullptr},
646 "rna_Volume_grids_begin",
647 "rna_Volume_grids_next",
648 "rna_Volume_grids_end",
649 "rna_Volume_grids_get",
650 "rna_Volume_grids_length",
670 "rna_IDMaterials_assign_int");
691 "Name of the velocity field, or the base name if the velocity is split into multiple grids");
699 "Define how the velocity vectors are interpreted with regard to time, 'frame' means "
700 "the delta time is 1 frame, 'second' means the delta time is 1 / FPS");
715 "Name of the grid for the X axis component of the velocity field if it "
716 "was split into multiple grids");
723 "Name of the grid for the Y axis component of the velocity field if it "
724 "was split into multiple grids");
731 "Name of the grid for the Z axis component of the velocity field if it "
732 "was split into multiple grids");
#define BLI_STR_UTF8_MULTIPLICATION_SIGN
#define BLT_I18NCONTEXT_ID_VOLUME
#define BLT_I18NCONTEXT_UNIT
float4x4 get_transform_matrix(const VolumeGridData &grid)
std::string get_name(const VolumeGridData &grid)
int get_channels_num(VolumeGridType type)
std::string error_message_from_load(const VolumeGridData &grid)
void load(const VolumeGridData &grid)
VolumeGridType get_type(const VolumeGridData &grid)
bool is_loaded(const VolumeGridData &grid)
void WM_main_add_notifier(uint type, void *reference)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
PropertyRNA * RNA_def_string_file_path(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void WM_global_reportf(eReportType type, const char *format,...)
static void rna_def_volume_grid(BlenderRNA *brna)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
int BKE_volume_num_grids(const Volume *volume)
bool BKE_volume_set_velocity_grid_by_name(Volume *volume, StringRef base_name)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
@ VOLUME_AXIS_SLICE_SINGLE
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
const EnumPropertyItem rna_enum_velocity_unit_items[]
const bke::VolumeGridData * BKE_volume_grid_get(const Volume *volume, int grid_index)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
MINLINE int max_ii(int a, int b)
MatBase< float, 4, 4 > float4x4
const EnumPropertyItem rna_enum_volume_grid_data_type_items[]
@ VOLUME_SEQUENCE_PING_PONG
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void rna_def_animdata_common(StructRNA *srna)
const char * BKE_volume_grids_error_msg(const Volume *volume)
bool BKE_volume_is_loaded(const Volume *volume)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
@ VOLUME_PRECISION_VARIABLE
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void DEG_id_tag_update(ID *id, unsigned int flags)
@ VOLUME_GRID_VECTOR_FLOAT
@ VOLUME_GRID_VECTOR_DOUBLE
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
const char * BKE_volume_grids_frame_filepath(const Volume *volume)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
static void rna_def_volume_render(BlenderRNA *brna)
void BKE_volume_unload(Volume *volume)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
bool BKE_volume_save(const Volume *volume, const Main *bmain, ReportList *reports, const char *filepath)
bool BKE_volume_load(const Volume *volume, const Main *bmain)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
static void rna_def_volume_grids(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
@ VOLUME_WIREFRAME_POINTS
@ VOLUME_WIREFRAME_BOUNDS
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
void DEG_relations_tag_update(Main *bmain)
static void rna_def_volume_display(BlenderRNA *brna)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
@ VOLUME_WIREFRAME_COARSE
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
@ VOLUME_DISPLAY_INTERP_LINEAR
@ VOLUME_DISPLAY_INTERP_CUBIC
@ VOLUME_DISPLAY_INTERP_CLOSEST
static void rna_def_volume(BlenderRNA *brna)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop, const bool allow_replace)
MINLINE int clamp_i(int value, int min, int max)
const int rna_matrix_dimsize_4x4[]
void RNA_def_volume(BlenderRNA *brna)