soc-2008-mxcurioni: merged changes to revision 14747, cosmetic changes for source/blender/freestyle

This commit is contained in:
Maxime Curioni
2008-05-08 19:16:40 +00:00
365 changed files with 1331 additions and 824 deletions

View File

@@ -75,7 +75,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include" AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\include;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\ketsji;..\..\..\source\gameengine\network;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\Physics\Sumo;..\..\..\source\gameengine\Physics\common;..\..\..\source\gameengine\network\loopbacknetwork;..\..\..\source\gameengine\rasterizer\ras_openglrasterizer;..\..\..\source\gameengine\Physics\Sumo\Fuzzics\include"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID" PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID;WITH_GLEXT"
StringPooling="TRUE" StringPooling="TRUE"
BasicRuntimeChecks="0" BasicRuntimeChecks="0"
RuntimeLibrary="0" RuntimeLibrary="0"

View File

@@ -180,7 +180,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet" AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID" PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID;WITH_GLEXT"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="0" RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="TRUE"
@@ -233,7 +233,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet" AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
PreprocessorDefinitions="JANCODEPANCO;WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG;USE_SUMO_SOLID" PreprocessorDefinitions="JANCODEPANCO;WIN32;_LIB;EXP_PYTHON_EMBEDDING;_DEBUG;USE_SUMO_SOLID;WITH_GLEXT"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
DefaultCharIsUnsigned="TRUE" DefaultCharIsUnsigned="TRUE"
@@ -285,7 +285,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet" AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\soundsystem\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\extern\bullet\include;..\..\..\..\build\msvc_7\extern\solid\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenkernel;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\physics;..\..\..\source\gameengine\rasterizer;..\..\..\source\gameengine\network;..\..\..\source\gameengine\Converter;..\..\..\source\gameengine\gamelogic;..\..\..\source\gameengine\scenegraph;..\..\..\source\gameengine\expressions;..\..\..\source\gameengine\physics\sumo;..\..\..\source\gameengine\physics\dummy;..\..\..\source\gameengine\physics\BlOde;..\..\..\source\gameengine\ketsji\kxnetwork;..\..\..\source\gameengine\physics\common;..\..\..\source\gameengine\physics\sumo\include;..\..\..\source\gameengine\physics\common\dummy;..\..\..\source\gameengine\Rasterizer\RAS_OpenGLRasterizer;..\..\..\source\gameengine\physics\sumo\fuzzics\include;..\..\..\source\sumo\include;..\..\..\source\sumo\fuzzics\include;..\..\..\source\gameengine\physics\bullet"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID" PreprocessorDefinitions="NDEBUG;WIN32;_LIB;USE_SUMO_SOLID;WITH_GLEXT"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="0" RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="TRUE"

View File

@@ -126,7 +126,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\source\kernel\gen_system" AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\source\kernel\gen_system"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB" PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_GLEXT"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="0" RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="TRUE"
@@ -230,7 +230,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\source\kernel\gen_system" AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\source\kernel\gen_system"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB" PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_GLEXT"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
DefaultCharIsUnsigned="TRUE" DefaultCharIsUnsigned="TRUE"
@@ -282,7 +282,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\source\kernel\gen_system" AdditionalIncludeDirectories="..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\build\msvc_7\intern\string\include;..\..\..\source\kernel\gen_system"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB" PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_GLEXT"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="0" RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="TRUE"

View File

@@ -178,7 +178,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer" AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB" PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_GLEXT"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="0" RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="TRUE"
@@ -230,7 +230,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer" AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
PreprocessorDefinitions="_DEBUG,WIN32,_LIB" PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_GLEXT"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
DefaultCharIsUnsigned="TRUE" DefaultCharIsUnsigned="TRUE"
@@ -282,7 +282,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer" AdditionalIncludeDirectories="..\..\..\..\..\build\msvc_7\intern\moto\include;..\..\..\..\..\build\msvc_7\intern\string\include;..\..\..\..\source\kernel\gen_system;..\..\..\..\source\gameengine\Rasterizer"
PreprocessorDefinitions="NDEBUG,WIN32,_LIB" PreprocessorDefinitions="NDEBUG;WIN32;_LIB;WITH_GLEXT"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="0" RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE" EnableFunctionLevelLinking="TRUE"

View File

@@ -17,12 +17,16 @@ def add_mesh_simple(name, verts, edges, faces):
if scn.lib: return if scn.lib: return
ob_act = scn.objects.active ob_act = scn.objects.active
is_editmode = EditMode()
cursor = GetCursorPos() cursor = GetCursorPos()
quat = None
if is_editmode or Blender.Get('add_view_align'): # Aligning seems odd for editmode, but blender does it, oh well
try: quat = Blender.Mathutils.Quaternion(GetViewQuat()) try: quat = Blender.Mathutils.Quaternion(GetViewQuat())
except: quat = None except: pass
# Exist editmode for non mesh types # Exist editmode for non mesh types
if ob_act and ob_act.type != 'Mesh' and EditMode(): if ob_act and ob_act.type != 'Mesh' and is_editmode:
EditMode(0) EditMode(0)
# We are in mesh editmode # We are in mesh editmode
@@ -66,6 +70,7 @@ def add_mesh_simple(name, verts, edges, faces):
me.edges.extend(edges) me.edges.extend(edges)
me.faces.extend(faces) me.faces.extend(faces)
if is_editmode or Blender.Get('add_editmode'):
EditMode(1) EditMode(1)
else: else:
@@ -91,6 +96,7 @@ def add_mesh_simple(name, verts, edges, faces):
ob_act.loc = cursor ob_act.loc = cursor
if is_editmode or Blender.Get('add_editmode'):
EditMode(1) EditMode(1)

