From 761122da2f7921fdde886d2763c0fd9122794f32 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 5 Feb 2012 07:40:15 +0000 Subject: Code Cleanup: minor changes & sync with bmesh. --- source/blender/blenkernel/intern/deform.c | 2 +- source/blender/blenkernel/intern/mesh.c | 2 +- source/blender/blenkernel/intern/particle.c | 1 - source/blender/blenkernel/intern/subsurf_ccg.c | 2 +- source/blender/editors/curve/editcurve.c | 4 ++++ 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index 3f3e3b80042..a95cd8d00d8 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -650,11 +650,11 @@ void defvert_remove_group(MDeformVert *dvert, MDeformWeight *dw) dvert->dw[i]= dvert->dw[dvert->totweight]; } memcpy(dw_new, dvert->dw, sizeof(MDeformWeight) * dvert->totweight); - MEM_freeN(dvert->dw); #else memcpy(dw_new, dvert->dw, sizeof(MDeformWeight)*i); memcpy(dw_new+i, dvert->dw+i+1, sizeof(MDeformWeight)*(dvert->totweight-i)); #endif + MEM_freeN(dvert->dw); } dvert->dw = dw_new; } diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index cba92e7a14c..f9f02751d82 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1315,7 +1315,7 @@ UvVertMap *make_uv_vert_map(struct MFace *mface, struct MTFace *tface, unsigned for(a=0; aflag & ME_HIDE) && (mf->flag & ME_FACE_SEL))) totuv += (mf->v4)? 4: 3; - + if(totuv==0) return NULL; diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 3a4ae5797a0..cd3933d3c44 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -4524,7 +4524,6 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3] madd_v3_v3fl(center, yvec, bb->offset[1]); } - void psys_apply_hair_lattice(Scene *scene, Object *ob, ParticleSystem *psys) { ParticleSimulationData sim= {0}; diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index ffcbd0bdc56..4e88a488530 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -44,12 +44,12 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "BLI_utildefines.h" #include "BLI_blenlib.h" #include "BLI_edgehash.h" #include "BLI_math.h" #include "BLI_memarena.h" #include "BLI_pbvh.h" -#include "BLI_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_global.h" diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 8c20d9be4f8..5c762ca61cc 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -3389,8 +3389,12 @@ static int convertspline(short type, Nurb *nu) nu->orderu= 4; nu->orderv= 1; nu->type = type; + +#if 0 /* UNUSED */ if(nu->flagu & CU_NURB_CYCLIC) c= nu->orderu-1; else c= 0; +#endif + if(type== CU_NURBS) { nu->flagu &= CU_NURB_CYCLIC; /* disable all flags except for cyclic */ nu->flagu |= CU_NURB_BEZIER; -- cgit v1.2.3 From 5e92c4e38125849c5790a14be3d98441afaf2edb Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 5 Feb 2012 09:29:53 +0000 Subject: win32 quicktime: missing include. How comes nobody else got this problem? --- source/blender/quicktime/apple/quicktime_import.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/quicktime/apple/quicktime_import.c b/source/blender/quicktime/apple/quicktime_import.c index b58b4a646e2..a7d09682a14 100644 --- a/source/blender/quicktime/apple/quicktime_import.c +++ b/source/blender/quicktime/apple/quicktime_import.c @@ -41,6 +41,7 @@ #include "BLO_sys_types.h" #include "BKE_global.h" #include "BLI_dynstr.h" +#include "BLI_path_util.h" #ifdef __APPLE__ #include -- cgit v1.2.3 From 223216a36f0adc23341307042cc4d838b7dde800 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 5 Feb 2012 09:32:35 +0000 Subject: BGE bug #21947: Softbodies not using object size. Fixed by scaling the shape before creating the soft body. --- source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 22aa781ebc2..4b3e2ea33a3 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -231,6 +231,8 @@ bool CcdPhysicsController::CreateSoftbody() if (trimeshshape->getMeshInterface()->getNumSubParts()==1) { unsigned char* vertexBase; + btScalar* scaledVertexBase; + btVector3 localScaling; PHY_ScalarType vertexType; int numverts; int vertexstride; @@ -238,8 +240,16 @@ bool CcdPhysicsController::CreateSoftbody() int indexstride; PHY_ScalarType indexType; trimeshshape->getMeshInterface()->getLockedVertexIndexBase(&vertexBase,numverts,vertexType,vertexstride,&indexbase,indexstride,numtris,indexType); - - psb = btSoftBodyHelpers::CreateFromTriMesh(worldInfo,(const btScalar*)vertexBase,(const int*)indexbase,numtris,false); + localScaling = scaledtrimeshshape->getLocalScaling(); + scaledVertexBase = new btScalar[numverts*3]; + for (int i=0; i Date: Sun, 5 Feb 2012 11:42:20 +0000 Subject: Fix #30073: metaball + edit mode + proportinal edit hotkey Was missed registration of PET toggling operators. --- source/blender/editors/metaball/mball_ops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/editors/metaball/mball_ops.c b/source/blender/editors/metaball/mball_ops.c index c7635bcf2cc..f689fb049fe 100644 --- a/source/blender/editors/metaball/mball_ops.c +++ b/source/blender/editors/metaball/mball_ops.c @@ -36,6 +36,7 @@ #include "ED_mball.h" #include "ED_screen.h" +#include "ED_object.h" #include "BLI_utildefines.h" @@ -77,5 +78,7 @@ void ED_keymap_metaball(wmKeyConfig *keyconf) RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE); kmi = WM_keymap_add_item(keymap, "MBALL_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0); RNA_enum_set(kmi->ptr, "action", SEL_INVERT); + + ED_object_generic_keymap(keyconf, keymap, 3); } -- cgit v1.2.3 From d8d5bb6b9a7525c0ce935c5b76a901b11e48cfaf Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 5 Feb 2012 13:04:13 +0000 Subject: BGE bug #18883: Softbodies being hit by ghost objects. Added a one liner fix in Bullet. I will also report the fix to Erwin so that it can be added to next Bullet version. --- extern/bullet2/src/BulletSoftBody/btSoftBody.cpp | 32 +++++++++++++----------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/extern/bullet2/src/BulletSoftBody/btSoftBody.cpp b/extern/bullet2/src/BulletSoftBody/btSoftBody.cpp index a90acb99f04..0d19fd193e7 100644 --- a/extern/bullet2/src/BulletSoftBody/btSoftBody.cpp +++ b/extern/bullet2/src/BulletSoftBody/btSoftBody.cpp @@ -2780,21 +2780,23 @@ void btSoftBody::PSolve_RContacts(btSoftBody* psb, btScalar kst, btScalar ti) { const RContact& c = psb->m_rcontacts[i]; const sCti& cti = c.m_cti; - btRigidBody* tmpRigid = btRigidBody::upcast(cti.m_colObj); - - const btVector3 va = tmpRigid ? tmpRigid->getVelocityInLocalPoint(c.m_c1)*dt : btVector3(0,0,0); - const btVector3 vb = c.m_node->m_x-c.m_node->m_q; - const btVector3 vr = vb-va; - const btScalar dn = btDot(vr, cti.m_normal); - if(dn<=SIMD_EPSILON) - { - const btScalar dp = btMin( (btDot(c.m_node->m_x, cti.m_normal) + cti.m_offset), mrg ); - const btVector3 fv = vr - (cti.m_normal * dn); - // c0 is the impulse matrix, c3 is 1 - the friction coefficient or 0, c4 is the contact hardness coefficient - const btVector3 impulse = c.m_c0 * ( (vr - (fv * c.m_c3) + (cti.m_normal * (dp * c.m_c4))) * kst ); - c.m_node->m_x -= impulse * c.m_c2; - if (tmpRigid) - tmpRigid->applyImpulse(impulse,c.m_c1); + + if (cti.m_colObj->hasContactResponse()) { + btRigidBody* tmpRigid = btRigidBody::upcast(cti.m_colObj); + const btVector3 va = tmpRigid ? tmpRigid->getVelocityInLocalPoint(c.m_c1)*dt : btVector3(0,0,0); + const btVector3 vb = c.m_node->m_x-c.m_node->m_q; + const btVector3 vr = vb-va; + const btScalar dn = btDot(vr, cti.m_normal); + if(dn<=SIMD_EPSILON) + { + const btScalar dp = btMin( (btDot(c.m_node->m_x, cti.m_normal) + cti.m_offset), mrg ); + const btVector3 fv = vr - (cti.m_normal * dn); + // c0 is the impulse matrix, c3 is 1 - the friction coefficient or 0, c4 is the contact hardness coefficient + const btVector3 impulse = c.m_c0 * ( (vr - (fv * c.m_c3) + (cti.m_normal * (dp * c.m_c4))) * kst ); + c.m_node->m_x -= impulse * c.m_c2; + if (tmpRigid) + tmpRigid->applyImpulse(impulse,c.m_c1); + } } } } -- cgit v1.2.3 From 04a079668c2d72ea00f2537fa88fdca2728c5aa2 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sun, 5 Feb 2012 13:43:58 +0000 Subject: Movie Clip Editor: cleanup of display panels - Split display options into two panels: * Display, which contains all general display options related on editor itself * Marker Display, which contains options which makes sense for markers themselves and not used so often. - Remove Show GPencil option which doesn't actually make sense because strokes might be disabled from GPencil panel - Removed Show Pyramid option and show pyramid for KLT tracker as default. - Added hotkey to toggle Show Disabled (Alt-D) - Added hotkey to toggle Show Pattern (Alt-S) Changes in interface and hotkeys are done by Sebastian Koenig. Thanks for the patch! Own changes in interface were related on Aspect Ratio. It doesn't make much sense for tracking (camera pixel aspect is what you'll want to use, but for masking it would make much more sense because when you just want to create a mask for footage you don't actually have camera). Just removing from interface seems not so nice for now. Merged from soc-2011-tomato rev43872 --- release/scripts/startup/bl_ui/space_clip.py | 49 ++++++++++++++++---------- source/blender/editors/gpencil/gpencil_paint.c | 8 ----- source/blender/editors/space_clip/clip_draw.c | 4 +-- source/blender/editors/space_clip/space_clip.c | 8 ++++- source/blender/makesdna/DNA_space_types.h | 4 +-- source/blender/makesrna/intern/rna_space.c | 12 ------- 6 files changed, 41 insertions(+), 44 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index 8ebc1c450b4..eb97e546379 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -547,23 +547,15 @@ class CLIP_PT_display(Panel): col = layout.column(align=True) - col.prop(sc, "show_marker_pattern", text="Pattern") - col.prop(sc, "show_marker_search", text="Search") - col.prop(sc, "show_pyramid_levels", text="Pyramid") - - col.prop(sc, "show_track_path", text="Path") - row = col.row() - row.active = sc.show_track_path - row.prop(sc, "path_length", text="Length") - col.prop(sc, "show_disabled", "Disabled Tracks") + col.prop(sc, "show_names", text="Names and Status") col.prop(sc, "show_bundles", text="3D Markers") - col.prop(sc, "show_names", text="Names and Status") - col.prop(sc, "show_tiny_markers", text="Compact Markers") + col.prop(sc, "use_mute_footage", text="Mute Footage") + col.prop(sc, "lock_selection") - col.prop(sc, "show_grease_pencil", text="Grease Pencil") - col.prop(sc, "use_mute_footage", text="Mute") + if sc.view == 'GRAPH': + col.prop(sc, "lock_time_cursor") if sc.mode == 'DISTORTION': col.prop(sc, "show_grid", text="Grid") @@ -571,15 +563,34 @@ class CLIP_PT_display(Panel): elif sc.mode == 'RECONSTRUCTION': col.prop(sc, "show_stable", text="Stable") - col.prop(sc, "lock_selection") - - if sc.view == 'GRAPH': - col.prop(sc, "lock_time_cursor") - clip = sc.clip if clip: col.label(text="Display Aspect Ratio:") - col.prop(clip, "display_aspect", text="") + row = col.row() + row.prop(clip, "display_aspect", text="") + + +class CLIP_PT_marker_display(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Marker Display" + + def draw(self, context): + layout = self.layout + sc = context.space_data + + col = layout.column(align=True) + + row = col.row() + row.prop(sc, "show_marker_pattern", text="Pattern") + row.prop(sc, "show_marker_search", text="Search") + + col.prop(sc, "show_tiny_markers", text="Thin Markers") + col.prop(sc, "show_track_path", text="Path") + + row = col.row() + row.active = sc.show_track_path + row.prop(sc, "path_length", text="Length") class CLIP_PT_track_settings(Panel): diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 6c93727bf55..99572345c96 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1117,14 +1117,6 @@ static int gp_session_initdata (bContext *C, tGPsdata *p) p->custom_color[1]= 0.0f; p->custom_color[2]= 0.5f; p->custom_color[3]= 0.9f; - - /* check that gpencil data is allowed to be drawn */ - if ((sc->flag & SC_SHOW_GPENCIL)==0) { - p->status= GP_STATUS_ERROR; - if (G.f & G_DEBUG) - printf("Error: In active view, Grease Pencil not shown \n"); - return 0; - } } break; diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index a331703690b..de43b30d4f4 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -586,7 +586,7 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra } /* pyramid */ - if(sel && TRACK_SELECTED(track) && (sc->flag&SC_SHOW_PYRAMID_LEVELS) && (track->tracker==TRACKER_KLT) && (marker->flag&MARKER_DISABLED)==0) { + if(sel && TRACK_SELECTED(track) && (track->tracker==TRACKER_KLT) && (marker->flag&MARKER_DISABLED)==0) { if(track->flag&TRACK_LOCKED) { if(act) UI_ThemeColor(TH_ACT_MARKER); else if(track->pat_flag&SELECT) UI_ThemeColorShade(TH_LOCK_MARKER, 64); @@ -1307,7 +1307,7 @@ void clip_draw_grease_pencil(bContext *C, int onlyv2d) MovieClip *clip= ED_space_clip(sc); ImBuf *ibuf; - if((sc->flag&SC_SHOW_GPENCIL)==0 || !clip) + if(!clip) return; if(onlyv2d) { diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index 0d34cc2cfbf..5abdafbfffc 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -157,7 +157,7 @@ static SpaceLink *clip_new(const bContext *C) sc= MEM_callocN(sizeof(SpaceClip), "initclip"); sc->spacetype= SPACE_CLIP; - sc->flag= SC_SHOW_MARKER_PATTERN|SC_SHOW_TRACK_PATH|SC_SHOW_GPENCIL|SC_MANUAL_CALIBRATION|SC_SHOW_GRAPH_TRACKS|SC_SHOW_GRAPH_FRAMES; + sc->flag= SC_SHOW_MARKER_PATTERN|SC_SHOW_TRACK_PATH|SC_MANUAL_CALIBRATION|SC_SHOW_GRAPH_TRACKS|SC_SHOW_GRAPH_FRAMES; sc->zoom= 1.0f; sc->path_length= 20; sc->scopes.track_preview_height= 120; @@ -530,6 +530,12 @@ static void clip_keymap(struct wmKeyConfig *keyconf) kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", LKEY, KM_PRESS, 0, 0); RNA_string_set(kmi->ptr, "data_path", "space_data.lock_selection"); + kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", DKEY, KM_PRESS, KM_ALT, 0); + RNA_string_set(kmi->ptr, "data_path", "space_data.show_disabled"); + + kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", SKEY, KM_PRESS, KM_ALT, 0); + RNA_string_set(kmi->ptr, "data_path", "space_data.show_marker_search"); + kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); RNA_string_set(kmi->ptr, "data_path", "space_data.use_mute_footage"); diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 06138bc0757..64d858bbcee 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -896,11 +896,11 @@ enum { #define SC_SHOW_GRID (1<<9) #define SC_SHOW_STABLE (1<<10) #define SC_MANUAL_CALIBRATION (1<<11) -#define SC_SHOW_GPENCIL (1<<12) +/*#define SC_SHOW_GPENCIL (1<<12)*/ /* UNUSED */ #define SC_SHOW_FILTERS (1<<13) #define SC_SHOW_GRAPH_FRAMES (1<<14) #define SC_SHOW_GRAPH_TRACKS (1<<15) -#define SC_SHOW_PYRAMID_LEVELS (1<<16) +/*#define SC_SHOW_PYRAMID_LEVELS (1<<16) */ /* UNUSED */ #define SC_LOCK_TIMECURSOR (1<<17) /* SpaceClip->mode */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 799366a5234..8499e2fa111 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2888,12 +2888,6 @@ static void rna_def_space_clip(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_MARKER_SEARCH); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); - /* show pyramid */ - prop= RNA_def_property(srna, "show_pyramid_levels", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Show Pyramid ", "Show patterns for each pyramid level for markers (KLT only)"); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_PYRAMID_LEVELS); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); - /* lock to selection */ prop= RNA_def_property(srna, "lock_selection", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "Lock to Selection", "Lock viewport to selected markers during playback"); @@ -2973,12 +2967,6 @@ static void rna_def_space_clip(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Manual Calibration", "Use manual calibration helpers"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); - /* show stable */ - prop= RNA_def_property(srna, "show_grease_pencil", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GPENCIL); - RNA_def_property_ui_text(prop, "Show Grease Pencil", "Show grease pencil strokes over the footage"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); - /* show filters */ prop= RNA_def_property(srna, "show_filters", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_FILTERS); -- cgit v1.2.3 From d51a1f3ed1e7028d4f5f46e86d51db5a07fb2ed3 Mon Sep 17 00:00:00 2001 From: Alexander Kuznetsov Date: Sun, 5 Feb 2012 16:05:20 +0000 Subject: Fix for [#30044] on windows We don't know how ALT key modifies the key, so utf=0; That way Text Object can handle it. * Should be removed when we able to support different keyboards on Windows --- intern/ghost/intern/GHOST_SystemWin32.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 9cae2c27e65..98c4785797d 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -717,10 +717,11 @@ GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, RAWINP if (key != GHOST_kKeyUnknown) { char utf8_char[6] = {0} ; + char ascii = 0; wchar_t utf16[2]={0}; - BYTE state[256]; - GetKeyboardState((PBYTE)state); + BYTE state[256] ={0}; + GetKeyboardState(state); if(ToUnicodeEx(vk, 0, state, utf16, 2, 0, system->m_keylayout)) WideCharToMultiByte(CP_UTF8, 0, @@ -728,9 +729,14 @@ GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, RAWINP (LPSTR) utf8_char, 5, NULL,NULL); else *utf8_char = 0; - if(!keyDown) utf8_char[0] = '\0'; - event = new GHOST_EventKey(system->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key, (*utf8_char & 0x80)?'?':*utf8_char, utf8_char); + + if(!keyDown) {utf8_char[0] = '\0'; ascii='\0';} + else ascii = utf8_char[0]& 0x80?'?':utf8_char[0]; + + if(0x80&state[VK_MENU]) utf8_char[0]='\0'; + + event = new GHOST_EventKey(system->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key, ascii, utf8_char); #ifdef GHOST_DEBUG std::cout << ascii << std::endl; -- cgit v1.2.3 From fa163003c98e09f00bcbbee7838d5ed487d55cc8 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 5 Feb 2012 16:05:36 +0000 Subject: Release schedule: * BCon4, important bug fixes only. * Update readme.html and links to release logs, which now point to http://www.blender.org/development/release-logs/blender-262 --- release/scripts/startup/bl_ui/space_info.py | 2 +- release/text/readme.html | 10 +++++----- source/blender/blenkernel/BKE_blender.h | 2 +- source/blender/windowmanager/intern/wm_operators.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index 901f709fb5b..95eb49062c0 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -362,7 +362,7 @@ class INFO_MT_help(Menu): layout = self.layout layout.operator("wm.url_open", text="Manual", icon='HELP').url = 'http://wiki.blender.org/index.php/Doc:2.6/Manual' - layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-261/' + layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-262/' layout.separator() diff --git a/release/text/readme.html b/release/text/readme.html index 0627624d2e7..a9f5e705b3d 100644 --- a/release/text/readme.html +++ b/release/text/readme.html @@ -12,18 +12,18 @@ -

