90 static void rna_Material_update_previews(
Main *
UNUSED(bmain),
106 rna_Material_update(bmain,
scene,
ptr);
174 for (sl =
area->spacedata.first; sl; sl = sl->
next) {
240 if (index < 0 || index >=
MAX_MTEX) {
260 if (mtex_ar ==
NULL) {
265 if (index < 0 || index >=
MAX_MTEX) {
270 if (mtex_ar[index]) {
273 mtex_ar[index] =
NULL;
281 static void rna_TexPaintSlot_uv_layer_get(
PointerRNA *
ptr,
char *value)
299 static void rna_TexPaintSlot_uv_layer_set(
PointerRNA *
ptr,
const char *value)
308 static void rna_TexPaintSlot_name_get(
PointerRNA *
ptr,
char *value)
329 return strlen(
data->ima->id.name) - 2;
332 return strlen(
data->attribute_name);
367 rna_MaterialGpencil_update(bmain,
scene,
ptr);
375 static int rna_GpencilColorData_is_stroke_visible_get(
PointerRNA *
ptr)
381 static int rna_GpencilColorData_is_fill_visible_get(
PointerRNA *
ptr)
387 static void rna_GpencilColorData_stroke_image_set(
PointerRNA *
ptr,
398 static void rna_GpencilColorData_fill_image_set(
PointerRNA *
ptr,
461 prop,
"Line Priority",
"The line color of a higher priority is used at material boundaries");
492 "Fill area with gradient color"},
508 "Follow stroke drawing path and object rotation"},
514 "Do not follow drawing path or object rotation and keeps aligned with viewport"},
598 prop,
"Locked",
"Protect color from further editing and/or frame changes");
605 prop,
"Show in Ghosts",
"Display strokes using this color when showing onion skins");
621 prop,
"Self Overlap",
"Disable stencil and overlap self intersections with alpha materials");
627 prop,
"Holdout",
"Remove the color from underneath this stroke by using it as a mask");
633 prop,
"Holdout",
"Remove the color from underneath this stroke by using it as a mask");
651 prop,
"Alignment",
"Defines how align Dots and Boxes with drawing path and object rotation");
662 "Additional rotation applied to dots and square texture of strokes. "
663 "Only applies in texture shading mode");
723 prop,
"Is Stroke Visible",
"True when opacity of stroke is set high enough to be visible");
729 prop,
"Is Fill Visible",
"True when opacity of fill is set high enough to be visible");
745 prop,
"Use Material Mask",
"Use material masks to filter out occluded strokes");
761 "Faces with this material will behave as if it has set number of layers in occlusion");
767 "Intersection Priority",
768 "The intersection line will be included into the object with the "
769 "higher intersection priority value");
776 "Use Intersection Priority",
777 "Override object and collection intersection priority value");
788 {
MA_FLAT,
"FLAT", ICON_MATPLANE,
"Flat",
"Flat XY plane"},
789 {
MA_SPHERE,
"SPHERE", ICON_MATSPHERE,
"Sphere",
"Sphere"},
790 {
MA_CUBE,
"CUBE", ICON_MATCUBE,
"Cube",
"Cube"},
791 {
MA_HAIR,
"HAIR", ICON_CURVES,
"Hair",
"Hair strands"},
792 {
MA_SHADERBALL,
"SHADERBALL", ICON_MATSHADERBALL,
"Shader Ball",
"Shader ball"},
793 {
MA_CLOTH,
"CLOTH", ICON_MATCLOTH,
"Cloth",
"Cloth"},
794 {
MA_FLUID,
"FLUID", ICON_MATFLUID,
"Fluid",
"Fluid"},
799 {
MA_BM_SOLID,
"OPAQUE", 0,
"Opaque",
"Render surface without transparency"},
804 "Use the alpha threshold to clip the visibility (binary visibility)"},
809 "Use noise to dither the binary visibility (works well with multi-samples)"},
814 "Render polygon transparent, depending on alpha channel of the texture"},
819 {
MA_BS_NONE,
"NONE", 0,
"None",
"Material will cast no shadow"},
820 {
MA_BS_SOLID,
"OPAQUE", 0,
"Opaque",
"Material will cast shadows without transparency"},
825 "Use the alpha threshold to clip the visibility (binary visibility)"},
830 "Use noise to dither the binary visibility and use filtering to reduce the noise"},
838 "Material data-block to define the appearance of geometric objects for rendering");
857 "A pixel is rendered only if its alpha value is above this threshold");
864 "Render multiple transparent layers "
865 "(may introduce transparency sorting problems)");
871 prop,
"Backface Culling",
"Use back face culling to hide the back side of faces");
877 prop,
"Screen Space Refraction",
"Use raytraced screen space refractions");
883 prop,
"Subsurface Translucency",
"Add translucency effect to subsurface");
891 "Approximate the thickness of the object to compute two refraction "
892 "events (0 is disabled)");
905 prop,
"Preview World",
"Use the current world background to light the preview render");
911 prop,
"Pass Index",
"Index number for the \"Material Index\" render pass");
938 prop,
"Grease Pencil Settings",
"Grease pencil color settings for material");
944 prop,
"Is Grease Pencil",
"True if this material has grease pencil data");
959 const char *structname,
960 const char *structname_slots)
976 parm =
RNA_def_pointer(func,
"mtex", structname,
"",
"The newly initialized mtex");
983 func,
"index", 0, 0, INT_MAX,
"Index",
"Slot index to initialize", 0, INT_MAX);
985 parm =
RNA_def_pointer(func,
"mtex", structname,
"",
"The newly initialized mtex");
991 parm =
RNA_def_int(func,
"index", 0, 0, INT_MAX,
"Index",
"Slot index to clear", 0, INT_MAX);
998 const char *activeget,
999 const char *activeset,
1000 const char *activeeditable,
1001 const char *structname,
1002 const char *structname_slots,
1013 "rna_iterator_array_next",
1014 "rna_iterator_array_end",
1015 "rna_iterator_array_dereference_get",
1021 prop,
"Textures",
"Texture slots defining the mapping and influence of textures");
1027 if (activeeditable) {
1048 srna,
"Texture Paint Slot",
"Slot that contains information about texture painting");
1053 prop,
"rna_TexPaintSlot_name_get",
"rna_TexPaintSlot_name_length",
NULL);
1066 "rna_TexPaintSlot_uv_layer_get",
1067 "rna_TexPaintSlot_uv_layer_length",
1068 "rna_TexPaintSlot_uv_layer_set");
1088 "rna_Material_texpaint_begin",
1089 "rna_iterator_array_next",
1090 "rna_iterator_array_end",
1091 "rna_iterator_array_dereference_get",
1098 prop,
"Texture Slot Images",
"Texture images used for texture painting");
1102 "rna_Material_texpaint_begin",
1103 "rna_iterator_array_next",
1104 "rna_iterator_array_end",
1105 "rna_iterator_array_get",
1112 prop,
"Texture Slots",
"Texture slots defining the mapping and influence of textures");
1117 prop,
"Active Paint Texture Index",
"Index of active texture paint slot");
void BKE_id_attributes_active_color_set(struct ID *id, struct CustomDataLayer *active_layer)
struct CustomDataLayer * BKE_id_attributes_color_find(const struct ID *id, const char *name)
struct Scene * CTX_data_scene(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
#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_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_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(1
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_COPY_ON_WRITE
@ GP_MATERIAL_GRADIENT_RADIAL
@ GP_MATERIAL_GRADIENT_LINEAR
@ GP_MATERIAL_FILL_STYLE_GRADIENT
@ GP_MATERIAL_FILL_STYLE_TEXTURE
@ GP_MATERIAL_FILL_STYLE_SOLID
@ GP_MATERIAL_STROKE_STYLE_SOLID
@ GP_MATERIAL_STROKE_STYLE_TEXTURE
struct TexPaintSlot TexPaintSlot
@ 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_FOLLOW_PATH
@ GP_MATERIAL_FOLLOW_FIXED
Object is a sort of wrapper for general info.
void ED_space_image_set(struct Main *bmain, struct SpaceImage *sima, 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.
#define RNA_ENUM_ITEM_SEPR
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
#define ND_SHADING_PREVIEW
return(oflags[bm->toolflag_index].f &oflag) !=0
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
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_index(const char *filename, FileIndexerEntries *entries, void *user_data)
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_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)
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_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
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_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_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)