Blender V2.61 - r43446
Defines | Functions

texture.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_dynlib.h"
#include "BLI_math.h"
#include "BLI_kdopbvh.h"
#include "BLI_utildefines.h"
#include "BLI_bpath.h"
#include "DNA_key_types.h"
#include "DNA_object_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
#include "DNA_world_types.h"
#include "DNA_brush_types.h"
#include "DNA_node_types.h"
#include "DNA_color_types.h"
#include "DNA_particle_types.h"
#include "IMB_imbuf.h"
#include "BKE_plugin_types.h"
#include "BKE_utildefines.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_ocean.h"
#include "BKE_library.h"
#include "BKE_image.h"
#include "BKE_material.h"
#include "BKE_texture.h"
#include "BKE_key.h"
#include "BKE_icons.h"
#include "BKE_node.h"
#include "BKE_animsys.h"
#include "BKE_colortools.h"

Go to the source code of this file.

Defines

#define INT   96
#define FLO   128

Functions

int test_dlerr (const char *name, const char *symbol)
void open_plugin_tex (PluginTex *pit)
PluginTexadd_plugin_tex (char *str)
void free_plugin_tex (PluginTex *pit)
TexMappingadd_tex_mapping (void)
void default_tex_mapping (TexMapping *texmap)
void init_tex_mapping (TexMapping *texmap)
ColorMappingadd_color_mapping (void)
void default_color_mapping (ColorMapping *colormap)
void init_colorband (ColorBand *coba, int rangetype)
ColorBandadd_colorband (int rangetype)
int do_colorband (const ColorBand *coba, float in, float out[4])
void colorband_table_RGBA (ColorBand *coba, float **array, int *size)
int vergcband (const void *a1, const void *a2)
CBDatacolorband_element_add (struct ColorBand *coba, float position)
int colorband_element_remove (struct ColorBand *coba, int index)
void free_texture (Tex *tex)
void default_tex (Tex *tex)
void tex_set_type (Tex *tex, int type)
Texadd_texture (const char *name)
void default_mtex (MTex *mtex)
MTexadd_mtex (void)
MTexadd_mtex_id (ID *id, int slot)
Texcopy_texture (Tex *tex)
Texlocalize_texture (Tex *tex)
static void extern_local_texture (Tex *tex)
void make_local_texture (Tex *tex)
void autotexname (Tex *tex)
Texgive_current_object_texture (Object *ob)
Texgive_current_lamp_texture (Lamp *la)
void set_current_lamp_texture (Lamp *la, Tex *newtex)
bNodegive_current_material_texture_node (Material *ma)
Texgive_current_material_texture (Material *ma)
int give_active_mtex (ID *id, MTex ***mtex_ar, short *act)
void set_active_mtex (ID *id, short act)
void set_current_material_texture (Material *ma, Tex *newtex)
int has_current_material_texture (Material *ma)
Texgive_current_world_texture (World *world)
void set_current_world_texture (World *wo, Tex *newtex)
Texgive_current_brush_texture (Brush *br)
void set_current_brush_texture (Brush *br, Tex *newtex)
Texgive_current_particle_texture (ParticleSettings *part)
void set_current_particle_texture (ParticleSettings *part, Tex *newtex)
EnvMapBKE_add_envmap (void)
EnvMapBKE_copy_envmap (EnvMap *env)
void BKE_free_envmapdata (EnvMap *env)
void BKE_free_envmap (EnvMap *env)
PointDensityBKE_add_pointdensity (void)
PointDensityBKE_copy_pointdensity (PointDensity *pd)
void BKE_free_pointdensitydata (PointDensity *pd)
void BKE_free_pointdensity (PointDensity *pd)
void BKE_free_voxeldatadata (struct VoxelData *vd)
void BKE_free_voxeldata (struct VoxelData *vd)
struct VoxelDataBKE_add_voxeldata (void)
struct VoxelDataBKE_copy_voxeldata (struct VoxelData *vd)
struct OceanTexBKE_add_oceantex (void)
struct OceanTexBKE_copy_oceantex (struct OceanTex *ot)
void BKE_free_oceantex (struct OceanTex *ot)
int BKE_texture_dependsOnTime (const struct Tex *texture)