Blender 2.61

+

Blender 2.62


About

Welcome to Blender, the free, open source 3D application for modeling, animation, rendering, compositing, video editing and game creation. Blender is available for Linux, Mac OS X, Windows, Solaris and FreeBSD and has a large world-wide community.

Blender can be used freely for any purpose, including commercial use and distribution. It's free and open-source software, released under the GNU GPL licence. The entire source code is available on our website.

For more information, visit blender.org.


-

2.61

-

The Blender Foundation and online developer community is proud to present Blender 2.61. This release is the second official stable release of the Blender 2.6 series, in which we will refine the 2.5 series and add exciting new features again.More information about this release.

+

2.62

+

The Blender Foundation and online developer community is proud to present Blender 2.62. This release is the third official stable release of the Blender 2.6 series, in which we will refine the 2.5 series and add exciting new features again.More information about this release.


Bugs

-

Although Blender 2.61 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender. If it wasn’t reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.

+

Although Blender 2.62 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender. If it wasn’t reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.


Package Contents

The downloaded Blender package includes:

@@ -47,7 +47,7 @@

Links

Users:

General information www.blender.org
- Full release log www.blender.org/development/release-logs/blender-261/
+ Full release log www.blender.org/development/release-logs/blender-262/
Tutorials www.blender.org/education-help/
Manual wiki.blender.org/index.php/Doc:Manual
User Forum www.blenderartists.org
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 50fef032b75..7236015054d 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -51,7 +51,7 @@ extern "C" { /* can be left blank, otherwise a,b,c... etc with no quotes */ #define BLENDER_VERSION_CHAR /* alpha/beta/rc/release, docs use this */ -#define BLENDER_VERSION_CYCLE beta +#define BLENDER_VERSION_CYCLE rc extern char versionstr[]; /* from blender.c */ diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 4052c221935..3346edaa5de 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1324,7 +1324,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar uiItemL(col, "Links", ICON_NONE); uiItemStringO(col, IFACE_("Donations"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/blenderorg/blender-foundation/donation-payment"); uiItemStringO(col, IFACE_("Credits"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/credits"); - uiItemStringO(col, IFACE_("Release Log"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-261"); + uiItemStringO(col, IFACE_("Release Log"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-262"); uiItemStringO(col, IFACE_("Manual"), ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:2.5/Manual"); uiItemStringO(col, IFACE_("Blender Website"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org"); uiItemStringO(col, IFACE_("User Community"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community"); -- cgit v1.2.3 From 2cb3fe3dfd830386633e5642d35108be8b6b6a17 Mon Sep 17 00:00:00 2001 From: Domino Marama Date: Sun, 5 Feb 2012 16:19:28 +0000 Subject: =?UTF-8?q?Patch=20#30050=20by=20Juha=20M=C3=A4ki-Kanto=20(kanttor?= =?UTF-8?q?i)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes for Collada exporter. Adds Second Life compatibility for armatures Adds objects parentinverse to exported transform if it's non-identity Fix mismatch between add_inv_bind_mats and add_joints_source accessor counts Fix bone exports in world space should be local space --- source/blender/collada/AnimationExporter.cpp | 21 +++++++++ source/blender/collada/AnimationExporter.h | 5 +- source/blender/collada/ArmatureExporter.cpp | 54 +++++++++++++++++++--- source/blender/collada/DocumentExporter.cpp | 2 +- source/blender/collada/ExportSettings.h | 1 + source/blender/collada/TransformWriter.cpp | 22 +++++++++ source/blender/collada/collada.cpp | 3 +- source/blender/collada/collada.h | 2 +- source/blender/makesrna/intern/rna_scene_api.c | 9 ++-- source/blender/windowmanager/intern/wm_operators.c | 7 ++- 10 files changed, 109 insertions(+), 17 deletions(-) diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index 7b57ed243a1..c2d8c356aae 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -773,6 +773,27 @@ std::string AnimationExporter::create_4x4_source(std::vector &frames , Ob copy_m4_m4(mat, pchan->pose_mat); UnitConverter converter; + // SECOND_LIFE_COMPATIBILITY + // AFAIK animation to second life is via BVH, but no + // reason to not have the collada-animation be correct + if(export_settings->second_life) + { + float temp[4][4]; + copy_m4_m4(temp, bone->arm_mat); + temp[3][0] = temp[3][1] = temp[3][2] = 0.0f; + invert_m4(temp); + + mult_m4_m4m4(mat, mat, temp); + + if(bone->parent) + { + copy_m4_m4(temp, bone->parent->arm_mat); + temp[3][0] = temp[3][1] = temp[3][2] = 0.0f; + + mult_m4_m4m4(mat, temp, mat); + } + } + float outmat[4][4]; converter.mat4_to_dae(outmat,mat); diff --git a/source/blender/collada/AnimationExporter.h b/source/blender/collada/AnimationExporter.h index c3a5c7a5383..ba7ec6859cc 100644 --- a/source/blender/collada/AnimationExporter.h +++ b/source/blender/collada/AnimationExporter.h @@ -83,7 +83,9 @@ private: public: - AnimationExporter(COLLADASW::StreamWriter *sw): COLLADASW::LibraryAnimations(sw) { this->sw = sw; } + AnimationExporter(COLLADASW::StreamWriter *sw, const ExportSettings *export_settings): + COLLADASW::LibraryAnimations(sw), export_settings(export_settings) + { this->sw = sw; } void exportAnimations(Scene *sce); @@ -92,6 +94,7 @@ public: void operator() (Object *ob); protected: + const ExportSettings *export_settings; void dae_animation(Object* ob, FCurve *fcu, char* transformName , bool is_param, Material *ma = NULL); diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp index fcfc197ce80..0e89f2db74b 100644 --- a/source/blender/collada/ArmatureExporter.cpp +++ b/source/blender/collada/ArmatureExporter.cpp @@ -221,8 +221,31 @@ void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW: mult_m4_m4m4(mat, invpar, pchan->pose_mat); } else { - // get world-space from armature-space - mult_m4_m4m4(mat, ob_arm->obmat, pchan->pose_mat); + copy_m4_m4(mat, pchan->pose_mat); + // Why? Joint's localspace is still it's parent node + //get world-space from armature-space + //mult_m4_m4m4(mat, ob_arm->obmat, pchan->pose_mat); + } + + // SECOND_LIFE_COMPATIBILITY + if(export_settings->second_life) + { + // Remove rotations vs armature from transform + // parent_rest_rot * mat * irest_rot + float temp[4][4]; + copy_m4_m4(temp, bone->arm_mat); + temp[3][0] = temp[3][1] = temp[3][2] = 0.0f; + invert_m4(temp); + + mult_m4_m4m4(mat, mat, temp); + + if(bone->parent) + { + copy_m4_m4(temp, bone->parent->arm_mat); + temp[3][0] = temp[3][1] = temp[3][2] = 0.0f; + + mult_m4_m4m4(mat, temp, mat); + } } TransformWriter::add_node_transform(node, mat,NULL ); @@ -341,10 +364,16 @@ std::string ArmatureExporter::add_inv_bind_mats_source(Object *ob_arm, ListBase { std::string source_id = controller_id + BIND_POSES_SOURCE_ID_SUFFIX; + int totjoint = 0; + for (bDeformGroup *def = (bDeformGroup*)defbase->first; def; def = def->next) { + if (is_bone_defgroup(ob_arm, def)) + totjoint++; + } + COLLADASW::FloatSourceF source(mSW); source.setId(source_id); source.setArrayId(source_id + ARRAY_ID_SUFFIX); - source.setAccessorCount(BLI_countlist(defbase)); + source.setAccessorCount(totjoint); //BLI_countlist(defbase)); source.setAccessorStride(16); source.setParameterTypeName(&COLLADASW::CSWC::CSW_VALUE_TYPE_FLOAT4x4); @@ -366,16 +395,27 @@ std::string ArmatureExporter::add_inv_bind_mats_source(Object *ob_arm, ListBase for (bDeformGroup *def = (bDeformGroup*)defbase->first; def; def = def->next) { if (is_bone_defgroup(ob_arm, def)) { - bPoseChannel *pchan = get_pose_channel(pose, def->name); float mat[4][4]; float world[4][4]; float inv_bind_mat[4][4]; - // make world-space matrix, arm_mat is armature-space - mult_m4_m4m4(world, ob_arm->obmat, pchan->bone->arm_mat); - + // SECOND_LIFE_COMPATIBILITY + if(export_settings->second_life) + { + // Only translations, no rotation vs armature + float temp[4][4]; + unit_m4(temp); + copy_v3_v3(temp[3], pchan->bone->arm_mat[3]); + mult_m4_m4m4(world, ob_arm->obmat, temp); + } + else + { + // make world-space matrix, arm_mat is armature-space + mult_m4_m4m4(world, ob_arm->obmat, pchan->bone->arm_mat); + } + invert_m4_m4(mat, world); converter.mat4_to_dae(inv_bind_mat, mat); diff --git a/source/blender/collada/DocumentExporter.cpp b/source/blender/collada/DocumentExporter.cpp index 6e8abc08358..6e04a1773bb 100644 --- a/source/blender/collada/DocumentExporter.cpp +++ b/source/blender/collada/DocumentExporter.cpp @@ -257,7 +257,7 @@ void DocumentExporter::exportCurrentScene(Scene *sce) } // - AnimationExporter ae(&sw); + AnimationExporter ae(&sw, this->export_settings); ae.exportAnimations(sce); // diff --git a/source/blender/collada/ExportSettings.h b/source/blender/collada/ExportSettings.h index 1ad7c8c370e..80e20acbe48 100644 --- a/source/blender/collada/ExportSettings.h +++ b/source/blender/collada/ExportSettings.h @@ -31,6 +31,7 @@ struct ExportSettings { public: bool selected; + bool second_life; char *filepath; }; diff --git a/source/blender/collada/TransformWriter.cpp b/source/blender/collada/TransformWriter.cpp index 379a0619040..a2bca6733e1 100644 --- a/source/blender/collada/TransformWriter.cpp +++ b/source/blender/collada/TransformWriter.cpp @@ -59,6 +59,7 @@ void TransformWriter::add_node_transform(COLLADASW::Node& node, float mat[][4], void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob) { + /* float rot[3], loc[3], scale[3]; if (ob->parent) { @@ -91,6 +92,27 @@ void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob) } add_transform(node, loc, rot, scale); + */ + + /* Using parentinv should allow use of existing curves */ + // If parentinv is identity don't add it. + bool add_parinv = false; + for(int i = 0; i < 16; ++i) + { + float f = (i%4 == i/4) ? 1.0f : 0.0f ; + if(ob->parentinv[i%4][i/4] != f) add_parinv = true; + } + + // Eat this 3ds Max et friends + if(add_parinv) + { + double dmat[4][4]; + UnitConverter converter; + converter.mat4_to_dae_double(dmat, ob->parentinv); + node.addMatrix("parentinverse", dmat); + } + + add_transform(node, ob->loc, ob->rot, ob->size); } void TransformWriter::add_node_transform_identity(COLLADASW::Node& node) diff --git a/source/blender/collada/collada.cpp b/source/blender/collada/collada.cpp index 0731faceeed..39114f6543b 100644 --- a/source/blender/collada/collada.cpp +++ b/source/blender/collada/collada.cpp @@ -49,11 +49,12 @@ extern "C" return 0; } - int collada_export(Scene *sce, const char *filepath, int selected) + int collada_export(Scene *sce, const char *filepath, int selected, int second_life) { ExportSettings export_settings; export_settings.selected = selected != 0; + export_settings.second_life = second_life != 0; export_settings.filepath = (char *)filepath; /* annoying, collada crashes if file cant be created! [#27162] */ diff --git a/source/blender/collada/collada.h b/source/blender/collada/collada.h index b86f37b7af6..161977368db 100644 --- a/source/blender/collada/collada.h +++ b/source/blender/collada/collada.h @@ -37,7 +37,7 @@ extern "C" { * both return 1 on success, 0 on error */ int collada_import(bContext *C, const char *filepath); - int collada_export(Scene *sce, const char *filepath, int selected); + int collada_export(Scene *sce, const char *filepath, int selected, int second_life); #ifdef __cplusplus } #endif diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index 153317fb687..6d588632c95 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -84,9 +84,9 @@ static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, char *name /* don't remove this, as COLLADA exporting cannot be done through operators in render() callback. */ #include "../../collada/collada.h" -static void rna_Scene_collada_export(Scene *scene, const char *filepath, int selected) +static void rna_Scene_collada_export(Scene *scene, const char *filepath, int selected, int second_life) { - collada_export(scene, filepath, selected); + collada_export(scene, filepath, selected, second_life); } #endif @@ -110,10 +110,11 @@ void RNA_api_scene(StructRNA *srna) #ifdef WITH_COLLADA /* don't remove this, as COLLADA exporting cannot be done through operators in render() callback. */ func= RNA_def_function(srna, "collada_export", "rna_Scene_collada_export"); - RNA_def_string(func, "filepath", "", FILE_MAX, "File Path", "File path to write Collada file"); - parm= RNA_def_boolean(func, "selected", 0, "Export only selected", "Export only selected elements"); + parm= RNA_def_string(func, "filepath", "", FILE_MAX, "File Path", "File path to write Collada file"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_subtype(parm, PROP_FILEPATH); /* allow non utf8 */ + parm= RNA_def_boolean(func, "selected", 0, "Export only selected", "Export only selected elements"); + parm= RNA_def_boolean(func, "second_life", 0, "Export for Second Life", "Compatibility mode for Second Life"); RNA_def_function_ui_description(func, "Export to collada file"); #endif } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 3346edaa5de..19c45164b53 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -2135,7 +2135,7 @@ static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED static int wm_collada_export_exec(bContext *C, wmOperator *op) { char filename[FILE_MAX]; - int selected; + int selected, second_life; if(!RNA_struct_property_is_set(op->ptr, "filepath")) { BKE_report(op->reports, RPT_ERROR, "No filename given"); @@ -2144,7 +2144,8 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "filepath", filename); selected = RNA_boolean_get(op->ptr, "selected"); - if(collada_export(CTX_data_scene(C), filename, selected)) { + second_life = RNA_boolean_get(op->ptr, "second_life"); + if(collada_export(CTX_data_scene(C), filename, selected, second_life)) { return OPERATOR_FINISHED; } else { @@ -2164,6 +2165,8 @@ static void WM_OT_collada_export(wmOperatorType *ot) WM_operator_properties_filesel(ot, FOLDERFILE|COLLADAFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY); RNA_def_boolean(ot->srna, "selected", 0, "Export only selected", "Export only selected elements"); + RNA_def_boolean(ot->srna, "second_life", 0, "Export for Second Life", + "Compatibility mode for Second Life"); } /* function used for WM_OT_save_mainfile too */ -- cgit v1.2.3 From 212337139c7561d0a63c80b5e9150ac4b1452d21 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 5 Feb 2012 21:48:41 +0000 Subject: fix [#30062] Weight, Texture,Vertex Paint - Face Selection Mask Icon: Out of Sync missing notifier for header redraw. --- source/blender/makesrna/intern/rna_mesh.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index c2faf20749d..f0320d85bb8 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -2192,14 +2192,13 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_PAINT_MASK); RNA_def_property_ui_text(prop, "Paint Mask", "Face selection masking for painting"); RNA_def_property_ui_icon(prop, ICON_FACESEL_HLT, 0); - RNA_def_property_update(prop, 0, "rna_Mesh_update_facemask"); - + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Mesh_update_facemask"); prop= RNA_def_property(srna, "use_paint_mask_vertex", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_VERT_SEL); RNA_def_property_ui_text(prop, "Vertex Selection", "Vertex selection masking for painting (weight paint only)"); RNA_def_property_ui_icon(prop, ICON_VERTEXSEL, 0); - RNA_def_property_update(prop, 0, "rna_Mesh_update_vertmask"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Mesh_update_vertmask"); /* readonly editmesh info - use for extrude menu */ prop= RNA_def_property(srna, "total_vert_sel", PROP_INT, PROP_UNSIGNED); -- cgit v1.2.3 From 8f3170a17c270dd8a02f9b3bf2a971a65cab67ae Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 5 Feb 2012 21:58:24 +0000 Subject: no functional change: NC_SPACE|ND_SPACE_VIEW3D notifier was getting an Object as a reference, currently this argument isn't used, but every other use passes a view3d, so better pass a view3d here too. --- source/blender/editors/space_view3d/view3d_buttons.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 985d70d2144..5238fd30ae6 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1269,7 +1269,7 @@ static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event } /* default for now */ - WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, ob); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d); } static void view3d_panel_object(const bContext *C, Panel *pa) -- cgit v1.2.3