From 8a6a3dbb547bc87759fda875ad2fdd85bb32835c Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sun, 23 Oct 2011 19:39:20 +0000 Subject: [PATCH 01/10] Fix for commit 41227 (Some opening comment tags (/*) were lost!). --- intern/itasc/ConstraintSet.cpp | 6 +++--- intern/itasc/ControlledObject.cpp | 2 +- intern/itasc/CopyPose.cpp | 2 +- intern/itasc/Scene.cpp | 18 +++++++++--------- intern/itasc/WDLSSolver.cpp | 6 +++--- intern/itasc/WSDLSSolver.cpp | 8 ++++---- source/blender/quicktime/quicktime_export.h | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/intern/itasc/ConstraintSet.cpp b/intern/itasc/ConstraintSet.cpp index e21cd36e4c8..74926df3092 100644 --- a/intern/itasc/ConstraintSet.cpp +++ b/intern/itasc/ConstraintSet.cpp @@ -80,7 +80,7 @@ void ConstraintSet::modelUpdate(Frame& _external_pose,const Timestamp& timestamp double ConstraintSet::getMaxTimestep(double& timestep) { - e_scalar maxChidot = m_chidot.array().abs().maxCoeff(); + e_scalar maxChidot = m_chidot.cwise().abs().maxCoeff(); if (timestep*maxChidot > m_maxDeltaChi) { timestep = m_maxDeltaChi/maxChidot; } @@ -162,9 +162,9 @@ bool ConstraintSet::closeLoop(){ }else m_B.row(i) = m_U.col(i)/m_S(i); - m_Jf_inv.noalias()=m_V*m_B; + m_Jf_inv=(m_V*m_B).lazy(); - m_chi.noalias()+=m_Jf_inv*m_tdelta; + m_chi+=(m_Jf_inv*m_tdelta).lazy(); updateJacobian(); // m_externalPose-m_internalPose in end effector frame // this is just to compare the pose, a different formula would work too diff --git a/intern/itasc/ControlledObject.cpp b/intern/itasc/ControlledObject.cpp index 4055aad7768..773370b6d2e 100644 --- a/intern/itasc/ControlledObject.cpp +++ b/intern/itasc/ControlledObject.cpp @@ -54,7 +54,7 @@ const e_matrix& ControlledObject::getJq(unsigned int ee) const double ControlledObject::getMaxTimestep(double& timestep) { - e_scalar maxQdot = m_qdot.array().abs().maxCoeff(); + e_scalar maxQdot = m_qdot.cwise().abs().maxCoeff(); if (timestep*maxQdot > m_maxDeltaQ) { timestep = m_maxDeltaQ/maxQdot; } diff --git a/intern/itasc/CopyPose.cpp b/intern/itasc/CopyPose.cpp index a9d4c2f0a2a..133d6de2069 100644 --- a/intern/itasc/CopyPose.cpp +++ b/intern/itasc/CopyPose.cpp @@ -473,7 +473,7 @@ double CopyPose::getMaxTimestep(double& timestep) // CopyPose should not have any limit on linear velocity: // in case the target is out of reach, this can be very high. // We will simply limit on rotation - e_scalar maxChidot = m_chidot.block(3,0,3,1).array().abs().maxCoeff(); + e_scalar maxChidot = m_chidot.block(3,0,3,1).cwise().abs().maxCoeff(); if (timestep*maxChidot > m_maxDeltaChi) { timestep = m_maxDeltaChi/maxChidot; } diff --git a/intern/itasc/Scene.cpp b/intern/itasc/Scene.cpp index 16f8551bfc7..9b8c5e5cd4c 100644 --- a/intern/itasc/Scene.cpp +++ b/intern/itasc/Scene.cpp @@ -356,7 +356,7 @@ bool Scene::update(double timestamp, double timestep, unsigned int numsubstep, b m_Uf.col(i).setConstant(0.0); else m_Uf.col(i)*=(1/m_Sf(i)); - project(m_Jf_inv,cs->featurerange,cs->featurerange).noalias()=m_Vf*m_Uf.transpose(); + project(m_Jf_inv,cs->featurerange,cs->featurerange)=(m_Vf*m_Uf.transpose()).lazy(); //Get the robotjacobian associated with this constraintset //Each jacobian is expressed in robot base frame => convert to world reference @@ -410,11 +410,11 @@ bool Scene::update(double timestamp, double timestep, unsigned int numsubstep, b } //Calculate A - m_Atemp.noalias()=m_Cf*m_Jf_inv; - m_A.noalias() = m_Cq-(m_Atemp*m_Jq); + m_Atemp=(m_Cf*m_Jf_inv).lazy(); + m_A = m_Cq-(m_Atemp*m_Jq).lazy(); if (m_nuTotal > 0) { - m_B.noalias()=m_Atemp*m_Ju; - m_ydot.noalias() += m_B*m_xdot; + m_B=(m_Atemp*m_Ju).lazy(); + m_ydot += (m_B*m_xdot).lazy(); } //Call the solver with A, Wq, Wy, ydot to solver qdot: @@ -435,13 +435,13 @@ bool Scene::update(double timestamp, double timestep, unsigned int numsubstep, b //Calculate the twist of the world reference frame due to the robots (Jq*qdot+Ju*chiudot): e_vector6 external_vel = e_zero_vector(6); if (ob1->jointrange.count > 0) - external_vel.noalias() += (project(m_Jq,cs->featurerange,ob1->jointrange)*project(m_qdot,ob1->jointrange)); + external_vel += (project(m_Jq,cs->featurerange,ob1->jointrange)*project(m_qdot,ob1->jointrange)).lazy(); if (ob2->jointrange.count > 0) - external_vel.noalias() += (project(m_Jq,cs->featurerange,ob2->jointrange)*project(m_qdot,ob2->jointrange)); + external_vel += (project(m_Jq,cs->featurerange,ob2->jointrange)*project(m_qdot,ob2->jointrange)).lazy(); if (ob1->coordinaterange.count > 0) - external_vel.noalias() += (project(m_Ju,cs->featurerange,ob1->coordinaterange)*project(m_xdot,ob1->coordinaterange)); + external_vel += (project(m_Ju,cs->featurerange,ob1->coordinaterange)*project(m_xdot,ob1->coordinaterange)).lazy(); if (ob2->coordinaterange.count > 0) - external_vel.noalias() += (project(m_Ju,cs->featurerange,ob2->coordinaterange)*project(m_xdot,ob2->coordinaterange)); + external_vel += (project(m_Ju,cs->featurerange,ob2->coordinaterange)*project(m_xdot,ob2->coordinaterange)).lazy(); //the twist caused by the constraint must be opposite because of the closed loop //estimate the velocity of the joints using the inverse jacobian e_vector6 estimated_chidot = project(m_Jf_inv,cs->featurerange,cs->featurerange)*(-external_vel); diff --git a/intern/itasc/WDLSSolver.cpp b/intern/itasc/WDLSSolver.cpp index d03c38396c7..a4146149d30 100644 --- a/intern/itasc/WDLSSolver.cpp +++ b/intern/itasc/WDLSSolver.cpp @@ -65,10 +65,10 @@ bool WDLSSolver::solve(const e_matrix& A, const e_vector& Wy, const e_vector& yd if(ret<0) return false; - m_WqV.noalias() = Wq*m_V; + m_WqV = (Wq*m_V).lazy(); //Wy*ydot - m_Wy_ydot = Wy.array() * ydot.array(); + m_Wy_ydot = Wy.cwise() * ydot; //S^-1*U'*Wy*ydot e_scalar maxDeltaS = e_scalar(0.0); e_scalar prevS = e_scalar(0.0); @@ -85,7 +85,7 @@ bool WDLSSolver::solve(const e_matrix& A, const e_vector& Wy, const e_vector& yd } lambda = (S < m_epsilon) ? (e_scalar(1.0)-KDL::sqr(S/m_epsilon))*m_lambda*m_lambda : e_scalar(0.0); alpha = m_U.col(i).dot(m_Wy_ydot)*S/(S*S+lambda); - vmax = m_WqV.col(i).array().abs().maxCoeff(); + vmax = m_WqV.col(i).cwise().abs().maxCoeff(); norm = fabs(alpha*vmax); if (norm > m_qmax) { qdot += m_WqV.col(i)*(alpha*m_qmax/norm); diff --git a/intern/itasc/WSDLSSolver.cpp b/intern/itasc/WSDLSSolver.cpp index 6fdd8e6e06c..014c312635f 100644 --- a/intern/itasc/WSDLSSolver.cpp +++ b/intern/itasc/WSDLSSolver.cpp @@ -60,7 +60,7 @@ bool WSDLSSolver::solve(const e_matrix& A, const e_vector& Wy, const e_vector& y e_scalar N, M; // Create the Weighted jacobian - m_AWq.noalias() = A*Wq; + m_AWq = (A*Wq).lazy(); for (i=0; i _qmax) { damp = Sinv*alpha*_qmax/norm; diff --git a/source/blender/quicktime/quicktime_export.h b/source/blender/quicktime/quicktime_export.h index 8499952131e..517e0c8c0f6 100644 --- a/source/blender/quicktime/quicktime_export.h +++ b/source/blender/quicktime/quicktime_export.h @@ -1,4 +1,4 @@ - * +/* * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or From c49cdf5eec1ec70008c12f7b6cbfdad75dde3b16 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sun, 23 Oct 2011 19:54:06 +0000 Subject: [PATCH 02/10] Another set of UI messages fixes and tweaks! No functional changes. --- GNUmakefile | 3 +-- SConstruct | 4 +++- intern/itasc/ConstraintSet.cpp | 6 +++--- intern/itasc/ControlledObject.cpp | 2 +- intern/itasc/CopyPose.cpp | 2 +- intern/itasc/Scene.cpp | 18 +++++++++--------- intern/itasc/WDLSSolver.cpp | 6 +++--- intern/itasc/WSDLSSolver.cpp | 8 ++++---- 8 files changed, 25 insertions(+), 24 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 5d1e5fec073..b06344ca238 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,6 +1,5 @@ # -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*- -# vim: tabstop=8 -# $Id: GNUmakefile 41122 2011-10-19 21:55:27Z campbellbarton $ +# vim: tabstop=4 # # ##### BEGIN GPL LICENSE BLOCK ##### # diff --git a/SConstruct b/SConstruct index 0db32365bfc..93787cdddce 100644 --- a/SConstruct +++ b/SConstruct @@ -1,5 +1,5 @@ #!/usr/bin/env python -# $Id: SConstruct 41169 2011-10-21 04:23:26Z campbellbarton $ +# # ***** BEGIN GPL LICENSE BLOCK ***** # # This program is free software; you can redistribute it and/or @@ -30,6 +30,8 @@ # Then read all SConscripts and build # # TODO: fix /FORCE:MULTIPLE on windows to get proper debug builds. +# TODO: directory copy functions are far too complicated, see: +# http://wiki.blender.org/index.php/User:Ideasman42/SConsNotSimpleInstallingFiles import platform as pltfrm diff --git a/intern/itasc/ConstraintSet.cpp b/intern/itasc/ConstraintSet.cpp index 74926df3092..e21cd36e4c8 100644 --- a/intern/itasc/ConstraintSet.cpp +++ b/intern/itasc/ConstraintSet.cpp @@ -80,7 +80,7 @@ void ConstraintSet::modelUpdate(Frame& _external_pose,const Timestamp& timestamp double ConstraintSet::getMaxTimestep(double& timestep) { - e_scalar maxChidot = m_chidot.cwise().abs().maxCoeff(); + e_scalar maxChidot = m_chidot.array().abs().maxCoeff(); if (timestep*maxChidot > m_maxDeltaChi) { timestep = m_maxDeltaChi/maxChidot; } @@ -162,9 +162,9 @@ bool ConstraintSet::closeLoop(){ }else m_B.row(i) = m_U.col(i)/m_S(i); - m_Jf_inv=(m_V*m_B).lazy(); + m_Jf_inv.noalias()=m_V*m_B; - m_chi+=(m_Jf_inv*m_tdelta).lazy(); + m_chi.noalias()+=m_Jf_inv*m_tdelta; updateJacobian(); // m_externalPose-m_internalPose in end effector frame // this is just to compare the pose, a different formula would work too diff --git a/intern/itasc/ControlledObject.cpp b/intern/itasc/ControlledObject.cpp index 773370b6d2e..4055aad7768 100644 --- a/intern/itasc/ControlledObject.cpp +++ b/intern/itasc/ControlledObject.cpp @@ -54,7 +54,7 @@ const e_matrix& ControlledObject::getJq(unsigned int ee) const double ControlledObject::getMaxTimestep(double& timestep) { - e_scalar maxQdot = m_qdot.cwise().abs().maxCoeff(); + e_scalar maxQdot = m_qdot.array().abs().maxCoeff(); if (timestep*maxQdot > m_maxDeltaQ) { timestep = m_maxDeltaQ/maxQdot; } diff --git a/intern/itasc/CopyPose.cpp b/intern/itasc/CopyPose.cpp index 133d6de2069..a9d4c2f0a2a 100644 --- a/intern/itasc/CopyPose.cpp +++ b/intern/itasc/CopyPose.cpp @@ -473,7 +473,7 @@ double CopyPose::getMaxTimestep(double& timestep) // CopyPose should not have any limit on linear velocity: // in case the target is out of reach, this can be very high. // We will simply limit on rotation - e_scalar maxChidot = m_chidot.block(3,0,3,1).cwise().abs().maxCoeff(); + e_scalar maxChidot = m_chidot.block(3,0,3,1).array().abs().maxCoeff(); if (timestep*maxChidot > m_maxDeltaChi) { timestep = m_maxDeltaChi/maxChidot; } diff --git a/intern/itasc/Scene.cpp b/intern/itasc/Scene.cpp index 9b8c5e5cd4c..16f8551bfc7 100644 --- a/intern/itasc/Scene.cpp +++ b/intern/itasc/Scene.cpp @@ -356,7 +356,7 @@ bool Scene::update(double timestamp, double timestep, unsigned int numsubstep, b m_Uf.col(i).setConstant(0.0); else m_Uf.col(i)*=(1/m_Sf(i)); - project(m_Jf_inv,cs->featurerange,cs->featurerange)=(m_Vf*m_Uf.transpose()).lazy(); + project(m_Jf_inv,cs->featurerange,cs->featurerange).noalias()=m_Vf*m_Uf.transpose(); //Get the robotjacobian associated with this constraintset //Each jacobian is expressed in robot base frame => convert to world reference @@ -410,11 +410,11 @@ bool Scene::update(double timestamp, double timestep, unsigned int numsubstep, b } //Calculate A - m_Atemp=(m_Cf*m_Jf_inv).lazy(); - m_A = m_Cq-(m_Atemp*m_Jq).lazy(); + m_Atemp.noalias()=m_Cf*m_Jf_inv; + m_A.noalias() = m_Cq-(m_Atemp*m_Jq); if (m_nuTotal > 0) { - m_B=(m_Atemp*m_Ju).lazy(); - m_ydot += (m_B*m_xdot).lazy(); + m_B.noalias()=m_Atemp*m_Ju; + m_ydot.noalias() += m_B*m_xdot; } //Call the solver with A, Wq, Wy, ydot to solver qdot: @@ -435,13 +435,13 @@ bool Scene::update(double timestamp, double timestep, unsigned int numsubstep, b //Calculate the twist of the world reference frame due to the robots (Jq*qdot+Ju*chiudot): e_vector6 external_vel = e_zero_vector(6); if (ob1->jointrange.count > 0) - external_vel += (project(m_Jq,cs->featurerange,ob1->jointrange)*project(m_qdot,ob1->jointrange)).lazy(); + external_vel.noalias() += (project(m_Jq,cs->featurerange,ob1->jointrange)*project(m_qdot,ob1->jointrange)); if (ob2->jointrange.count > 0) - external_vel += (project(m_Jq,cs->featurerange,ob2->jointrange)*project(m_qdot,ob2->jointrange)).lazy(); + external_vel.noalias() += (project(m_Jq,cs->featurerange,ob2->jointrange)*project(m_qdot,ob2->jointrange)); if (ob1->coordinaterange.count > 0) - external_vel += (project(m_Ju,cs->featurerange,ob1->coordinaterange)*project(m_xdot,ob1->coordinaterange)).lazy(); + external_vel.noalias() += (project(m_Ju,cs->featurerange,ob1->coordinaterange)*project(m_xdot,ob1->coordinaterange)); if (ob2->coordinaterange.count > 0) - external_vel += (project(m_Ju,cs->featurerange,ob2->coordinaterange)*project(m_xdot,ob2->coordinaterange)).lazy(); + external_vel.noalias() += (project(m_Ju,cs->featurerange,ob2->coordinaterange)*project(m_xdot,ob2->coordinaterange)); //the twist caused by the constraint must be opposite because of the closed loop //estimate the velocity of the joints using the inverse jacobian e_vector6 estimated_chidot = project(m_Jf_inv,cs->featurerange,cs->featurerange)*(-external_vel); diff --git a/intern/itasc/WDLSSolver.cpp b/intern/itasc/WDLSSolver.cpp index a4146149d30..d03c38396c7 100644 --- a/intern/itasc/WDLSSolver.cpp +++ b/intern/itasc/WDLSSolver.cpp @@ -65,10 +65,10 @@ bool WDLSSolver::solve(const e_matrix& A, const e_vector& Wy, const e_vector& yd if(ret<0) return false; - m_WqV = (Wq*m_V).lazy(); + m_WqV.noalias() = Wq*m_V; //Wy*ydot - m_Wy_ydot = Wy.cwise() * ydot; + m_Wy_ydot = Wy.array() * ydot.array(); //S^-1*U'*Wy*ydot e_scalar maxDeltaS = e_scalar(0.0); e_scalar prevS = e_scalar(0.0); @@ -85,7 +85,7 @@ bool WDLSSolver::solve(const e_matrix& A, const e_vector& Wy, const e_vector& yd } lambda = (S < m_epsilon) ? (e_scalar(1.0)-KDL::sqr(S/m_epsilon))*m_lambda*m_lambda : e_scalar(0.0); alpha = m_U.col(i).dot(m_Wy_ydot)*S/(S*S+lambda); - vmax = m_WqV.col(i).cwise().abs().maxCoeff(); + vmax = m_WqV.col(i).array().abs().maxCoeff(); norm = fabs(alpha*vmax); if (norm > m_qmax) { qdot += m_WqV.col(i)*(alpha*m_qmax/norm); diff --git a/intern/itasc/WSDLSSolver.cpp b/intern/itasc/WSDLSSolver.cpp index 014c312635f..6fdd8e6e06c 100644 --- a/intern/itasc/WSDLSSolver.cpp +++ b/intern/itasc/WSDLSSolver.cpp @@ -60,7 +60,7 @@ bool WSDLSSolver::solve(const e_matrix& A, const e_vector& Wy, const e_vector& y e_scalar N, M; // Create the Weighted jacobian - m_AWq = (A*Wq).lazy(); + m_AWq.noalias() = A*Wq; for (i=0; i _qmax) { damp = Sinv*alpha*_qmax/norm; From 809131bc8026c85f61813de42c34b02c47a780fe Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 24 Oct 2011 04:52:43 +0000 Subject: [PATCH 03/10] added function BKE_library_filepath_set which sync's the libraries absolute path when setting to a relative value, before this you could never be sure if a libraries absolute path was valid or not because the user might have changed the relative library path in the outliner, now setting from the outliner and py/rna syncs the absolute path. --- source/blender/blenkernel/BKE_library.h | 1 - source/blender/blenkernel/intern/library.c | 16 ++-------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h index 77ce7a50956..947eafa9dd3 100644 --- a/source/blender/blenkernel/BKE_library.h +++ b/source/blender/blenkernel/BKE_library.h @@ -59,7 +59,6 @@ int id_copy(struct ID *id, struct ID **newid, int test); int id_unlink(struct ID *id, int test); int new_id(struct ListBase *lb, struct ID *id, const char *name); -void id_clear_lib_data(struct ListBase *lb, struct ID *id); struct ListBase *which_libbase(struct Main *mainlib, short type); diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 0c2ca4c68b3..c44ccd7aa57 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -74,7 +74,7 @@ #include "BLI_blenlib.h" #include "BLI_dynstr.h" #include "BLI_utildefines.h" -#include "BLI_bpath.h" + #include "BKE_animsys.h" #include "BKE_context.h" @@ -108,7 +108,6 @@ #include "BKE_gpencil.h" #include "BKE_fcurve.h" #include "BKE_speaker.h" -#include "BKE_utildefines.h" #include "RNA_access.h" @@ -195,8 +194,7 @@ int id_make_local(ID *id, int test) if(!test) make_local_texture((Tex*)id); return 1; case ID_IM: - if(!test) make_local_image((Image*)id); - return 1; + return 0; /* not implemented */ case ID_LT: if(!test) { make_local_lattice((Lattice*)id); @@ -1248,16 +1246,6 @@ int new_id(ListBase *lb, ID *id, const char *tname) return result; } -/* Pull an ID out of a library (make it local). Only call this for IDs that - don't have other library users. */ -void id_clear_lib_data(ListBase *lb, ID *id) -{ - bpath_traverse_id(id, bpath_relocate_visitor, id->lib->filepath); - id->lib= NULL; - id->flag= LIB_LOCAL; - new_id(lb, id, NULL); -} - /* next to indirect usage in read/writefile also in editobject.c scene.c */ void clear_id_newpoins(void) { From 5571485bad17fce48bca160cef97f6a591d5c08f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 24 Oct 2011 06:57:53 +0000 Subject: [PATCH 04/10] fix for crash when entering in non unicode ascii chars. now allow these but only for filepaths. --- .../editors/interface/interface_handlers.c | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index e49cb4898d9..99972f2ff09 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1944,26 +1944,18 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle if((event->ascii || event->utf8_buf[0]) && (retval == WM_UI_HANDLER_CONTINUE)) { char ascii = event->ascii; - const char *utf8_buf= event->utf8_buf; /* exception that's useful for number buttons, some keyboard numpads have a comma instead of a period */ - if(ELEM3(but->type, NUM, NUMABS, NUMSLI)) { /* could use data->min*/ - if(event->type == PADPERIOD && ascii == ',') { + if(ELEM3(but->type, NUM, NUMABS, NUMSLI)) + if(event->type == PADPERIOD && ascii == ',') ascii = '.'; - utf8_buf= NULL; /* force ascii fallback */ - } - } - if(utf8_buf && utf8_buf[0]) { - int utf8_buf_len= BLI_str_utf8_size(utf8_buf); + if(event->utf8_buf[0]) { /* keep this printf until utf8 is well tested */ - if (utf8_buf_len != 1) { - printf("%s: utf8 char '%.*s'\n", __func__, utf8_buf_len, utf8_buf); - } - - // strcpy(utf8_buf, "12345"); - changed= ui_textedit_type_buf(but, data, event->utf8_buf, utf8_buf_len); + printf("%s: utf8 char '%s'\n", __func__, event->utf8_buf); + // strcpy(event->utf8_buf, "12345"); + changed= ui_textedit_type_buf(but, data, event->utf8_buf, BLI_str_utf8_size(event->utf8_buf)); } else { changed= ui_textedit_type_ascii(but, data, ascii); From a1af5ae6a69704eb147bc05f29374e894b9d0326 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 24 Oct 2011 10:11:47 +0000 Subject: [PATCH 05/10] fix for error utf8 printing input. --- source/blender/editors/interface/interface_handlers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 99972f2ff09..9d8e2f33f5c 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1953,7 +1953,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle if(event->utf8_buf[0]) { /* keep this printf until utf8 is well tested */ - printf("%s: utf8 char '%s'\n", __func__, event->utf8_buf); + printf("%s: utf8 char '%.*s'\n", __func__, BLI_str_utf8_size(event->utf8_buf), event->utf8_buf); // strcpy(event->utf8_buf, "12345"); changed= ui_textedit_type_buf(but, data, event->utf8_buf, BLI_str_utf8_size(event->utf8_buf)); } From 5a6605610dbdc78515343bae048fa3d10b23533c Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 24 Oct 2011 10:26:37 +0000 Subject: [PATCH 06/10] Fix #28949: can't render video to Flash Several issues were discovered when was looking into this bug: - MPEG file format didn't set needed codec settings such as frame rate and so, Was caused by not very correct fix fix #21351. - "Expert" codec settings stored in idprops was affected on formats which don't actually need them causing some conflicts in codec settings. - Flash codec doesn't support b-frames. Now C presets shouldn't affect on each other and flash coded wouldn't use b-frames even when using h264 format. Should work fine for files created from scratch. If existing files fails to render, try to switch file format to something else and then back to needed value. --- source/blender/blenkernel/intern/writeffmpeg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index da1412dac0d..bdca3c8e618 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -1102,7 +1102,7 @@ IDProperty *ffmpeg_property_add(RenderData *rd, char * type, int opt_index, int idp_type = IDP_FLOAT; break; case FF_OPT_TYPE_STRING: - val.str = (char *)" "; + val.str = " "; idp_type = IDP_STRING; break; case FF_OPT_TYPE_CONST: @@ -1377,3 +1377,4 @@ void ffmpeg_verify_image_type(RenderData *rd) } #endif + From a29c3b2bbbe24b21b900ecfe103c33c8f1a0a7d1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 24 Oct 2011 12:26:14 +0000 Subject: [PATCH 07/10] fix [#28961] FCurves.range() returns wrong values for one-point curves (sic!) also fix for case where verts were treated as found but were infact not because none were selected. --- source/blender/blenkernel/intern/action.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index ac0697ddbf9..e46e2df8353 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -137,14 +137,19 @@ void make_local_action(bAction *act) // XXX: double-check this; it used to be just single-user check, but that was when fake-users were still default if ((act->id.flag & LIB_FAKEUSER) && (act->id.us<=1)) { - id_clear_lib_data(&bmain->action, (ID *)act); + act->id.lib= NULL; + act->id.flag= LIB_LOCAL; + new_id(&bmain->action, (ID *)act, NULL); return; } BKE_animdata_main_cb(bmain, make_localact_init_cb, &mlac); if (mlac.local && mlac.lib==0) { - id_clear_lib_data(&bmain->action, (ID *)act); + act->id.lib= NULL; + act->id.flag= LIB_LOCAL; + //make_local_action_channels(act); + new_id(&bmain->action, (ID *)act, NULL); } else if (mlac.local && mlac.lib) { mlac.actn= copy_action(act); From 8afc509be42c6422b1600d9dab133a8d5b025aad Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 24 Oct 2011 17:09:31 +0000 Subject: [PATCH 08/10] Some small fixes and changes: - Add *.cc files to qtcreator project as well as .cpp and .cxx (would be needed for correct generating projects with libmv library). - Added negate_v2 and negate_v2_v2 functions. They'll be needed for camera tracking project. - Fixed issue with generating proxies from 32bit images. (generated jpg-s opened fine in blender, but were dark in osx viewer). - Marked unused arg in indexer as UNUSED. --- build_files/cmake/project_info.py | 2 +- source/blender/blenkernel/intern/sequencer.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build_files/cmake/project_info.py b/build_files/cmake/project_info.py index 8e813d39b64..f57778f9858 100755 --- a/build_files/cmake/project_info.py +++ b/build_files/cmake/project_info.py @@ -104,7 +104,7 @@ def is_glsl(filename): def is_c(filename): ext = splitext(filename)[1] - return (ext in (".c", ".cpp", ".cxx", ".m", ".mm", ".rc", ".cc", ".inl")) + return (ext in (".c", ".cpp", ".cxx", ".m", ".mm", ".rc", ".cc")) def is_c_any(filename): diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 6b319e6b5e1..3dcbe036206 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -2505,6 +2505,9 @@ static void *seq_prefetch_thread(void * This_) for (e = prefetch_done.first; e; e = e->next) { if (s_last > e->monoton_cfra) { + if (e->ibuf) { + IMB_cache_limiter_unref(e->ibuf); + } BLI_remlink(&prefetch_done, e); MEM_freeN(e); } @@ -2582,6 +2585,9 @@ static void seq_stop_threads() } for (e = prefetch_done.first; e; e = e->next) { + if (e->ibuf) { + IMB_cache_limiter_unref(e->ibuf); + } BLI_remlink(&prefetch_done, e); MEM_freeN(e); } From 3cbadbf895f4775290d626bed00e97f997b8a962 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 24 Oct 2011 17:12:28 +0000 Subject: [PATCH 09/10] MovieCache implementation Implementation of cache for general movie-related areas such as sequencer and clip editor (in the future) Some changes in limiter were necessary: - Limiter counted mapped memory twice when was checking how many memory is used. - It was using "global" memory usage not memory usage by cached elements. It will cause big problems when there's large mesh or plenty of undo steps are in memory nothing would be cached in sequencer. - To solve this problem introduced "callback" to measure cached element size. It could be not very accurate in general, but it works well for image buffers. And if this callback isn't set old-school memory usage check would be used. - The whole cache used to get freed when memory limit exceeded, now it'll drop only as much elements as necessary to reduce memory usage. Seqcache is switched to use this new cache code. --- source/blender/imbuf/CMakeLists.txt | 11 +++-- source/blender/imbuf/intern/allocimbuf.c | 56 +++++++++++++++++++++++- 2 files changed, 59 insertions(+), 8 deletions(-) diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index a03d6ce280d..1b190ae96de 100644 --- a/source/blender/imbuf/CMakeLists.txt +++ b/source/blender/imbuf/CMakeLists.txt @@ -23,6 +23,11 @@ # # ***** END GPL LICENSE BLOCK ***** +if(WITH_CODEC_FFMPEG) + # FFMPEG gives warnigns which are hard to avoid across multiple versions. + remove_strict_flags() +endif() + set(INC . ../avi @@ -155,12 +160,6 @@ if(WITH_CODEC_FFMPEG) ${FFMPEG_INCLUDE_DIRS} ) add_definitions(-DWITH_FFMPEG) - - remove_strict_flags_file( - intern/indexer.c - intern/util.c - intern/anim_movie.c - ) endif() if(WITH_IMAGE_DDS) diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c index 1d82c862dbd..da08671341a 100644 --- a/source/blender/imbuf/intern/allocimbuf.c +++ b/source/blender/imbuf/intern/allocimbuf.c @@ -164,9 +164,8 @@ void IMB_freeImBuf(ImBuf *ibuf) IMB_freezbufImBuf(ibuf); IMB_freezbuffloatImBuf(ibuf); freeencodedbufferImBuf(ibuf); + IMB_cache_limiter_unmanage(ibuf); IMB_metadata_free(ibuf); - if (ibuf->dds_data.data != NULL) - free(ibuf->dds_data.data); MEM_freeN(ibuf); } } @@ -472,3 +471,56 @@ static MEM_CacheLimiterC **get_imbuf_cache_limiter(void) return &c; } + +void IMB_free_cache_limiter(void) +{ + delete_MEM_CacheLimiter(*get_imbuf_cache_limiter()); + *get_imbuf_cache_limiter() = NULL; +} + +void IMB_cache_limiter_insert(ImBuf *i) +{ + if(!i->c_handle) { + i->c_handle = MEM_CacheLimiter_insert( + *get_imbuf_cache_limiter(), i); + MEM_CacheLimiter_ref(i->c_handle); + MEM_CacheLimiter_enforce_limits( + *get_imbuf_cache_limiter()); + MEM_CacheLimiter_unref(i->c_handle); + } +} + +void IMB_cache_limiter_unmanage(ImBuf *i) +{ + if(i->c_handle) { + MEM_CacheLimiter_unmanage(i->c_handle); + i->c_handle = NULL; + } +} + +void IMB_cache_limiter_touch(ImBuf *i) +{ + if(i->c_handle) + MEM_CacheLimiter_touch(i->c_handle); +} + +void IMB_cache_limiter_ref(ImBuf *i) +{ + if(i->c_handle) + MEM_CacheLimiter_ref(i->c_handle); +} + +void IMB_cache_limiter_unref(ImBuf *i) +{ + if(i->c_handle) + MEM_CacheLimiter_unref(i->c_handle); +} + +int IMB_cache_limiter_get_refcount(ImBuf *i) +{ + if(i->c_handle) + return MEM_CacheLimiter_get_refcount(i->c_handle); + + return 0; +} + From 5b6224c84719213883334bcd9d2c46216053fe35 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 24 Oct 2011 17:26:24 +0000 Subject: [PATCH 10/10] Remove currently unused IMB_cache_limiter_* function. Would be replaced with movie cache soon. --- source/blender/blenkernel/intern/sequencer.c | 6 --- source/blender/imbuf/intern/allocimbuf.c | 54 -------------------- 2 files changed, 60 deletions(-) diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 3dcbe036206..6b319e6b5e1 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -2505,9 +2505,6 @@ static void *seq_prefetch_thread(void * This_) for (e = prefetch_done.first; e; e = e->next) { if (s_last > e->monoton_cfra) { - if (e->ibuf) { - IMB_cache_limiter_unref(e->ibuf); - } BLI_remlink(&prefetch_done, e); MEM_freeN(e); } @@ -2585,9 +2582,6 @@ static void seq_stop_threads() } for (e = prefetch_done.first; e; e = e->next) { - if (e->ibuf) { - IMB_cache_limiter_unref(e->ibuf); - } BLI_remlink(&prefetch_done, e); MEM_freeN(e); } diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c index da08671341a..98828c58511 100644 --- a/source/blender/imbuf/intern/allocimbuf.c +++ b/source/blender/imbuf/intern/allocimbuf.c @@ -164,7 +164,6 @@ void IMB_freeImBuf(ImBuf *ibuf) IMB_freezbufImBuf(ibuf); IMB_freezbuffloatImBuf(ibuf); freeencodedbufferImBuf(ibuf); - IMB_cache_limiter_unmanage(ibuf); IMB_metadata_free(ibuf); MEM_freeN(ibuf); } @@ -471,56 +470,3 @@ static MEM_CacheLimiterC **get_imbuf_cache_limiter(void) return &c; } - -void IMB_free_cache_limiter(void) -{ - delete_MEM_CacheLimiter(*get_imbuf_cache_limiter()); - *get_imbuf_cache_limiter() = NULL; -} - -void IMB_cache_limiter_insert(ImBuf *i) -{ - if(!i->c_handle) { - i->c_handle = MEM_CacheLimiter_insert( - *get_imbuf_cache_limiter(), i); - MEM_CacheLimiter_ref(i->c_handle); - MEM_CacheLimiter_enforce_limits( - *get_imbuf_cache_limiter()); - MEM_CacheLimiter_unref(i->c_handle); - } -} - -void IMB_cache_limiter_unmanage(ImBuf *i) -{ - if(i->c_handle) { - MEM_CacheLimiter_unmanage(i->c_handle); - i->c_handle = NULL; - } -} - -void IMB_cache_limiter_touch(ImBuf *i) -{ - if(i->c_handle) - MEM_CacheLimiter_touch(i->c_handle); -} - -void IMB_cache_limiter_ref(ImBuf *i) -{ - if(i->c_handle) - MEM_CacheLimiter_ref(i->c_handle); -} - -void IMB_cache_limiter_unref(ImBuf *i) -{ - if(i->c_handle) - MEM_CacheLimiter_unref(i->c_handle); -} - -int IMB_cache_limiter_get_refcount(ImBuf *i) -{ - if(i->c_handle) - return MEM_CacheLimiter_get_refcount(i->c_handle); - - return 0; -} -