14 # include "winsock2.h"
19 #define DNA_DEPRECATED_ALLOW
80 #define U (*((const UserDef *)&U))
85 uint *mcol, *mcoln, *mcolmain;
96 mcoln[0] = mcol[mface->
v1];
97 mcoln[1] = mcol[mface->
v2];
98 mcoln[2] = mcol[mface->
v3];
99 mcoln[3] = mcol[mface->
v4];
129 for (bone = lb->
first; bone; bone = bone->
next) {
135 if (bone->
dist <= 0.0f) {
147 for (bone = lb->
first; bone; bone = bone->
next) {
148 if (bone->
layer == 0) {
192 if (nhs->
val == 0.0f) {
212 if (!
node->storage) {
225 iuser =
node->storage;
229 if (iuser->
flag & IMA_DO_PREMUL) {
249 if (prop->
len != i) {
250 printf(
"Found and fixed bad id property group length.\n");
272 int a, mtfacen, mcoln;
301 for (
a = 0;
a < me->
totface;
a++, mtf++, tf++, mcol += 4) {
302 memcpy(mcol, tf->col,
sizeof(tf->col));
303 memcpy(mtf->uv, tf->uv,
sizeof(tf->uv));
323 if (layer->
name[0] == 0) {
325 strcpy(layer->
name,
"UVMap");
334 if (layer->
name[0] == 0) {
336 strcpy(layer->
name,
"Col");
374 iuser->
frames = nia->frames;
375 iuser->
sfra = nia->sfra;
376 iuser->
offset = nia->nr - 1;
377 iuser->
cycl = nia->cyclic;
379 node->storage = iuser;
418 for (con = lb->
first; con; con = con->
next) {
434 data->subtarget[0] =
'\0';
526 ob->colbits |= (1 <<
a);
657 for (j = 0; j < 4; j++) {
659 cp = ((
char *)&tface->col[j]) + 1;
660 for (k = 0; k < 3; k++) {
661 cp[k] = (cp[k] > 126) ? 255 : cp[k] * 2;
675 if (me->subdiv == 0) {
691 sipo->v2d.max[0] = 15000.0;
739 TFace *tface = me->tface;
741 for (
b = 0;
b < 4;
b++) {
742 tface->uv[
b][0] /= 32767.0f;
743 tface->uv[
b][1] /= 32767.0f;
756 if (sound->
volume < 0.01f) {
774 sound->
flags |= SOUND_FLAGS_3D;
777 sound->
flags &= ~SOUND_FLAGS_3D;
791 ME_SUBSURF = (1 << 7),
793 if (me->
flag & ME_SMESH) {
794 me->
flag &= ~ME_SMESH;
795 me->
flag |= ME_SUBSURF;
800 if (me->subdiv < 2) {
821 for (i = 0; i < me->
totface * 4; i++) {
829 for (i = 0; i < me->
totface; i++) {
830 TFace *tf = &((TFace *)me->tface)[i];
832 for (j = 0; j < 4; j++) {
833 char *
col = (
char *)&tf->col[j];
867 enum { ME_SUBSURF = (1 << 7) };
868 if ((me->
flag & ME_SUBSURF) && (me->subdivr == 0)) {
869 me->subdivr = me->subdiv;
874 sce->
r.stereomode = 1;
884 for (sl =
area->spacedata.first; sl; sl = sl->
next) {
887 sseq->v2d.keeptot = 0;
914 for (curcon = list->
first; curcon; curcon = curcon->
next) {
957 for (sl =
area->spacedata.first; sl; sl = sl->
next) {
960 sac->v2d.max[0] = 32000;
964 sla->v2d.max[0] = 32000;
989 for (curcon = list->
first; curcon; curcon = curcon->
next) {
1024 for (sl =
area->spacedata.first; sl; sl = sl->
next) {
1028 sbuts->v2d.maxzoom = 1.2f;
1030 if (sbuts->
mainb == BUTS_LAMP) {
1031 sbuts->
mainb = CONTEXT_SHADING;
1034 else if (sbuts->
mainb == BUTS_MAT) {
1035 sbuts->
mainb = CONTEXT_SHADING;
1038 else if (sbuts->
mainb == BUTS_TEX) {
1039 sbuts->
mainb = CONTEXT_SHADING;
1042 else if (sbuts->
mainb == BUTS_ANIM) {
1043 sbuts->
mainb = CONTEXT_OBJECT;
1045 else if (sbuts->
mainb == BUTS_WORLD) {
1046 sbuts->
mainb = CONTEXT_SCENE;
1049 else if (sbuts->
mainb == BUTS_RENDER) {
1050 sbuts->
mainb = CONTEXT_SCENE;
1053 else if (sbuts->
mainb == BUTS_FPAINT) {
1054 sbuts->
mainb = CONTEXT_EDITING;
1056 else if (sbuts->
mainb == BUTS_RADIO) {
1057 sbuts->
mainb = CONTEXT_SHADING;
1060 else if (sbuts->
mainb == BUTS_CONSTRAINT) {
1061 sbuts->
mainb = CONTEXT_OBJECT;
1063 else if (sbuts->
mainb == BUTS_SCRIPT) {
1064 sbuts->
mainb = CONTEXT_OBJECT;
1066 else if (sbuts->
mainb == BUTS_EDIT) {
1067 sbuts->
mainb = CONTEXT_EDITING;
1070 sbuts->
mainb = CONTEXT_SCENE;
1093 for (sl =
area->spacedata.first; sl; sl = sl->
next) {
1097 sac->v2d.maxzoom = 50;
1128 screen = screen->
id.
next;
1160 if (wrld->
aodist == 0.0f) {
1176 for (sl =
area->spacedata.first; sl; sl = sl->
next) {
1180 snla->v2d.maxzoom = 50;
1194 for (sl =
area->spacedata.first; sl; sl = sl->
next) {
1211 for (sl =
area->spacedata.first; sl; sl = sl->
next) {
1214 if (
st->tabnumber == 0) {
1252 printf(
"NOTE: ortho render has changed, tweak new Camera 'scale' value.\n");
1313 enum { ARM_DRAWXRAY = (1 << 1) };
1314 if (arm->
flag & ARM_DRAWXRAY) {
1322 ME_SUBSURF = (1 << 7),
1323 ME_OPT_EDGES = (1 << 8),
1326 if (me->
flag & ME_SUBSURF) {
1335 if (me->subdiv != 0) {
1338 if (me->subdivr != 0) {
1342 if (me->
flag & ME_OPT_EDGES) {
1386 if (lt->
fu == 0.0f && lt->
fv == 0.0f && lt->
fw == 0.0f) {
1435 data->weight = 1.0f;
1436 data->orientweight = 1.0f;
1440 data->rootbone = -1;
1452 if (paf->
disp == 0) {
1458 if (paf->
omat == 0) {
1484 if (kb->
name[0] == 0) {
1485 strcpy(kb->
name,
"Basis");
1489 if (kb->
name[0] == 0) {
1503 int set_passepartout = 0;
1524 if (arm->
layer == 0) {
1529 for (; sce; sce = sce->
id.
next) {
1531 set_passepartout = 1;
1536 for (; cam; cam = cam->
id.
next) {
1537 if (set_passepartout) {
1563 if (arm->
layer == 0) {
1620 strcpy(ima->
id.
name + 2,
"Viewer Node");
1621 strcpy(ima->
filepath,
"Viewer Node");
1647 for (sl =
area->spacedata.first; sl; sl = sl->
next) {
1661 R_THREADS = (1 << 19),
1667 if (sce->
r.
mode & R_THREADS) {
1687 for (bezt = nu->
bezt,
a = 0; a < nu->pntsu;
a++, bezt++) {
1694 for (bp = nu->
bp,
a = 0; a < nu->pntsu * nu->
pntsv;
a++, bp++) {
1713 for (curcon = list->
first; curcon; curcon = curcon->
next) {
1714 switch (curcon->
type) {
1719 if (
data->flag == 0) {
1735 switch (curcon->
type) {
1748 if (
data->flag == 0) {
1782 if (collection->layer == 0) {
1783 collection->layer = (1 << 20) - 1;
1812 TEX_ANIMCYCLIC = (1 << 6),
1813 TEX_ANIM5 = (1 << 7),
1855 for (; ob; ob = ob->
id.
next) {
1858 for (curdef = ob->defbase.first; curdef; curdef = curdef->
next) {
1860 if (curdef->
name[0] ==
'\0') {
1873 switch (mmd->axis) {
1911 for (sl =
area->spacedata.first; sl; sl = sl->
next) {
1915 saction->v2d.tot.ymin = -1000.0;
1916 saction->v2d.tot.ymax = 0.0;
1918 saction->v2d.cur.ymin = -75.0;
1919 saction->v2d.cur.ymax = 5.0;
1951 for (curcon = list->
first; curcon; curcon = curcon->
next) {
1953 if (curcon->
flag & 0x20) {
1958 switch (curcon->
type) {
1984 if (curcon->
flag & 0x20) {
1989 switch (curcon->
type) {
2021 if (ob->
soft && !ob->
soft->pointcache) {
2029 printf(
"Old memory cache isn't supported for particles, so re-bake the simulation!\n");
2061 if (ma->gloss_mir == 0.0f) {
2062 ma->gloss_mir = 1.0f;
2171 for (k = 0; k < sb->
totkey; k++) {
2195 for (k = 0; k < sb->
totkey; k++) {
2235 "ParticleSystem %i",
2253 part->force_group = paf->
group;
2269 float fac = paf->
lifetime / 100.0f;
2303 for (; dup; dup = dup->
id.
next) {
2327 printf(
"Old particle system converted to new system.\n");
2367 for (strip = ob->nlastrips.first; strip; strip = strip->
next) {
2368 float length, actlength, repeat;
2384 if (strip->
scale == 0.0f) {
2385 strip->
scale = 1.0f;
2439 if (ob->fluidsimSettings) {
2478 if (nu->
pntsv > 1) {
2506 for (sl =
area->spacedata.first; sl; sl = sl->
next) {
Blender kernel action and pose functionality.
void BKE_pose_tag_recalc(struct Main *bmain, struct bPose *pose)
void BKE_armature_where_is(struct bArmature *arm)
struct bConstraint * BKE_constraint_add_for_object(struct Object *ob, const char *name, short type)
void * CustomData_add_layer(struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem)
void calc_lat_fudu(int flag, int res, float *r_fu, float *r_du)
#define MAIN_VERSION_ATLEAST(main, ver, subver)
void BKE_mesh_strip_loose_faces(struct Mesh *me)
void BKE_mesh_update_customdata_pointers(struct Mesh *me, bool do_ensure_tess_cd)
void BKE_mesh_calc_edges_legacy(struct Mesh *me, bool use_old)
const ModifierTypeInfo * BKE_modifier_get_info(ModifierType type)
struct ModifierData * BKE_modifiers_findby_type(const struct Object *ob, ModifierType type)
struct ModifierData * BKE_modifier_new(int type)
@ eModifierTypeType_OnlyDeform
bool BKE_modifier_unique_name(struct ListBase *modifiers, struct ModifierData *md)
#define CMP_NODE_SPLITVIEWER
#define CMP_NODE_ALPHAOVER
General operations, lookup, etc. for blender objects.
struct PartEff * BKE_object_do_version_give_parteff_245(struct Object *ob)
struct ParticleSettings * BKE_particlesettings_add(struct Main *bmain, const char *name)
struct PointCache * BKE_ptcache_add(struct ListBase *ptcaches)
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void unit_m4(float m[4][4])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
#define STREQLEN(a, b, n)
Compatibility-like things for windows.
external readfile function prototypes.
Object groups, one object can be in many groups at once.
@ CONSTRAINT_TYPE_TRACKTO
@ CONSTRAINT_TYPE_LOCLIKE
@ CONSTRAINT_TYPE_ROTLIKE
@ CONSTRAINT_TYPE_KINEMATIC
@ CONSTRAINT_TYPE_LOCLIMIT
@ CONSTRAINT_TYPE_FOLLOWPATH
#define LA_FALLOFF_INVLINEAR
@ eModifierType_ParticleSystem
@ eSubsurfModifierFlag_Incremental
@ eSubsurfModifierFlag_DebugIncr
@ eSubsurfModifierFlag_ControlEdges
#define OB_FLUIDSIM_PARTICLE
Object is a sort of wrapper for general info.
#define PART_HAIR_BSPLINE
#define PE_DEFLECT_EMITTER
#define V3D_SELECT_OUTLINE
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block TEX_IMAGE
Platform independent time functions.
__forceinline const avxi srl(const avxi &a, const int32_t b)
struct PreviewImage * preview
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 SEQ_for_each_callback(ListBase *seqbase, SeqForEachFunc callback, void *user_data)
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
ccl_device_inline float3 ceil(const float3 &a)
static void area(int d1, int d2, int e1, int e2, float weights[2])
T length(const vec_base< T, Size > &a)
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void blo_do_versions_oldnewmap_insert(OldNewMap *onm, const void *oldaddr, void *newaddr, int nr)
void * blo_do_versions_newlibadr(FileData *fd, const void *lib, const void *adr)
ListBase * SEQ_active_seqbase_get(const Editing *ed)
struct PointCache * point_cache
struct OldNewMap * libmap
struct FluidsimSettings * fss
struct FluidVertexVelocity * meshVelocities
struct CurveMapping * curfalloff
struct bNodeTree * nodetree
struct MDeformVert * dvert
struct ModifierData * next
float instance_faces_scale
struct Collection * group
ParticleBrushData brush[7]
struct Object * instance_object
struct ParticleSystem * psys
struct ParticleSystem * next
struct PointCache * pointcache
struct bNodeTree * nodetree
struct ToolSettings * toolsettings
struct bActionStrip * next
struct bConstraint * next
struct bPoseChannel * next
struct PackedFile * packedfile
struct PackedFile * newpackedfile
double PIL_check_seconds_timer(void)
static void bone_version_239(ListBase *lb)
static void do_version_free_effects_245(ListBase *lb)
static void idproperties_fix_groups_lengths_recurse(IDProperty *prop)
void blo_do_version_old_trackto_to_constraints(Object *ob)
static void ntree_version_242(bNodeTree *ntree)
static void ntree_version_241(bNodeTree *ntree)
static void do_version_constraints_245(ListBase *lb)
static void ntree_version_245(FileData *fd, Library *lib, bNodeTree *ntree)
static void do_version_bone_head_tail_237(Bone *bone)
static void customdata_version_243(Mesh *me)
static void customdata_version_242(Mesh *me)
static void bone_version_238(ListBase *lb)
static void do_version_free_effect_245(Effect *eff)
static void do_version_ntree_242_2(bNodeTree *ntree)
static bool seq_set_blend_mode_cb(Sequence *seq, void *UNUSED(user_data))
static void vcol_to_fcol(Mesh *me)
static bool seq_set_alpha_mode_cb(Sequence *seq, void *UNUSED(user_data))
static void idproperties_fix_group_lengths(ListBase idlist)
void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)