Skip to content

Commit

Permalink
Updates osgexport files and build script
Browse files Browse the repository at this point in the history
  • Loading branch information
AurL committed Jan 14, 2016
1 parent 67c81d0 commit f2d1764
Show file tree
Hide file tree
Showing 64 changed files with 242 additions and 20 deletions.
6 changes: 3 additions & 3 deletions blender-2.5/CMakeLists.txt → CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ SET(CPACK_SOURCE_PACKAGE_FILE_NAME "osgexporter-${OSGEXPORTER_VERSION}")
SET(BLENDER "blender" CACHE FILEPATH "(Absolute) path to blender binary")
SET(EXPORTER "${PROJECT_SOURCE_DIR}/exporter" CACHE FILEPATH "(Absolute) path to exporter modules")
OPTION(TEST "Enable test" OFF)
OPTION(BUILD_DATA "Build data" ON)
OPTION(BUILD_DATA "Build samples" ON)

IF(TEST)
ENABLE_TESTING()
SET(BUILD_DATA ON)
ENDIF(TEST)


ADD_SUBDIRECTORY(data)
ADD_SUBDIRECTORY(samples)
IF(TEST)
ADD_SUBDIRECTORY(test/)
ADD_SUBDIRECTORY(tests/)
ENDIF(TEST)
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cd blender-2.5/exporter/
version=$(cat osg/__init__.py | grep '"version":' | sed 's/.*(\([0-9]*\),\([0-9]*\),\([0-9]*\).*/\1.\2.\3/' )
cd exporter/
version=$(cat osg/__init__.py | grep '"version":' | sed -e 's/[a-zA-Z "():]*//g' -e 's/,$//g' -e 's/,/-/g')
appname=osgexport-$version
echo $appname
zip -r ../build/${appname}.zip . -i \*.py
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
# Cedric Pinson <[email protected]>


SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/data/avatar/avatar.blend )
SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/samples/avatar/avatar.blend )
SET ( DATA_TARGET avatar )
BUILD_DATA()
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
# Cedric Pinson <[email protected]>


SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/data/bees/bees.blend )
SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/samples/bees/bees.blend )
SET ( DATA_TARGET bees )
BUILD_DATA()
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
# Cedric Pinson <[email protected]>


SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/data/bignathan/bigcharacter.blend )
SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/samples/bignathan/bigcharacter.blend )
SET ( DATA_TARGET bignathan )
BUILD_DATA()
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
# Authors:
# Cedric Pinson <[email protected]>

SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/data/car/BMW-MikePan2.blend )
SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/samples/car/BMW-MikePan2.blend )
SET ( DATA_TARGET car )
BUILD_DATA()
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
# Cedric Pinson <[email protected]>


SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/data/cycles/cycles.blend )
SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/samples/cycles/cycles.blend )
SET ( DATA_TARGET cycles )
BUILD_DATA()
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
# Cedric Pinson <[email protected]>


SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/data/example/example.blend)
SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/samples/example/example.blend)
SET ( DATA_TARGET example )
BUILD_DATA()
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
# Cedric Pinson <[email protected]>


SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/data/ipos/simple_anim.blend )
SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/samples/ipos/simple_anim.blend )
SET ( DATA_TARGET anim )
BUILD_DATA()
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
# Cedric Pinson <[email protected]>


SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/data/lights/lights.blend )
SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/samples/lights/lights.blend )
SET ( DATA_TARGET lights )
BUILD_DATA()
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
# Cedric Pinson <[email protected]>


SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/data/multimaterial/floor.blend )
SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/samples/multimaterial/floor.blend )
SET ( DATA_TARGET floor )
BUILD_DATA()
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
# Cedric Pinson <[email protected]>


SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/data/nathan/character.blend )
SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/samples/nathan/character.blend )
SET ( DATA_TARGET nathan )
BUILD_DATA()
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
# Cedric Pinson <[email protected]>


SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/data/normalmap/barrel.blend )
SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/samples/normalmap/barrel.blend )
SET ( DATA_TARGET barrel )
BUILD_DATA()
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
# Authors:
# Cedric Pinson <[email protected]>

SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/data/robot/robot.blend )
SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/samples/robot/robot.blend )
SET ( DATA_TARGET robot )
BUILD_DATA()
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
# Cedric Pinson <[email protected]>


SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/data/walker/Jansens.blend )
SET ( DATA_SOURCE ${PROJECT_SOURCE_DIR}/samples/walker/Jansens.blend )
SET ( DATA_TARGET Jansens )
BUILD_DATA()
File renamed without changes.
2 changes: 1 addition & 1 deletion blender-2.5/test/CMakeLists.txt → tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ CONFIGURE_FILE(
IMMEDIATE @ONLY
)
ADD_TEST(NAME "test-material"
COMMAND ${BLENDER} --background "${CMAKE_CURRENT_SOURCE_DIR}/../data/multimaterial/floor.blend" --python "${CMAKE_CURRENT_BINARY_DIR}/test-material.py")
COMMAND ${BLENDER} --background "${CMAKE_CURRENT_SOURCE_DIR}/../samples/multimaterial/floor.blend" --python "${CMAKE_CURRENT_BINARY_DIR}/test-material.py")

CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/test-shadernode.py.in
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions tests/scene.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
obj ParentBone

Parsing object 'ParentBone' of type ARMATURE
processing Armature ParentBone

Parsing object 'Triangle' of type MESH
exporting object Triangle
mesh_object is Plane
214 changes: 214 additions & 0 deletions tests/scene.osgt
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
#Ascii Scene
#Version 92
#Generator osgexport 0.14.2