Detailed Description

Definition in file texture.c.


Define Documentation

#define FLO   128

Definition at line 161 of file texture.c.

Referenced by add_plugin_tex().

#define INT   96

Definition at line 160 of file texture.c.

Referenced by add_plugin_tex().


Function Documentation

ColorMapping* add_color_mapping ( void  ) [read]

Definition at line 270 of file texture.c.

References default_color_mapping(), and MEM_callocN().

ColorBand* add_colorband ( int  rangetype) [read]
MTex* add_mtex ( void  ) [read]
MTex* add_mtex_id ( ID id,
int  slot 
) [read]

Definition at line 774 of file texture.c.

References add_mtex(), give_active_mtex(), i, id_us_min(), MAX_MTEX, MEM_freeN(), and NULL.

PluginTex* add_plugin_tex ( char *  str) [read]
TexMapping* add_tex_mapping ( void  ) [read]

Definition at line 207 of file texture.c.

References default_tex_mapping(), and MEM_callocN().

Referenced by node_composit_init_map_value(), and node_shader_init_mapping().

Tex* add_texture ( const char *  name) [read]
void autotexname ( Tex tex)
EnvMap* BKE_add_envmap ( void  ) [read]
struct OceanTex* BKE_add_oceantex ( void  ) [read]

Definition at line 1529 of file texture.c.

References MEM_callocN(), NULL, OceanTex::object, OceanTex::output, and TEX_OCN_DISPLACEMENT.

Referenced by tex_set_type().

PointDensity* BKE_add_pointdensity ( void  ) [read]
struct VoxelData* BKE_add_voxeldata ( void  ) [read]
EnvMap* BKE_copy_envmap ( EnvMap env) [read]

Definition at line 1375 of file texture.c.

References EnvMap::cube, id_us_plus(), EnvMap::ima, MEM_dupallocN(), NULL, and EnvMap::ok.

Referenced by copy_texture(), and localize_texture().

struct OceanTex* BKE_copy_oceantex ( struct OceanTex ot) [read]

Definition at line 1540 of file texture.c.

References MEM_dupallocN().

Referenced by copy_texture(), and localize_texture().

PointDensity* BKE_copy_pointdensity ( PointDensity pd) [read]
struct VoxelData* BKE_copy_voxeldata ( struct VoxelData vd) [read]

Definition at line 1517 of file texture.c.

References VoxelData::dataset, MEM_dupallocN(), and NULL.

void BKE_free_envmap ( EnvMap env)

Definition at line 1404 of file texture.c.

References BKE_free_envmapdata(), and MEM_freeN().

Referenced by free_texture().

void BKE_free_envmapdata ( EnvMap env)
void BKE_free_oceantex ( struct OceanTex ot)

Definition at line 1547 of file texture.c.

References MEM_freeN().

Referenced by free_texture().

void BKE_free_pointdensity ( PointDensity pd)

Definition at line 1476 of file texture.c.

References BKE_free_pointdensitydata(), and MEM_freeN().

Referenced by free_texture().

void BKE_free_pointdensitydata ( PointDensity pd)
void BKE_free_voxeldata ( struct VoxelData vd)

Definition at line 1493 of file texture.c.

References BKE_free_voxeldatadata(), and MEM_freeN().

Referenced by free_texture().

void BKE_free_voxeldatadata ( struct VoxelData vd)

Definition at line 1484 of file texture.c.

References VoxelData::dataset, MEM_freeN(), and NULL.

Referenced by BKE_free_voxeldata().

int BKE_texture_dependsOnTime ( const struct Tex texture)

Definition at line 1554 of file texture.c.

References Tex::adt, ELEM, Tex::ima, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, Tex::plugin, Image::source, TEX_NOISE, and Tex::type.

Referenced by dependsOnTime().

CBData* colorband_element_add ( struct ColorBand coba,
float  position 
) [read]
int colorband_element_remove ( struct ColorBand coba,
int  index 
)

Definition at line 521 of file texture.c.

References ColorBand::cur, ColorBand::data, and ColorBand::tot.