View File

@@ -6,6 +6,7 @@
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# DXF Reader v0.9 by Ed Blake (AKA Kitsu) # DXF Reader v0.9 by Ed Blake (AKA Kitsu)
# 2008.05.08 modif.def convert() by Remigiusz Fiedler (AKA migius)
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# ***** BEGIN GPL LICENSE BLOCK ***** # ***** BEGIN GPL LICENSE BLOCK *****
# #
@@ -138,9 +139,9 @@ def convert(code, value):
strings = 0-9, 100, 102, 300-309, 410-419, 430-439, 470-479, 999, 1000-1009 strings = 0-9, 100, 102, 300-309, 410-419, 430-439, 470-479, 999, 1000-1009
""" """
if 59 < code < 80 or 169 < code < 180 or 269 < code < 290 or 369 < code < 390 or 399 < code < 410 or 1059 < code < 1071: if 59 < code < 80 or 169 < code < 180 or 269 < code < 290 or 369 < code < 390 or 399 < code < 410 or 1059 < code < 1071:
value = int(value) value = int(float(value))
elif 89 < code < 100 or 419 < code < 430 or 439 < code < 460 or code == 1071: elif 89 < code < 100 or 419 < code < 430 or 439 < code < 460 or code == 1071:
value = long(value) value = long(float(value))
elif 9 < code < 60 or 109 < code < 150 or 209 < code < 240 or 459 < code < 470 or 1009 < code < 1060: elif 9 < code < 60 or 109 < code < 150 or 209 < code < 240 or 459 < code < 470 or 1009 < code < 1060:
value = float(value) value = float(value)
elif code == 105 or 309 < code < 380 or 389 < code < 400: elif code == 105 or 309 < code < 380 or 389 < code < 400:
@@ -378,5 +379,3 @@ if __name__ == "__main__":
drawing = readDXF(filename) drawing = readDXF(filename)
for item in drawing.entities.data: for item in drawing.entities.data:
print item print item

View File

