27#define DNA_DEPRECATED_ALLOW
71 std::optional<Library *> owner_library,
76 Tex *texture_dst = (
Tex *)id_dst;
77 const Tex *texture_src = (
const Tex *)id_src;
86 texture_dst->
ima =
nullptr;
89 if (texture_dst->
coba) {
106 reinterpret_cast<ID **
>(&texture_dst->
nodetree),
107 flag_embedded_id_data);
115 texture_dst->
preview =
nullptr;
166 writer,
reinterpret_cast<bNodeTree *
>(temp_embedded_id_buffer.
get()));
238 texmap->
size[0] = texmap->
size[1] = texmap->
size[2] = 1.0f;
239 texmap->
max[0] = texmap->
max[1] = texmap->
max[2] = 1.0f;
251 float smat[4][4], rmat[4][4], tmat[4][4], proj[4][4],
size[3];
266 proj[texmap->
projx - 1][0] = 1.0f;
269 proj[texmap->
projy - 1][1] = 1.0f;
272 proj[texmap->
projz - 1][2] = 1.0f;
406 if (mtex_ar ==
nullptr) {
433 mtex_ar[slot] =
nullptr;
438 return mtex_ar[slot];
445 MTex *mtex =
nullptr;
449 mtex = linestyle->
mtex[int(linestyle->
texact)];
460 int act = linestyle->
texact;
462 if (linestyle->
mtex[act] && linestyle->
mtex[act]->
tex) {
467 if (!linestyle->
mtex[act]) {
472 linestyle->
mtex[act]->
tex = newtex;
547 MTex *mtex =
nullptr;
571 if (!part->
mtex[act]) {
620 bool use_color_management)
624 texture, tex_co, texres, pool, use_color_management,
false);
631 texres->
tin = (1.0f / 3.0f) * (texres->
trgba[0] + texres->
trgba[1] + texres->
trgba[2]);
641 bool use_color_management)
648 for (
bNode *node : ntree->all_nodes()) {
653 else if (node->is_group() && node->id !=
nullptr) {
663 if (
texture->nodetree !=
nullptr) {
void BKE_brush_tag_unsaved_changes(Brush *brush)
void BKE_colorband_init(ColorBand *coba, bool rangetype)
void BKE_icon_id_delete(struct ID *id)
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
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)
void * BKE_id_new(Main *bmain, short type, const char *name)
@ LIB_ID_CREATE_NO_ALLOCATE
@ LIB_ID_CREATE_NO_USER_REFCOUNT
void BKE_id_blend_write(BlendWriter *writer, ID *id)
#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)
#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)
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 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 DNA_struct_default_get(struct_name)
Read Guarded memory(de)allocation.
void ntreeTexEndExecTree(struct bNodeTreeExec *exec)
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
void * MEM_callocN(size_t len, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
void node_tree_blend_write(BlendWriter *writer, bNodeTree *ntree)
bNodeTree * node_tree_localize(bNodeTree *ntree, std::optional< ID * > new_owner_id)
void node_tree_free_embedded_tree(bNodeTree *ntree)
struct PreviewImage * preview
struct bNodeTree * nodetree
bNodeTreeRuntimeHandle * runtime
static void texture_copy_data(Main *bmain, std::optional< Library * > owner_library, ID *id_dst, const ID *id_src, const int flag)
Tex * BKE_texture_add(Main *bmain, const char *name)
void BKE_texture_type_set(Tex *tex, int type)
void BKE_texture_mapping_default(TexMapping *texmap, int type)
Tex * give_current_particle_texture(ParticleSettings *part)
void set_current_particle_texture(ParticleSettings *part, Tex *newtex)
static void texture_foreach_id(ID *id, LibraryForeachIDData *data)
static void texture_init_data(ID *id)
void set_current_brush_texture(Brush *br, Tex *newtex)
void BKE_texture_colormapping_default(ColorMapping *colormap)
MTex * BKE_texture_mtex_add_id(ID *id, int slot)
Tex * give_current_linestyle_texture(FreestyleLineStyle *linestyle)
void BKE_texture_mtex_foreach_id(LibraryForeachIDData *data, MTex *mtex)
bool BKE_texture_dependsOnTime(const Tex *texture)
void BKE_texture_mapping_init(TexMapping *texmap)
void set_active_mtex(ID *id, short act)
void set_current_linestyle_texture(FreestyleLineStyle *linestyle, Tex *newtex)
bool give_active_mtex(ID *id, MTex ***mtex_ar, short *act)
MTex * BKE_texture_mtex_add()
static void texture_blend_write(BlendWriter *writer, ID *id, const void *id_address)
void BKE_texture_mtex_default(MTex *mtex)
static void texture_blend_read_data(BlendDataReader *reader, ID *id)
ColorMapping * BKE_texture_colormapping_add()
void BKE_texture_get_value_ex(Tex *texture, const float *tex_co, TexResult *texres, ImagePool *pool, bool use_color_management)
static void texture_free_data(ID *id)
void BKE_texture_fetch_images_for_pool(Tex *texture, ImagePool *pool)
void BKE_texture_default(Tex *tex)
Tex * give_current_brush_texture(Brush *br)
static void texture_nodes_fetch_images_for_pool(Tex *texture, bNodeTree *ntree, ImagePool *pool)
bool BKE_texture_is_image_user(const Tex *tex)
void BKE_texture_get_value(Tex *texture, const float *tex_co, TexResult *texres, bool use_color_management)
TexMapping * BKE_texture_mapping_add(int type)
int multitex_ext_safe(Tex *tex, const float texvec[3], TexResult *texres, ImagePool *pool, bool scene_color_manage, const bool skip_load_image)