[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20156] branches/ge_dev: Tree initialization logic: merge overlapping IK chain so that a bone can only be part of one Tree at a time (required for stateful simulation).
Benoit Bolsee
benoit.bolsee at online.be
Mon May 11 18:31:30 CEST 2009
Revision: 20156
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20156
Author: ben2610
Date: 2009-05-11 18:31:30 +0200 (Mon, 11 May 2009)
Log Message:
-----------
Tree initialization logic: merge overlapping IK chain so that a bone can only be part of one Tree at a time (required for stateful simulation).
Modified Paths:
--------------
branches/ge_dev/source/blender/ikplugin/CMakeLists.txt
branches/ge_dev/source/blender/ikplugin/SConscript
branches/ge_dev/source/blender/ikplugin/intern/Makefile
branches/ge_dev/source/blender/ikplugin/intern/itasc_plugin.cpp
Added Paths:
-----------
branches/ge_dev/projectfiles_vc9/blender/ikplugin/
branches/ge_dev/projectfiles_vc9/blender/ikplugin/BIK_ikplugin.vcproj
Added: branches/ge_dev/projectfiles_vc9/blender/ikplugin/BIK_ikplugin.vcproj
===================================================================
--- branches/ge_dev/projectfiles_vc9/blender/ikplugin/BIK_ikplugin.vcproj (rev 0)
+++ branches/ge_dev/projectfiles_vc9/blender/ikplugin/BIK_ikplugin.vcproj 2009-05-11 16:31:30 UTC (rev 20156)
@@ -0,0 +1,213 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="BIK_ikplugin"
+ ProjectGUID="{9951A8C9-84FE-4CFE-9E18-9D01CB8E09F3}"
+ RootNamespace="BRE_ikplugin"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Blender Debug|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_9\source\blender\ikplugin\debug"
+ IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\ikplugin\debug"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\ikplugin;..\..\..\intern\itasc;..\..\..\extern\Eigen2"
+ PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ DefaultCharIsUnsigned="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\ikplugin\debug\BRE_yafray.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\ikplugin\debug\"
+ ObjectFile="..\..\..\..\build\msvc_9\source\blender\ikplugin\debug\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\ikplugin\debug\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1043"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\build\msvc_9\libs\debug\BRE_ikplugin.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Blender Release|Win32"
+ OutputDirectory="..\..\..\..\build\msvc_9\source\blender\ikplugin"
+ IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\ikplugin"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\ikplugin;..\..\..\intern\itasc;..\..\..\extern\Eigen2"
+ PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ DefaultCharIsUnsigned="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\yafray\BIK_ikplugin.pch"
+ AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\ikplugin\"
+ ObjectFile="..\..\..\..\build\msvc_9\source\blender\ikplugin\"
+ ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\ikplugin\"
+ WarningLevel="2"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1043"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="..\..\..\..\build\msvc_9\libs\BIK_ikplugin.lib"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\ikplugin\intern\ikplugin_api.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\ikplugin\intern\iksolver_plugin.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\ikplugin\intern\itasc_plugin.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\..\source\blender\ikplugin\intern\ikplugin_api.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\ikplugin\intern\iksolver_plugin.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\source\blender\ikplugin\intern\itasc_plugin.h"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\..\..\source\blender\ikplugin\BIK_api.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Modified: branches/ge_dev/source/blender/ikplugin/CMakeLists.txt
===================================================================
--- branches/ge_dev/source/blender/ikplugin/CMakeLists.txt 2009-05-11 16:18:38 UTC (rev 20155)
+++ branches/ge_dev/source/blender/ikplugin/CMakeLists.txt 2009-05-11 16:31:30 UTC (rev 20156)
@@ -28,6 +28,7 @@
SET(INC
../../../intern/guardedalloc ../../../intern/iksolver/extern
+ ../../../intern/itasc ../../../extern/Eigen2
../blenlib ../makesdna ../blenkernel ../include ../ikplugin
)
Modified: branches/ge_dev/source/blender/ikplugin/SConscript
===================================================================
--- branches/ge_dev/source/blender/ikplugin/SConscript 2009-05-11 16:18:38 UTC (rev 20155)
+++ branches/ge_dev/source/blender/ikplugin/SConscript 2009-05-11 16:31:30 UTC (rev 20156)
@@ -4,6 +4,6 @@
sources = env.Glob('intern/*.c') + env.Glob('intern/*.cpp')
incs = '#/intern/guardedalloc #/intern/iksolver/extern ../makesdna ../blenlib'
-incs += ' ../blenkernel ../include ../ikplugin'
+incs += ' ../blenkernel ../include ../ikplugin #/intern/itasc #/extern/Eigen2'
env.BlenderLib ( 'bf_ikplugin', sources, Split(incs), [], libtype=['blender','player'], priority=[5, 190] )
Modified: branches/ge_dev/source/blender/ikplugin/intern/Makefile
===================================================================
--- branches/ge_dev/source/blender/ikplugin/intern/Makefile 2009-05-11 16:18:38 UTC (rev 20155)
+++ branches/ge_dev/source/blender/ikplugin/intern/Makefile 2009-05-11 16:31:30 UTC (rev 20156)
@@ -32,11 +32,12 @@
CFLAGS += $(LEVEL_1_C_WARNINGS)
CFLAGS += -I$(NAN_GUARDEDALLOC)/include
-CFLAGS += -I$(NAN_IKSOLVER)/include
CFLAGS += -I../../makesdna
CFLAGS += -I../../blenkernel
CFLAGS += -I../../blenlib
CFLAGS += -I../../include
+CFLAGS += -I../../../intern/itasc
+CFLAGS += -I../../../extern/Eigen2
CFLAGS += -I..
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
Modified: branches/ge_dev/source/blender/ikplugin/intern/itasc_plugin.cpp
===================================================================
--- branches/ge_dev/source/blender/ikplugin/intern/itasc_plugin.cpp 2009-05-11 16:18:38 UTC (rev 20155)
+++ branches/ge_dev/source/blender/ikplugin/intern/itasc_plugin.cpp 2009-05-11 16:31:30 UTC (rev 20156)
@@ -27,14 +27,239 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <stdlib.h>
+#include <string.h>
+#include <vector>
+
+#include "MEM_guardedalloc.h"
+
+#include "BIK_api.h"
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+
+#include "BKE_armature.h"
+#include "BKE_utildefines.h"
+#include "DNA_object_types.h"
+#include "DNA_action_types.h"
+#include "DNA_constraint_types.h"
+#include "DNA_armature_types.h"
+
#include "itasc_plugin.h"
-void itasc_initialize_tree(struct Object *ob, float ctime)
+#include "Armature.hpp"
+
+// Structure pointed by bArmature.ikdata
+// It contains everything needed to simulate the armatures
+// There can be several simulation islands independent to each other
+struct IK_Data
{
+ struct IK_Scene* first;
+};
+
+struct IK_Scene
+{
+ IK_Scene* next;
+ bPoseChannel* chan;
+ iTaSC::Armature* armature;
+ iTaSC::Cache* cache;
+ iTaSC::Scene* scene;
+ std::vector<iTaSC::ConstraintSet*> constraints;
+};
+
+int initialize_scene(Object *ob, bPoseChannel *pchan_tip)
+{
+ bPoseChannel *curchan, *pchan_root=NULL, *chanlist[256], **oldchan;
+ PoseTree *tree;
+ PoseTarget *target;
+ bConstraint *con;
+ bKinematicConstraint *data;
+ int a, segcount= 0, size, newsize, *oldparent, parent, rootbone, treecount;
+
+ /* find IK constraint, and validate it */
+ for(con= (bConstraint *)pchan_tip->constraints.first; con; con= (bConstraint *)con->next) {
+ if(con->type==CONSTRAINT_TYPE_KINEMATIC) {
+ data=(bKinematicConstraint*)con->data;
+ if (data->flag & CONSTRAINT_IK_AUTO) break;
+ if (data->tar==NULL) continue;
+ if (data->tar->type==OB_ARMATURE && data->subtarget[0]==0) continue;
+ if ((con->flag & CONSTRAINT_DISABLE)==0 && (con->enforce!=0.0)) break;
+ }
+ }
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list