[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38283] branches/soc-2011-carrot: Merge with trunk r38281
Miika Hamalainen
miika.hamalainen at kolumbus.fi
Sun Jul 10 18:18:49 CEST 2011
Revision: 38283
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38283
Author: miikah
Date: 2011-07-10 16:18:48 +0000 (Sun, 10 Jul 2011)
Log Message:
-----------
Merge with trunk r38281
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38281
Modified Paths:
--------------
branches/soc-2011-carrot/intern/ghost/test/CMakeLists.txt
branches/soc-2011-carrot/intern/ghost/test/multitest/MultiTest.c
branches/soc-2011-carrot/intern/iksolver/intern/IK_QJacobian.cpp
branches/soc-2011-carrot/intern/iksolver/intern/IK_QJacobian.h
branches/soc-2011-carrot/intern/iksolver/intern/IK_QTask.cpp
branches/soc-2011-carrot/release/scripts/modules/addon_utils.py
branches/soc-2011-carrot/release/scripts/modules/bpy_extras/view3d_utils.py
branches/soc-2011-carrot/release/scripts/modules/bpy_types.py
branches/soc-2011-carrot/release/scripts/modules/bpyml_ui.py
branches/soc-2011-carrot/release/scripts/modules/rna_prop_ui.py
branches/soc-2011-carrot/release/scripts/startup/bl_operators/image.py
branches/soc-2011-carrot/release/scripts/startup/bl_operators/mesh.py
branches/soc-2011-carrot/release/scripts/startup/bl_operators/object_align.py
branches/soc-2011-carrot/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
branches/soc-2011-carrot/release/scripts/startup/bl_operators/uvcalc_follow_active.py
branches/soc-2011-carrot/release/scripts/startup/bl_operators/uvcalc_lightmap.py
branches/soc-2011-carrot/source/blender/blenkernel/intern/cdderivedmesh.c
branches/soc-2011-carrot/source/blender/blenkernel/intern/curve.c
branches/soc-2011-carrot/source/blender/blenkernel/intern/node.c
branches/soc-2011-carrot/source/blender/blenkernel/intern/softbody.c
branches/soc-2011-carrot/source/blender/blenlib/intern/pbvh.c
branches/soc-2011-carrot/source/blender/blenloader/intern/readfile.c
branches/soc-2011-carrot/source/blender/blenloader/intern/writefile.c
branches/soc-2011-carrot/source/blender/editors/armature/poseUtils.c
branches/soc-2011-carrot/source/blender/editors/object/object_relations.c
branches/soc-2011-carrot/source/blender/editors/space_view3d/view3d_view.c
branches/soc-2011-carrot/source/blender/editors/transform/transform_conversions.c
branches/soc-2011-carrot/source/blender/gpu/GPU_buffers.h
branches/soc-2011-carrot/source/blender/gpu/intern/gpu_buffers.c
branches/soc-2011-carrot/source/blender/makesdna/DNA_object_force.h
branches/soc-2011-carrot/source/blender/makesrna/intern/rna_object_force.c
branches/soc-2011-carrot/source/blender/nodes/intern/SHD_nodes/SHD_material.c
branches/soc-2011-carrot/source/blender/python/generic/py_capi_utils.c
branches/soc-2011-carrot/source/blender/python/generic/py_capi_utils.h
branches/soc-2011-carrot/source/blender/python/intern/bpy_driver.c
branches/soc-2011-carrot/source/blender/python/intern/bpy_rna.c
branches/soc-2011-carrot/source/blender/render/intern/source/convertblender.c
branches/soc-2011-carrot/source/blender/windowmanager/intern/wm_init_exit.c
branches/soc-2011-carrot/source/gameengine/Expressions/PyObjectPlus.cpp
branches/soc-2011-carrot/source/gameengine/Ketsji/KX_Camera.cpp
branches/soc-2011-carrot/source/gameengine/Ketsji/KX_GameObject.cpp
Property Changed:
----------------
branches/soc-2011-carrot/
Property changes on: branches/soc-2011-carrot
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/blender:36828-38225
+ /trunk/blender:36828-38281
Modified: branches/soc-2011-carrot/intern/ghost/test/CMakeLists.txt
===================================================================
--- branches/soc-2011-carrot/intern/ghost/test/CMakeLists.txt 2011-07-10 16:08:26 UTC (rev 38282)
+++ branches/soc-2011-carrot/intern/ghost/test/CMakeLists.txt 2011-07-10 16:18:48 UTC (rev 38283)
@@ -58,11 +58,39 @@
include_directories(${INC_NEW})
add_library(guardedalloc_lib ${SRC_NEW})
+# blenfont
+include(${CMAKE_SOURCE_DIR}/../../../source/blender/blenfont/CMakeLists.txt)
+suffix_relpaths(INC_NEW "${INC}" "../../../source/blender/blenfont/")
+suffix_relpaths(SRC_NEW "${SRC}" "../../../source/blender/blenfont/")
+include_directories(${INC_NEW})
+add_library(blenfont_lib ${SRC_NEW})
+# grr, blenfont needs BLI
+include_directories(
+ "../../../source/blender/blenlib"
+ "../../../source/blender/blenloader"
+ )
+add_library(bli_lib
+ "../../../source/blender/blenlib/intern/fileops.c"
+ "../../../source/blender/blenlib/intern/rct.c"
+ "../../../source/blender/blenlib/intern/string.c"
+ "../../../source/blender/blenlib/intern/listbase.c"
+ "../../../source/blender/blenlib/intern/storage.c"
+ "../../../source/blender/blenlib/intern/path_util.c"
+ "../../../source/blender/blenlib/intern/BLI_dynstr.c"
+ "../../../source/blender/blenlib/intern/BLI_linklist.c"
+ "../../../source/blender/blenlib/intern/BLI_memarena.c"
+ )
+
+
find_package(OpenGL REQUIRED)
+find_package(Freetype REQUIRED)
+
include_directories(${CMAKE_SOURCE_DIR}/../)
include_directories(${OPENGL_INCLUDE_DIR})
+include_directories(${FREETYPE_INCLUDE_DIRS})
+include_directories(${CMAKE_SOURCE_DIR}/../../../source/blender/blenfont)
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
@@ -105,6 +133,7 @@
# MultiTest (C)
add_executable(multitest_c
+ ${CMAKE_SOURCE_DIR}/../../../source/blender/editors/datafiles/bfont.ttf.c
${CMAKE_SOURCE_DIR}/multitest/Basic.c
${CMAKE_SOURCE_DIR}/multitest/EventToBuf.c
${CMAKE_SOURCE_DIR}/multitest/MultiTest.c
@@ -114,10 +143,13 @@
)
target_link_libraries(multitest_c
+ blenfont_lib
+ bli_lib
ghost_lib
string_lib
guardedalloc_lib
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
+ ${FREETYPE_LIBRARY}
${PLATFORM_LINKLIBS}
)
Modified: branches/soc-2011-carrot/intern/ghost/test/multitest/MultiTest.c
===================================================================
--- branches/soc-2011-carrot/intern/ghost/test/multitest/MultiTest.c 2011-07-10 16:08:26 UTC (rev 38282)
+++ branches/soc-2011-carrot/intern/ghost/test/multitest/MultiTest.c 2011-07-10 16:18:48 UTC (rev 38283)
@@ -42,8 +42,19 @@
#include "MEM_guardedalloc.h"
#include "GHOST_C-api.h"
-#include "BMF_Api.h"
+#ifdef USE_BMF
+# include "BMF_Api.h"
+#else
+# include "BLF_api.h"
+ extern int datatoc_bfont_ttf_size;
+ extern char datatoc_bfont_ttf[];
+
+ // XXX, bad, but BLI uses these
+ char bprogname[160]= "";
+char U[1024]= {0};
+#endif
+
#include "Util.h"
#include "Basic.h"
#include "ScrollBar.h"
@@ -291,7 +302,7 @@
win= GHOST_CreateWindow(sys, "MultiTest:Main", 40, 40, 400, 400,
GHOST_kWindowStateNormal, GHOST_kDrawingContextTypeOpenGL,
- FALSE);
+ FALSE, FALSE);
if (win) {
MainWindow *mw= MEM_callocN(sizeof(*mw), "mainwindow_new");
@@ -324,8 +335,12 @@
MultiTestApp *app;
GHOST_WindowHandle win;
-
+
+#ifdef USE_BMF
BMF_Font *font;
+#else
+ int font;
+#endif
int fonttexid;
int fontheight;
@@ -429,18 +444,26 @@
char *line= lw->loglines[(lw->nloglines-1)-(i+startline)];
int x_pos= lw->textarea[0][0] + 4;
int y_pos= lw->textarea[0][1] + 4 + i*lw->fontheight;
-
+
+#ifdef USE_BMF
if (lw->fonttexid==-1) {
glRasterPos2i(x_pos, y_pos);
BMF_DrawString(lw->font, line);
} else {
BMF_DrawStringTexture(lw->font, line, x_pos, y_pos, 0.0);
}
+#else
+ BLF_position(lw->font, x_pos, y_pos, 0.0);
+ BLF_draw(lw->font, line, 256); // XXX
+#endif
}
+
+#ifdef USE_BMF
if (lw->fonttexid!=-1) {
glDisable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
}
+#endif
GHOST_SwapWindowBuffers(lw->win);
}
@@ -531,19 +554,25 @@
GHOST_GetMainDisplayDimensions(sys, &screensize[0], &screensize[1]);
win= GHOST_CreateWindow(sys, "MultiTest:Logger", 40, screensize[1]-432,
800, 300, GHOST_kWindowStateNormal,
- GHOST_kDrawingContextTypeOpenGL, FALSE);
+ GHOST_kDrawingContextTypeOpenGL, FALSE, FALSE);
if (win) {
LoggerWindow *lw= MEM_callocN(sizeof(*lw), "loggerwindow_new");
int bbox[2][2];
lw->app= app;
lw->win= win;
-
+
+#ifdef USE_BMF
lw->font= BMF_GetFont(BMF_kScreen12);
lw->fonttexid= BMF_GetFontTexture(lw->font);
BMF_GetBoundingBox(lw->font, &bbox[0][0], &bbox[0][1], &bbox[1][0], &bbox[1][1]);
lw->fontheight= rect_height(bbox);
+#else
+ lw->font= BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
+ BLF_size(lw->font, 11, 72);
+ lw->fontheight= BLF_height(lw->font, "A_");
+#endif
lw->nloglines= lw->logsize= 0;
lw->loglines= MEM_mallocN(sizeof(*lw->loglines)*lw->nloglines, "loglines");
@@ -711,7 +740,7 @@
win= GHOST_CreateWindow(sys, "MultiTest:Extra", 500, 40, 400, 400,
GHOST_kWindowStateNormal, GHOST_kDrawingContextTypeOpenGL,
- FALSE);
+ FALSE, FALSE);
if (win) {
ExtraWindow *ew= MEM_callocN(sizeof(*ew), "mainwindow_new");
@@ -786,7 +815,7 @@
MultiTestApp *multitestapp_new(void) {
MultiTestApp *app= MEM_mallocN(sizeof(*app), "multitestapp_new");
GHOST_EventConsumerHandle consumer= GHOST_CreateEventConsumer(multitest_event_handler, app);
-
+
app->sys= GHOST_CreateSystem();
if (!app->sys)
fatal("Unable to create ghost system");
@@ -850,6 +879,10 @@
/***/
int main(int argc, char **argv) {
+#ifndef USE_BMF
+ BLF_init(11, 72);
+#endif
+
MultiTestApp *app= multitestapp_new();
multitestapp_run(app);
Modified: branches/soc-2011-carrot/intern/iksolver/intern/IK_QJacobian.cpp
===================================================================
--- branches/soc-2011-carrot/intern/iksolver/intern/IK_QJacobian.cpp 2011-07-10 16:08:26 UTC (rev 38282)
+++ branches/soc-2011-carrot/intern/iksolver/intern/IK_QJacobian.cpp 2011-07-10 16:18:48 UTC (rev 38283)
@@ -59,6 +59,7 @@
m_d_theta.newsize(dof);
m_d_theta_tmp.newsize(dof);
+ m_d_norm_weight.newsize(dof);
m_norm.newsize(dof);
m_norm = 0.0;
@@ -111,11 +112,13 @@
m_beta[id+2] = v.z();
}
-void IK_QJacobian::SetDerivatives(int id, int dof_id, const MT_Vector3& v)
+void IK_QJacobian::SetDerivatives(int id, int dof_id, const MT_Vector3& v, MT_Scalar norm_weight)
{
m_jacobian[id][dof_id] = v.x()*m_weight_sqrt[dof_id];
m_jacobian[id+1][dof_id] = v.y()*m_weight_sqrt[dof_id];
m_jacobian[id+2][dof_id] = v.z()*m_weight_sqrt[dof_id];
+
+ m_d_norm_weight[dof_id] = norm_weight;
}
void IK_QJacobian::Invert()
@@ -429,7 +432,7 @@
MT_Scalar mx = 0.0, dtheta_abs;
for (i = 0; i < m_d_theta.size(); i++) {
- dtheta_abs = MT_abs(m_d_theta[i]);
+ dtheta_abs = MT_abs(m_d_theta[i]*m_d_norm_weight[i]);
if (dtheta_abs > mx)
mx = dtheta_abs;
}
Modified: branches/soc-2011-carrot/intern/iksolver/intern/IK_QJacobian.h
===================================================================
--- branches/soc-2011-carrot/intern/iksolver/intern/IK_QJacobian.h 2011-07-10 16:08:26 UTC (rev 38282)
+++ branches/soc-2011-carrot/intern/iksolver/intern/IK_QJacobian.h 2011-07-10 16:18:48 UTC (rev 38283)
@@ -56,7 +56,7 @@
// Iteratively called
void SetBetas(int id, int size, const MT_Vector3& v);
- void SetDerivatives(int id, int dof_id, const MT_Vector3& v);
+ void SetDerivatives(int id, int dof_id, const MT_Vector3& v, MT_Scalar norm_weight);
void Invert();
@@ -89,6 +89,7 @@
/// the vector of computed angle changes
TVector m_d_theta;
+ TVector m_d_norm_weight;
/// space required for SVD computation
Modified: branches/soc-2011-carrot/intern/iksolver/intern/IK_QTask.cpp
===================================================================
--- branches/soc-2011-carrot/intern/iksolver/intern/IK_QTask.cpp 2011-07-10 16:08:26 UTC (rev 38282)
+++ branches/soc-2011-carrot/intern/iksolver/intern/IK_QTask.cpp 2011-07-10 16:18:48 UTC (rev 38283)
@@ -95,10 +95,10 @@
MT_Vector3 axis = seg->Axis(i)*m_weight;
if (seg->Translational())
- jacobian.SetDerivatives(m_id, seg->DoFId()+i, axis);
+ jacobian.SetDerivatives(m_id, seg->DoFId()+i, axis, 1e2);
else {
MT_Vector3 pa = p.cross(axis);
- jacobian.SetDerivatives(m_id, seg->DoFId()+i, pa);
+ jacobian.SetDerivatives(m_id, seg->DoFId()+i, pa, 1e0);
}
}
}
@@ -147,10 +147,10 @@
for (i = 0; i < seg->NumberOfDoF(); i++) {
if (seg->Translational())
- jacobian.SetDerivatives(m_id, seg->DoFId()+i, MT_Vector3(0, 0, 0));
+ jacobian.SetDerivatives(m_id, seg->DoFId()+i, MT_Vector3(0, 0, 0), 1e2);
else {
MT_Vector3 axis = seg->Axis(i)*m_weight;
- jacobian.SetDerivatives(m_id, seg->DoFId()+i, axis);
+ jacobian.SetDerivatives(m_id, seg->DoFId()+i, axis, 1e0);
}
}
}
@@ -202,10 +202,10 @@
axis *= /*segment->Mass()**/m_total_mass_inv;
if (segment->Translational())
- jacobian.SetDerivatives(m_id, segment->DoFId()+i, axis);
+ jacobian.SetDerivatives(m_id, segment->DoFId()+i, axis, 1e2);
else {
MT_Vector3 pa = axis.cross(p);
- jacobian.SetDerivatives(m_id, segment->DoFId()+i, pa);
+ jacobian.SetDerivatives(m_id, segment->DoFId()+i, pa, 1e0);
}
}
Modified: branches/soc-2011-carrot/release/scripts/modules/addon_utils.py
===================================================================
--- branches/soc-2011-carrot/release/scripts/modules/addon_utils.py 2011-07-10 16:08:26 UTC (rev 38282)
+++ branches/soc-2011-carrot/release/scripts/modules/addon_utils.py 2011-07-10 16:18:48 UTC (rev 38283)
@@ -48,8 +48,6 @@
def modules(module_cache):
import os
- import sys
- import time
path_list = paths()
@@ -173,11 +171,9 @@
:return: the loaded module or None on failier.
:rtype: module
"""
- # note, this still gets added to _bpy_types.TypeMap
import os
import sys
- import bpy_types as _bpy_types
import imp
def handle_error():
@@ -246,8 +242,6 @@
:type module_name: string
"""
import sys
- import bpy_types as _bpy_types
-
mod = sys.modules.get(module_name)
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list