29 {0,
"NONE", 0,
"None",
""},
30 {
TEX_BLEND,
"BLEND", ICON_TEXTURE,
"Blend",
"Procedural - create a ramp texture"},
35 "Procedural - create a cloud-like fractal noise texture"},
40 "Procedural - noise texture distorted by two noise algorithms"},
45 "Allow for images or movies to be used as textures"},
50 "Procedural - color texture based on trigonometric functions"},
55 "Procedural - marble-like noise texture with wave generated bands"},
60 "Procedural - highly flexible fractal noise texture"},
65 "Procedural - random noise, gives a different result every time, for every frame, for every "
67 {
TEX_STUCCI,
"STUCCI", ICON_TEXTURE,
"Stucci",
"Procedural - create a fractal noise texture"},
72 "Procedural - create cell-like patterns based on Worley noise"},
77 "Procedural - wave generated bands or rings, with optional noise"},
78 {0,
nullptr, 0,
nullptr,
nullptr},
86 {
MTEX_MUL,
"MULTIPLY", 0,
"Multiply",
""},
96 {
MTEX_DIFF,
"DIFFERENCE", 0,
"Difference",
""},
97 {
MTEX_SUB,
"SUBTRACT", 0,
"Subtract",
""},
98 {
MTEX_DIV,
"DIVIDE", 0,
"Divide",
""},
104 {0,
nullptr, 0,
nullptr,
nullptr},
112# include <fmt/format.h>
143 Tex *tex =
static_cast<Tex *
>(ptr->data);
147 return RNA_BlendTexture;
149 return RNA_CloudsTexture;
151 return RNA_DistortedNoiseTexture;
153 return RNA_ImageTexture;
155 return RNA_MagicTexture;
157 return RNA_MarbleTexture;
159 return RNA_MusgraveTexture;
161 return RNA_NoiseTexture;
163 return RNA_StucciTexture;
165 return RNA_VoronoiTexture;
167 return RNA_WoodTexture;
175 ID *
id = ptr->owner_id;
178 Tex *tex = id_cast<Tex *>(ptr->owner_id);
186 bNodeTree *ntree = id_cast<bNodeTree *>(ptr->owner_id);
193 ID *
id = ptr->owner_id;
198 bNodeTree *ntree = id_cast<bNodeTree *>(ptr->owner_id);
204 if (
node->storage == texmap) {
210 rna_Texture_update(bmain, scene, ptr);
221 Tex *tex = id_cast<Tex *>(ptr->owner_id);
228static void rna_Texture_type_set(
PointerRNA *ptr,
int value)
230 Tex *tex =
static_cast<Tex *
>(ptr->data);
243 ID *
id = ptr->owner_id;
247 switch (
GS(
id->name)) {
261 MTex *mtex =
static_cast<MTex *
>(ptr->data);
271 MTex *mtex =
static_cast<MTex *
>(ptr->data);
292 MTex *mtex =
static_cast<MTex *
>(ptr->data);
299 if (
GS(ptr->owner_id->name) ==
ID_BR) {
300 return "texture_slot";
314 return fmt::format(
"texture_slots[{}]",
index);
322 char name_esc[(
sizeof(mtex->tex->id.name) - 2) * 2];
324 BLI_str_escape(name_esc, mtex->tex->id.name + 2,
sizeof(name_esc));
325 return fmt::format(
"texture_slots[\"{}\"]", name_esc);
328 return "texture_slots[0]";
331static int rna_TextureSlot_name_length(
PointerRNA *ptr)
333 MTex *mtex =
static_cast<MTex *
>(ptr->data);
336 return strlen(mtex->tex->id.name + 2);
342static void rna_TextureSlot_name_get(
PointerRNA *ptr,
char *value)
344 MTex *mtex =
static_cast<MTex *
>(ptr->data);
347 strcpy(value, mtex->tex->id.name + 2);
354static int rna_TextureSlot_output_node_get(
PointerRNA *ptr)
356 MTex *mtex =
static_cast<MTex *
>(ptr->data);
357 Tex *tex = mtex->tex;
358 int cur = mtex->which_output;
366 if (cur ==
node->custom1) {
374 mtex->which_output = 0;
383 MTex *mtex =
static_cast<MTex *
>(ptr->data);
384 Tex *tex = mtex->tex;
395 tmp.
name =
"Not Specified";
396 tmp.identifier =
"NOT_SPECIFIED";
401 tmp.value =
node->custom1;
403 tmp.identifier = tmp.name;
416static void rna_Texture_use_color_ramp_set(
PointerRNA *ptr,
bool value)
418 Tex *tex =
static_cast<Tex *
>(ptr->data);
434 Tex *tex =
static_cast<Tex *
>(ptr->data);
436 if (tex->use_nodes) {
439 if (tex->nodetree ==
nullptr) {
456 {
MTEX_FLAT,
"FLAT", 0,
"Flat",
"Map X and Y coordinates directly"},
457 {
MTEX_CUBE,
"CUBE", 0,
"Cube",
"Map using the normal vector"},
458 {
MTEX_TUBE,
"TUBE", 0,
"Tube",
"Map with Z as central axis"},
459 {
MTEX_SPHERE,
"SPHERE", 0,
"Sphere",
"Map with Z as central axis"},
460 {0,
nullptr, 0,
nullptr,
nullptr},
464 {0,
"NONE", 0,
"None",
""},
465 {1,
"X", 0,
"X",
""},
466 {2,
"Y", 0,
"Y",
""},
467 {3,
"Z", 0,
"Z",
""},
468 {0,
nullptr, 0,
nullptr,
nullptr},
609 srna,
"Texture Slot",
"Texture slot defining the mapping and influence of a texture");
623 prop,
"rna_TextureSlot_name_get",
"rna_TextureSlot_name_length",
nullptr);
636 prop,
"Offset",
"Fine tune of the texture mapping X, Y and Z locations");
653 "Default color for textures that don't return RGB or when RGB to intensity is enabled");
671 "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard");
679 prop,
"rna_TextureSlot_output_node_get",
nullptr,
"rna_TextureSlot_output_node_itemf");
681 prop,
"Output Node",
"Which output node to use, for node-based textures");
701 "Noise algorithm - Blender original: Smooth interpolated noise"},
706 "Noise algorithm - Original Perlin: Smooth interpolated noise"},
711 "Noise algorithm - Improved Perlin: Smooth interpolated noise"},
716 "Noise algorithm - Voronoi F1: Returns distance to the closest feature point"},
721 "Noise algorithm - Voronoi F2: Returns distance to the 2nd closest feature point"},
726 "Noise algorithm - Voronoi F3: Returns distance to the 3rd closest feature point"},
731 "Noise algorithm - Voronoi F4: Returns distance to the 4th closest feature point"},
732 {
TEX_VORONOI_F2F1,
"VORONOI_F2_F1", 0,
"Voronoi F2-F1",
"Noise algorithm - Voronoi F1-F2"},
737 "Noise algorithm - Voronoi Crackle: Voronoi tessellation with sharp edges"},
742 "Noise algorithm - Cell Noise: Square cell tessellation"},
743 {0,
nullptr, 0,
nullptr,
nullptr},
747 {
TEX_NOISESOFT,
"SOFT_NOISE", 0,
"Soft",
"Generate soft noise (smooth transitions)"},
748 {
TEX_NOISEPERL,
"HARD_NOISE", 0,
"Hard",
"Generate hard noise (sharp transitions)"},
749 {0,
nullptr, 0,
nullptr,
nullptr},
760 {0,
nullptr, 0,
nullptr,
nullptr},
797 prop,
"Color",
"Determine whether Noise returns grayscale or RGB values");
813 {
TEX_BAND,
"BANDS", 0,
"Bands",
"Use standard wood texture in bands"},
814 {
TEX_RING,
"RINGS", 0,
"Rings",
"Use wood texture in rings"},
815 {
TEX_BANDNOISE,
"BANDNOISE", 0,
"Band Noise",
"Add noise to standard wood"},
816 {
TEX_RINGNOISE,
"RINGNOISE", 0,
"Ring Noise",
"Add noise to rings"},
817 {0,
nullptr, 0,
nullptr,
nullptr},
821 {
TEX_SIN,
"SIN", 0,
"Sine",
"Use a sine wave to produce bands"},
822 {
TEX_SAW,
"SAW", 0,
"Saw",
"Use a saw wave to produce bands"},
823 {
TEX_TRI,
"TRI", 0,
"Tri",
"Use a triangle wave to produce bands"},
824 {0,
nullptr, 0,
nullptr,
nullptr},
883 {
TEX_SOFT,
"SOFT", 0,
"Soft",
"Use soft marble"},
884 {
TEX_SHARP,
"SHARP", 0,
"Sharp",
"Use more clearly defined marble"},
885 {
TEX_SHARPER,
"SHARPER", 0,
"Sharper",
"Use very clearly defined marble"},
886 {0,
nullptr, 0,
nullptr,
nullptr},
890 {
TEX_SIN,
"SIN", 0,
"Sin",
"Use a sine wave to produce bands"},
891 {
TEX_SAW,
"SAW", 0,
"Saw",
"Use a saw wave to produce bands"},
892 {
TEX_TRI,
"TRI", 0,
"Tri",
"Use a triangle wave to produce bands"},
893 {0,
nullptr, 0,
nullptr,
nullptr},
983 {
TEX_LIN,
"LINEAR", 0,
"Linear",
"Create a linear progression"},
984 {
TEX_QUAD,
"QUADRATIC", 0,
"Quadratic",
"Create a quadratic progression"},
985 {
TEX_EASE,
"EASING", 0,
"Easing",
"Create a progression easing from one step to the next"},
986 {
TEX_DIAG,
"DIAGONAL", 0,
"Diagonal",
"Create a diagonal progression"},
987 {
TEX_SPHERE,
"SPHERICAL", 0,
"Spherical",
"Create a spherical progression"},
992 "Create a quadratic progression in the shape of a sphere"},
993 {
TEX_RAD,
"RADIAL", 0,
"Radial",
"Create a radial progression"},
994 {0,
nullptr, 0,
nullptr,
nullptr},
998 {0,
"HORIZONTAL", 0,
"Horizontal",
"No flipping"},
999 {
TEX_FLIPBLEND,
"VERTICAL", 0,
"Vertical",
"Flip the texture's X and Y axis"},
1000 {0,
nullptr, 0,
nullptr,
nullptr},
1026 {
TEX_PLASTIC,
"PLASTIC", 0,
"Plastic",
"Use standard stucci"},
1027 {
TEX_WALLIN,
"WALL_IN", 0,
"Wall In",
"Create Dimples"},
1028 {
TEX_WALLOUT,
"WALL_OUT", 0,
"Wall Out",
"Create Ridges"},
1029 {0,
nullptr, 0,
nullptr,
nullptr},
1085 {
TEX_EXTEND,
"EXTEND", 0,
"Extend",
"Extend by repeating edge pixels of the image"},
1086 {
TEX_CLIP,
"CLIP", 0,
"Clip",
"Clip to image size and set exterior pixels as transparent"},
1091 "Clip to cubic-shaped area around the image and set exterior pixels as transparent"},
1092 {
TEX_REPEAT,
"REPEAT", 0,
"Repeat",
"Cause the image to repeat horizontally and vertically"},
1093 {
TEX_CHECKER,
"CHECKER", 0,
"Checker",
"Cause the image to repeat in checker board pattern"},
1094 {0,
nullptr, 0,
nullptr,
nullptr},
1121 prop,
"Calculate Alpha",
"Calculate an alpha channel based on RGB values in the image");
1135 prop,
"Extension",
"How the image is extrapolated past its original bounds");
1228 prop,
nullptr,
nullptr,
nullptr,
"rna_Image_no_renderresult_or_viewer_poll");
1235 "Parameters defining which layer, pass and frame of the image is displayed");
1251 {
TEX_MFRACTAL,
"MULTIFRACTAL", 0,
"Multifractal",
"Use Perlin noise as a basis"},
1253 "RIDGED_MULTIFRACTAL",
1255 "Ridged Multifractal",
1256 "Use Perlin noise with inflection as a basis"},
1258 "HYBRID_MULTIFRACTAL",
1260 "Hybrid Multifractal",
1261 "Use Perlin noise as a basis, with extended controls"},
1262 {
TEX_FBM,
"FBM", 0,
"fBM",
"Fractal Brownian Motion, use Brownian noise as a basis"},
1263 {
TEX_HTERRAIN,
"HETERO_TERRAIN", 0,
"Hetero Terrain",
"Similar to multifractal"},
1264 {0,
nullptr, 0,
nullptr,
nullptr},
1345 {
TEX_DISTANCE,
"DISTANCE", 0,
"Actual Distance",
"sqrt(x*x+y*y+z*z)"},
1351 "The length of the distance in axial directions"},
1352 {
TEX_CHEBYCHEV,
"CHEBYCHEV", 0,
"Chebychev",
"The length of the longest Axial journey"},
1353 {
TEX_MINKOVSKY_HALF,
"MINKOVSKY_HALF", 0,
"Minkowski 1/2",
"Set Minkowski variable to 0.5"},
1354 {
TEX_MINKOVSKY_FOUR,
"MINKOVSKY_FOUR", 0,
"Minkowski 4",
"Set Minkowski variable to 4"},
1359 "Use the Minkowski function to calculate distance "
1360 "(exponent value determines the shape of the boundaries)"},
1361 {0,
nullptr, 0,
nullptr,
nullptr},
1366 {
TEX_INTENSITY,
"INTENSITY", 0,
"Intensity",
"Only calculate intensity"},
1367 {
TEX_COL1,
"POSITION", 0,
"Position",
"Color cells by position"},
1371 "Position and Outline",
1372 "Use position plus an outline based on F2-F1"},
1374 "POSITION_OUTLINE_INTENSITY",
1376 "Position, Outline, and Intensity",
1377 "Multiply position and outline by intensity"},
1378 {0,
nullptr, 0,
nullptr,
nullptr},
1421 "Algorithm used to calculate distance of sample points to feature points");
1499 srna,
"Texture",
"Texture data-block used by materials, lights, worlds and brushes");
1515 "Set negative texture RGB and intensity values to zero, for some uses "
1516 "like displacement this option can be disabled to get the full range");
1524 "Map the texture intensity to the color ramp. "
1525 "Note that the alpha value is used for image textures, "
1526 "enable \"Calculate Alpha\" for images without an alpha channel.");
#define BLT_I18NCONTEXT_ID_IMAGE
#define BLT_I18NCONTEXT_ID_TEXTURE
#define BLT_I18NCONTEXT_COLOR
Read Blender memory allocation and freeing.
#define RNA_ENUM_ITEM_SEPR
#define RNA_TRANSLATION_PREC_DEFAULT
void invalidate_overlay_tex(Scene &scene, const Tex *tex)
void WM_main_add_notifier(uint type, void *reference)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
static void rna_def_texture_marble(BlenderRNA *brna)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
static void rna_def_texture_magic(BlenderRNA *brna)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void ED_node_texture_default(const bContext *C, Tex *tex)
void RNA_api_texture(StructRNA *srna)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
PointerRNA RNA_id_pointer_create(ID *id)
int RNA_property_collection_lookup_index(PointerRNA *ptr, PropertyRNA *prop, const PointerRNA *t_ptr)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
static void rna_def_mtex(BlenderRNA *brna)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
static void rna_def_texture_stucci(BlenderRNA *brna)
static void rna_def_filter_common(StructRNA *srna)
ColorBand * BKE_colorband_add(bool rangetype)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void BKE_texture_mapping_init(struct TexMapping *texmap)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static void rna_def_texture_image(BlenderRNA *brna)
const EnumPropertyItem rna_enum_mapping_type_items[]
static void rna_def_texture_distorted_noise(BlenderRNA *brna)
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)
std::optional< std::string > rna_TextureSlot_path(const PointerRNA *ptr)
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
void rna_def_animdata_common(StructRNA *srna)
void BKE_brush_tag_unsaved_changes(Brush *brush)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
static void rna_def_texmapping(BlenderRNA *brna)
void DEG_id_tag_update(ID *id, unsigned int flags)
static void rna_def_texture_blend(BlenderRNA *brna)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
static void rna_def_texture_voronoi(BlenderRNA *brna)
char char size_t BLI_str_escape(char *__restrict dst, StringRef src, size_t dst_maxncpy) ATTR_NONNULL(1)
void BKE_main_ensure_invariants(Main &bmain, std::optional< Span< ID * > > modified_ids=std::nullopt)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_texture(BlenderRNA *brna)
static const EnumPropertyItem prop_noise_basis_items[]
const EnumPropertyItem rna_enum_texture_type_items[]
static void rna_def_texture_musgrave(BlenderRNA *brna)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
static void rna_def_texture_noise(BlenderRNA *brna)
static void rna_def_texture(BlenderRNA *brna)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void BKE_texture_type_set(struct Tex *tex, eTex_Type type)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
static const EnumPropertyItem prop_image_extension[]
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
static const EnumPropertyItem blend_type_items[]
static const EnumPropertyItem prop_noise_type[]
void BKE_ntree_update_tag_node_property(bNodeTree *ntree, bNode *node)
Main * CTX_data_main(const bContext *C)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
static void rna_def_texture_clouds(BlenderRNA *brna)
ID_Type GS(const char *name)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static void rna_def_colormapping(BlenderRNA *brna)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
void DEG_relations_tag_update(Main *bmain)
Scene * CTX_data_scene(const bContext *C)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop, const bool allow_replace)
void rna_TextureSlot_update(bContext *C, PointerRNA *ptr)
void RNA_def_property_array(PropertyRNA *prop, int length)
static void rna_def_texture_wood(BlenderRNA *brna)