Revision: 15339
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15339
Author:   campbellbarton
Date:     2008-06-24 07:02:01 +0200 (Tue, 24 Jun 2008)

Log Message:
-----------
svn  merge  -r15309:HEAD 
https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Note the mail message failed to come through for 15309 which was just a merge 
from trunk.

Modified Paths:
--------------
    branches/apricot/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj
    branches/apricot/release/scripts/DirectX8Exporter.py
    branches/apricot/release/scripts/bpymodules/BPyArmature.py
    branches/apricot/source/blender/blenkernel/intern/action.c
    branches/apricot/source/blender/blenkernel/intern/particle_system.c
    branches/apricot/source/blender/blenlib/BLI_arithb.h
    branches/apricot/source/blender/blenlib/intern/arithb.c
    branches/apricot/source/blender/imbuf/IMB_imbuf_types.h
    branches/apricot/source/blender/imbuf/intern/anim.c
    branches/apricot/source/blender/include/transform.h
    branches/apricot/source/blender/makesdna/DNA_actuator_types.h
    branches/apricot/source/blender/makesdna/DNA_controller_types.h
    branches/apricot/source/blender/makesdna/DNA_sensor_types.h
    branches/apricot/source/blender/python/api2_2x/Mathutils.c
    branches/apricot/source/blender/render/intern/source/pipeline.c
    branches/apricot/source/blender/src/buttons_logic.c
    branches/apricot/source/blender/src/buttons_scene.c
    branches/apricot/source/blender/src/editobject.c
    branches/apricot/source/blender/src/editseq.c
    branches/apricot/source/blender/src/sequence.c
    branches/apricot/source/blender/src/space.c
    branches/apricot/source/blender/src/transform.c
    branches/apricot/source/blender/src/transform_constraints.c
    branches/apricot/source/blender/src/transform_snap.c
    branches/apricot/source/creator/creator.c
    branches/apricot/source/gameengine/Converter/BL_ActionActuator.cpp
    branches/apricot/source/gameengine/Converter/BL_ActionActuator.h
    branches/apricot/source/gameengine/Converter/KX_ConvertActuators.cpp
    branches/apricot/source/gameengine/Converter/KX_ConvertControllers.cpp
    branches/apricot/source/gameengine/Converter/KX_ConvertSensors.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_ISensor.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_ISensor.h
    branches/apricot/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_MouseSensor.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_PropertySensor.cpp
    branches/apricot/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
    branches/apricot/source/gameengine/Ketsji/KX_RaySensor.cpp
    branches/apricot/source/gameengine/Ketsji/KX_TouchSensor.cpp

Added Paths:
-----------
    branches/apricot/release/scripts/animation_bake_constraints.py
    branches/apricot/release/scripts/c3d_import.py
    branches/apricot/source/gameengine/GameLogic/SCA_NANDController.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_NANDController.h
    branches/apricot/source/gameengine/GameLogic/SCA_NORController.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_NORController.h
    branches/apricot/source/gameengine/GameLogic/SCA_XNORController.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_XNORController.h
    branches/apricot/source/gameengine/GameLogic/SCA_XORController.cpp
    branches/apricot/source/gameengine/GameLogic/SCA_XORController.h

Modified: 
branches/apricot/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj
===================================================================
--- branches/apricot/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj 
2008-06-24 00:52:12 UTC (rev 15338)
+++ branches/apricot/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj 
2008-06-24 05:02:01 UTC (rev 15339)
@@ -396,6 +396,12 @@
                                
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_MouseSensor.cpp">
                        </File>
                        <File
+                               
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_NANDController.cpp">
+                       </File>
+                       <File
+                               
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_NORController.cpp">
+                       </File>
+                       <File
                                
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_ORController.cpp">
                        </File>
                        <File
@@ -425,6 +431,12 @@
                        <File
                                
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_TimeEventManager.cpp">
                        </File>
+                       <File
+                               
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_XNORController.cpp">
+                       </File>
+                       <File
+                               
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_XORController.cpp">
+                       </File>
                </Filter>
                <Filter
                        Name="Header Files"
@@ -499,6 +511,12 @@
                                
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_MouseSensor.h">
                        </File>
                        <File
+                               
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_NANDController.h">
+                       </File>
+                       <File
+                               
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_NORController.h">
+                       </File>
+                       <File
                                
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_ORController.h">
                        </File>
                        <File
@@ -528,6 +546,12 @@
                        <File
                                
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_TimeEventManager.h">
                        </File>
+                       <File
+                               
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_XNORController.h">
+                       </File>
+                       <File
+                               
RelativePath="..\..\..\source\gameengine\GameLogic\SCA_XORController.h">
+                       </File>
                </Filter>
        </Files>
        <Globals>