@@ -57,6 +57,8 @@ import Blender
from Blender import Object, Lamp, Draw, Image, Text, sys, Mesh from Blender import Object, Lamp, Draw, Image, Text, sys, Mesh
from Blender.Scene import Render from Blender.Scene import Render
import math import math
import BPyObject
import BPyMesh
# #
DEG2RAD=0.017453292519943295 DEG2RAD=0.017453292519943295
@@ -68,14 +70,14 @@ MATWORLD= Blender.Mathutils.RotationMatrix(-90, 4, 'x')
filename = Blender.Get('filename') filename = Blender.Get('filename')
_safeOverwrite = True _safeOverwrite = True
ARG=''
extension = '' extension = ''
########################################################## ##########################################################
# Functions for writing output file # Functions for writing output file
########################################################## ##########################################################
class VRML2Export: class x3d_class:
def __init__(self, filename): def __init__(self, filename):
#--- public you can change these --- #--- public you can change these ---
@@ -101,7 +103,18 @@ class VRML2Export:
self.meshNames={} # dictionary of meshNames self.meshNames={} # dictionary of meshNames
self.indentLevel=0 # keeps track of current indenting self.indentLevel=0 # keeps track of current indenting
self.filename=filename self.filename=filename
self.file = open(filename, "w") self.file = None
if filename.lower().endswith('.x3dz'):
try:
import gzip
self.file = gzip.open(filename, "w")
except:
print "failed to import compression modules, exporting uncompressed"
self.filename = filename[:-1] # remove trailing z
if self.file == None:
self.file = open(self.filename, "w")
self.bNav=0 self.bNav=0
self.nodeID=0 self.nodeID=0
self.namesReserved=[ "Anchor","Appearance","Arc2D","ArcClose2D","AudioClip","Background","Billboard", self.namesReserved=[ "Anchor","Appearance","Arc2D","ArcClose2D","AudioClip","Background","Billboard",
@@ -169,7 +182,7 @@ class VRML2Export:
nameinline = nameinline+".x3d" nameinline = nameinline+".x3d"
self.file.write("url=\"%s\" />" % nameinline) self.file.write("url=\"%s\" />" % nameinline)
self.file.write("\n\n") self.file.write("\n\n")
'''
def writeScript(self): def writeScript(self):
textEditor = Blender.Text.Get() textEditor = Blender.Text.Get()
@@ -190,15 +203,17 @@ class VRML2Export:
for j in xrange(nalllines): for j in xrange(nalllines):
self.writeIndented(alllines[j] + "\n") self.writeIndented(alllines[j] + "\n")
self.writeIndented("\n") self.writeIndented("\n")
'''
def writeViewpoint(self, ob, scene): def writeViewpoint(self, ob, mat, scene):
context = scene.render context = scene.render
ratio = float(context.imageSizeY())/float(context.imageSizeX()) ratio = float(context.imageSizeY())/float(context.imageSizeX())
lens = (360* (math.atan(ratio *16 / ob.data.getLens()) / math.pi))*(math.pi/180) lens = (360* (math.atan(ratio *16 / ob.data.getLens()) / math.pi))*(math.pi/180)
lens = min(lens, math.pi) lens = min(lens, math.pi)
# get the camera location, subtract 90 degress from X to orient like X3D does # get the camera location, subtract 90 degress from X to orient like X3D does
mat = ob.matrixWorld # mat = ob.matrixWorld - mat is now passed!
loc = self.rotatePointForVRML(mat.translationPart()) loc = self.rotatePointForVRML(mat.translationPart())
rot = mat.toEuler() rot = mat.toEuler()
rot = (((rot[0]-90)*DEG2RAD), rot[1]*DEG2RAD, rot[2]*DEG2RAD) rot = (((rot[0]-90)*DEG2RAD), rot[1]*DEG2RAD, rot[2]*DEG2RAD)
@@ -229,23 +244,11 @@ class VRML2Export:
self.file.write("visibilityRange=\"%s\" />\n\n" % round(mparam[2],self.cp)) self.file.write("visibilityRange=\"%s\" />\n\n" % round(mparam[2],self.cp))
else: else:
return return
'''
def writeNavigationInfo(self, scene): def writeNavigationInfo(self, scene):
allObj = [] self.file.write('<NavigationInfo headlight="FALSE" visibilityLimit="0.0" type=\'"EXAMINE","ANY"\' avatarSize="0.25, 1.75, 0.75" />\n')
allObj = list(scene.objects)
headlight = "true" def writeSpotLight(self, ob, mtx, lamp, world):
vislimit = 0.0
for ob in allObj:
objType=ob.type
if objType == "Camera":
vislimit = ob.data.clipEnd
elif objType == "Lamp":
headlight = "false"
self.file.write("<NavigationInfo headlight=\"%s\" " % headlight)
self.file.write("visibilityLimit=\"%s\" " % (round(vislimit,self.cp)))
self.file.write("type=\"EXAMINE\", \"ANY\" avatarSize=\"0.25, 1.75, 0.75\" />\n\n")
'''
def writeSpotLight(self, ob, lamp, world):
safeName = self.cleanStr(ob.name) safeName = self.cleanStr(ob.name)
if world: if world:
ambi = world.amb ambi = world.amb
@@ -259,12 +262,14 @@ class VRML2Export:
beamWidth=((lamp.spotSize*math.pi)/180.0)*.37; beamWidth=((lamp.spotSize*math.pi)/180.0)*.37;
cutOffAngle=beamWidth*1.3 cutOffAngle=beamWidth*1.3
dx,dy,dz=self.computeDirection(ob) dx,dy,dz=self.computeDirection(mtx)
# note -dx seems to equal om[3][0] # note -dx seems to equal om[3][0]
# note -dz seems to equal om[3][1] # note -dz seems to equal om[3][1]
# note dy seems to equal om[3][2] # note dy seems to equal om[3][2]
location=(ob.matrixWorld*MATWORLD).translationPart() #location=(ob.matrixWorld*MATWORLD).translationPart() # now passed
location=(mtx*MATWORLD).translationPart()
radius = lamp.dist*math.cos(beamWidth) radius = lamp.dist*math.cos(beamWidth)
self.file.write("<SpotLight DEF=\"%s\" " % safeName) self.file.write("<SpotLight DEF=\"%s\" " % safeName)
self.file.write("radius=\"%s\" " % (round(radius,self.cp))) self.file.write("radius=\"%s\" " % (round(radius,self.cp)))
@@ -277,7 +282,7 @@ class VRML2Export:
self.file.write("location=\"%s %s %s\" />\n\n" % (round(location[0],3), round(location[1],3), round(location[2],3))) self.file.write("location=\"%s %s %s\" />\n\n" % (round(location[0],3), round(location[1],3), round(location[2],3)))
def writeDirectionalLight(self, ob, lamp, world): def writeDirectionalLight(self, ob, mtx, lamp, world):
safeName = self.cleanStr(ob.name) safeName = self.cleanStr(ob.name)
if world: if world:
ambi = world.amb ambi = world.amb
@@ -287,14 +292,14 @@ class VRML2Export:
ambientIntensity = 0 ambientIntensity = 0
intensity=min(lamp.energy/1.75,1.0) intensity=min(lamp.energy/1.75,1.0)
(dx,dy,dz)=self.computeDirection(ob) (dx,dy,dz)=self.computeDirection(mtx)
self.file.write("<DirectionalLight DEF=\"%s\" " % safeName) self.file.write("<DirectionalLight DEF=\"%s\" " % safeName)
self.file.write("ambientIntensity=\"%s\" " % (round(ambientIntensity,self.cp))) self.file.write("ambientIntensity=\"%s\" " % (round(ambientIntensity,self.cp)))
self.file.write("color=\"%s %s %s\" " % (round(lamp.col[0],self.cp), round(lamp.col[1],self.cp), round(lamp.col[2],self.cp))) self.file.write("color=\"%s %s %s\" " % (round(lamp.col[0],self.cp), round(lamp.col[1],self.cp), round(lamp.col[2],self.cp)))
self.file.write("intensity=\"%s\" " % (round(intensity,self.cp))) self.file.write("intensity=\"%s\" " % (round(intensity,self.cp)))
self.file.write("direction=\"%s %s %s\" />\n\n" % (round(dx,4),round(dy,4),round(dz,4))) self.file.write("direction=\"%s %s %s\" />\n\n" % (round(dx,4),round(dy,4),round(dz,4)))
def writePointLight(self, ob, lamp, world): def writePointLight(self, ob, mtx, lamp, world):
safeName = self.cleanStr(ob.name) safeName = self.cleanStr(ob.name)
if world: if world:
ambi = world.amb ambi = world.amb
@@ -303,29 +308,30 @@ class VRML2Export:
ambi = 0 ambi = 0
ambientIntensity = 0 ambientIntensity = 0
location=(ob.matrixWorld*MATWORLD).translationPart() # location=(ob.matrixWorld*MATWORLD).translationPart() # now passed
intensity=min(lamp.energy/1.75,1.0) location= (mtx*MATWORLD).translationPart()
radius = lamp.dist
self.file.write("<PointLight DEF=\"%s\" " % safeName) self.file.write("<PointLight DEF=\"%s\" " % safeName)
self.file.write("ambientIntensity=\"%s\" " % (round(ambientIntensity,self.cp))) self.file.write("ambientIntensity=\"%s\" " % (round(ambientIntensity,self.cp)))
self.file.write("color=\"%s %s %s\" " % (round(lamp.col[0],self.cp), round(lamp.col[1],self.cp), round(lamp.col[2],self.cp))) self.file.write("color=\"%s %s %s\" " % (round(lamp.col[0],self.cp), round(lamp.col[1],self.cp), round(lamp.col[2],self.cp)))
self.file.write("intensity=\"%s\" " % (round(intensity,self.cp))) self.file.write("intensity=\"%s\" " % (round( min(lamp.energy/1.75,1.0) ,self.cp)))
self.file.write("radius=\"%s\" " % radius ) self.file.write("radius=\"%s\" " % lamp.dist )
self.file.write("location=\"%s %s %s\" />\n\n" % (round(location[0],3), round(location[1],3), round(location[2],3))) self.file.write("location=\"%s %s %s\" />\n\n" % (round(location[0],3), round(location[1],3), round(location[2],3)))
'''
def writeNode(self, ob): def writeNode(self, ob, mtx):
obname=str(ob.name) obname=str(ob.name)
if obname in self.namesStandard: if obname in self.namesStandard:
return return
else: else:
dx,dy,dz = self.computeDirection(ob) dx,dy,dz = self.computeDirection(mtx)
location=(ob.matrixWorld*MATWORLD).translationPart() # location=(ob.matrixWorld*MATWORLD).translationPart()
location=(mtx*MATWORLD).translationPart()
self.writeIndented("<%s\n" % obname,1) self.writeIndented("<%s\n" % obname,1)
self.writeIndented("# direction %s %s %s\n" % (round(dx,3),round(dy,3),round(dz,3))) self.writeIndented("direction=\"%s %s %s\"\n" % (round(dx,3),round(dy,3),round(dz,3)))
self.writeIndented("# location %s %s %s\n" % (round(location[0],3), round(location[1],3), round(location[2],3))) self.writeIndented("location=\"%s %s %s\"\n" % (round(location[0],3), round(location[1],3), round(location[2],3)))
self.writeIndented("/>\n",-1) self.writeIndented("/>\n",-1)
self.writeIndented("\n") self.writeIndented("\n")
'''
def secureName(self, name): def secureName(self, name):
name = name + str(self.nodeID) name = name + str(self.nodeID)
self.nodeID=self.nodeID+1 self.nodeID=self.nodeID+1
@@ -345,13 +351,13 @@ class VRML2Export:
newname = name newname = name
return "%s" % (newname) return "%s" % (newname)
def writeIndexedFaceSet(self, ob, world, normals = 0): def writeIndexedFaceSet(self, ob, mesh, mtx, world, EXPORT_TRI = False):
imageMap={} # set of used images imageMap={} # set of used images
sided={} # 'one':cnt , 'two':cnt sided={} # 'one':cnt , 'two':cnt
vColors={} # 'multi':1 vColors={} # 'multi':1
meshName = self.cleanStr(ob.name) meshName = self.cleanStr(ob.name)
mesh=ob.getData(mesh=1)
meshME = self.cleanStr(mesh.name) meshME = self.cleanStr(ob.getData(mesh=1).name) # We dont care if its the mesh name or not
if len(mesh.faces) == 0: return if len(mesh.faces) == 0: return
mode = 0 mode = 0
if mesh.faceUV: if mesh.faceUV:
@@ -382,7 +388,8 @@ class VRML2Export:
else: else:
bTwoSided=0 bTwoSided=0
mtx = ob.matrixWorld * MATWORLD # mtx = ob.matrixWorld * MATWORLD # mtx is now passed
mtx = mtx * MATWORLD
loc= mtx.translationPart() loc= mtx.translationPart()
sca= mtx.scalePart() sca= mtx.scalePart()
@@ -456,12 +463,12 @@ class VRML2Export:
elif hasImageTexture == 1: elif hasImageTexture == 1:
self.writeTextureCoordinates(mesh) self.writeTextureCoordinates(mesh)
#--- output coordinates #--- output coordinates
self.writeCoordinates(ob, mesh, meshName) self.writeCoordinates(ob, mesh, meshName, EXPORT_TRI)
self.writingcoords = 1 self.writingcoords = 1
self.writingtexture = 1 self.writingtexture = 1
self.writingcolor = 1 self.writingcolor = 1
self.writeCoordinates(ob, mesh, meshName) self.writeCoordinates(ob, mesh, meshName, EXPORT_TRI)
#--- output textureCoordinates if UV texture used #--- output textureCoordinates if UV texture used
if mesh.faceUV: if mesh.faceUV:
@@ -498,17 +505,23 @@ class VRML2Export:
self.file.write("\n") self.file.write("\n")
def writeCoordinates(self, ob, mesh, meshName): def writeCoordinates(self, ob, mesh, meshName, EXPORT_TRI = False):
# create vertex list and pre rotate -90 degrees X for VRML # create vertex list and pre rotate -90 degrees X for VRML
if self.writingcoords == 0: if self.writingcoords == 0:
self.file.write('coordIndex="') self.file.write('coordIndex="')
for face in mesh.faces: for face in mesh.faces:
fv = face.v fv = face.v
if len(face)==4:
self.file.write("%i %i %i %i -1, " % (fv[0].index, fv[1].index, fv[2].index, fv[3].index)) if len(face)==3:
else:
self.file.write("%i %i %i -1, " % (fv[0].index, fv[1].index, fv[2].index)) self.file.write("%i %i %i -1, " % (fv[0].index, fv[1].index, fv[2].index))
else:
if EXPORT_TRI:
self.file.write("%i %i %i -1, " % (fv[0].index, fv[1].index, fv[2].index))
self.file.write("%i %i %i -1, " % (fv[0].index, fv[2].index, fv[3].index))
else:
self.file.write("%i %i %i %i -1, " % (fv[0].index, fv[1].index, fv[2].index, fv[3].index))
self.file.write("\">\n") self.file.write("\">\n")
else: else:
#-- vertices #-- vertices
@@ -679,43 +692,74 @@ class VRML2Export:
# export routine # export routine
########################################################## ##########################################################
def export(self, scene, world, alltextures): def export(self, scene, world, alltextures,\
EXPORT_APPLY_MODIFIERS = False,\
EXPORT_TRI= False,\
):
print "Info: starting X3D export to " + self.filename + "..." print "Info: starting X3D export to " + self.filename + "..."
self.writeHeader() self.writeHeader()
self.writeScript() # self.writeScript()
# self.writeNavigationInfo(scene) # This seems to position me in some strange area I cant see the model (with BS Contact) - Campbell self.writeNavigationInfo(scene)
self.writeBackground(world, alltextures) self.writeBackground(world, alltextures)
self.writeFog(world) self.writeFog(world)
self.proto = 0 self.proto = 0
for ob in scene.objects.context:
# COPIED FROM OBJ EXPORTER
if EXPORT_APPLY_MODIFIERS:
temp_mesh_name = '~tmp-mesh'
# Get the container mesh. - used for applying modifiers and non mesh objects.
containerMesh = meshName = tempMesh = None
for meshName in Blender.NMesh.GetNames():
if meshName.startswith(temp_mesh_name):
tempMesh = Mesh.Get(meshName)
if not tempMesh.users:
containerMesh = tempMesh
if not containerMesh:
containerMesh = Mesh.New(temp_mesh_name)
# --------------------------
for ob_main in scene.objects.context:
for ob, ob_mat in BPyObject.getDerivedObjects(ob_main):
objType=ob.type objType=ob.type
objName=ob.name objName=ob.name
self.matonly = 0 self.matonly = 0
if objType == "Camera": if objType == "Camera":
self.writeViewpoint(ob, scene) self.writeViewpoint(ob, ob_mat, scene)
elif objType == "Mesh": elif objType in ("Mesh", "Curve", "Surf", "Text") :
self.writeIndexedFaceSet(ob, world, normals = 0) if EXPORT_APPLY_MODIFIERS or objType != 'Mesh':
me= BPyMesh.getMeshFromObject(ob, containerMesh, EXPORT_APPLY_MODIFIERS, False, scene)
else:
me = ob.getData(mesh=1)
self.writeIndexedFaceSet(ob, me, ob_mat, world, EXPORT_TRI = EXPORT_TRI)
elif objType == "Lamp": elif objType == "Lamp":
data= ob.data data= ob.data
datatype=data.type datatype=data.type
if datatype == Lamp.Types.Lamp: if datatype == Lamp.Types.Lamp:
self.writePointLight(ob, data, world) self.writePointLight(ob, ob_mat, data, world)
elif datatype == Lamp.Types.Spot: elif datatype == Lamp.Types.Spot:
self.writeSpotLight(ob, data, world) self.writeSpotLight(ob, ob_mat, data, world)
elif datatype == Lamp.Types.Sun: elif datatype == Lamp.Types.Sun:
self.writeDirectionalLight(ob, data, world) self.writeDirectionalLight(ob, ob_mat, data, world)
else: else:
self.writeDirectionalLight(ob, data, world) self.writeDirectionalLight(ob, ob_mat, data, world)
elif objType == "Empty" and objName != "Empty": # do you think x3d could document what to do with dummy objects?
self.writeNode(ob) #elif objType == "Empty" and objName != "Empty":
# self.writeNode(ob, ob_mat)
else: else:
#print "Info: Ignoring [%s], object type [%s] not handle yet" % (object.name,object.getType) #print "Info: Ignoring [%s], object type [%s] not handle yet" % (object.name,object.getType)
print "" pass
if ARG != 'selected':
self.writeScript()
self.file.write("\n</Scene>\n</X3D>") self.file.write("\n</Scene>\n</X3D>")
if EXPORT_APPLY_MODIFIERS:
if containerMesh:
containerMesh.verts = None
self.cleanup() self.cleanup()
########################################################## ##########################################################
@@ -837,10 +881,10 @@ class VRML2Export:
round(c.b/255.0,self.cp)) round(c.b/255.0,self.cp))
return s return s
def computeDirection(self, ob): def computeDirection(self, mtx):
x,y,z=(0,-1.0,0) # point down x,y,z=(0,-1.0,0) # point down
ax,ay,az = (ob.matrixWorld*MATWORLD).toEuler() ax,ay,az = (mtx*MATWORLD).toEuler()
ax *= DEG2RAD ax *= DEG2RAD
ay *= DEG2RAD ay *= DEG2RAD
@@ -931,7 +975,36 @@ class VRML2Export:
# Callbacks, needed before Main # Callbacks, needed before Main
########################################################## ##########################################################
def select_file(filename): def x3d_export(filename, \
EXPORT_APPLY_MODIFIERS= False,\
EXPORT_TRI= False,\
EXPORT_GZIP= False,\
):
if EXPORT_GZIP:
if not filename.lower().endswith('.x3dz'):
filename = '.'.join(filename.split('.')[:-1]) + '.x3dz'
else:
if not filename.lower().endswith('.x3d'):
filename = '.'.join(filename.split('.')[:-1]) + '.x3d'
scene = Blender.Scene.GetCurrent()
world = scene.world
alltextures = Blender.Texture.Get()
wrlexport=x3d_class(filename)
wrlexport.export(\
scene,\
world,\
alltextures,\
\
EXPORT_APPLY_MODIFIERS = EXPORT_APPLY_MODIFIERS,\
EXPORT_TRI = EXPORT_TRI,\
)
def x3d_export_ui(filename):
if not filename.endswith(extension): if not filename.endswith(extension):
filename += extension filename += extension
#if _safeOverwrite and sys.exists(filename): #if _safeOverwrite and sys.exists(filename):
@@ -939,18 +1012,40 @@ def select_file(filename):
#if(result != 1): #if(result != 1):
# return # return
scene = Blender.Scene.GetCurrent() # Get user options
world = scene.world EXPORT_APPLY_MODIFIERS = Draw.Create(1)
alltextures = Blender.Texture.Get() EXPORT_TRI = Draw.Create(0)
EXPORT_GZIP = Draw.Create( filename.lower().endswith('.x3dz') )
# Get USER Options
pup_block = [\
('Apply Modifiers', EXPORT_APPLY_MODIFIERS, 'Use transformed mesh data from each object.'),\
('Triangulate', EXPORT_TRI, 'Triangulate quads.'),\
('Compress', EXPORT_GZIP, 'GZip the resulting file, requires a full python install'),\
]
if not Draw.PupBlock('Export...', pup_block):
return
Blender.Window.EditMode(0)
Blender.Window.WaitCursor(1)
x3d_export(filename,\
EXPORT_APPLY_MODIFIERS = EXPORT_APPLY_MODIFIERS.val,\
EXPORT_TRI = EXPORT_TRI.val,\
EXPORT_GZIP = EXPORT_GZIP.val\
)
Blender.Window.WaitCursor(0)
wrlexport=VRML2Export(filename)
wrlexport.export(scene, world, alltextures)
######################################################### #########################################################
# main routine # main routine
######################################################### #########################################################
if __name__ == '__main__': if __name__ == '__main__':
Blender.Window.FileSelector(select_file,"Export X3D", Blender.Get('filename').replace('.blend', '.x3d')) Blender.Window.FileSelector(x3d_export_ui,"Export X3D", Blender.Get('filename').replace('.blend', '.x3d'))
# select_file('/shared/bed1.x3d')

