[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16452] trunk/blender/release/scripts: 2 gamelogic templates, one with example functions and comments, another minimal template for those who know the

2008-09-09 Thread Campbell Barton
Revision: 16452
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16452
Author:   campbellbarton
Date: 2008-09-10 05:34:08 +0200 (Wed, 10 Sep 2008)

Log Message:
---
2 gamelogic templates, one with example functions and comments, another minimal 
template for those who know the api.

Added Paths:
---
trunk/blender/release/scripts/scripttemplate_gamelogic.py
trunk/blender/release/scripts/scripttemplate_gamelogic_basic.py

Added: trunk/blender/release/scripts/scripttemplate_gamelogic.py
===
--- trunk/blender/release/scripts/scripttemplate_gamelogic.py   
(rev 0)
+++ trunk/blender/release/scripts/scripttemplate_gamelogic.py   2008-09-10 
03:34:08 UTC (rev 16452)
@@ -0,0 +1,94 @@
+#!BPY
+"""
+Name: 'GameLogic Example'
+Blender: 245
+Group: 'ScriptTemplate'
+Tooltip: 'Script template with examples of how to use game logic'
+"""
+
+from Blender import Window
+import bpy
+
+script_data = \
+'''
+# GameLogic has been added to the global namespace no need to import
+
+# for keyboard event comparison
+# import GameKeys 
+
+# support for Vector(), Matrix() types and advanced functions like 
AngleBetweenVecs(v1,v2) and RotationMatrix(...)
+# import Mathutils 
+
+# for functions like getWindowWidth(), getWindowHeight()
+# import Rasterizer
+
+def main():
+   cont = GameLogic.getCurrentController()
+   
+   # The KX_GameObject that owns this controller.
+   own = cont.getOwner()
+   
+   # for scripts that deal with spacial logic
+   own_pos = own.getPosition() 
+   
+   
+   # Some example functions, remove to write your own script.
+   # check for a positive sensor, will run on any object without errors.
+   print 'Logic info for KX_GameObject', own.getName()
+   input = False
+   
+   for sens in cont.getSensors():
+   # The sensor can be on another object, we may want to use it
+   own_sens = sens.getOwner()
+   print 'sensor:', sens.getName(),
+   if sens.isPositive():
+   print '(true)'
+   input = True
+   else:
+   print '(false)'
+   
+   for actu in cont.getActuators():
+   # The actuator can be on another object, we may want to use it
+   own_actu = actu.getOwner()
+   print 'actuator:', sens.getName()
+   
+   # This runs the actuator or turns it off
+   # note that actuators will continue to run unless explicitly 
turned off.
+   if input:
+   GameLogic.addActiveActuator(actu, True)
+   else:
+   GameLogic.addActiveActuator(actu, False)
+   
+   # Its also good practice to get sensors and actuators by names
+   # so any changes to their order wont break the script.
+   
+   # sens_key = cont.getSensor('key_sensor')
+   # actu_motion = cont.getActuator('motion')
+   
+   
+   # Loop through all other objects in the scene
+   sce = GameLogic.getCurrentScene()
+   print 'Scene Objects:', sce.getName()
+   for ob in sce.getObjectList():
+   print '   ', ob.getName(), ob.getPosition()
+   
+   
+   # Example where collision objects are checked for their properties
+   # adding to our objects "life" property
+   """
+   actu_collide = cont.getSensor('collision_sens')
+   for ob in actu_collide.getHitObjectList():
+   # Check to see the object has this property
+   if hasattr(ob, 'life'):
+   own.life += ob.life
+   ob.life = 0
+   print own.life
+   """
+
+main()
+'''
+
+new_text = bpy.data.texts.new('gamelogic_example.py')
+new_text.write(script_data)
+bpy.data.texts.active = new_text
+Window.RedrawAll()

Added: trunk/blender/release/scripts/scripttemplate_gamelogic_basic.py
===
--- trunk/blender/release/scripts/scripttemplate_gamelogic_basic.py 
(rev 0)
+++ trunk/blender/release/scripts/scripttemplate_gamelogic_basic.py 
2008-09-10 03:34:08 UTC (rev 16452)
@@ -0,0 +1,33 @@
+#!BPY
+"""
+Name: 'GameLogic Template'
+Blender: 245
+Group: 'ScriptTemplate'
+Tooltip: 'Basic template for new game logic scripts'
+"""
+
+from Blender import Window
+import bpy
+
+script_data = \
+'''
+def main():
+
+   cont = GameLogic.getCurrentController()
+   own = cont.getOwner()
+   
+   sens = cont.getSensor('mySensor')
+   actu = cont.getActuator('myActuator')
+   
+   if sens.isPositive():
+   GameLogic.addActiveActuator(actu, True)
+   else:
+   GameLogic.addActiveActuator(actu, False)
+
+main()
+'''
+
+new_text = bpy.data.texts.new('g

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16451] trunk/blender/source/blender/ python/BPY_interface.c: BPY merge from apricot branch.

2008-09-09 Thread Campbell Barton
Revision: 16451
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16451
Author:   campbellbarton
Date: 2008-09-10 03:17:03 +0200 (Wed, 10 Sep 2008)

Log Message:
---
BPY merge from apricot branch.
work around non unix line endings using pythons execfile() function rather then 
loading the binary data and manually stripping the line endings.

Modified Paths:
--
trunk/blender/source/blender/python/BPY_interface.c

Modified: trunk/blender/source/blender/python/BPY_interface.c
===
--- trunk/blender/source/blender/python/BPY_interface.c 2008-09-09 22:40:10 UTC 
(rev 16450)
+++ trunk/blender/source/blender/python/BPY_interface.c 2008-09-10 01:17:03 UTC 
(rev 16451)
@@ -778,10 +778,7 @@
PyObject *py_dict, *py_res, *pyarg;
Text *text = NULL;
BPy_constant *info;
-   int len;

-   FILE *fp = NULL;
-   
PyGILState_STATE gilstate = PyGILState_Ensure();