Modified: branches/apricot/release/scripts/DirectX8Exporter.py
===================================================================
--- branches/apricot/release/scripts/DirectX8Exporter.py        2008-06-24 
00:52:12 UTC (rev 15338)
+++ branches/apricot/release/scripts/DirectX8Exporter.py        2008-06-24 
05:02:01 UTC (rev 15339)
@@ -6,9 +6,9 @@
 # Group: 'Export'
 # Tooltip: 'Export to DirectX text file format format for XNA Animation 
Component Library.'
 """
-__author__ = "minahito (original:Arben (Ben) Omari)"
-__url__ = ("blender", "blenderartists.org", "Adjuster's site 
http://sunday-lab.blogspot.com/, Author's site http://www.omariben.too.it";)
-__version__ = "3.0"
+__author__ = "vertex color exporting feature is added by mnemoto 
(original:minahito (original:Arben (Ben) Omari))"
+__url__ = ("blender", "elysiun", "Adjuster's site 
http://sunday-lab.blogspot.com/, Author's site 
http://www.omariben.too.it","Adjuster's site http://ex.homeunix.net/";)
+__version__ = "3.1"
 
 __bpydoc__ = """\
 This script exports a Blender mesh with armature to DirectX 8's text file
@@ -444,6 +444,7 @@
                self.writeMeshMaterialList(obj, mesh, tex)
                self.writeMeshNormals(obj, mesh)
                self.writeMeshTextureCoords(obj, mesh)
+               self.writeMeshVertexColors(obj, mesh)
                self.file.write("  }  // End of the Mesh %s \n" % (obj.name))
                
                                        
@@ -464,6 +465,7 @@
                                self.writeMeshMaterialList(obj, mesh, tex)
                                self.writeMeshNormals(obj, mesh)
                                self.writeMeshTextureCoords(obj, mesh)
+                               self.writeMeshVertexColors(obj, mesh)
                                self.file.write(" }\n")
                                self.file.write("}\n")
                                ind = objs.index(obj)
@@ -1047,6 +1049,32 @@
                                                self.file.write(",\n")
 
                        self.file.write("}  //End of MeshTextureCoords\n")
+
+       #***********************************************
+       #MESH VORTEX COLORS
+       #***********************************************
+       def writeMeshVertexColors(self, name, mesh):
+               if mesh.hasVertexColours():
+                       self.file.write("MeshVertexColors {\n")
+                       #VERTICES NUMBER
+                       numvert = reduce( lambda i,f: len(f)+i, mesh.faces, 0)
+                       self.file.write("%d;\n" % (numvert))
+                       #VERTEX COLORS
+                       
+                       vcounter =0
+                       for f in mesh.faces:
+                               col = f.col
+                               for i,c in enumerate(col):
+                                       # Note vcol alpha has no meaning
+                                       self.file.write("%d;%f;%f;%f;%f;" % 
(vcounter,c.r/255.0, c.g/255.0, c.b/255.0, 1.0)) # c.a/255.0))
+                                       vcounter+=1
+                                       if vcounter == numvert :
+                                               self.file.write(";\n")
+                                       else :
+                                               self.file.write(",\n")
+
+                       self.file.write("}  //End of MeshVertexColors\n")
+
 
#***********************************************#***********************************************#***********************************************
        #***********************************************
        #FRAMES

Copied: branches/apricot/release/scripts/animation_bake_constraints.py (from 
rev 15338, trunk/blender/release/scripts/animation_bake_constraints.py)
===================================================================
--- branches/apricot/release/scripts/animation_bake_constraints.py              
                (rev 0)
