55 {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))
134static std::optional<std::string> rna_MaterialLineArt_path(
const PointerRNA * )
151 iter, (
void *)ma->texpaintslot,
sizeof(
TexPaintSlot), ma->tot_slots, 0,
nullptr);
159 if (ma->use_nodes && ma->nodetree) {
167 if (ma->texpaintslot && (ma->tot_slots > ma->paint_active_slot)) {
168 TexPaintSlot *slot = &ma->texpaintslot[ma->paint_active_slot];
181 if (layer !=
nullptr) {
197 switch (material->surface_render_method) {
206static void rna_Material_blend_method_set(
PointerRNA *
ptr,
int new_blend_method)
209 switch (new_blend_method) {
221static void rna_Material_render_method_set(
PointerRNA *
ptr,
int new_render_method)
224 material->surface_render_method = new_render_method;
227 switch (new_render_method) {
236static void rna_Material_transparent_shadow_set(
PointerRNA *
ptr,
bool new_value)
249 if (ma->use_nodes && ma->nodetree ==
nullptr) {
261 if (mtex ==
nullptr) {
276 if (index < 0 || index >=
MAX_MTEX) {
296 if (mtex_ar ==
nullptr) {
301 if (index < 0 || index >=
MAX_MTEX) {
306 if (mtex_ar[index]) {
309 mtex_ar[index] =
nullptr;
317static void rna_TexPaintSlot_uv_layer_get(
PointerRNA *
ptr,
char *value)
321 if (data->uvname !=
nullptr) {
322 strcpy(value, data->uvname);
332 return data->
uvname ==
nullptr ? 0 : strlen(data->uvname);
335static void rna_TexPaintSlot_uv_layer_set(
PointerRNA *
ptr,
const char *value)
339 if (data->uvname !=
nullptr) {
344static void rna_TexPaintSlot_name_get(
PointerRNA *
ptr,
char *value)
348 if (data->ima !=
nullptr) {
349 strcpy(value, data->ima->id.name + 2);
353 if (data->attribute_name !=
nullptr) {
354 strcpy(value, data->attribute_name);
364 if (data->ima !=
nullptr) {
365 return strlen(data->ima->id.name) - 2;
367 if (data->attribute_name !=
nullptr) {
368 return strlen(data->attribute_name);
377 if (data->ima !=
nullptr) {
380 if (data->attribute_name !=
nullptr) {
390 if (ma->gp_style !=
nullptr) {
397static std::optional<std::string> rna_GpencilColorData_path(
const PointerRNA * )
399 return "grease_pencil";
402static bool rna_GpencilColorData_is_stroke_visible_get(
PointerRNA *
ptr)
408static bool rna_GpencilColorData_is_fill_visible_get(
PointerRNA *
ptr)
414static void rna_GpencilColorData_stroke_image_set(
PointerRNA *
ptr,
419 ID *
id =
static_cast<ID *
>(value.data);
425static void rna_GpencilColorData_fill_image_set(
PointerRNA *
ptr,
430 ID *
id =
static_cast<ID *
>(value.data);
449 static float diffuse_color_default[4] = {0.8f, 0.8f, 0.8f, 1.0f};
492 prop,
"Line Priority",
"The line color of a higher priority is used at material boundaries");
506 {0,
nullptr, 0,
nullptr,
nullptr},
513 {0,
nullptr, 0,
nullptr,
nullptr},
523 "Fill area with gradient color"},
525 {0,
nullptr, 0,
nullptr,
nullptr},
531 {0,
nullptr, 0,
nullptr,
nullptr},
539 "Follow stroke drawing path and object rotation"},
545 "Do not follow drawing path or object rotation and keeps aligned with viewport"},
546 {0,
nullptr, 0,
nullptr,
nullptr},
631 prop,
"Locked",
"Protect color from further editing and/or frame changes");
638 prop,
"Show in Ghosts",
"Display strokes using this color when showing onion skins");
654 prop,
"Self Overlap",
"Disable stencil and overlap self intersections with alpha materials");
660 prop,
"Holdout",
"Remove the color from underneath this stroke by using it as a mask");
666 prop,
"Holdout",
"Remove the color from underneath this stroke by using it as a mask");
684 prop,
"Alignment",
"Defines how align Dots and Boxes with drawing path and object rotation");
695 "Additional rotation applied to dots and square texture of strokes. "
696 "Only applies in texture shading mode.");
724 prop,
nullptr,
"rna_GpencilColorData_stroke_image_set",
nullptr,
nullptr);
749 prop,
nullptr,
"rna_GpencilColorData_fill_image_set",
nullptr,
nullptr);
760 prop,
"Is Stroke Visible",
"True when opacity of stroke is set high enough to be visible");
766 prop,
"Is Fill Visible",
"True when opacity of fill is set high enough to be visible");
782 prop,
"Use Material Mask",
"Use material masks to filter out occluded strokes");
798 "Faces with this material will behave as if it has set number of layers in occlusion");
804 "Intersection Priority",
805 "The intersection line will be included into the object with the "
806 "higher intersection priority value");
813 "Use Intersection Priority",
814 "Override object and collection intersection priority value");
825 {
MA_FLAT,
"FLAT", ICON_MATPLANE,
"Flat",
"Flat XY plane"},
826 {
MA_SPHERE,
"SPHERE", ICON_MATSPHERE,
"Sphere",
"Sphere"},
827 {
MA_CUBE,
"CUBE", ICON_MATCUBE,
"Cube",
"Cube"},
828 {
MA_HAIR,
"HAIR", ICON_CURVES,
"Hair",
"Hair strands"},
829 {
MA_SHADERBALL,
"SHADERBALL", ICON_MATSHADERBALL,
"Shader Ball",
"Shader ball"},
830 {
MA_CLOTH,
"CLOTH", ICON_MATCLOTH,
"Cloth",
"Cloth"},
831 {
MA_FLUID,
"FLUID", ICON_MATFLUID,
"Fluid",
"Fluid"},
832 {0,
nullptr, 0,
nullptr,
nullptr},
840 "Each face is considered as a medium interface. Gives correct results for manifold "
841 "geometry that contains no inner parts."},
846 "Faces are considered as medium interface only when they have different consecutive "
847 "facing. Gives correct results as long as the max ray depth is not exceeded. Have "
848 "significant memory overhead compared to the fast method."},
849 {0,
nullptr, 0,
nullptr,
nullptr},
857 "Approximate the object as a sphere whose diameter is equal to the thickness defined by "
863 "Approximate the object as an infinite slab of thickness defined by the node tree"},
864 {0,
nullptr, 0,
nullptr,
nullptr},
869 {
MA_BM_SOLID,
"OPAQUE", 0,
"Opaque",
"Render surface without transparency"},
874 "Use the alpha threshold to clip the visibility (binary visibility)"},
879 "Use noise to dither the binary visibility (works well with multi-samples)"},
884 "Render polygon transparent, depending on alpha channel of the texture"},
885 {0,
nullptr, 0,
nullptr,
nullptr},
894 "Allows for grayscale hashed transparency, and compatible with render passes and "
895 "raytracing. Also known as deferred rendering."},
900 "Allows for colored transparency, but incompatible with render passes and raytracing. Also "
901 "known as forward rendering."},
902 {0,
nullptr, 0,
nullptr,
nullptr},
910 "Bump mapping to simulate the appearance of displacement"},
915 "Use true displacement of surface only, requires fine subdivision"},
919 "Displacement and Bump",
920 "Combination of true displacement and bump mapping for finer detail"},
921 {0,
nullptr, 0,
nullptr,
nullptr},
928 "Material data-block to define the appearance of geometric objects for rendering");
934 "Surface Render Method",
935 "Controls the blending and the compatibility with certain features");
952 "Blend Mode for Transparent Faces (Deprecated: use 'surface_render_method')");
954 prop,
"rna_Material_blend_method_get",
"rna_Material_blend_method_set",
nullptr);
962 "A pixel is rendered only if its alpha value is above this threshold");
969 "Use Transparency Overlap",
970 "Render multiple transparent layers "
971 "(may introduce transparency sorting problems)");
980 "Render multiple transparent layers "
981 "(may introduce transparency sorting problems) (Deprecated: use 'use_tranparency_overlap')");
988 prop,
"Backface Culling",
"Use back face culling to hide the back side of faces");
994 prop,
"Shadow Backface Culling",
"Use back face culling when casting shadows");
1002 "Light Probe Volume Backface Culling",
1003 "Consider material single sided for light probe volume capture. "
1004 "Additionally helps rejecting probes inside the object to avoid light leaks.");
1012 "Transparent Shadows",
1013 "Use transparent shadows for this material if it contains a Transparent BSDF, "
1014 "disabling will render faster but not give accurate shadows");
1021 "Raytrace Transmission",
1022 "Use raytracing to determine transmitted color instead of using only light probes. "
1023 "This prevents the surface from contributing to the lighting of surfaces not using this "
1032 "Raytrace Transmission",
1033 "Use raytracing to determine transmitted color instead of using only light probes. "
1034 "This prevents the surface from contributing to the lighting of surfaces not using this "
1035 "setting. Deprecated: use 'use_raytrace_refraction'.");
1041 prop,
"Subsurface Translucency",
"Add translucency effect to subsurface (Deprecated)");
1049 "Approximate the thickness of the object to compute two refraction "
1050 "events (0 is disabled) (Deprecated)");
1058 "Approximation used to model the light interactions inside the object");
1064 "Thickness From Shadow",
1065 "Use the shadow maps from shadow casting lights "
1066 "to refine the thickness defined by the material node tree");
1073 "Volume Intersection Method",
1074 "Determines which inner part of the mesh will produce volumetric effect");
1081 "Max Vertex Displacement",
1082 "The max distance a vertex can be displaced. "
1083 "Displacements over this threshold may cause visibility issues.");
1097 prop,
"Preview World",
"Use the current world background to light the preview render");
1103 prop,
"Pass Index",
"Index number for the \"Material Index\" render pass");
1130 prop,
"Grease Pencil Settings",
"Grease pencil color settings for material");
1136 prop,
"Is Grease Pencil",
"True if this material has grease pencil data");
1151 const char *structname,
1152 const char *structname_slots)
1168 parm =
RNA_def_pointer(func,
"mtex", structname,
"",
"The newly initialized mtex");
1175 func,
"index", 0, 0, INT_MAX,
"Index",
"Slot index to initialize", 0, INT_MAX);
1177 parm =
RNA_def_pointer(func,
"mtex", structname,
"",
"The newly initialized mtex");
1183 parm =
RNA_def_int(func,
"index", 0, 0, INT_MAX,
"Index",
"Slot index to clear", 0, INT_MAX);
1190 const char *activeget,
1191 const char *activeset,
1192 const char *activeeditable,
1193 const char *structname,
1194 const char *structname_slots,
1196 const char *update_index)
1205 "rna_iterator_array_next",
1206 "rna_iterator_array_end",
1207 "rna_iterator_array_dereference_get",
1213 prop,
"Textures",
"Texture slots defining the mapping and influence of textures");
1219 if (activeeditable) {
1240 srna,
"Texture Paint Slot",
"Slot that contains information about texture painting");
1245 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, const char *name)
void BKE_id_attributes_active_color_set(struct ID *id, const char *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.
struct bNode * BKE_texpaint_slot_material_find_node(struct 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)
void DEG_relations_tag_update(Main *bmain)
@ 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_FILL_STYLE_GRADIENT
@ GP_MATERIAL_FILL_STYLE_TEXTURE
@ GP_MATERIAL_FILL_STYLE_SOLID
@ MA_DISPLACEMENT_DISPLACE
@ GP_MATERIAL_FOLLOW_PATH
@ GP_MATERIAL_FOLLOW_FIXED
@ MA_VOLUME_ISECT_ACCURATE
@ GP_MATERIAL_STROKE_STYLE_SOLID
@ GP_MATERIAL_STROKE_STYLE_TEXTURE
@ GP_MATERIAL_HIDE_ONIONSKIN
@ GP_MATERIAL_DISABLE_STENCIL
@ GP_MATERIAL_IS_STROKE_HOLDOUT
@ GP_MATERIAL_STROKE_SHOW
@ GP_MATERIAL_IS_FILL_HOLDOUT
@ LRT_MATERIAL_CUSTOM_INTERSECTION_PRIORITY
@ LRT_MATERIAL_MASK_ENABLED
@ GP_MATERIAL_MODE_SQUARE
@ GP_MATERIAL_GRADIENT_RADIAL
@ GP_MATERIAL_GRADIENT_LINEAR
Object is a sort of wrapper for general info.
void ED_space_image_sync(Main *bmain, Image *image, bool ignore_render_viewer)
void ED_node_shader_default(const bContext *C, ID *id)
Read Guarded memory(de)allocation.
#define RNA_ENUM_ITEM_SEPR
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
#define ND_SHADING_PREVIEW
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, void *ptr, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
void rna_def_animdata_common(StructRNA *srna)
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_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
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_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_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)