if (!BLI_exists(script->scriptname)) {
@@ -825,12 +822,8 @@
Py_INCREF( Py_None );
pyarg = Py_None;
} else {
-   if (BLI_exists(script->scriptname)) {
-   fp = fopen( script->scriptname, "rb" );
-   }
-   
-   if( !fp ) {
-   printf( "Error loading script: couldn't open file 
%s\n", script->scriptname );
+   if (!BLI_exists(script->scriptname)) {
+   printf( "Script does not exit %s\n", script->scriptname 
);
free_libblock( &G.main->script, script );
PyGILState_Release(gilstate);
return 0;
@@ -875,51 +868,17 @@
if (text) {
py_res = RunPython( text, py_dict );
} else {
+   char pystring[sizeof(script->scriptname) + 15];
+   sprintf(pystring, "execfile(r'%s')", script->scriptname);
+   py_res = PyRun_String( pystring, Py_file_input, py_dict, 
py_dict );
+   }
+
+   if( !py_res ) { /* Failed execution of the script */
/* Previously we used PyRun_File to run directly the code on a 
FILE 
* object, but as written in the Python/C API Ref Manual, 
chapter 2,
* 'FILE structs for different C libraries can be different and 
* incompatible'.
* So now we load the script file data to a buffer */
-   char *buffer=NULL, *buffer_ofs=NULL, *b_to, *b_from;
-   
-   fseek( fp, 0L, SEEK_END );
-   len = ftell( fp );
-   fseek( fp, 0L, SEEK_SET );
-   
-   buffer = buffer_ofs = MEM_mallocN( len + 2, "pyfilebuf" );  
/* len+2 to add '\n\0' */
-   len = fread( buffer, 1, len, fp );
-   
-   buffer[len] = '\n'; /* fix syntax error in files w/o eol */
-   buffer[len + 1] = '\0';
-   
-   
-   /* fast clean-up of dos cr/lf line endings, remove convert 
'\r\n's to '\n' */
-   if (*buffer_ofs == '\r' && *(buffer_ofs+1) == '\n') {
-   buffer_ofs++;
-   }
-   b_from = b_to = buffer_ofs;
-   
-   while(*b_from != '\0') {
-   if (*b_from == '\r' && *( b_from+1 ) == '\n') {
-   b_from++;
-   }
-   if (b_from != b_to) {
-   *b_to = *b_from;
-   }
-   b_to++;
-   b_from++;
-   }
-   *b_to = '\0';
-   /* done cleaning the string */
-   
-   fclose( fp );
-   
-   py_res = PyRun_String( buffer_ofs, Py_file_input, py_dict, 
py_dict );
-   MEM_freeN( buffer );
-   }
-
-   if( !py_res ) { /* Failed execution of the script */
-
BPY_Err_Handle( script->id.name + 2 );
ReleaseGlobalDictionary( py_dict );
script->py_globaldict = 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 [16450] trunk/blender/source/gameengine: BGE bug #17549: fix crash on removeParent() with static mesh.

2008-09-09 Thread Benoit Bolsee
Revision: 16450
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16450
Author:   ben2610
Date: 2008-09-10 00:40:10 +0200 (Wed, 10 Sep 2008)

Log Message:
---
BGE bug #17549: fix crash on removeParent() with static mesh. Fix scaling bug 
on setParent(). Add python setWorldPosition() to allow setting object position 
in world coordinate regardless if it is a root or a child object.

Modified Paths:
--
trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp
trunk/blender/source/gameengine/Ketsji/KX_GameObject.h
trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
trunk/blender/source/gameengine/PyDoc/KX_GameObject.py

Modified: trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp
===
--- trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp2008-09-09 
21:46:19 UTC (rev 16449)
+++ trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp2008-09-09 
22:40:10 UTC (rev 16450)
@@ -235,11 +235,12 @@
m_pPhysicsController1->SuspendDynamics(true);
}
// Set us to our new scale, position, and orientation
-   scale1[0] = scale1[0]/scale2[0];
-   scale1[1] = scale1[1]/scale2[1];
-   scale1[2] = scale1[2]/scale2[2];
+   scale2[0] = 1.0/scale2[0];
+   scale2[1] = 1.0/scale2[1];
+   scale2[2] = 1.0/scale2[2];
+   scale1 = scale1 * scale2;
MT_Matrix3x3 invori = obj->NodeGetWorldOrientation().inverse();
-   MT_Vector3 newpos = 
invori*(NodeGetWorldPosition()-obj->NodeGetWorldPosition())*scale1;
+   MT_Vector3 newpos = 
invori*(NodeGetWorldPosition()-obj->NodeGetWorldPosition())*scale2;
 
NodeSetLocalScale(scale1);
NodeSetLocalPosition(MT_Point3(newpos[0],newpos[1],newpos[2]));
@@ -914,6 +915,7 @@
 PyMethodDef KX_GameObject::Methods[] = {
{"getPosition", (PyCFunction) KX_GameObject::sPyGetPosition, 
METH_NOARGS},
{"setPosition", (PyCFunction) KX_GameObject::sPySetPosition, METH_O},
+   {"setWorldPosition", (PyCFunction) KX_GameObject::sPySetWorldPosition, 
METH_O},
{"getLinearVelocity", (PyCFunction) 
KX_GameObject::sPyGetLinearVelocity, METH_VARARGS},
{"setLinearVelocity", (PyCFunction) 
KX_GameObject::sPySetLinearVelocity, METH_VARARGS},
{"getAngularVelocity", (PyCFunction) 
KX_GameObject::sPyGetAngularVelocity, METH_VARARGS},
@@ -1576,6 +1578,19 @@
return NULL;
 }
 
+PyObject* KX_GameObject::PySetWorldPosition(PyObject* self, PyObject* value)
+{
+   MT_Point3 pos;
+   if (PyVecTo(value, pos))
+   {
+   NodeSetWorldPosition(pos);
+   NodeUpdateGS(0.f,true);
+   Py_RETURN_NONE;
+   }
+
+   return NULL;
+}
+
 PyObject* KX_GameObject::PyGetPhysicsId(PyObject* self)
 {
KX_IPhysicsController* ctrl = GetPhysicsController();

Modified: trunk/blender/source/gameengine/Ketsji/KX_GameObject.h
===
--- trunk/blender/source/gameengine/Ketsji/KX_GameObject.h  2008-09-09 
21:46:19 UTC (rev 16449)
+++ trunk/blender/source/gameengine/Ketsji/KX_GameObject.h  2008-09-09 
22:40:10 UTC (rev 16450)
@@ -754,6 +754,7 @@
 
KX_PYMETHOD_NOARGS(KX_GameObject,GetPosition);
KX_PYMETHOD_O(KX_GameObject,SetPosition);
+   KX_PYMETHOD_O(KX_GameObject,SetWorldPosition);
KX_PYMETHOD_VARARGS(KX_GameObject,GetLinearVelocity);
KX_PYMETHOD_VARARGS(KX_GameObject,SetLinearVelocity);
KX_PYMETHOD_VARARGS(KX_GameObject,GetAngularVelocity);

Modified: 
trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
===
--- trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
2008-09-09 21:46:19 UTC (rev 16449)
+++ trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
2008-09-09 22:40:10 UTC (rev 16450)
@@ -452,11 +452,12 @@
// this function is used when the collisionning group of a controller 
is changed
// remove and add the collistioning object
btRigidBody* body = ctrl->GetRigidBody();
-   btVector3 inertia;
+   btVector3 inertia(0.0,0.0,0.0);
 
m_dynamicsWorld->removeCollisionObject(body);
body->setCollisionFlags(newCollisionFlags);
-   body->getCollisionShape()->calculateLocalInertia(newMass, inertia);
+   if (newMass)
+   body->getCollisionShape()->calculateLocalInertia(newMass, 
inertia);
body->setMassProps(newMass, inertia);
m_dynamicsWorld->addCollisionObject(body, newCollisionGroup, 
newCollisionMask);
// to avoid nasty interaction, we must update the property of the 
controller as well

Modified: trunk/blender/source/gameengine/PyD

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16449] trunk/blender/source/blender/src: Bugfix for [#17363] Edge selection mode + knife twice = latter cut doesn' t do anything

2008-09-09 Thread Daniel Genrich
Revision: 16449
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16449
Author:   genscher
Date: 2008-09-09 23:46:19 +0200 (Tue, 09 Sep 2008)

Log Message:
---
Bugfix for [#17363] Edge selection mode + knife twice = latter cut doesn't do 
anything

Modified Paths:
--
trunk/blender/source/blender/src/editmesh_loop.c
trunk/blender/source/blender/src/editmesh_tools.c

Modified: trunk/blender/source/blender/src/editmesh_loop.c
===
--- trunk/blender/source/blender/src/editmesh_loop.c2008-09-09 21:15:30 UTC 
(rev 16448)
+++ trunk/blender/source/blender/src/editmesh_loop.c2008-09-09 21:46:19 UTC 
(rev 16449)
@@ -745,9 +745,9 @@
eed= eed->next;
}

-   if  (mode==KNIFE_EXACT)esubdivideflag(1, 0, 
B_KNIFE|B_PERCENTSUBD,1,SUBDIV_SELECT_ORIG);
-   else if (mode==KNIFE_MIDPOINT) esubdivideflag(1, 0, 
B_KNIFE,1,SUBDIV_SELECT_ORIG);
-   else if (mode==KNIFE_MULTICUT) esubdivideflag(1, 0, 
B_KNIFE,numcuts,SUBDIV_SELECT_ORIG);
+   if(mode==KNIFE_EXACT) esubdivideflag(SELECT, 0, 
B_KNIFE|B_PERCENTSUBD,1,SUBDIV_SELECT_ORIG);
+   else if (mode==KNIFE_MIDPOINT) esubdivideflag(SELECT, 0, 
B_KNIFE,1,SUBDIV_SELECT_ORIG);
+   else if (mode==KNIFE_MULTICUT) esubdivideflag(SELECT, 0, 
B_KNIFE,numcuts,SUBDIV_SELECT_ORIG);
 
eed=em->edges.first;
while(eed){

Modified: trunk/blender/source/blender/src/editmesh_tools.c
===
--- trunk/blender/source/blender/src/editmesh_tools.c   2008-09-09 21:15:30 UTC 
(rev 16448)
+++ trunk/blender/source/blender/src/editmesh_tools.c   2008-09-09 21:46:19 UTC 
(rev 16449)
@@ -2698,16 +2698,21 @@
free_tagged_edges_faces(em->edges.first, em->faces.first); 

if(seltype == SUBDIV_SELECT_ORIG  && G.qual  != LR_CTRLKEY) {
+   /* bugfix: vertex could get flagged as "not-selected"
+   // solution: clear flags before, not at the same time as 
setting SELECT flag -dg
+   */
for(eed = em->edges.first;eed;eed = eed->next) {
-   if(eed->f2 & EDGENEW || eed->f2 & EDGEOLD) {
-   eed->f |= flag;
-   EM_select_edge(eed,1); 
-   
-   }else{
+   if(!(eed->f2 & EDGENEW || eed->f2 & EDGEOLD)) {
eed->f &= !flag;
EM_select_edge(eed,0); 
}
-   }   
+   }
+   for(eed = em->edges.first;eed;eed = eed->next) {
+   if(eed->f2 & EDGENEW || eed->f2 & EDGEOLD) {
+   eed->f |= flag;
+   EM_select_edge(eed,1);
+   }
+   }
} else if ((seltype == SUBDIV_SELECT_INNER || seltype == 
SUBDIV_SELECT_INNER_SEL)|| G.qual == LR_CTRLKEY) {
for(eed = em->edges.first;eed;eed = eed->next) {
if(eed->f2 & EDGEINNER) {


___
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 [16448] trunk/blender: Patch 17508: Blender Web Plugin - XEmbed.

2008-09-09 Thread Benoit Bolsee
Revision: 16448
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16448
Author:   ben2610
Date: 2008-09-09 23:15:30 +0200 (Tue, 09 Sep 2008)

Log Message:
---
Patch 17508: Blender Web Plugin - XEmbed. Enable XEmbed integration of 
blenderplayer, using -i as input parameter to pass embedder window id. create a 
minimal web plugin to embed blenderplayer on web pages (using gecko/mozilla as 
browser). Only for *nix.

Modified Paths:
--
trunk/blender/CMakeLists.txt
trunk/blender/intern/ghost/GHOST_ISystem.h
trunk/blender/intern/ghost/GHOST_Types.h
trunk/blender/intern/ghost/intern/GHOST_SystemCarbon.cpp
trunk/blender/intern/ghost/intern/GHOST_SystemCarbon.h
trunk/blender/intern/ghost/intern/GHOST_SystemWin32.cpp
trunk/blender/intern/ghost/intern/GHOST_SystemWin32.h
trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp
trunk/blender/intern/ghost/intern/GHOST_SystemX11.h
trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp
trunk/blender/intern/ghost/intern/GHOST_WindowX11.h
trunk/blender/source/gameengine/GamePlayer/CMakeLists.txt
trunk/blender/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
trunk/blender/source/gameengine/GamePlayer/ghost/GPG_Application.h
trunk/blender/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
trunk/blender/source/gameengine/GamePlayer/netscape/test/resource/test.html

Added Paths:
---
trunk/blender/source/gameengine/GamePlayer/xembed/
trunk/blender/source/gameengine/GamePlayer/xembed/CMakeLists.txt
trunk/blender/source/gameengine/GamePlayer/xembed/UnixShell.c
trunk/blender/source/gameengine/GamePlayer/xembed/blender_plugin_types.h
trunk/blender/source/gameengine/GamePlayer/xembed/npunix.c

Modified: trunk/blender/CMakeLists.txt
===
--- trunk/blender/CMakeLists.txt2008-09-09 20:52:18 UTC (rev 16447)
+++ trunk/blender/CMakeLists.txt2008-09-09 21:15:30 UTC (rev 16448)
@@ -64,6 +64,7 @@
 OPTION(WITH_FFMPEG "Enable FFMPeg Support 
(http://ffmpeg.mplayerhq.hu/)"   OFF)
 OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" 
ON)
 OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the 
compiler)"   OFF)
+OPTION(WITH_WEBPLUGIN  "Enable Web Plugin (Mozilla-Unix only)" 
OFF)
 
 IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
   MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
@@ -457,6 +458,13 @@
 SUBDIRS(source/creator)
 
 #-
+# Blender WebPlugin
+IF(WITH_WEBPLUGIN) 
+  SET(MOZILLA_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK 
path")
+  SET(WITH_PLAYER ON)
+ENDIF(WITH_WEBPLUGIN)
+
+#-
 # Blender Player
 IF(WITH_PLAYER)
   SUBDIRS(blenderplayer)

Modified: trunk/blender/intern/ghost/GHOST_ISystem.h
===
--- trunk/blender/intern/ghost/GHOST_ISystem.h  2008-09-09 20:52:18 UTC (rev 
16447)
+++ trunk/blender/intern/ghost/GHOST_ISystem.h  2008-09-09 21:15:30 UTC (rev 
16448)
@@ -224,13 +224,15 @@
 * @param   state   The state of the window when opened.
 * @param   typeThe type of drawing context installed 
in this window.
 * @param   stereoVisualCreate a stereo visual for quad 
buffered stereo.
+* @param   parentWindowParent (embedder) window
 * @return  The new window (or 0 if creation failed).
 */
virtual GHOST_IWindow* createWindow(
const STR_String& title,
GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, 
GHOST_TUns32 height,
GHOST_TWindowState state, GHOST_TDrawingContextType type,
-   const bool stereoVisual) = 0;
+   const bool stereoVisual,
+   const GHOST_TEmbedderWindowID parentWindow = 0) = 0;
 
/**
 * Dispose a window.

Modified: trunk/blender/intern/ghost/GHOST_Types.h
===
--- trunk/blender/intern/ghost/GHOST_Types.h2008-09-09 20:52:18 UTC (rev 
16447)
+++ trunk/blender/intern/ghost/GHOST_Types.h2008-09-09 21:15:30 UTC (rev 
16448)
@@ -100,6 +100,7 @@
GHOST_kWindowStateMaximized,
GHOST_kWindowStateMinimized,
GHOST_kWindowStateFullScreen,
+   GHOST_kWindowStateEmbedded,
GHOST_kWindowState8Normal = 8,
GHOST_kWindowState8Maximized,
GHOST_kWindowState8Minimized,
@@ -392,6 +393,15 @@
 } GHOST_DisplaySetting;
 
 
+#ifdef _WIN32
+typedef long GHOST_TEmbedderWindowID;
+#endif // _WIN32
+
+#ifndef _WIN32
+// I can't use "Window" from "" because it conflits with Window 
defined in winlay.h
+typedef int GHOST_

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16447] trunk/blender/source/blender/ python/api2_2x/Particle.c: Python API

2008-09-09 Thread Ken Hughes
Revision: 16447
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16447
Author:   khughes
Date: 2008-09-09 22:52:18 +0200 (Tue, 09 Sep 2008)

Log Message:
---
Python API
--
Bugfix #14425.  Particle.Get() could return a list of invalid items.  The API
still needs more work, but for now throw an NotImplemented exception.

Modified Paths:
--
trunk/blender/source/blender/python/api2_2x/Particle.c

Modified: trunk/blender/source/blender/python/api2_2x/Particle.c
===
--- trunk/blender/source/blender/python/api2_2x/Particle.c  2008-09-09 
20:19:00 UTC (rev 16446)
+++ trunk/blender/source/blender/python/api2_2x/Particle.c  2008-09-09 
20:52:18 UTC (rev 16447)
@@ -526,15 +526,18 @@
 
 PyObject *M_ParticleSys_Get( PyObject * self, PyObject * args ) 
 {
+#if 1
+   return EXPP_ReturnPyObjError( PyExc_NotImplementedError,
+   "Particle.Get() not implemented" );
+#else
ParticleSettings *psys_iter;
char *name = NULL;
-#if 0
 
ParticleSystem *blparticlesys = 0;
Object *ob;
 
PyObject *partsyslist,*current;
-#endif
+
if( !PyArg_ParseTuple( args, "|s", &name ) )
return EXPP_ReturnPyObjError( PyExc_TypeError,
"expected string argument" );
@@ -577,7 +580,6 @@
}

while( psys_iter ){
-#if 0
pyobj = ParticleSystem_CreatePyObject( psys_iter);
if( !pyobj){
Py_DECREF( pylist );
@@ -586,7 +588,6 @@
"could not create ParticleSystem 
PyObject");
}
PyList_SET_ITEM( pylist, index, pyobj);
-#endif
printf("name is %s\n", psys_iter->id.name+2);
psys_iter = psys_iter->id.next;
index++;
@@ -596,10 +597,6 @@

}

-   
-
-#if 0
-
for( ob = G.main->particlesystem.first; ob; ob = ob->id.next )
if( !strcmp( name, ob->id.name + 2 ) )
break;
@@ -626,7 +623,6 @@
}
 
return partsyslist;
-
 #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 [16446] trunk/blender/source/blender/src/ transform_orientations.c:

2008-09-09 Thread Brecht Van Lommel
Revision: 16446
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16446
Author:   blendix
Date: 2008-09-09 22:19:00 +0200 (Tue, 09 Sep 2008)

Log Message:
---

Fix for bug #14775: memorblock end corrupt print, needed to allocate
one byte more for the align menu string 0 terminator. 

Modified Paths:
--
trunk/blender/source/blender/src/transform_orientations.c

Modified: trunk/blender/source/blender/src/transform_orientations.c
===
--- trunk/blender/source/blender/src/transform_orientations.c   2008-09-09 
20:09:54 UTC (rev 16445)
+++ trunk/blender/source/blender/src/transform_orientations.c   2008-09-09 
20:19:00 UTC (rev 16446)
@@ -352,7 +352,7 @@
char *str_menu, *p;


-   str_menu = MEM_callocN(strlen(menu) + strlen(title) + 40 * 
BIF_countTransformOrientation(), "UserTransSpace from matrix");
+   str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + 40 * 
BIF_countTransformOrientation(), "UserTransSpace from matrix");
p = str_menu;

p += sprintf(str_menu, "%s", title);


___
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 [16445] trunk/blender/source/blender/src:

2008-09-09 Thread Brecht Van Lommel
Revision: 16445
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16445
Author:   blendix
Date: 2008-09-09 22:09:54 +0200 (Tue, 09 Sep 2008)

Log Message:
---

Fix for bug #17588: crash with ctrl+a and no active object.

Modified Paths:
--
trunk/blender/source/blender/src/editobject.c
trunk/blender/source/blender/src/meshlaplacian.c

Modified: trunk/blender/source/blender/src/editobject.c
===
--- trunk/blender/source/blender/src/editobject.c   2008-09-09 20:01:21 UTC 
(rev 16444)
+++ trunk/blender/source/blender/src/editobject.c   2008-09-09 20:09:54 UTC 
(rev 16445)
@@ -4138,6 +4138,7 @@
} 
else {
ob= OBACT;
+   if(ob==0) return;

if ((ob->pose) && (ob->flag & OB_POSEMODE))
evt = pupmenu("Apply Object%t|Current Pose as 
RestPose%x3");

Modified: trunk/blender/source/blender/src/meshlaplacian.c
===
--- trunk/blender/source/blender/src/meshlaplacian.c2008-09-09 20:01:21 UTC 
(rev 16444)
+++ trunk/blender/source/blender/src/meshlaplacian.c2008-09-09 20:09:54 UTC 
(rev 16445)
@@ -178,7 +178,6 @@
varea[i1] += (obtuse == 1)? area: area*0.5;
varea[i2] += (obtuse == 2)? area: area*0.5;
varea[i3] += (obtuse == 3)? area: area*0.5;
-   //printf("area %f\n", area);
}
else {
len1= VecLenf(v2, v3);
@@ -192,10 +191,7 @@
varea[i1] += (t2 + t3)*0.25f;
varea[i2] += (t1 + t3)*0.25f;
varea[i3] += (t1 + t2)*0.25f;
-   //printf("varea %f %f %f\n", t1, t2, t3);
}
-
-   //printf("triangle area %f %f %f\n", t1, t2, t3);
 }
 
 static void laplacian_triangle_weights(LaplacianSystem *sys, int f, int i1, 
int i2, int i3)
@@ -298,7 +294,7 @@
for(a=0; aareaweights) {
if(sys->varea[a] != 0.0f)
-   sys->varea[a]= 0.5f/sys->varea[a]; 
//MAX2(sys->varea[a], 0.001f);
+   sys->varea[a]= 0.5f/sys->varea[a];
}
else
sys->varea[a]= 1.0f;


___
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 [16444] trunk/blender/source/blender/ include/BIF_meshlaplacian.h:

2008-09-09 Thread Brecht Van Lommel
Revision: 16444
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16444
Author:   blendix
Date: 2008-09-09 22:01:21 +0200 (Tue, 09 Sep 2008)

Log Message:
---

Forgot this file in previous commit.

Modified Paths:
--
trunk/blender/source/blender/include/BIF_meshlaplacian.h

Modified: trunk/blender/source/blender/include/BIF_meshlaplacian.h
===
--- trunk/blender/source/blender/include/BIF_meshlaplacian.h2008-09-09 
20:00:57 UTC (rev 16443)
+++ trunk/blender/source/blender/include/BIF_meshlaplacian.h2008-09-09 
20:01:21 UTC (rev 16444)
@@ -47,7 +47,7 @@
 struct LaplacianSystem;
 typedef struct LaplacianSystem LaplacianSystem;
 
-LaplacianSystem *laplacian_construct_begin(int totvert, int totface);
+LaplacianSystem *laplacian_construct_begin(int totvert, int totface, int lsq);
 
 void laplacian_add_vertex(LaplacianSystem *sys, float *co, int pinned);
 void laplacian_add_triangle(LaplacianSystem *sys, int v1, int v2, int v3);


___
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 [16443] trunk/blender/source/blender/src/ meshlaplacian.c:

2008-09-09 Thread Brecht Van Lommel
Revision: 16443
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16443
Author:   blendix
Date: 2008-09-09 22:00:57 +0200 (Tue, 09 Sep 2008)

Log Message:
---

Fix for bug #17443: make bone heat weighting solve a bit less
sensitive to poorly shaped geometry, should succeed solving
in more cases now.

Modified Paths:
--
trunk/blender/source/blender/src/meshlaplacian.c

Modified: trunk/blender/source/blender/src/meshlaplacian.c
===
--- trunk/blender/source/blender/src/meshlaplacian.c2008-09-09 19:00:16 UTC 
(rev 16442)
+++ trunk/blender/source/blender/src/meshlaplacian.c2008-09-09 20:00:57 UTC 
(rev 16443)
@@ -178,6 +178,7 @@
varea[i1] += (obtuse == 1)? area: area*0.5;
varea[i2] += (obtuse == 2)? area: area*0.5;
varea[i3] += (obtuse == 3)? area: area*0.5;
+   //printf("area %f\n", area);
}
else {
len1= VecLenf(v2, v3);
@@ -191,7 +192,10 @@
varea[i1] += (t2 + t3)*0.25f;
varea[i2] += (t1 + t3)*0.25f;
varea[i3] += (t1 + t2)*0.25f;
+   //printf("varea %f %f %f\n", t1, t2, t3);
}
+
+   //printf("triangle area %f %f %f\n", t1, t2, t3);
 }
 
 static void laplacian_triangle_weights(LaplacianSystem *sys, int f, int i1, 
int i2, int i3)
@@ -204,7 +208,7 @@
v3= sys->verts[i3];
 
/* instead of *0.5 we divided by the number of faces of the edge, it 
still
-  needs to be varified that this is indeed the correct thing to do! */
+  needs to be verified that this is indeed the correct thing to do! */
t1= cotan_weight(v1, v2, v3)/laplacian_edge_count(sys->edgehash, i2, 
i3);
t2= cotan_weight(v2, v3, v1)/laplacian_edge_count(sys->edgehash, i3, 
i1);
t3= cotan_weight(v3, v1, v2)/laplacian_edge_count(sys->edgehash, i1, 
i2);
@@ -229,7 +233,7 @@
}
 }
 
-LaplacianSystem *laplacian_system_construct_begin(int totvert, int totface)
+LaplacianSystem *laplacian_system_construct_begin(int totvert, int totface, 
int lsq)
 {
LaplacianSystem *sys;
 
@@ -248,6 +252,8 @@
/* create opennl context */
nlNewContext();
nlSolverParameteri(NL_NB_VARIABLES, totvert);
+   if(lsq)
+   nlSolverParameteri(NL_LEAST_SQUARES, NL_TRUE);
 
sys->context= nlGetCurrent();
 
@@ -292,7 +298,7 @@
for(a=0; aareaweights) {
if(sys->varea[a] != 0.0f)
-   sys->varea[a]= 0.5f/sys->varea[a];
+   sys->varea[a]= 0.5f/sys->varea[a]; 
//MAX2(sys->varea[a], 0.001f);
}
else
sys->varea[a]= 1.0f;
@@ -631,7 +637,7 @@
}
 
/* create laplacian */
-   sys = laplacian_system_construct_begin(me->totvert, totface);
+   sys = laplacian_system_construct_begin(me->totvert, totface, 1);
 
sys->heat.mesh= me;
sys->heat.verts= verts;
@@ -933,7 +939,7 @@
}
 
/* create laplacian */
-   sys = laplacian_system_construct_begin(totvert, totface);
+   sys = laplacian_system_construct_begin(totvert, totface, 0);
 
sys->rigid.mesh= em;
sys->rigid.R = MEM_callocN(sizeof(float)*3*3*totvert, "RigidDeformR");


___
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 [16442] branches/soc-2008-mxcurioni/source /blender/freestyle: soc-2008-mxcurioni: Win32 build clean-up

2008-09-09 Thread Maxime Curioni
Revision: 16442
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16442
Author:   mxcurioni
Date: 2008-09-09 21:00:16 +0200 (Tue, 09 Sep 2008)

Log Message:
---
soc-2008-mxcurioni: Win32 build clean-up

Modified Paths:
--
branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp

Removed Paths:
-

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLUtils.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLUtils.h

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript
===
--- branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript 
2008-09-09 18:44:10 UTC (rev 16441)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript 
2008-09-09 19:00:16 UTC (rev 16442)
@@ -48,9 +48,6 @@
 prefix = 'intern/rendering'
 rendering_sources = env.Glob(prefix + '/GL*.cpp')
 
-if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'):
-   rendering_sources = env.Glob(prefix + '/extgl.cpp')
-
 #  app / app_blender
 prefix = 'intern/app_blender'
 app_sources = env.Glob(prefix + '/*.cpp')

Modified: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp
===
--- 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp
   2008-09-09 18:44:10 UTC (rev 16441)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp
   2008-09-09 19:00:16 UTC (rev 16442)
@@ -38,7 +38,6 @@
 #include "AppCanvas.h"
 #include "../rendering/GLRenderer.h"
 #include "../rendering/GLStrokeRenderer.h"
-#include "../rendering/GLUtils.h"
 #include "AppConfig.h"
 
 #include "../system/StringUtils.h"

Deleted: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLUtils.cpp
===
--- 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLUtils.cpp
   2008-09-09 18:44:10 UTC (rev 16441)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLUtils.cpp
   2008-09-09 19:00:16 UTC (rev 16442)
@@ -1,70 +0,0 @@
-
-//
-//  Copyright (C) : Please refer to the COPYRIGHT file distributed 
-//   with this source distribution. 
-//
-//  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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-///
-#include "GLUtils.h"
-
-# ifdef WIN32
-#  include 
-# endif
-# ifdef __MACH__
-#  include 
-# else
-#  include 
-# endif
-#include 
-
-// int isExtensionSupported(const char *extension)
-// {
-//   const GLubyte *extensions = NULL;
-//   const GLubyte *start;
-//   GLubyte *where, *terminator;
-// 
-//   /* Extension names should not have spaces. */
-//   where = (GLubyte *) strchr(extension, ' ');
-//   if (where || *extension == '\0')
-// return 0;
-//   extensions = glGetString(GL_EXTENSIONS);
-//   /* It takes a bit of care to be fool-proof about parsing the
-//  OpenGL extensions string. Don't be fooled by sub-strings,
-//  etc. */
-//   start = extensions;
-//   for (;;) {
-// where = (GLubyte *) strstr((const char *) start, extension);
-// if (!where)
-//   break;
-// terminator = where + strlen(extension);
-// if (where == start || *(where - 1) == ' ')
-//   if (*terminator == ' ' || *terminator == '\0')
-// return 1;
-// start = terminator;
-//   }
-//   return 0;
-// }
-// 
-// void *glutils_extgl_GetProcAddress(const char *name)
-// {
-// #ifdef _WIN32
-// void *t = wglGetProcAddress(name);
-// return t;
-// #else
-// return NULL;
-// #endif
-// }
-

Deleted: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLUtils.h
===
--- 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLUtils.h 
2008-09-09 18:44:10 UTC (rev 16441)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLUtils.h 
2008-09-09 19:00:16 UTC

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16441] trunk/blender/source/blender/ blenkernel/intern/subsurf_ccg.c: Bugfix for [#17329] Bevel Weights are lost after Subsurf

2008-09-09 Thread Daniel Genrich
Revision: 16441
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16441
Author:   genscher
Date: 2008-09-09 20:44:10 +0200 (Tue, 09 Sep 2008)

Log Message:
---
Bugfix for [#17329] Bevel Weights are lost after Subsurf

Modified Paths:
--
trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c

Modified: trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c
===
--- trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c
2008-09-09 18:03:44 UTC (rev 16440)
+++ trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c
2008-09-09 18:44:10 UTC (rev 16441)
@@ -700,6 +700,7 @@
for(index = 0; index < totedge; index++) {
CCGEdge *e = edgeMap2[index];
unsigned int flags = 0;
+   char bweight = 0;
int edgeIdx = 
GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(ss, e));
 
if(!ccgSubSurf_getEdgeNumFaces(ss, e)) flags |= ME_LOOSEEDGE;
@@ -710,12 +711,14 @@
dm->getEdge(dm, edgeIdx, &origMed);
 
flags |= origMed.flag;
+   bweight = origMed.bweight;
}
 
for(x = 0; x < edgeSize - 1; x++) {
med->v1 = getEdgeIndex(ss, e, x, edgeSize);
med->v2 = getEdgeIndex(ss, e, x + 1, edgeSize);
med->flag = flags;
+   med->bweight = bweight;
*origIndex = ccgDM_getEdgeMapIndex(NULL, ss, e);
++med;
++origIndex;


___
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 [16440] branches/soc-2008-mxcurioni: * Make sure freestyle branch compiles with SCons/msvc9 on Windows.

2008-09-09 Thread Nathan Letwory
Revision: 16440
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16440
Author:   jesterking
Date: 2008-09-09 20:03:44 +0200 (Tue, 09 Sep 2008)

Log Message:
---
* Make sure freestyle branch compiles with SCons/msvc9 on Windows. This was 
joint operation with mxcurioni :)

Modified Paths:
--
branches/soc-2008-mxcurioni/SConstruct

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppConfig.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppGLWidget.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppGLWidget_config.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLDebugRenderer.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLStrokeRenderer.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/FreestyleConfig.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/PythonInterpreter.h

Modified: branches/soc-2008-mxcurioni/SConstruct
===
--- branches/soc-2008-mxcurioni/SConstruct  2008-09-09 17:27:01 UTC (rev 
16439)
+++ branches/soc-2008-mxcurioni/SConstruct  2008-09-09 18:03:44 UTC (rev 
16440)
@@ -493,7 +493,7 @@
 Depends(blenderplayer,installtarget)
 
 if not env['WITH_BF_GAMEENGINE']:
-blendernogame = env.Alias('blendernogame', B.game)
+blendernogame = env.Alias('blendernogame', B.program_list)
 Depends(blendernogame,installtarget)
 
 Depends(nsiscmd, allinstall)

Modified: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp
===
--- 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp
   2008-09-09 17:27:01 UTC (rev 16439)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp
   2008-09-09 18:03:44 UTC (rev 16440)
@@ -19,6 +19,17 @@
 //
 ///
 
+
+#ifdef WIN32
+# include 
+# include 
+#endif
+#ifdef __MACH__
+# include 
+#else
+# include 
+#endif
+
 #include "AppGLWidget.h"
 #include "../image/Image.h"
 #include "../system/TimeStamp.h"
@@ -32,16 +43,6 @@
 
 #include "../system/StringUtils.h"
 
-#ifdef WIN32
-# include 
-# include "GL/glew.h"
-#endif
-#ifdef __MACH__
-# include 
-#else
-# include 
-#endif
-
 AppCanvas::AppCanvas()
 :Canvas()
 {

Modified: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppConfig.cpp
===
--- 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppConfig.cpp
   2008-09-09 17:27:01 UTC (rev 16439)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppConfig.cpp
   2008-09-09 18:03:44 UTC (rev 16440)
@@ -25,101 +25,72 @@
 
 using namespace std;
 
-namespace Config{
-  Path* Path::_pInstance = 0;
-  Path::Path(){
-// get the home directory
-_HomeDir = getEnvVar("HOME");
-// get the root directory
+namespace Config {
+Path* Path::_pInstance = 0;
+Path::Path() {
+   // get the home directory
+   _HomeDir = getEnvVar("HOME");
+   // get the root directory
//soc
setRootDir(getEnvVar("FREESTYLE_BLENDER_DIR"));
 
-_pInstance = this;
-  }
-  void Path::setRootDir(const string& iRootDir){
-_ProjectDir = iRootDir;
-_ModelsPath = "";
-_PatternsPath = _ProjectDir +
-string(DIR_SEP.c_str()) +
-"data" +
-string(DIR_SEP.c_str()) +
-"textures" +
-string(DIR_SEP.c_str()) +
-"variation_patterns" +
-string(DIR_SEP.c_str());
-_BrushesPath = _ProjectDir +
-string(DIR_SEP.c_str()) +
-"data" +
-string(DIR_SEP.c_str()) +
-"textures" +
-string(DIR_SEP.c_str()) +
-"brushes" +
-string(DIR_SEP.c_str());
-_PythonPath = _ProjectDir + 
-  string(DIR_SEP.c_str()) + 
-  "python" + 
-  string(PATH_SEP.c_str()) +
-  _ProjectDir +
-  

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16439] trunk/blender/source/blender/ render/intern/source/zbuf.c:

2008-09-09 Thread Brecht Van Lommel
Revision: 16439
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16439
Author:   blendix
Date: 2008-09-09 19:27:01 +0200 (Tue, 09 Sep 2008)

Log Message:
---

Fix for bug #12132: vector blur with fast moving objects does
not give a smooth fallof. there's no correct fix possible due
to a lack of information, but this manually adds a smoother
falloff, overestimating the contribution of foregroud pixels
instead of becoming transparent.

Modified Paths:
--
trunk/blender/source/blender/render/intern/source/zbuf.c

Modified: trunk/blender/source/blender/render/intern/source/zbuf.c
===
--- trunk/blender/source/blender/render/intern/source/zbuf.c2008-09-09 
16:40:36 UTC (rev 16438)
+++ trunk/blender/source/blender/render/intern/source/zbuf.c2008-09-09 
17:27:01 UTC (rev 16439)
@@ -2981,10 +2981,11 @@
 {
ZSpan zspan;
DrawBufPixel *rectdraw, *dr;
-   static float jit[16][2];
+   static float jit[256][2];
float v1[3], v2[3], v3[3], v4[3], fx, fy;
-   float *rectvz, *dvz, *dimg, *dvec1, *dvec2, *dz, *dz1, *dz2, *rectz, 
*minvecbufrect= NULL;
-   float maxspeedsq= (float)nbd->maxspeed*nbd->maxspeed;
+   float *rectvz, *dvz, *dimg, *dvec1, *dvec2, *dz, *dz1, *dz2, *rectz;
+   float *minvecbufrect= NULL, *rectweight, *rw, *rectmax, *rm, *ro;
+   float maxspeedsq= (float)nbd->maxspeed*nbd->maxspeed, totfac;
int y, x, step, maxspeed=nbd->maxspeed, samples= nbd->samples;
int tsktsk= 0;
static int firsttime= 1;
@@ -3003,6 +3004,9 @@
rectmove= MEM_mapallocN(xsize*ysize, "rectmove");
rectdraw= MEM_mapallocN(sizeof(DrawBufPixel)*xsize*ysize, "rect draw");
zspan.rectp= (int *)rectdraw;
+
+   rectweight= MEM_mapallocN(sizeof(float)*xsize*ysize, "rect weight");
+   rectmax= MEM_mapallocN(sizeof(float)*xsize*ysize, "rect max");

/* debug... check if PASS_VECTOR_MAX still is in buffers */
dvec1= vecbufrect;
@@ -3142,7 +3146,7 @@
dm= rectmove;
dvec1= vecbufrect;
for(x=xsize*ysize; x>0; x--, dm++, dvec1+=4) {
-   if(dvec1[0]!=0.0f || dvec1[1]!=0.0f || dvec1[2]!=0.0f || 
dvec1[3]!=0.0f)
+   if((dvec1[0]!=0.0f || dvec1[1]!=0.0f || dvec1[2]!=0.0f || 
dvec1[3]!=0.0f))
*dm= 255;
}

@@ -3151,9 +3155,12 @@
/* has to become static, the init-jit calls a random-seed, screwing up 
texture noise node */
if(firsttime) {
firsttime= 0;
-   BLI_initjit(jit[0], 16);
+   BLI_initjit(jit[0], 256);
}

+   memset(newrect, 0, sizeof(float)*xsize*ysize*4);
+   totfac= 0.0f;
+
/* accumulate */
samples/= 2;
for(step= 1; step<=samples; step++) {
@@ -3161,7 +3168,7 @@
int side;

for(side=0; side<2; side++) {
-   float blendfac= 1.0f/((ABS(step)*2+side)+1), ipodata[4];
+   float blendfac, ipodata[4];

/* clear zbuf, if we draw future we fill in not moving 
pixels */
if(0)
@@ -3193,30 +3200,32 @@

set_quad_bezier_ipo(0.5f + 0.5f*speedfac, ipodata);

-   for(fy= -0.5f+jit[step & 15][0], y=0; y1) {
+   float jfx = fx + 0.5f;
+   float jfy = fy + 0.5f;
DrawBufPixel col;

/* make vertices */
if(nbd->curved) {   /* 
curved */
quad_bezier_2d(v1, dz1, 
dz1+2, ipodata);
-   v1[0]+= fx; v1[1]+= fy; 
v1[2]= *dz;
+   v1[0]+= jfx; v1[1]+= 
jfy; v1[2]= *dz;
 
quad_bezier_2d(v2, 
dz1+4, dz1+4+2, ipodata);
-   v2[0]+= fx+1.0f; 
v2[1]+= fy; v2[2]= *dz;
+   v2[0]+= jfx+1.0f; 
v2[1]+= jfy; v2[2]= *dz;
 
quad_bezier_2d(v3, 
dz2+4, dz2+4+2, ipodata);
-   v3[0]+= fx+1.0f; 
v3[1]+= fy+1.0f; v3[2]= *dz;
+   v3[0]+= jfx+1.0f; 
v3[1]+= jfy+1.0f; v3[2]= *dz;

quad_bezier_2d(v4, dz2, 
dz2+2, ipodata);
-   

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16438] branches/soc-2008-mxcurioni/source /blender/freestyle: soc-2008-mxcurioni: replaced extgl calls with glew, to test whether glBlendEquation is

2008-09-09 Thread Maxime Curioni
Revision: 16438
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16438
Author:   mxcurioni
Date: 2008-09-09 18:40:36 +0200 (Tue, 09 Sep 2008)

Log Message:
---
soc-2008-mxcurioni: replaced extgl calls with glew, to test whether 
glBlendEquation is present. Removal of app/ folder

Modified Paths:
--
branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLStrokeRenderer.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLUtils.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/GLUtils.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/FreestyleConfig.h

Removed Paths:
-

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppAboutWindow.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppAboutWindow.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppCanvas.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppCanvas.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppConfig.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppConfig.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppDensityCurvesWindow.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppDensityCurvesWindow.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppGL2DCurvesViewer.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppGL2DCurvesViewer.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppGLWidget.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppGLWidget.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppInteractiveShaderWindow.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppInteractiveShaderWindow.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppMainWindow.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppMainWindow.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppOptionsWindow.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppOptionsWindow.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppProgressBar.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppProgressBar.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppStyleWindow.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/AppStyleWindow.h
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/ConfigIO.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/ConfigIO.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/Controller.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/Controller.h
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/Main.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/QGLBasicWidget.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/QGLBasicWidget.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/QStyleModuleSyntaxHighlighter.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/QStyleModuleSyntaxHighlighter.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/appmainwindowbase4.ui

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/densitycurveswindow4.ui

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/freestyle.qrc
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/icons/

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/interactiveshaderwindow4.ui

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/optionswindow4.ui

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/progressdialog4.ui

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/stylewindow4.ui
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/ui_dir/

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript
===
--- branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript 
2008-09-09 16:38:08 UTC (rev 16437)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript 
2008-09-09 16:40:36 UTC (rev 16438)
@@ -8,6 +8,7 @@
 
 incs += '../blenkernel ../blenloader ../blenlib ../imbuf ../makesdna ../python 
'
 incs += '../render/extern/include ../render/intern/include ../include ../src'
+incs += ' #/extern/glew/include'
 incs += 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16437] trunk/blender/source/blender/ blenkernel/intern/modifier.c: Bugfix #17562: array fit to curve isnt working

2008-09-09 Thread Daniel Genrich
Revision: 16437
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16437
Author:   genscher
Date: 2008-09-09 18:38:08 +0200 (Tue, 09 Sep 2008)

Log Message:
---
Bugfix #17562: array fit to curve isnt working

Modified Paths:
--
trunk/blender/source/blender/blenkernel/intern/modifier.c

Modified: trunk/blender/source/blender/blenkernel/intern/modifier.c
===
--- trunk/blender/source/blender/blenkernel/intern/modifier.c   2008-09-09 
15:41:40 UTC (rev 16436)
+++ trunk/blender/source/blender/blenkernel/intern/modifier.c   2008-09-09 
16:38:08 UTC (rev 16437)
@@ -793,12 +793,18 @@
if(amd->fit_type == MOD_ARR_FITCURVE && amd->curve_ob) {
Curve *cu = amd->curve_ob->data;
if(cu) {
+   float tmp_mat[3][3];
+   float scale;
+   
+   object_to_mat3(amd->curve_ob, tmp_mat);
+   scale = Mat3ToScalef(tmp_mat);
+   
if(!cu->path) {
cu->flag |= CU_PATH; // needed for path & 
bevlist
makeDispListCurveTypes(amd->curve_ob, 0);
}
if(cu->path)
-   length = cu->path->totdist;
+   length = scale*cu->path->totdist;
}
}
 


___
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 [16436] branches/soc-2008-mxcurioni/source /blender/freestyle: soc-2008-mxcurioni: file cleanup (swig, extgl, pbuffer, python...)

2008-09-09 Thread Maxime Curioni
Revision: 16436
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16436
Author:   mxcurioni
Date: 2008-09-09 17:41:40 +0200 (Tue, 09 Sep 2008)

Log Message:
---
soc-2008-mxcurioni: file cleanup (swig, extgl, pbuffer, python...)

Removed Paths:
-
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/app.pro
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/src.pri

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/geometry/geometry.pro
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/geometry/src.pri
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/image/image.pro
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/image/src.pri

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/extgl.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/extgl.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/pbuffer.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/pbuffer.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/rendering.pro

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/rendering/src.pri

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/scene_graph.pro

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/src.pri
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/src.pri

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/stroke.pro
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/swig/
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/src.pri

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/system.pro
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/src.pri

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/view_map.pro

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/src.pri

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/winged_edge.pro
branches/soc-2008-mxcurioni/source/blender/freestyle/python/

Deleted: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/app.pro
===
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/app.pro 
2008-09-09 15:15:01 UTC (rev 16435)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app/app.pro 
2008-09-09 15:41:40 UTC (rev 16436)
@@ -1,179 +0,0 @@
-# This file should be viewed as a -*- mode: Makefile -*-
-
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-#W A R N I N G ! ! ! #
-# a u t h o r i z e dp e r s o n a lo n l y   #
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-
-include(../Config.pri)
-
-TEMPLATE= app
-TARGET  = $${APPNAME}
-debug: TARGET   = $${TARGET}_d
-VERSION = $${APPVERSION}
-TARGET_VERSION_EXT = $${APPVERSION_MAJ}.$${APPVERSION_MID}
-
-
-
-#
-# CONFIG
-#
-###
-
-CONFIG  *= console qglviewer2 
3ds$${LIB3DS_VERSION_MAJ}.$${LIB3DS_VERSION_MIN} 
python$${PYTHON_VERSION_MAJ}.$${PYTHON_VERSION_MIN} glut
-win32: CONFIG  += embed_manifest_exe 
-QT += xml
-
-exists (../libconfig.pri) {
-  include (../libconfig.pri)
-}
-
-#
-# BUILD DIRECTORIES
-#
-###
-
-BUILD_DIR   = ../../build
-
-OBJECTS_DIR = $${BUILD_DIR}/$${REL_OBJECTS_DIR}
-DESTDIR = $${BUILD_DIR}/$${REL_DESTDIR}
-UI_DIR  = ui_dir
-
-#!win32:PYTHON_DIR_REL= build/$${REL_DESTDIR}/lib/python
-#win32:PYTHON_DIR_REL= build\\$${REL_DESTDIR}\\python
-  
-#
-# LIBS
-#
-###
-
-!static {
-  !win32 {
-lib_bundle {
-  LIBS += -F$${BUILD_DIR}/$${REL_DESTDIR}/lib -framework $${LIB_GEOMETRY} 
-framework $${LIB_IMAGE} \
-   -framework $${LIB_SCENE_GRAPH} -framework $${LIB_SYSTEM} \
-   -framework $${LIB_WINGED_EDGE} -framework $${LIB_VIEW_MAP} \
-   -framework $${LIB_RENDERING} -framework $${LIB_STROKE}
-} else {
-  LIBS *= -L$${BUILD_DIR}/$${REL_DESTDIR}/lib \
- -l$${LIB_SYSTEM} -l$${LIB_IMAGE} -l$${LIB_GEOMETRY} \
- -l$${LIB_SCENE_GRAPH} -l$${LIB_WINGED_EDGE} 
-l$${LIB_VIEW_MAP} \
- -l$${LIB_RENDERING} -l$${LIB_STROKE}
-}
-  }
-
-  win32:LIBS  *= $${DESTDIR}/$${LIB_SCENE_GRAPH}$${LIBVERSION}.lib \
- $${DESTDIR}/$${LIB_SYSTEM}$${LIBVERSION}.lib \
- $${DESTDIR}/$${LIB_WINGED_EDGE}$${LIBVERSION}.lib \
- $${DESTDIR}/$${LIB_VIEW_MAP}$${LIBVERSION}.lib \

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16435] trunk/blender/source/blender:

2008-09-09 Thread Brecht Van Lommel
Revision: 16435
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16435
Author:   blendix
Date: 2008-09-09 17:15:01 +0200 (Tue, 09 Sep 2008)

Log Message:
---

Fix for bug #17402: IK influence blending with pole targets
didn't give smooth transition. Now it blends the result of
IK solving in that case.

Modified Paths:
--
trunk/blender/source/blender/blenkernel/intern/armature.c
trunk/blender/source/blender/blenlib/BLI_arithb.h
trunk/blender/source/blender/blenlib/intern/arithb.c

Modified: trunk/blender/source/blender/blenkernel/intern/armature.c
===
--- trunk/blender/source/blender/blenkernel/intern/armature.c   2008-09-09 
14:16:54 UTC (rev 16434)
+++ trunk/blender/source/blender/blenkernel/intern/armature.c   2008-09-09 
15:15:01 UTC (rev 16435)
@@ -1690,7 +1690,7 @@
 were executed & assigned. Now as last we do an IK pass */
 static void execute_posetree(Object *ob, PoseTree *tree)
 {
-   float R_parmat[3][3];
+   float R_parmat[3][3], identity[3][3];
float iR_parmat[3][3];
float R_bonemat[3][3];
float goalrot[3][3], goalpos[3];
@@ -1699,7 +1699,8 @@
float irest_basis[3][3], full_basis[3][3];
float end_pose[4][4], world_pose[4][4];
float length, basis[3][3], rest_basis[3][3], start[3], *ikstretch=NULL;
-   int a, flag, hasstretch=0;
+   float resultinf=0.0f;
+   int a, flag, hasstretch=0, resultblend=0;
bPoseChannel *pchan;
IK_Segment *seg, *parent, **iktree, *iktarget;
IK_Solver *solver;
@@ -1844,6 +1845,12 @@
Mat4MulMat4(goal, rootmat, goalinv);
VECCOPY(polepos, goal[3]);
poleconstrain= 1;
+
+   /* for pole targets, we blend the result of the 
ik solver
+* instead of the target position, otherwise we 
can't get
+* a smooth transition */
+   resultblend= 1;
+   resultinf= target->con->enforce;

if(data->flag & CONSTRAINT_IK_GETANGLE) {
poleangledata= data;
@@ -1853,7 +1860,7 @@
}
 
/* do we need blending? */
-   if (target->con->enforce!=1.0) {
+   if (!resultblend && target->con->enforce!=1.0) {
float q1[4], q2[4], q[4];
float fac= target->con->enforce;
float mfac= 1.0-fac;
@@ -1903,7 +1910,7 @@
tree->basis_change= MEM_mallocN(sizeof(float[3][3])*tree->totchannel, 
"ik basis change");
if(hasstretch)
ikstretch= MEM_mallocN(sizeof(float)*tree->totchannel, "ik 
stretch");
-   
+   
for(a=0; atotchannel; a++) {
IK_GetBasisChange(iktree[a], tree->basis_change[a]);

@@ -1931,6 +1938,12 @@
VecMulf(tree->basis_change[a][1], stretch);
VecMulf(tree->basis_change[a][2], stretch);
}
+
+   if(resultblend && resultinf!=1.0f) {
+   Mat3One(identity);
+   Mat3BlendMat3(tree->basis_change[a], identity,
+   tree->basis_change[a], resultinf);
+   }

IK_FreeSegment(iktree[a]);
}

Modified: trunk/blender/source/blender/blenlib/BLI_arithb.h
===
--- trunk/blender/source/blender/blenlib/BLI_arithb.h   2008-09-09 14:16:54 UTC 
(rev 16434)
+++ trunk/blender/source/blender/blenlib/BLI_arithb.h   2008-09-09 15:15:01 UTC 
(rev 16435)
@@ -164,6 +164,7 @@
 void Mat3CpyMat4(float m1[][3],float m2[][4]);
 void Mat4CpyMat3(float m1[][4], float m2[][3]); 
 
+void Mat3BlendMat3(float out[][3], float dst[][3], float src[][3], float 
srcweight);
 void Mat4BlendMat4(float out[][4], float dst[][4], float src[][4], float 
srcweight);
 
 float Det2x2(float a,float b,float c, float d);

Modified: trunk/blender/source/blender/blenlib/intern/arithb.c
===
--- trunk/blender/source/blender/blenlib/intern/arithb.c2008-09-09 
14:16:54 UTC (rev 16434)
+++ trunk/blender/source/blender/blenlib/intern/arithb.c2008-09-09 
15:15:01 UTC (rev 16435)
@@ -759,6 +759,28 @@
}
 }
 
+void Mat3BlendMat3(float out[][3], float dst[][3], float src[][3], float 
srcweight)
+{
+   float squat[4], dquat[4], fquat[4];
+   float ssize[3], dsize[3], fsize[4];
+   float rmat[3][3], smat[3][3];
+   
+   Mat3ToQuat(dst, dquat);
+   Mat3ToSize(dst, dsize);
+
+   Mat3ToQuat(src, squat);
+   Mat3ToSize(src, ssize);
+

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16434] trunk/blender/source/blender/ render/intern/source:

2008-09-09 Thread Brecht Van Lommel
Revision: 16434
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16434
Author:   blendix
Date: 2008-09-09 16:16:54 +0200 (Tue, 09 Sep 2008)

Log Message:
---

Fix for bug #17580: crash rendering instanced objects with
halo material attach to the object instead of the mesh.

Also for bug #13489: avoid a crash rendering with invalid
active vcol layer, most likely caused by a bug that was
already fixed.

Modified Paths:
--
trunk/blender/source/blender/render/intern/source/convertblender.c
trunk/blender/source/blender/render/intern/source/renderdatabase.c

Modified: trunk/blender/source/blender/render/intern/source/convertblender.c
===
--- trunk/blender/source/blender/render/intern/source/convertblender.c  
2008-09-09 13:35:38 UTC (rev 16433)
+++ trunk/blender/source/blender/render/intern/source/convertblender.c  
2008-09-09 14:16:54 UTC (rev 16434)
@@ -4578,17 +4578,19 @@
 static int allow_render_dupli_instance(Render *re, DupliObject *dob, Object 
*obd)
 {
ParticleSystem *psys;
-   Material ***material;
+   Material *ma;
short a, *totmaterial;
 
-   /* don't allow objects with halos */
+   /* don't allow objects with halos. we need to have
+* all halo's to sort them globally in advance */
totmaterial= give_totcolp(obd);
-   material= give_matarar(obd);
 
-   if(totmaterial && material) {
-   for(a= 0; a<*totmaterial; a++)
-   if((*material)[a] && (*material)[a]->mode & MA_HALO)
+   if(totmaterial) {
+   for(a= 0; a<*totmaterial; a++) {
+   ma= give_current_material(obd, a);
+   if(ma && (ma->mode & MA_HALO))
return 0;
+   }
}
 
for(psys=obd->particlesystem.first; psys; psys=psys->next)

Modified: trunk/blender/source/blender/render/intern/source/renderdatabase.c
===
--- trunk/blender/source/blender/render/intern/source/renderdatabase.c  
2008-09-09 13:35:38 UTC (rev 16433)
+++ trunk/blender/source/blender/render/intern/source/renderdatabase.c  
2008-09-09 14:16:54 UTC (rev 16434)
@@ -483,16 +483,16 @@
   DerivedMesh which stores the layers is freed */

CustomDataLayer *layer;
-   int numlayers, i, mtfn, mcn;
+   int numtf = 0, numcol = 0, i, mtfn, mcn;
 
if (CustomData_has_layer(data, CD_MTFACE)) {
-   numlayers= CustomData_number_of_layers(data, CD_MTFACE);
-   obr->mtface= MEM_callocN(sizeof(*obr->mtface)*numlayers, 
"mtfacenames");
+   numtf= CustomData_number_of_layers(data, CD_MTFACE);
+   obr->mtface= MEM_callocN(sizeof(*obr->mtface)*numtf, 
"mtfacenames");
}
 
if (CustomData_has_layer(data, CD_MCOL)) {
-   numlayers= CustomData_number_of_layers(data, CD_MCOL);
-   obr->mcol= MEM_callocN(sizeof(*obr->mcol)*numlayers, 
"mcolnames");
+   numcol= CustomData_number_of_layers(data, CD_MCOL);
+   obr->mcol= MEM_callocN(sizeof(*obr->mcol)*numcol, "mcolnames");
}
 
for (i=0, mtfn=0, mcn=0; i < data->totlayer; i++) {
@@ -500,12 +500,12 @@
 
if (layer->type == CD_MTFACE) {
strcpy(obr->mtface[mtfn++], layer->name);
-   obr->actmtface= layer->active_rnd;
+   obr->actmtface= CLAMPIS(layer->active_rnd, 0, numtf);
obr->bakemtface= layer->active;
}
else if (layer->type == CD_MCOL) {
strcpy(obr->mcol[mcn++], layer->name);
-   obr->actmcol= layer->active_rnd;
+   obr->actmcol= CLAMPIS(layer->active_rnd, 0, numcol);
}
}
 }


___
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 [16433] trunk/blender/source/blender/src/ drawipo.c: Bugfix #13592

2008-09-09 Thread Ton Roosendaal
Revision: 16433
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16433
Author:   ton
Date: 2008-09-09 15:35:38 +0200 (Tue, 09 Sep 2008)

Log Message:
---
Bugfix #13592

Sequencer, Time, Sound windows were drawing frame numbers double when
too far zoomed in. 

Modified Paths:
--
trunk/blender/source/blender/src/drawipo.c

Modified: trunk/blender/source/blender/src/drawipo.c
===
--- trunk/blender/source/blender/src/drawipo.c  2008-09-09 12:51:22 UTC (rev 
16432)
+++ trunk/blender/source/blender/src/drawipo.c  2008-09-09 13:35:38 UTC (rev 
16433)
@@ -921,6 +921,13 @@

BIF_ThemeColor(TH_TEXT);
val= ipogrid_startx;
+   
+   if (ELEM3(curarea->spacetype, SPACE_SEQ, SPACE_SOUND, 
SPACE_TIME)) {/* prevents printing twice same frame */
+   while(ipogrid_dx < 0.f) {
+   ipogrid_dx *= 2.0f;
+   dfac*= 2.0f;
+   }
+   }   
while(fac < hor.xmax) {

if(curarea->spacetype==SPACE_OOPS) { 


___
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 [16432] trunk/blender/source/blender/src/ buttons_object.c: Bugfix #13596

2008-09-09 Thread Ton Roosendaal
Revision: 16432
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16432
Author:   ton
Date: 2008-09-09 14:51:22 +0200 (Tue, 09 Sep 2008)

Log Message:
---
Bugfix #13596

Wrong popup on single-user particles, it said "make local".

Modified Paths:
--
trunk/blender/source/blender/src/buttons_object.c

Modified: trunk/blender/source/blender/src/buttons_object.c
===
--- trunk/blender/source/blender/src/buttons_object.c   2008-09-09 12:00:38 UTC 
(rev 16431)
+++ trunk/blender/source/blender/src/buttons_object.c   2008-09-09 12:51:22 UTC 
(rev 16432)
@@ -3001,7 +3001,7 @@
if(ob && (psys=psys_get_current(ob))){
if(psys->part) {
if(psys->part->id.us>1){
-   if(okee("Make local")){
+   if(okee("Make Single User")){

part=psys_copy_settings(psys->part);
part->id.us=1;
psys->part->id.us--;


___
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 [16431] trunk/blender/source/blender/src/ editscreen.c: Bugfix #13653

2008-09-09 Thread Ton Roosendaal
Revision: 16431
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16431
Author:   ton
Date: 2008-09-09 14:00:38 +0200 (Tue, 09 Sep 2008)

Log Message:
---
Bugfix #13653

Autosave disable didn't work.

Note however that a disabled autosave only gets active on saving the 
user settings, and loading blender again. This is a timer that gets 
set on startup. I didn't code a kill timer. :)

Modified Paths:
--
trunk/blender/source/blender/src/editscreen.c

Modified: trunk/blender/source/blender/src/editscreen.c
===
--- trunk/blender/source/blender/src/editscreen.c   2008-09-09 11:40:29 UTC 
(rev 16430)
+++ trunk/blender/source/blender/src/editscreen.c   2008-09-09 12:00:38 UTC 
(rev 16431)
@@ -1023,8 +1023,11 @@
return (G.afbreek==1);
 }
 
-void reset_autosave(void) {
-   window_set_timer(mainwin, U.savetime*60*1000, AUTOSAVE_FILE);
+void reset_autosave(void) 
+{
+   if(U.flag & USER_AUTOSAVE) {
+   window_set_timer(mainwin, U.savetime*60*1000, AUTOSAVE_FILE);
+   }
 }
 
 /*  handlers ** */


___
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 [16430] trunk/blender/source/blender/ render/intern/source/rendercore.c: Bugfix #13675

2008-09-09 Thread Ton Roosendaal
Revision: 16430
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16430
Author:   ton
Date: 2008-09-09 13:40:29 +0200 (Tue, 09 Sep 2008)

Log Message:
---
Bugfix #13675

Edge render made star render disappear. Wrong Z value comparing...
(2 year old bug!)

Modified Paths:
--
trunk/blender/source/blender/render/intern/source/rendercore.c

Modified: trunk/blender/source/blender/render/intern/source/rendercore.c
===
--- trunk/blender/source/blender/render/intern/source/rendercore.c  
2008-09-09 10:58:58 UTC (rev 16429)
+++ trunk/blender/source/blender/render/intern/source/rendercore.c  
2008-09-09 11:40:29 UTC (rev 16430)
@@ -158,7 +158,7 @@
 {

if(har->type & HA_ONLYSKY) {
-   if(zz!=0x7FFF) zz= - 0x7F;
+   if(zz < 0x7FF0) zz= - 0x7F; /* edge render messes 
zvalues */
}
else {
zz= (zz>>8);


___
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 [16429] trunk/blender/source/blender/src/ buttons_logic.c: wasnt using icon buttons correctly

2008-09-09 Thread Campbell Barton
Revision: 16429
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16429
Author:   campbellbarton
Date: 2008-09-09 12:58:58 +0200 (Tue, 09 Sep 2008)

Log Message:
---
wasnt using icon buttons correctly

Modified Paths:
--
trunk/blender/source/blender/src/buttons_logic.c

Modified: trunk/blender/source/blender/src/buttons_logic.c
===
--- trunk/blender/source/blender/src/buttons_logic.c2008-09-09 10:16:09 UTC 
(rev 16428)
+++ trunk/blender/source/blender/src/buttons_logic.c2008-09-09 10:58:58 UTC 
(rev 16429)
@@ -3379,7 +3379,8 @@
uiBlockSetEmboss(block, UI_EMBOSSM);
uiDefIconButBitS(block, TOG, SENS_DEL, 
B_DEL_SENS, ICON_X,  xco, yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Delete 
Sensor");
if (pin)
-   uiDefIconButBitS(block, 
ICONTOG, SENS_PIN, B_REDR, (sens->flag & SENS_PIN) ? 
ICON_PIN_DEHLT:ICON_PIN_HLT, (short)(xco+width-44), yco, 22, 19, &sens->flag, 
0, 0, 0, 0, "Display when not linked to a visible states controller");
+   uiDefIconButBitS(block, 
ICONTOG, SENS_PIN, B_REDR, ICON_PIN_DEHLT, (short)(xco+width-44), yco, 22, 19, 
&sens->flag, 0, 0, 0, 0, "Display when not linked to a visible states 
controller");
+   
uiDefIconButBitS(block, ICONTOG, 
SENS_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, 
&sens->flag, 0, 0, 0, 0, "Sensor settings");
 
ycoo= yco;
@@ -3456,7 +3457,7 @@
uiBlockSetEmboss(block, UI_EMBOSSM);
uiDefIconButBitS(block, TOG, ACT_DEL, 
B_DEL_ACT, ICON_X,xco, yco, 22, 19, &act->flag, 0, 0, 0, 0, "Delete 
Actuator");
if (pin)
-   uiDefIconButBitS(block, 
ICONTOG, ACT_PIN, B_REDR, (act->flag & ACT_PIN) ? ICON_PIN_DEHLT:ICON_PIN_HLT, 
(short)(xco+width-44), yco, 22, 19, &act->flag, 0, 0, 0, 0, "Display when not 
linked to a visible states controller");
+   uiDefIconButBitS(block, 
ICONTOG, ACT_PIN, B_REDR, ICON_PIN_DEHLT, (short)(xco+width-44), yco, 22, 19, 
&act->flag, 0, 0, 0, 0, "Display when not linked to a visible states 
controller");
uiDefIconButBitS(block, ICONTOG, 
ACT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, 
&act->flag, 0, 0, 0, 0, "Display the actuator");

if(act->flag & ACT_SHOW) {


___
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 [16428] trunk/blender/source/blender/nodes /intern/CMP_nodes/CMP_tonemap.c: Bugfix #13837

2008-09-09 Thread Ton Roosendaal
Revision: 16428
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16428
Author:   ton
Date: 2008-09-09 12:16:09 +0200 (Tue, 09 Sep 2008)

Log Message:
---
Bugfix #13837

Tonemap didn't correctly accept any buffer type.
The coder who added this should check this fix! Any node coder maybe...

Modified Paths:
--
trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_tonemap.c

Modified: trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_tonemap.c
===
--- trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_tonemap.c   
2008-09-08 23:39:32 UTC (rev 16427)
+++ trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_tonemap.c   
2008-09-09 10:16:09 UTC (rev 16428)
@@ -130,13 +130,16 @@
if ((img==NULL) || (out[0]->hasoutput==0)) return;
 
if (img->type != CB_RGBA)
-   new = typecheck_compbuf(img, CB_RGBA);
-   else
-   new = dupalloc_compbuf(img);
+   img = typecheck_compbuf(img, CB_RGBA);
+   
+   new = dupalloc_compbuf(img);
 
tonemap(node->storage, new, img);
 
out[0]->data = new;
+   
+   if(img!=in[0]->data)
+   free_compbuf(img);
 }
 
 static void node_composit_init_tonemap(bNode* node)


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs