Initial commit

This commit is contained in:
Jakub Skokan 2016-07-12 08:47:20 +02:00
commit d6c7f1ae87
95 changed files with 31975 additions and 0 deletions

1
extra/Makefile.am Normal file
View file

@ -0,0 +1 @@
EXTRA_DIST = *.py *.blend

304
extra/Makefile.in Normal file
View file

@ -0,0 +1,304 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = extra
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_CONFIG = @SDL_CONFIG@
SDL_LIBS = @SDL_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
EXTRA_DIST = *.py *.blend
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu extra/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu extra/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
uninstall-info-am:
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic distclean \
distclean-generic distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

BIN
extra/keyboard.blend Normal file

Binary file not shown.

198
extra/m3dexport.py Normal file
View file

@ -0,0 +1,198 @@
#!BPY
"""
Name: 'm3d mesh exporter'
Blender: 237
Group: 'Export'
Tooltip: 'Export meshes to .xml'
"""
import Blender
from Blender import NMesh, Object, Scene, Lamp
import math
from math import sin, cos
import os
global indentation
indentation = 0
def indent(file):
if indentation < 1:
return
for i in range(indentation):
file.write("\t");
def setIndent(d):
global indentation
indentation += d
def toQuaternion(fRoll, fYaw, fPitch):
fSinPitch = sin(fPitch*0.5)
fCosPitch = cos(fPitch*0.5)
fSinYaw = sin(fYaw*0.5)
fCosYaw = cos(fYaw*0.5)
fSinRoll = sin(fRoll*0.5)
fCosRoll = cos(fRoll*0.5)
fCosPitchCosYaw = fCosPitch*fCosYaw
fSinPitchSinYaw = fSinPitch*fSinYaw
X = fSinRoll * fCosPitchCosYaw - fCosRoll * fSinPitchSinYaw
Y = fCosRoll * fSinPitch * fCosYaw + fSinRoll * fCosPitch * fSinYaw
Z = fCosRoll * fCosPitch * fSinYaw - fSinRoll * fSinPitch * fCosYaw
W = fCosRoll * fCosPitchCosYaw + fSinRoll * fSinPitchSinYaw
return [W, X, Y, Z]
def export(obj, file):
print "Export %s\n" %obj.getName()
locX = obj.LocX
locY = obj.LocY
locZ = obj.LocZ
rotX = obj.RotX
rotY = obj.RotY
rotZ = obj.RotZ
sizeX = obj.SizeX
sizeY = obj.SizeY
sizeZ = obj.SizeZ
parent = obj.getParent()
while parent:
locX -= parent.LocX
locY -= parent.LocY
locZ -= parent.LocZ
rotX -= parent.RotX
rotY -= parent.RotY
rotZ -= parent.RotZ
sizeX /= parent.SizeX
sizeY /= parent.SizeY
sizeZ /= parent.SizeZ
parent = parent.getParent()
loc = [locX, locY, locZ]
size = [sizeX, sizeY, sizeZ]
quat = toQuaternion(rotX, -rotY, rotZ)
if obj.getType() == "Mesh":
exportMesh(obj, file, loc, size, quat)
def exportMaterial(mat, file):
indent(file)
file.write("<Material name=\"%s\" " % mat.getName())
col = mat.getRGBCol()
file.write("diffuseR=\"%1.4f\" diffuseG=\"%1.4f\" diffuseB=\"%1.4f\" " % (col[0], col[1], col[2]))
amb = mat.getAmb()
col[0] *= amb
col[1] *= amb
col[2] *= amb
file.write("ambientR=\"%1.4f\" ambientG=\"%1.4f\" ambientB=\"%1.4f\" " % (col[0], col[1], col[2]))
col = mat.getSpecCol()
file.write("specularR=\"%1.4f\" specularG=\"%1.4f\" specularB=\"%1.4f\" " % (col[0], col[1], col[2]))
file.write("shininess=\"%1.4f\"" % (mat.getSpec()))
file.write("/>\n")
def exportTexture(tex, file):
indent(file)
file.write("<Texture name=\"%s\" units=\"1\">\n" % tex.getName())
indent(file)
file.write("\t<Image filename=\"%s\"/>\n" % os.path.basename(tex.getFilename()))
indent(file)
file.write("</Texture>\n")
def exportMesh(obj, file, loc, size, quat):
mesh = NMesh.GetRawFromObject(obj.getName())
indent(file)
file.write("<Mesh name=\"%s\" numVertices=\"%d\" numFaces=\"%d\" " %(obj.getName(), len(mesh.verts), len(mesh.faces)))
file.write("x=\"%3.5f\" y=\"%3.5f\" z=\"%3.5f\" " %(loc[0], loc[2], -loc[1]))
file.write("sx=\"%3.5f\" sy=\"%3.5f\" sz=\"%3.5f\" " %(size[0], size[1], size[2]))
file.write("qw=\"%3.5f\" qx=\"%3.5f\" qy=\"%3.5f\" qz=\"%3.5f\"" %(quat[0], quat[1], quat[2], quat[3]))
file.write(">\n")
setIndent(1)
for mat in mesh.materials:
exportMaterial(mat, file)
if len(mesh.materials) > 0:
file.write("\n")
textures = []
if mesh.hasFaceUV():
for face in mesh.faces:
if not face.image:
continue;
if textures.count(face.image) == 0:
textures.append(face.image)
for tex in textures:
exportTexture(tex, file)
if len(textures) > 0:
file.write("\n")
for vert in mesh.verts:
indent(file)
file.write("<Vertex x=\"%3.5f\" y=\"%3.5f\" z=\"%3.5f\" " %(vert.co[0], vert.co[2], -vert.co[1]))
file.write("nx=\"%3.5f\" ny=\"%3.5f\" nz=\"%3.5f\"/>\n" %(vert.no[0], vert.no[2], -vert.no[1]))
file.write("\n")
for face in mesh.faces:
indent(file)
file.write("<Face smooth=\"%d\" " %face.smooth)
file.write("nx=\"%3.5f\" ny=\"%3.5f\" nz=\"%3.5f\" " %(face.normal[0], face.normal[2], -face.normal[1]))
if face.image:
file.write("texture=\"%d\" " %(textures.index(face.image)))
else:
file.write("texture=\"-1\" ")
mat = face.materialIndex
if mat >= len(mesh.materials):
mat = -1
file.write("material=\"%d\">\n" %(mat))
setIndent(1)
for i in range(3):
indent(file);
file.write("<Vertex index=\"%d\" " %face.v[i].index )
if mesh.hasFaceUV() and face.image:
file.write("u=\"%1.3f\" v=\"%1.3f\"" %(face.uv[i][0], 1.0-face.uv[i][1]))
file.write("/>\n")
setIndent(-1)
# file.write(" vertex1=\"%d\" vertex2=\"%d\" vertex3=\"%d\"/>\n" %(face.v[0].index, face.v[1].index, face.v[2].index))
indent(file)
file.write("</Face>\n")
Object.GetSelected().remove(obj)
for child in Object.GetSelected():
if child.parent == obj:
export(child, file)
Object.GetSelected().remove(child)
setIndent(-1)
indent(file)
file.write("</Mesh>\n\n")
def main():
selected = Object.GetSelected()
if len(selected) == 0:
print "Nothing selected"
return
for obj in selected:
if obj.getType() != "Mesh":
continue
file = open("%s.xml" % (obj.getName()), "w")
file.write("<? xml version=\"1.0\" ?>\n")
export(obj, file)
file.close()
main()

BIN
extra/mittaristo.blend Normal file

Binary file not shown.

BIN
extra/planet.blend Normal file

Binary file not shown.

BIN
extra/racer.blend Normal file

Binary file not shown.

BIN
extra/ring.blend Normal file

Binary file not shown.

BIN
extra/signal.blend Normal file

Binary file not shown.