+++ branches/apricot/release/scripts/animation_bake_constraints.py      
2008-06-24 05:02:01 UTC (rev 15339)
@@ -0,0 +1,800 @@
+#!BPY
+
+"""
+Name: 'Bake Constraints'
+Blender: 246
+Group: 'Animation'
+Tooltip: 'Bake a Constrained object/rig to IPOs'
+Fillename: 'Bake_Constraint.py'
+"""
+
+__author__ = "Roger Wickes (rogerwickes(at)yahoo.com)"
+__script__ = "Bake Constraints"
+__version__ = "0.6"
+__url__ = ["Communicate problems and errors, 
http://www.blenderartists.com/forum/private.php?do=newpm to PapaSmurf"]
+__email__= ["Roger Wickes, [EMAIL PROTECTED]", "scripts"]
+__bpydoc__ = """\
+
+bake_constraints
+
+This script bakes the real-world LocRot of an object (the net effect of any 
constraints - 
+(Copy, Limit, Track, Follow, - that affect Location, Rotation)
+(usually one constrained to match another's location and/or Tracked to another)
+and creates a clone with a set of Ipo Curves named Ipo<objname>
+These curves control a non-constrained object and thus make it mimic the 
constrained object
+Actions can be then be edited without the need for the drivers/constraining 
objects
+
+Developed for use with MoCap data, where a bone is constrained to point at an 
empty
+moving through space and time. This records the actual locrot of the armature
+so that the motion can be edited, reoriented, scaled, and used as NLA Actions
+
+see also wiki Scripts/Manual/ Sandbox/Animation/Bake_Constraints (tbd)
+
+Usage:<br>
+ - Select the reference Object(s) you want to bake <br>
+ - Set the frame range to bake in the Anim Panel <br>
+ - Set the test code (if you want a self-test) in the RT field in the Anim 
Panel <br>
+               -- Set RT:1 in the Anim panel to create a test armature <br>
+<br>
+ - Run the script    <br>
+ - The clone copy of the object is created and it has an IPO curve assigned to 
it. 
+ - The clone shadows the object by an offset locrot (see usrDelta)
+ - That Ipo has Location and Rotation curves that make the shadow mimic the 
movement of the selected object, 
+                but without using constraints. Bones move identically in 
relation to the armature as the reference object
+
+       
+Version History:
+               0.1: bakes Loc Rot for a constrained object
+               0.2: bakes Loc and Rot for the bones within Armature object
+               0.3: UI for setting options
+               0.3.1 add manual to script library
+               0.4: bake multiple objects
+               0.5: root bone worldspace rotation
+               0.6: re-integration with BPyArmature
+               
+License, Copyright, and Attribution:
+       by Roger WICKES  May 2008, released under Blender Artistic Licence to 
Public Domain
+               feel free to add to any Blender Python Scripts Bundle.
+ Thanks to Jean-Baptiste PERIN, IdeasMan42 (Campbell Barton?), 
Basil_Fawlty/Cage_drei (Andrew Cruse)
+ much lifted/learned from blender.org/documentation/245PytonDoc and wiki
+ some modules based on c3D_Import.py, PoseLib16.py and IPO/Armature code 
examples e.g. camera jitter
+
+Pseudocode (planned versions):
+       Initialize
+       If at least one object is selected
+               For each selected object,
+                       create a shadow object
+                       remove any constraints on the clone
+                       create or reset an ipo curve named like the object
+                       for each frame
+                                set the clone's locrot key based on the 
reference object
+                       if it's an armature,
+                                       create an action (which is an Ipo for 
each bone)
+                                       for each frame of the animation
+                                               for each bone in the armature
+                                                       set the key
+       Else you're a smurf
+
+Test Conditions and Regressions:
+       1. (v0.1) Non-armatures (the cube), with ipo curve and constraints at 
the object level
+       2. armatures, with ipo curve and constraints at the object level
+       3. armatures, with bones that have ipo curves and constraints
+       
+Naming conventions:
+       arm = a specific objec type armature
+       bone = bones that make up the skeleton of an armature
+
+       ob = object, an instance of an object type
+       ebone = edit bone, a bone in edit mode
+       pbone = pose bone, a posed bone in an object
+       tst = testing, self-test routines
+       usr = user-entered or designated stuff  
+
+Pattern Notes (let me know if I've violated any):
+       Bergin Starting,Designing, Programming, Coding
+       Bergin 23 Indent for Structure - I don't like only 2, but the editor is 
set up that way
+       Bergin 26 Be Spacey Not Tabby - personal frustraion here. workaround is 
to Format->convert to whitespace
+       Bergin 27 Consistent Capitalization - except Blender, because I love it.
+       Bergin 28 Name Your Constants - not for those I plan on making variable
+       Python 01 Return Everything - I made this one up, all functions and 
methods end in return
+               even though it is decoration in Python, it helps Python throw 
an indentation error for typing mistakes
+       Wickes 01 Decorate Your Code - for visual appeal and to ease 
maintenance, include separators like ######### 
+               to visually distinquish and separate functions, making it 
quicker to scan through code for methods
+       Wickes 02 Whitespace helps readability - include blanks around = # and 
lines (after def, after return) to make it stand out and pretty
+
+"""
+########################################
+
+import Blender
+from   Blender import *
+from   Blender.Mathutils import *
+import struct
+import string
+import bpy
+import BPyMessages
+import BPyArmature
+# reload(BPyArmature)
+from   BPyArmature import getBakedPoseData
+
+Vector= Blender.Mathutils.Vector
+Euler= Blender.Mathutils.Euler
+Matrix= Blender.Mathutils.Matrix #invert() function at least
+RotationMatrix = Blender.Mathutils.RotationMatrix

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to