View File

@@ -315,7 +315,6 @@ ifeq ($(WITH_BF_BLENDERPLAYER), true)
endif endif
ifeq ($(WITH_BF_WEBPLUGIN), true) ifeq ($(WITH_BF_WEBPLUGIN), true)
ifneq ($(NAN_NO_PLUGIN), true)
BINTARGETS += plugin BINTARGETS += plugin
ifeq ($(OS),linux) ifeq ($(OS),linux)
ifeq ($(CPU),i386) ifeq ($(CPU),i386)
@@ -323,7 +322,6 @@ ifeq ($(WITH_BF_WEBPLUGIN), true)
endif endif
endif endif
endif endif
endif
ifeq ($(OS),solaris) ifeq ($(OS),solaris)
PULIB += $(NAN_ZLIB)/lib/libz.a PULIB += $(NAN_ZLIB)/lib/libz.a

View File

@@ -355,7 +355,7 @@ TimeMarker *get_frame_marker(int frame){return 0;};
/* editseq.c */ /* editseq.c */
Sequence *get_forground_frame_seq(int frame){return 0;}; Sequence *get_forground_frame_seq(int frame){return 0;};
void set_last_seq(Sequence *seq){return 0;}; void set_last_seq(Sequence *seq){};
/* modifier.c stub */ /* modifier.c stub */
void harmonic_coordinates_bind(struct MeshDeformModifierData *mmd, void harmonic_coordinates_bind(struct MeshDeformModifierData *mmd,

View File

@@ -493,7 +493,7 @@ static float get_actionstrip_frame(bActionStrip *strip, float cframe, int invert
repeat = (strip->flag & ACTSTRIP_USESTRIDE) ? (1.0f) : (strip->repeat); repeat = (strip->flag & ACTSTRIP_USESTRIDE) ? (1.0f) : (strip->repeat);
if (strip->scale == 0.0f) strip->scale= 1.0f; if (strip->scale == 0.0f) strip->scale= 1.0f;
scale = abs(strip->scale); /* scale must be positive (for now) */ scale = fabs(strip->scale); /* scale must be positive (for now) */
actlength = strip->actend-strip->actstart; actlength = strip->actend-strip->actstart;
if (actlength == 0.0f) actlength = 1.0f; if (actlength == 0.0f) actlength = 1.0f;

View File

@@ -383,7 +383,8 @@ static void setup_app_data(BlendFileData *bfd, char *filename)
/* special cases, override loaded flags: */ /* special cases, override loaded flags: */
if (G.f & G_DEBUG) bfd->globalf |= G_DEBUG; if (G.f & G_DEBUG) bfd->globalf |= G_DEBUG;
else bfd->globalf &= ~G_DEBUG; else bfd->globalf &= ~G_DEBUG;
if (!(G.f & G_DOSCRIPTLINKS)) bfd->globalf &= ~G_DOSCRIPTLINKS;
if ((U.flag & USER_DONT_DOSCRIPTLINKS)) bfd->globalf &= ~G_DOSCRIPTLINKS;
G.f= bfd->globalf; G.f= bfd->globalf;

View File

@@ -1104,9 +1104,9 @@ static void vectomat (float *vec, float *target_up, short axis, short upflag, sh
/* identity matrix - don't do anything if the two axes are the same */ /* identity matrix - don't do anything if the two axes are the same */
else { else {
m[0][0]= m[1][1]= m[2][2]= 1.0; m[0][0]= m[1][1]= m[2][2]= 1.0;
m[0][1]= m[0][2]= m[0][3]= 0.0; m[0][1]= m[0][2]= 0.0;
m[1][0]= m[1][2]= m[1][3]= 0.0; m[1][0]= m[1][2]= 0.0;
m[2][0]= m[2][1]= m[2][3]= 0.0; m[2][0]= m[2][1]= 0.0;
} }
} }

View File

@@ -1917,6 +1917,9 @@ void set_icu_vars(IpoCurve *icu)
icu->ymin= 0.0; icu->ymin= 0.0;
break; break;
case PART_CLUMP: case PART_CLUMP:
icu->ymin= -1.0;
icu->ymax= 1.0;
break;
case PART_DRAG: case PART_DRAG:
case PART_DAMP: case PART_DAMP:
case PART_LENGTH: case PART_LENGTH:
@@ -1926,6 +1929,7 @@ void set_icu_vars(IpoCurve *icu)
case PART_KINK_SHAPE: case PART_KINK_SHAPE:
icu->ymin= -0.999; icu->ymin= -0.999;
icu->ymax= 0.999; icu->ymax= 0.999;
break;
} }
} }
else if(icu->blocktype==ID_CO) { else if(icu->blocktype==ID_CO) {

View File

@@ -1506,6 +1506,7 @@ static DerivedMesh *mirrorModifier_applyModifier(
result = mirrorModifier__doMirror(mmd, ob, derivedData, 0); result = mirrorModifier__doMirror(mmd, ob, derivedData, 0);
if(result != derivedData)
CDDM_calc_normals(result); CDDM_calc_normals(result);
return result; return result;
@@ -5514,6 +5515,7 @@ static void particleSystemModifier_deformVerts(
DerivedMesh *dm = derivedData; DerivedMesh *dm = derivedData;
ParticleSystemModifierData *psmd= (ParticleSystemModifierData*) md; ParticleSystemModifierData *psmd= (ParticleSystemModifierData*) md;
ParticleSystem * psys=0; ParticleSystem * psys=0;
Mesh *me;
int needsFree=0; int needsFree=0;
if(ob->particlesystem.first) if(ob->particlesystem.first)
@@ -5521,6 +5523,14 @@ static void particleSystemModifier_deformVerts(
else else
return; return;
/* multires check */
if(ob->type == OB_MESH) {
me= (Mesh*)ob->data;
if(me->mr && me->mr->current != 1)
modifier_setError(md,
"Particles only supported on first multires level.");
}
if(!psys_check_enabled(ob, psys)) if(!psys_check_enabled(ob, psys))
return; return;

View File

@@ -152,6 +152,49 @@ char *psys_menu_string(Object *ob, int for_sb)
return str; return str;
} }
/* we allocate path cache memory in chunks instead of a big continguous
* chunk, windows' memory allocater fails to find big blocks of memory often */
#define PATH_CACHE_BUF_SIZE 1024
static ParticleCacheKey **psys_alloc_path_cache_buffers(ListBase *bufs, int tot, int steps)
{
LinkData *buf;
ParticleCacheKey **cache;
int i, totkey, totbufkey;
tot= MAX2(tot, 1);
totkey = 0;
cache = MEM_callocN(tot*sizeof(void*), "PathCacheArray");
while(totkey < tot) {
totbufkey= MIN2(tot-totkey, PATH_CACHE_BUF_SIZE);
buf= MEM_callocN(sizeof(LinkData), "PathCacheLinkData");
buf->data= MEM_callocN(sizeof(ParticleCacheKey)*totbufkey*steps, "ParticleCacheKey");
for(i=0; i<totbufkey; i++)
cache[totkey+i] = ((ParticleCacheKey*)buf->data) + i*steps;
totkey += totbufkey;
BLI_addtail(bufs, buf);
}
return cache;
}
static void psys_free_path_cache_buffers(ParticleCacheKey **cache, ListBase *bufs)
{
LinkData *buf;
if(cache)
MEM_freeN(cache);
for(buf= bufs->first; buf; buf=buf->next)
MEM_freeN(buf->data);
BLI_freelistN(bufs);
}
/************************************************/ /************************************************/
/* Getting stuff */ /* Getting stuff */
/************************************************/ /************************************************/
@@ -250,10 +293,17 @@ int psys_in_edit_mode(ParticleSystem *psys)
int psys_check_enabled(Object *ob, ParticleSystem *psys) int psys_check_enabled(Object *ob, ParticleSystem *psys)
{ {
ParticleSystemModifierData *psmd; ParticleSystemModifierData *psmd;
Mesh *me;
if(psys->flag & PSYS_DISABLED) if(psys->flag & PSYS_DISABLED)
return 0; return 0;
if(ob->type == OB_MESH) {
me= (Mesh*)ob->data;
if(me->mr && me->mr->current != 1)
return 0;
}
psmd= psys_get_modifier(ob, psys); psmd= psys_get_modifier(ob, psys);
if(psys->renderdata) { if(psys->renderdata) {
if(!(psmd->modifier.mode & eModifierMode_Render)) if(!(psmd->modifier.mode & eModifierMode_Render))
@@ -299,27 +349,16 @@ void free_keyed_keys(ParticleSystem *psys)
} }
void free_child_path_cache(ParticleSystem *psys) void free_child_path_cache(ParticleSystem *psys)
{ {
if(psys->childcache){ psys_free_path_cache_buffers(psys->childcache, &psys->childcachebufs);
if(psys->childcache[0])
MEM_freeN(psys->childcache[0]);
MEM_freeN(psys->childcache);
psys->childcache = NULL; psys->childcache = NULL;
psys->totchildcache = 0; psys->totchildcache = 0;
} }
}
void psys_free_path_cache(ParticleSystem *psys) void psys_free_path_cache(ParticleSystem *psys)
{ {
if(psys->pathcache){ psys_free_path_cache_buffers(psys->pathcache, &psys->pathcachebufs);
if(psys->pathcache[0])
MEM_freeN(psys->pathcache[0]);
MEM_freeN(psys->pathcache);
psys->pathcache= NULL; psys->pathcache= NULL;
psys->totcached= 0; psys->totcached= 0;
}
free_child_path_cache(psys); free_child_path_cache(psys);
} }
void psys_free_children(ParticleSystem *psys) void psys_free_children(ParticleSystem *psys)
@@ -2250,10 +2289,9 @@ void psys_cache_child_paths(Object *ob, ParticleSystem *psys, float cfra, int ed
ParticleSettings *part = psys->part; ParticleSettings *part = psys->part;
ParticleThread *pthreads; ParticleThread *pthreads;
ParticleThreadContext *ctx; ParticleThreadContext *ctx;
ParticleCacheKey **cache, *tcache; ParticleCacheKey **cache;
ListBase threads; ListBase threads;
int i, totchild, totparent, totthread; int i, totchild, totparent, totthread;
unsigned long totchildstep;
pthreads= psys_threads_create(ob, psys); pthreads= psys_threads_create(ob, psys);
@@ -2272,13 +2310,7 @@ void psys_cache_child_paths(Object *ob, ParticleSystem *psys, float cfra, int ed
else { else {
/* clear out old and create new empty path cache */ /* clear out old and create new empty path cache */
free_child_path_cache(psys); free_child_path_cache(psys);
psys->childcache= psys_alloc_path_cache_buffers(&psys->childcachebufs, totchild, ctx->steps+1);
cache = psys->childcache = MEM_callocN(totchild*sizeof(void *), "Child path cache array");
totchildstep= totchild*(ctx->steps + 1);
tcache = MEM_callocN(totchildstep*sizeof(ParticleCacheKey), "Child path cache");
for(i=0; i<totchild; i++)
cache[i] = tcache + i * (ctx->steps + 1);
psys->totchildcache = totchild; psys->totchildcache = totchild;
} }
@@ -2365,12 +2397,8 @@ void psys_cache_paths(Object *ob, ParticleSystem *psys, float cfra, int editupda
else { else {
/* clear out old and create new empty path cache */ /* clear out old and create new empty path cache */
psys_free_path_cache(psys); psys_free_path_cache(psys);
cache= psys_alloc_path_cache_buffers(&psys->pathcachebufs, totpart, steps+1);
/* allocate cache array for fast access and set pointers to contiguous mem block */ psys->pathcache= cache;
cache = psys->pathcache = MEM_callocN(MAX2(1, totpart) * sizeof(void *), "Path cache array");
cache[0] = MEM_callocN(totpart * (steps + 1) * sizeof(ParticleCacheKey), "Path cache");
for(i=1; i<totpart; i++)
cache[i] = cache[0] + i * (steps + 1);
} }
if(edit==NULL && psys->soft && psys->softflag & OB_SB_ENABLE) if(edit==NULL && psys->soft && psys->softflag & OB_SB_ENABLE)

View File

@@ -4763,6 +4763,9 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier
psys_update_path_cache(ob,psmd,psys,framenr); psys_update_path_cache(ob,psmd,psys,framenr);
} }
cache->simframe= framenr;
cache->flag |= PTCACHE_SIMULATION_VALID;
return; return;
} }
else if(ob->id.lib || (cache->flag & PTCACHE_BAKED)) { else if(ob->id.lib || (cache->flag & PTCACHE_BAKED)) {

View File

@@ -2615,6 +2615,8 @@ static void direct_link_particlesystems(FileData *fd, ListBase *particles)
psys->edit = 0; psys->edit = 0;
psys->pathcache = 0; psys->pathcache = 0;
psys->childcache = 0; psys->childcache = 0;
psys->pathcachebufs.first = psys->pathcachebufs.last = 0;
psys->childcachebufs.first = psys->childcachebufs.last = 0;
psys->reactevents.first = psys->reactevents.last = 0; psys->reactevents.first = psys->reactevents.last = 0;
psys->pointcache= newdataadr(fd, psys->pointcache); psys->pointcache= newdataadr(fd, psys->pointcache);

View File

Before

Width:  |  Height:  |  Size: 400 B

After

Width:  |  Height:  |  Size: 400 B

View File

Before

Width:  |  Height:  |  Size: 813 B

After

Width:  |  Height:  |  Size: 813 B

View File

Before

Width:  |  Height:  |  Size: 776 B

After

Width:  |  Height:  |  Size: 776 B

View File

Before

Width:  |  Height:  |  Size: 773 B

After

Width:  |  Height:  |  Size: 773 B

View File

Before

Width:  |  Height:  |  Size: 782 B

After

Width:  |  Height:  |  Size: 782 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 896 B

After

Width:  |  Height:  |  Size: 896 B

View File

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 406 B

View File

Before

Width:  |  Height:  |  Size: 402 B

After

Width:  |  Height:  |  Size: 402 B

View File

Before

Width:  |  Height:  |  Size: 1015 B

After

Width:  |  Height:  |  Size: 1015 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 910 B

After

Width:  |  Height:  |  Size: 910 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 769 B

After

Width:  |  Height:  |  Size: 769 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 375 B

After

Width:  |  Height:  |  Size: 375 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Some files were not shown because too many files have changed in this diff Show More