Referenced by colorband_del_cb().

void colorband_table_RGBA ( ColorBand coba,
float **  array,
int *  size 
)

Definition at line 461 of file texture.c.

References CM_TABLE, do_colorband(), MEM_callocN(), and size().

Referenced by do_colorband_blend(), and gpu_shader_valtorgb().

Tex* copy_texture ( Tex tex) [read]
void default_color_mapping ( ColorMapping colormap)
void default_mtex ( MTex mtex)
void default_tex ( Tex tex)
void default_tex_mapping ( TexMapping texmap)
int do_colorband ( const ColorBand coba,
float  in,
float  out[4] 
)
static void extern_local_texture ( Tex tex) [static]

Definition at line 890 of file texture.c.

References id_lib_extern(), and Tex::ima.

Referenced by make_local_texture().

void free_plugin_tex ( PluginTex pit)

Definition at line 197 of file texture.c.

References MEM_freeN(), and NULL.

Referenced by free_texture().

void free_texture ( Tex tex)
int give_active_mtex ( ID id,
MTex ***  mtex_ar,
short *  act 
)

Definition at line 1170 of file texture.c.

References FALSE, GS, ID_LA, ID_MA, ID_PA, ID_WO, ID::name, NULL, and TRUE.

Referenced by add_mtex_id(), and texture_slot_move().

Tex* give_current_brush_texture ( Brush br) [read]

Definition at line 1304 of file texture.c.

References Brush::mtex, and MTex::tex.

Referenced by buttons_context_path_texture(), and snode_set_context().

Tex* give_current_lamp_texture ( Lamp la) [read]

Definition at line 1101 of file texture.c.

References Lamp::mtex, NULL, MTex::tex, and Lamp::texact.

Referenced by buttons_context_path_texture(), and give_current_object_texture().

Tex* give_current_material_texture ( Material ma) [read]
bNode* give_current_material_texture_node ( Material ma) [read]
Tex* give_current_object_texture ( Object ob) [read]
Tex* give_current_particle_texture ( ParticleSettings part) [read]

Definition at line 1320 of file texture.c.

References ParticleSettings::mtex, NULL, MTex::tex, and ParticleSettings::texact.

Referenced by buttons_context_path_texture().

Tex* give_current_world_texture ( World world) [read]

Definition at line 1269 of file texture.c.

References World::mtex, NULL, MTex::tex, and World::texact.

Referenced by buttons_context_path_texture(), and snode_set_context().

int has_current_material_texture ( Material ma)

Definition at line 1255 of file texture.c.

References ID_TE, nodeGetActiveID(), Material::nodetree, NULL, and Material::use_nodes.

void init_colorband ( ColorBand coba,
int  rangetype 
)
void init_tex_mapping ( TexMapping texmap)
Tex* localize_texture ( Tex tex) [read]
void make_local_texture ( Tex tex)
void open_plugin_tex ( PluginTex pit)
void set_active_mtex ( ID id,
short  act 
)

Definition at line 1198 of file texture.c.

References GS, ID_LA, ID_MA, ID_PA, ID_WO, MAX_MTEX, and ID::name.

Referenced by texture_slot_move().

void set_current_brush_texture ( Brush br,
Tex newtex 
)

Definition at line 1309 of file texture.c.

References Tex::id, id_us_min(), id_us_plus(), Brush::mtex, and MTex::tex.

void set_current_lamp_texture ( Lamp la,
Tex newtex 
)
void set_current_material_texture ( Material ma,
Tex newtex 
)
void set_current_particle_texture ( ParticleSettings part,
Tex newtex 
)
void set_current_world_texture ( World wo,
Tex newtex 
)
int test_dlerr ( const char *  name,
const char *  symbol 
)

Definition at line 79 of file texture.c.

References BLI_dynlib_get_error_as_string(), err, and NULL.

Referenced by open_plugin_seq(), and open_plugin_tex().

void tex_set_type ( Tex tex,
int  type 
)
int vergcband ( const void *  a1,
const void *  a2 
)

Definition at line 472 of file texture.c.

References CBData::pos.

Referenced by colorband_element_add().