54 {0,
nullptr, 0,
nullptr,
nullptr},
107 rna_Material_update(bmain, scene,
ptr);
110 for (
Object *ob =
static_cast<Object *
>(bmain->objects.first); ob;
111 ob =
static_cast<Object *
>(ob->id.next))
130static std::optional<std::string> rna_MaterialLineArt_path(
const PointerRNA * )
147 iter,
ptr, (
void *)ma->texpaintslot,
sizeof(
TexPaintSlot), ma->tot_slots, 0,
nullptr);
163 if (ma->texpaintslot && (ma->tot_slots > ma->paint_active_slot)) {
164 TexPaintSlot *slot = &ma->texpaintslot[ma->paint_active_slot];
177 if (layer !=
nullptr) {
193 switch (material->surface_render_method) {
202static void rna_Material_blend_method_set(
PointerRNA *
ptr,
int new_blend_method)
205 switch (new_blend_method) {
217static void rna_Material_render_method_set(
PointerRNA *
ptr,
int new_render_method)
220 material->surface_render_method = new_render_method;
223 switch (new_render_method) {
232static void rna_Material_transparent_shadow_set(
PointerRNA *
ptr,
bool new_value)
240static bool rna_Material_use_nodes_get(
PointerRNA * )
246static void rna_Material_use_nodes_set(
PointerRNA * ,
bool )
257 if (mtex ==
nullptr) {
272 if (index < 0 || index >=
MAX_MTEX) {
292 if (mtex_ar ==
nullptr) {
297 if (index < 0 || index >=
MAX_MTEX) {
302 if (mtex_ar[index]) {
305 mtex_ar[index] =
nullptr;
313static void rna_TexPaintSlot_uv_layer_get(
PointerRNA *
ptr,
char *value)
317 if (
data->uvname !=
nullptr) {
318 strcpy(value,
data->uvname);
328 return data->uvname ==
nullptr ? 0 : strlen(
data->uvname);
331static void rna_TexPaintSlot_uv_layer_set(
PointerRNA *
ptr,
const char *value)
335 if (
data->uvname !=
nullptr) {
340static void rna_TexPaintSlot_name_get(
PointerRNA *
ptr,
char *value)
344 if (
data->ima !=
nullptr) {
345 strcpy(value,
data->ima->id.name + 2);
349 if (
data->attribute_name !=
nullptr) {
350 strcpy(value,
data->attribute_name);
360 if (
data->ima !=
nullptr) {
361 return strlen(
data->ima->id.name) - 2;
363 if (
data->attribute_name !=
nullptr) {
364 return strlen(
data->attribute_name);
373 if (
data->ima !=
nullptr) {
376 if (
data->attribute_name !=
nullptr) {
386 if (ma->gp_style !=
nullptr) {
393static std::optional<std::string> rna_GpencilColorData_path(
const PointerRNA * )
395 return "grease_pencil";
398static bool rna_GpencilColorData_is_stroke_visible_get(
PointerRNA *
ptr)
404static bool rna_GpencilColorData_is_fill_visible_get(
PointerRNA *
ptr)
410static void rna_GpencilColorData_stroke_image_set(
PointerRNA *
ptr,
415 ID *
id =
static_cast<ID *
>(value.
data);
421static void rna_GpencilColorData_fill_image_set(
PointerRNA *
ptr,
426 ID *
id =
static_cast<ID *
>(value.data);
445 static const float diffuse_color_default[4] = {0.8f, 0.8f, 0.8f, 1.0f};
488 prop,
"Line Priority",
"The line color of a higher priority is used at material boundaries");
502 {0,
nullptr, 0,
nullptr,
nullptr},
509 {0,
nullptr, 0,
nullptr,
nullptr},
519 "Fill area with gradient color"},
521 {0,
nullptr, 0,
nullptr,
nullptr},
527 {0,
nullptr, 0,
nullptr,
nullptr},
535 "Follow stroke drawing path and object rotation"},
541 "Do not follow drawing path or object rotation and keeps aligned with viewport"},
542 {0,
nullptr, 0,
nullptr,
nullptr},
627 prop,
"Locked",
"Protect color from further editing and/or frame changes");
634 prop,
"Show in Ghosts",
"Display strokes using this color when showing onion skins");
650 prop,
"Self Overlap",
"Disable stencil and overlap self intersections with alpha materials");
656 prop,
"Holdout",
"Remove the color from underneath this stroke by using it as a mask");
662 prop,
"Holdout",
"Remove the color from underneath this stroke by using it as a mask");
680 prop,
"Alignment",
"Defines how align Dots and Boxes with drawing path and object rotation");
691 "Additional rotation applied to dots and square texture of strokes. "
692 "Only applies in texture shading mode.");
720 prop,
nullptr,
"rna_GpencilColorData_stroke_image_set",
nullptr,
nullptr);
745 prop,
nullptr,
"rna_GpencilColorData_fill_image_set",
nullptr,
nullptr);
756 prop,
"Is Stroke Visible",
"True when opacity of stroke is set high enough to be visible");
762 prop,
"Is Fill Visible",
"True when opacity of fill is set high enough to be visible");
778 prop,
"Use Material Mask",
"Use material masks to filter out occluded strokes");
793 "Faces with this material will behave as if it has set number of layers in occlusion");
799 "Intersection Priority",
800 "The intersection line will be included into the object with the "
801 "higher intersection priority value");
808 "Use Intersection Priority",
809 "Override object and collection intersection priority value");
820 {
MA_FLAT,
"FLAT", ICON_MATPLANE,
"Flat",
"Flat XY plane"},
821 {
MA_SPHERE,
"SPHERE", ICON_MATSPHERE,
"Sphere",
"Sphere"},
822 {
MA_CUBE,
"CUBE", ICON_MATCUBE,
"Cube",
"Cube"},
823 {
MA_HAIR,
"HAIR", ICON_CURVES,
"Hair",
"Hair strands"},
824 {
MA_SHADERBALL,
"SHADERBALL", ICON_MATSHADERBALL,
"Shader Ball",
"Shader ball"},
825 {
MA_CLOTH,
"CLOTH", ICON_MATCLOTH,
"Cloth",
"Cloth"},
826 {
MA_FLUID,
"FLUID", ICON_MATFLUID,
"Fluid",
"Fluid"},
827 {0,
nullptr, 0,
nullptr,
nullptr},
835 "Each face is considered as a medium interface. Gives correct results for manifold "
836 "geometry that contains no inner parts."},
841 "Faces are considered as medium interface only when they have different consecutive "
842 "facing. Gives correct results as long as the max ray depth is not exceeded. Have "
843 "significant memory overhead compared to the fast method."},
844 {0,
nullptr, 0,
nullptr,
nullptr},
852 "Approximate the object as a sphere whose diameter is equal to the thickness defined by "
858 "Approximate the object as an infinite slab of thickness defined by the node tree"},
859 {0,
nullptr, 0,
nullptr,
nullptr},
864 {
MA_BM_SOLID,
"OPAQUE", 0,
"Opaque",
"Render surface without transparency"},
869 "Use the alpha threshold to clip the visibility (binary visibility)"},
874 "Use noise to dither the binary visibility (works well with multi-samples)"},
879 "Render polygon transparent, depending on alpha channel of the texture"},
880 {0,
nullptr, 0,
nullptr,
nullptr},
889 "Allows for grayscale hashed transparency, and compatible with render passes and "
890 "raytracing. Also known as deferred rendering."},
895 "Allows for colored transparency, but incompatible with render passes and raytracing. Also "
896 "known as forward rendering."},
897 {0,
nullptr, 0,
nullptr,
nullptr},
905 "Bump mapping to simulate the appearance of displacement"},
910 "Use true displacement of surface only, requires fine subdivision"},
914 "Displacement and Bump",
915 "Combination of true displacement and bump mapping for finer detail"},
916 {0,
nullptr, 0,
nullptr,
nullptr},
923 "Material data-block to define the appearance of geometric objects for rendering");
929 "Surface Render Method",
930 "Controls the blending and the compatibility with certain features");
947 "Blend Mode for Transparent Faces (Deprecated: use 'surface_render_method')");
949 prop,
"rna_Material_blend_method_get",
"rna_Material_blend_method_set",
nullptr);
957 "A pixel is rendered only if its alpha value is above this threshold");
964 "Use Transparency Overlap",
965 "Render multiple transparent layers "
966 "(may introduce transparency sorting problems)");
975 "Render multiple transparent layers "
976 "(may introduce transparency sorting problems) (Deprecated: use 'use_tranparency_overlap')");
983 prop,
"Backface Culling",
"Use back face culling to hide the back side of faces");
989 prop,
"Shadow Backface Culling",
"Use back face culling when casting shadows");
997 "Light Probe Volume Backface Culling",
998 "Consider material single sided for light probe volume capture. "
999 "Additionally helps rejecting probes inside the object to avoid light leaks.");
1007 "Transparent Shadows",
1008 "Use transparent shadows for this material if it contains a Transparent BSDF, "
1009 "disabling will render faster but not give accurate shadows");
1016 "Raytrace Transmission",
1017 "Use raytracing to determine transmitted color instead of using only light probes. "
1018 "This prevents the surface from contributing to the lighting of surfaces not using this "
1027 "Raytrace Transmission",
1028 "Use raytracing to determine transmitted color instead of using only light probes. "
1029 "This prevents the surface from contributing to the lighting of surfaces not using this "
1030 "setting. Deprecated: use 'use_raytrace_refraction'.");
1036 prop,
"Subsurface Translucency",
"Add translucency effect to subsurface (Deprecated)");
1044 "Approximate the thickness of the object to compute two refraction "
1045 "events (0 is disabled) (Deprecated)");
1053 "Approximation used to model the light interactions inside the object");
1059 "Thickness From Shadow",
1060 "Use the shadow maps from shadow casting lights "
1061 "to refine the thickness defined by the material node tree");
1068 "Volume Intersection Method",
1069 "Determines which inner part of the mesh will produce volumetric effect");
1076 "Max Vertex Displacement",
1077 "The max distance a vertex can be displaced. "
1078 "Displacements over this threshold may cause visibility issues.");
1092 prop,
"Preview World",
"Use the current world background to light the preview render");
1098 prop,
"Pass Index",
"Index number for the \"Material Index\" render pass");
1114 "Unused but kept for compatibility reasons. Setting the property "
1115 "has no effect, and getting it always returns True.",
1129 prop,
"Grease Pencil Settings",
"Grease Pencil color settings for material");
1135 prop,
"Is Grease Pencil",
"True if this material has Grease Pencil data");
1150 const char *structname,
1151 const char *structname_slots)
1167 parm =
RNA_def_pointer(func,
"mtex", structname,
"",
"The newly initialized mtex");
1174 func,
"index", 0, 0, INT_MAX,
"Index",
"Slot index to initialize", 0, INT_MAX);
1176 parm =
RNA_def_pointer(func,
"mtex", structname,
"",
"The newly initialized mtex");
1182 parm =
RNA_def_int(func,
"index", 0, 0, INT_MAX,
"Index",
"Slot index to clear", 0, INT_MAX);
1189 const char *activeget,
1190 const char *activeset,
1191 const char *activeeditable,
1192 const char *structname,
1193 const char *structname_slots,
1195 const char *update_index)
1204 "rna_iterator_array_next",
1205 "rna_iterator_array_end",
1206 "rna_iterator_array_dereference_get",
1212 prop,
"Textures",
"Texture slots defining the mapping and influence of textures");
1218 if (activeeditable) {
1239 srna,
"Texture Paint Slot",
"Slot that contains information about texture painting");
1244 prop,
"rna_TexPaintSlot_name_get",
"rna_TexPaintSlot_name_length",
nullptr);
1258 "rna_TexPaintSlot_uv_layer_get",
1259 "rna_TexPaintSlot_uv_layer_length",
1260 "rna_TexPaintSlot_uv_layer_set");
1280 "rna_Material_texpaint_begin",
1281 "rna_iterator_array_next",
1282 "rna_iterator_array_end",
1283 "rna_iterator_array_dereference_get",
1290 prop,
"Texture Slot Images",
"Texture images used for texture painting");
1294 "rna_Material_texpaint_begin",
1295 "rna_iterator_array_next",
1296 "rna_iterator_array_end",
1297 "rna_iterator_array_get",
1304 prop,
"Texture Slots",
"Texture slots defining the mapping and influence of textures");
1309 prop,
"Active Paint Texture Index",
"Index of active texture paint slot");
const struct CustomDataLayer * BKE_id_attributes_color_find(const struct ID *id, blender::StringRef name)
void BKE_id_attributes_active_color_set(struct ID *id, std::optional< blender::StringRef > name)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
#define GPENCIL_ALPHA_OPACITY_THRESH
Low-level operations for grease pencil.
General operations, lookup, etc. for materials.
bNode * BKE_texpaint_slot_material_find_node(Material *ma, short texpaint_slot)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
bool give_active_mtex(struct ID *id, struct MTex ***mtex_ar, short *act)
struct MTex * BKE_texture_mtex_add_id(struct ID *id, int slot)
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define SET_FLAG_FROM_TEST(value, test, flag)
#define BLT_I18NCONTEXT_ID_GPENCIL
#define BLT_I18NCONTEXT_ID_MATERIAL
void DEG_id_tag_update(ID *id, unsigned int flags)
#define MAX_CUSTOMDATA_LAYER_NAME_NO_PREFIX
@ GP_MATERIAL_STROKE_STYLE_SOLID
@ GP_MATERIAL_STROKE_STYLE_TEXTURE
@ MA_BL_TRANSPARENT_SHADOW
@ MA_BL_LIGHTPROBE_VOLUME_DOUBLE_SIDED
@ MA_BL_THICKNESS_FROM_SHADOW
@ MA_BL_CULL_BACKFACE_SHADOW
@ MA_SURFACE_METHOD_DEFERRED
@ MA_SURFACE_METHOD_FORWARD
@ GP_MATERIAL_FOLLOW_PATH
@ GP_MATERIAL_FOLLOW_FIXED
@ GP_MATERIAL_HIDE_ONIONSKIN
@ GP_MATERIAL_DISABLE_STENCIL
@ GP_MATERIAL_IS_STROKE_HOLDOUT
@ GP_MATERIAL_STROKE_SHOW
@ GP_MATERIAL_IS_FILL_HOLDOUT
@ GP_MATERIAL_GRADIENT_RADIAL
@ GP_MATERIAL_GRADIENT_LINEAR
@ LRT_MATERIAL_CUSTOM_INTERSECTION_PRIORITY
@ LRT_MATERIAL_MASK_ENABLED
@ GP_MATERIAL_MODE_SQUARE
@ MA_DISPLACEMENT_DISPLACE
@ MA_VOLUME_ISECT_ACCURATE
@ GP_MATERIAL_FILL_STYLE_GRADIENT
@ GP_MATERIAL_FILL_STYLE_TEXTURE
@ GP_MATERIAL_FILL_STYLE_SOLID
Object is a sort of wrapper for general info.
void ED_space_image_sync(Main *bmain, Image *image, bool ignore_render_viewer)
Read Guarded memory(de)allocation.
#define RNA_ENUM_ITEM_SEPR
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
#define ND_SHADING_PREVIEW
BMesh const char void * data
void MEM_freeN(void *vmemh)
void node_set_active(bNodeTree &ntree, bNode &node)
static void update(bNodeTree *ntree)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
void rna_def_animdata_common(StructRNA *srna)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_property_deprecated(PropertyRNA *prop, const char *note, const short version, const short removal_version)
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_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_bitset_array_sdna(PropertyRNA *prop, const char *structname, const char *propname, const int64_t booleanbit, const int length)
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_int_default(PropertyRNA *prop, int value)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void rna_mtex_texture_slots_clear(ID *self, bContext *C, ReportList *reports, int index)
void RNA_api_material(StructRNA *srna)
MTex * rna_mtex_texture_slots_add(ID *self, bContext *C, ReportList *reports)
MTex * rna_mtex_texture_slots_create(ID *self, bContext *C, ReportList *reports, int index)
static void rna_def_material_greasepencil(BlenderRNA *brna)
static void rna_def_texture_slots(BlenderRNA *brna, PropertyRNA *cprop, const char *structname, const char *structname_slots)
const EnumPropertyItem rna_enum_ramp_blend_items[]
void RNA_def_material(BlenderRNA *brna)
void rna_def_texpaint_slots(BlenderRNA *brna, StructRNA *srna)
static void rna_def_tex_slot(BlenderRNA *brna)
static void rna_def_material_lineart(BlenderRNA *brna)
void rna_def_mtex_common(BlenderRNA *brna, StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *activeeditable, const char *structname, const char *structname_slots, const char *update, const char *update_index)
static void rna_def_material_display(StructRNA *srna)
void WM_main_add_notifier(uint type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)