[Bf-blender-cvs] [b87eaef] master: Fix T44137: bpy.path.is_subdir fails
Commit: b87eaef1f7928bd6f0e937474cf922afa4c07f83 Author: Campbell Barton Date: Thu Mar 26 16:29:14 2015 +1100 Branches: master https://developer.blender.org/rBb87eaef1f7928bd6f0e937474cf922afa4c07f83 Fix T44137: bpy.path.is_subdir fails `bpy.path.is_subdir("/abc/def/ghi","/abc/de")` incorrectly returned True === M release/scripts/modules/bpy/path.py === diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py index 25a6c72..0012083 100644 --- a/release/scripts/modules/bpy/path.py +++ b/release/scripts/modules/bpy/path.py @@ -116,7 +116,11 @@ def is_subdir(path, directory): from os.path import normpath, normcase path = normpath(normcase(path)) directory = normpath(normcase(directory)) -return path.startswith(directory) +if len(path) > len(directory): +if path.startswith(directory): +sep = ord(_os.sep) if isinstance(directory, bytes) else _os.sep +return (path[len(directory)] == sep) +return False def clean_name(name, replace="_"): ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [770b109] master: Fix: AUD_OpenALDevice::getPosition returns negative values
Commit: 770b109deb6fbaea571901e56f5b9b6742483f69 Author: Jörg Müller Date: Thu Mar 26 14:45:21 2015 +1300 Branches: master https://developer.blender.org/rB770b109deb6fbaea571901e56f5b9b6742483f69 Fix: AUD_OpenALDevice::getPosition returns negative values Reported by Antony Riakiotakis. The problem was the seeking code. === M intern/audaspace/OpenAL/AUD_OpenALDevice.cpp === diff --git a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp index d055c13..c0c77b6 100644 --- a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp +++ b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp @@ -276,49 +276,48 @@ bool AUD_OpenALDevice::AUD_OpenALHandle::seek(float position) alGetSourcei(m_source, AL_SOURCE_STATE, &info); - if(info != AL_PLAYING) - { - if(info == AL_PAUSED) - alSourceStop(m_source); + // we need to stop playing sounds as well to clear the buffers + // this might cause clicks, but fixes a bug regarding position determination + if(info == AL_PAUSED || info == AL_PLAYING) + alSourceStop(m_source); + + alSourcei(m_source, AL_BUFFER, 0); + m_current = 0; - alSourcei(m_source, AL_BUFFER, 0); - m_current = 0; + ALenum err; + if((err = alGetError()) == AL_NO_ERROR) + { + int length; + AUD_DeviceSpecs specs = m_device->m_specs; + specs.specs = m_reader->getSpecs(); + m_device->m_buffer.assureSize(m_device->m_buffersize * AUD_DEVICE_SAMPLE_SIZE(specs)); - ALenum err; - if((err = alGetError()) == AL_NO_ERROR) + for(int i = 0; i < CYCLE_BUFFERS; i++) { - int length; - AUD_DeviceSpecs specs = m_device->m_specs; - specs.specs = m_reader->getSpecs(); - m_device->m_buffer.assureSize(m_device->m_buffersize * AUD_DEVICE_SAMPLE_SIZE(specs)); + length = m_device->m_buffersize; + m_reader->read(length, m_eos, m_device->m_buffer.getBuffer()); - for(int i = 0; i < CYCLE_BUFFERS; i++) + if(length == 0) { - length = m_device->m_buffersize; - m_reader->read(length, m_eos, m_device->m_buffer.getBuffer()); - - if(length == 0) - { - // AUD_XXX: TODO: don't fill all buffers and enqueue them later - length = 1; - memset(m_device->m_buffer.getBuffer(), 0, length * AUD_DEVICE_SAMPLE_SIZE(specs)); - } - - alBufferData(m_buffers[i], m_format, m_device->m_buffer.getBuffer(), -length * AUD_DEVICE_SAMPLE_SIZE(specs), specs.rate); - - if(alGetError() != AL_NO_ERROR) - break; + // AUD_XXX: TODO: don't fill all buffers and enqueue them later + length = 1; + memset(m_device->m_buffer.getBuffer(), 0, length * AUD_DEVICE_SAMPLE_SIZE(specs)); } - if(m_loopcount != 0) - m_eos = false; + alBufferData(m_buffers[i], m_format, m_device->m_buffer.getBuffer(), +length * AUD_DEVICE_SAMPLE_SIZE(specs), specs.rate); - alSourceQueueBuffers(m_source, CYCLE_BUFFERS, m_buffers); + if(alGetError() != AL_NO_ERROR) + break; } - alSourceRewind(m_source); + if(m_loopcount != 0) + m_eos = false; + + alSourceQueueBuffers(m_source, CYCLE_BUFFERS, m_buffers); } + + alSourceRewind(m_source); } if(m_status == AUD_STATUS_STOPPED) @@ -343,9 +342,14 @@ float AUD_OpenALDevice::AUD_OpenALHandle::getPosition(
[Bf-blender-cvs] [92f305a] master: A more forward thinking version of previous commit
Commit: 92f305a490802812091da4640df552d77f168844 Author: Julian Eisel Date: Wed Mar 25 22:15:56 2015 +0100 Branches: master https://developer.blender.org/rB92f305a490802812091da4640df552d77f168844 A more forward thinking version of previous commit Basically same as 581afa9da37, but I guess we can assume that scopes added in future to the image preview may also want to use the viewrect from the original ibuf. === M source/blender/editors/space_sequencer/sequencer_draw.c === diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index c668887..ec4ae5a 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1079,7 +1079,10 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq /* future files may have new scopes we don't catch above */ if (scope) { scopes->reference_ibuf = ibuf; - if (!scopes->zebra_ibuf) { /* zebra uses viewrect from orig ibuf */ + if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) { + /* scopes drawn in image preview use viewrect from orig ibuf - currently that's only zebra */ + } + else { viewrect[0] = scope->x; viewrect[1] = scope->y; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [581afa9] master: Fix T44121: VSE Preview scaling issue when using proxies and Show Overexposed
Commit: 581afa9da37e0adaea756c165af11b467e9b8852 Author: Julian Eisel Date: Wed Mar 25 21:52:54 2015 +0100 Branches: master https://developer.blender.org/rB581afa9da37e0adaea756c165af11b467e9b8852 Fix T44121: VSE Preview scaling issue when using proxies and Show Overexposed === M source/blender/editors/space_sequencer/sequencer_draw.c === diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index b63c46c..c668887 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1079,8 +1079,10 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq /* future files may have new scopes we don't catch above */ if (scope) { scopes->reference_ibuf = ibuf; - viewrect[0] = scope->x; - viewrect[1] = scope->y; + if (!scopes->zebra_ibuf) { /* zebra uses viewrect from orig ibuf */ + viewrect[0] = scope->x; + viewrect[1] = scope->y; + } } else { scopes->reference_ibuf = NULL; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ad3e6ec] gooseberry: Merge branch 'master' into gooseberry
Commit: ad3e6ecfb4173c98ac1abbe03a62393202c69ee9 Author: Lukas Tönne Date: Wed Mar 25 20:10:02 2015 +0100 Branches: gooseberry https://developer.blender.org/rBad3e6ecfb4173c98ac1abbe03a62393202c69ee9 Merge branch 'master' into gooseberry Conflicts: source/blender/editors/render/render_opengl.c === === diff --cc source/blender/editors/render/render_opengl.c index d40ced2,d8da0e9..2bcb9ef --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@@ -223,8 -223,12 +223,13 @@@ static void screen_opengl_render_apply( /*int is_ortho = scene->r.mode & R_ORTHO;*/ camera = v3d->camera; RE_GetCameraWindow(oglrender->re, camera, scene->r.cfra, winmat); - is_persp = true; + if (camera->type == OB_CAMERA) { + Camera *cam = camera->data; + is_persp = cam->type == CAM_PERSP; + } + else + is_persp = true; + BKE_camera_to_gpu_dof(camera, &fx_settings); } else { diff --cc source/blender/editors/space_view3d/drawobject.c index da5108c,808408b..281fbe6 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@@ -5134,18 -4754,21 +5135,24 @@@ static void draw_new_particle_system(Sc /* don't draw normal paths in edit mode */ if (psys_in_edit_mode(scene, psys) && (pset->flag & PE_DRAW_PART) == 0) return; - - if (part->draw_as == PART_DRAW_REND) - draw_as = part->ren_as; - else - draw_as = part->draw_as; - - if (draw_as == PART_DRAW_NOT) + + draw_as = part->draw_as == PART_DRAW_REND ? part->ren_as : part->draw_as; + if (draw_as == PART_DRAW_NOT) { return; + } + else if (draw_as == PART_DRAW_HULL) { +#ifdef USE_PARTICLE_HULL_DRAWING + draw_particle_hair_hull(scene, v3d, rv3d, base, psys, ob_dt, dflag); +#endif + return; + } + /* prepare curvemapping tables */ + if ((psys->part->child_flag & PART_CHILD_USE_CLUMP_CURVE) && psys->part->clumpcurve) + curvemapping_changed_all(psys->part->clumpcurve); + if ((psys->part->child_flag & PART_CHILD_USE_ROUGH_CURVE) && psys->part->roughcurve) + curvemapping_changed_all(psys->part->roughcurve); + /* 2. */ sim.scene = scene; sim.ob = ob; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4dc141f] master: Yet another fix for crashing particles.
Commit: 4dc141f933f632ea00482b294e8c252ac12d21aa Author: Lukas Tönne Date: Wed Mar 25 20:08:12 2015 +0100 Branches: master https://developer.blender.org/rB4dc141f933f632ea00482b294e8c252ac12d21aa Yet another fix for crashing particles. === M source/blender/editors/space_view3d/drawobject.c === diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index d4d8db6..808408b 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -52,6 +52,7 @@ #include "BKE_anim.h" /* for the where_on_path function */ #include "BKE_armature.h" #include "BKE_camera.h" +#include "BKE_colortools.h" #include "BKE_constraint.h" /* for the get_constraint_target function */ #include "BKE_curve.h" #include "BKE_DerivedMesh.h" @@ -4762,6 +4763,12 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if (draw_as == PART_DRAW_NOT) return; + /* prepare curvemapping tables */ + if ((psys->part->child_flag & PART_CHILD_USE_CLUMP_CURVE) && psys->part->clumpcurve) + curvemapping_changed_all(psys->part->clumpcurve); + if ((psys->part->child_flag & PART_CHILD_USE_ROUGH_CURVE) && psys->part->roughcurve) + curvemapping_changed_all(psys->part->roughcurve); + /* 2. */ sim.scene = scene; sim.ob = ob; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5e2cc06] master: minor cleanup: alignment
Commit: 5e2cc06518e9d32a625cfd3fce4987c705155bed Author: Mike Erwin Date: Wed Mar 25 14:28:36 2015 -0400 Branches: master https://developer.blender.org/rB5e2cc06518e9d32a625cfd3fce4987c705155bed minor cleanup: alignment === M source/blender/nodes/NOD_static_types.h M source/blender/nodes/shader/nodes/node_shader_object_info.c === diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h index 166fa29..6b9a97c 100644 --- a/source/blender/nodes/NOD_static_types.h +++ b/source/blender/nodes/NOD_static_types.h @@ -71,7 +71,7 @@ DefNode( ShaderNode, SH_NODE_OUTPUT_LAMP, def_sh_output, "OU DefNode( ShaderNode, SH_NODE_OUTPUT_WORLD, def_sh_output, "OUTPUT_WORLD", OutputWorld, "World Output", "" ) DefNode( ShaderNode, SH_NODE_OUTPUT_LINESTYLE, def_sh_output_linestyle,"OUTPUT_LINESTYLE", OutputLineStyle, "Line Style Output", "" ) DefNode( ShaderNode, SH_NODE_FRESNEL,0, "FRESNEL",Fresnel, "Fresnel", "" ) -DefNode( ShaderNode, SH_NODE_LAYER_WEIGHT, 0, "LAYER_WEIGHT", LayerWeight, "Layer Weight", "" ) +DefNode( ShaderNode, SH_NODE_LAYER_WEIGHT, 0, "LAYER_WEIGHT", LayerWeight, "Layer Weight", "" ) DefNode( ShaderNode, SH_NODE_MIX_SHADER, 0, "MIX_SHADER", MixShader,"Mix Shader","" ) DefNode( ShaderNode, SH_NODE_ADD_SHADER, 0, "ADD_SHADER", AddShader,"Add Shader","" ) DefNode( ShaderNode, SH_NODE_ATTRIBUTE, def_sh_attribute, "ATTRIBUTE", Attribute,"Attribute", "" ) @@ -208,7 +208,7 @@ DefNode( CompositorNode, CMP_NODE_KEYINGSCREEN, def_cmp_keyingscreen, "KEYIN DefNode( CompositorNode, CMP_NODE_KEYING, def_cmp_keying, "KEYING", Keying, "Keying","" ) DefNode( CompositorNode, CMP_NODE_TRACKPOS, def_cmp_trackpos, "TRACKPOS", TrackPos, "Track Position","" ) DefNode( CompositorNode, CMP_NODE_PIXELATE, 0, "PIXELATE", Pixelate, "Pixelate", "" ) -DefNode( CompositorNode, CMP_NODE_PLANETRACKDEFORM,def_cmp_planetrackdeform,"PLANETRACKDEFORM",PlaneTrackDeform,"Plane Track Deform","" ) +DefNode( CompositorNode, CMP_NODE_PLANETRACKDEFORM,def_cmp_planetrackdeform,"PLANETRACKDEFORM",PlaneTrackDeform,"Plane Track Deform","") DefNode( CompositorNode, CMP_NODE_CORNERPIN, 0, "CORNERPIN", CornerPin,"Corner Pin","" ) DefNode( CompositorNode, CMP_NODE_SUNBEAMS, def_cmp_sunbeams, "SUNBEAMS", SunBeams, "Sun Beams", "" ) diff --git a/source/blender/nodes/shader/nodes/node_shader_object_info.c b/source/blender/nodes/shader/nodes/node_shader_object_info.c index a862c62..d190524 100644 --- a/source/blender/nodes/shader/nodes/node_shader_object_info.c +++ b/source/blender/nodes/shader/nodes/node_shader_object_info.c @@ -30,10 +30,10 @@ /* OUTPUT */ static bNodeSocketTemplate sh_node_object_info_out[] = { - { SOCK_VECTOR, 0, N_("Location"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, - { SOCK_FLOAT, 0, N_("Object Index"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, - { SOCK_FLOAT, 0, N_("Material Index"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, - { SOCK_FLOAT, 0, N_("Random"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { SOCK_VECTOR, 0, N_("Location"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { SOCK_FLOAT, 0, N_("Object Index"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { SOCK_FLOAT, 0, N_("Material Index"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { SOCK_FLOAT, 0, N_("Random"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { -1, 0, "" } }; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [465819a] gooseberry: Customdata caching for CD_ORIGSPACE_MLOOP.
Commit: 465819af4f6ae15394ca90c985a070fe25adacd7 Author: Lukas Tönne Date: Wed Mar 25 18:57:52 2015 +0100 Branches: gooseberry https://developer.blender.org/rB465819af4f6ae15394ca90c985a070fe25adacd7 Customdata caching for CD_ORIGSPACE_MLOOP. === M source/blender/pointcache/alembic/abc_customdata.cpp === diff --git a/source/blender/pointcache/alembic/abc_customdata.cpp b/source/blender/pointcache/alembic/abc_customdata.cpp index 7451870..0b9c3c3 100644 --- a/source/blender/pointcache/alembic/abc_customdata.cpp +++ b/source/blender/pointcache/alembic/abc_customdata.cpp @@ -177,6 +177,22 @@ void write_sample(CustomDataWriter *writer, OCompoundProperty &parent, prop.set(OV3fArrayProperty::sample_type((V3f *)data, num_data)); } +template <> +void write_sample(CustomDataWriter *writer, OCompoundProperty &parent, const std::string &name, void *data, int num_data) +{ + OCompoundProperty prop = writer->add_compound_property(name, parent); + + OV2fArrayProperty prop_uv = writer->add_array_property(name+":uv", prop); + + OrigSpaceLoop *ospaceloop = (OrigSpaceLoop *)data; + std::vector uv_data; + uv_data.reserve(num_data); + for (int i = 0; i < num_data; ++i) { + uv_data.push_back(V2f(ospaceloop->uv[0], ospaceloop->uv[1])); + } + prop_uv.set(V2fArraySample(uv_data)); +} + /* - */ template @@ -344,6 +360,30 @@ PTCReadSampleResult read_sample(CustomDataReader *reader, ICompoundProp return PTC_READ_SAMPLE_EXACT; } +template <> +PTCReadSampleResult read_sample(CustomDataReader *reader, ICompoundProperty &parent, const ISampleSelector &ss, const std::string &name, void *data, int num_data) +{ + ICompoundProperty prop = reader->add_compound_property(name, parent); + + IV2fArrayProperty uv_prop = reader->add_array_property(name+":uv", prop); + + V2fArraySamplePtr sample = uv_prop.getValue(ss); + + if (sample->size() != num_data) + return PTC_READ_SAMPLE_INVALID; + + OrigSpaceLoop *ospace = (OrigSpaceLoop *)data; + const V2f *sample_data = (const V2f *)sample->getData(); + for (int i = 0; i < num_data; ++i) { + copy_v2_v2(ospace->uv, sample_data->getValue()); + + ++sample_data; + ++ospace; + } + + return PTC_READ_SAMPLE_EXACT; +} + /* = */ /* recursive template that handles dispatch by CD layer type */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e1273f7] gooseberry: Customdata caching for CD_ORCO.
Commit: e1273f7d7907d8aa8be0fac6a67c76d5cacc3411 Author: Lukas Tönne Date: Wed Mar 25 18:44:56 2015 +0100 Branches: gooseberry https://developer.blender.org/rBe1273f7d7907d8aa8be0fac6a67c76d5cacc3411 Customdata caching for CD_ORCO. === M source/blender/pointcache/alembic/abc_customdata.cpp === diff --git a/source/blender/pointcache/alembic/abc_customdata.cpp b/source/blender/pointcache/alembic/abc_customdata.cpp index a55270e..7451870 100644 --- a/source/blender/pointcache/alembic/abc_customdata.cpp +++ b/source/blender/pointcache/alembic/abc_customdata.cpp @@ -169,6 +169,14 @@ void write_sample(CustomDataWriter *writer, OCompoundProperty &par uv_prop[3].set(V2fArraySample(uv_data[3])); } +template <> +void write_sample(CustomDataWriter *writer, OCompoundProperty &parent, const std::string &name, void *data, int num_data) +{ + OV3fArrayProperty prop = writer->add_array_property(name, parent); + + prop.set(OV3fArrayProperty::sample_type((V3f *)data, num_data)); +} + /* - */ template @@ -322,6 +330,20 @@ PTCReadSampleResult read_sample(CustomDataReader *reader, ICompoun return PTC_READ_SAMPLE_EXACT; } +template <> +PTCReadSampleResult read_sample(CustomDataReader *reader, ICompoundProperty &parent, const ISampleSelector &ss, const std::string &name, void *data, int num_data) +{ + IV3fArrayProperty prop = reader->add_array_property(name, parent); + + V3fArraySamplePtr sample = prop.getValue(ss); + + if (sample->size() != num_data) + return PTC_READ_SAMPLE_INVALID; + + memcpy(data, sample->getData(), sizeof(V3f) * num_data); + return PTC_READ_SAMPLE_EXACT; +} + /* = */ /* recursive template that handles dispatch by CD layer type */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[d4ac58d] master: Fix T43694, by Krzysztof Rećko (chrisr), reviewed in D1177.
Commit: d4ac58d04989e8c2e1951a55519cfba53011d494 Author: Lukas Tönne Date: Wed Mar 25 18:34:52 2015 +0100 Branches: master https://developer.blender.org/rBd4ac58d04989e8c2e1951a55519cfba53011d494 Fix T43694, by Krzysztof Rećko (chrisr), reviewed in D1177. Added some guards to prevent clumping to non existing particles. Also, adjusted threaded child path evaluation, so each child is evaluated once - previously virtual parents were done twice. === M source/blender/blenkernel/BKE_particle.h M source/blender/blenkernel/intern/particle.c M source/blender/blenkernel/intern/particle_distribute.c M source/blender/blenkernel/intern/particle_system.c === diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index 0f1389b..619c061 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -361,7 +361,7 @@ void psys_get_dupli_path_transform(struct ParticleSimulationData *sim, struct Pa void psys_thread_context_init(struct ParticleThreadContext *ctx, struct ParticleSimulationData *sim); void psys_thread_context_free(struct ParticleThreadContext *ctx); -void psys_tasks_create(struct ParticleThreadContext *ctx, int totpart, struct ParticleTask **r_tasks, int *r_numtasks); +void psys_tasks_create(struct ParticleThreadContext *ctx, int startpart, int endpart, struct ParticleTask **r_tasks, int *r_numtasks); void psys_tasks_free(struct ParticleTask *tasks, int numtasks); void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3], float zvec[3], float center[3]); diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 291efd0..5d553f5 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -103,6 +103,8 @@ void psys_init_rng(void) static void get_child_modifier_parameters(ParticleSettings *part, ParticleThreadContext *ctx, ChildParticle *cpa, short cpa_from, int cpa_num, float *cpa_fuv, float *orco, ParticleTexture *ptex); +static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSettings *part, ParticleData *par, + int child_index, int face_index, const float fw[4], float *orco, ParticleTexture *ptex, int event, float cfra); extern void do_child_modifiers(ParticleSimulationData *sim, ParticleTexture *ptex, const float par_co[3], const float par_vel[3], const float par_rot[4], const float par_orco[3], ChildParticle *cpa, const float orco[3], float mat[4][4], ParticleKey *state, float t); @@ -1943,9 +1945,11 @@ float *psys_cache_vgroup(DerivedMesh *dm, ParticleSystem *psys, int vgroup) } void psys_find_parents(ParticleSimulationData *sim) { + ParticleSystem *psys = sim->psys; ParticleSettings *part = sim->psys->part; KDTree *tree; ChildParticle *cpa; + ParticleTexture ptex; int p, totparent, totchild = sim->psys->totchild; float co[3], orco[3]; int from = PART_FROM_FACE; @@ -1963,7 +1967,13 @@ void psys_find_parents(ParticleSimulationData *sim) for (p = 0, cpa = sim->psys->child; p < totparent; p++, cpa++) { psys_particle_on_emitter(sim->psmd, from, cpa->num, DMCACHE_ISCHILD, cpa->fuv, cpa->foffset, co, 0, 0, 0, orco, 0); - BLI_kdtree_insert(tree, p, orco); + + /* Check if particle doesn't exist because of texture influence. Insert only existing particles into kdtree. */ + get_cpa_texture(sim->psmd->dm, psys, part, psys->particles + cpa->pa[0], p, cpa->num, cpa->fuv, orco, &ptex, PAMAP_DENS | PAMAP_CHILD, psys->cfra); + + if (ptex.exist >= psys_frand(psys, p + 24)) { + BLI_kdtree_insert(tree, p, orco); + } } BLI_kdtree_balance(tree); @@ -2273,7 +2283,7 @@ static void psys_thread_create_path(ParticleTask *task, struct ChildParticle *cp ParticleCacheKey *par = NULL; float par_co[3]; float par_orco[3]; - + if (ctx->totparent) { if (i >= ctx->totparent) { pa = &psys->particles[cpa->parent]; @@ -2284,6 +2294,16 @@ static void psys_thread_create_path(ParticleTask *task, struct ChildParticle *cp else if (cpa->parent >= 0) { pa = &psys->particles[cpa->parent]; par = pcache[cpa->parent]; + + /* If particle is unexisting, try to pick a viable parent from particles used for interpolation. */ + for (k = 0; k < 4 && pa && (p
[Bf-blender-cvs] [b690f22] gooseberry: Basic drawing code for strands loaded from caches.
Commit: b690f220e2305407e191b3d732d9759fa3d4dcfa Author: Lukas Tönne Date: Wed Mar 25 18:07:03 2015 +0100 Branches: gooseberry https://developer.blender.org/rBb690f220e2305407e191b3d732d9759fa3d4dcfa Basic drawing code for strands loaded from caches. This is entirely separate from particle systems and their insane drawing function. === M source/blender/blenkernel/BKE_strands.h M source/blender/editors/space_view3d/CMakeLists.txt A source/blender/editors/space_view3d/drawstrands.c M source/blender/editors/space_view3d/view3d_draw.c M source/blender/editors/space_view3d/view3d_intern.h M source/blender/pointcache/alembic/abc_particles.cpp M source/blender/pointcache/alembic/abc_particles.h === diff --git a/source/blender/blenkernel/BKE_strands.h b/source/blender/blenkernel/BKE_strands.h index 22e9c4b..f19c137 100644 --- a/source/blender/blenkernel/BKE_strands.h +++ b/source/blender/blenkernel/BKE_strands.h @@ -53,6 +53,7 @@ BLI_INLINE void BKE_strand_iter_init(StrandIterator *iter, Strands *strands) iter->tot = strands->totcurves; iter->index = 0; iter->curve = strands->curves; + iter->verts = strands->verts; } BLI_INLINE bool BKE_strand_iter_valid(StrandIterator *iter) diff --git a/source/blender/editors/space_view3d/CMakeLists.txt b/source/blender/editors/space_view3d/CMakeLists.txt index ab69e67..7d36931 100644 --- a/source/blender/editors/space_view3d/CMakeLists.txt +++ b/source/blender/editors/space_view3d/CMakeLists.txt @@ -45,6 +45,7 @@ set(SRC drawmesh.c drawobject.c drawsimdebug.c + drawstrands.c drawvolume.c space_view3d.c view3d_buttons.c diff --git a/source/blender/editors/space_view3d/drawstrands.c b/source/blender/editors/space_view3d/drawstrands.c new file mode 100644 index 000..ccc5d67 --- /dev/null +++ b/source/blender/editors/space_view3d/drawstrands.c @@ -0,0 +1,121 @@ +/* + * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2014 by the Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Lukas Toenne + * + * * END GPL LICENSE BLOCK * + */ + +/** \file blender/editors/space_view3d/drawsimdebug.c + * \ingroup spview3d + */ + +#include "MEM_guardedalloc.h" + +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_view3d_types.h" +#include "DNA_object_types.h" + +#include "BLI_blenlib.h" +#include "BLI_math.h" +#include "BLI_utildefines.h" + +#include "BKE_global.h" +#include "BKE_strands.h" + +#include "view3d_intern.h" + +#include "BIF_gl.h" +#include "BIF_glutil.h" + +#include "UI_resources.h" + +static void draw_strand_lines(Strands *strands, short dflag) +{ + GLint polygonmode[2]; + StrandIterator it_strand; + + glGetIntegerv(GL_POLYGON_MODE, polygonmode); + glEnableClientState(GL_VERTEX_ARRAY); + + /* setup gl flags */ +// glEnableClientState(GL_NORMAL_ARRAY); + + if ((dflag & DRAW_CONSTCOLOR) == 0) { +// if (part->draw_col == PART_DRAW_COL_MAT) +// glEnableClientState(GL_COLOR_ARRAY); + } + + glColor3f(1,1,1); +// glEnable(GL_LIGHTING); +// glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); +// glEnable(GL_COLOR_MATERIAL); + + for (BKE_strand_iter_init(&it_strand, strands); BKE_strand_iter_valid(&it_strand); BKE_strand_iter_next(&it_strand)) { + if (it_strand.tot <= 0) + continue; + + glVertexPointer(3, GL_FLOAT, sizeof(StrandsVertex), it_strand.verts->co); +// glNormalPointer(GL_FLOAT, sizeof(StrandsVertex), it_strand.verts->nor); + if ((dflag & DRAW_CONSTCOLOR) == 0) { +// if (part->draw_col == PART_DRAW_COL_MAT) { +// glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col); +// } + } + + glDrawArrays(GL_LINE_STRIP, 0, it_strand.c
[Bf-blender-cvs] [9fc1a29] master: Fix 2 typos ( shakin' hands )
Commit: 9fc1a29de35bd9ac453884d106ec5694539f989e Author: Jens Verwiebe Date: Wed Mar 25 16:56:43 2015 +0100 Branches: master https://developer.blender.org/rB9fc1a29de35bd9ac453884d106ec5694539f989e Fix 2 typos ( shakin' hands ) === M intern/cycles/kernel/kernel_shader.h === diff --git a/intern/cycles/kernel/kernel_shader.h b/intern/cycles/kernel/kernel_shader.h index 17e5db9..71b2f74 100644 --- a/intern/cycles/kernel/kernel_shader.h +++ b/intern/cycles/kernel/kernel_shader.h @@ -798,8 +798,8 @@ ccl_device void shader_eval_surface(KernelGlobals *kg, ShaderData *sd, #else sd->closure->weight = make_float3(0.8f, 0.8f, 0.8f); sd->closure->N = sd->N; - sd->closyre->data0 = 0.0f; - sd->closyre->data1 = 0.0f; + sd->closure->data0 = 0.0f; + sd->closure->data1 = 0.0f; sd->flag |= bsdf_diffuse_setup(&sd->closure); #endif } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [aebc04e] gooseberry: Smoke cache offset (start frame) feature.
Commit: aebc04ec1f818610f1cc43d210b072ea6227f689 Author: Lukas Tönne Date: Wed Mar 25 15:56:05 2015 +0100 Branches: gooseberry https://developer.blender.org/rBaebc04ec1f818610f1cc43d210b072ea6227f689 Smoke cache offset (start frame) feature. This lets users set a start frame at which a cached smoke simulation starts. This offset is simply subtracted from the current scene frame for evaluating the cache. === M release/scripts/startup/bl_ui/properties_physics_smoke.py M source/blender/blenkernel/intern/smoke.c M source/blender/makesdna/DNA_smoke_types.h M source/blender/makesrna/intern/rna_smoke.c === diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py index 63268bc..b2f7962 100644 --- a/release/scripts/startup/bl_ui/properties_physics_smoke.py +++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py @@ -309,6 +309,7 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel): layout.label(text="Compression:") layout.prop(md, "point_cache_compress_type", expand=True) +layout.prop(md, "point_cache_offset", text="Start Frame") point_cache_ui(self, context, cache, (cache.is_baked is False), 'SMOKE') diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index aa8649b..54e9b8c 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -2671,7 +2671,7 @@ static void smokeModifier_process(SmokeModifierData *smd, Scene *scene, Object * int startframe, endframe, framenr; float timescale; - framenr = scene->r.cfra; + framenr = scene->r.cfra - sds->point_cache_offset; //printf("time: %d\n", scene->r.cfra); diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h index 25c98b4..c774e40 100644 --- a/source/blender/makesdna/DNA_smoke_types.h +++ b/source/blender/makesdna/DNA_smoke_types.h @@ -137,6 +137,8 @@ typedef struct SmokeDomainSettings { /* Smoke uses only one cache from now on (index [0]), but keeping the array for now for reading old files. */ struct PointCache *point_cache[2]; /* definition is in DNA_object_force.h */ struct ListBase ptcaches[2]; + int point_cache_offset; + int pad; struct EffectorWeights *effector_weights; int border_collisions; /* How domain border collisions are handled */ float time_scale; diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index 55262a9..ed6bfef 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -414,6 +414,14 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, smoke_cache_comp_items); RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used"); + prop = RNA_def_property(srna, "point_cache_offset", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "point_cache_offset"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_range(prop, -1, 1); + RNA_def_property_ui_range(prop, -1, 1, 1, -1); + RNA_def_property_ui_text(prop, "Point Cache Offset", "Offset to add to cached frames"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_update"); + prop = RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "border_collisions"); RNA_def_property_enum_items(prop, smoke_domain_colli_items); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [be72ad6] gooseberry: Simplified data structure and reading code for strands in Alembic caches.
Commit: be72ad615a68c48d27ad615d5de0f30fc93778f5 Author: Lukas Tönne Date: Wed Mar 25 15:08:02 2015 +0100 Branches: gooseberry https://developer.blender.org/rBbe72ad615a68c48d27ad615d5de0f30fc93778f5 Simplified data structure and reading code for strands in Alembic caches. === M source/blender/blenkernel/BKE_strands.h M source/blender/blenkernel/intern/strands.c M source/blender/pointcache/alembic/abc_particles.cpp === diff --git a/source/blender/blenkernel/BKE_strands.h b/source/blender/blenkernel/BKE_strands.h index 950df1c..22e9c4b 100644 --- a/source/blender/blenkernel/BKE_strands.h +++ b/source/blender/blenkernel/BKE_strands.h @@ -21,28 +21,20 @@ #include "BLI_utildefines.h" -#define STRANDS_BLOCK_SIZE (1 << 14) /* 16384 */ -#define STRANDS_INDEX_TO_BLOCK(i) ((i) >> 14) -#define STRANDS_INDEX_TO_BLOCK_OFFSET(i)((i) - STRANDS_INDEX_TO_BLOCK((i))) -#define STRANDS_BLOCK_TO_INDEX(block, offset) ((block) * STRANDS_BLOCK_SIZE + (offset)) - -typedef struct StrandsVertexBlock { - float co[STRANDS_BLOCK_SIZE][3]; - float vel[STRANDS_BLOCK_SIZE][3]; - float rot[STRANDS_BLOCK_SIZE][4]; - float col[STRANDS_BLOCK_SIZE][3]; - float time[STRANDS_BLOCK_SIZE]; -} StrandsVertexBlock; - -typedef struct StrandsBlock { - int numverts[STRANDS_BLOCK_SIZE]; - int parent[STRANDS_BLOCK_SIZE]; -} StrandsBlock; +typedef struct StrandsVertex { + float co[3]; + float time; + float weight; +} StrandsVertex; + +typedef struct StrandsCurve { + int numverts; +} StrandsCurve; typedef struct Strands { - StrandsBlock *strands; - StrandsVertexBlock *verts; - int totstrands, totverts; + StrandsCurve *curves; + StrandsVertex *verts; + int totcurves, totverts; } Strands; struct Strands *BKE_strands_new(int strands, int verts); @@ -50,83 +42,55 @@ void BKE_strands_free(struct Strands *strands); /* - */ -#if 0 -typedef struct StrandsIterator { - int totstrands; /* total number of strands to loop over */ - int strand_index, strand_block; /* index of current strand and index in the block */ - int vertex_start, vertex_block_next; - - int *numverts, *parent; -} StrandsIterator; +typedef struct StrandIterator { + int index, tot; + StrandsCurve *curve; + StrandsVertex *verts; +} StrandIterator; -BLI_INLINE void BKE_strands_iter_init(StrandsIterator *iter, Strands *strands) +BLI_INLINE void BKE_strand_iter_init(StrandIterator *iter, Strands *strands) { - iter->strand_index = 0; - iter->strand_block = 0; - iter->totstrands = strands->totstrands; - - iter->vertex_start = 0; - iter->vertex_block_next = 0; - - iter->numverts = strands->strands->numverts; - iter->parent = strands->strands->parent; + iter->tot = strands->totcurves; + iter->index = 0; + iter->curve = strands->curves; } -BLI_INLINE bool BKE_strands_iter_valid(StrandsIterator *iter) +BLI_INLINE bool BKE_strand_iter_valid(StrandIterator *iter) { - return (iter->strand_index < iter->totstrands); + return iter->index < iter->tot; } -BLI_INLINE void BKE_strand_iter_next(StrandsIterator *iter) +BLI_INLINE void BKE_strand_iter_next(StrandIterator *iter) { - int numverts = *iter->numverts; - - ++iter->strand_index; - ++iter->strand_block; - if (iter->strand_block > STRANDS_BLOCK_SIZE) - iter->strand_block -= STRANDS_BLOCK_SIZE; + const int numverts = iter->curve->numverts; - iter->vertex_start += numverts; - iter->vertex_block_next += numverts; - if (iter->vertex_block_next > STRANDS_BLOCK_SIZE) - iter->vertex_block_next = 0; + ++iter->index; + ++iter->curve; + iter->verts += numverts; } -#endif -#if 0 -typedef struct StrandsIterator { - int strand_index, vertex_index; - int strand_block, vertex_block; - int totstrands, totverts; - float *co[3], *vel[3], *rot[4], *col[3], *time; -} StrandsIterator; +typedef struct StrandVertexIterator { + int index, tot; + StrandsVertex *vertex; +} StrandVertexIterator; -BLI_INLINE void BKE_strands_iter_init(StrandsIterator *iter, Strands *strands) +BLI_INLINE void BKE_strand_vertex_iter_init(StrandVertexIterator *iter, StrandIterator *strand_iter) { - iter->strand_index = 0; - iter->strand_block = 0; - iter->totstrands = strands->totstrands; - iter->totverts = strands->totverts; - iter->vertex_index = 0; - iter->vertex_block = 0; - iter->co = strands->verts->co; - iter->vel = strands->verts->vel; - iter->rot = stra
[Bf-blender-cvs] [4fd2f67] master: Fix T44133 SSAO in OpenGL rendering from orthographic camera did not work
Commit: 4fd2f678ea07fcd69dffce10fbfd0b19ccdc3782 Author: Antony Riakiotakis Date: Wed Mar 25 15:05:36 2015 +0100 Branches: master https://developer.blender.org/rB4fd2f678ea07fcd69dffce10fbfd0b19ccdc3782 Fix T44133 SSAO in OpenGL rendering from orthographic camera did not work Safe to include in final release === M source/blender/editors/render/render_opengl.c === diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 402e72d..d8da0e9 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -223,7 +223,12 @@ static void screen_opengl_render_apply(OGLRender *oglrender) /*int is_ortho = scene->r.mode & R_ORTHO;*/ camera = v3d->camera; RE_GetCameraWindow(oglrender->re, camera, scene->r.cfra, winmat); - is_persp = true; + if (camera->type == OB_CAMERA) { + Camera *cam = camera->data; + is_persp = cam->type == CAM_PERSP; + } + else + is_persp = true; BKE_camera_to_gpu_dof(camera, &fx_settings); } else { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d92b6cb] gooseberry: Revert "Disable cuda binaries on the buildbot for the gooseberry branch."
Commit: d92b6cba6798d2120497e160524bcd84c8b8bff5 Author: Lukas Tönne Date: Wed Mar 25 14:46:30 2015 +0100 Branches: gooseberry https://developer.blender.org/rBd92b6cba6798d2120497e160524bcd84c8b8bff5 Revert "Disable cuda binaries on the buildbot for the gooseberry branch." This reverts commit 83da7b1edba27aaeef0a6d4e3114390305f7dc02. === M build_files/buildbot/config/user-config-cuda-glibc211-x86_64.py === diff --git a/build_files/buildbot/config/user-config-cuda-glibc211-x86_64.py b/build_files/buildbot/config/user-config-cuda-glibc211-x86_64.py index 0623858..29b1b9f 100644 --- a/build_files/buildbot/config/user-config-cuda-glibc211-x86_64.py +++ b/build_files/buildbot/config/user-config-cuda-glibc211-x86_64.py @@ -2,6 +2,4 @@ BF_BUILDDIR = '../blender-build/linux-glibc211-x86_64' BF_INSTALLDIR = '../blender-install/linux-glibc211-x86_64' BF_NUMJOBS = 1 -# XXX disabled cuda bins for gooseberry branch for faster builds -#BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52'] -BF_CYCLES_CUDA_BINARIES_ARCH = [] +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52'] ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [83da7b1] gooseberry: Disable cuda binaries on the buildbot for the gooseberry branch.
Commit: 83da7b1edba27aaeef0a6d4e3114390305f7dc02 Author: Lukas Tönne Date: Wed Mar 25 14:44:47 2015 +0100 Branches: gooseberry https://developer.blender.org/rB83da7b1edba27aaeef0a6d4e3114390305f7dc02 Disable cuda binaries on the buildbot for the gooseberry branch. Doing this increases build times too much for fast updates. === M build_files/buildbot/config/user-config-cuda-glibc211-x86_64.py === diff --git a/build_files/buildbot/config/user-config-cuda-glibc211-x86_64.py b/build_files/buildbot/config/user-config-cuda-glibc211-x86_64.py index 29b1b9f..0623858 100644 --- a/build_files/buildbot/config/user-config-cuda-glibc211-x86_64.py +++ b/build_files/buildbot/config/user-config-cuda-glibc211-x86_64.py @@ -2,4 +2,6 @@ BF_BUILDDIR = '../blender-build/linux-glibc211-x86_64' BF_INSTALLDIR = '../blender-install/linux-glibc211-x86_64' BF_NUMJOBS = 1 -BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52'] +# XXX disabled cuda bins for gooseberry branch for faster builds +#BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52'] +BF_CYCLES_CUDA_BINARIES_ARCH = [] ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1a866d5] master: Fix crash with computers not supporting high quality depth of field.
Commit: 1a866d55acce90406e6430f85f3d88335c4f686d Author: Antony Riakiotakis Date: Wed Mar 25 14:43:28 2015 +0100 Branches: master https://developer.blender.org/rB1a866d55acce90406e6430f85f3d88335c4f686d Fix crash with computers not supporting high quality depth of field. === M source/blender/gpu/intern/gpu_compositing.c === diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c index 6a7805b..f850b6f 100644 --- a/source/blender/gpu/intern/gpu_compositing.c +++ b/source/blender/gpu/intern/gpu_compositing.c @@ -390,7 +390,12 @@ bool GPU_fx_compositor_initialize_passes( /* create textures for dof effect */ if (fx_flag & GPU_FX_FLAG_DOF) { - bool dof_high_quality = (fx_settings->dof->high_quality != 0); + bool dof_high_quality = (fx_settings->dof->high_quality != 0) && + GPU_geometry_shader_support() && GPU_instanced_drawing_support(); + + /* cleanup buffers if quality setting has changed (no need to keep more buffers around than necessary ) */ + if (dof_high_quality != fx->dof_high_quality) + cleanup_fx_dof_buffers(fx); if (dof_high_quality) { fx->dof_downsampled_w = w / 2; @@ -469,7 +474,7 @@ bool GPU_fx_compositor_initialize_passes( } } - fx->dof_high_quality = dof_high_quality && GPU_geometry_shader_support() && GPU_instanced_drawing_support(); + fx->dof_high_quality = dof_high_quality; } else { /* cleanup unnecessary buffers */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1c329af] master: Fix T44026: ID prop delete leaves names in _RNA_UI
Commit: 1c329af74cb2720fbb2e24a58ae15046d5c5c957 Author: Campbell Barton Date: Thu Mar 26 00:10:39 2015 +1100 Branches: master https://developer.blender.org/rB1c329af74cb2720fbb2e24a58ae15046d5c5c957 Fix T44026: ID prop delete leaves names in _RNA_UI === M release/scripts/modules/rna_prop_ui.py M release/scripts/startup/bl_operators/wm.py === diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py index f464945..44722fa 100644 --- a/release/scripts/modules/rna_prop_ui.py +++ b/release/scripts/modules/rna_prop_ui.py @@ -32,6 +32,13 @@ def rna_idprop_ui_get(item, create=True): return None +def rna_idprop_ui_del(item): +try: +del item['_RNA_UI'] +except KeyError: +pass + + def rna_idprop_ui_prop_get(item, prop, create=True): rna_ui = rna_idprop_ui_get(item, create) @@ -46,7 +53,7 @@ def rna_idprop_ui_prop_get(item, prop, create=True): return rna_ui[prop] -def rna_idprop_ui_prop_clear(item, prop): +def rna_idprop_ui_prop_clear(item, prop, remove=True): rna_ui = rna_idprop_ui_get(item, False) if rna_ui is None: @@ -54,8 +61,10 @@ def rna_idprop_ui_prop_clear(item, prop): try: del rna_ui[prop] -except: +except KeyError: pass +if remove and len(item.keys()) == 1: +rna_idprop_ui_del(item) def rna_idprop_context_value(context, context_member, property_type): diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index a48415c..7ac9fa4 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -1296,9 +1296,13 @@ class WM_OT_properties_remove(Operator): property = rna_property def execute(self, context): +from rna_prop_ui import rna_idprop_ui_prop_clear data_path = self.data_path item = eval("context.%s" % data_path) -del item[self.property] +prop = self.property +del item[prop] +rna_idprop_ui_prop_clear(item, prop) + return {'FINISHED'} ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2891298] gooseberry: Fix wrong time sampling in customdata array properties.
Commit: 2891298ad26b6970fdb0899a537e442166adf00a Author: Lukas Tönne Date: Wed Mar 25 13:35:52 2015 +0100 Branches: gooseberry https://developer.blender.org/rB2891298ad26b6970fdb0899a537e442166adf00a Fix wrong time sampling in customdata array properties. The time sampling should be specified explicitly when creating properties. === M source/blender/pointcache/alembic/abc_customdata.cpp M source/blender/pointcache/alembic/abc_customdata.h M source/blender/pointcache/alembic/abc_mesh.cpp M source/blender/pointcache/alembic/abc_writer.h === diff --git a/source/blender/pointcache/alembic/abc_customdata.cpp b/source/blender/pointcache/alembic/abc_customdata.cpp index 6f60a7f..a55270e 100644 --- a/source/blender/pointcache/alembic/abc_customdata.cpp +++ b/source/blender/pointcache/alembic/abc_customdata.cpp @@ -376,6 +376,11 @@ CustomDataWriter::~CustomDataWriter() } } +void CustomDataWriter::init(TimeSamplingPtr time_sampling) +{ + m_time_sampling = time_sampling; +} + /* unique property name based on either layer name or index */ std::string CustomDataWriter::cdtype_to_name(CustomData *cdata, CustomDataType type, int n) { diff --git a/source/blender/pointcache/alembic/abc_customdata.h b/source/blender/pointcache/alembic/abc_customdata.h index f943242..6201b55 100644 --- a/source/blender/pointcache/alembic/abc_customdata.h +++ b/source/blender/pointcache/alembic/abc_customdata.h @@ -48,6 +48,8 @@ struct CustomDataWriter { CustomDataWriter(const std::string &name, CustomDataMask cdmask); ~CustomDataWriter(); + void init(Abc::TimeSamplingPtr time_sampling); + void write_sample(CustomData *cdata, int num_data, Abc::OCompoundProperty &parent); Abc::OCompoundProperty &props() { return m_props; } @@ -57,7 +59,7 @@ struct CustomDataWriter { { LayerPropsMap::iterator it = m_layer_props.find(name); if (it == m_layer_props.end()) { - PropertyT prop = PropertyT(parent, name, 0); + PropertyT prop = PropertyT(parent, name, m_time_sampling); m_layer_props.insert(LayerPropsPair(name, prop.getPtr())); return prop; } @@ -71,7 +73,7 @@ struct CustomDataWriter { { LayerPropsMap::iterator it = m_layer_props.find(name); if (it == m_layer_props.end()) { - PropertyT prop = PropertyT(parent, name, 0); + PropertyT prop = PropertyT(parent, name, m_time_sampling); m_layer_props.insert(LayerPropsPair(name, prop.getPtr())); return prop; } @@ -86,6 +88,7 @@ private: std::string m_name; CustomDataMask m_cdmask; + Abc::TimeSamplingPtr m_time_sampling; Abc::OCompoundProperty m_props; LayerPropsMap m_layer_props; }; diff --git a/source/blender/pointcache/alembic/abc_mesh.cpp b/source/blender/pointcache/alembic/abc_mesh.cpp index c502b07..7daa3b7 100644 --- a/source/blender/pointcache/alembic/abc_mesh.cpp +++ b/source/blender/pointcache/alembic/abc_mesh.cpp @@ -102,20 +102,26 @@ void AbcDerivedMeshWriter::init_abc(OObject parent) // OCompoundProperty geom_props = schema.getArbGeomParams(); OCompoundProperty user_props = schema.getUserProperties(); - m_prop_vert_normals = ON3fArrayProperty(user_props, "vertex_normals", 0); - m_prop_vert_flag = OCharArrayProperty(user_props, "vertex_flag", 0); - m_prop_vert_bweight = OCharArrayProperty(user_props, "vertex_bweight", 0); - - m_prop_edge_verts = OUInt32ArrayProperty(user_props, "edge_verts", 0); - m_prop_edge_flag = OInt16ArrayProperty(user_props, "edge_flag", 0); - m_prop_edge_crease = OCharArrayProperty(user_props, "edge_crease", 0); - m_prop_edge_bweight = OCharArrayProperty(user_props, "edge_bweight", 0); - - m_prop_poly_mat_nr = OInt16ArrayProperty(user_props, "poly_mat_nr", 0); - m_prop_poly_flag = OCharArrayProperty(user_props, "poly_flag", 0); - - m_prop_loop_verts = OInt32ArrayProperty(user_props, "loop_verts", 0); - m_prop_loop_edges = OInt32ArrayProperty(user_props, "loop_edges", 0); + m_prop_vert_normals = ON3fArrayProperty(user_props, "vertex_normals", frame_sampling()); + m_prop_vert_flag = OCharArrayProperty(user_props, "vertex_flag", frame_sampling()); + m_prop_vert_bweight = OCharArrayProperty(user_props, "vertex_bweight", frame_sampling()); + + m_prop_edge_verts = OUInt32ArrayProperty(user_props, "edge_verts", frame_sampling()); + m_prop_edge_flag = OInt16ArrayProperty(user_props, "edge_flag", frame_sampling()); + m_prop_edge_crease = OCharA
[Bf-blender-cvs] [0ef9f61] master: Attempt to fix an error in compilation of geometry shaders in Intel 4000 cards (see T44072)
Commit: 0ef9f61410b8a22905daa38feb49a2f5d1b845e4 Author: Antony Riakiotakis Date: Wed Mar 25 13:05:52 2015 +0100 Branches: master https://developer.blender.org/rB0ef9f61410b8a22905daa38feb49a2f5d1b845e4 Attempt to fix an error in compilation of geometry shaders in Intel 4000 cards (see T44072) === M source/blender/gpu/shaders/gpu_shader_fx_dof_hq_geo.glsl === diff --git a/source/blender/gpu/shaders/gpu_shader_fx_dof_hq_geo.glsl b/source/blender/gpu/shaders/gpu_shader_fx_dof_hq_geo.glsl index 9f365a0..7918122 100644 --- a/source/blender/gpu/shaders/gpu_shader_fx_dof_hq_geo.glsl +++ b/source/blender/gpu/shaders/gpu_shader_fx_dof_hq_geo.glsl @@ -6,7 +6,7 @@ uniform vec2 layerselection; uniform sampler2D cocbuffer; /* initial uv coordinate */ -varying in vec2 uvcoord[]; +varying in vec2 uvcoord[1]; varying out vec2 particlecoord; varying out vec4 color; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6175507] temp-mball-refactor: correct ifdef'd accumulation normal ifdef
Commit: 61755072665a76712a5dce98dfd00b53affe2c5a Author: Campbell Barton Date: Sat Feb 28 03:36:54 2015 +1100 Branches: temp-mball-refactor https://developer.blender.org/rB61755072665a76712a5dce98dfd00b53affe2c5a correct ifdef'd accumulation normal ifdef === M source/blender/blenkernel/intern/mball_tessellate.c === diff --git a/source/blender/blenkernel/intern/mball_tessellate.c b/source/blender/blenkernel/intern/mball_tessellate.c index 62b3b29..3edb6aa 100644 --- a/source/blender/blenkernel/intern/mball_tessellate.c +++ b/source/blender/blenkernel/intern/mball_tessellate.c @@ -55,6 +55,9 @@ #include "BLI_strict_flags.h" +/* experimental (faster) normal calculation */ +// #define USE_ACCUM_NORMAL + /* Data types */ typedef struct corner { /* corner of a cube */ @@ -391,7 +394,7 @@ static void make_face(PROCESS *process, int i1, int i2, int i3, int i4) { int *cur; -#ifdef MB_ACCUM_NORMAL +#ifdef USE_ACCUM_NORMAL float n[3]; #endif @@ -415,18 +418,18 @@ static void make_face(PROCESS *process, int i1, int i2, int i3, int i4) cur[3] = i4; } -#ifdef MB_ACCUM_NORMAL +#ifdef USE_ACCUM_NORMAL if (i4 == 0) { - normal_tri_v3(n, &process->co[i1 * 3], &process->co[i2 * 3], &process->co[i3 * 3]); + normal_tri_v3(n, process->co[i1], process->co[i2], process->co[i3]); accumulate_vertex_normals( - &process->no[i1 * 3], &process->no[i2 * 3], &process->no[i3 * 3], NULL, n, - &process->co[i1 * 3], &process->co[i2 * 3], &process->co[i3 * 3], NULL); + process->no[i1], process->no[i2], process->no[i3], NULL, n, + process->co[i1], process->co[i2], process->co[i3], NULL); } else { - normal_quad_v3(n, &process->co[i1 * 3], &process->co[i2 * 3], &process->co[i3 * 3], &process->co[i4 * 3]); + normal_quad_v3(n, process->co[i1], process->co[i2], process->co[i3], process->co[i4]); accumulate_vertex_normals( - &process->no[i1 * 3], &process->no[i2 * 3], &process->no[i3 * 3], &process->no[i4 * 3], n, - &process->co[i1 * 3], &process->co[i2 * 3], &process->co[i3 * 3], &process->co[i4 * 3]); + process->no[i1], process->no[i2], process->no[i3], process->no[i4], n, + process->co[i1], process->co[i2], process->co[i3], process->co[i4]); } #endif @@ -839,6 +842,7 @@ static void addtovertices(PROCESS *process, const float v[3], const float no[3]) process->curvertex++; } +#ifndef USE_ACCUM_NORMAL /** * Computes normal from density field at given point. * @@ -874,6 +878,7 @@ static void vnormal(PROCESS *process, const float point[3], float r_no[3]) } #endif } +#endif /* USE_ACCUM_NORMAL */ /** * \return the id of vertex between two corners. @@ -889,8 +894,8 @@ static int vertid(PROCESS *process, const CORNER *c1, const CORNER *c2) converge(process, c1, c2, v); /* position */ -#ifdef MB_ACCUM_NORMAL - no[0] = no[1] = no[2] = 0.0f; +#ifdef USE_ACCUM_NORMAL + zero_v3(no); #else vnormal(process, v, no); #endif ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3d20bf7] master: BKE_mball: split tessellation into its own file
Commit: 3d20bf75cbfa2ea6444a68af860b8ef1db5675a8 Author: Campbell Barton Date: Thu Feb 26 14:39:57 2015 +1100 Branches: master https://developer.blender.org/rB3d20bf75cbfa2ea6444a68af860b8ef1db5675a8 BKE_mball: split tessellation into its own file this has a lot of its own local structs, functions, better to keep isolated from general metaball selection/library logic. === A source/blender/blenkernel/BKE_mball_tessellate.h M source/blender/blenkernel/CMakeLists.txt M source/blender/blenkernel/intern/mball.c A source/blender/blenkernel/intern/mball_tessellate.c === diff --git a/source/blender/blenkernel/BKE_mball_tessellate.h b/source/blender/blenkernel/BKE_mball_tessellate.h new file mode 100644 index 000..e69de29 diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index a826fe2..f19c106 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -119,6 +119,7 @@ set(SRC intern/mask_rasterize.c intern/material.c intern/mball.c + intern/mball_tessellate.c intern/mesh.c intern/mesh_evaluate.c intern/mesh_mapping.c @@ -233,6 +234,7 @@ set(SRC BKE_mask.h BKE_material.h BKE_mball.h + BKE_mball_tessellate.h BKE_mesh.h BKE_mesh_mapping.h BKE_mesh_remap.h diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index ce20636..efc5b23 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -65,119 +65,6 @@ #include "BKE_object.h" #include "BKE_material.h" -/* Data types */ - -typedef struct vertex { /* surface vertex */ - float co[3]; /* position and surface normal */ - float no[3]; -} VERTEX; - -typedef struct vertices { /* list of vertices in polygonization */ - int count, max; /* # vertices, max # allowed */ - VERTEX *ptr;/* dynamically allocated */ -} VERTICES; - -typedef struct corner { /* corner of a cube */ - int i, j, k;/* (i, j, k) is index within lattice */ - float co[3], value; /* location and function value */ - struct corner *next; -} CORNER; - -typedef struct cube { /* partitioning cell (cube) */ - int i, j, k;/* lattice location of cube */ - CORNER *corners[8]; /* eight corners */ -} CUBE; - -typedef struct cubes { /* linked list of cubes acting as stack */ - CUBE cube; /* a single cube */ - struct cubes *next; /* remaining elements */ -} CUBES; - -typedef struct centerlist { /* list of cube locations */ - int i, j, k;/* cube location */ - struct centerlist *next;/* remaining elements */ -} CENTERLIST; - -typedef struct edgelist { /* list of edges */ - int i1, j1, k1, i2, j2, k2; /* edge corner ids */ - int vid;/* vertex id */ - struct edgelist *next; /* remaining elements */ -} EDGELIST; - -typedef struct intlist {/* list of integers */ - int i; /* an integer */ - struct intlist *next; /* remaining elements */ -} INTLIST; - -typedef struct intlists { /* list of list of integers */ - INTLIST *list; /* a list of integers */ - struct intlists *next; /* remaining elements */ -} INTLISTS; - -/* dividing scene using octal tree makes polygonisation faster */ -typedef struct ml_pointer { - struct ml_pointer *next, *prev; - struct MetaElem *ml; -} ml_pointer; - -typedef struct octal_node { - struct octal_node *nodes[8];/* children of current node */ - struct octal_node *parent; /* parent of current node */ - struct ListBase elems; /* ListBase of MetaElem pointers (ml_pointer) */ - float x_min, y_min, z_min; /* 1st border point */ - float x_max, y_max, z_max; /* 7th border point */ - float x, y, z; /* center of node */ - int pos, neg; /* number of positive and negative MetaElements in the node */ - int count; /* number of MetaElems, which belongs to the node */ -} octal_node; - -typedef struct octal_tree { - struct octal_node *first; /* first node */ - int pos, neg; /* number of positive and negative MetaElements in the scene */ - short depth;/* number of scene subdivision */ -} octal_tree; - -struct pgn_elements { - struct pgn_elements *next, *prev; - char *data; -}; - -typedef struct process {/* parameters, function, storage */ - /* ** old G_mb contents ** */ - float thresh; - int totelem; -
[Bf-blender-cvs] [7bc8ddc] master: use BKE_mball_tessellate.h include
Commit: 7bc8ddc6e2f2da8afde91ef01afee4079e7f9a45 Author: Campbell Barton Date: Wed Mar 25 22:36:43 2015 +1100 Branches: master https://developer.blender.org/rB7bc8ddc6e2f2da8afde91ef01afee4079e7f9a45 use BKE_mball_tessellate.h include also remove unused includes === M source/blender/blenkernel/BKE_mball.h M source/blender/blenkernel/BKE_mball_tessellate.h M source/blender/blenkernel/intern/displist.c M source/blender/blenkernel/intern/mball.c M source/blender/blenkernel/intern/mball_tessellate.c === diff --git a/source/blender/blenkernel/BKE_mball.h b/source/blender/blenkernel/BKE_mball.h index c021960..aa9ba45 100644 --- a/source/blender/blenkernel/BKE_mball.h +++ b/source/blender/blenkernel/BKE_mball.h @@ -48,7 +48,6 @@ void BKE_mball_make_local(struct MetaBall *mb); void BKE_mball_cubeTable_free(void); -void BKE_mball_polygonize(struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob, struct ListBase *dispbase); bool BKE_mball_is_basis_for(struct Object *ob1, struct Object *ob2); bool BKE_mball_is_basis(struct Object *ob); struct Object *BKE_mball_basis_find(struct Scene *scene, struct Object *ob); diff --git a/source/blender/blenkernel/BKE_mball_tessellate.h b/source/blender/blenkernel/BKE_mball_tessellate.h index e69de29..a3d3e19 100644 --- a/source/blender/blenkernel/BKE_mball_tessellate.h +++ b/source/blender/blenkernel/BKE_mball_tessellate.h @@ -0,0 +1,34 @@ +/* + * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * * END GPL LICENSE BLOCK * + */ +#ifndef __BKE_MBALL_TESSELLATE_H__ +#define __BKE_MBALL_TESSELLATE_H__ + +/** \file BKE_mball_tessellate.h + * \ingroup bke + */ +struct EvaluationContext; +struct Object; +struct Scene; + +void BKE_mball_polygonize( +struct EvaluationContext *eval_ctx, struct Scene *scene, +struct Object *ob, struct ListBase *dispbase); + +#endif /* __BKE_MBALL_TESSELLATE_H__ */ diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index dd92a82..e5e7515 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -53,6 +53,7 @@ #include "BKE_cdderivedmesh.h" #include "BKE_object.h" #include "BKE_mball.h" +#include "BKE_mball_tessellate.h" #include "BKE_curve.h" #include "BKE_key.h" #include "BKE_anim.h" diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index efc5b23..2503118 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -39,6 +39,7 @@ #include #include #include + #include "MEM_guardedalloc.h" #include "DNA_material_types.h" @@ -46,7 +47,6 @@ #include "DNA_meta_types.h" #include "DNA_scene_types.h" - #include "BLI_blenlib.h" #include "BLI_math.h" #include "BLI_utildefines.h" @@ -54,7 +54,6 @@ #include "BKE_global.h" #include "BKE_main.h" -/* #include "BKE_object.h" */ #include "BKE_animsys.h" #include "BKE_curve.h" #include "BKE_depsgraph.h" diff --git a/source/blender/blenkernel/intern/mball_tessellate.c b/source/blender/blenkernel/intern/mball_tessellate.c index b1bef13..0402494 100644 --- a/source/blender/blenkernel/intern/mball_tessellate.c +++ b/source/blender/blenkernel/intern/mball_tessellate.c @@ -33,31 +33,25 @@ #include #include #include + #include "MEM_guardedalloc.h" -#include "DNA_material_types.h" #include "DNA_object_types.h" #include "DNA_meta_types.h" #include "DNA_scene_types.h" - -#include "BLI_blenlib.h" +#include "BLI_listbase.h" +#include "BLI_path_util.h" #include "BLI_math.h" #include "BLI_utildefines.h" #include "BKE_global.h" -#include "BKE_main.h" -/* #include "BKE_object.h" */ -#include "BKE_animsys.h" -#include "BKE_curve.h" #include "BKE_depsgraph.h" #include "BKE_scene.h" -#include "BKE_library.h" #include "BKE_displist.h" #include "BKE_mball.h" -#include "BKE_object.h" -#include "BKE_material.h" +#include "BKE_mball_tessellate.h" /* own include */ /* Data types */ ___ Bf-blender-cvs mailing list Bf-ble
[Bf-blender-cvs] [7f822bb] gooseberry: Merge branch 'master' into gooseberry
Commit: 7f822bb4dd4187f6fab916ea8943ec039394ad47 Author: Antony Riakiotakis Date: Wed Mar 25 12:39:38 2015 +0100 Branches: gooseberry https://developer.blender.org/rB7f822bb4dd4187f6fab916ea8943ec039394ad47 Merge branch 'master' into gooseberry Conflicts: source/blender/gpu/intern/gpu_buffers.c === === diff --cc source/blender/blenloader/intern/versioning_270.c index 35470e6,50cd393..206b498 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@@ -38,8 -38,8 +38,9 @@@ #include "DNA_camera_types.h" #include "DNA_cloth_types.h" #include "DNA_constraint_types.h" +#include "DNA_key_types.h" #include "DNA_sdna_types.h" + #include "DNA_sequence_types.h" #include "DNA_space_types.h" #include "DNA_screen_types.h" #include "DNA_object_types.h" diff --cc source/blender/editors/space_sequencer/sequencer_intern.h index 37b801d,8db0df5..d426ed6 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@@ -131,10 -131,8 +131,10 @@@ void SEQUENCER_OT_copy(struct wmOperato void SEQUENCER_OT_paste(struct wmOperatorType *ot); void SEQUENCER_OT_rebuild_proxy(struct wmOperatorType *ot); - void SEQUENCER_OT_enable_proxies(struct wmOperatorType *ot); + void SEQUENCER_OT_copy_proxy_settings(struct wmOperatorType *ot); +void SEQUENCER_OT_overdrop_transform(struct wmOperatorType *ot); + /* preview specific operators */ void SEQUENCER_OT_view_all_preview(struct wmOperatorType *ot); diff --cc source/blender/gpu/GPU_buffers.h index 69e1ddd,54153cf..629ac51 --- a/source/blender/gpu/GPU_buffers.h +++ b/source/blender/gpu/GPU_buffers.h @@@ -50,14 -50,11 +50,14 @@@ struct GSet struct GPUVertPointLink; struct PBVH; +typedef void (*GPUBufferCopyFunc)(DerivedMesh *dm, float *varray, int *index, + int *mat_orig_to_new, void *user_data); + typedef struct GPUBuffer { - int size; /* in bytes */ - void *pointer; /* used with vertex arrays */ - unsigned int id;/* used with vertex buffer objects */ - bool use_vbo; /* true for VBOs, false for vertex arrays */ + int size;/* in bytes */ + void *pointer; /* used with vertex arrays */ + unsigned int id; /* used with vertex buffer objects */ + bool use_vbo;/* true for VBOs, false for vertex arrays */ } GPUBuffer; typedef struct GPUBufferMaterial { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ec03ab0] master: Change Enables proxy operator to Copy proxy operator.
Commit: ec03ab021f171bf529746bb440756fbc986b45e7 Author: Antony Riakiotakis Date: Wed Mar 25 12:36:26 2015 +0100 Branches: master https://developer.blender.org/rBec03ab021f171bf529746bb440756fbc986b45e7 Change Enables proxy operator to Copy proxy operator. Allows to change and copy settings much easier, also allows things like directory settings etc to be copied over. === M release/scripts/startup/bl_ui/space_sequencer.py M source/blender/editors/space_sequencer/sequencer_edit.c M source/blender/editors/space_sequencer/sequencer_intern.h M source/blender/editors/space_sequencer/sequencer_ops.c === diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 4f83cc0..feaef35 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -926,24 +926,14 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel): flow.prop(proxy, "directory") if proxy.use_proxy_custom_file: flow.prop(proxy, "filepath") - + layout.label("Enabled Proxies:") -enabled = "" -row = layout.row() -if (proxy.build_25): -enabled += "25% " -if (proxy.build_50): -enabled += "50% " -if (proxy.build_75): -enabled += "75% " -if (proxy.build_100): -enabled += "100% " - -row.label(enabled) -if (proxy.use_overwrite): -layout.label("Overwrite On") -else: -layout.label("Overwrite Off") +col = layout.column() +col.prop(proxy, "build_25") +col.prop(proxy, "build_50") +col.prop(proxy, "build_75") +col.prop(proxy, "build_100") +col.prop(proxy, "use_overwrite") col = layout.column() col.label(text="Build JPEG quality") @@ -956,7 +946,7 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel): col.prop(proxy, "timecode") col = layout.column() -col.operator("sequencer.enable_proxies") +col.operator("sequencer.copy_proxy_settings") col.operator("sequencer.rebuild_proxy") diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index aaf398b..dc37b76 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -3473,24 +3473,31 @@ void SEQUENCER_OT_rebuild_proxy(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER; } -static int sequencer_enable_proxies_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) -{ - return WM_operator_props_dialog_popup(C, op, 10 * UI_UNIT_X, 5 * UI_UNIT_Y); -} - -static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op) +static int sequencer_copy_proxy_settings_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); Editing *ed = BKE_sequencer_editing_get(scene, false); + Sequence *actseq = ed->act_seq; Sequence *seq; - bool proxy_25 = RNA_boolean_get(op->ptr, "proxy_25"); - bool proxy_50 = RNA_boolean_get(op->ptr, "proxy_50"); - bool proxy_75 = RNA_boolean_get(op->ptr, "proxy_75"); - bool proxy_100 = RNA_boolean_get(op->ptr, "proxy_100"); - bool override = RNA_boolean_get(op->ptr, "override"); + StripProxy *actproxy, *proxy; + bool proxy_25; + bool proxy_50; + bool proxy_75; + bool proxy_100; bool turnon = true; - if (ed == NULL || !(proxy_25 || proxy_50 || proxy_75 || proxy_100)) { + if (ed == NULL || actseq == NULL || !actseq->strip || !actseq->strip->proxy) { + return OPERATOR_CANCELLED; + } + + actproxy = actseq->strip->proxy; + + proxy_25 = (actproxy->build_size_flags & SEQ_PROXY_IMAGE_SIZE_25) != 0; + proxy_50 = (actproxy->build_size_flags & SEQ_PROXY_IMAGE_SIZE_50) != 0; + proxy_75 = (actproxy->build_size_flags & SEQ_PROXY_IMAGE_SIZE_75) != 0; + proxy_100 = (actproxy->build_size_flags & SEQ_PROXY_IMAGE_SIZE_100) != 0; + + if (!(proxy_25 || proxy_50 || proxy_75 || proxy_100)) { turnon = false; } @@ -3503,30 +3510,8 @@ static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op) continue; } - if (proxy_25) - seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_25; - else - seq->strip->proxy->build_size_flags
[Bf-blender-cvs] [0561e18] gooseberry: Explicit CD type masks for each element.
Commit: 0561e18f8115e23a99cd0250295762833dacdf96 Author: Lukas Tönne Date: Wed Mar 25 10:32:57 2015 +0100 Branches: gooseberry https://developer.blender.org/rB0561e18f8115e23a99cd0250295762833dacdf96 Explicit CD type masks for each element. Avoid storing redundant normals for vertices. === M source/blender/pointcache/alembic/abc_mesh.cpp === diff --git a/source/blender/pointcache/alembic/abc_mesh.cpp b/source/blender/pointcache/alembic/abc_mesh.cpp index dd37939..c502b07 100644 --- a/source/blender/pointcache/alembic/abc_mesh.cpp +++ b/source/blender/pointcache/alembic/abc_mesh.cpp @@ -43,7 +43,12 @@ using namespace Abc; using namespace AbcGeom; /* CD layers that are stored in generic customdata arrays created with CD_ALLOC */ -static CustomDataMask CD_MASK_CACHE = ~(CD_MASK_MVERT | CD_MASK_MEDGE | CD_MASK_MFACE | CD_MASK_MPOLY | CD_MASK_MLOOP | CD_MASK_BMESH | CD_MASK_MTFACE); +static CustomDataMask CD_MASK_CACHE_EXCLUDE = (CD_MASK_MVERT | CD_MASK_MEDGE | CD_MASK_MFACE | CD_MASK_MPOLY | CD_MASK_MLOOP | CD_MASK_BMESH | CD_MASK_MTFACE); +static CustomDataMask CD_MASK_CACHE_VERT = ~(CD_MASK_CACHE_EXCLUDE | CD_MASK_NORMAL); +static CustomDataMask CD_MASK_CACHE_EDGE = ~(CD_MASK_CACHE_EXCLUDE); +static CustomDataMask CD_MASK_CACHE_FACE = ~(CD_MASK_CACHE_EXCLUDE); +static CustomDataMask CD_MASK_CACHE_POLY = ~(CD_MASK_CACHE_EXCLUDE); +static CustomDataMask CD_MASK_CACHE_LOOP = ~(CD_MASK_CACHE_EXCLUDE); struct MVertSample { std::vector co; @@ -74,11 +79,11 @@ struct MLoopSample { AbcDerivedMeshWriter::AbcDerivedMeshWriter(const std::string &name, Object *ob, DerivedMesh **dm_ptr) : DerivedMeshWriter(ob, dm_ptr, name), -m_vert_data_writer("vertex_data", CD_MASK_CACHE), -m_edge_data_writer("edge_data", CD_MASK_CACHE), -m_face_data_writer("face_data", CD_MASK_CACHE), -m_poly_data_writer("poly_data", CD_MASK_CACHE), -m_loop_data_writer("loop_data", CD_MASK_CACHE) +m_vert_data_writer("vertex_data", CD_MASK_CACHE_VERT), +m_edge_data_writer("edge_data", CD_MASK_CACHE_EDGE), +m_face_data_writer("face_data", CD_MASK_CACHE_FACE), +m_poly_data_writer("poly_data", CD_MASK_CACHE_POLY), +m_loop_data_writer("loop_data", CD_MASK_CACHE_LOOP) { } @@ -311,11 +316,11 @@ void AbcDerivedMeshWriter::write_sample() AbcDerivedMeshReader::AbcDerivedMeshReader(const std::string &name, Object *ob) : DerivedMeshReader(ob, name), -m_vert_data_reader("vertex_data", CD_MASK_CACHE), -m_edge_data_reader("edge_data", CD_MASK_CACHE), -m_face_data_reader("face_data", CD_MASK_CACHE), -m_poly_data_reader("poly_data", CD_MASK_CACHE), -m_loop_data_reader("loop_data", CD_MASK_CACHE) +m_vert_data_reader("vertex_data", CD_MASK_CACHE_VERT), +m_edge_data_reader("edge_data", CD_MASK_CACHE_EDGE), +m_face_data_reader("face_data", CD_MASK_CACHE_FACE), +m_poly_data_reader("poly_data", CD_MASK_CACHE_POLY), +m_loop_data_reader("loop_data", CD_MASK_CACHE_LOOP) { } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8463e6c] master: Fix for crash when using particle emission with clump/roughness curves in a smoke sim.
Commit: 8463e6cb416021d72282e386218118e06226101e Author: Lukas Tönne Date: Wed Mar 25 12:26:16 2015 +0100 Branches: master https://developer.blender.org/rB8463e6cb416021d72282e386218118e06226101e Fix for crash when using particle emission with clump/roughness curves in a smoke sim. This interaction between sims is totally stupid and must be recoded entirely in some utopian future. === M source/blender/blenkernel/intern/smoke.c === diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 559e1e0..aa8649b 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -66,6 +66,7 @@ #include "BKE_bvhutils.h" #include "BKE_cdderivedmesh.h" #include "BKE_collision.h" +#include "BKE_colortools.h" #include "BKE_constraint.h" #include "BKE_customdata.h" #include "BKE_deform.h" @@ -1239,6 +1240,12 @@ static void emit_from_particles(Object *flow_ob, SmokeDomainSettings *sds, Smoke sim.ob = flow_ob; sim.psys = psys; + /* prepare curvemapping tables */ + if ((psys->part->child_flag & PART_CHILD_USE_CLUMP_CURVE) && psys->part->clumpcurve) + curvemapping_changed_all(psys->part->clumpcurve); + if ((psys->part->child_flag & PART_CHILD_USE_ROUGH_CURVE) && psys->part->roughcurve) + curvemapping_changed_all(psys->part->roughcurve); + /* initialize particle cache */ if (psys->part->type == PART_HAIR) { // TODO: PART_HAIR not supported whatsoever ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a180c8e] master: Allow multiple strips to use the same directory when custom proxy directory is used.
Commit: a180c8e2ed6ce62e6a15d28a0bb7f60bb58bc0cb Author: Antony Riakiotakis Date: Wed Mar 25 12:05:34 2015 +0100 Branches: master https://developer.blender.org/rBa180c8e2ed6ce62e6a15d28a0bb7f60bb58bc0cb Allow multiple strips to use the same directory when custom proxy directory is used. This is done by appending the name of the file as extra folder. Existing projects may need to regenerate their proxies but it should be possible now to have all proxies nicely in the same custom folder. Next commits will include operators to copy directory settings between selected strips, making the process faster. === M source/blender/blenkernel/intern/sequencer.c M source/blender/imbuf/IMB_imbuf.h M source/blender/imbuf/intern/indexer.c M source/blender/makesdna/DNA_sequence_types.h === diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 19120d4..eb7736f 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -1364,7 +1364,11 @@ static void seq_open_anim_file(Sequence *seq, bool openfile) if (proxy->storage & SEQ_STORAGE_PROXY_CUSTOM_DIR) { char dir[FILE_MAX]; + char fname[FILE_MAXFILE]; BLI_strncpy(dir, seq->strip->proxy->dir, sizeof(dir)); + IMB_anim_get_fname(seq->anim, fname, FILE_MAXFILE); + BLI_path_append(dir, sizeof(dir), fname); + BLI_path_abs(dir, G.main->name); IMB_anim_set_index_dir(seq->anim, dir); @@ -1390,8 +1394,14 @@ static bool seq_proxy_get_fname(Sequence *seq, int cfra, int render_size, char * * have both, a directory full of jpeg files and proxy avis, so * sorry folks, please rebuild your proxies... */ - if (proxy->storage & (SEQ_STORAGE_PROXY_CUSTOM_DIR | SEQ_STORAGE_PROXY_CUSTOM_FILE)) { + if ((proxy->storage & SEQ_STORAGE_PROXY_CUSTOM_DIR) && (proxy->storage & SEQ_STORAGE_PROXY_CUSTOM_FILE)) { + BLI_strncpy(dir, seq->strip->proxy->dir, sizeof(dir)); + } + else if (seq->anim && (proxy->storage & SEQ_STORAGE_PROXY_CUSTOM_DIR)) { + char fname[FILE_MAXFILE]; BLI_strncpy(dir, seq->strip->proxy->dir, sizeof(dir)); + IMB_anim_get_fname(seq->anim, fname, FILE_MAXFILE); + BLI_path_append(dir, sizeof(dir), fname); } else if (seq->type == SEQ_TYPE_IMAGE) { BLI_snprintf(dir, PROXY_MAXFILE, "%s/BL_proxy", seq->strip->dir); @@ -1402,7 +1412,7 @@ static bool seq_proxy_get_fname(Sequence *seq, int cfra, int render_size, char * if (proxy->storage & SEQ_STORAGE_PROXY_CUSTOM_FILE) { BLI_join_dirfile(name, PROXY_MAXFILE, -dir, seq->strip->proxy->file); +dir, proxy->file); BLI_path_abs(name, G.main->name); return true; @@ -1436,15 +1446,15 @@ static ImBuf *seq_proxy_fetch(const SeqRenderData *context, Sequence *seq, int c int render_size = context->preview_render_size; StripProxy *proxy = seq->strip->proxy; + if (!(seq->flag & SEQ_USE_PROXY)) { + return NULL; + } + /* dirty hack to distinguish 100% render size from PROXY_100 */ if (render_size == 99) { render_size = 100; } - if (!(seq->flag & SEQ_USE_PROXY)) { - return NULL; - } - size_flags = proxy->build_size_flags; /* only use proxies, if they are enabled (even if present!) */ diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index 447a14b..1868230 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -240,6 +240,7 @@ typedef enum IMB_Proxy_Size { /* defaults to BL_proxy within the directory of the animation */ void IMB_anim_set_index_dir(struct anim *anim, const char *dir); +void IMB_anim_get_fname(struct anim *anim, char *file, int size); int IMB_anim_index_get_frame_index(struct anim *anim, IMB_Timecode_Type tc, int position); diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index d028174..183159f 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -374,6 +374,13 @@ static void get_index_dir(struct anim *anim, char *index_dir, size_t index_dir_l } } +void IMB_anim_get_fname(struct anim *anim, char *file, int size) +{ + char fname[FILE_MAXFILE]; + BLI_split_dirfile(anim->name, file, fname, size, sizeof(fname)); + BLI_strncpy(file, fname, size); +} + static void get_proxy_filename(struct anim *anim, IMB_Proxy_Size preview_size,
[Bf-blender-cvs] [22dfb50] master: Fix T44128: Ray visibility only enables diffuse if glossy is also enabled
Commit: 22dfb506229258e293d7ab32a2c495ce93084e9d Author: Sergey Sharybin Date: Wed Mar 25 14:48:41 2015 +0500 Branches: master https://developer.blender.org/rB22dfb506229258e293d7ab32a2c495ce93084e9d Fix T44128: Ray visibility only enables diffuse if glossy is also enabled Issue was caused by accident in c8a9a56 which not only disabled glossy reflection if Glossy visibility is disabled, but also Diffuse reflection. Quite safe and should go to final release branch. === M intern/cycles/kernel/kernel_emission.h === diff --git a/intern/cycles/kernel/kernel_emission.h b/intern/cycles/kernel/kernel_emission.h index 7523105..d3cbc5c 100644 --- a/intern/cycles/kernel/kernel_emission.h +++ b/intern/cycles/kernel/kernel_emission.h @@ -188,7 +188,8 @@ ccl_device_noinline bool indirect_lamp_emission(KernelGlobals *kg, PathState *st /* use visibility flag to skip lights */ if(ls.shader & SHADER_EXCLUDE_ANY) { if(((ls.shader & SHADER_EXCLUDE_DIFFUSE) && (state->flag & PATH_RAY_DIFFUSE)) || - ((ls.shader & SHADER_EXCLUDE_GLOSSY) && (state->flag & PATH_RAY_REFLECT)) || + ((ls.shader & SHADER_EXCLUDE_GLOSSY) && + ((state->flag & (PATH_RAY_GLOSSY|PATH_RAY_REFLECT)) == (PATH_RAY_GLOSSY|PATH_RAY_REFLECT))) || ((ls.shader & SHADER_EXCLUDE_TRANSMIT) && (state->flag & PATH_RAY_TRANSMIT)) || ((ls.shader & SHADER_EXCLUDE_SCATTER) && (state->flag & PATH_RAY_VOLUME_SCATTER))) continue; @@ -232,7 +233,8 @@ ccl_device_noinline float3 indirect_background(KernelGlobals *kg, PathState *sta /* use visibility flag to skip lights */ if(shader & SHADER_EXCLUDE_ANY) { if(((shader & SHADER_EXCLUDE_DIFFUSE) && (state->flag & PATH_RAY_DIFFUSE)) || - ((shader & SHADER_EXCLUDE_GLOSSY) && (state->flag & PATH_RAY_REFLECT)) || + ((shader & SHADER_EXCLUDE_GLOSSY) && + ((state->flag & (PATH_RAY_GLOSSY|PATH_RAY_REFLECT)) == (PATH_RAY_GLOSSY|PATH_RAY_REFLECT))) || ((shader & SHADER_EXCLUDE_TRANSMIT) && (state->flag & PATH_RAY_TRANSMIT)) || ((shader & SHADER_EXCLUDE_CAMERA) && (state->flag & PATH_RAY_CAMERA)) || ((shader & SHADER_EXCLUDE_SCATTER) && (state->flag & PATH_RAY_VOLUME_SCATTER))) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3cee9d6] master: Simplify recent commit
Commit: 3cee9d6939c85afd7eabf9fafbcec7859abef9a0 Author: Campbell Barton Date: Wed Mar 25 20:28:17 2015 +1100 Branches: master https://developer.blender.org/rB3cee9d6939c85afd7eabf9fafbcec7859abef9a0 Simplify recent commit === M source/blender/blenlib/intern/rct.c === diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c index d7ca749..1edc900 100644 --- a/source/blender/blenlib/intern/rct.c +++ b/source/blender/blenlib/intern/rct.c @@ -593,12 +593,14 @@ void BLI_rctf_rotate_expand(rctf *dst, const rctf *src, const float angle) const float cent[2] = {BLI_rctf_cent_x(src), BLI_rctf_cent_y(src)}; float corner[2], corner_rot[2], corder_max[2]; - ARRAY_SET_ITEMS(corner, src->xmin - cent[0], src->ymax - cent[1]); + /* x is same for both corners */ + corner[0] = src->xmax - cent[0]; + corner[1] = src->ymax - cent[1]; ROTATE_SINCOS(corner_rot, mat2, corner); corder_max[0] = fabsf(corner_rot[0]); corder_max[1] = fabsf(corner_rot[1]); - ARRAY_SET_ITEMS(corner, src->xmax - cent[0], src->ymax - cent[1]); + corner[1] *= -1; ROTATE_SINCOS(corner_rot, mat2, corner); corder_max[0] = MAX2(corder_max[0], fabsf(corner_rot[0])); corder_max[1] = MAX2(corder_max[1], fabsf(corner_rot[1])); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b38b584] master: Fix T44124: Crash deleting brush
Commit: b38b5846bac2b7674d9130e943df76f5f3626d6c Author: Campbell Barton Date: Wed Mar 25 20:16:27 2015 +1100 Branches: master https://developer.blender.org/rBb38b5846bac2b7674d9130e943df76f5f3626d6c Fix T44124: Crash deleting brush === M source/blender/editors/space_view3d/view3d_draw.c === diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index a06f6cd..e51993c 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -3636,7 +3636,7 @@ static bool is_cursor_visible(Scene *scene) else if (ob->mode & OB_MODE_TEXTURE_PAINT) { const Paint *p = BKE_paint_get_active(scene); - if (p && p->brush->imagepaint_tool == PAINT_TOOL_CLONE) { + if (p && p->brush && p->brush->imagepaint_tool == PAINT_TOOL_CLONE) { if ((scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_LAYER_CLONE) == 0) { return true; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3eb33b8] master: Fix T44118: Rotated background image disappears
Commit: 3eb33b804d48ac4009184722db02ecaa9d71ef21 Author: Campbell Barton Date: Wed Mar 25 19:46:07 2015 +1100 Branches: master https://developer.blender.org/rB3eb33b804d48ac4009184722db02ecaa9d71ef21 Fix T44118: Rotated background image disappears Image clipping didn't take rotation into account. === M source/blender/blenlib/BLI_rect.h M source/blender/blenlib/intern/rct.c M source/blender/editors/space_view3d/view3d_draw.c === diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h index a132ac4..e0a0b34 100644 --- a/source/blender/blenlib/BLI_rect.h +++ b/source/blender/blenlib/BLI_rect.h @@ -89,6 +89,8 @@ void BLI_rctf_union(struct rctf *rctf1, const struct rctf *rctf2); void BLI_rcti_rctf_copy(struct rcti *dst, const struct rctf *src); void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src); +void BLI_rctf_rotate_expand(rctf *dst, const rctf *src, const float angle); + void print_rctf(const char *str, const struct rctf *rect); void print_rcti(const char *str, const struct rcti *rect); diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c index 61e5783..d7ca749 100644 --- a/source/blender/blenlib/intern/rct.c +++ b/source/blender/blenlib/intern/rct.c @@ -571,3 +571,44 @@ void print_rcti(const char *str, const rcti *rect) printf("%s: xmin %d, xmax %d, ymin %d, ymax %d (%dx%d)\n", str, rect->xmin, rect->xmax, rect->ymin, rect->ymax, BLI_rcti_size_x(rect), BLI_rcti_size_y(rect)); } + + +/* */ +/* Comprehensive math (float only) */ + +/** \name Rect math functions + * \{ */ + +#define ROTATE_SINCOS(r_vec, mat2, vec) { \ + (r_vec)[0] = (mat2)[1] * (vec)[0] + (+(mat2)[0]) * (vec)[1]; \ + (r_vec)[1] = (mat2)[0] * (vec)[0] + (-(mat2)[1]) * (vec)[1]; \ +} ((void)0) + +/** + * Expand the rectangle to fit a rotated \a src. + */ +void BLI_rctf_rotate_expand(rctf *dst, const rctf *src, const float angle) +{ + const float mat2[2] = {sinf(angle), cosf(angle)}; + const float cent[2] = {BLI_rctf_cent_x(src), BLI_rctf_cent_y(src)}; + float corner[2], corner_rot[2], corder_max[2]; + + ARRAY_SET_ITEMS(corner, src->xmin - cent[0], src->ymax - cent[1]); + ROTATE_SINCOS(corner_rot, mat2, corner); + corder_max[0] = fabsf(corner_rot[0]); + corder_max[1] = fabsf(corner_rot[1]); + + ARRAY_SET_ITEMS(corner, src->xmax - cent[0], src->ymax - cent[1]); + ROTATE_SINCOS(corner_rot, mat2, corner); + corder_max[0] = MAX2(corder_max[0], fabsf(corner_rot[0])); + corder_max[1] = MAX2(corder_max[1], fabsf(corner_rot[1])); + + dst->xmin = cent[0] - corder_max[0]; + dst->xmax = cent[0] + corder_max[0]; + dst->ymin = cent[1] - corder_max[1]; + dst->ymax = cent[1] + corder_max[1]; +} + +#undef ROTATE_SINCOS + +/** \} */ diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 86916a3..a06f6cd 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1624,6 +1624,7 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d, ImBuf *ibuf = NULL, *freeibuf, *releaseibuf; void *lock; + rctf clip_rect; Image *ima = NULL; MovieClip *clip = NULL; @@ -1786,8 +1787,12 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d, } /* complete clip? */ + BLI_rctf_init(&clip_rect, x1, x2, y1, y2); + if (bgpic->rotation) { + BLI_rctf_rotate_expand(&clip_rect, &clip_rect, bgpic->rotation); + } - if (x2 < 0 || y2 < 0 || x1 > ar->winx || y1 > ar->winy) { + if (clip_rect.xmax < 0 || clip_rect.ymax < 0 || clip_rect.xmin > ar->winx || clip_rect.ymin > ar->winy) { if (freeibuf) IMB_freeImBuf(freeibuf); if (releaseibuf) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8d0b104] master: Fix T44064: Reroute two-node loop crash
Commit: 8d0b104f4357f5914f3e28d735ebffa1526a598e Author: Sergey Sharybin Date: Wed Mar 25 13:46:59 2015 +0500 Branches: master https://developer.blender.org/rB8d0b104f4357f5914f3e28d735ebffa1526a598e Fix T44064: Reroute two-node loop crash Issue was caused by cycles in shader graph confusing it's simplification stage. Now we're ignoring links which are marked as invalid from blender side so we don't run into such cycles and keep graph code simple. === M intern/cycles/blender/blender_shader.cpp === diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index baf79a7..5628d96 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -951,6 +951,10 @@ static void add_nodes(Scene *scene, BL::BlendData b_data, BL::Scene b_scene, Sha BL::NodeTree::links_iterator b_link; for(b_ntree.links.begin(b_link); b_link != b_ntree.links.end(); ++b_link) { + /* Ignore invalid links to avoid unwanted cycles created in graph. */ + if(!b_link->is_valid()) { + continue; + } /* get blender link data */ BL::NodeSocket b_from_sock = b_link->from_socket(); BL::NodeSocket b_to_sock = b_link->to_socket(); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [917b875] master: Tracking: Fix one frame memory leak when tracking last frame
Commit: 917b8754f9d89b9d0a1488d83e0c5ff308c74e1d Author: Sergey Sharybin Date: Wed Mar 25 13:20:37 2015 +0500 Branches: master https://developer.blender.org/rB917b8754f9d89b9d0a1488d83e0c5ff308c74e1d Tracking: Fix one frame memory leak when tracking last frame === M extern/libmv/libmv/autotrack/autotrack.cc === diff --git a/extern/libmv/libmv/autotrack/autotrack.cc b/extern/libmv/libmv/autotrack/autotrack.cc index 96a0ef6..4c7bdf1 100644 --- a/extern/libmv/libmv/autotrack/autotrack.cc +++ b/extern/libmv/libmv/autotrack/autotrack.cc @@ -154,6 +154,7 @@ bool AutoTrack::TrackMarker(Marker* tracked_marker, frame_accessor_, &tracked_image); if (!tracked_key) { +frame_accessor_->ReleaseImage(reference_key); LG << "Couldn't get frame for tracked marker: " << tracked_marker; return false; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ad75477] decklink: First working implementation of VideoDeckLink.
Commit: ad75477f1c8b43001641d9e8c8143ce5b77155aa Author: Benoit Bolsee Date: Wed Mar 25 08:53:36 2015 +0100 Branches: decklink https://developer.blender.org/rBad75477f1c8b43001641d9e8c8143ce5b77155aa First working implementation of VideoDeckLink. Doc: TBD BL_Shader: allows to pass partially defined shader (e.g fragment without vertex) === M source/gameengine/Ketsji/BL_Shader.cpp M source/gameengine/VideoTexture/Exception.h M source/gameengine/VideoTexture/VideoDeckLink.cpp M source/gameengine/VideoTexture/VideoDeckLink.h === diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index a59c368..a7d42f2 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -285,11 +285,11 @@ void BL_Shader::UnloadShader() bool BL_Shader::LinkProgram() { - int vertlen = 0, fraglen=0, proglen=0; - int vertstatus=0, fragstatus=0, progstatus=0; - unsigned int tmpVert=0, tmpFrag=0, tmpProg=0; - int char_len=0; - char *logInf =0; + int vertlen = 0, fraglen = 0, proglen = 0; + int vertstatus = 0, fragstatus = 0, progstatus = 0; + unsigned int tmpVert = 0, tmpFrag = 0, tmpProg = 0; + int char_len = 0; + char *logInf = 0; if (mError) goto programError; @@ -298,67 +298,78 @@ bool BL_Shader::LinkProgram() spit("Invalid GLSL sources"); return false; } - if ( !GLEW_ARB_fragment_shader) { + if (!GLEW_ARB_fragment_shader) { spit("Fragment shaders not supported"); return false; } - if ( !GLEW_ARB_vertex_shader) { + if (!GLEW_ARB_vertex_shader) { spit("Vertex shaders not supported"); return false; } - - // -- vertex shader -- - tmpVert = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB); - glShaderSourceARB(tmpVert, 1, (const char**)&vertProg, 0); - glCompileShaderARB(tmpVert); - glGetObjectParameterivARB(tmpVert, GL_OBJECT_INFO_LOG_LENGTH_ARB,(GLint*) &vertlen); - - // print info if any - if ( vertlen > 0 && vertlen < MAX_LOG_LEN) { - logInf = (char*)MEM_mallocN(vertlen, "vert-log"); - glGetInfoLogARB(tmpVert, vertlen, (GLsizei*)&char_len, logInf); - if (char_len >0) { - spit(" Vertex Shader Error "); - spit(logInf); + if (vertProg[0] != 0) + { + // -- vertex shader -- + tmpVert = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB); + glShaderSourceARB(tmpVert, 1, (const char**)&vertProg, 0); + glCompileShaderARB(tmpVert); + glGetObjectParameterivARB(tmpVert, GL_OBJECT_INFO_LOG_LENGTH_ARB, (GLint*)&vertlen); + + // print info if any + if (vertlen > 0 && vertlen < MAX_LOG_LEN) { + logInf = (char*)MEM_mallocN(vertlen, "vert-log"); + glGetInfoLogARB(tmpVert, vertlen, (GLsizei*)&char_len, logInf); + if (char_len > 0) { + spit(" Vertex Shader Error "); + spit(logInf); + } + MEM_freeN(logInf); + logInf = 0; + } + // check for compile errors + glGetObjectParameterivARB(tmpVert, GL_OBJECT_COMPILE_STATUS_ARB, (GLint*)&vertstatus); + if (!vertstatus) { + spit(" Vertex shader failed to compile "); + goto programError; } - MEM_freeN(logInf); - logInf=0; - } - // check for compile errors - glGetObjectParameterivARB(tmpVert, GL_OBJECT_COMPILE_STATUS_ARB,(GLint*)&vertstatus); - if (!vertstatus) { - spit(" Vertex shader failed to compile "); - goto programError; } - // -- fragment shader - tmpFrag = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB); - glShaderSourceARB(tmpFrag, 1,(const char**)&fragProg, 0); - glCompileShaderARB(tmpFrag); - glGetObjectParameterivARB(tmpFrag, GL_OBJECT_INFO_LOG_LENGTH_ARB, (GLint*) &fraglen); - if (fraglen >0 && fraglen < MAX_LOG_LEN) { - logInf = (char*)MEM_mallocN(fraglen, "frag-log"); - glGetInfoLogARB(tmpFrag, fraglen,(GLsizei*) &char_len, logInf); - if (char_len >0) { - spit(" Fragment Shader Error "); - spit(logInf); + if (fragProg[0] != 0) + { + // -- fragment shader