osg::Group {
UniqueID 21
Name "Root"
Children 1 {
osgAnimation::Skeleton {
UniqueID 0
Name "ParentBone"
UpdateCallback TRUE {
osgAnimation::UpdateSkeleton {
UniqueID 1
}
}
Children 1 {
osgAnimation::Bone {
UniqueID 2
Name "Bone"
DataVariance DYNAMIC
UpdateCallback TRUE {
osgAnimation::UpdateBone {
UniqueID 3
Name "Bone"
StackedTransforms 4 {
osgAnimation::StackedMatrixElement {
UniqueID 4
Name "bindmatrix"
Matrix {
1.00000 0.00000 0.00000 0.00000
0.00000 0.00000 1.00000 0.00000
0.00000 -1.00000 0.00000 0.00000
0.00000 0.00000 0.00000 1.00000
}
}
osgAnimation::StackedTranslateElement {
UniqueID 5
Name "translate"
Translate 0.00000 0.00000 0.00000
}
osgAnimation::StackedQuaternionElement {
UniqueID 6
Name "quaternion"
Quaternion 0.00000 0.00000 0.00000 1.00000
}
osgAnimation::StackedScaleElement {
UniqueID 7
Name "scale"
Scale 1.00000 1.00000 1.00000
}
}
}
}
Children 1 {
osgAnimation::Bone {
UniqueID 8
Name "Bone.002"
DataVariance DYNAMIC
UpdateCallback TRUE {
osgAnimation::UpdateBone {
UniqueID 9
Name "Bone.002"
StackedTransforms 4 {
osgAnimation::StackedMatrixElement {
UniqueID 10
Name "bindmatrix"
Matrix {
1.00000 0.00000 0.00000 0.00000
0.00000 1.00000 0.00000 0.00000
0.00000 -0.00000 1.00000 0.00000
0.00000 1.00000 0.00000 1.00000
}
}
osgAnimation::StackedTranslateElement {
UniqueID 11
Name "translate"
Translate 0.00000 0.00000 0.00000
}
osgAnimation::StackedQuaternionElement {
UniqueID 12
Name "quaternion"
Quaternion 0.00000 0.00000 0.00000 1.00000
}
osgAnimation::StackedScaleElement {
UniqueID 13
Name "scale"
Scale 1.00000 1.00000 1.00000
}
}
}
}
Children 1 {
osg::MatrixTransform {
UniqueID 15
Name "Triangle"
Children 1 {
osg::Geode {
UniqueID 19
Name "GeodePlane"
Drawables 1 {
osgAnimation::RigGeometry {
UniqueID 18
Name "Triangle"
PrimitiveSetList 1 {
DrawElementsUByte GL_TRIANGLES 3 {
0 1 2
}
}
VertexData {
Array TRUE ArrayID 0 Vec3fArray 3 {
1.00000 -1.00000 1.45249
1.00000 1.00000 1.45249
-1.00000 1.00000 1.45249
}
Indices FALSE
Binding BIND_PER_VERTEX
Normalize 0
}
NormalData {
Array TRUE ArrayID 1 Vec3fArray 3 {
-0.00000 0.00000 1.00000
-0.00000 0.00000 1.00000
-0.00000 0.00000 1.00000
}
Indices FALSE
Binding BIND_PER_VERTEX
Normalize 0
}
InfluenceMap 2 {
VertexInfluence "Bone" 3 {
0 0.41718
0 0.41718
1 0.35746
}
VertexInfluence "Bone.002" 4 {
0 0.58282
0 0.58282
1 0.64254
2 0.99334
}
}
SourceGeometry TRUE {
osg::Geometry {
UniqueID 17
Name "Triangle"
PrimitiveSetList 1 {
DrawElementsUByte GL_TRIANGLES 3 {
0 1 2
}
}
VertexData {
Array TRUE ArrayID 0
Indices FALSE
Binding BIND_PER_VERTEX
Normalize 0
}
NormalData {
Array TRUE ArrayID 1
Indices FALSE
Binding BIND_PER_VERTEX
Normalize 0
}
}
}
}
}
}
}
Matrix {
1.00000 0.00000 0.00000 0.00000
0.00000 -0.00000 -1.00000 0.00000
0.00000 1.00000 -0.00000 0.00000
0.91055 -0.60056 0.96109 1.00000
}
}
}
Matrix {
1.00000 0.00000 0.00000 0.00000
0.00000 1.00000 0.00000 0.00000
0.00000 0.00000 1.00000 0.00000
0.00000 0.00000 0.00000 1.00000
}
InvBindMatrixInSkeletonSpace {
1.00000 -0.00000 0.00000 -0.00000
-0.00000 -0.00000 -1.00000 0.00000
0.00000 1.00000 -0.00000 -0.00000
-0.00000 -1.00000 0.00000 1.00000
}
}
}
Matrix {
1.00000 0.00000 0.00000 0.00000
0.00000 1.00000 0.00000 0.00000
0.00000 0.00000 1.00000 0.00000
0.00000 0.00000 0.00000 1.00000
}
InvBindMatrixInSkeletonSpace {
1.00000 -0.00000 0.00000 -0.00000
-0.00000 0.00000 -1.00000 0.00000
0.00000 1.00000 0.00000 -0.00000
-0.00000 0.00000 -0.00000 1.00000
}
}
}
Matrix {
1.00000 0.00000 0.00000 0.00000
0.00000 1.00000 0.00000 0.00000
0.00000 0.00000 1.00000 0.00000
-0.27407 -0.15860 -0.39944 1.00000
}
}
}
}
Binary file added tests/shaderNode.blend
Binary file not shown.
Binary file added tests/shaderNode.blend1
Binary file not shown.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Exporter(unittest.TestCase):
self.config = osgconf.Config()
self.config.defaultattr('scene', bpy.context.scene)
has_action = blender_object.animation_data and hasAction(blender_object)
has_constraints = hasConstraints(blender_object)
has_constraints = hasSolidConstraints(blender_object)
has_morph = hasShapeKeysAnimation(blender_object)
action2animation = BlenderAnimationToAnimation(object=blender_object,
config=self.config,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f2d1764

Please sign in to comment.