101 static void rna_Material_update_previews(
Main *
UNUSED(bmain),
117 rna_Material_update(bmain,
scene,
ptr);
153 static void rna_Material_active_paint_texture_index_update(
Main *bmain,
185 for (sl =
area->spacedata.first; sl; sl = sl->
next) {
236 if (index < 0 || index >=
MAX_MTEX) {
256 if (mtex_ar ==
NULL) {
261 if (index < 0 || index >=
MAX_MTEX) {
266 if (mtex_ar[index]) {
269 mtex_ar[index] =
NULL;
277 static void rna_TexPaintSlot_uv_layer_get(
PointerRNA *
ptr,
char *value)
295 static void rna_TexPaintSlot_uv_layer_set(
PointerRNA *
ptr,
const char *value)
320 rna_MaterialGpencil_update(bmain,
scene,
ptr);
328 static int rna_GpencilColorData_is_stroke_visible_get(
PointerRNA *
ptr)
334 static int rna_GpencilColorData_is_fill_visible_get(
PointerRNA *
ptr)
340 static void rna_GpencilColorData_stroke_image_set(
PointerRNA *
ptr,
351 static void rna_GpencilColorData_fill_image_set(
PointerRNA *
ptr,
414 prop,
"Line Priority",
"The line color of a higher priority is used at material boundaries");
445 "Fill area with gradient color"},
461 "Follow stroke drawing path and object rotation"},
467 "Do not follow drawing path or object rotation and keeps aligned with viewport"},
551 prop,
"Locked",
"Protect color from further editing and/or frame changes");
558 prop,
"Show in Ghosts",
"Display strokes using this color when showing onion skins");
574 prop,
"Self Overlap",
"Disable stencil and overlap self intersections with alpha materials");
580 prop,
"Holdout",
"Remove the color from underneath this stroke by using it as a mask");
586 prop,
"Holdout",
"Remove the color from underneath this stroke by using it as a mask");
604 prop,
"Alignment",
"Defines how align Dots and Boxes with drawing path and object rotation");
614 prop,
"Rotation",
"Additional rotation applied to dots and square strokes");
674 prop,
"Is Stroke Visible",
"True when opacity of stroke is set high enough to be visible");
680 prop,
"Is Fill Visible",
"True when opacity of fill is set high enough to be visible");
695 prop,
"Use Transparency",
"Use transparency mask from this material in line art");
713 {
MA_FLAT,
"FLAT", ICON_MATPLANE,
"Flat",
"Flat XY plane"},
714 {
MA_SPHERE,
"SPHERE", ICON_MATSPHERE,
"Sphere",
"Sphere"},
715 {
MA_CUBE,
"CUBE", ICON_MATCUBE,
"Cube",
"Cube"},
716 {
MA_HAIR,
"HAIR", ICON_HAIR,
"Hair",
"Hair strands"},
717 {
MA_SHADERBALL,
"SHADERBALL", ICON_MATSHADERBALL,
"Shader Ball",
"Shader ball"},
718 {
MA_CLOTH,
"CLOTH", ICON_MATCLOTH,
"Cloth",
"Cloth"},
719 {
MA_FLUID,
"FLUID", ICON_MATFLUID,
"Fluid",
"Fluid"},
724 {
MA_BM_SOLID,
"OPAQUE", 0,
"Opaque",
"Render surface without transparency"},
729 "Use the alpha threshold to clip the visibility (binary visibility)"},
734 "Use noise to dither the binary visibility (works well with multi-samples)"},
739 "Render polygon transparent, depending on alpha channel of the texture"},
744 {
MA_BS_NONE,
"NONE", 0,
"None",
"Material will cast no shadow"},
745 {
MA_BS_SOLID,
"OPAQUE", 0,
"Opaque",
"Material will cast shadows without transparency"},
750 "Use the alpha threshold to clip the visibility (binary visibility)"},
755 "Use noise to dither the binary visibility and use filtering to reduce the noise"},
763 "Material data-block to define the appearance of geometric objects for rendering");
782 "A pixel is rendered only if its alpha value is above this threshold");
789 "Limit transparency to a single layer "
790 "(avoids transparency sorting problems)");
796 prop,
"Backface Culling",
"Use back face culling to hide the back side of faces");
802 prop,
"Screen Space Refraction",
"Use raytraced screen space refractions");
808 prop,
"Subsurface Translucency",
"Add translucency effect to subsurface");
816 "Approximate the thickness of the object to compute two refraction "
817 "event (0 is disabled)");
830 prop,
"Preview World",
"Use the current world background to light the preview render");
836 prop,
"Pass Index",
"Index number for the \"Material Index\" render pass");
864 prop,
"Grease Pencil Settings",
"Grease pencil color settings for material");
870 prop,
"Is Grease Pencil",
"True if this material has grease pencil data");
885 const char *structname,
886 const char *structname_slots)
902 parm =
RNA_def_pointer(func,
"mtex", structname,
"",
"The newly initialized mtex");
909 func,
"index", 0, 0, INT_MAX,
"Index",
"Slot index to initialize", 0, INT_MAX);
911 parm =
RNA_def_pointer(func,
"mtex", structname,
"",
"The newly initialized mtex");
917 parm =
RNA_def_int(func,
"index", 0, 0, INT_MAX,
"Index",
"Slot index to clear", 0, INT_MAX);
924 const char *activeget,
925 const char *activeset,
926 const char *activeeditable,
927 const char *structname,
928 const char *structname_slots,
930 const char *update_index)
939 "rna_iterator_array_next",
940 "rna_iterator_array_end",
941 "rna_iterator_array_dereference_get",
947 prop,
"Textures",
"Texture slots defining the mapping and influence of textures");
953 if (activeeditable) {
974 srna,
"Texture Paint Slot",
"Slot that contains information about texture painting");
980 "rna_TexPaintSlot_uv_layer_get",
981 "rna_TexPaintSlot_uv_layer_length",
982 "rna_TexPaintSlot_uv_layer_set");
1002 "rna_Material_texpaint_begin",
1003 "rna_iterator_array_next",
1004 "rna_iterator_array_end",
1005 "rna_iterator_array_dereference_get",
1012 prop,
"Texture Slot Images",
"Texture images used for texture painting");
1016 "rna_Material_texpaint_begin",
1017 "rna_iterator_array_next",
1018 "rna_iterator_array_end",
1019 "rna_iterator_array_get",
1026 prop,
"Texture Slots",
"Texture slots defining the mapping and influence of textures");
1031 prop,
"Active Paint Texture Index",
"Index of active texture paint slot");
struct Scene * CTX_data_scene(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
#define GPENCIL_ALPHA_OPACITY_THRESH
void id_us_min(struct ID *id)
void id_us_plus(struct ID *id)
General operations, lookup, etc. for materials.
struct bNode * BKE_texpaint_slot_material_find_node(struct Material *ma, short texpaint_slot)
void BKE_node_preview_clear_tree(struct bNodeTree *ntree)
void nodeSetActive(struct bNodeTree *ntree, struct bNode *node)
void BKE_report(ReportList *reports, ReportType type, const char *message)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
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_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_COPY_ON_WRITE
struct TexPaintSlot TexPaintSlot
@ 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
@ LRT_MATERIAL_TRANSPARENCY_ENABLED
@ GP_MATERIAL_MODE_SQUARE
@ GP_MATERIAL_STROKE_STYLE_SOLID
@ GP_MATERIAL_STROKE_STYLE_TEXTURE
@ GP_MATERIAL_GRADIENT_RADIAL
@ GP_MATERIAL_GRADIENT_LINEAR
@ GP_MATERIAL_FILL_STYLE_GRADIENT
@ GP_MATERIAL_FILL_STYLE_TEXTURE
@ GP_MATERIAL_FILL_STYLE_SOLID
Object is a sort of wrapper for general info.
#define OBEDIT_FROM_VIEW_LAYER(view_layer)
void ED_space_image_set(struct Main *bmain, struct SpaceImage *sima, struct Object *obedit, struct Image *ima, bool automatic)
void ED_node_shader_default(const struct bContext *C, struct ID *id)
struct wmWindow * ED_screen_window_find(const struct bScreen *screen, const struct wmWindowManager *wm)
Read Guarded memory(de)allocation.
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
#define ND_SHADING_PREVIEW
return(oflags[bm->toolflag_index].f &oflag) !=0
void ED_gpencil_update_color_uv(Main *bmain, Material *mat)
void(* MEM_freeN)(void *vmemh)
static void area(int d1, int d2, int e1, int e2, float weights[2])
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_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
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)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
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_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
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)
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
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)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
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_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(struct ID *self, struct bContext *C, struct ReportList *reports, int index)
void RNA_api_material(StructRNA *srna)
struct MTex * rna_mtex_texture_slots_add(struct ID *self, struct bContext *C, struct ReportList *reports)
struct MTex * rna_mtex_texture_slots_create(struct ID *self, struct bContext *C, struct 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)
struct bNodeTree * nodetree
struct MaterialGPencilStyle * gp_style
struct TexPaintSlot * texpaintslot
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)