[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36942] branches/soc-2011-pepper/source/ gameengine/Converter: BGE Animation:
Revision: 36942 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36942 Author: moguri Date: 2011-05-27 03:45:52 + (Fri, 27 May 2011) Log Message: --- BGE Animation: * As per Aligorith's suggestion, I'm adding svn:eol-style = native to some files I added. Modified Paths: -- branches/soc-2011-pepper/source/gameengine/Converter/BL_Action.cpp branches/soc-2011-pepper/source/gameengine/Converter/BL_Action.h branches/soc-2011-pepper/source/gameengine/Converter/BL_ActionManager.cpp branches/soc-2011-pepper/source/gameengine/Converter/BL_ActionManager.h Property Changed: branches/soc-2011-pepper/source/gameengine/Converter/BL_Action.cpp branches/soc-2011-pepper/source/gameengine/Converter/BL_Action.h branches/soc-2011-pepper/source/gameengine/Converter/BL_ActionManager.cpp branches/soc-2011-pepper/source/gameengine/Converter/BL_ActionManager.h Modified: branches/soc-2011-pepper/source/gameengine/Converter/BL_Action.cpp === --- branches/soc-2011-pepper/source/gameengine/Converter/BL_Action.cpp 2011-05-27 01:55:52 UTC (rev 36941) +++ branches/soc-2011-pepper/source/gameengine/Converter/BL_Action.cpp 2011-05-27 03:45:52 UTC (rev 36942) @@ -1,198 +1,198 @@ -/** - * $Id$ - * - * * 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) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * * END GPL LICENSE BLOCK * - */ - -#include "BL_Action.h" -#include "BL_ArmatureObject.h" -#include "KX_GameObject.h" - -// These three are for getting the action from the logic manager -#include "KX_Scene.h" -#include "KX_PythonInit.h" -#include "SCA_LogicManager.h" - -extern "C" { -#include "BKE_animsys.h" -#include "BKE_action.h" -#include "RNA_access.h" -#include "RNA_define.h" -} - -BL_Action::BL_Action(class KX_GameObject* gameobj, - const char* name, - float start, - float end, - float blendin, - short play_mode, - short blend_mode) -: - m_obj(gameobj), - m_startframe(start), - m_endframe(end), - m_blendin(blendin), - m_playmode(play_mode), - m_endtime(0.f), - m_localtime(start), - m_blendframe(0.f), - m_blendstart(0.f), - m_pose(NULL), - m_blendpose(NULL), - m_done(false) -{ - m_starttime = KX_GetActiveEngine()->GetFrameTime(); - m_action = (bAction*)KX_GetActiveScene()->GetLogicManager()->GetActionByName(name); - - if (!m_action) printf("Failed to load action: %s\n", name); -} - -BL_Action::~BL_Action() -{ - if (m_pose) - game_free_pose(m_pose); - if (m_blendpose) - game_free_pose(m_blendpose); -} - -void BL_Action::SetLocalTime(float curtime) -{ - float dt = (curtime-m_starttime)*KX_KetsjiEngine::GetAnimFrameRate(); - - if (m_endframe < m_startframe) - dt = -dt; - - m_localtime = m_startframe + dt; -} - -void BL_Action::Update(float curtime) -{ - curtime -= KX_KetsjiEngine::GetSuspendedDelta(); - - SetLocalTime(curtime); - - // Handle wrap around - if (m_localtime < m_startframe || m_localtime > m_endframe) - { - switch(m_playmode) - { - case ACT_MODE_PLAY: - // Clamp - m_localtime = m_endframe; - m_done = true; - break; - case ACT_MODE_LOOP: - // Put the time back to the beginning - m_localtime = m_startframe; - m_starttime = curtime; - break; - case ACT_MODE_PING_PONG: - // Swap the start and end frames - float temp = m_startframe; - m_startframe = m_endframe; -
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36941] branches/soc-2011-avocado/blender/ source/blender/editors/mesh/bmesh_tools.c: Test code written to compute dual graph of mesh using only small
Revision: 36941 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36941 Author: shuvro Date: 2011-05-27 01:55:52 + (Fri, 27 May 2011) Log Message: --- Test code written to compute dual graph of mesh using only small fixed size array. Modified Paths: -- branches/soc-2011-avocado/blender/source/blender/editors/mesh/bmesh_tools.c Modified: branches/soc-2011-avocado/blender/source/blender/editors/mesh/bmesh_tools.c === --- branches/soc-2011-avocado/blender/source/blender/editors/mesh/bmesh_tools.c 2011-05-26 23:51:02 UTC (rev 36940) +++ branches/soc-2011-avocado/blender/source/blender/editors/mesh/bmesh_tools.c 2011-05-27 01:55:52 UTC (rev 36941) @@ -1227,6 +1227,42 @@ RNA_def_boolean(ot->srna, "inclusive", 0, "Inclusive", "Selects geometry around selected geometry, occording to selection mode"); } +static int compute_dual_graph(BMesh *bm) +{ +BMEdge *eed; +BMIter iter, iter2; +BMLoop *l; +//int count = 0; + +float dummy_dual_graph[1000][1000]; +int i,face_index[2]; + + +for(eed = BMIter_New(&iter, bm, BM_EDGES_OF_MESH, bm ); eed; eed= BMIter_Step(&iter)) +{ +/* if not boundary edge */ +if(!BM_Boundary_Edge(eed)){ + +printf("index : %d\n", eed->head.index); +i = 0; + +BM_ITER(l, &iter2, bm, BM_LOOPS_OF_EDGE, eed) { +printf("%d ", l->f->head.index); +face_index[i++] = l->f->head.index; +} +dummy_dual_graph[face_index[0]][face_index[1]] = 1; +} +else +{ +printf("visiting boundary edge.\n"); +} +} + + +return 0; +} + + /* * SEAMS AND EDGES */ static int editbmesh_mark_seam(bContext *C, wmOperator *op) @@ -1263,6 +1299,7 @@ /* just as a demo to show call to autoseam */ BKE_use_autoseam(); +compute_dual_graph(bm); DAG_id_tag_update(obedit->data, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36940] trunk/blender/source/blender/ blenkernel/intern/writeffmpeg.c: == FFMPEG ==
Revision: 36940 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36940 Author: schlaile Date: 2011-05-26 23:51:02 + (Thu, 26 May 2011) Log Message: --- == FFMPEG == ... and another funny version patch, since OpenSuse obviously used some version "in-between" Modified Paths: -- trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c Modified: trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c === --- trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c 2011-05-26 23:29:40 UTC (rev 36939) +++ trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c 2011-05-26 23:51:02 UTC (rev 36940) @@ -76,6 +76,12 @@ #define avio_close url_fclose #endif +/* make OpenSuSe special "in-between" ffmpeg 0.6.2 version(tm) happy... + Agh */ +#ifndef AVIO_FLAG_WRITE +#define AVIO_FLAG_WRITE URL_WRONLY +#endif + extern void do_init_ffmpeg(void); static int ffmpeg_type = 0; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36939] trunk/blender/source/blender: own recent commits caused crash with the grease pencil in camera view, always pass rv3d argument now.
Revision: 36939 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36939 Author: campbellbarton Date: 2011-05-26 23:29:40 + (Thu, 26 May 2011) Log Message: --- own recent commits caused crash with the grease pencil in camera view, always pass rv3d argument now. also found a bug where hex_to_rgb could use un-initialized memory. Modified Paths: -- trunk/blender/source/blender/blenlib/intern/math_color.c trunk/blender/source/blender/editors/gpencil/gpencil_edit.c trunk/blender/source/blender/editors/gpencil/gpencil_paint.c trunk/blender/source/blender/editors/space_view3d/view3d_draw.c Modified: trunk/blender/source/blender/blenlib/intern/math_color.c === --- trunk/blender/source/blender/blenlib/intern/math_color.c2011-05-26 23:19:15 UTC (rev 36938) +++ trunk/blender/source/blender/blenlib/intern/math_color.c2011-05-26 23:29:40 UTC (rev 36939) @@ -194,6 +194,10 @@ CLAMP(*g, 0.0f, 1.0f); CLAMP(*b, 0.0f, 1.0f); } + else { + /* avoid using un-initialized vars */ + *r= *g= *b= 0.0f; + } } void rgb_to_hsv(float r, float g, float b, float *lh, float *ls, float *lv) Modified: trunk/blender/source/blender/editors/gpencil/gpencil_edit.c === --- trunk/blender/source/blender/editors/gpencil/gpencil_edit.c 2011-05-26 23:19:15 UTC (rev 36938) +++ trunk/blender/source/blender/editors/gpencil/gpencil_edit.c 2011-05-26 23:29:40 UTC (rev 36939) @@ -453,7 +453,7 @@ /* for camera view set the subrect */ if (rv3d->persp == RV3D_CAMOB) { - ED_view3d_calc_camera_border(scene, ar, v3d, NULL, subrect, -1); /* negative shift */ + ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, subrect, -1); /* negative shift */ return 1; } } Modified: trunk/blender/source/blender/editors/gpencil/gpencil_paint.c === --- trunk/blender/source/blender/editors/gpencil/gpencil_paint.c 2011-05-26 23:19:15 UTC (rev 36938) +++ trunk/blender/source/blender/editors/gpencil/gpencil_paint.c 2011-05-26 23:29:40 UTC (rev 36939) @@ -1131,7 +1131,7 @@ /* for camera view set the subrect */ if (rv3d->persp == RV3D_CAMOB) { - ED_view3d_calc_camera_border(p->scene, p->ar, v3d, NULL, &p->subrect_data, -1); /* negative shift */ + ED_view3d_calc_camera_border(p->scene, p->ar, v3d, rv3d, &p->subrect_data, -1); /* negative shift */ p->subrect= &p->subrect_data; } } Modified: trunk/blender/source/blender/editors/space_view3d/view3d_draw.c === --- trunk/blender/source/blender/editors/space_view3d/view3d_draw.c 2011-05-26 23:19:15 UTC (rev 36938) +++ trunk/blender/source/blender/editors/space_view3d/view3d_draw.c 2011-05-26 23:29:40 UTC (rev 36939) @@ -876,9 +876,6 @@ float dx= 0.0f, dy= 0.0f; view3d_viewborder_size_get(scene, ar, size); - - if (rv3d == NULL) - rv3d = ar->regiondata; size[0]= size[0]*zoomfac; size[1]= size[1]*zoomfac; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36938] trunk/blender/source/blender/ blenkernel/intern/writeffmpeg.c: == FFMPEG ==
Revision: 36938 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36938 Author: schlaile Date: 2011-05-26 23:19:15 + (Thu, 26 May 2011) Log Message: --- == FFMPEG == Added some API compatibility code again, since some API-changes weren't even documented (they even didn't do a proper version-bump, arghh!) If it breaks again, please tell! Modified Paths: -- trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c Modified: trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c === --- trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c 2011-05-26 22:48:06 UTC (rev 36937) +++ trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c 2011-05-26 23:19:15 UTC (rev 36938) @@ -61,6 +61,21 @@ #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" +#if (LIBAVFORMAT_VERSION_MAJOR >= 52) && (LIBAVFORMAT_VERSION_MINOR >= 105) +#define FFMPEG_HAVE_AVIO 1 +#endif + +#if (LIBAVFORMAT_VERSION_MAJOR >= 53) && (LIBAVFORMAT_VERSION_MINOR >= 3) +#define FFMPEG_HAVE_DEFAULT_VAL_UNION 1 +#endif + +#ifndef FFMPEG_HAVE_AVIO +#define AVIO_FLAG_WRITE URL_WRONLY +#define avio_open url_fopen +#define avio_tell url_ftell +#define avio_close url_fclose +#endif + extern void do_init_ffmpeg(void); static int ffmpeg_type = 0; @@ -1051,12 +1066,20 @@ switch (o->type) { case FF_OPT_TYPE_INT: case FF_OPT_TYPE_INT64: +#ifdef FFMPEG_HAVE_DEFAULT_VAL_UNION val.i = o->default_val.i64; +#else + val.i = o->default_val; +#endif idp_type = IDP_INT; break; case FF_OPT_TYPE_DOUBLE: case FF_OPT_TYPE_FLOAT: +#ifdef FFMPEG_HAVE_DEFAULT_VAL_UNION val.f = o->default_val.dbl; +#else + val.f = o->default_val; +#endif idp_type = IDP_FLOAT; break; case FF_OPT_TYPE_STRING: ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36937] trunk/blender/source/gameengine/ Converter/KX_BlenderSceneConverter.cpp: missed this in recent commit.
Revision: 36937 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36937 Author: campbellbarton Date: 2011-05-26 22:48:06 + (Thu, 26 May 2011) Log Message: --- missed this in recent commit. Modified Paths: -- trunk/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp Modified: trunk/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp === --- trunk/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp 2011-05-26 22:32:15 UTC (rev 36936) +++ trunk/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp 2011-05-26 22:48:06 UTC (rev 36937) @@ -994,7 +994,7 @@ int i=0; LinkNode *n= names; while(n) { - BLO_library_append_named_part(C, main_tmp, &bpy_openlib, (char *)n->link, idcode, 0); + BLO_library_append_named_part(main_tmp, &bpy_openlib, (char *)n->link, idcode); n= (LinkNode *)n->next; i++; } @@ -1012,7 +1012,7 @@ int i=0; LinkNode *n= names; while(n) { - BLO_library_append_named_part(C, main_tmp, &bpy_openlib, (char *)n->link, ID_AC, 0); + BLO_library_append_named_part(main_tmp, &bpy_openlib, (char *)n->link, ID_AC); n= (LinkNode *)n->next; i++; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
Re: [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36932] trunk/blender/source/blender: split BLO_library_append_named_part into 2 function, one that adds objects into the scene and another that j
split BLO_library_append_named_part into 2 function, one that adds objects into the scene and another that just links/appends. Modified Paths: -- trunk/blender/source/blender/blenloader/BLO_readfile.h trunk/blender/source/blender/blenloader/intern/readfile.c trunk/blender/source/blender/python/intern/bpy_library.c trunk/blender/source/blender/windowmanager/intern/wm_operators.c this commit breaks game engine compile. Fix is attached, don't know, if it works, so please check and commit. Cheers, Peter Peter Schlaile diff --git a/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 684ed0b..2cd4e4b 100644 --- a/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -994,7 +994,7 @@ bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const cha int i=0; LinkNode *n= names; while(n) { - BLO_library_append_named_part(C, main_tmp, &bpy_openlib, (char *)n->link, idcode, 0); + BLO_library_append_named_part_ex(C, main_tmp, &bpy_openlib, (char *)n->link, idcode, 0); n= (LinkNode *)n->next; i++; } @@ -1012,7 +1012,7 @@ bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const cha int i=0; LinkNode *n= names; while(n) { - BLO_library_append_named_part(C, main_tmp, &bpy_openlib, (char *)n->link, ID_AC, 0); + BLO_library_append_named_part_ex(C, main_tmp, &bpy_openlib, (char *)n->link, ID_AC, 0); n= (LinkNode *)n->next; i++; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36936] branches/soc-2011-onion/source/ blender: GSOC 2011 - onion branch
Revision: 36936 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36936 Author: psy-fi Date: 2011-05-26 22:32:15 + (Thu, 26 May 2011) Log Message: --- GSOC 2011 - onion branch --Color correction fix series no.2-- More de-gamma corrections on all brush inputs in preparation for correct behavior fix based on other developer's input. This commit fixes brush GUI colors only. Images stored as sRGB are not de linearized before sampling. This will be fixed in later according to decision on image texture storage type and sampling. TODO: upload final images as sRGB for viewing. This will fix behavior completely. Modified Paths: -- branches/soc-2011-onion/source/blender/blenkernel/intern/brush.c branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c Modified: branches/soc-2011-onion/source/blender/blenkernel/intern/brush.c === --- branches/soc-2011-onion/source/blender/blenkernel/intern/brush.c 2011-05-26 22:20:29 UTC (rev 36935) +++ branches/soc-2011-onion/source/blender/blenkernel/intern/brush.c 2011-05-26 22:32:15 UTC (rev 36936) @@ -571,9 +571,9 @@ } } else { - crgb[0]= FTOCHAR(brush->rgb[0]); - crgb[1]= FTOCHAR(brush->rgb[1]); - crgb[2]= FTOCHAR(brush->rgb[2]); + crgb[0]= FTOCHAR(srgb_to_linearrgb(brush->rgb[0])); + crgb[1]= FTOCHAR(srgb_to_linearrgb(brush->rgb[1])); + crgb[2]= FTOCHAR(srgb_to_linearrgb(brush->rgb[2])); for (y=0; y < ibuf->y; y++) { dst = (char*)ibuf->rect + y*rowbytes; @@ -601,9 +601,9 @@ dist = sqrt(xy[0]*xy[0] + xy[1]*xy[1]); brush_sample_tex(brush, xy, rgba, 0); - dst[0] = FTOCHAR(rgba[0]*brush->rgb[0]); - dst[1] = FTOCHAR(rgba[1]*brush->rgb[1]); - dst[2] = FTOCHAR(rgba[2]*brush->rgb[2]); + dst[0] = FTOCHAR(rgba[0]*srgb_to_linearrgb(brush->rgb[0])); + dst[1] = FTOCHAR(rgba[1]*srgb_to_linearrgb(brush->rgb[1])); + dst[2] = FTOCHAR(rgba[2]*srgb_to_linearrgb(brush->rgb[2])); dst[3] = FTOCHAR(rgba[3]*alpha*brush_curve_strength_clamp(brush, dist, radius)); } else { dist = sqrt(xy[0]*xy[0] + xy[1]*xy[1]); Modified: branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c === --- branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c 2011-05-26 22:20:29 UTC (rev 36935) +++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c 2011-05-26 22:32:15 UTC (rev 36936) @@ -3673,13 +3673,16 @@ unsigned char rgba_ub[4]; if (ps->is_texbrush) { - rgba_ub[0] = FTOCHAR(rgba[0] * ps->brush->rgb[0]); - rgba_ub[1] = FTOCHAR(rgba[1] * ps->brush->rgb[1]); - rgba_ub[2] = FTOCHAR(rgba[2] * ps->brush->rgb[2]); + /*rgba already holds a texture result here from higher level function*/ + rgba_ub[0] = FTOCHAR(rgba[0] * srgb_to_linearrgb(ps->brush->rgb[0])); + rgba_ub[1] = FTOCHAR(rgba[1] * srgb_to_linearrgb(ps->brush->rgb[1])); + rgba_ub[2] = FTOCHAR(rgba[2] * srgb_to_linearrgb(ps->brush->rgb[2])); rgba_ub[3] = FTOCHAR(rgba[3]); } else { - IMAPAINT_FLOAT_RGB_TO_CHAR(rgba_ub, ps->brush->rgb); + VECCOPY(rgba, ps->brush->rgb); + srgb_to_linearrgb_v3_v3(rgba, rgba); + IMAPAINT_FLOAT_RGB_TO_CHAR(rgba_ub, rgba); rgba_ub[3] = 255; } @@ -3694,12 +3697,14 @@ static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask) { if (ps->is_texbrush) { - rgba[0] *= ps->brush->rgb[0]; - rgba[1] *= ps->brush->rgb[1]; - rgba[2] *= ps->brush->rgb[2]; + /*rgba already holds a texture result here from higher level function*/ + rgba[0] *= srgb_to_linearrgb(ps->brush->rgb[0]); + rgba[1] *= srgb_to_linearrgb(ps->brush->rgb[1]); + rgba[2] *= srgb_to_linearrgb(ps->brush->rgb[2]); } else { VECCOPY(rgba, ps->brush->rgb); + srgb_to_linearrgb_v3_v3(rgba, rgba); } if (ps->is_airbrush==0 && mask < 1.0f) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.bl
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36935] trunk/blender/source/blender/ editors/sculpt_paint/paint_vertex.c: weight paint mirror, move duplicate code into a function.
Revision: 36935 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36935 Author: campbellbarton Date: 2011-05-26 22:20:29 + (Thu, 26 May 2011) Log Message: --- weight paint mirror, move duplicate code into a function. Modified Paths: -- trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c === --- trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c 2011-05-26 21:57:02 UTC (rev 36934) +++ trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c 2011-05-26 22:20:29 UTC (rev 36935) @@ -288,6 +288,43 @@ } +/* mirror_vgroup is set to -1 when invalid */ +static void wpaint_mirror_vgroup_ensure(Object *ob, int *vgroup_mirror) +{ + bDeformGroup *defgroup= BLI_findlink(&ob->defbase, ob->actdef - 1); + + if(defgroup) { + bDeformGroup *curdef; + int mirrdef; + char name[MAXBONENAME]; + + flip_side_name(name, defgroup->name, FALSE); + + if(strcmp(name, defgroup->name) != 0) { + for (curdef= ob->defbase.first, mirrdef; curdef; curdef=curdef->next, mirrdef++) { + if (!strcmp(curdef->name, name)) { + break; + } + } + + if(curdef==NULL) { + int olddef= ob->actdef; /* tsk, ED_vgroup_add sets the active defgroup */ + curdef= ED_vgroup_add_name(ob, name); + ob->actdef= olddef; + } + + /* curdef should never be NULL unless this is +* a lamp and ED_vgroup_add_name fails */ + if(curdef) { + *vgroup_mirror= mirrdef; + return; + } + } + } + + *vgroup_mirror= -1; +} + static void copy_vpaint_prev(VPaint *vp, unsigned int *mcol, int tot) { if(vp->vpaint_prev) { @@ -383,32 +420,11 @@ } vgroup= ob->actdef-1; - - /* directly copied from weight_paint, should probaby split into a separate function */ + /* if mirror painting, find the other group */ if(me->editflag & ME_EDIT_MIRROR_X) { - bDeformGroup *defgroup= BLI_findlink(&ob->defbase, ob->actdef-1); - if(defgroup) { - bDeformGroup *curdef; - int actdef= 0; - char name[32]; - - flip_side_name(name, defgroup->name, FALSE); - - for (curdef = ob->defbase.first; curdef; curdef=curdef->next, actdef++) - if (!strcmp(curdef->name, name)) - break; - if(curdef==NULL) { - int olddef= ob->actdef; /* tsk, ED_vgroup_add sets the active defgroup */ - curdef= ED_vgroup_add_name (ob, name); - ob->actdef= olddef; - } - - if(curdef && curdef!=defgroup) - vgroup_mirror= actdef; - } + wpaint_mirror_vgroup_ensure(ob, &vgroup_mirror); } - /* end copy from weight_paint*/ copy_wpaint_prev(wp, me->dvert, me->totvert); @@ -1351,26 +1367,7 @@ /* if mirror painting, find the other group */ if(me->editflag & ME_EDIT_MIRROR_X) { - bDeformGroup *defgroup= BLI_findlink(&ob->defbase, ob->actdef-1); - if(defgroup) { - bDeformGroup *curdef; - int actdef= 0; - char name[32]; - - flip_side_name(name, defgroup->name, FALSE); - - for (curdef = ob->defbase.first; curdef; curdef=curdef->next, actdef++) - if (!strcmp(curdef->name, name)) - break; - if(curdef==NULL) { - int olddef= ob->actdef; /* tsk, ED_vgroup_add sets the active defgroup */ - curdef= ED_vgroup_add_name (ob, name); - ob->actdef= olddef; - } - - if(curdef && curdef!=defgroup) - wpd->vgroup_mirror= actdef; - } + wpaint_mirror_vgroup_ensure(ob, &wpd->vgroup_mirror); } return 1; ___ Bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36934] trunk/blender: == FFMPEG ==
Revision: 36934 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36934 Author: schlaile Date: 2011-05-26 21:57:02 + (Thu, 26 May 2011) Log Message: --- == FFMPEG == * removed a lot of old cruft code for ancient ffmpeg versions * made it compile again against latest ffmpeg / libav GIT (also shouldn't break distro ffmpegs, since those API changes have been introduced over a year ago. If it nevertheless breaks, please send me an email) Modified Paths: -- trunk/blender/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c trunk/blender/source/blender/imbuf/intern/anim_movie.c trunk/blender/source/blender/imbuf/intern/util.c trunk/blender/source/blender/makesrna/intern/rna_scene.c trunk/blender/source/gameengine/VideoTexture/VideoFFmpeg.cpp trunk/blender/source/gameengine/VideoTexture/VideoFFmpeg.h Modified: trunk/blender/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp === --- trunk/blender/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp 2011-05-26 21:04:01 UTC (rev 36933) +++ trunk/blender/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp 2011-05-26 21:57:02 UTC (rev 36934) @@ -52,6 +52,10 @@ int read_length, data_size; + AVPacket tmp_pkt; + + av_init_packet(&tmp_pkt); + // as long as there is still data in the package while(audio_pkg_size > 0) { @@ -64,16 +68,15 @@ // read samples from the packet data_size = buf_size - buf_pos; - /*read_length = avcodec_decode_audio3(m_codecCtx, - (int16_t*)(((data_t*)buffer.getBuffer())+buf_pos), - &data_size, - packet);*/ - read_length = avcodec_decode_audio2(m_codecCtx, - (int16_t*)(((data_t*)buffer.getBuffer()) + buf_pos), - &data_size, - audio_pkg_data, - audio_pkg_size); + tmp_pkt.data = audio_pkg_data; + tmp_pkt.size = audio_pkg_size; + + read_length = avcodec_decode_audio3( + m_codecCtx, + (int16_t*)(((data_t*)buffer.getBuffer()) + buf_pos), + &data_size, &tmp_pkt); + // read error, next packet! if(read_length < 0) break; @@ -112,7 +115,7 @@ for(unsigned int i = 0; i < m_formatCtx->nb_streams; i++) { - if((m_formatCtx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) + if((m_formatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) && (m_stream < 0)) { m_stream=i; Modified: trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c === --- trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c 2011-05-26 21:04:01 UTC (rev 36933) +++ trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c 2011-05-26 21:57:02 UTC (rev 36934) @@ -39,19 +39,6 @@ #include #include -#if LIBAVFORMAT_VERSION_INT < (49 << 16) -#define FFMPEG_OLD_FRAME_RATE 1 -#else -#define FFMPEG_CODEC_IS_POINTER 1 -#define FFMPEG_CODEC_TIME_BASE 1 -#endif - -#if LIBAVFORMAT_VERSION_INT >= (52 << 16) -#define OUTFILE_PB (outfile->pb) -#else -#define OUTFILE_PB (&outfile->pb) -#endif - #if defined(WIN32) && (!(defined snprintf)) #define snprintf _snprintf #endif @@ -114,24 +101,12 @@ } } -#ifdef FFMPEG_CODEC_IS_POINTER -static AVCodecContext* get_codec_from_stream(AVStream* stream) -{ - return stream->codec; -} -#else -static AVCodecContext* get_codec_from_stream(AVStream* stream) -{ - return &stream->codec; -} -#endif - static int write_audio_frame(void) { AVCodecContext* c = NULL; AVPacket pkt; - c = get_codec_from_stream(audio_stream); + c = audio_stream->codec; av_init_packet(&pkt); pkt.size = 0; @@ -153,17 +128,15 @@ if(c->coded_frame && c->coded_frame->pts != AV_NOPTS_VALUE) { -#ifdef FFMPEG_CODEC_TIME_BASE pkt.pts = av_rescale_q(c->coded_frame->pts, - c->time_base, audio_stream->time_base); -#else - pkt.pts = c->coded_frame->pts; -#endif + c->time_base, audio_stream->time_base); fprintf(stderr, "Audio Frame PTS: %d\n", (int)pkt.pts); } pkt.stream_index = audio_stream->index; - pkt.flags |= PKT_FLAG_KEY; + + pkt.flags |= AV_PKT_FLAG_KEY; + if (av_interleaved_write_frame(outfile, &pkt) != 0) {
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36933] trunk/blender/source/blender: remove BLI_streq() since it was hardly used, also replace string search with BLI_findstring().
Revision: 36933 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36933 Author: campbellbarton Date: 2011-05-26 21:04:01 + (Thu, 26 May 2011) Log Message: --- remove BLI_streq() since it was hardly used, also replace string search with BLI_findstring(). Modified Paths: -- trunk/blender/source/blender/blenlib/BLI_string.h trunk/blender/source/blender/blenlib/intern/string.c trunk/blender/source/blender/blenloader/intern/readfile.c trunk/blender/source/blender/editors/armature/editarmature_sketch.c trunk/blender/source/blender/editors/interface/interface.c Modified: trunk/blender/source/blender/blenlib/BLI_string.h === --- trunk/blender/source/blender/blenlib/BLI_string.h 2011-05-26 20:45:19 UTC (rev 36932) +++ trunk/blender/source/blender/blenlib/BLI_string.h 2011-05-26 21:04:01 UTC (rev 36933) @@ -123,13 +123,6 @@ ; /** -* Compare two strings -* -* @retval True if the strings are equal, false otherwise. -*/ -int BLI_streq(const char *a, const char *b); - - /** * Compare two strings without regard to case. * * @retval True if the strings are equal, false otherwise. Modified: trunk/blender/source/blender/blenlib/intern/string.c === --- trunk/blender/source/blender/blenlib/intern/string.c2011-05-26 20:45:19 UTC (rev 36932) +++ trunk/blender/source/blender/blenlib/intern/string.c2011-05-26 21:04:01 UTC (rev 36933) @@ -212,11 +212,6 @@ } } -int BLI_streq(const char *a, const char *b) -{ - return (strcmp(a, b)==0); -} - int BLI_strcaseeq(const char *a, const char *b) { return (BLI_strcasecmp(a, b)==0); Modified: trunk/blender/source/blender/blenloader/intern/readfile.c === --- trunk/blender/source/blender/blenloader/intern/readfile.c 2011-05-26 20:45:19 UTC (rev 36932) +++ trunk/blender/source/blender/blenloader/intern/readfile.c 2011-05-26 21:04:01 UTC (rev 36933) @@ -1082,7 +1082,7 @@ /* now we know that we are in a blend file and it is safe to assume that gp actually points to a group */ - if (BLI_streq("Screen", gp)==0) + if (strcmp("Screen", gp)!=0) BLI_strncpy(group, gp, GROUP_MAX); } return 1; @@ -12902,7 +12902,7 @@ for (bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) { if (bhead->code == GS(id->name)) { - if (BLI_streq(id->name, bhead_id_name(fd, bhead))) { + if (strcmp(id->name, bhead_id_name(fd, bhead))==0) { id->flag &= ~LIB_READ; id->flag |= LIB_TEST; // printf("read lib block %s\n", id->name); Modified: trunk/blender/source/blender/editors/armature/editarmature_sketch.c === --- trunk/blender/source/blender/editors/armature/editarmature_sketch.c 2011-05-26 20:45:19 UTC (rev 36932) +++ trunk/blender/source/blender/editors/armature/editarmature_sketch.c 2011-05-26 21:04:01 UTC (rev 36933) @@ -374,16 +374,16 @@ int valid = 0; int caps = 0; - if (BLI_streq(side, "")) + if (side[0] == '\0') { valid = 1; } - else if (BLI_streq(side, "R") || BLI_streq(side, "L")) + else if (strcmp(side, "R")==0 || strcmp(side, "L")==0) { valid = 1; caps = 1; } - else if (BLI_streq(side, "r") || BLI_streq(side, "l")) + else if (strcmp(side, "r")==0 || strcmp(side, "l")==0) { valid = 1; caps = 0; Modified: trunk/blender/source/blender/editors/interface/interface.c === --- trunk/blender/source/blender/editors/interface/interface.c 2011-05-26 20:45:19 UTC (rev 36932) +++ trunk/blender/source/blender/editors/interface/interface.c 2011-05-26 21:04:01 UTC (rev 36933) @@ -1848,29 +1848,24 @@ void uiBlockSetRegion(uiBlock *block, ARegion *region) { - ListBase *lb; + ListBase *lb= ®ion->uiblocks; uiBlock *oldblock= NULL; - lb= ®ion->uiblocks; - /* each listbase only has one block with this name, free block * if is already there so it can be rebuilt from scratch */ if(lb) { -
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36932] trunk/blender/source/blender: split BLO_library_append_named_part into 2 function, one that adds objects into the scene and another that just
Revision: 36932 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36932 Author: campbellbarton Date: 2011-05-26 20:45:19 + (Thu, 26 May 2011) Log Message: --- split BLO_library_append_named_part into 2 function, one that adds objects into the scene and another that just links/appends. Modified Paths: -- trunk/blender/source/blender/blenloader/BLO_readfile.h trunk/blender/source/blender/blenloader/intern/readfile.c trunk/blender/source/blender/python/intern/bpy_library.c trunk/blender/source/blender/windowmanager/intern/wm_operators.c Modified: trunk/blender/source/blender/blenloader/BLO_readfile.h === --- trunk/blender/source/blender/blenloader/BLO_readfile.h 2011-05-26 19:13:01 UTC (rev 36931) +++ trunk/blender/source/blender/blenloader/BLO_readfile.h 2011-05-26 20:45:19 UTC (rev 36932) @@ -213,18 +213,32 @@ struct Main* BLO_library_append_begin(const struct bContext *C, BlendHandle** bh, const char *filepath); + /** * Link/Append a named datablock from an external blend file. * + * @param mainl The main database to link from (not the active one). + * @param bh The blender file handle. + * @param idname The name of the datablock (without the 2 char ID prefix) + * @param idcode The kind of datablock to link. + * @return the appended ID when found. + */ +struct ID *BLO_library_append_named_part(struct Main *mainl, BlendHandle** bh, const char *idname, const int idcode); + +/** + * Link/Append a named datablock from an external blend file. + * optionally instance the object in the scene when the flags are set. + * * @param C The context, when NULL instancing object in the scene isnt done. * @param mainl The main database to link from (not the active one). * @param bh The blender file handle. * @param idname The name of the datablock (without the 2 char ID prefix) * @param idcode The kind of datablock to link. * @param flag Options for linking, used for instancing. - * @return Boolean, 0 when the datablock could not be found. + * @return the appended ID when found. */ -struct ID *BLO_library_append_named_part(const struct bContext *C, struct Main *mainl, BlendHandle** bh, const char *idname, int idcode, short flag); +struct ID *BLO_library_append_named_part_ex(const struct bContext *C, struct Main *mainl, BlendHandle** bh, const char *idname, const int idcode, const short flag); + void BLO_library_append_end(const struct bContext *C, struct Main *mainl, BlendHandle** bh, int idcode, short flag); void *BLO_library_read_struct(struct FileData *fd, struct BHead *bh, const char *blockname); Modified: trunk/blender/source/blender/blenloader/intern/readfile.c === --- trunk/blender/source/blender/blenloader/intern/readfile.c 2011-05-26 19:13:01 UTC (rev 36931) +++ trunk/blender/source/blender/blenloader/intern/readfile.c 2011-05-26 20:45:19 UTC (rev 36932) @@ -12806,24 +12806,17 @@ } /* returns true if the item was found - * but it may already have already been appended/linked */ -static ID *append_named_part(const bContext *C, Main *mainl, FileData *fd, const char *idname, int idcode, short flag) +* but it may already have already been appended/linked */ +static ID *append_named_part(Main *mainl, FileData *fd, const char *idname, const short idcode) { - Scene *scene= CTX_data_scene(C); /* can be NULL */ - Object *ob; - Base *base; BHead *bhead; ID *id= NULL; - int endloop=0; int found=0; - bhead = blo_firstbhead(fd); - while(bhead && endloop==0) { + for(bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) { + if(bhead->code==idcode) { + const char *idname_test= bhead_id_name(fd, bhead); - if(bhead->code==ENDB) endloop= 1; - else if(bhead->code==idcode) { - const char *idname_test= bhead_id_name(fd, bhead); - if(strcmp(idname_test + 2, idname)==0) { found= 1; id= is_yet_read(fd, mainl, bhead); @@ -12839,38 +12832,12 @@ } } - /* TODO, move out of append and into own func the caller can use */ - if(scene && id && (GS(id->name) == ID_OB)) { /* loose object: give a base */ - base= MEM_callocN( sizeof(Base), "app_nam_part"); - BLI_addtail(&scene->base, base); - - ob= (Object *)id; - - /* link at active layer (view3d->lay if in context, else scene->lay */ -
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36931] trunk/blender/source/blender/ python: sphinx docstrng formatting (some lines were getting really long)
Revision: 36931 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36931 Author: campbellbarton Date: 2011-05-26 19:13:01 + (Thu, 26 May 2011) Log Message: --- sphinx docstrng formatting (some lines were getting really long) Modified Paths: -- trunk/blender/source/blender/python/generic/mathutils_Color.c trunk/blender/source/blender/python/generic/mathutils_Euler.c trunk/blender/source/blender/python/generic/mathutils_Matrix.c trunk/blender/source/blender/python/generic/mathutils_Quaternion.c trunk/blender/source/blender/python/generic/mathutils_Vector.c trunk/blender/source/blender/python/intern/bpy_props.c trunk/blender/source/blender/python/intern/bpy_rna.c Modified: trunk/blender/source/blender/python/generic/mathutils_Color.c === --- trunk/blender/source/blender/python/generic/mathutils_Color.c 2011-05-26 18:11:59 UTC (rev 36930) +++ trunk/blender/source/blender/python/generic/mathutils_Color.c 2011-05-26 19:13:01 UTC (rev 36931) @@ -93,7 +93,8 @@ " :return: A copy of the color.\n" " :rtype: :class:`Color`\n" "\n" -" .. note:: use this to get a copy of a wrapped color with no reference to the original data.\n" +" .. note:: use this to get a copy of a wrapped color with\n" +" no reference to the original data.\n" ); static PyObject *Color_copy(ColorObject *self) { Modified: trunk/blender/source/blender/python/generic/mathutils_Euler.c === --- trunk/blender/source/blender/python/generic/mathutils_Euler.c 2011-05-26 18:11:59 UTC (rev 36930) +++ trunk/blender/source/blender/python/generic/mathutils_Euler.c 2011-05-26 19:13:01 UTC (rev 36931) @@ -185,7 +185,8 @@ PyDoc_STRVAR(Euler_rotate_axis_doc, ".. method:: rotate_axis(axis, angle)\n" "\n" -" Rotates the euler a certain amount and returning a unique euler rotation (no 720 degree pitches).\n" +" Rotates the euler a certain amount and returning a unique euler rotation\n" +" (no 720 degree pitches).\n" "\n" " :arg axis: single character in ['X, 'Y', 'Z'].\n" " :type axis: string\n" @@ -247,7 +248,8 @@ PyDoc_STRVAR(Euler_make_compatible_doc, ".. method:: make_compatible(other)\n" "\n" -" Make this euler compatible with another, so interpolating between them works as intended.\n" +" Make this euler compatible with another,\n" +" so interpolating between them works as intended.\n" "\n" " .. note:: the rotation order is not taken into account for this function.\n" ); @@ -279,7 +281,8 @@ " :return: A copy of the euler.\n" " :rtype: :class:`Euler`\n" "\n" -" .. note:: use this to get a copy of a wrapped euler with no reference to the original data.\n" +" .. note:: use this to get a copy of a wrapped euler with\n" +" no reference to the original data.\n" ); static PyObject *Euler_copy(EulerObject *self) { Modified: trunk/blender/source/blender/python/generic/mathutils_Matrix.c === --- trunk/blender/source/blender/python/generic/mathutils_Matrix.c 2011-05-26 18:11:59 UTC (rev 36930) +++ trunk/blender/source/blender/python/generic/mathutils_Matrix.c 2011-05-26 19:13:01 UTC (rev 36931) @@ -195,7 +195,8 @@ " :type angle: float\n" " :arg size: The size of the rotation matrix to construct [2, 4].\n" " :type size: int\n" -" :arg axis: a string in ['X', 'Y', 'Z'] or a 3D Vector Object (optional when size is 2).\n" +" :arg axis: a string in ['X', 'Y', 'Z'] or a 3D Vector Object\n" +" (optional when size is 2).\n" " :type axis: string or :class:`Vector`\n" " :return: A new rotation matrix.\n" " :rtype: :class:`Matrix`\n" @@ -407,7 +408,9 @@ "\n" " Create a matrix to represent an orthographic projection.\n" "\n" -" :arg axis: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'], where a single axis is for a 2D matrix. Or a vector for an arbitrary axis\n" +" :arg axis: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'],\n" +" where a single axis is for a 2D matrix.\n" +" Or a vector for an arbitrary axis\n" " :type axis: string or :class:`Vector`\n" " :arg size: The size of the projection matrix to construct [2, 4].\n" " :type size: int\n" @@ -513,11 +516,13 @@ "\n" " Create a matrix to represent an shear transformation.\n" "\n" -" :arg plane: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'], where a single axis is for a 2D matrix only.\n" +" :arg plane: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'],\n" +" where a single axis is for a 2D matrix only.\n" " :type plane: string\n" " :arg size: The size of the shear matrix to construct [2, 4].\n" " :type size: int\n" -" :arg factor: The factor of shear to apply. For a 3 or 4 *size* matrix pass a pair of floats corrasp
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36930] trunk/blender/release/scripts/ startup/bl_ui: use a dynamic enum for addons, annoyingly the enum was being generated from python for each of t
Revision: 36930 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36930 Author: campbellbarton Date: 2011-05-26 18:11:59 + (Thu, 26 May 2011) Log Message: --- use a dynamic enum for addons, annoyingly the enum was being generated from python for each of the addon buttons (~14 times per draw) which was noticeably slow, so disabling 'expand' for now. Eventually it would be good to have the expanded buttons all using the same result from itemf(). Modified Paths: -- trunk/blender/release/scripts/startup/bl_ui/__init__.py trunk/blender/release/scripts/startup/bl_ui/space_userpref.py Modified: trunk/blender/release/scripts/startup/bl_ui/__init__.py === --- trunk/blender/release/scripts/startup/bl_ui/__init__.py 2011-05-26 17:07:38 UTC (rev 36929) +++ trunk/blender/release/scripts/startup/bl_ui/__init__.py 2011-05-26 18:11:59 UTC (rev 36930) @@ -85,26 +85,26 @@ from bpy.props import StringProperty, EnumProperty WindowManager = bpy.types.WindowManager +def addon_filter_items(self, context): +import addon_utils + +items = [('All', "All", ""), + ('Enabled', "Enabled", ""), + ('Disabled', "Disabled", ""), +] + +items_unique = set() + +for mod in addon_utils.modules(space_userpref.USERPREF_PT_addons._addons_fake_modules): +info = addon_utils.module_bl_info(mod) +items_unique.add(info["category"]) + +items.extend([(cat, cat, "") for cat in sorted(items_unique)]) +return items + WindowManager.addon_search = StringProperty(name="Search", description="Search within the selected filter") WindowManager.addon_filter = EnumProperty( -items=[('All', "All", ""), - ('Enabled', "Enabled", ""), - ('Disabled', "Disabled", ""), - ('3D View', "3D View", ""), - ('Add Curve', "Add Curve", ""), - ('Add Mesh', "Add Mesh", ""), - ('Animation', "Animation", ""), - ('Development', "Development", ""), - ('Game Engine', "Game Engine", ""), - ('Import-Export', "Import-Export", ""), - ('Mesh', "Mesh", ""), - ('Object', "Object", ""), - ('Render', "Render", ""), - ('Rigging', "Rigging", ""), - ('Text Editor', "Text Editor", ""), - ('System', "System", ""), - ('Other', "Other", ""), - ], +items=addon_filter_items, name="Category", description="Filter add-ons by category", ) Modified: trunk/blender/release/scripts/startup/bl_ui/space_userpref.py === --- trunk/blender/release/scripts/startup/bl_ui/space_userpref.py 2011-05-26 17:07:38 UTC (rev 36929) +++ trunk/blender/release/scripts/startup/bl_ui/space_userpref.py 2011-05-26 18:11:59 UTC (rev 36930) @@ -889,7 +889,8 @@ split = layout.split(percentage=0.2) col = split.column() col.prop(context.window_manager, "addon_search", text="", icon='VIEWZOOM') -col.prop(context.window_manager, "addon_filter", expand=True) +col.label(text="Categories") +col.prop(context.window_manager, "addon_filter", text="") # , expand=True, too slow with dynamic enum. col.label(text="Supported Level") col.prop(context.window_manager, "addon_support", expand=True) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36929] branches/soc-2011-pepper/source/ blender/collada: AnimationExporter class refactoring.
Revision: 36929 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36929 Author: phabtar Date: 2011-05-26 17:07:38 + (Thu, 26 May 2011) Log Message: --- AnimationExporter class refactoring. Exported AnimationExporter class to a separate set of files. Modified Paths: -- branches/soc-2011-pepper/source/blender/collada/CMakeLists.txt branches/soc-2011-pepper/source/blender/collada/DocumentExporter.cpp Added Paths: --- branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp branches/soc-2011-pepper/source/blender/collada/AnimationExporter.h Added: branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp === --- branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp (rev 0) +++ branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp 2011-05-26 17:07:38 UTC (rev 36929) @@ -0,0 +1,660 @@ +/* + * $Id: DocumentExporter.cpp 36898 2011-05-25 17:14:31Z phabtar $ + * + * * 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. + * + * Contributor(s): Chingiz Dyussenov, Arystanbek Dyussenov, Jan Diederich, Tod Liverseed. + * + * * END GPL LICENSE BLOCK * + */ + +#include "GeometryExporter.h" +#include "AnimationExporter.h" + +template +void forEachObjectInScene(Scene *sce, Functor &f) +{ + Base *base= (Base*) sce->base.first; + while(base) { + Object *ob = base->object; + + f(ob); + + base= base->next; + } +} + +void AnimationExporter::exportAnimations(Scene *sce) + { + if(hasAnimations(sce)) { + this->scene = sce; + + openLibrary(); + + forEachObjectInScene(sce, *this); + + closeLibrary(); + } + } + + // called for each exported object + void AnimationExporter::operator() (Object *ob) + { + if (!ob->adt || !ob->adt->action) return; + + FCurve *fcu = (FCurve*)ob->adt->action->curves.first; + + if (ob->type == OB_ARMATURE) { + if (!ob->data) return; + + bArmature *arm = (bArmature*)ob->data; + for (Bone *bone = (Bone*)arm->bonebase.first; bone; bone = bone->next) + write_bone_animation(ob, bone); + } + else { + while (fcu) { + // TODO "rotation_quaternion" is also possible for objects (although euler is default) + if ((!strcmp(fcu->rna_path, "location") || !strcmp(fcu->rna_path, "scale")) || + (!strcmp(fcu->rna_path, "rotation_euler") && ob->rotmode == ROT_MODE_EUL)) + dae_animation(fcu, id_name(ob)); + + fcu = fcu->next; + } + } + } + + void AnimationExporter::dae_animation(FCurve *fcu, std::string ob_name) + { + const char *axis_names[] = {"X", "Y", "Z"}; + const char *axis_name = NULL; + char anim_id[200]; + + if (fcu->array_index < 3) + axis_name = axis_names[fcu->array_index]; + + BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s_%s", (char*)translate_id(ob_name).c_str(), +fcu->rna_path, axis_names[fcu->array_index]); + + // check rna_path is one of: rotation, scale, location + + openAnimation(anim_id, COLLADABU::Utils::EMPTY_STRING); + + // create input source + std::string input_id = create_source_from_fcurve(COLLADASW::InputSemantic::INPUT, fcu, anim_id, axis_name); + + // create output source + std::string output_id = create_source_from_fcurve(COLLADASW::InputSemantic::OUTPUT, fcu, anim_id, axis_name); + + // create interpolations source +
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36928] trunk/blender/source/blender: support for dynamic items in bpy.props.EnumProperty(), the items keyword argument can optionally be a function r
Revision: 36928 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36928 Author: campbellbarton Date: 2011-05-26 16:07:28 + (Thu, 26 May 2011) Log Message: --- support for dynamic items in bpy.props.EnumProperty(), the items keyword argument can optionally be a function rather then a list. Modified Paths: -- trunk/blender/source/blender/makesrna/RNA_access.h trunk/blender/source/blender/makesrna/RNA_define.h trunk/blender/source/blender/makesrna/intern/makesrna.c trunk/blender/source/blender/makesrna/intern/rna_access.c trunk/blender/source/blender/makesrna/intern/rna_define.c trunk/blender/source/blender/makesrna/intern/rna_internal_types.h trunk/blender/source/blender/python/intern/bpy_props.c Modified: trunk/blender/source/blender/makesrna/RNA_access.h === --- trunk/blender/source/blender/makesrna/RNA_access.h 2011-05-26 15:04:41 UTC (rev 36927) +++ trunk/blender/source/blender/makesrna/RNA_access.h 2011-05-26 16:07:28 UTC (rev 36928) @@ -743,6 +743,7 @@ int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop); void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value); int RNA_property_enum_get_default(PointerRNA *ptr, PropertyRNA *prop); +void *RNA_property_enum_py_data_get(PropertyRNA *prop); PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop); void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value); Modified: trunk/blender/source/blender/makesrna/RNA_define.h === --- trunk/blender/source/blender/makesrna/RNA_define.h 2011-05-26 15:04:41 UTC (rev 36927) +++ trunk/blender/source/blender/makesrna/RNA_define.h 2011-05-26 16:07:28 UTC (rev 36928) @@ -90,6 +90,7 @@ PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description); PropertyRNA *RNA_def_enum_flag(StructOrFunctionRNA *cont, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description); void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc); +void RNA_def_enum_py_data(PropertyRNA *prop, void *py_data); PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); PropertyRNA *RNA_def_float_vector(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); Modified: trunk/blender/source/blender/makesrna/intern/makesrna.c === --- trunk/blender/source/blender/makesrna/intern/makesrna.c 2011-05-26 15:04:41 UTC (rev 36927) +++ trunk/blender/source/blender/makesrna/intern/makesrna.c 2011-05-26 16:07:28 UTC (rev 36928) @@ -2223,7 +2223,7 @@ } case PROP_ENUM: { EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop; - fprintf(f, "\t%s, %s, %s, ", rna_function_string(eprop->get), rna_function_string(eprop->set), rna_function_string(eprop->itemf)); + fprintf(f, "\t%s, %s, %s, NULL, ", rna_function_string(eprop->get), rna_function_string(eprop->set), rna_function_string(eprop->itemf)); if(eprop->item) fprintf(f, "rna_%s%s_%s_items, ", srna->identifier, strnest, prop->identifier); else Modified: trunk/blender/source/blender/makesrna/intern/rna_access.c === --- trunk/blender/source/blender/makesrna/intern/rna_access.c 2011-05-26 15:04:41 UTC (rev 36927) +++ trunk/blender/source/blender/makesrna/intern/rna_access.c 2011-05-26 16:07:28 UTC (rev 36928) @@ -2120,7 +2120,15 @@ return eprop->defaultvalue; } +void *RNA_property_enum_py_data_get(PropertyRNA *prop) +{ + EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop; + BLI_assert(RNA_property_type(prop) == PROP_ENUM); + + return eprop->py_data; +} + PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop) { PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop; Modified: trunk/blender/source/blender/makesrna/intern/rna_define.c === --- trunk/blender/source/blender/makesrna/intern/rna_define.c 2011-05-26 15:04:41 UTC (rev 36927) +++ trunk/blender/source/blender/makesrna/intern/rna_define.c 2011-05-26 16:07:28 UTC (rev 3692
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36927] branches/soc-2011-onion/source/ blender/blenkernel/intern/brush.c: de-gamma correct brush color before applying brush.
Revision: 36927 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36927 Author: psy-fi Date: 2011-05-26 15:04:41 + (Thu, 26 May 2011) Log Message: --- de-gamma correct brush color before applying brush. Maybe this will fix problems with incorrect colors during painting Modified Paths: -- branches/soc-2011-onion/source/blender/blenkernel/intern/brush.c Modified: branches/soc-2011-onion/source/blender/blenkernel/intern/brush.c === --- branches/soc-2011-onion/source/blender/blenkernel/intern/brush.c 2011-05-26 14:30:46 UTC (rev 36926) +++ branches/soc-2011-onion/source/blender/blenkernel/intern/brush.c 2011-05-26 15:04:41 UTC (rev 36927) @@ -562,9 +562,9 @@ brush_sample_tex(brush, xy, rgba, 0); - dstf[0] = rgba[0]*brush->rgb[0]; - dstf[1] = rgba[1]*brush->rgb[1]; - dstf[2] = rgba[2]*brush->rgb[2]; + dstf[0] = rgba[0]*srgb_to_linearrgb(brush->rgb[0]); + dstf[1] = rgba[1]*srgb_to_linearrgb(brush->rgb[1]); + dstf[2] = rgba[2]*srgb_to_linearrgb(brush->rgb[2]); dstf[3] = rgba[3]*alpha*brush_curve_strength_clamp(brush, dist, radius); } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36926] branches/soc-2011-onion/source/ blender: a few comments plus a null check
Revision: 36926 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36926 Author: psy-fi Date: 2011-05-26 14:30:46 + (Thu, 26 May 2011) Log Message: --- a few comments plus a null check Modified Paths: -- branches/soc-2011-onion/source/blender/gpu/intern/gpu_draw.c branches/soc-2011-onion/source/blender/imbuf/IMB_imbuf.h branches/soc-2011-onion/source/blender/imbuf/intern/divers.c Modified: branches/soc-2011-onion/source/blender/gpu/intern/gpu_draw.c === --- branches/soc-2011-onion/source/blender/gpu/intern/gpu_draw.c 2011-05-26 13:59:57 UTC (rev 36925) +++ branches/soc-2011-onion/source/blender/gpu/intern/gpu_draw.c 2011-05-26 14:30:46 UTC (rev 36926) @@ -706,10 +706,18 @@ glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skip_rows); if (ibuf->rect_float){ + /*This case needs a whole new buffer*/ if(ibuf->rect==NULL) { IMB_rect_from_float(ibuf); } else { + /*Do partial drawing. 'buffer' holds only the changed part. + This approach is better since: + a)we avoid sending the whole + texture to the driver(bandwidth) + b)The driver skips some math when uploading the texture. + + implementation for non-float images will follow*/ float *buffer = (float *)MEM_mallocN(w*h*sizeof(float)*4, "temp_texpaint_float_buf"); IMB_partial_rect_from_float(ibuf, buffer, x, y, w, h); glBindTexture(GL_TEXTURE_2D, ima->bindcode); Modified: branches/soc-2011-onion/source/blender/imbuf/IMB_imbuf.h === --- branches/soc-2011-onion/source/blender/imbuf/IMB_imbuf.h2011-05-26 13:59:57 UTC (rev 36925) +++ branches/soc-2011-onion/source/blender/imbuf/IMB_imbuf.h2011-05-26 14:30:46 UTC (rev 36926) @@ -323,7 +323,8 @@ /*create char buffer, color corrected if necessary, for ImBufs that lack one*/ void IMB_rect_from_float(struct ImBuf *ibuf); -/*create char buffer for part of the image, color corrected if necessary, for ImBufs that lack one*/ +/*create char buffer for part of the image, color corrected if necessary, for ImBufs that lack one. +Changed part will be stored in buffer. This is expected to bu used for texure painting updates*/ void IMB_partial_rect_from_float(struct ImBuf *ibuf, float *buffer, int x, int y, int w, int h); void IMB_float_from_rect(struct ImBuf *ibuf); void IMB_float_from_rect_simple(struct ImBuf *ibuf); /* no profile conversion */ Modified: branches/soc-2011-onion/source/blender/imbuf/intern/divers.c === --- branches/soc-2011-onion/source/blender/imbuf/intern/divers.c 2011-05-26 13:59:57 UTC (rev 36925) +++ branches/soc-2011-onion/source/blender/imbuf/intern/divers.c 2011-05-26 14:30:46 UTC (rev 36926) @@ -224,7 +224,9 @@ if called -only- from GPU_paint_update_image this test will never fail but leaving it here for better or worse */ - if(init_srcFloatPxl==NULL) return; + if(init_srcFloatPxl==NULL || (buffer == NULL)){ + return; + } if(init_dstBytePxl==NULL) { imb_addrectImBuf(ibuf); init_dstBytePxl = (unsigned char *) ibuf->rect; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36924] trunk/blender/source/blender: add the property as an argument to enum item functions, not used yet but needed for dynamic python enums.
Revision: 36924 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36924 Author: campbellbarton Date: 2011-05-26 13:38:16 + (Thu, 26 May 2011) Log Message: --- add the property as an argument to enum item functions, not used yet but needed for dynamic python enums. Modified Paths: -- trunk/blender/source/blender/editors/animation/keyingsets.c trunk/blender/source/blender/editors/armature/poselib.c trunk/blender/source/blender/editors/include/ED_keyframing.h trunk/blender/source/blender/editors/mesh/editmesh_mods.c trunk/blender/source/blender/editors/mesh/editmesh_tools.c trunk/blender/source/blender/editors/object/object_edit.c trunk/blender/source/blender/editors/object/object_hook.c trunk/blender/source/blender/editors/object/object_modifier.c trunk/blender/source/blender/editors/object/object_relations.c trunk/blender/source/blender/editors/object/object_vgroup.c trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c trunk/blender/source/blender/makesrna/RNA_enum_types.h trunk/blender/source/blender/makesrna/RNA_types.h trunk/blender/source/blender/makesrna/intern/rna_access.c trunk/blender/source/blender/makesrna/intern/rna_actuator.c trunk/blender/source/blender/makesrna/intern/rna_brush.c trunk/blender/source/blender/makesrna/intern/rna_constraint.c trunk/blender/source/blender/makesrna/intern/rna_image.c trunk/blender/source/blender/makesrna/intern/rna_internal_types.h trunk/blender/source/blender/makesrna/intern/rna_material.c trunk/blender/source/blender/makesrna/intern/rna_nodetree.c trunk/blender/source/blender/makesrna/intern/rna_object.c trunk/blender/source/blender/makesrna/intern/rna_object_force.c trunk/blender/source/blender/makesrna/intern/rna_particle.c trunk/blender/source/blender/makesrna/intern/rna_rna.c trunk/blender/source/blender/makesrna/intern/rna_scene.c trunk/blender/source/blender/makesrna/intern/rna_sculpt_paint.c trunk/blender/source/blender/makesrna/intern/rna_sensor.c trunk/blender/source/blender/makesrna/intern/rna_space.c trunk/blender/source/blender/makesrna/intern/rna_texture.c trunk/blender/source/blender/makesrna/intern/rna_wm.c trunk/blender/source/blender/windowmanager/intern/wm_operators.c Modified: trunk/blender/source/blender/editors/animation/keyingsets.c === --- trunk/blender/source/blender/editors/animation/keyingsets.c 2011-05-26 12:56:32 UTC (rev 36923) +++ trunk/blender/source/blender/editors/animation/keyingsets.c 2011-05-26 13:38:16 UTC (rev 36924) @@ -696,7 +696,7 @@ /* Menu of All Keying Sets - */ /* Dynamically populate an enum of Keying Sets */ -EnumPropertyItem *ANIM_keying_sets_enum_itemf (bContext *C, PointerRNA *UNUSED(ptr), int *free) +EnumPropertyItem *ANIM_keying_sets_enum_itemf (bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { Scene *scene = CTX_data_scene(C); KeyingSet *ks; Modified: trunk/blender/source/blender/editors/armature/poselib.c === --- trunk/blender/source/blender/editors/armature/poselib.c 2011-05-26 12:56:32 UTC (rev 36923) +++ trunk/blender/source/blender/editors/armature/poselib.c 2011-05-26 13:38:16 UTC (rev 36924) @@ -483,7 +483,7 @@ /* - */ /* can be called with C == NULL */ -static EnumPropertyItem *poselib_stored_pose_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) +static EnumPropertyItem *poselib_stored_pose_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { Object *ob = get_poselib_object(C); bAction *act = (ob) ? ob->poselib : NULL; Modified: trunk/blender/source/blender/editors/include/ED_keyframing.h === --- trunk/blender/source/blender/editors/include/ED_keyframing.h 2011-05-26 12:56:32 UTC (rev 36923) +++ trunk/blender/source/blender/editors/include/ED_keyframing.h 2011-05-26 13:38:16 UTC (rev 36924) @@ -211,7 +211,7 @@ void ANIM_keying_sets_menu_setup(struct bContext *C, const char title[], const char op_name[]); /* Dynamically populate an enum of Keying Sets */ -struct EnumPropertyItem *ANIM_keying_sets_enum_itemf(struct bContext *C, struct PointerRNA *ptr, int *free); +struct EnumPropertyItem *ANIM_keying_sets_enum_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, int *free); /* Check if KeyingSet can be used in the current context */ short ANIM_keyingset_context_ok_poll(struct bContext *C, struct KeyingSet *ks); Modified: trunk/blender/source/blender/editors/mesh/editmesh_mods.c === --- trunk/blender/source/blender/editors/mesh/editmesh_mods.c
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36922] branches/soc-2011-pepper/source/ blender: New experimental drawtype for armatures: "Wire"
Revision: 36922 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36922 Author: aligorith Date: 2011-05-26 12:34:53 + (Thu, 26 May 2011) Log Message: --- New experimental drawtype for armatures: "Wire" This is equivalent to using B-Bones which are all scaled to have xwidth=zwidth=0, which can be useful to see how some limbs will bend, without the overhead of blocks blocking the view or having to scale down bone sizes first. Modified Paths: -- branches/soc-2011-pepper/source/blender/editors/space_view3d/drawarmature.c branches/soc-2011-pepper/source/blender/makesdna/DNA_armature_types.h branches/soc-2011-pepper/source/blender/makesrna/intern/rna_armature.c Modified: branches/soc-2011-pepper/source/blender/editors/space_view3d/drawarmature.c === --- branches/soc-2011-pepper/source/blender/editors/space_view3d/drawarmature.c 2011-05-26 12:23:56 UTC (rev 36921) +++ branches/soc-2011-pepper/source/blender/editors/space_view3d/drawarmature.c 2011-05-26 12:34:53 UTC (rev 36922) @@ -1217,6 +1217,87 @@ } } +static void draw_wire_bone_segments(bPoseChannel *pchan, Mat4 *bbones, float length, int segments) +{ + if ((segments > 1) && (pchan)) { + float dlen= length/(float)segments; + Mat4 *bbone = bbones; + int a; + + for (a=0; amat); + + glBegin(GL_LINES); + glVertex3f(0.0f, 0.0f, 0.0f); + glVertex3f(0.0f, dlen, 0.0f); + glEnd(); // GL_LINES + + glPopMatrix(); + } + } + else { + glPushMatrix(); + + glBegin(GL_LINES); + glVertex3f(0.0f, 0.0f, 0.0f); + glVertex3f(0.0f, length, 0.0f); + glEnd(); + + glPopMatrix(); + } +} + +static void draw_wire_bone(int dt, int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone) +{ + Mat4 *bbones = NULL; + int segments = 0; + float length; + + if (pchan) { + segments= pchan->bone->segments; + length= pchan->bone->length; + + if (segments > 1) + bbones = b_bone_spline_setup(pchan, 0); + } + else + length= ebone->length; + + /* draw points only if... */ + if (armflag & ARM_EDITMODE) { + /* move to unitspace */ + glPushMatrix(); + glScalef(length, length, length); + draw_bone_points(dt, armflag, boneflag, id); + glPopMatrix(); + length *= 0.95f;// make vertices visible + } + + /* this chunk not in object mode */ + if (armflag & (ARM_EDITMODE|ARM_POSEMODE)) { + if (id != -1) + glLoadName((GLuint) id|BONESEL_BONE); + + draw_wire_bone_segments(pchan, bbones, length, segments); + + /* further we send no names */ + if (id != -1) + glLoadName(id & 0x);/* object tag, for bordersel optim */ + } + + /* colors for modes */ + if (armflag & ARM_POSEMODE) { + set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag); + } + else if (armflag & ARM_EDITMODE) { + set_ebone_glColor(boneflag); + } + + /* draw normal */ + draw_wire_bone_segments(pchan, bbones, length, segments); +} + static void draw_bone(int dt, int armflag, int boneflag, int constflag, unsigned int id, float length) { @@ -1656,7 +1737,7 @@ int use_custom = (pchan->custom) && !(arm->flag & ARM_NO_CUSTOM); glPushMatrix(); - if(use_custom && pchan->custom_tx) { + if (use_custom && pchan->custom_tx) { glMultMatrixf(pchan->custom_tx->pose_mat); } else { @@ -1684,6 +1765,8 @@ } else if (arm->drawtype==ARM_LINE) ; /* nothing in solid */ + else if (arm->drawtype==ARM_WIRE) + ; /* nothing in solid */ else if (arm->drawtype==ARM_ENVELOPE) dra
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36921] branches/soc-2011-pepper/release/ scripts/modules/mocap_tools.py: Changing SVN properties on mocap_tools. py so that this plays nice on
Revision: 36921 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36921 Author: aligorith Date: 2011-05-26 12:23:56 + (Thu, 26 May 2011) Log Message: --- Changing SVN properties on mocap_tools.py so that this plays nice on all platforms. Note to other SoC students: When adding new source files, please remember to add a "svn:eol-style" = "native" SVN property to those files, which gets rid of any problems with line-endings between Windows/Linux (and "other" platforms). It's easier in the long run if you just ensure that you've got autoprops enabled to set this in your svn config. Property Changed: branches/soc-2011-pepper/release/scripts/modules/mocap_tools.py Property changes on: branches/soc-2011-pepper/release/scripts/modules/mocap_tools.py ___ Added: svn:eol-style + native ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36920] trunk/blender/source/blender/ blenlib/intern/path_util.c: Since we don't support win2k or older anymore, remove old shortname code.
Revision: 36920 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36920 Author: jesterking Date: 2011-05-26 12:23:11 + (Thu, 26 May 2011) Log Message: --- Since we don't support win2k or older anymore, remove old shortname code. Finally nice full names. Modified Paths: -- trunk/blender/source/blender/blenlib/intern/path_util.c Modified: trunk/blender/source/blender/blenlib/intern/path_util.c === --- trunk/blender/source/blender/blenlib/intern/path_util.c 2011-05-26 12:15:42 UTC (rev 36919) +++ trunk/blender/source/blender/blenlib/intern/path_util.c 2011-05-26 12:23:11 UTC (rev 36920) @@ -1691,7 +1691,6 @@ #ifdef _WIN32 if(GetModuleFileName(0, fullname, maxlen)) { - GetShortPathName(fullname, fullname, maxlen); if(!BLI_exists(fullname)) { printf("path can't be found: \"%.*s\"\n", maxlen, fullname); MessageBox(NULL, "path constains invalid characters or is too long (see console)", "Error", MB_OK); @@ -1745,18 +1744,6 @@ printf("guessing '%s' == '%s'\n", name, fullname); } #endif - -#ifdef _WIN32 - // in windows change long filename to short filename because - // win2k doesn't know how to parse a commandline with lots of - // spaces and double-quotes. There's another solution to this - // with spawnv(P_WAIT, bprogname, argv) instead of system() but - // that's even uglier - GetShortPathName(fullname, fullname, maxlen); -#if defined(DEBUG) - printf("Shortname = '%s'\n", fullname); -#endif -#endif } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36919] trunk/blender/source/creator/ CMakeLists.txt: fix for installing blender as a python module with cmake.
Revision: 36919 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36919 Author: campbellbarton Date: 2011-05-26 12:15:42 + (Thu, 26 May 2011) Log Message: --- fix for installing blender as a python module with cmake. Modified Paths: -- trunk/blender/source/creator/CMakeLists.txt Modified: trunk/blender/source/creator/CMakeLists.txt === --- trunk/blender/source/creator/CMakeLists.txt 2011-05-26 12:09:21 UTC (rev 36918) +++ trunk/blender/source/creator/CMakeLists.txt 2011-05-26 12:15:42 UTC (rev 36919) @@ -278,17 +278,11 @@ else() # main blender binary if(WITH_PYTHON_MODULE) - get_target_property(_module_name blender OUTPUT_NAME) - if(NOT _module_suffix) - set(_module_suffix "${SUFFIX}") - endif() - install( - PROGRAMS "${TARGETDIR}/${_module_name}.so" # XXX, *nix only + TARGETS blender + LIBRARY DESTINATION ${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages ) - - unset(_module_name) else() install( PROGRAMS ${TARGETDIR}/blender ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36918] branches/soc-2011-pepper/source/ blender/makesrna/intern/rna_constraint.c: Bugfix: Label for " Local With Parent" constraint space was broken
Revision: 36918 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36918 Author: aligorith Date: 2011-05-26 12:09:21 + (Thu, 26 May 2011) Log Message: --- Bugfix: Label for "Local With Parent" constraint space was broken by tooltips patch applied a few weeks ago in trunk Modified Paths: -- branches/soc-2011-pepper/source/blender/makesrna/intern/rna_constraint.c Modified: branches/soc-2011-pepper/source/blender/makesrna/intern/rna_constraint.c === --- branches/soc-2011-pepper/source/blender/makesrna/intern/rna_constraint.c 2011-05-26 12:02:31 UTC (rev 36917) +++ branches/soc-2011-pepper/source/blender/makesrna/intern/rna_constraint.c 2011-05-26 12:09:21 UTC (rev 36918) @@ -85,7 +85,7 @@ static EnumPropertyItem owner_space_pchan_items[] = { {0, "WORLD", 0, "World Space", "The constraint is applied relative to the world coordinate system"}, {2, "POSE", 0, "Pose Space", "The constraint is applied in Pose Space, the object transformation is ignored"}, - {3, "LOCAL_WITH_PARENT", 0, "The constraint is applied relative to the local coordinate system of the object, with the parent transformation added"}, + {3, "LOCAL_WITH_PARENT", 0, "Local With Parent", "The constraint is applied relative to the local coordinate system of the object, with the parent transformation added"}, {1, "LOCAL", 0, "Local Space", "The constraint is applied relative to the local coordinate sytem of the object"}, {0, NULL, 0, NULL, NULL}}; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36916] trunk/blender: update to build system excluding parts of the python bundle.
Revision: 36916 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36916 Author: campbellbarton Date: 2011-05-26 11:45:25 + (Thu, 26 May 2011) Log Message: --- update to build system excluding parts of the python bundle. Modified Paths: -- trunk/blender/build_files/scons/tools/Blender.py trunk/blender/source/creator/CMakeLists.txt Modified: trunk/blender/build_files/scons/tools/Blender.py === --- trunk/blender/build_files/scons/tools/Blender.py2011-05-26 10:56:36 UTC (rev 36915) +++ trunk/blender/build_files/scons/tools/Blender.py2011-05-26 11:45:25 UTC (rev 36916) @@ -449,10 +449,16 @@ shutil.rmtree(py_target, False, printexception) exclude_re=[re.compile('.*/test/.*'), re.compile('^config/.*'), +re.compile('^config-*/.*'), re.compile('^distutils/.*'), re.compile('^idlelib/.*'), re.compile('^lib2to3/.*'), -re.compile('^tkinter/.*')] +re.compile('^tkinter/.*'), +re.compile('^_tkinter_d.pyd'), +re.compile('^turtledemo'), +re.compile('^turtle.py'), +] + print "Unpacking '" + py_tar + "' to '" + py_target + "'" untar_pybundle(py_tar,py_target,exclude_re) @@ -569,17 +575,17 @@ run("cp -R '%s' '%s'" % (py_src, os.path.dirname(py_target))) run("rm -rf '%s/distutils'" % py_target) run("rm -rf '%s/lib2to3'" % py_target) -run("rm -rf '%s/idlelib'" % py_target) -run("rm -rf '%s/tkinter'" % py_target) run("rm -rf '%s/config'" % py_target) - +run("rm -rf '%s/config-*'" % py_target) run("rm -rf '%s/site-packages'" % py_target) run("mkdir '%s/site-packages'" % py_target)# python needs it.' +run("rm -rf '%s/idlelib'" % py_target) +run("rm -rf '%s/tkinter'" % py_target) +run("rm -rf '%s/turtledemo'" % py_target) +run("rm -r '%s/turtle.py'" % py_target) +run("rm -f '%s/lib-dynload/_tkinter.so'" % py_target) -run("rm -f '%s/lib-dynload/_tkinter.so'" % py_target) run("find '%s' -type d -name 'test' -prune -exec rm -rf {} ';'" % py_target) -run("find '%s' -type d -name 'config-*' -prune -exec rm -rf {} ';'" % py_target) -run("find '%s' -type d -name 'turtledemo' -prune -exec rm -rf {} ';'" % py_target) run("find '%s' -type d -name '__pycache__' -exec rm -rf {} ';'" % py_target) run("find '%s' -name '*.py[co]' -exec rm -rf {} ';'" % py_target) run("find '%s' -name '*.so' -exec strip -s {} ';'" % py_target) Modified: trunk/blender/source/creator/CMakeLists.txt === --- trunk/blender/source/creator/CMakeLists.txt 2011-05-26 10:56:36 UTC (rev 36915) +++ trunk/blender/source/creator/CMakeLists.txt 2011-05-26 11:45:25 UTC (rev 36916) @@ -193,8 +193,8 @@ PROPERTIES PREFIX "" OUTPUT_NAME bpy - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/ - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/ # only needed on windows + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin # only needed on windows ) if(WIN32) @@ -270,7 +270,7 @@ ) install( - DIRECTORY ${CMAKE_SOURCE_DIR}/release/text/ + DIRECTORY ${CMAKE_SOURCE_DIR}/release/text DESTINATION ${TARGETDIR} PATTERN ".svn" EXCLUDE ) @@ -317,7 +317,7 @@ ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/32x32 ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/48x48 ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/256x256 - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/ + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor PATTERN ".svn" EXCLUDE PATTERN "*.svg" EXCLUDE ) @@ -334,7 +334,7 @@ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1 ) install( - DIRECTORY ${CMAKE_SOURCE_DIR}/release/text/ + DIRECTORY ${CMAKE_SOURCE_DIR}/release/text DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/blender PATTERN ".svn" EXCLUDE ) @@ -353,7 +353,7 @@ install( DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale - DESTINATIO
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36915] branches/soc-2010-jwilkins/source/ blender/python/generic/mathutils_Color.h: This file was giving me problems committing with everything else,
Revision: 36915 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36915 Author: jwilkins Date: 2011-05-26 10:56:36 + (Thu, 26 May 2011) Log Message: --- This file was giving me problems committing with everything else, so trying to commit it separately. Property Changed: branches/soc-2010-jwilkins/source/blender/python/generic/mathutils_Color.h Property changes on: branches/soc-2010-jwilkins/source/blender/python/generic/mathutils_Color.h ___ Added: svn:mergeinfo + /trunk/blender/source/blender/python/generic/mathutils_Color.h:34825-34836,34893-36913 ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36914] trunk/blender/source/blender/ blenloader/intern/readfile.c: Fix #27465: used light groups did not get linked in with materials automatically.
Revision: 36914 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36914 Author: blendix Date: 2011-05-26 10:25:51 + (Thu, 26 May 2011) Log Message: --- Fix #27465: used light groups did not get linked in with materials automatically. Modified Paths: -- trunk/blender/source/blender/blenloader/intern/readfile.c Modified: trunk/blender/source/blender/blenloader/intern/readfile.c === --- trunk/blender/source/blender/blenloader/intern/readfile.c 2011-05-26 10:21:09 UTC (rev 36913) +++ trunk/blender/source/blender/blenloader/intern/readfile.c 2011-05-26 10:25:51 UTC (rev 36914) @@ -12200,6 +12200,9 @@ if(ma->nodetree) expand_nodetree(fd, mainvar, ma->nodetree); + + if(ma->group) + expand_doit(fd, mainvar, ma->group); } static void expand_lamp(FileData *fd, Main *mainvar, Lamp *la) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36913] trunk/blender/source/blender/ modifiers/intern/MOD_armature.c: Fix #27480: armature multimodifier was not working in edit mode.
Revision: 36913 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36913 Author: blendix Date: 2011-05-26 10:21:09 + (Thu, 26 May 2011) Log Message: --- Fix #27480: armature multimodifier was not working in edit mode. Modified Paths: -- trunk/blender/source/blender/modifiers/intern/MOD_armature.c Modified: trunk/blender/source/blender/modifiers/intern/MOD_armature.c === --- trunk/blender/source/blender/modifiers/intern/MOD_armature.c 2011-05-26 09:58:22 UTC (rev 36912) +++ trunk/blender/source/blender/modifiers/intern/MOD_armature.c 2011-05-26 10:21:09 UTC (rev 36913) @@ -127,8 +127,8 @@ modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */ armature_deform_verts(amd->object, ob, derivedData, vertexCos, NULL, - numVerts, amd->deformflag, -(float(*)[3])amd->prevCos, amd->defgrp_name); + numVerts, amd->deformflag, (float(*)[3])amd->prevCos, amd->defgrp_name); + /* free cache */ if(amd->prevCos) { MEM_freeN(amd->prevCos); @@ -145,9 +145,17 @@ if(!derivedData) dm = CDDM_from_editmesh(editData, ob->data); - armature_deform_verts(amd->object, ob, dm, vertexCos, NULL, numVerts, - amd->deformflag, NULL, amd->defgrp_name); + modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */ + armature_deform_verts(amd->object, ob, dm, vertexCos, NULL, + numVerts, amd->deformflag, (float(*)[3])amd->prevCos, amd->defgrp_name); + + /* free cache */ + if(amd->prevCos) { + MEM_freeN(amd->prevCos); + amd->prevCos= NULL; + } + if(!derivedData) dm->release(dm); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36912] trunk/blender/source/blender: Fix #27445: various operators missing with some non-english system languages.
Revision: 36912 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36912 Author: blendix Date: 2011-05-26 09:58:22 + (Thu, 26 May 2011) Log Message: --- Fix #27445: various operators missing with some non-english system languages. In the case of this bug e.g. material.new became MATERiAL_OT_new, due to different capitalization of "i" in Turkish. Fixed by not using the locale dependent toupper/tolower functions. Modified Paths: -- trunk/blender/source/blender/blenlib/BLI_string.h trunk/blender/source/blender/blenlib/intern/string.c trunk/blender/source/blender/windowmanager/intern/wm_operators.c Modified: trunk/blender/source/blender/blenlib/BLI_string.h === --- trunk/blender/source/blender/blenlib/BLI_string.h 2011-05-26 09:46:51 UTC (rev 36911) +++ trunk/blender/source/blender/blenlib/BLI_string.h 2011-05-26 09:58:22 UTC (rev 36912) @@ -147,6 +147,9 @@ int BLI_utf8_invalid_byte(const char *str, int length); int BLI_utf8_invalid_strip(char *str, int length); +void BLI_ascii_strtolower(char *str, int len); +void BLI_ascii_strtoupper(char *str, int len); + #ifdef __cplusplus } #endif Modified: trunk/blender/source/blender/blenlib/intern/string.c === --- trunk/blender/source/blender/blenlib/intern/string.c2011-05-26 09:46:51 UTC (rev 36911) +++ trunk/blender/source/blender/blenlib/intern/string.c2011-05-26 09:58:22 UTC (rev 36912) @@ -469,3 +469,21 @@ return tot; } +void BLI_ascii_strtolower(char *str, int len) +{ + int i; + + for(i=0; i= 'A' && str[i] <= 'Z') + str[i] += 'a' - 'A'; +} + +void BLI_ascii_strtoupper(char *str, int len) +{ + int i; + + for(i=0; i= 'a' && str[i] <= 'z') + str[i] -= 'a' - 'A'; +} + Modified: trunk/blender/source/blender/windowmanager/intern/wm_operators.c === --- trunk/blender/source/blender/windowmanager/intern/wm_operators.c 2011-05-26 09:46:51 UTC (rev 36911) +++ trunk/blender/source/blender/windowmanager/intern/wm_operators.c 2011-05-26 09:58:22 UTC (rev 36912) @@ -56,6 +56,7 @@ #include "BLI_blenlib.h" #include "BLI_dynstr.h" /*for WM_operator_pystring */ #include "BLI_math.h" +#include "BLI_string.h" #include "BLI_utildefines.h" #include "BLO_readfile.h" @@ -441,11 +442,13 @@ { char *sep= strstr(from, "_OT_"); if(sep) { - int i, ofs= (sep-from); + int ofs= (sep-from); + + /* note, we use ascii tolower instead of system tolower, because the + latter depends on the locale, and can lead to idname mistmatch */ + memcpy(to, from, sizeof(char)*ofs); + BLI_ascii_strtolower(to, ofs); - for(i=0; ihttp://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36911] trunk/blender/source/blender/ blenkernel/intern/image.c: Use proper checking for image source
Revision: 36911 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36911 Author: nazgul Date: 2011-05-26 09:46:51 + (Thu, 26 May 2011) Log Message: --- Use proper checking for image source Modified Paths: -- trunk/blender/source/blender/blenkernel/intern/image.c Modified: trunk/blender/source/blender/blenkernel/intern/image.c === --- trunk/blender/source/blender/blenkernel/intern/image.c 2011-05-26 09:33:51 UTC (rev 36910) +++ trunk/blender/source/blender/blenkernel/intern/image.c 2011-05-26 09:46:51 UTC (rev 36911) @@ -381,9 +381,7 @@ ima= image_alloc(libname, IMA_SRC_FILE, IMA_TYPE_IMAGE); BLI_strncpy(ima->name, name, sizeof(ima->name)); - /* do a wild guess! */ - if(BLI_testextensie(name, ".avi") || BLI_testextensie(name, ".mov") - || BLI_testextensie(name, ".mpg") || BLI_testextensie(name, ".mp4")) + if(BLI_testextensie_array(name, imb_ext_movie)) ima->source= IMA_SRC_MOVIE; return ima; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36910] trunk/blender: correct spelling error and some pep8 changes.
Revision: 36910 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36910 Author: campbellbarton Date: 2011-05-26 09:33:51 + (Thu, 26 May 2011) Log Message: --- correct spelling error and some pep8 changes. Modified Paths: -- trunk/blender/build_files/cmake/cmake_netbeans_project.py trunk/blender/build_files/cmake/cmake_qtcreator_project.py trunk/blender/build_files/cmake/project_info.py trunk/blender/doc/python_api/examples/bpy.types.BlendDataLibraries.load.py trunk/blender/release/scripts/modules/bpy_extras/mesh_utils.py trunk/blender/release/scripts/modules/bpy_extras/view3d_utils.py trunk/blender/release/scripts/startup/bl_operators/uvcalc_follow_active.py trunk/blender/release/scripts/startup/bl_ui/properties_data_empty.py trunk/blender/release/scripts/startup/bl_ui/properties_object_constraint.py trunk/blender/release/scripts/startup/bl_ui/space_image.py Modified: trunk/blender/build_files/cmake/cmake_netbeans_project.py === --- trunk/blender/build_files/cmake/cmake_netbeans_project.py 2011-05-26 09:20:30 UTC (rev 36909) +++ trunk/blender/build_files/cmake/cmake_netbeans_project.py 2011-05-26 09:33:51 UTC (rev 36910) @@ -33,7 +33,7 @@ from project_info import * import os -from os.path import join, dirname, normpath, abspath, splitext, relpath, exists +from os.path import join, dirname, normpath, relpath, exists def create_nb_project_main(): @@ -50,7 +50,6 @@ includes.sort() PROJECT_NAME = "Blender" -FILE_NAME = PROJECT_NAME.lower() # --- NB spesific defines = [("%s=%s" % cdef) if cdef[1] else cdef[0] for cdef in defines] @@ -76,7 +75,7 @@ if not exists(PROJECT_DIR_NB): os.mkdir(PROJECT_DIR_NB) -SOURCE_DIR_REL = relpath(SOURCE_DIR, PROJECT_DIR) +# SOURCE_DIR_REL = relpath(SOURCE_DIR, PROJECT_DIR) f = open(join(PROJECT_DIR_NB, "project.xml"), 'w') Modified: trunk/blender/build_files/cmake/cmake_qtcreator_project.py === --- trunk/blender/build_files/cmake/cmake_qtcreator_project.py 2011-05-26 09:20:30 UTC (rev 36909) +++ trunk/blender/build_files/cmake/cmake_qtcreator_project.py 2011-05-26 09:33:51 UTC (rev 36910) @@ -34,54 +34,52 @@ from project_info import * import os -from os.path import join, dirname, normpath, abspath, splitext, relpath, exists - import sys def create_qtc_project_main(): files = list(source_list(SOURCE_DIR, filename_check=is_project_file)) -files_rel = [relpath(f, start=PROJECT_DIR) for f in files] +files_rel = [os.path.relpath(f, start=PROJECT_DIR) for f in files] files_rel.sort() # --- qtcreator specific, simple format if SIMPLE_PROJECTFILE: # --- qtcreator specific, simple format PROJECT_NAME = "Blender" -f = open(join(PROJECT_DIR, "%s.files" % PROJECT_NAME), 'w') +f = open(os.path.join(PROJECT_DIR, "%s.files" % PROJECT_NAME), 'w') f.write("\n".join(files_rel)) -f = open(join(PROJECT_DIR, "%s.includes" % PROJECT_NAME), 'w') -f.write("\n".join(sorted(list(set(dirname(f) for f in files_rel if is_c_header(f)) +f = open(os.path.join(PROJECT_DIR, "%s.includes" % PROJECT_NAME), 'w') +f.write("\n".join(sorted(list(set(os.path.dirname(f) for f in files_rel if is_c_header(f)) -qtc_prj = join(PROJECT_DIR, "%s.creator" % PROJECT_NAME) +qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % PROJECT_NAME) f = open(qtc_prj, 'w') f.write("[General]\n") -qtc_cfg = join(PROJECT_DIR, "%s.config" % PROJECT_NAME) -if not exists(qtc_cfg): +qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % PROJECT_NAME) +if not os.path.exists(qtc_cfg): f = open(qtc_cfg, 'w') f.write("// ADD PREDEFINED MACROS HERE!\n") else: includes, defines = cmake_advanced_info() # for some reason it doesnt give all internal includes -includes = list(set(includes) | set(dirname(f) for f in files_rel if is_c_header(f))) +includes = list(set(includes) | set(os.path.dirname(f) for f in files_rel if is_c_header(f))) includes.sort() PROJECT_NAME = "Blender" FILE_NAME = PROJECT_NAME.lower() -f = open(join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w') +f = open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w') f.write("\n".join(files_rel)) -f = open(join(PROJECT_DIR, "%s.includes" % FILE_NAME), 'w') +f = open(os.path.join(PROJECT_DIR, "%s.includes" % FILE_NAME), 'w') f.write("\n".join(sorted(includes))) -qtc_prj = join(PROJECT_DIR, "%s.creator" % FILE_NAME) +qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME)
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36909] trunk/blender/source/blender/ makesrna/intern/rna_sequencer.c: BUGFIX: Sequencer strips. elements was broken when strip was trimmed (personal
Revision: 36909 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36909 Author: dfelinto Date: 2011-05-26 09:20:30 + (Thu, 26 May 2011) Log Message: --- BUGFIX: Sequencer strips.elements was broken when strip was trimmed (personal bug report, no number) When trimmed the seq->len was being reduced from the offsets (initial and final). This was the length passed to the elements. This had two problems: 1) it would not allow you to change the elements not visible (although you likely want to change them as well). 2) the element[0] was always the seq->strips[0].stripdata[0], regardless of the initial trim. Anyhoo it's all working now. Thanks Campbell for helping out with this one. Modified Paths: -- trunk/blender/source/blender/makesrna/intern/rna_sequencer.c Modified: trunk/blender/source/blender/makesrna/intern/rna_sequencer.c === --- trunk/blender/source/blender/makesrna/intern/rna_sequencer.c 2011-05-26 09:08:37 UTC (rev 36908) +++ trunk/blender/source/blender/makesrna/intern/rna_sequencer.c 2011-05-26 09:20:30 UTC (rev 36909) @@ -107,6 +107,23 @@ } /* internal use */ +static int rna_SequenceEditor_elements_length(PointerRNA *ptr) +{ + Sequence *seq= (Sequence*)ptr->data; + + /* Hack? copied from sequencer.c::reload_sequence_new_file() */ + size_t olen = MEM_allocN_len(seq->strip->stripdata)/sizeof(struct StripElem); + + /* the problem with seq->strip->len and seq->len is that it's discounted from the offset (hard cut trim) */ + return (int) olen; +} + +static void rna_SequenceEditor_elements_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +{ + Sequence *seq= (Sequence*)ptr->data; + rna_iterator_array_begin(iter, (void*)seq->strip->stripdata, sizeof(StripElem), rna_SequenceEditor_elements_length(ptr), 0, NULL); +} + static void rna_Sequence_frame_change_update(Scene *scene, Sequence *seq) { Editing *ed= seq_give_editing(scene, FALSE); @@ -1222,9 +1239,10 @@ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", "strip->len"); + RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL); RNA_def_property_struct_type(prop, "SequenceElement"); RNA_def_property_ui_text(prop, "Elements", ""); + RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_elements_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_SequenceEditor_elements_length", 0, 0); rna_def_filter_video(srna); rna_def_proxy(srna); @@ -1291,9 +1309,10 @@ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", "strip->len"); + RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL); RNA_def_property_struct_type(prop, "SequenceElement"); RNA_def_property_ui_text(prop, "Elements", ""); + RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_elements_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_SequenceEditor_elements_length", 0, 0); prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); RNA_def_property_ui_text(prop, "File", ""); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36908] branches/soc-2010-jwilkins/source/ blender/windowmanager/intern/wm_operators.c: Merged wm_operators. c with trunk.
Revision: 36908 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36908 Author: jwilkins Date: 2011-05-26 09:08:37 + (Thu, 26 May 2011) Log Message: --- Merged wm_operators.c with trunk. Had to set asside my on-surface brush code so I can reintegrate it later. revisions 34399-36874 Modified Paths: -- branches/soc-2010-jwilkins/source/blender/windowmanager/intern/wm_operators.c Property Changed: branches/soc-2010-jwilkins/source/blender/windowmanager/intern/wm_operators.c Modified: branches/soc-2010-jwilkins/source/blender/windowmanager/intern/wm_operators.c === --- branches/soc-2010-jwilkins/source/blender/windowmanager/intern/wm_operators.c 2011-05-26 07:16:56 UTC (rev 36907) +++ branches/soc-2010-jwilkins/source/blender/windowmanager/intern/wm_operators.c 2011-05-26 09:08:37 UTC (rev 36908) @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * * BEGIN GPL LICENSE BLOCK * @@ -26,12 +26,19 @@ * * END GPL LICENSE BLOCK * */ +/** \file blender/windowmanager/intern/wm_operators.c + * \ingroup wm + */ + + #include #include #include #include #include +#include +#include "GHOST_C-api.h" #include "MEM_guardedalloc.h" @@ -54,6 +61,7 @@ #include "BLO_readfile.h" #include "BKE_blender.h" +#include "BKE_brush.h" #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_idprop.h" @@ -386,10 +394,13 @@ BLI_addtail(&ot->macro, otmacro); { + /* operator should always be found but in the event its not. dont segfault */ wmOperatorType *otsub = WM_operatortype_find(idname, 0); + if(otsub) { RNA_def_pointer_runtime(ot->srna, otsub->idname, otsub->srna, otsub->name, otsub->description); } + } return otmacro; } @@ -641,7 +652,7 @@ return op->type->exec(C, op); } else { - pup= uiPupMenuBegin(C, op->type->name, ICON_NULL); + pup= uiPupMenuBegin(C, op->type->name, ICON_NONE); layout= uiPupMenuLayout(pup); uiItemsFullEnumO(layout, op->type->idname, (char*)RNA_property_identifier(prop), op->ptr->data, WM_OP_EXEC_REGION_WIN, 0); uiPupMenuEnd(C, pup); @@ -689,11 +700,16 @@ wmOperatorType *ot= arg1; if(ot) { - PointerRNA props_ptr; - WM_operator_properties_create_ptr(&props_ptr, ot); - RNA_property_enum_set(&props_ptr, ot->prop, GET_INT_FROM_POINTER(arg2)); - WM_operator_name_call(C, ot->idname, WM_OP_EXEC_DEFAULT, &props_ptr); - WM_operator_properties_free(&props_ptr); + if(ot->prop) { + PointerRNA props_ptr; + WM_operator_properties_create_ptr(&props_ptr, ot); + RNA_property_enum_set(&props_ptr, ot->prop, GET_INT_FROM_POINTER(arg2)); + WM_operator_name_call(C, ot->idname, WM_OP_EXEC_DEFAULT, &props_ptr); + WM_operator_properties_free(&props_ptr); + } + else { + printf("operator_enum_call_cb: op->prop for '%s' is NULL\n", ot->idname); + } } } @@ -716,7 +732,7 @@ /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 10 - uiSearchBoxhHeight(), 180, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); - uiPopupBoundsBlock(block, 6.0f, 0, -20); /* move it downwards, mouse over button */ + uiPopupBoundsBlock(block, 6, 0, -20); /* move it downwards, mouse over button */ uiEndBlock(C, block); event= *(win->eventstate); /* XXX huh huh? make api call */ @@ -750,7 +766,7 @@ pup= uiPupMenuBegin(C, "OK?", ICON_QUESTION); layout= uiPupMenuLayout(pup); - uiItemFullO(layout, op->type->idname, message, ICON_NULL, properties, WM_OP_EXEC_REGION_WIN, 0); + uiItemFullO(layout, op->type->idname, message, ICON_NONE, properties, WM_OP_EXEC_REGION_WIN, 0); uiPupMenuEnd(C, pup); return OPERATOR_CANCELLED; @@ -867,6 +883,19 @@ return 1; } +wmOperator *WM_operator_last_redo(const bContext *C) +{ + wmWindowManager *wm= CTX_wm_manager(C); + wmOperator *op; + + /* only for operators that are registered and did an undo push */ + for(op= wm->operators.last; op; op= op->prev) + if((op->type->flag & OPTYPE_REGISTER) && (op->type->flag & OPTYPE_UNDO)) + break; + + return op; +} + static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op) { wmOperator *op= arg_op; @@ -892,7 +921,7 @@ uiLayoutOperatorButs(C, layout, op, NULL, 'H', UI_LAYOUT_OP_SHOW_TITLE); - uiPopupBoundsBlo
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36907] trunk/blender/release/scripts: move less common mesh operations out of bpy_types into bpy_extras. mesh_utils
Revision: 36907 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36907 Author: campbellbarton Date: 2011-05-26 07:16:56 + (Thu, 26 May 2011) Log Message: --- move less common mesh operations out of bpy_types into bpy_extras.mesh_utils Modified Paths: -- trunk/blender/release/scripts/modules/bpy_extras/mesh_utils.py trunk/blender/release/scripts/modules/bpy_types.py trunk/blender/release/scripts/startup/bl_operators/mesh.py trunk/blender/release/scripts/startup/bl_operators/uvcalc_follow_active.py Modified: trunk/blender/release/scripts/modules/bpy_extras/mesh_utils.py === --- trunk/blender/release/scripts/modules/bpy_extras/mesh_utils.py 2011-05-26 06:34:31 UTC (rev 36906) +++ trunk/blender/release/scripts/modules/bpy_extras/mesh_utils.py 2011-05-26 07:16:56 UTC (rev 36907) @@ -67,3 +67,341 @@ # return all face groups that are not null # this is all the faces that are connected in their own lists. return [fg for fg in face_groups if fg] + + +def edge_face_count_dict(mesh): +face_edge_keys = [face.edge_keys for face in mesh.faces] +face_edge_count = {} +for face_keys in face_edge_keys: +for key in face_keys: +try: +face_edge_count[key] += 1 +except: +face_edge_count[key] = 1 + +return face_edge_count + + +def edge_face_count(mesh): +edge_face_count_dict = edge_face_count_dict(mesh) +return [edge_face_count_dict.get(ed.key, 0) for ed in mesh.edges] + + +def edge_loops_from_faces(mesh, faces=None, seams=()): +""" +Edge loops defined by faces + +Takes me.faces or a list of faces and returns the edge loops +These edge loops are the edges that sit between quads, so they dont touch +1 quad, note: not connected will make 2 edge loops, both only containing 2 edges. + +return a list of edge key lists +[ [(0,1), (4, 8), (3,8)], ...] + +return a list of edge vertex index lists +""" + +OTHER_INDEX = 2, 3, 0, 1 # opposite face index + +if faces is None: +faces = mesh.faces + +edges = {} + +for f in faces: +#if len(f) == 4: +if f.vertices_raw[3] != 0: +edge_keys = f.edge_keys +for i, edkey in enumerate(f.edge_keys): +edges.setdefault(edkey, []).append(edge_keys[OTHER_INDEX[i]]) + +for edkey in seams: +edges[edkey] = [] + +# Collect edge loops here +edge_loops = [] + +for edkey, ed_adj in edges.items(): +if 0 < len(ed_adj) < 3: # 1 or 2 +# Seek the first edge +context_loop = [edkey, ed_adj[0]] +edge_loops.append(context_loop) +if len(ed_adj) == 2: +other_dir = ed_adj[1] +else: +other_dir = None + +ed_adj[:] = [] + +flipped = False + +while 1: +# from knowing the last 2, look for th next. +ed_adj = edges[context_loop[-1]] +if len(ed_adj) != 2: + +if other_dir and flipped == False: # the original edge had 2 other edges +flipped = True # only flip the list once +context_loop.reverse() +ed_adj[:] = [] +context_loop.append(other_dir) # save 1 lookiup + +ed_adj = edges[context_loop[-1]] +if len(ed_adj) != 2: +ed_adj[:] = [] +break +else: +ed_adj[:] = [] +break + +i = ed_adj.index(context_loop[-2]) +context_loop.append(ed_adj[not i]) + +# Dont look at this again +ed_adj[:] = [] + +return edge_loops + +def edge_loops_from_edges(mesh, edges=None): +""" +Edge loops defined by edges + +Takes me.edges or a list of edges and returns the edge loops + +return a list of vertex indices. +[ [1, 6, 7, 2], ...] + +closed loops have matching start and end values. +""" +line_polys = [] + +# Get edges not used by a face +if edges is None: +edges = mesh.edges + +if not hasattr(edges, "pop"): +edges = edges[:] + +edge_dict = {ed.key: ed for ed in mesh.edges if ed.select} + +while edges: +current_edge = edges.pop() +vert_end, vert_start = current_edge.vertices[:] +line_poly = [vert_start, vert_end] + +ok = True +while ok: +ok = False +#for i, ed in enumerate(edges): +i = len(edges) +while i: +i -= 1 +ed = edges[i] +v1, v2 = ed.vertices +if v1 == vert_end: +line_poly.append