diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_modifier.h | 9 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_node.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/BME_tools.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 26 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/modifier.c | 90 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 5 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 28 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_extensions.c | 4 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/radiance_hdr.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_sequence_types.h | 3 | ||||
-rw-r--r-- | source/blender/nodes/TEX_node.h | 1 | ||||
-rw-r--r-- | source/blender/nodes/intern/TEX_nodes/TEX_at.c | 70 | ||||
-rw-r--r-- | source/blender/render/intern/source/texture.c | 6 |
16 files changed, 198 insertions, 58 deletions
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h index e91039e31f4..4065cbb7007 100644 --- a/source/blender/blenkernel/BKE_modifier.h +++ b/source/blender/blenkernel/BKE_modifier.h @@ -204,7 +204,7 @@ typedef struct ModifierTypeInfo { * * This function is optional. */ - CustomDataMask (*requiredDataMask)(struct ModifierData *md); + CustomDataMask (*requiredDataMask)(struct Object *ob, struct ModifierData *md); /* Free internal modifier data variables, this function should * not free the md variable itself. @@ -272,6 +272,7 @@ int modifier_dependsOnTime(struct ModifierData *md); int modifier_supportsMapping(struct ModifierData *md); int modifier_couldBeCage(struct ModifierData *md); int modifier_isDeformer(struct ModifierData *md); +int modifier_isEnabled(struct ModifierData *md, int required_mode); void modifier_setError(struct ModifierData *md, char *format, ...); void modifiers_foreachObjectLink(struct Object *ob, @@ -302,8 +303,10 @@ int modifiers_indexInObject(struct Object *ob, struct ModifierData *md * evaluation, assuming the data indicated by dataMask is required at the * end of the stack. */ -struct LinkNode *modifiers_calcDataMasks(struct ModifierData *md, - CustomDataMask dataMask); +struct LinkNode *modifiers_calcDataMasks(struct Object *ob, + struct ModifierData *md, + CustomDataMask dataMask, + int required_mode); struct ModifierData *modifiers_getVirtualModifierList(struct Object *ob); #endif diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 09237e74d1d..87ee8f9cab3 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -410,8 +410,9 @@ struct TexResult; #define TEX_NODE_DECOMPOSE 420 #define TEX_NODE_VALTONOR 421 #define TEX_NODE_SCALE 422 +#define TEX_NODE_AT 423 -/* 201-299 reserved. Use like this: TEX_NODE_PROC + TEX_CLOUDS, etc */ +/* 501-599 reserved. Use like this: TEX_NODE_PROC + TEX_CLOUDS, etc */ #define TEX_NODE_PROC 500 #define TEX_NODE_PROC_MAX 600 diff --git a/source/blender/blenkernel/intern/BME_tools.c b/source/blender/blenkernel/intern/BME_tools.c index a41307de183..32065ea5151 100644 --- a/source/blender/blenkernel/intern/BME_tools.c +++ b/source/blender/blenkernel/intern/BME_tools.c @@ -191,7 +191,7 @@ static BME_Poly *BME_split_face(BME_Mesh *bm, BME_Poly *f, BME_Vert *v1, BME_Ver nf = BME_SFME(bm,f,v1,v2,nl); nf->flag = f->flag; /* if the edge was selected, select this face, too */ - if (example->flag & SELECT) f->flag |= ME_FACE_SEL; + if (example && (example->flag & SELECT)) f->flag |= ME_FACE_SEL; nf->h = f->h; nf->mat_nr = f->mat_nr; if (nl && example) { diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index bc6e549dc6f..090f256ab9f 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -1604,18 +1604,18 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos modifiers_clearErrors(ob); + if(useRenderParams) required_mode = eModifierMode_Render; + else required_mode = eModifierMode_Realtime; + /* we always want to keep original indices */ dataMask |= CD_MASK_ORIGINDEX; - datamasks = modifiers_calcDataMasks(md, dataMask); + datamasks = modifiers_calcDataMasks(ob, md, dataMask, required_mode); curr = datamasks; if(deform_r) *deform_r = NULL; *final_r = NULL; - if(useRenderParams) required_mode = eModifierMode_Render; - else required_mode = eModifierMode_Realtime; - if(useDeform) { if(useDeform > 0 && do_ob_key(scene, ob)) /* shape key makes deform verts */ deformedVerts = mesh_getVertexCos(me, &numVerts); @@ -1628,8 +1628,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos md->scene= scene; - if((md->mode & required_mode) != required_mode) continue; - if(mti->isDisabled && mti->isDisabled(md)) continue; + if(!modifier_isEnabled(md, required_mode)) continue; if(useDeform < 0 && mti->dependsOnTime && mti->dependsOnTime(md)) continue; if(mti->type == eModifierTypeType_OnlyDeform) { @@ -1678,19 +1677,18 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos md->scene= scene; - if((md->mode & required_mode) != required_mode) continue; + if(!modifier_isEnabled(md, required_mode)) continue; if(mti->type == eModifierTypeType_OnlyDeform && !useDeform) continue; if((mti->flags & eModifierTypeFlag_RequiresOriginalData) && dm) { modifier_setError(md, "Modifier requires original data, bad stack position."); continue; } - if(mti->isDisabled && mti->isDisabled(md)) continue; if(needMapping && !modifier_supportsMapping(md)) continue; if(useDeform < 0 && mti->dependsOnTime && mti->dependsOnTime(md)) continue; /* add an orco layer if needed by this modifier */ if(dm && mti->requiredDataMask) { - mask = mti->requiredDataMask(md); + mask = mti->requiredDataMask(ob, md); if(mask & CD_MASK_ORCO) add_orco_dm(ob, NULL, dm, orcodm); } @@ -1860,14 +1858,11 @@ static int editmesh_modifier_is_enabled(ModifierData *md, DerivedMesh *dm) ModifierTypeInfo *mti = modifierType_getInfo(md->type); int required_mode = eModifierMode_Realtime | eModifierMode_Editmode; - if((md->mode & required_mode) != required_mode) return 0; + if(!modifier_isEnabled(md, required_mode)) return 0; if((mti->flags & eModifierTypeFlag_RequiresOriginalData) && dm) { modifier_setError(md, "Modifier requires original data, bad stack position."); return 0; } - if(mti->isDisabled && mti->isDisabled(md)) return 0; - if(!(mti->flags & eModifierTypeFlag_SupportsEditmode)) return 0; - if(md->mode & eModifierMode_DisableTemporary) return 0; return 1; } @@ -1882,6 +1877,7 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri DerivedMesh *dm, *orcodm = NULL; int i, numVerts = 0, cageIndex = modifiers_getCageIndex(ob, NULL); LinkNode *datamasks, *curr; + int required_mode = eModifierMode_Realtime | eModifierMode_Editmode; modifiers_clearErrors(ob); @@ -1895,7 +1891,7 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri /* we always want to keep original indices */ dataMask |= CD_MASK_ORIGINDEX; - datamasks = modifiers_calcDataMasks(md, dataMask); + datamasks = modifiers_calcDataMasks(ob, md, dataMask, required_mode); curr = datamasks; for(i = 0; md; i++, md = md->next, curr = curr->next) { @@ -1908,7 +1904,7 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri /* add an orco layer if needed by this modifier */ if(dm && mti->requiredDataMask) { - mask = mti->requiredDataMask(md); + mask = mti->requiredDataMask(ob, md); if(mask & CD_MASK_ORCO) add_orco_dm(ob, em, dm, orcodm); } diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 3ef7b82864c..bf3d27cafbf 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -209,7 +209,7 @@ static void curveModifier_copyData(ModifierData *md, ModifierData *target) strncpy(tcmd->name, cmd->name, 32); } -CustomDataMask curveModifier_requiredDataMask(ModifierData *md) +CustomDataMask curveModifier_requiredDataMask(Object *ob, ModifierData *md) { CurveModifierData *cmd = (CurveModifierData *)md; CustomDataMask dataMask = 0; @@ -285,7 +285,7 @@ static void latticeModifier_copyData(ModifierData *md, ModifierData *target) strncpy(tlmd->name, lmd->name, 32); } -CustomDataMask latticeModifier_requiredDataMask(ModifierData *md) +CustomDataMask latticeModifier_requiredDataMask(Object *ob, ModifierData *md) { LatticeModifierData *lmd = (LatticeModifierData *)md; CustomDataMask dataMask = 0; @@ -668,7 +668,7 @@ static void maskModifier_copyData(ModifierData *md, ModifierData *target) strcpy(tmmd->vgroup, mmd->vgroup); } -static CustomDataMask maskModifier_requiredDataMask(ModifierData *md) +static CustomDataMask maskModifier_requiredDataMask(Object *ob, ModifierData *md) { return (1 << CD_MDEFORMVERT); } @@ -3396,7 +3396,7 @@ static void bevelModifier_copyData(ModifierData *md, ModifierData *target) strncpy(tbmd->defgrp_name, bmd->defgrp_name, 32); } -CustomDataMask bevelModifier_requiredDataMask(ModifierData *md) +CustomDataMask bevelModifier_requiredDataMask(Object *ob, ModifierData *md) { BevelModifierData *bmd = (BevelModifierData *)md; CustomDataMask dataMask = 0; @@ -3476,7 +3476,7 @@ static void displaceModifier_copyData(ModifierData *md, ModifierData *target) strncpy(tdmd->uvlayer_name, dmd->uvlayer_name, 32); } -CustomDataMask displaceModifier_requiredDataMask(ModifierData *md) +CustomDataMask displaceModifier_requiredDataMask(Object *ob, ModifierData *md) { DisplaceModifierData *dmd = (DisplaceModifierData *)md; CustomDataMask dataMask = 0; @@ -3819,7 +3819,7 @@ static void uvprojectModifier_copyData(ModifierData *md, ModifierData *target) tumd->aspecty = umd->aspecty; } -CustomDataMask uvprojectModifier_requiredDataMask(ModifierData *md) +CustomDataMask uvprojectModifier_requiredDataMask(Object *ob, ModifierData *md) { CustomDataMask dataMask = 0; @@ -4285,7 +4285,7 @@ int smoothModifier_isDisabled(ModifierData *md) return 0; } -CustomDataMask smoothModifier_requiredDataMask(ModifierData *md) +CustomDataMask smoothModifier_requiredDataMask(Object *ob, ModifierData *md) { SmoothModifierData *smd = (SmoothModifierData *)md; CustomDataMask dataMask = 0; @@ -4514,7 +4514,7 @@ int castModifier_isDisabled(ModifierData *md) return 0; } -CustomDataMask castModifier_requiredDataMask(ModifierData *md) +CustomDataMask castModifier_requiredDataMask(Object *ob, ModifierData *md) { CastModifierData *cmd = (CastModifierData *)md; CustomDataMask dataMask = 0; @@ -5145,7 +5145,7 @@ static void waveModifier_updateDepgraph( } } -CustomDataMask waveModifier_requiredDataMask(ModifierData *md) +CustomDataMask waveModifier_requiredDataMask(Object *ob, ModifierData *md) { WaveModifierData *wmd = (WaveModifierData *)md; CustomDataMask dataMask = 0; @@ -5482,7 +5482,7 @@ static void armatureModifier_copyData(ModifierData *md, ModifierData *target) strncpy(tamd->defgrp_name, amd->defgrp_name, 32); } -CustomDataMask armatureModifier_requiredDataMask(ModifierData *md) +CustomDataMask armatureModifier_requiredDataMask(Object *ob, ModifierData *md) { CustomDataMask dataMask = 0; @@ -5596,7 +5596,7 @@ static void hookModifier_copyData(ModifierData *md, ModifierData *target) strncpy(thmd->name, hmd->name, 32); } -CustomDataMask hookModifier_requiredDataMask(ModifierData *md) +CustomDataMask hookModifier_requiredDataMask(Object *ob, ModifierData *md) { HookModifierData *hmd = (HookModifierData *)md; CustomDataMask dataMask = 0; @@ -5855,7 +5855,7 @@ static void clothModifier_updateDepgraph( } } -CustomDataMask clothModifier_requiredDataMask(ModifierData *md) +CustomDataMask clothModifier_requiredDataMask(Object *ob, ModifierData *md) { CustomDataMask dataMask = 0; @@ -6239,7 +6239,7 @@ static DerivedMesh *booleanModifier_applyModifier( return derivedData; } -CustomDataMask booleanModifier_requiredDataMask(ModifierData *md) +CustomDataMask booleanModifier_requiredDataMask(Object *ob, ModifierData *md) { CustomDataMask dataMask = (1 << CD_MTFACE) + (1 << CD_MEDGE); @@ -6287,12 +6287,27 @@ static void particleSystemModifier_copyData(ModifierData *md, ModifierData *targ tpsmd->psys = psmd->psys; } -CustomDataMask particleSystemModifier_requiredDataMask(ModifierData *md) +CustomDataMask particleSystemModifier_requiredDataMask(Object *ob, ModifierData *md) { ParticleSystemModifierData *psmd= (ParticleSystemModifierData*) md; - CustomDataMask dataMask = (1 << CD_MTFACE) + (1 << CD_MEDGE); + CustomDataMask dataMask = 0; + Material *ma; + MTex *mtex; int i; + ma= give_current_material(ob, psmd->psys->part->omat); + if(ma) { + for(i=0; i<MAX_MTEX; i++) { + mtex=ma->mtex[i]; + if(mtex && (ma->septex & (1<<i))==0) + if(mtex->pmapto && (mtex->texco & TEXCO_UV)) + dataMask |= (1 << CD_MTFACE); + } + } + + if(psmd->psys->part->tanfac!=0.0) + dataMask |= (1 << CD_MTFACE); + /* ask for vertexgroups if we need them */ for(i=0; i<PSYS_TOT_VG; i++){ if(psmd->psys->vgroup[i]){ @@ -6637,7 +6652,7 @@ static int explodeModifier_dependsOnTime(ModifierData *md) { return 1; } -CustomDataMask explodeModifier_requiredDataMask(ModifierData *md) +CustomDataMask explodeModifier_requiredDataMask(Object *ob, ModifierData *md) { ExplodeModifierData *emd= (ExplodeModifierData*) md; CustomDataMask dataMask = 0; @@ -7551,7 +7566,7 @@ static void meshdeformModifier_copyData(ModifierData *md, ModifierData *target) tmmd->object = mmd->object; } -CustomDataMask meshdeformModifier_requiredDataMask(ModifierData *md) +CustomDataMask meshdeformModifier_requiredDataMask(Object *ob, ModifierData *md) { MeshDeformModifierData *mmd = (MeshDeformModifierData *)md; CustomDataMask dataMask = 0; @@ -7815,10 +7830,12 @@ static void meshdeformModifier_deformVerts( { DerivedMesh *dm; - if(!derivedData && ob->type==OB_MESH) - dm= CDDM_from_mesh(ob->data, ob); - else - dm= derivedData; + if (!derivedData) { + dm= get_original_dm(md->scene, ob, NULL, 0); + if (dm == NULL) return; + } + else dm= derivedData; + modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */ @@ -7930,7 +7947,7 @@ static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target) tsmd->subsurfLevels = smd->subsurfLevels; } -CustomDataMask shrinkwrapModifier_requiredDataMask(ModifierData *md) +CustomDataMask shrinkwrapModifier_requiredDataMask(Object *ob, ModifierData *md) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *)md; CustomDataMask dataMask = 0; @@ -7964,7 +7981,7 @@ static void shrinkwrapModifier_foreachObjectLink(ModifierData *md, Object *ob, O static void shrinkwrapModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { DerivedMesh *dm = NULL; - CustomDataMask dataMask = shrinkwrapModifier_requiredDataMask(md); + CustomDataMask dataMask = shrinkwrapModifier_requiredDataMask(ob, md); /* We implement requiredDataMask but thats not really usefull since mesh_calc_modifiers pass a NULL derivedData or without the modified vertexs applied */ if(dataMask) @@ -7990,7 +8007,7 @@ static void shrinkwrapModifier_deformVerts(ModifierData *md, Object *ob, Derived static void shrinkwrapModifier_deformVertsEM(ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { DerivedMesh *dm = NULL; - CustomDataMask dataMask = shrinkwrapModifier_requiredDataMask(md); + CustomDataMask dataMask = shrinkwrapModifier_requiredDataMask(ob, md); if(dataMask) { @@ -8049,7 +8066,7 @@ static void simpledeformModifier_copyData(ModifierData *md, ModifierData *target memcpy(tsmd->limit, smd->limit, sizeof(tsmd->limit)); } -static CustomDataMask simpledeformModifier_requiredDataMask(ModifierData *md) +static CustomDataMask simpledeformModifier_requiredDataMask(Object *ob, ModifierData *md) { SimpleDeformModifierData *smd = (SimpleDeformModifierData *)md; CustomDataMask dataMask = 0; @@ -8078,7 +8095,7 @@ static void simpledeformModifier_updateDepgraph(ModifierData *md, DagForest *for static void simpledeformModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { DerivedMesh *dm = NULL; - CustomDataMask dataMask = simpledeformModifier_requiredDataMask(md); + CustomDataMask dataMask = simpledeformModifier_requiredDataMask(ob, md); /* We implement requiredDataMask but thats not really usefull since mesh_calc_modifiers pass a NULL derivedData or without the modified vertexs applied */ if(dataMask) @@ -8105,7 +8122,7 @@ static void simpledeformModifier_deformVerts(ModifierData *md, Object *ob, Deriv static void simpledeformModifier_deformVertsEM(ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { DerivedMesh *dm = NULL; - CustomDataMask dataMask = simpledeformModifier_requiredDataMask(md); + CustomDataMask dataMask = simpledeformModifier_requiredDataMask(ob, md); /* We implement requiredDataMask but thats not really usefull since mesh_calc_modifiers pass a NULL derivedData or without the modified vertexs applied */ if(dataMask) @@ -8717,7 +8734,20 @@ int modifiers_isParticleEnabled(Object *ob) return (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render)); } -LinkNode *modifiers_calcDataMasks(ModifierData *md, CustomDataMask dataMask) +int modifier_isEnabled(ModifierData *md, int required_mode) +{ + ModifierTypeInfo *mti = modifierType_getInfo(md->type); + + if((md->mode & required_mode) != required_mode) return 0; + if(mti->isDisabled && mti->isDisabled(md)) return 0; + if(md->mode & eModifierMode_DisableTemporary) return 0; + if(required_mode & eModifierMode_Editmode) + if(!(mti->flags & eModifierTypeFlag_SupportsEditmode)) return 0; + + return 1; +} + +LinkNode *modifiers_calcDataMasks(Object *ob, ModifierData *md, CustomDataMask dataMask, int required_mode) { LinkNode *dataMasks = NULL; LinkNode *curr, *prev; @@ -8727,7 +8757,9 @@ LinkNode *modifiers_calcDataMasks(ModifierData *md, CustomDataMask dataMask) ModifierTypeInfo *mti = modifierType_getInfo(md->type); CustomDataMask mask = 0; - if(mti->requiredDataMask) mask = mti->requiredDataMask(md); + if(modifier_isEnabled(md, required_mode)) + if(mti->requiredDataMask) + mask = mti->requiredDataMask(ob, md); BLI_linklist_prepend(&dataMasks, SET_INT_IN_POINTER(mask)); } diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index a83b8817580..0f42ba0d2e2 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -3050,6 +3050,7 @@ static void registerTextureNodes(ListBase *ntypelist) nodeRegisterType(ntypelist, &tex_node_rotate); nodeRegisterType(ntypelist, &tex_node_translate); nodeRegisterType(ntypelist, &tex_node_scale); + nodeRegisterType(ntypelist, &tex_node_at); nodeRegisterType(ntypelist, &tex_node_proc_voronoi); nodeRegisterType(ntypelist, &tex_node_proc_blend); diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 74a754c0ca8..34e69b2d736 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3169,7 +3169,7 @@ static void get_cpa_texture(DerivedMesh *dm, Material *ma, int face_index, float if(ma) for(m=0; m<MAX_MTEX; m++){ mtex=ma->mtex[m]; - if(mtex && (ma->septex & (1<<m))==0){ + if(mtex && (ma->septex & (1<<m))==0 && mtex->pmapto){ float def=mtex->def_var; float var=mtex->varfac; short blend=mtex->blendtype; @@ -3218,7 +3218,7 @@ void psys_get_texture(Object *ob, Material *ma, ParticleSystemModifierData *psmd if(ma) for(m=0; m<MAX_MTEX; m++){ mtex=ma->mtex[m]; - if(mtex && (ma->septex & (1<<m))==0){ + if(mtex && (ma->septex & (1<<m))==0 && mtex->pmapto){ float var=mtex->varfac; float def=mtex->def_var; short blend=mtex->blendtype; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 596c27a14f5..52f13eeadb8 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -1761,7 +1761,10 @@ void reset_particle(Scene *scene, ParticleData *pa, ParticleSystem *psys, Partic where_is_object_time(scene, ob,pa->time); /* get birth location from object */ - psys_particle_on_emitter(psmd,part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,utan,vtan,0,0); + if(part->tanfac!=0.0) + psys_particle_on_emitter(psmd,part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,utan,vtan,0,0); + else + psys_particle_on_emitter(psmd,part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,0,0,0,0); /* save local coordinates for later */ VECCOPY(tloc,loc); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index e4afdb6b7b5..1502b475350 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9137,6 +9137,34 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + if (main->versionfile < 249 && main->subversionfile < 2) { + Scene *sce= main->scene.first; + Sequence *seq; + Editing *ed; + + while(sce) { + ed= sce->ed; + if(ed) { + SEQP_BEGIN(ed, seq) { + if (seq->strip && seq->strip->proxy){ + if (sce->r.size != 100.0) { + seq->strip->proxy->size + = sce->r.size; + } else { + seq->strip->proxy->size + = 25.0; + } + seq->strip->proxy->quality =90; + } + } + SEQ_END + } + + sce= sce->id.next; + } + + } + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 7654c67419b..4984e043031 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -746,7 +746,9 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, /*GPU glGetObjectParameterivARB(shader->object, GL_OBJECT_LINK_STATUS_ARB, &status); if (!status) { glGetInfoLogARB(shader->object, sizeof(log), &length, log); - shader_print_errors("linking", log, fragcode); + if (fragcode) shader_print_errors("linking", log, fragcode); + else if (vertexcode) shader_print_errors("linking", log, vertexcode); + else if (libcode) shader_print_errors("linking", log, libcode); GPU_shader_free(shader); return NULL; diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 818b67170c7..7e8b5c18d71 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1285,7 +1285,7 @@ void GPU_materials_free() GPU_material_free(&defmaterial); - for(ob=G.main->object.first; ma; ma=ma->id.next) + for(ob=G.main->object.first; ob; ob=ob->id.next) GPU_lamp_free(ob); } diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c index d00e34cfdbe..69c4970df38 100644 --- a/source/blender/imbuf/intern/radiance_hdr.c +++ b/source/blender/imbuf/intern/radiance_hdr.c @@ -191,7 +191,7 @@ struct ImBuf *imb_loadhdr(unsigned char *mem, int size, int flags) break; } } - if (found) { + if (found && (x<(size + 2))) { if (sscanf((char *)&mem[x+1], "%79s %d %79s %d", (char*)&oriY, &height, (char*)&oriX, &width) != 4) return NULL; diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index 6fce4fa990d..39e72c34adf 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -80,6 +80,9 @@ typedef struct StripProxy { char dir[160]; char file[80]; struct anim *anim; + short size; + short quality; + int pad; } StripProxy; typedef struct Strip { diff --git a/source/blender/nodes/TEX_node.h b/source/blender/nodes/TEX_node.h index d298f062143..f58d0312961 100644 --- a/source/blender/nodes/TEX_node.h +++ b/source/blender/nodes/TEX_node.h @@ -59,6 +59,7 @@ extern bNodeType tex_node_distance; extern bNodeType tex_node_rotate; extern bNodeType tex_node_translate; extern bNodeType tex_node_scale; +extern bNodeType tex_node_at; extern bNodeType tex_node_compose; extern bNodeType tex_node_decompose; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_at.c b/source/blender/nodes/intern/TEX_nodes/TEX_at.c new file mode 100644 index 00000000000..80f232ccd0c --- /dev/null +++ b/source/blender/nodes/intern/TEX_nodes/TEX_at.c @@ -0,0 +1,70 @@ +/** + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2005 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): R Allen + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "../TEX_util.h" + +static bNodeSocketType inputs[]= { + { SOCK_RGBA, 1, "Texture", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f }, + { SOCK_VECTOR, 1, "Coordinates", 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f }, + { -1, 0, "" } +}; +static bNodeSocketType outputs[]= { + { SOCK_RGBA, 0, "Texture", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f }, + { -1, 0, "" } +}; + +static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +{ + float new_coord[3]; + + tex_input_vec(new_coord, in[1], coord, thread); + tex_input_rgba(out, in[0], new_coord, thread); +} + +static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ + tex_output(node, in, out[0], &colorfn); +} + +bNodeType tex_node_at = { + /* *next,*prev */ NULL, NULL, + /* type code */ TEX_NODE_AT, + /* name */ "At", + /* width+range */ 100, 60, 150, + /* class+opts */ NODE_CLASS_DISTORT, 0, + /* input sock */ inputs, + /* output sock */ outputs, + /* storage */ "", + /* execfunc */ exec, + /* butfunc */ NULL, + /* initfunc */ NULL, + /* freestoragefunc */ NULL, + /* copystoragefunc */ NULL, + /* id */ NULL + +}; diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index 16f876fdd38..d9fc075c1c4 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -2418,13 +2418,13 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef /* placement */ - if(mtex->projx) texvec[0]= mtex->size[0]*(co[mtex->projx-1]+mtex->ofs[0]); + if(mtex->projx && co) texvec[0]= mtex->size[0]*(co[mtex->projx-1]+mtex->ofs[0]); else texvec[0]= mtex->size[0]*(mtex->ofs[0]); - if(mtex->projy) texvec[1]= mtex->size[1]*(co[mtex->projy-1]+mtex->ofs[1]); + if(mtex->projy && co) texvec[1]= mtex->size[1]*(co[mtex->projy-1]+mtex->ofs[1]); else texvec[1]= mtex->size[1]*(mtex->ofs[1]); - if(mtex->projz) texvec[2]= mtex->size[2]*(co[mtex->projz-1]+mtex->ofs[2]); + if(mtex->projz && co) texvec[2]= mtex->size[2]*(co[mtex->projz-1]+mtex->ofs[2]); else texvec[2]= mtex->size[2]*(mtex->ofs[2]); if(shi->osatex) { |