Blender V5.0
texture.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cmath>
10#include <cstdio>
11#include <cstdlib>
12#include <cstring>
13#include <optional>
14
15#include "MEM_guardedalloc.h"
16
17#include "BLI_kdopbvh.hh"
18#include "BLI_listbase.h"
19#include "BLI_math_matrix.h"
20#include "BLI_math_rotation.h"
21#include "BLI_math_vector.h"
22#include "BLI_utildefines.h"
23
24#include "BLT_translation.hh"
25
26/* Allow using deprecated functionality for .blend file I/O. */
27#define DNA_DEPRECATED_ALLOW
28
30#include "DNA_brush_types.h"
31#include "DNA_color_types.h"
32#include "DNA_defaults.h"
33#include "DNA_linestyle_types.h"
34#include "DNA_material_types.h"
35#include "DNA_node_types.h"
36#include "DNA_particle_types.h"
37#include "DNA_texture_types.h"
38
39#include "BKE_brush.hh"
40#include "BKE_colorband.hh"
41#include "BKE_colortools.hh"
42#include "BKE_icons.h"
43#include "BKE_idtype.hh"
44#include "BKE_image.hh"
45#include "BKE_lib_id.hh"
46#include "BKE_lib_query.hh"
47#include "BKE_node_runtime.hh"
48#include "BKE_preview_image.hh"
49#include "BKE_texture.h"
50
51#include "NOD_texture.h"
52
53#include "RE_texture.h"
54
55#include "DRW_engine.hh"
56
57#include "BLO_read_write.hh"
58
69
70static void texture_copy_data(Main *bmain,
71 std::optional<Library *> owner_library,
72 ID *id_dst,
73 const ID *id_src,
74 const int flag)
75{
76 Tex *texture_dst = (Tex *)id_dst;
77 const Tex *texture_src = (const Tex *)id_src;
78
79 const bool is_localized = (flag & LIB_ID_CREATE_LOCAL) != 0;
80 /* Never handle user-count here for own sub-data. */
81 const int flag_subdata = flag | LIB_ID_CREATE_NO_USER_REFCOUNT;
82 /* Always need allocation of the embedded ID data. */
83 const int flag_embedded_id_data = flag_subdata & ~LIB_ID_CREATE_NO_ALLOCATE;
84
85 if (!BKE_texture_is_image_user(texture_src)) {
86 texture_dst->ima = nullptr;
87 }
88
89 if (texture_dst->coba) {
90 texture_dst->coba = static_cast<ColorBand *>(MEM_dupallocN(texture_dst->coba));
91 }
92 if (texture_src->nodetree) {
93 if (texture_src->nodetree->runtime->execdata) {
94 ntreeTexEndExecTree(texture_src->nodetree->runtime->execdata);
95 }
96
97 if (is_localized) {
98 texture_dst->nodetree = blender::bke::node_tree_localize(texture_src->nodetree,
99 &texture_dst->id);
100 }
101 else {
102 BKE_id_copy_in_lib(bmain,
103 owner_library,
104 &texture_src->nodetree->id,
105 &texture_dst->id,
106 reinterpret_cast<ID **>(&texture_dst->nodetree),
107 flag_embedded_id_data);
108 }
109 }
110
111 if ((flag & LIB_ID_COPY_NO_PREVIEW) == 0) {
112 BKE_previewimg_id_copy(&texture_dst->id, &texture_src->id);
113 }
114 else {
115 texture_dst->preview = nullptr;
116 }
117}
118
119static void texture_free_data(ID *id)
120{
121 Tex *texture = (Tex *)id;
122
123 /* is no lib link block, but texture extension */
124 if (texture->nodetree) {
126 MEM_freeN(texture->nodetree);
127 texture->nodetree = nullptr;
128 }
129
130 MEM_SAFE_FREE(texture->coba);
131
133 BKE_previewimg_free(&texture->preview);
134}
135
137{
138 Tex *texture = reinterpret_cast<Tex *>(id);
139
140 if (texture->nodetree) {
141 /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */
144 }
146}
147
148static void texture_blend_write(BlendWriter *writer, ID *id, const void *id_address)
149{
150 Tex *tex = (Tex *)id;
151
152 /* write LibData */
153 BLO_write_id_struct(writer, Tex, id_address, &tex->id);
154 BKE_id_blend_write(writer, &tex->id);
155
156 /* direct data */
157 if (tex->coba) {
158 BLO_write_struct(writer, ColorBand, tex->coba);
159 }
160
161 /* nodetree is integral part of texture, no libdata */
162 if (tex->nodetree) {
163 BLO_Write_IDBuffer temp_embedded_id_buffer{tex->nodetree->id, writer};
164 BLO_write_struct_at_address(writer, bNodeTree, tex->nodetree, temp_embedded_id_buffer.get());
166 writer, reinterpret_cast<bNodeTree *>(temp_embedded_id_buffer.get()));
167 }
168
170}
171
173{
174 Tex *tex = (Tex *)id;
175
176 BLO_read_struct(reader, ColorBand, &tex->coba);
177
178 BLO_read_struct(reader, PreviewImage, &tex->preview);
180
181 tex->iuser.scene = nullptr;
182
183 tex->runtime.last_update = 0;
184}
185
187 /*id_code*/ Tex::id_type,
188 /*id_filter*/ FILTER_ID_TE,
189 /*dependencies_id_types*/ FILTER_ID_IM | FILTER_ID_OB,
190 /*main_listbase_index*/ INDEX_ID_TE,
191 /*struct_size*/ sizeof(Tex),
192 /*name*/ "Texture",
193 /*name_plural*/ N_("textures"),
194 /*translation_context*/ BLT_I18NCONTEXT_ID_TEXTURE,
196 /*asset_type_info*/ nullptr,
197
198 /*init_data*/ texture_init_data,
199 /*copy_data*/ texture_copy_data,
200 /*free_data*/ texture_free_data,
201 /*make_local*/ nullptr,
202 /*foreach_id*/ texture_foreach_id,
203 /*foreach_cache*/ nullptr,
204 /*foreach_path*/ nullptr,
205 /*foreach_working_space_color*/ nullptr,
206 /*owner_pointer_get*/ nullptr,
207
208 /*blend_write*/ texture_blend_write,
209 /*blend_read_data*/ texture_blend_read_data,
210 /*blend_read_after_liblink*/ nullptr,
211
212 /*blend_read_undo_preserve*/ nullptr,
213
214 /*lib_override_apply_post*/ nullptr,
215};
216
222
223/* ****************** Mapping ******************* */
224
226{
227 TexMapping *texmap = MEM_callocN<TexMapping>("TexMapping");
228
229 BKE_texture_mapping_default(texmap, type);
230
231 return texmap;
232}
233
235{
236 *texmap = TexMapping{};
237
238 texmap->size[0] = texmap->size[1] = texmap->size[2] = 1.0f;
239 texmap->max[0] = texmap->max[1] = texmap->max[2] = 1.0f;
240 unit_m4(texmap->mat);
241
242 texmap->projx = PROJ_X;
243 texmap->projy = PROJ_Y;
244 texmap->projz = PROJ_Z;
245 texmap->mapping = MTEX_FLAT;
246 texmap->type = type;
247}
248
250{
251 float smat[4][4], rmat[4][4], tmat[4][4], proj[4][4], size[3];
252
253 if (texmap->projx == PROJ_X && texmap->projy == PROJ_Y && texmap->projz == PROJ_Z &&
254 is_zero_v3(texmap->loc) && is_zero_v3(texmap->rot) && is_one_v3(texmap->size))
255 {
256 unit_m4(texmap->mat);
257
258 texmap->flag |= TEXMAP_UNIT_MATRIX;
259 }
260 else {
261 /* axis projection */
262 zero_m4(proj);
263 proj[3][3] = 1.0f;
264
265 if (texmap->projx != PROJ_N) {
266 proj[texmap->projx - 1][0] = 1.0f;
267 }
268 if (texmap->projy != PROJ_N) {
269 proj[texmap->projy - 1][1] = 1.0f;
270 }
271 if (texmap->projz != PROJ_N) {
272 proj[texmap->projz - 1][2] = 1.0f;
273 }
274
275 /* scale */
276 copy_v3_v3(size, texmap->size);
277
279 /* keep matrix invertible */
280 if (fabsf(size[0]) < 1e-5f) {
281 size[0] = signf(size[0]) * 1e-5f;
282 }
283 if (fabsf(size[1]) < 1e-5f) {
284 size[1] = signf(size[1]) * 1e-5f;
285 }
286 if (fabsf(size[2]) < 1e-5f) {
287 size[2] = signf(size[2]) * 1e-5f;
288 }
289 }
290
291 size_to_mat4(smat, texmap->size);
292
293 /* rotation */
294 eul_to_mat4(rmat, texmap->rot);
295
296 /* translation */
297 unit_m4(tmat);
298 copy_v3_v3(tmat[3], texmap->loc);
299
300 if (texmap->type == TEXMAP_TYPE_TEXTURE) {
301 /* to transform a texture, the inverse transform needs
302 * to be applied to the texture coordinate */
303 mul_m4_series(texmap->mat, tmat, rmat, smat);
304 invert_m4(texmap->mat);
305 }
306 else if (texmap->type == TEXMAP_TYPE_POINT) {
307 /* forward transform */
308 mul_m4_series(texmap->mat, tmat, rmat, smat);
309 }
310 else if (texmap->type == TEXMAP_TYPE_VECTOR) {
311 /* no translation for vectors */
312 mul_m4_m4m4(texmap->mat, rmat, smat);
313 }
314 else if (texmap->type == TEXMAP_TYPE_NORMAL) {
315 /* no translation for normals, and inverse transpose */
316 mul_m4_m4m4(texmap->mat, rmat, smat);
317 invert_m4(texmap->mat);
318 transpose_m4(texmap->mat);
319 }
320
321 /* projection last */
322 mul_m4_m4m4(texmap->mat, texmap->mat, proj);
323
324 texmap->flag &= ~TEXMAP_UNIT_MATRIX;
325 }
326}
327
329{
330 ColorMapping *colormap = MEM_callocN<ColorMapping>("ColorMapping");
331
333
334 return colormap;
335}
336
338{
339 *colormap = ColorMapping{};
340
341 BKE_colorband_init(&colormap->coba, true);
342
343 colormap->bright = 1.0;
344 colormap->contrast = 1.0;
345 colormap->saturation = 1.0;
346
347 colormap->blend_color[0] = 0.8f;
348 colormap->blend_color[1] = 0.8f;
349 colormap->blend_color[2] = 0.8f;
350 colormap->blend_type = MA_RAMP_BLEND;
351 colormap->blend_factor = 0.0f;
352}
353
354/* ******************* TEX ************************ */
355
356/* ------------------------------------------------------------------------- */
357
359{
360 texture_init_data(&tex->id);
361}
362
363void BKE_texture_type_set(Tex *tex, int type)
364{
365 tex->type = type;
366}
367
368/* ------------------------------------------------------------------------- */
369
370Tex *BKE_texture_add(Main *bmain, const char *name)
371{
372 Tex *tex;
373
374 tex = BKE_id_new<Tex>(bmain, name);
375
376 return tex;
377}
378
379/* ------------------------------------------------------------------------- */
380
382{
383 *mtex = blender::dna::shallow_copy(*DNA_struct_default_get(MTex));
384}
385
386/* ------------------------------------------------------------------------- */
387
389{
390 MTex *mtex;
391
392 mtex = MEM_callocN<MTex>("BKE_texture_mtex_add");
393
395
396 return mtex;
397}
398
400{
401 MTex **mtex_ar;
402 short act;
403
404 give_active_mtex(id, &mtex_ar, &act);
405
406 if (mtex_ar == nullptr) {
407 return nullptr;
408 }
409
410 if (slot == -1) {
411 /* find first free */
412 int i;
413 for (i = 0; i < MAX_MTEX; i++) {
414 if (!mtex_ar[i]) {
415 slot = i;
416 break;
417 }
418 }
419 if (slot == -1) {
420 return nullptr;
421 }
422 }
423 else {
424 /* make sure slot is valid */
425 if (slot < 0 || slot >= MAX_MTEX) {
426 return nullptr;
427 }
428 }
429
430 if (mtex_ar[slot]) {
431 id_us_min((ID *)mtex_ar[slot]->tex);
432 MEM_freeN(mtex_ar[slot]);
433 mtex_ar[slot] = nullptr;
434 }
435
436 mtex_ar[slot] = BKE_texture_mtex_add();
437
438 return mtex_ar[slot];
439}
440
441/* ------------------------------------------------------------------------- */
442
444{
445 MTex *mtex = nullptr;
446 Tex *tex = nullptr;
447
448 if (linestyle) {
449 mtex = linestyle->mtex[int(linestyle->texact)];
450 if (mtex) {
451 tex = mtex->tex;
452 }
453 }
454
455 return tex;
456}
457
459{
460 int act = linestyle->texact;
461
462 if (linestyle->mtex[act] && linestyle->mtex[act]->tex) {
463 id_us_min(&linestyle->mtex[act]->tex->id);
464 }
465
466 if (newtex) {
467 if (!linestyle->mtex[act]) {
468 linestyle->mtex[act] = BKE_texture_mtex_add();
469 linestyle->mtex[act]->texco = TEXCO_STROKE;
470 }
471
472 linestyle->mtex[act]->tex = newtex;
473 id_us_plus(&newtex->id);
474 }
475 else {
476 MEM_SAFE_FREE(linestyle->mtex[act]);
477 }
478}
479
480bool give_active_mtex(ID *id, MTex ***mtex_ar, short *act)
481{
482 switch (GS(id->name)) {
483 case ID_LS:
484 *mtex_ar = ((FreestyleLineStyle *)id)->mtex;
485 if (act) {
486 *act = (((FreestyleLineStyle *)id)->texact);
487 }
488 break;
489 case ID_PA:
490 *mtex_ar = ((ParticleSettings *)id)->mtex;
491 if (act) {
492 *act = (((ParticleSettings *)id)->texact);
493 }
494 break;
495 default:
496 *mtex_ar = nullptr;
497 if (act) {
498 *act = 0;
499 }
500 return false;
501 }
502
503 return true;
504}
505
506void set_active_mtex(ID *id, short act)
507{
508 if (act < 0) {
509 act = 0;
510 }
511 else if (act >= MAX_MTEX) {
512 act = MAX_MTEX - 1;
513 }
514
515 switch (GS(id->name)) {
516 case ID_LS:
517 ((FreestyleLineStyle *)id)->texact = act;
518 break;
519 case ID_PA:
520 ((ParticleSettings *)id)->texact = act;
521 break;
522 default:
523 break;
524 }
525}
526
528{
529 return br->mtex.tex;
530}
531
533{
534 if (br->mtex.tex) {
535 id_us_min(&br->mtex.tex->id);
536 }
537
538 if (newtex) {
539 br->mtex.tex = newtex;
540 id_us_plus(&newtex->id);
541 }
543}
544
546{
547 MTex *mtex = nullptr;
548 Tex *tex = nullptr;
549
550 if (!part) {
551 return nullptr;
552 }
553
554 mtex = part->mtex[int(part->texact)];
555 if (mtex) {
556 tex = mtex->tex;
557 }
558
559 return tex;
560}
561
563{
564 int act = part->texact;
565
566 if (part->mtex[act] && part->mtex[act]->tex) {
567 id_us_min(&part->mtex[act]->tex->id);
568 }
569
570 if (newtex) {
571 if (!part->mtex[act]) {
572 part->mtex[act] = BKE_texture_mtex_add();
573 part->mtex[act]->texco = TEXCO_ORCO;
574 part->mtex[act]->blendtype = MTEX_MUL;
575 }
576
577 part->mtex[act]->tex = newtex;
578 id_us_plus(&newtex->id);
579 }
580 else {
581 MEM_SAFE_FREE(part->mtex[act]);
582 }
583}
584
585/* ------------------------------------------------------------------------- */
586
588{
589 switch (tex->type) {
590 case TEX_IMAGE: {
591 return true;
592 }
593 }
594
595 return false;
596}
597
599{
600 if (texture->ima && BKE_image_is_animated(texture->ima)) {
601 return true;
602 }
603 if (texture->adt) {
604 /* assume anything in adt means the texture is animated */
605 return true;
606 }
607 if (texture->type == TEX_NOISE) {
608 /* noise always varies with time */
609 return true;
610 }
611 return false;
612}
613
614/* ------------------------------------------------------------------------- */
615
617 const float *tex_co,
618 TexResult *texres,
619 ImagePool *pool,
620 bool use_color_management)
621{
622 /* no node textures for now */
623 const int result_type = multitex_ext_safe(
624 texture, tex_co, texres, pool, use_color_management, false);
625
626 /* if the texture gave an RGB value, we assume it didn't give a valid
627 * intensity, since this is in the context of modifiers don't use perceptual color conversion.
628 * if the texture didn't give an RGB value, copy the intensity across
629 */
630 if (result_type & TEX_RGB) {
631 texres->tin = (1.0f / 3.0f) * (texres->trgba[0] + texres->trgba[1] + texres->trgba[2]);
632 }
633 else {
634 copy_v3_fl(texres->trgba, texres->tin);
635 }
636}
637
639 const float *tex_co,
640 TexResult *texres,
641 bool use_color_management)
642{
643 BKE_texture_get_value_ex(texture, tex_co, texres, nullptr, use_color_management);
644}
645
647{
648 for (bNode *node : ntree->all_nodes()) {
649 if (node->type_legacy == SH_NODE_TEX_IMAGE && node->id != nullptr) {
650 Image *image = (Image *)node->id;
651 BKE_image_pool_acquire_ibuf(image, &texture->iuser, pool);
652 }
653 else if (node->is_group() && node->id != nullptr) {
654 /* TODO(sergey): Do we need to control recursion here? */
655 bNodeTree *nested_tree = (bNodeTree *)node->id;
657 }
658 }
659}
660
662{
663 if (texture->nodetree != nullptr) {
665 }
666 else {
667 if (texture->type == TEX_IMAGE) {
668 if (texture->ima != nullptr) {
669 BKE_image_pool_acquire_ibuf(texture->ima, &texture->iuser, pool);
670 }
671 }
672 }
673}
void BKE_brush_tag_unsaved_changes(Brush *brush)
Definition brush.cc:764
void BKE_colorband_init(ColorBand *coba, bool rangetype)
Definition colorband.cc:23
void BKE_icon_id_delete(struct ID *id)
Definition icons.cc:437
IDTypeInfo IDType_ID_TE
Definition texture.cc:186
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
Definition BKE_idtype.hh:47
ImBuf * BKE_image_pool_acquire_ibuf(Image *ima, ImageUser *iuser, ImagePool *pool)
void BKE_imageuser_default(ImageUser *iuser)
bool BKE_image_is_animated(Image *image)
struct ID * BKE_id_copy_in_lib(Main *bmain, std::optional< Library * > owner_library, const ID *id, std::optional< const ID * > new_owner_id, ID **new_id_p, int flag)
Definition lib_id.cc:675
void id_us_plus(ID *id)
Definition lib_id.cc:358
void * BKE_id_new(Main *bmain, short type, const char *name)
Definition lib_id.cc:1514
@ LIB_ID_CREATE_NO_ALLOCATE
@ LIB_ID_COPY_NO_PREVIEW
@ LIB_ID_CREATE_LOCAL
@ LIB_ID_CREATE_NO_USER_REFCOUNT
void id_us_min(ID *id)
Definition lib_id.cc:366
void BKE_id_blend_write(BlendWriter *writer, ID *id)
Definition lib_id.cc:2631
#define BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data_, func_call_)
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
void BKE_library_foreach_ID_embedded(LibraryForeachIDData *data, ID **id_pp)
Definition lib_query.cc:172
@ IDWALK_CB_USER
@ IDWALK_CB_NOP
#define SH_NODE_TEX_IMAGE
void BKE_previewimg_blend_write(BlendWriter *writer, const PreviewImage *prv)
void BKE_previewimg_free(PreviewImage **prv)
void BKE_previewimg_blend_read(BlendDataReader *reader, PreviewImage *prv)
void BKE_previewimg_id_copy(ID *new_id, const ID *old_id)
#define BLI_assert(a)
Definition BLI_assert.h:46
MINLINE float signf(float f)
void zero_m4(float m[4][4])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void size_to_mat4(float R[4][4], const float size[3])
#define mul_m4_series(...)
bool invert_m4(float mat[4][4])
void transpose_m4(float R[4][4])
void unit_m4(float m[4][4])
void eul_to_mat4(float mat[4][4], const float eul[3])
MINLINE bool is_one_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE bool is_zero_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_fl(float r[3], float f)
#define ELEM(...)
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member)
#define MEMCPY_STRUCT_AFTER(struct_dst, struct_src, member)
#define BLO_write_id_struct(writer, struct_name, id_address, id)
#define BLO_write_struct(writer, struct_name, data_ptr)
#define BLO_read_struct(reader, struct_name, ptr_p)
#define BLO_write_struct_at_address(writer, struct_name, address, data_ptr)
#define BLT_I18NCONTEXT_ID_TEXTURE
#define FILTER_ID_OB
Definition DNA_ID.h:1214
#define FILTER_ID_TE
Definition DNA_ID.h:1220
@ INDEX_ID_TE
Definition DNA_ID.h:1311
#define FILTER_ID_IM
Definition DNA_ID.h:1204
@ ID_LS
@ ID_PA
#define DNA_struct_default_get(struct_name)
#define TEXCO_STROKE
@ TEXCO_ORCO
@ MA_RAMP_BLEND
@ MTEX_MUL
@ TEX_RGB
@ TEXMAP_TYPE_NORMAL
@ TEXMAP_TYPE_POINT
@ TEXMAP_TYPE_TEXTURE
@ TEXMAP_TYPE_VECTOR
@ TEXMAP_UNIT_MATRIX
@ TEX_NOISE
@ TEX_IMAGE
@ MTEX_FLAT
Read Guarded memory(de)allocation.
#define MEM_SAFE_FREE(v)
void ntreeTexEndExecTree(struct bNodeTreeExec *exec)
#define MAX_MTEX
Definition Stroke.h:31
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
#define GS(x)
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
void * MEM_callocN(size_t len, const char *str)
Definition mallocn.cc:118
void * MEM_dupallocN(const void *vmemh)
Definition mallocn.cc:143
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
void node_tree_blend_write(BlendWriter *writer, bNodeTree *ntree)
Definition node.cc:1140
bNodeTree * node_tree_localize(bNodeTree *ntree, std::optional< ID * > new_owner_id)
Definition node.cc:4586
void node_tree_free_embedded_tree(bNodeTree *ntree)
Definition node.cc:4462
const char * name
#define fabsf
struct MTex mtex
struct ColorBand coba
struct MTex * mtex[18]
Definition DNA_ID.h:414
char name[258]
Definition DNA_ID.h:432
struct Scene * scene
short texco
short blendtype
struct Object * object
struct Tex * tex
struct MTex * mtex[18]
float mat[4][4]
float tin
Definition RE_texture.h:59
float trgba[4]
Definition RE_texture.h:60
uint64_t last_update
struct PreviewImage * preview
Tex_Runtime runtime
struct ImageUser iuser
struct ColorBand * coba
struct bNodeTree * nodetree
struct Image * ima
bNodeTreeRuntimeHandle * runtime
i
Definition text_draw.cc:230
static void texture_copy_data(Main *bmain, std::optional< Library * > owner_library, ID *id_dst, const ID *id_src, const int flag)
Definition texture.cc:70
Tex * BKE_texture_add(Main *bmain, const char *name)
Definition texture.cc:370
void BKE_texture_type_set(Tex *tex, int type)
Definition texture.cc:363
void BKE_texture_mapping_default(TexMapping *texmap, int type)
Definition texture.cc:234
Tex * give_current_particle_texture(ParticleSettings *part)
Definition texture.cc:545
void set_current_particle_texture(ParticleSettings *part, Tex *newtex)
Definition texture.cc:562
static void texture_foreach_id(ID *id, LibraryForeachIDData *data)
Definition texture.cc:136
static void texture_init_data(ID *id)
Definition texture.cc:59
void set_current_brush_texture(Brush *br, Tex *newtex)
Definition texture.cc:532
void BKE_texture_colormapping_default(ColorMapping *colormap)
Definition texture.cc:337
MTex * BKE_texture_mtex_add_id(ID *id, int slot)
Definition texture.cc:399
Tex * give_current_linestyle_texture(FreestyleLineStyle *linestyle)
Definition texture.cc:443
void BKE_texture_mtex_foreach_id(LibraryForeachIDData *data, MTex *mtex)
Definition texture.cc:217
bool BKE_texture_dependsOnTime(const Tex *texture)
Definition texture.cc:598
void BKE_texture_mapping_init(TexMapping *texmap)
Definition texture.cc:249
void set_active_mtex(ID *id, short act)
Definition texture.cc:506
void set_current_linestyle_texture(FreestyleLineStyle *linestyle, Tex *newtex)
Definition texture.cc:458
bool give_active_mtex(ID *id, MTex ***mtex_ar, short *act)
Definition texture.cc:480
MTex * BKE_texture_mtex_add()
Definition texture.cc:388
static void texture_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Definition texture.cc:148
void BKE_texture_mtex_default(MTex *mtex)
Definition texture.cc:381
static void texture_blend_read_data(BlendDataReader *reader, ID *id)
Definition texture.cc:172
ColorMapping * BKE_texture_colormapping_add()
Definition texture.cc:328
void BKE_texture_get_value_ex(Tex *texture, const float *tex_co, TexResult *texres, ImagePool *pool, bool use_color_management)
Definition texture.cc:616
static void texture_free_data(ID *id)
Definition texture.cc:119
void BKE_texture_fetch_images_for_pool(Tex *texture, ImagePool *pool)
Definition texture.cc:661
void BKE_texture_default(Tex *tex)
Definition texture.cc:358
Tex * give_current_brush_texture(Brush *br)
Definition texture.cc:527
static void texture_nodes_fetch_images_for_pool(Tex *texture, bNodeTree *ntree, ImagePool *pool)
Definition texture.cc:646
bool BKE_texture_is_image_user(const Tex *tex)
Definition texture.cc:587
void BKE_texture_get_value(Tex *texture, const float *tex_co, TexResult *texres, bool use_color_management)
Definition texture.cc:638
TexMapping * BKE_texture_mapping_add(int type)
Definition texture.cc:225
int multitex_ext_safe(Tex *tex, const float texvec[3], TexResult *texres, ImagePool *pool, bool scene_color_manage, const bool skip_load_image)
#define N_(msgid)
uint8_t flag
Definition wm_window.cc:145