soc-2008-mxcurioni: merge-repair with trunk rev 15456

This commit is contained in:
Maxime Curioni
2008-07-06 19:53:32 +00:00
144 changed files with 5417 additions and 4036 deletions

View File

@@ -38,7 +38,10 @@
#include <stdarg.h>
/* mmap exception */
#if defined(AMIGA) || defined(__BeOS) || defined(WIN32)
#if defined(AMIGA) || defined(__BeOS)
#elif defined(WIN32)
#include <sys/types.h>
#include "mmap_win.h"
#else
#include <sys/types.h>
#include <sys/mman.h>
@@ -289,7 +292,7 @@ void *MEM_callocN(unsigned int len, const char *str)
/* note; mmap returns zero'd memory */
void *MEM_mapallocN(unsigned int len, const char *str)
{
#if defined(AMIGA) || defined(__BeOS) || defined(WIN32)
#if defined(AMIGA) || defined(__BeOS)
return MEM_callocN(len, str);
#else
MemHead *memh;
@@ -586,7 +589,7 @@ static void rem_memblock(MemHead *memh)
totblock--;
mem_in_use -= memh->len;
#if defined(AMIGA) || defined(__BeOS) || defined(WIN32)
#if defined(AMIGA) || defined(__BeOS)
free(memh);
#else

View File

@@ -251,6 +251,9 @@ ECHO Done
<File
RelativePath="..\..\intern\mallocn.c">
</File>
<File
RelativePath="..\..\intern\mmap_win.c">
</File>
</Filter>
<Filter
Name="Header Files"
@@ -261,6 +264,13 @@ ECHO Done
<File
RelativePath="..\..\MEM_guardedalloc.h">
</File>
<File
RelativePath="..\..\mmap_win.h">
</File>
</Filter>
<Filter
Name="intern"
Filter="">
</Filter>
</Filter>
</Files>

View File

@@ -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", "elysiun", "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 @@ class xExport:
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 @@ class xExport:
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 @@ template SkinWeights {\n\
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

View File

@@ -8,7 +8,7 @@ Tip: 'Export selected meshes to AC3D (.ac) format'
"""
__author__ = "Willian P. Germano"
__url__ = ("blender", "elysiun", "AC3D's homepage, http://www.ac3d.org",
__url__ = ("blender", "blenderartists.org", "AC3D's homepage, http://www.ac3d.org",
"PLib 3d gaming lib, http://plib.sf.net")
__version__ = "2.44 2007-05-05"

View File

@@ -8,7 +8,7 @@ Tip: 'Import an AC3D (.ac) file.'
"""
__author__ = "Willian P. Germano"
__url__ = ("blender", "elysiun", "AC3D's homepage, http://www.ac3d.org",
__url__ = ("blender", "blenderartists.org", "AC3D's homepage, http://www.ac3d.org",
"PLib 3d gaming lib, http://plib.sf.net")
__version__ = "2.43.1 2007-02-21"

View File

@@ -8,7 +8,7 @@ Tip: 'Bevel selected faces, edges, and vertices'
"""
__author__ = "Loic BERTHE"
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "2.0"
__bpydoc__ = """\

View File

@@ -10,7 +10,7 @@ Tooltip: 'View and edit available scripts configuration data'
__author__ = "Willian P. Germano"
__version__ = "0.1 2005/04/14"
__email__ = ('scripts', 'Author, wgermano:ig*com*br')
__url__ = ('blender', 'elysiun')
__url__ = ('blender', 'blenderartists.org')
__bpydoc__ ="""\
This script can be used to view and edit configuration data stored

View File

@@ -1,14 +1,14 @@
#!BPY
"""
Name: 'Interactive Console'
Blender: 237
Name: 'Interactive Python Console'
Blender: 245
Group: 'System'
Tooltip: 'Interactive Python Console'
"""
__author__ = "Campbell Barton AKA Ideasman"
__url__ = ["Author's homepage, http://members.iinet.net.au/~cpbarton/ideasman/", "blender", "elysiun", "Official Python site, http://www.python.org"]
__author__ = "Campbell Barton aka ideasman42"
__url__ = ["www.blender.org", "blenderartists.org", "www.python.org"]
__bpydoc__ = """\
This is an interactive console, similar to Python's own command line interpreter. Since it is embedded in Blender, it has access to all Blender Python modules.
@@ -26,8 +26,6 @@ Usage:<br>
- Ctrl + Enter: auto compleate based on variable names and modules loaded -- multiple choices popup a menu;<br>
- Shift + Enter: multiline functions -- delays executing code until only Enter is pressed.
"""
__author__ = "Campbell Barton AKA Ideasman"
__url__ = ["http://members.iinet.net.au/~cpbarton/ideasman/", "blender", "elysiun"]
# --------------------------------------------------------------------------
# ***** BEGIN GPL LICENSE BLOCK *****

View File

@@ -8,7 +8,7 @@ Tooltip: 'Make envelope symetrical'
"""
__author__ = "Jonas Petersen"
__url__ = ("blender", "elysiun", "Script's homepage, http://www.mindfloaters.de/blender/", "thread at blender.org, http://www.blender.org/modules.php?op=modload&name=phpBB2&file=viewtopic&t=4858 ")
__url__ = ("blender", "blenderartists.org", "Script's homepage, http://www.mindfloaters.de/blender/", "thread at blender.org, http://www.blender.org/modules.php?op=modload&name=phpBB2&file=viewtopic&t=4858 ")
__version__ = "0.9 2004-11-10"
__doc__ = """\
This script creates perfectly symmetrical envelope sets. It is part of the

View File

@@ -8,7 +8,7 @@ Tip: 'Export Loc Rot Size chanels to a Lightwave .mot file'
"""
__author__ = "Daniel Salazar (ZanQdo)"
__url__ = ("blender", "elysiun",
__url__ = ("blender", "blenderartists.org",
"e-mail: zanqdo@gmail.com")
__version__ = "16/04/08"

View File

@@ -1,13 +1,13 @@
#!BPY
"""
Name: 'Same Weights...'
Blender: 241
Blender: 245
Group: 'FaceSelect'
Tooltip: 'Select same faces with teh same weight for the active group.'
"""
__author__ = ["Campbell Barton"]
__url__ = ("blender", "elysiun", "http://members.iinet.net.au/~cpbarton/ideasman/")
__author__ = ["Campbell Barton aka ideasman42"]
__url__ = ["www.blender.org", "blenderartists.org", "www.python.org"]
__version__ = "0.1"
__bpydoc__ = """\

View File

@@ -8,7 +8,7 @@ Tip: 'Export to OpenFlight v16.0 (.flt)'
__author__ = "Greg MacDonald, Geoffrey Bantle"
__version__ = "2.0 11/21/07"
__url__ = ("blender", "elysiun", "Author's homepage, http://sourceforge.net/projects/blight/")
__url__ = ("blender", "blenderartists.org", "Author's homepage, http://sourceforge.net/projects/blight/")
__bpydoc__ = """\
This script exports v16.0 OpenFlight files. OpenFlight is a
registered trademark of MultiGen-Paradigm, Inc.

View File

@@ -10,7 +10,7 @@ Tip: 'Import OpenFlight (.flt)'
__author__ = "Greg MacDonald, Campbell Barton, Geoffrey Bantle"
__version__ = "2.0 11/21/07"
__url__ = ("blender", "elysiun", "Author's homepage, http://sourceforge.net/projects/blight/")
__url__ = ("blender", "blenderartists.org", "Author's homepage, http://sourceforge.net/projects/blight/")
__bpydoc__ = """\
This script imports OpenFlight files into Blender. OpenFlight is a
registered trademark of MultiGen-Paradigm, Inc.

View File

@@ -10,7 +10,7 @@ Tooltip: 'Manage FLT colors'
__author__ = "Geoffrey Bantle"
__version__ = "1.0 11/21/2007"
__email__ = ('scripts', 'Author, ')
__url__ = ('blender', 'elysiun')
__url__ = ('blender', 'blenderartists.org')
__bpydoc__ ="""\

View File

@@ -10,7 +10,7 @@ Tooltip: 'Tools for working with FLT databases'
__author__ = "Geoffrey Bantle"
__version__ = "1.0 11/21/07"
__email__ = ('scripts', 'Author, ')
__url__ = ('blender', 'elysiun')
__url__ = ('blender', 'blenderartists.org')
__bpydoc__ ="""\
This script provides tools for working with OpenFlight databases in Blender. OpenFlight is a

View File

@@ -10,7 +10,7 @@ Tooltip: 'Show help information about a chosen installed script.'
__author__ = "Willian P. Germano"
__version__ = "0.1 11/02/04"
__email__ = ('scripts', 'Author, wgermano:ig*com*br')
__url__ = ('blender', 'elysiun')
__url__ = ('blender', 'blenderartists.org')
__bpydoc__ ="""\
This script shows help information for scripts registered in the menus.
@@ -84,8 +84,7 @@ DEFAULT_EMAILS = {
}
DEFAULT_LINKS = {
'blender': ["blender.org\'s Python forum", "http://www.blender.org/modules.php?op=modload&name=phpBB2&file=viewforum&f=9"],
'elysiun': ["elYsiun\'s Python and Plugins forum", "http://www.elysiun.com/forum/viewforum.php?f=5"]
'blender': ["blender.org\'s Python forum", "http://www.blender.org/modules.php?op=modload&name=phpBB2&file=viewforum&f=9"]
}
PADDING = 15

View File

@@ -7,7 +7,7 @@ Tooltip: 'Help for new users'
"""
__author__ = "Matt Ebb"
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "1.0"
__bpydoc__ = """\
This script opens the user's default web browser at www.blender3d.org's

View File

@@ -7,7 +7,7 @@ Tooltip: 'The Blender reference manual'
"""
__author__ = "Matt Ebb"
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "1.0"
__bpydoc__ = """\
This script opens the user's default web browser at www.blender3d.org's

View File

@@ -7,7 +7,7 @@ Tooltip: 'Information about the changes in this version of Blender'
"""
__author__ = "Matt Ebb"
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "1.0"
__bpydoc__ = """\
This script opens the user's default web browser at www.blender3d.org's

View File

@@ -8,7 +8,7 @@ Tooltip: 'Tutorials for learning to use Blender'
"""
__author__ = "Matt Ebb"
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "1.0"
__bpydoc__ = """\
This script opens the user's default web browser at www.blender3d.org's

View File

@@ -8,7 +8,7 @@ Tooltip: 'The official Blender website'
"""
__author__ = "Matt Ebb"
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "1.0"
__bpydoc__ = """\
This script opens the user's default web browser at Blender's main site,

View File

@@ -8,7 +8,7 @@ Tooltip: 'Get involved with Blender development'
"""
__author__ = "Matt Ebb"
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "1.0"
__bpydoc__ = """\
This script opens the user's default web browser at www.blender.org, the

View File

@@ -8,7 +8,7 @@ Tooltip: 'Buy official Blender resources and merchandise online'
"""
__author__ = "Matt Ebb"
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "1.0"
__bpydoc__ = """\
This script opens the user's default web browser at www.blender3d.org's

View File

@@ -8,7 +8,7 @@ Tooltip: 'Get involved with other Blender users'
"""
__author__ = "Matt Ebb"
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "1.0"
__bpydoc__ = """\
This script opens the user's default web browser at www.blender3d.org's

View File

@@ -7,7 +7,7 @@ Tooltip: 'Open in an application for editing. (hold Shift to configure)'
"""
__author__ = "Campbell Barton"
__url__ = ["blender", "elysiun"]
__url__ = ["blender", "blenderartists.org"]
__version__ = "1.0"
__bpydoc__ = """\

View File

@@ -8,7 +8,7 @@ Tip: 'Import Loc Rot Size chanels from a Lightwave .mot file'
"""
__author__ = "Daniel Salazar (ZanQdo)"
__url__ = ("blender", "elysiun",
__url__ = ("blender", "blenderartists.org",
"e-mail: zanqdo@gmail.com")
__version__ = "16/04/08"

View File

@@ -8,7 +8,7 @@ Tooltip: 'Export selected meshes to LightWave File Format (.lwo)'
"""
__author__ = "Anthony D'Agostino (Scorpius)"
__url__ = ("blender", "elysiun",
__url__ = ("blender", "blenderartists.org",
"Author's homepage, http://www.redrival.com/scorpius")
__version__ = "Part of IOSuite 0.5"

View File

@@ -10,7 +10,7 @@ Tooltip: 'Export to Quake file format (.md2).'
__author__ = 'Bob Holcomb'
__version__ = '0.18.1 patch 1'
__url__ = ["Bob's site, http://bane.servebeer.com",
"Support forum, http://bane.servebeer.com", "blender", "elysiun"]
"Support forum, http://bane.servebeer.com", "blender", "blenderartists.org"]
__email__ = ["Bob Holcomb, bob_holcomb:hotmail*com", "scripts"]
__bpydoc__ = """\
This script Exports a Quake 2 file (MD2).

View File

@@ -10,7 +10,7 @@ Tooltip: 'Import from Quake file format (.md2).'
__author__ = 'Bob Holcomb'
__version__ = '0.16'
__url__ = ["Bob's site, http://bane.servebeer.com",
"Support forum, http://scourage.servebeer.com/phpbb/", "blender", "elysiun"]
"Support forum, http://scourage.servebeer.com/phpbb/", "blender", "blenderartists.org"]
__email__ = ["Bob Holcomb, bob_holcomb:hotmail*com", "scripts"]
__bpydoc__ = """\
This script imports a Quake 2 file (MD2), textures,

View File

@@ -1,13 +1,13 @@
#!BPY
"""
Name: 'Bone Weight Copy'
Blender: 243
Blender: 245
Group: 'Object'
Tooltip: 'Copy Bone Weights from 1 mesh, to all other selected meshes.'
"""
__author__ = ["Campbell Barton"]
__url__ = ("blender", "elysiun", "http://members.iinet.net.au/~cpbarton/ideasman/")
__author__ = "Campbell Barton aka ideasman42"
__url__ = ["www.blender.org", "blenderartists.org", "www.python.org"]
__version__ = "0.1"
__bpydoc__ = """\

View File

@@ -1,13 +1,13 @@
#!BPY
"""
Name: 'Clean Meshes'
Blender: 242
Blender: 245
Group: 'Mesh'
Tooltip: 'Clean unused data from all selected mesh objects.'
"""
__author__ = ["Campbell Barton"]
__url__ = ("blender", "elysiun", "http://members.iinet.net.au/~cpbarton/ideasman/")
__author__ = "Campbell Barton aka ideasman42"
__url__ = ["www.blender.org", "blenderartists.org", "www.python.org"]
__version__ = "0.1"
__bpydoc__ = """\
Clean Meshes

View File

@@ -6,7 +6,7 @@ Group: 'Mesh'
Tip: 'Edges not used by a face are converted into polyline(s)'
"""
__author__ = ("Campbell Barton")
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "1.0 2006/02/08"
__bpydoc__ = """\

View File

@@ -6,8 +6,8 @@ Group: 'Mesh'
Tooltip: 'Snap Verticies to X mirrord locations and weights.'
"""
__author__= ['Campbell Barton']
__url__= ["blender", "elysiun", "http://members.iinet.net.au/~cpbarton/ideasman/"]
__author__ = "Campbell Barton aka ideasman42"
__url__ = ["www.blender.org", "blenderartists.org", "www.python.org"]
__version__= '1.0'
__bpydoc__= '''\
This script is used to mirror vertex locations and weights

View File

@@ -7,7 +7,7 @@ Tooltip: 'Removed polygons from a mesh while maintaining the shape, textures and
"""
__author__ = "Campbell Barton"
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "1.0 2006/02/07"
__bpydoc__ = """\

View File

@@ -8,7 +8,7 @@ Tip: 'Copy data from active object to other selected ones.'
"""
__author__ = "Jean-Michel Soler (jms), Campbell Barton (Ideasman42)"
__url__ = ("blender", "elysiun",
__url__ = ("blender", "blenderartists.org",
"Script's homepage, http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_lampdatacopier.htm",
"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender")
__version__ = "0.1.2"

View File

@@ -12,7 +12,7 @@ __author__ = "Martin Poirier (theeth), Jean-Michel Soler (jms), Campbell Barton
# Martin Poirier's Apply_Def.py and
# Jean-Michel Soler's Fix From Everything
__url__ = ("http://www.blender.org", "http://blenderartists.org", "http://members.iinet.net.au/~cpbarton/ideasman/", "http://jmsoler.free.fr")
__url__ = ("http://www.blender.org", "http://blenderartists.org", "http://jmsoler.free.fr")
__version__ = "1.6 07/07/2006"
__bpydoc__ = """\
@@ -77,7 +77,11 @@ def copy_vgroups(source_ob, target_ob):
for vgroupname in vgroups:
target_me.addVertGroup(vgroupname)
if len(target_me.verts) == len(source_me.verts):
vlist = source_me.getVertsFromGroup(vgroupname, True)
try: # in rare cases this can raise an 'no deform groups assigned to mesh' error
vlist = source_me.getVertsFromGroup(vgroupname, True)
except:
vlist = []
try:
for vpair in vlist:
target_me.assignVertsToGroup(vgroupname, [vpair[0]], vpair[1], ADD)
@@ -171,4 +175,4 @@ def apply_deform():
Blender.Window.RedrawAll()
if __name__=='__main__':
apply_deform()
apply_deform()

View File

@@ -6,7 +6,7 @@ Group: 'Object'
Tooltip: 'Apply the chosen rule to rename all selected objects at once.'
"""
__author__ = "Campbell Barton"
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "1.0"
__bpydoc__ = """\

View File

@@ -8,7 +8,7 @@ Tooltip: 'Export selected mesh to DEC Object File Format (*.off)'
"""
__author__ = "Anthony D'Agostino (Scorpius)"
__url__ = ("blender", "elysiun",
__url__ = ("blender", "blenderartists.org",
"Author's homepage, http://www.redrival.com/scorpius")
__version__ = "Part of IOSuite 0.5"

View File

@@ -8,7 +8,7 @@ Tooltip: 'Import DEC Object File Format (*.off)'
"""
__author__ = "Anthony D'Agostino (Scorpius), Campbell Barton (Ideasman)"
__url__ = ("blender", "elysiun",
__url__ = ("blender", "blenderartists.org",
"Author's homepage, http://www.redrival.com/scorpius")
__version__ = "Part of IOSuite 0.5"

View File

@@ -13,7 +13,7 @@ Tip: 'Import a path from any of a set of formats (still experimental)'
"""
__author__ = "Jean-Michel Soler (jms)"
__url__ = ("blender", "elysiun",
__url__ = ("blender", "blenderartists.org",
"AI importer's homepage, http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_import_ai.htm",
"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender")
__version__ = "0.1.1"

View File

@@ -8,7 +8,7 @@ Tooltip: 'Export selected mesh to Raw Format (.raw)'
"""
__author__ = "Anthony D'Agostino (Scorpius)"
__url__ = ("blender", "elysiun",
__url__ = ("blender", "blenderartists.org",
"Author's homepage, http://www.redrival.com/scorpius")
__version__ = "Part of IOSuite 0.5"

View File

@@ -8,7 +8,7 @@ Tooltip: 'Import Raw Triangle File Format (.raw)'
"""
__author__ = "Anthony D'Agostino (Scorpius)"
__url__ = ("blender", "elysiun",
__url__ = ("blender", "blenderartists.org",
"Author's homepage, http://www.redrival.com/scorpius")
__version__ = "Part of IOSuite 0.5"

View File

@@ -8,7 +8,7 @@ Tip: 'GUI to select and rename objects.'
"""
__author__ = "Jean-Michel Soler (jms)"
__url__ = ("blender", "elysiun",
__url__ = ("blender", "blenderartists.org",
"Script's homepage, http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_renameobjectgui.htm",
"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender")
__version__ = "233"

View File

@@ -8,7 +8,7 @@ Tooltip: 'Save current renderlayers as a BPython script'
"""
__author__ = "Campbell Barton"
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "1.0"
__bpydoc__ = """\
@@ -47,8 +47,12 @@ rend = sce.render
# default filename: theme's name + '_theme.py' in user's scripts dir:
default_fname = Blender.Get("scriptsdir")
default_fname = Blender.sys.join(default_fname, sce.name + '_renderlayer.py')
default_fname = default_fname.replace(' ','_')
if not default_fname:
default_fname = Blender.Get("uscriptsdir")
if default_fname:
default_fname = Blender.sys.join(default_fname, sce.name + '_renderlayer.py')
default_fname = default_fname.replace(' ','_')
def write_renderlayers(filename):
"Write the current renderlayer as a bpython script"
@@ -113,4 +117,4 @@ rend = sce.render
except:
Blender.Draw.PupMenu("Warning - check console!%t|Menus could not be automatically updated")
FileSelector(write_renderlayers, "Save RenderLayers", default_fname)
FileSelector(write_renderlayers, "Save RenderLayers", default_fname)

View File

@@ -8,7 +8,7 @@ Tip: 'Copy deform data (not surf. subdiv) of active obj to rvk of the 2nd select
"""
__author__ = "Jean-Michel Soler (jms)"
__url__ = ("blender", "elysiun",
__url__ = ("blender", "blenderartists.org",
"Script's homepage, http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_rvk1versrvk2.htm",
"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender")
__version__ = "2007/04/27"

View File

@@ -8,7 +8,7 @@ Tooltip: 'Save current theme as a BPython script'
"""
__author__ = "Willian P. Germano"
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "2.43 2006/12/30"
__bpydoc__ = """\

View File

@@ -98,7 +98,7 @@ SceneCheck()
'''
new_text = bpy.data.texts.new('pyconstraint_template.py')
new_text = bpy.data.texts.new('camobject_template.py')
new_text.write(script_data)
bpy.data.texts.active = new_text
Window.RedrawAll()

View File

@@ -70,7 +70,7 @@ if __name__ == '__main__':
main()
'''
new_text = bpy.data.texts.new('pyconstraint_template.py')
new_text = bpy.data.texts.new('metaball_template.py')
new_text.write(script_data)
bpy.data.texts.active = new_text
Window.RedrawAll()

View File

@@ -13,7 +13,7 @@ script_data = \
'''#!BPY
"""
Name: 'My Object Script'
Blender: 244
Blender: 245
Group: 'Object'
Tooltip: 'Put some useful info here'
"""
@@ -78,4 +78,4 @@ if __name__ == '__main__':
new_text = bpy.data.texts.new('object_template.py')
new_text.write(script_data)
bpy.data.texts.active = new_text
Window.RedrawAll()
Window.RedrawAll()

View File

@@ -8,7 +8,7 @@ Tooltip: 'Import Pro Engineer (.slp) File Format'
"""
__author__ = "Anthony D'Agostino (Scorpius)"
__url__ = ("blender", "elysiun",
__url__ = ("blender", "blenderartists.org",
"Author's homepage, http://www.redrival.com/scorpius")
__version__ = "Part of IOSuite 0.5"

View File

@@ -8,7 +8,7 @@ Tooltip: 'Information about your Blender environment, useful to diagnose problem
"""
__author__ = "Willian P. Germano"
__url__ = ("blender", "elysiun")
__url__ = ("blenderartists.org", "blenderartists.org")
__version__ = "1.1"
__bpydoc__ = """\
This script creates a text in Blender's Text Editor with information

View File

@@ -7,7 +7,7 @@ Tip: 'Unweld all faces from a (or several) selected and common vertex. Made vert
"""
__author__ = "Jean-Michel Soler (jms)"
__url__ = ("blender", "elysiun",
__url__ = ("blender", "blenderartists.org",
"Script's homepage, http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_faces2vertex.htm#exemple",
"Communicate problems and errors, http://www.zoo-logique.org/3D.Blender/newsportal/thread.php?group=3D.Blender")
__version__ = "0.4.6 "

View File

@@ -6,7 +6,7 @@ Group: 'UVCalculation'
Tooltip: 'Follow from active quads.'
"""
__author__ = "Campbell Barton"
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "1.0 2006/02/07"
__bpydoc__ = """\

View File

@@ -5,8 +5,8 @@ Blender: 242
Group: 'UVCalculation'
Tooltip: 'Give each face non overlapping space on a texture.'
"""
__author__ = "Campbell Barton"
__url__ = ("blender", "elysiun")
__author__ = "Campbell Barton aka ideasman42"
__url__ = ("blender", "blenderartists.org")
__version__ = "1.0 2006/02/07"
__bpydoc__ = """\

View File

@@ -2,13 +2,13 @@
""" Registration info for Blender menus: <- these words are ignored
Name: 'Click project from face'
Blender: 242
Blender: 245
Group: 'UVCalculation'
Tooltip: '3 Clicks to project uvs onto selected faces.'
"""
__author__ = ["Campbell Barton"]
__url__ = ("blender", "elysiun", "http://members.iinet.net.au/~cpbarton/ideasman/")
__author__ = "Campbell Barton aka ideasman42"
__url__ = ["www.blender.org", "blenderartists.org", "www.python.org"]
__version__ = "0.1"
__bpydoc__=\
'''

View File

@@ -9,7 +9,7 @@ Tooltip: 'UV Unwrap mesh faces for all select mesh objects'
__author__ = "Campbell Barton"
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "1.1 12/18/05"
__bpydoc__ = """\

View File

@@ -7,9 +7,7 @@ Tip: 'Copy UV coords from a mesh to another that has same vertex indices'
"""
__author__ = "Toni Alatalo, Martin Poirier et. al."
__url__ = ("blender", "elysiun",
"Script's homepage, http://www.elysiun.com/forum/viewtopic.php?t=14897",
"Communicate problems and errors, http://www.elysiun.com/forum/viewtopic.php?t=14897")
__url__ = ("blender", "blenderartists.org")
__version__ = "0.2 01/2006"
__bpydoc__ = """\

View File

@@ -1,13 +1,13 @@
#!BPY
"""
Name: 'VCol Gradient...'
Blender: 241
Blender: 245
Group: 'VertexPaint'
Tooltip: 'Click on the start and end grad points for the mesh for selected faces.'
"""
__author__ = ["Campbell Barton"]
__url__ = ("blender", "elysiun", "http://members.iinet.net.au/~cpbarton/ideasman/")
__author__ = "Campbell Barton aka ideasman42"
__url__ = ["www.blender.org", "blenderartists.org", "www.python.org"]
__version__ = "0.1"
# ***** BEGIN GPL LICENSE BLOCK *****

View File

@@ -1,13 +1,13 @@
#!BPY
"""
Name: 'Self Shadow VCols (AO)...'
Blender: 241
Blender: 245
Group: 'VertexPaint'
Tooltip: 'Generate Fake Ambient Occlusion with vertex colors.'
"""
__author__ = ["Campbell Barton"]
__url__ = ("blender", "elysiun", "http://members.iinet.net.au/~cpbarton/ideasman/")
__author__ = "Campbell Barton aka ideasman42"
__url__ = ["www.blender.org", "blenderartists.org", "www.python.org"]
__version__ = "0.1"
__bpydoc__ = """\

View File

@@ -7,7 +7,7 @@ Tooltip: 'Export to VRML97 file (.wrl)'
"""
__author__ = ("Rick Kimball", "Ken Miller", "Steve Matthews", "Bart")
__url__ = ["blender", "elysiun",
__url__ = ["blender", "blenderartists.org",
"Author's (Rick) homepage, http://kimballsoftware.com/blender",
"Author's (Bart) homepage, http://www.neeneenee.de/vrml"]
__email__ = ["Bart, bart:neeneenee*de"]

View File

@@ -1,13 +1,13 @@
#!BPY
"""
Name: 'Clean Weight...'
Blender: 241
Blender: 245
Group: 'WeightPaint'
Tooltip: 'Removed verts from groups below a weight limit.'
"""
__author__ = ["Campbell Barton"]
__url__ = ("blender", "elysiun", "http://members.iinet.net.au/~cpbarton/ideasman/")
__author__ = "Campbell Barton aka ideasman42"
__url__ = ["www.blender.org", "blenderartists.org", "www.python.org"]
__version__ = "0.1"
__bpydoc__ = """\

View File

@@ -1,13 +1,13 @@
#!BPY
"""
Name: 'Weight Gradient...'
Blender: 241
Blender: 245
Group: 'WeightPaint'
Tooltip: 'Click on the start and end grad points for the mesh for selected faces.'
"""
__author__ = ["Campbell Barton"]
__url__ = ("blender", "elysiun", "http://members.iinet.net.au/~cpbarton/ideasman/")
__author__ = "Campbell Barton aka ideasman42"
__url__ = ["www.blender.org", "blenderartists.org", "www.python.org"]
__version__ = "0.1"
__bpydoc__=\
'''

View File

@@ -1,13 +1,13 @@
#!BPY
"""
Name: 'Grow/Shrink Weight...'
Blender: 241
Blender: 245
Group: 'WeightPaint'
Tooltip: 'Grow/Shrink active vertex group.'
"""
__author__ = ["Campbell Barton"]
__url__ = ("blender", "elysiun", "http://members.iinet.net.au/~cpbarton/ideasman/")
__author__ = "Campbell Barton aka ideasman42"
__url__ = ["www.blender.org", "blenderartists.org", "www.python.org"]
__version__ = "0.1"
__bpydoc__ = """\

View File

@@ -1,13 +1,13 @@
#!BPY
"""
Name: 'Normalize/Scale Weight...'
Blender: 241
Blender: 245
Group: 'WeightPaint'
Tooltip: 'Normalize the weight of the active weightgroup.'
"""
__author__ = ["Campbell Barton"]
__url__ = ("blender", "elysiun", "http://members.iinet.net.au/~cpbarton/ideasman/")
__author__ = "Campbell Barton aka ideasman42"
__url__ = ["www.blender.org", "blenderartists.org", "www.python.org"]
__version__ = "0.1"
__bpydoc__ = """\

View File

@@ -8,7 +8,7 @@ Tip: 'Adds Widgets for Driven Shapes'
"""
__author__ = ["Johnny Matthews (guitargeek)"]
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "0.0.9 12/15/05"
__bpydoc__ = """\

View File

@@ -7,7 +7,7 @@ Tooltip: 'Export selected mesh to xfig Format (.fig)'
"""
__author__ = 'Dino Ghilardi', 'Campbell Barton AKA Ideasman42'
__url__ = ("blender", "elysiun")
__url__ = ("blender", "blenderartists.org")
__version__ = "1.1"
__bpydoc__ = """\

View File

@@ -10,7 +10,7 @@ Tooltip: 'Export to a SoftImage XSI file'
__author__ = ("Elira")
__url__ = ["Author's site, http://www.creative-realms.net/~elira/blender.html",
"SoftImage's site, www.softimage.com", "elysiun"]
"SoftImage's site, www.softimage.com", "blenderartists.org"]
__email__ = ["scripts"]
__version__ = "2005/11/01"

View File

@@ -231,6 +231,7 @@ struct ParticleSystemModifierData *psys_get_modifier(struct Object *ob, struct P
struct ParticleSettings *psys_new_settings(char *name, struct Main *main);
struct ParticleSettings *psys_copy_settings(struct ParticleSettings *part);
void psys_flush_settings(struct ParticleSettings *part, int event, int hair_recalc);
void make_local_particlesettings(struct ParticleSettings *part);
struct LinkNode *psys_using_settings(struct ParticleSettings *part, int flush_update);
void psys_changed_type(struct ParticleSystem *psys);

View File

@@ -337,6 +337,7 @@ static void frames_duplilist(ListBase *lb, Object *ob, int level, int animated)
{
extern int enable_cu_speed; /* object.c */
Object copyob;
DupliObject *dob;
int cfrao, ok;
/* simple preventing of too deep nested groups */
@@ -360,7 +361,8 @@ static void frames_duplilist(ListBase *lb, Object *ob, int level, int animated)
if(ok) {
do_ob_ipo(ob);
where_is_object_time(ob, (float)G.scene->r.cfra);
new_dupli_object(lb, ob, ob->obmat, ob->lay, G.scene->r.cfra, OB_DUPLIFRAMES, animated);
dob= new_dupli_object(lb, ob, ob->obmat, ob->lay, G.scene->r.cfra, OB_DUPLIFRAMES, animated);
Mat4CpyMat4(dob->omat, copyob.obmat);
}
}
@@ -723,7 +725,7 @@ static void face_duplilist(ListBase *lb, ID *id, Object *par, float par_space_ma
static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_space_mat[][4], ParticleSystem *psys, int level, int animated)
{
GroupObject *go;
Object *ob=0, **oblist=0;
Object *ob=0, **oblist=0, obcopy, *obcopylist=0;
DupliObject *dob;
ParticleSettings *part;
ParticleData *pa;
@@ -733,7 +735,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_
ParticleSystemModifierData *psmd;
float ctime, pa_time, scale = 1.0f;
float tmat[4][4], mat[4][4], obrotmat[4][4], pamat[4][4], size=0.0;
float obmat[4][4], (*obmatlist)[4][4]=0;
float (*obmat)[4], (*oldobmat)[4];
float xvec[3] = {-1.0, 0.0, 0.0}, q[4];
int lay, a, b, k, step_nbr = 0, counter, hair = 0;
int totpart, totchild, totgroup=0, pa_num;
@@ -758,7 +760,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_
totchild = psys->totchild;
BLI_srandom(31415926 + psys->seed);
lay= G.scene->lay;
if((part->draw_as == PART_DRAW_OB && part->dup_ob) ||
(part->draw_as == PART_DRAW_GR && part->dup_group && part->dup_group->gobject.first)) {
@@ -778,54 +780,55 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_
psys->lattice = psys_get_lattice(par, psys);
/* gather list of objects or single object */
if(part->draw_as==PART_DRAW_GR) {
group_handle_recalc_and_update(par, part->dup_group);
go= part->dup_group->gobject.first;
while(go) {
go=go->next;
for(go=part->dup_group->gobject.first; go; go=go->next)
totgroup++;
}
oblist= MEM_callocN(totgroup*sizeof(Object *), "dupgroup object list");
obmatlist= MEM_callocN(totgroup*sizeof(float)*4*4, "dupgroup obmat list");
go= part->dup_group->gobject.first;
/* we also copy the actual objects to restore afterwards, since
* where_is_object_time will change the object which breaks transform */
oblist = MEM_callocN(totgroup*sizeof(Object *), "dupgroup object list");
obcopylist = MEM_callocN(totgroup*sizeof(Object), "dupgroup copy list");
go = part->dup_group->gobject.first;
for(a=0; a<totgroup; a++, go=go->next) {
oblist[a]=go->ob;
Mat4CpyMat4(obmatlist[a], go->ob->obmat);
oblist[a] = go->ob;
obcopylist[a] = *go->ob;
}
}
else {
ob = part->dup_ob;
Mat4CpyMat4(obmat, ob->obmat);
obcopy = *ob;
}
if(totchild==0 || part->draw & PART_DRAW_PARENT)
a=0;
a = 0;
else
a=totpart;
a = totpart;
for(pa=psys->particles,counter=0; a<totpart+totchild; a++,pa++,counter++) {
if(a<totpart) {
/* handle parent particle */
if(pa->flag & (PARS_UNEXIST+PARS_NO_DISP))
continue;
pa_num=pa->num;
pa_time=pa->time;
size=pa->size;
pa_num = pa->num;
pa_time = pa->time;
size = pa->size;
}
else {
/* TODO: figure these two out */
cpa= &psys->child[a - totpart];
/* handle child particle */
cpa = &psys->child[a - totpart];
pa_num = a;
pa_time = psys->particles[cpa->parent].time;
size=psys_get_child_size(psys, cpa, ctime, 0);
size = psys_get_child_size(psys, cpa, ctime, 0);
}
if(part->draw_as==PART_DRAW_GR) {
/* for groups, pick the object based on settings */
if(part->draw&PART_DRAW_RAND_GR)
b= BLI_rand() % totgroup;
else if(part->from==PART_FROM_PARTICLE)
@@ -834,11 +837,17 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_
b= a % totgroup;
ob = oblist[b];
Mat4CpyMat4(obmat, obmatlist[b]);
obmat = oblist[b]->obmat;
oldobmat = obcopylist[b].obmat;
}
else {
obmat= ob->obmat;
oldobmat= obcopy.obmat;
}
for(k=0; k<=step_nbr; k++, counter++) {
if(hair) {
/* hair we handle separate and compute transform based on hair keys */
if(a < totpart) {
cache = psys->pathcache[a];
psys_get_dupli_path_transform(par, psys, psmd, pa, 0, cache, pamat, &scale);
@@ -851,6 +860,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_
VECCOPY(pamat[3], cache->co);
}
else if(step_nbr) {
/* other keys */
state.time = (float)k / (float)step_nbr;
psys_get_particle_on_path(par, psys, a, &state, 0);
@@ -859,6 +869,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_
pamat[3][3]= 1.0f;
}
else {
/* first key */
state.time = -1.0;
if(psys_get_particle_state(par, psys, a, &state, 0) == 0)
continue;
@@ -870,8 +881,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_
if(part->draw_as==PART_DRAW_GR && psys->part->draw & PART_DRAW_WHOLE_GR) {
for(go= part->dup_group->gobject.first, b=0; go; go= go->next, b++) {
Mat4MulMat4(tmat, obmatlist[b], pamat);
Mat4MulMat4(tmat, oblist[b]->obmat, pamat);
Mat4MulFloat3((float *)tmat, size*scale);
if(par_space_mat)
Mat4MulMat4(mat, tmat, par_space_mat);
@@ -879,6 +889,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_
Mat4CpyMat4(mat, tmat);
dob= new_dupli_object(lb, go->ob, mat, par->lay, counter, OB_DUPLIPARTS, animated);
Mat4CpyMat4(dob->omat, obcopylist[b].obmat);
if(G.rendering)
psys_get_dupli_texture(par, part, psmd, pa, cpa, dob->uv, dob->orco);
}
@@ -904,16 +915,27 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_
Mat4CpyMat4(mat, tmat);
dob= new_dupli_object(lb, ob, mat, par->lay, counter, OB_DUPLIPARTS, animated);
Mat4CpyMat4(dob->omat, oldobmat);
if(G.rendering)
psys_get_dupli_texture(par, part, psmd, pa, cpa, dob->uv, dob->orco);
}
}
}
/* restore objects since they were changed in where_is_object_time */
if(part->draw_as==PART_DRAW_GR) {
for(a=0; a<totgroup; a++)
*(oblist[a])= obcopylist[a];
}
else
*ob= obcopy;
}
/* clean up */
if(oblist)
MEM_freeN(oblist);
if(obmatlist)
MEM_freeN(obmatlist);
if(obcopylist)
MEM_freeN(obcopylist);
if(psys->lattice) {
end_latt_deform();

View File

@@ -348,9 +348,9 @@ void freeNurb(Nurb *nu)
if(nu->bp) MEM_freeN(nu->bp);
nu->bp= 0;
if(nu->knotsu) MEM_freeN(nu->knotsu);
nu->knotsu= 0;
nu->knotsu= NULL;
if(nu->knotsv) MEM_freeN(nu->knotsv);
nu->knotsv= 0;
nu->knotsv= NULL;
/* if(nu->trim.first) freeNurblist(&(nu->trim)); */
MEM_freeN(nu);
@@ -393,7 +393,7 @@ Nurb *duplicateNurb(Nurb *nu)
(BPoint*)MEM_mallocN((len)* sizeof(BPoint),"duplicateNurb3");
memcpy(newnu->bp, nu->bp, len*sizeof(BPoint));
newnu->knotsu=newnu->knotsv= 0;
newnu->knotsu= newnu->knotsv= NULL;
if(nu->knotsu) {
len= KNOTSU(nu);
@@ -506,6 +506,7 @@ static void calcknots(float *knots, short aantal, short order, short type)
}
}
else if(type==2) {
/* Warning, the order MUST be 2 or 4, if this is not enforced, the displist will be corrupt */
if(order==4) {
k= 0.34;
for(a=0;a<t;a++) {
@@ -520,6 +521,9 @@ static void calcknots(float *knots, short aantal, short order, short type)
knots[a]= (float)floor(k);
}
}
else {
printf("bez nurb curve order is not 3 or 4, should never happen\n");
}
}
}
@@ -529,7 +533,8 @@ static void makecyclicknots(float *knots, short pnts, short order)
int a, b, order2, c;
if(knots==0) return;
order2=order-1;
order2=order-1;
/* do first long rows (order -1), remove identical knots at endpoints */
if(order>2) {
@@ -549,26 +554,35 @@ static void makecyclicknots(float *knots, short pnts, short order)
}
void makeknots(Nurb *nu, short uv, short type) /* 0: uniform, 1: endpoints, 2: bezier */
/* type - 0: uniform, 1: endpoints, 2: bezier, note, cyclic nurbs are always uniform */
void makeknots(Nurb *nu, short uv, short type)
{
if( (nu->type & 7)==CU_NURBS ) {
if(uv & 1) {
if(uv == 1) {
if(nu->knotsu) MEM_freeN(nu->knotsu);
if(nu->pntsu>1) {
if(check_valid_nurb_u(nu)) {
nu->knotsu= MEM_callocN(4+sizeof(float)*KNOTSU(nu), "makeknots");
calcknots(nu->knotsu, nu->pntsu, nu->orderu, type);
if(nu->flagu & 1) makecyclicknots(nu->knotsu, nu->pntsu, nu->orderu);
if(nu->flagu & CU_CYCLIC) {
calcknots(nu->knotsu, nu->pntsu, nu->orderu, 0); /* cyclic should be uniform */
makecyclicknots(nu->knotsu, nu->pntsu, nu->orderu);
} else {
calcknots(nu->knotsu, nu->pntsu, nu->orderu, type);
}
}
else nu->knotsu= 0;
}
if(uv & 2) {
else nu->knotsu= NULL;
} else if(uv == 2) {
if(nu->knotsv) MEM_freeN(nu->knotsv);
if(nu->pntsv>1) {
if(check_valid_nurb_v(nu)) {
nu->knotsv= MEM_callocN(4+sizeof(float)*KNOTSV(nu), "makeknots");
calcknots(nu->knotsv, nu->pntsv, nu->orderv, type);
if(nu->flagv & 1) makecyclicknots(nu->knotsv, nu->pntsv, nu->orderv);
if(nu->flagv & CU_CYCLIC) {
calcknots(nu->knotsv, nu->pntsv, nu->orderv, 0); /* cyclic should be uniform */
makecyclicknots(nu->knotsv, nu->pntsv, nu->orderv);
} else {
calcknots(nu->knotsv, nu->pntsv, nu->orderv, type);
}
}
else nu->knotsv= 0;
else nu->knotsv= NULL;
}
}
}
@@ -645,7 +659,7 @@ void makeNurbfaces(Nurb *nu, float *data, int rowstride)
int i, j, iofs, jofs, cycl, len, resolu, resolv;
int istart, iend, jsta, jen, *jstart, *jend, ratcomp;
if(nu->knotsu==0 || nu->knotsv==0) return;
if(nu->knotsu==NULL || nu->knotsv==NULL) return;
if(nu->orderu>nu->pntsu) return;
if(nu->orderv>nu->pntsv) return;
if(data==0) return;
@@ -679,24 +693,24 @@ void makeNurbfaces(Nurb *nu, float *data, int rowstride)
fp= nu->knotsu;
ustart= fp[nu->orderu-1];
if(nu->flagu & 1) uend= fp[nu->pntsu+nu->orderu-1];
if(nu->flagu & CU_CYCLIC) uend= fp[nu->pntsu+nu->orderu-1];
else uend= fp[nu->pntsu];
ustep= (uend-ustart)/(resolu-1+(nu->flagu & 1));
ustep= (uend-ustart)/(resolu-1+(nu->flagu & CU_CYCLIC));
basisu= (float *)MEM_mallocN(sizeof(float)*KNOTSU(nu), "makeNurbfaces3");
fp= nu->knotsv;
vstart= fp[nu->orderv-1];
if(nu->flagv & 1) vend= fp[nu->pntsv+nu->orderv-1];
if(nu->flagv & CU_CYCLIC) vend= fp[nu->pntsv+nu->orderv-1];
else vend= fp[nu->pntsv];
vstep= (vend-vstart)/(resolv-1+(nu->flagv & 1));
vstep= (vend-vstart)/(resolv-1+(nu->flagv & CU_CYCLIC));
len= KNOTSV(nu);
basisv= (float *)MEM_mallocN(sizeof(float)*len*resolv, "makeNurbfaces3");
jstart= (int *)MEM_mallocN(sizeof(float)*resolv, "makeNurbfaces4");
jend= (int *)MEM_mallocN(sizeof(float)*resolv, "makeNurbfaces5");
/* precalculation of basisv and jstart,jend */
if(nu->flagv & 1) cycl= nu->orderv-1;
if(nu->flagv & CU_CYCLIC) cycl= nu->orderv-1;
else cycl= 0;
v= vstart;
basis= basisv;
@@ -706,7 +720,7 @@ void makeNurbfaces(Nurb *nu, float *data, int rowstride)
v+= vstep;
}
if(nu->flagu & 1) cycl= nu->orderu-1;
if(nu->flagu & CU_CYCLIC) cycl= nu->orderu-1;
else cycl= 0;
in= data;
u= ustart;
@@ -803,7 +817,7 @@ void makeNurbcurve(Nurb *nu, float *data, int resolu, int dim)
float *basisu, *sum, *fp, *in;
int i, len, istart, iend, cycl;
if(nu->knotsu==0) return;
if(nu->knotsu==NULL) return;
if(nu->orderu>nu->pntsu) return;
if(data==0) return;
@@ -820,12 +834,12 @@ void makeNurbcurve(Nurb *nu, float *data, int resolu, int dim)
fp= nu->knotsu;
ustart= fp[nu->orderu-1];
if(nu->flagu & 1) uend= fp[nu->pntsu+nu->orderu-1];
if(nu->flagu & CU_CYCLIC) uend= fp[nu->pntsu+nu->orderu-1];
else uend= fp[nu->pntsu];
ustep= (uend-ustart)/(resolu-1+(nu->flagu & 1));
ustep= (uend-ustart)/(resolu-1+(nu->flagu & CU_CYCLIC));
basisu= (float *)MEM_mallocN(sizeof(float)*KNOTSU(nu), "makeNurbcurve3");
if(nu->flagu & 1) cycl= nu->orderu-1;
if(nu->flagu & CU_CYCLIC) cycl= nu->orderu-1;
else cycl= 0;
in= data;
@@ -1425,14 +1439,14 @@ static void alfa_bezpart(BezTriple *prevbezt, BezTriple *bezt, Nurb *nu, float *
/* returns a point */
if(prevbezt==nu->bezt) {
if(nu->flagu & 1) pprev= last;
if(nu->flagu & CU_CYCLIC) pprev= last;
else pprev= prevbezt;
}
else pprev= prevbezt-1;
/* next point */
if(bezt==last) {
if(nu->flagu & 1) next= nu->bezt;
if(nu->flagu & CU_CYCLIC) next= nu->bezt;
else next= bezt;
}
else next= bezt+1;
@@ -1478,7 +1492,7 @@ void makeBevelList(Object *ob)
while(nu) {
/* check we are a single point? also check we are not a surface and that the orderu is sane,
* enforced in the UI but can go wrong possibly */
if(nu->pntsu<2 || ((nu->type & 7)==CU_NURBS && nu->pntsu < nu->orderu)) {
if(!check_valid_nurb_u(nu)) {
bl= MEM_callocN(sizeof(BevList)+1*sizeof(BevPoint), "makeBevelList");
BLI_addtail(&(cu->bev), bl);
bl->nr= 0;
@@ -1493,7 +1507,7 @@ void makeBevelList(Object *ob)
bl= MEM_callocN(sizeof(BevList)+len*sizeof(BevPoint), "makeBevelList");
BLI_addtail(&(cu->bev), bl);
if(nu->flagu & 1) bl->poly= 0;
if(nu->flagu & CU_CYCLIC) bl->poly= 0;
else bl->poly= -1;
bl->nr= len;
bl->flag= 0;
@@ -1512,17 +1526,17 @@ void makeBevelList(Object *ob)
}
else if((nu->type & 7)==CU_BEZIER) {
len= resolu*(nu->pntsu+ (nu->flagu & 1) -1)+1; /* in case last point is not cyclic */
len= resolu*(nu->pntsu+ (nu->flagu & CU_CYCLIC) -1)+1; /* in case last point is not cyclic */
bl= MEM_callocN(sizeof(BevList)+len*sizeof(BevPoint), "makeBevelList");
BLI_addtail(&(cu->bev), bl);
if(nu->flagu & 1) bl->poly= 0;
if(nu->flagu & CU_CYCLIC) bl->poly= 0;
else bl->poly= -1;
bevp= (BevPoint *)(bl+1);
a= nu->pntsu-1;
bezt= nu->bezt;
if(nu->flagu & 1) {
if(nu->flagu & CU_CYCLIC) {
a++;
prevbezt= nu->bezt+(nu->pntsu-1);
}
@@ -1595,7 +1609,7 @@ void makeBevelList(Object *ob)
MEM_freeN(data);
MEM_freeN(data_a);
if((nu->flagu & 1)==0) { /* not cyclic: endpoint */
if((nu->flagu & CU_CYCLIC)==0) { /* not cyclic: endpoint */
bevp->x= prevbezt->vec[1][0];
bevp->y= prevbezt->vec[1][1];
bevp->z= prevbezt->vec[1][2];
@@ -1611,7 +1625,7 @@ void makeBevelList(Object *ob)
BLI_addtail(&(cu->bev), bl);
bl->nr= len;
bl->flag= 0;
if(nu->flagu & 1) bl->poly= 0;
if(nu->flagu & CU_CYCLIC) bl->poly= 0;
else bl->poly= -1;
bevp= (BevPoint *)(bl+1);
@@ -2209,7 +2223,7 @@ void calchandlesNurb(Nurb *nu) /* first, if needed, set handle flags */
a= nu->pntsu;
bezt= nu->bezt;
if(nu->flagu & 1) prev= bezt+(a-1);
if(nu->flagu & CU_CYCLIC) prev= bezt+(a-1);
else prev= 0;
next= bezt+1;
@@ -2217,7 +2231,7 @@ void calchandlesNurb(Nurb *nu) /* first, if needed, set handle flags */
calchandleNurb(bezt, prev, next, 0);
prev= bezt;
if(a==1) {
if(nu->flagu & 1) next= nu->bezt;
if(nu->flagu & CU_CYCLIC) next= nu->bezt;
else next= 0;
}
else next++;
@@ -2608,3 +2622,63 @@ void curve_applyVertexCos(Curve *cu, ListBase *lb, float (*vertexCos)[3])
}
}
}
int check_valid_nurb_u( struct Nurb *nu )
{
if (nu==NULL) return 0;
if (nu->pntsu <= 1) return 0;
if ((nu->type & 7)!=CU_NURBS) return 1; /* not a nurb, lets assume its valid */
if (nu->pntsu < nu->orderu) return 0;
if (((nu->flag & CU_CYCLIC)==0) && ((nu->flagu>>1) & 2)) { /* Bezier U Endpoints */
if (nu->orderu==4) {
if (nu->pntsu < 5) return 0; /* bezier with 4 orderu needs 5 points */
} else if (nu->orderu != 3) return 0; /* order must be 3 or 4 */
}
return 1;
}
int check_valid_nurb_v( struct Nurb *nu)
{
if (nu==NULL) return 0;
if (nu->pntsv <= 1) return 0;
if ((nu->type & 7)!=CU_NURBS) return 1; /* not a nurb, lets assume its valid */
if (nu->pntsv < nu->orderv) return 0;
if (((nu->flag & CU_CYCLIC)==0) && ((nu->flagv>>1) & 2)) { /* Bezier V Endpoints */
if (nu->orderv==4) {
if (nu->pntsv < 5) return 0; /* bezier with 4 orderu needs 5 points */
} else if (nu->orderv != 3) return 0; /* order must be 3 or 4 */
}
return 1;
}
int clamp_nurb_order_u( struct Nurb *nu )
{
int change = 0;
if(nu->pntsu<nu->orderu) {
nu->orderu= nu->pntsu;
change= 1;
}
if(((nu->flag & CU_CYCLIC)==0) && (nu->flagu>>1)&2) {
CLAMP(nu->orderu, 3,4);
change= 1;
}
return change;
}
int clamp_nurb_order_v( struct Nurb *nu)
{
int change = 0;
if(nu->pntsv<nu->orderv) {
nu->orderv= nu->pntsv;
change= 1;
}
if(((nu->flag & CU_CYCLIC)==0) && (nu->flagv>>1)&2) {
CLAMP(nu->orderv, 3,4);
change= 1;
}
return change;
}

View File

@@ -346,6 +346,24 @@ static void dag_add_driver_relation(Ipo *ipo, DagForest *dag, DagNode *node, int
}
}
static void dag_add_collision_field_relation(DagForest *dag, Object *ob, DagNode *node)
{
Base *base;
DagNode *node2;
// would be nice to have a list of colliders here
// so for now walk all objects in scene check 'same layer rule'
for(base = G.scene->base.first; base; base= base->next) {
if((base->lay & ob->lay) && base->object->pd) {
Object *ob1= base->object;
if((ob1->pd->deflect || ob1->pd->forcefield) && (ob1 != ob)) {
node2 = dag_get_node(dag, ob1);
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Field Collision");
}
}
}
}
static void build_dag_object(DagForest *dag, DagNode *scenenode, Object *ob, int mask)
{
bConstraint *con;
@@ -523,22 +541,9 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Object *ob, int
}
/* softbody collision */
if((ob->type==OB_MESH) || (ob->type==OB_CURVE) || (ob->type==OB_LATTICE)) {
Base *base;
if(modifiers_isSoftbodyEnabled(ob)){
// would be nice to have a list of colliders here
// so for now walk all objects in scene check 'same layer rule'
for(base = G.scene->base.first; base; base= base->next) {
if( (base->lay & ob->lay) && base->object->pd) {
Object *ob1= base->object;
if((ob1->pd->deflect) && (ob1 != ob)) {
node2 = dag_get_node(dag, ob1);
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Softbody Collision");
}
}
}
}
}
if((ob->type==OB_MESH) || (ob->type==OB_CURVE) || (ob->type==OB_LATTICE))
if(modifiers_isSoftbodyEnabled(ob) || modifiers_isClothEnabled(ob))
dag_add_collision_field_relation(dag, ob, node);
if (ob->type==OB_MBALL) {
Object *mom= find_basis_mball(ob);
@@ -1691,7 +1696,7 @@ static void flush_update_node(DagNode *node, unsigned int layer, int curtime)
for(itA = node->child; itA; itA= itA->next) {
all_layer |= itA->lay;
/* the relationship is visible */
if(itA->lay & layer) {
if((itA->lay & layer) || (itA->node->ob == G.obedit)) {
if(itA->node->type==ID_OB) {
obc= itA->node->ob;
oldflag= obc->recalc;
@@ -1722,7 +1727,7 @@ static void flush_update_node(DagNode *node, unsigned int layer, int curtime)
}
}
/* even nicer, we can clear recalc flags... */
if((all_layer & layer)==0) {
if((all_layer & layer)==0 && (ob != G.obedit)) {
/* but existing displaylists or derivedmesh should be freed */
if(ob->recalc & OB_RECALC_DATA)
object_free_display(ob);
@@ -1736,7 +1741,7 @@ static void flush_update_node(DagNode *node, unsigned int layer, int curtime)
/* could merge this in with loop above...? (ton) */
for(itA = node->child; itA; itA= itA->next) {
/* the relationship is visible */
if(itA->lay & layer) {
if((itA->lay & layer) || (itA->node->ob == G.obedit)) {
if(itA->node->type==ID_OB) {
obc= itA->node->ob;
/* child moves */

View File

@@ -783,7 +783,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase)
else
resolu= nu->resolu;
if(nu->pntsu<2 || ((nu->type & 7)==CU_NURBS && nu->pntsu < nu->orderu));
if(!check_valid_nurb_u(nu));
else if((nu->type & 7)==CU_BEZIER) {
/* count */
@@ -816,7 +816,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase)
data= dl->verts;
if(nu->flagu & 1) {
if(nu->flagu & CU_CYCLIC) {
dl->type= DL_POLY;
a= nu->pntsu;
}
@@ -863,7 +863,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase)
dl->charidx = nu->charidx;
data= dl->verts;
if(nu->flagu & 1) dl->type= DL_POLY;
if(nu->flagu & CU_CYCLIC) dl->type= DL_POLY;
else dl->type= DL_SEGM;
makeNurbcurve(nu, data, resolu, 3);
}
@@ -878,7 +878,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase)
dl->charidx = nu->charidx;
data= dl->verts;
if(nu->flagu & 1) dl->type= DL_POLY;
if(nu->flagu & CU_CYCLIC) dl->type= DL_POLY;
else dl->type= DL_SEGM;
a= len;
@@ -1330,7 +1330,7 @@ void makeDispListSurf(Object *ob, ListBase *dispbase, int forRender)
dl->rt= nu->flag;
data= dl->verts;
if(nu->flagu & 1) dl->type= DL_POLY;
if(nu->flagu & CU_CYCLIC) dl->type= DL_POLY;
else dl->type= DL_SEGM;
makeNurbcurve(nu, data, nu->resolu, 3);

View File

@@ -281,15 +281,19 @@ static Image *image_alloc(const char *name, short source, short type)
/* get the ibuf from an image cache, local use here only */
static ImBuf *image_get_ibuf(Image *ima, int index, int frame)
{
/* this function is intended to be thread safe. with IMA_NO_INDEX this
* should be OK, but when iterating over the list this is more tricky
* */
if(index==IMA_NO_INDEX)
return ima->ibufs.first;
else {
ImBuf *ibuf;
index= IMA_MAKE_INDEX(frame, index);
for(ibuf= ima->ibufs.first; ibuf; ibuf= ibuf->next)
if(ibuf->index==index)
return ibuf;
return NULL;
}
}
@@ -317,19 +321,16 @@ static void image_assign_ibuf(Image *ima, ImBuf *ibuf, int index, int frame)
for(link= ima->ibufs.first; link; link= link->next)
if(link->index>=index)
break;
/* now we don't want copies? */
if(link && ibuf->index==link->index) {
ImBuf *prev= ibuf->prev;
image_remove_ibuf(ima, link);
link= prev;
}
ibuf->index= index;
/* this function accepts link==NULL */
BLI_insertlinkbefore(&ima->ibufs, link, ibuf);
ibuf->index= index;
/* now we don't want copies? */
if(link && ibuf->index==link->index)
image_remove_ibuf(ima, link);
}
}
/* checks if image was already loaded, then returns same image */
@@ -847,10 +848,6 @@ void BKE_add_image_extension(char *string, int imtype)
if(!BLI_testextensie(string, ".tga"))
extension= ".tga";
}
else if(ELEM5(imtype, R_MOVIE, R_AVICODEC, R_AVIRAW, R_AVIJPEG, R_JPEG90)) {
if(!( BLI_testextensie(string, ".jpg") || BLI_testextensie(string, ".jpeg")))
extension= ".jpg";
}
else if(imtype==R_BMP) {
if(!BLI_testextensie(string, ".bmp"))
extension= ".bmp";
@@ -873,10 +870,14 @@ void BKE_add_image_extension(char *string, int imtype)
if (!BLI_testextensie(string, ".dpx"))
extension= ".dpx";
}
else { /* targa default */
else if(imtype==R_TARGA) {
if(!BLI_testextensie(string, ".tga"))
extension= ".tga";
}
else { // R_MOVIE, R_AVICODEC, R_AVIRAW, R_AVIJPEG, R_JPEG90, R_QUICKTIME etc
if(!( BLI_testextensie(string, ".jpg") || BLI_testextensie(string, ".jpeg")))
extension= ".jpg";
}
strcat(string, extension);
}
@@ -1504,13 +1505,17 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame)
ibuf= NULL;
}
else {
image_assign_ibuf(ima, ibuf, 0, frame);
image_initialize_after_load(ima, ibuf);
image_assign_ibuf(ima, ibuf, 0, frame);
}
#else
image_assign_ibuf(ima, ibuf, 0, frame);
image_initialize_after_load(ima, ibuf);
image_assign_ibuf(ima, ibuf, 0, frame);
#endif
if(ima->flag & IMA_DO_PREMUL)
converttopremul(ibuf);
}
else
ima->ok= 0;
@@ -1545,8 +1550,9 @@ static ImBuf *image_load_sequence_multilayer(Image *ima, ImageUser *iuser, int f
// if(oldrr) printf("freed previous result %p\n", oldrr);
if(oldrr) RE_FreeRenderResult(oldrr);
}
else
else {
ima->rr= oldrr;
}
}
if(ima->rr) {
@@ -1561,8 +1567,8 @@ static ImBuf *image_load_sequence_multilayer(Image *ima, ImageUser *iuser, int f
ibuf->mall= IB_rectfloat;
ibuf->channels= rpass->channels;
image_assign_ibuf(ima, ibuf, iuser->multi_index, frame);
image_initialize_after_load(ima, ibuf);
image_assign_ibuf(ima, ibuf, iuser->multi_index, frame);
}
// else printf("pass not found\n");
@@ -1608,8 +1614,8 @@ static ImBuf *image_load_movie_file(Image *ima, ImageUser *iuser, int frame)
ibuf = IMB_anim_absolute(ima->anim, fra);
if(ibuf) {
image_assign_ibuf(ima, ibuf, 0, frame);
image_initialize_after_load(ima, ibuf);
image_assign_ibuf(ima, ibuf, 0, frame);
}
else
ima->ok= 0;
@@ -1628,6 +1634,7 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
{
struct ImBuf *ibuf;
char str[FILE_MAX];
int assign = 0;
/* always ensure clean ima */
image_free_buffers(ima);
@@ -1660,8 +1667,8 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
ibuf= NULL;
}
else {
image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
image_initialize_after_load(ima, ibuf);
assign= 1;
/* check if the image is a font image... */
detectBitmapFont(ibuf);
@@ -1677,6 +1684,9 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
else
ima->ok= 0;
if(assign)
image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
if(iuser)
iuser->ok= ima->ok;
@@ -1700,12 +1710,13 @@ static ImBuf *image_get_ibuf_multilayer(Image *ima, ImageUser *iuser)
if(rpass) {
ibuf= IMB_allocImBuf(ima->rr->rectx, ima->rr->recty, 32, 0, 0);
image_assign_ibuf(ima, ibuf, iuser?iuser->multi_index:IMA_NO_INDEX, 0);
image_initialize_after_load(ima, ibuf);
ibuf->rect_float= rpass->rect;
ibuf->flags |= IB_rectfloat;
ibuf->channels= rpass->channels;
image_assign_ibuf(ima, ibuf, iuser?iuser->multi_index:IMA_NO_INDEX, 0);
}
}
@@ -1792,12 +1803,71 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser)
return NULL;
}
static ImBuf *image_get_ibuf_threadsafe(Image *ima, ImageUser *iuser, int *frame_r, int *index_r)
{
ImBuf *ibuf = NULL;
int frame = 0, index = 0;
/* see if we already have an appropriate ibuf, with image source and type */
if(ima->source==IMA_SRC_MOVIE) {
frame= iuser?iuser->framenr:ima->lastframe;
ibuf= image_get_ibuf(ima, 0, frame);
}
else if(ima->source==IMA_SRC_SEQUENCE) {
if(ima->type==IMA_TYPE_IMAGE) {
frame= iuser?iuser->framenr:ima->lastframe;
ibuf= image_get_ibuf(ima, 0, frame);
}
else if(ima->type==IMA_TYPE_MULTILAYER) {
frame= iuser?iuser->framenr:ima->lastframe;
index= iuser?iuser->multi_index:IMA_NO_INDEX;
ibuf= image_get_ibuf(ima, index, frame);
}
}
else if(ima->source==IMA_SRC_FILE) {
if(ima->type==IMA_TYPE_IMAGE)
ibuf= image_get_ibuf(ima, IMA_NO_INDEX, 0);
else if(ima->type==IMA_TYPE_MULTILAYER)
ibuf= image_get_ibuf(ima, iuser?iuser->multi_index:IMA_NO_INDEX, 0);
}
else if(ima->source == IMA_SRC_GENERATED) {
ibuf= image_get_ibuf(ima, IMA_NO_INDEX, 0);
}
else if(ima->source == IMA_SRC_VIEWER) {
if(ima->type==IMA_TYPE_R_RESULT) {
/* always verify entirely, not that this shouldn't happen
* during render anyway */
}
else if(ima->type==IMA_TYPE_COMPOSITE) {
frame= iuser?iuser->framenr:0;
ibuf= image_get_ibuf(ima, 0, frame);
}
}
*frame_r = frame;
*index_r = index;
return ibuf;
}
/* Checks optional ImageUser and verifies/creates ImBuf. */
/* returns ibuf */
ImBuf *BKE_image_get_ibuf(Image *ima, ImageUser *iuser)
{
ImBuf *ibuf= NULL;
float color[] = {0, 0, 0, 1};
int frame= 0, index= 0;
/* This function is intended to be thread-safe. It postpones the mutex lock
* until it needs to load the image, if the image is already there it
* should just get the pointer and return. The reason is that a lot of mutex
* locks appears to be very slow on certain multicore macs, causing a render
* with image textures to actually slow down as more threads are used.
*
* Note that all the image loading functions should also make sure they do
* things in a threadsafe way for image_get_ibuf_threadsafe to work correct.
* That means, the last two steps must be, 1) add the ibuf to the list and
* 2) set ima/iuser->ok to 0 to IMA_OK_LOADED */
/* quick reject tests */
if(ima==NULL)
@@ -1809,101 +1879,95 @@ ImBuf *BKE_image_get_ibuf(Image *ima, ImageUser *iuser)
else if(ima->ok==0)
return NULL;
BLI_lock_thread(LOCK_IMAGE);
/* handle image source and types */
if(ima->source==IMA_SRC_MOVIE) {
/* source is from single file, use flipbook to store ibuf */
int frame= iuser?iuser->framenr:ima->lastframe;
ibuf= image_get_ibuf(ima, 0, frame);
if(ibuf==NULL)
ibuf= image_load_movie_file(ima, iuser, frame);
}
else if(ima->source==IMA_SRC_SEQUENCE) {
if(ima->type==IMA_TYPE_IMAGE) {
/* regular files, ibufs in flipbook, allows saving */
int frame= iuser?iuser->framenr:ima->lastframe;
ibuf= image_get_ibuf(ima, 0, frame);
if(ibuf==NULL)
ibuf= image_load_sequence_file(ima, iuser, frame);
else
BLI_strncpy(ima->name, ibuf->name, sizeof(ima->name));
/* try to get the ibuf without locking */
ibuf= image_get_ibuf_threadsafe(ima, iuser, &frame, &index);
if(ibuf == NULL) {
/* couldn't get ibuf and image is not ok, so let's lock and try to
* load the image */
BLI_lock_thread(LOCK_IMAGE);
/* need to check ok flag and loading ibuf again, because the situation
* might have changed in the meantime */
if(iuser) {
if(iuser->ok==0) {
BLI_unlock_thread(LOCK_IMAGE);
return NULL;
}
}
/* no else; on load the ima type can change */
if(ima->type==IMA_TYPE_MULTILAYER) {
/* only 1 layer/pass stored in imbufs, no exrhandle anim storage, no saving */
int frame= iuser?iuser->framenr:ima->lastframe;
int index= iuser?iuser->multi_index:IMA_NO_INDEX;
ibuf= image_get_ibuf(ima, index, frame);
if(G.rt) printf("seq multi fra %d id %d ibuf %p %s\n", frame, index, ibuf, ima->id.name);
if(ibuf==NULL)
ibuf= image_load_sequence_multilayer(ima, iuser, frame);
else
BLI_strncpy(ima->name, ibuf->name, sizeof(ima->name));
else if(ima->ok==0) {
BLI_unlock_thread(LOCK_IMAGE);
return NULL;
}
}
else if(ima->source==IMA_SRC_FILE) {
if(ima->type==IMA_TYPE_IMAGE) {
ibuf= image_get_ibuf(ima, IMA_NO_INDEX, 0);
if(ibuf==NULL)
ibuf= image_load_image_file(ima, iuser, G.scene->r.cfra); /* cfra only for '#', this global is OK */
}
/* no else; on load the ima type can change */
if(ima->type==IMA_TYPE_MULTILAYER) {
/* keeps render result, stores ibufs in listbase, allows saving */
ibuf= image_get_ibuf(ima, iuser?iuser->multi_index:IMA_NO_INDEX, 0);
if(ibuf==NULL)
ibuf= image_get_ibuf_multilayer(ima, iuser);
}
}
else if(ima->source == IMA_SRC_GENERATED) {
/* generated is: ibuf is allocated dynamically */
ibuf= image_get_ibuf(ima, IMA_NO_INDEX, 0);
if(ibuf==NULL) {
if(ima->type==IMA_TYPE_VERSE) {
/* todo */
ibuf= image_get_ibuf_threadsafe(ima, iuser, &frame, &index);
if(ibuf == NULL) {
/* we are sure we have to load the ibuf, using source and type */
if(ima->source==IMA_SRC_MOVIE) {
/* source is from single file, use flipbook to store ibuf */
ibuf= image_load_movie_file(ima, iuser, frame);
}
else { /* always fall back to IMA_TYPE_UV_TEST */
/* UV testgrid or black or solid etc */
if(ima->gen_x==0) ima->gen_x= 256;
if(ima->gen_y==0) ima->gen_y= 256;
ibuf= add_ibuf_size(ima->gen_x, ima->gen_y, ima->name, 0, ima->gen_type, color);
image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
ima->ok= IMA_OK_LOADED;
}
}
}
else if(ima->source == IMA_SRC_VIEWER) {
if(ima->type==IMA_TYPE_R_RESULT) {
/* always verify entirely */
ibuf= image_get_render_result(ima, iuser);
}
else if(ima->type==IMA_TYPE_COMPOSITE) {
int frame= iuser?iuser->framenr:0;
/* Composite Viewer, all handled in compositor */
ibuf= image_get_ibuf(ima, 0, frame);
if(ibuf==NULL) {
/* fake ibuf, will be filled in compositor */
ibuf= IMB_allocImBuf(256, 256, 32, IB_rect, 0);
image_assign_ibuf(ima, ibuf, 0, frame);
else if(ima->source==IMA_SRC_SEQUENCE) {
if(ima->type==IMA_TYPE_IMAGE) {
/* regular files, ibufs in flipbook, allows saving */
ibuf= image_load_sequence_file(ima, iuser, frame);
}
/* no else; on load the ima type can change */
if(ima->type==IMA_TYPE_MULTILAYER) {
/* only 1 layer/pass stored in imbufs, no exrhandle anim storage, no saving */
ibuf= image_load_sequence_multilayer(ima, iuser, frame);
}
if(ibuf)
BLI_strncpy(ima->name, ibuf->name, sizeof(ima->name));
}
else if(ima->source==IMA_SRC_FILE) {
if(ima->type==IMA_TYPE_IMAGE)
ibuf= image_load_image_file(ima, iuser, G.scene->r.cfra); /* cfra only for '#', this global is OK */
/* no else; on load the ima type can change */
if(ima->type==IMA_TYPE_MULTILAYER)
/* keeps render result, stores ibufs in listbase, allows saving */
ibuf= image_get_ibuf_multilayer(ima, iuser);
}
else if(ima->source == IMA_SRC_GENERATED) {
/* generated is: ibuf is allocated dynamically */
if(ima->type==IMA_TYPE_VERSE) {
/* todo */
}
else { /* always fall back to IMA_TYPE_UV_TEST */
/* UV testgrid or black or solid etc */
if(ima->gen_x==0) ima->gen_x= 256;
if(ima->gen_y==0) ima->gen_y= 256;
ibuf= add_ibuf_size(ima->gen_x, ima->gen_y, ima->name, 0, ima->gen_type, color);
image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
ima->ok= IMA_OK_LOADED;
}
}
else if(ima->source == IMA_SRC_VIEWER) {
if(ima->type==IMA_TYPE_R_RESULT) {
/* always verify entirely */
ibuf= image_get_render_result(ima, iuser);
}
else if(ima->type==IMA_TYPE_COMPOSITE) {
/* Composite Viewer, all handled in compositor */
/* fake ibuf, will be filled in compositor */
ibuf= IMB_allocImBuf(256, 256, 32, IB_rect, 0);
image_assign_ibuf(ima, ibuf, 0, frame);
}
}
}
BLI_unlock_thread(LOCK_IMAGE);
}
/* we assuming that if it is not rendering, it's also not multithreaded
* (a somewhat weak assumption) */
if(G.rendering==0)
tag_image_time(ima);
BLI_unlock_thread(LOCK_IMAGE);
return ibuf;
}

View File

@@ -1363,8 +1363,9 @@ void find_first_points(PROCESS *mbproc, MetaBall *mb, int a)
out_v = mbproc->function(out.x, out.y, out.z);
/* find "first points" on Implicit Surface of MetaElemnt ml */
//converge(&in, &out, in_v, out_v, mbproc->function, &mbproc->start, mb, 0);
workp = in;
workp.x = in.x;
workp.y = in.y;
workp.z = in.z;
workp_v = in_v;
max_len = sqrt((out.x-in.x)*(out.x-in.x) + (out.y-in.y)*(out.y-in.y) + (out.z-in.z)*(out.z-in.z));

View File

@@ -6068,6 +6068,8 @@ static void explodeModifier_copyData(ModifierData *md, ModifierData *target)
temd->facepa = 0;
temd->flag = emd->flag;
temd->protect = emd->protect;
temd->vgroup = emd->vgroup;
}
static int explodeModifier_dependsOnTime(ModifierData *md)
{

View File

@@ -1233,6 +1233,7 @@ Object *copy_object(Object *ob)
void expand_local_object(Object *ob)
{
bActionStrip *strip;
ParticleSystem *psys;
int a;
id_lib_extern((ID *)ob->action);
@@ -1246,7 +1247,8 @@ void expand_local_object(Object *ob)
for (strip=ob->nlastrips.first; strip; strip=strip->next) {
id_lib_extern((ID *)strip->act);
}
for(psys=ob->particlesystem.first; psys; psys=psys->next)
id_lib_extern((ID *)psys->part);
}
void make_local_object(Object *ob)
@@ -1389,7 +1391,7 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
ob->mat = MEM_dupallocN(target->mat);
for(i=0; i<target->totcol; i++) {
/* dont need to run test_object_materials since we know this object is new and not used elsewhere */
id_us_plus(ob->mat[i]);
id_us_plus((ID *)ob->mat[i]);
}
}

View File

@@ -3019,7 +3019,7 @@ ParticleSettings *psys_copy_settings(ParticleSettings *part)
return partn;
}
void psys_make_local_settings(ParticleSettings *part)
void make_local_particlesettings(ParticleSettings *part)
{
Object *ob;
ParticleSettings *par;

View File

@@ -99,7 +99,7 @@ float CalcNormFloat4(float *v1, float *v2, float *v3, float *v4, float *n);
void CalcNormLong(int *v1, int *v2, int *v3, float *n);
/* CalcNormShort: is ook uitprodukt - (translates as 'is also out/cross product') */
void CalcNormShort(short *v1, short *v2, short *v3, float *n);
float power_of_2(float val);
/**
* @section Euler conversion routines

View File

@@ -113,7 +113,8 @@ void RegisterBlendExtension(char * str);
DIR *opendir (const char *path);
struct dirent *readdir(DIR *dp);
int closedir (DIR *dp);
void get_default_root(char* root);
void get_default_root(char *root);
int check_file_chars(char *filename);
#endif /* __WINSTUFF_H__ */

View File

@@ -4540,3 +4540,8 @@ void tangent_from_uv(float *uv1, float *uv2, float *uv3, float *co1, float *co2,
if ((ct[0]*n[0] + ct[1]*n[1] + ct[2]*n[2]) < 0.0f)
VecMulf(tang, -1.0f);
}
/* used for zoom values*/
float power_of_2(float val) {
return pow(2, ceil(log(val) / log(2)));
}

View File

@@ -387,55 +387,521 @@ static char p[512+2]= {
float g[512+2][3]= {
0.33783,0.715698,-0.611206,-0.944031,-0.326599,-0.045624,-0.101074,-0.416443,-0.903503,0.799286,0.49411,-0.341949,-0.854645,0.518036,0.033936,0.42514,-0.437866,-0.792114,-0.358948,0.597046,0.717377,-0.985413,0.144714,0.089294,-0.601776,-0.33728,-0.723907,-0.449921,0.594513,0.666382,0.208313,-0.10791,
0.972076,0.575317,0.060425,0.815643,0.293365,-0.875702,-0.383453,0.293762,0.465759,0.834686,-0.846008,-0.233398,-0.47934,-0.115814,0.143036,-0.98291,0.204681,-0.949036,-0.239532,0.946716,-0.263947,0.184326,-0.235596,0.573822,0.784332,0.203705,-0.372253,-0.905487,0.756989,-0.651031,0.055298,0.497803,
0.814697,-0.297363,-0.16214,0.063995,-0.98468,-0.329254,0.834381,0.441925,0.703827,-0.527039,-0.476227,0.956421,0.266113,0.119781,0.480133,0.482849,0.7323,-0.18631,0.961212,-0.203125,-0.748474,-0.656921,-0.090393,-0.085052,-0.165253,0.982544,-0.76947,0.628174,-0.115234,0.383148,0.537659,0.751068,
0.616486,-0.668488,-0.415924,-0.259979,-0.630005,0.73175,0.570953,-0.087952,0.816223,-0.458008,0.023254,0.888611,-0.196167,0.976563,-0.088287,-0.263885,-0.69812,-0.665527,0.437134,-0.892273,-0.112793,-0.621674,-0.230438,0.748566,0.232422,0.900574,-0.367249,0.22229,-0.796143,0.562744,-0.665497,-0.73764,
0.11377,0.670135,0.704803,0.232605,0.895599,0.429749,-0.114655,-0.11557,-0.474243,0.872742,0.621826,0.604004,-0.498444,-0.832214,0.012756,0.55426,-0.702484,0.705994,-0.089661,-0.692017,0.649292,0.315399,-0.175995,-0.977997,0.111877,0.096954,-0.04953,0.994019,0.635284,-0.606689,-0.477783,-0.261261,
-0.607422,-0.750153,0.983276,0.165436,0.075958,-0.29837,0.404083,-0.864655,-0.638672,0.507721,0.578156,0.388214,0.412079,0.824249,0.556183,-0.208832,0.804352,0.778442,0.562012,0.27951,-0.616577,0.781921,-0.091522,0.196289,0.051056,0.979187,-0.121216,0.207153,-0.970734,-0.173401,-0.384735,0.906555,
0.161499,-0.723236,-0.671387,0.178497,-0.006226,-0.983887,-0.126038,0.15799,0.97934,0.830475,-0.024811,0.556458,-0.510132,-0.76944,0.384247,0.81424,0.200104,-0.544891,-0.112549,-0.393311,-0.912445,0.56189,0.152222,-0.813049,0.198914,-0.254517,-0.946381,-0.41217,0.690979,-0.593811,-0.407257,0.324524,
0.853668,-0.690186,0.366119,-0.624115,-0.428345,0.844147,-0.322296,-0.21228,-0.297546,-0.930756,-0.273071,0.516113,0.811798,0.928314,0.371643,0.007233,0.785828,-0.479218,-0.390778,-0.704895,0.058929,0.706818,0.173248,0.203583,0.963562,0.422211,-0.904297,-0.062469,-0.363312,-0.182465,0.913605,0.254028,
-0.552307,-0.793945,-0.28891,-0.765747,-0.574554,0.058319,0.291382,0.954803,0.946136,-0.303925,0.111267,-0.078156,0.443695,-0.892731,0.182098,0.89389,0.409515,-0.680298,-0.213318,0.701141,0.062469,0.848389,-0.525635,-0.72879,-0.641846,0.238342,-0.88089,0.427673,0.202637,-0.532501,-0.21405,0.818878,
0.948975,-0.305084,0.07962,0.925446,0.374664,0.055817,0.820923,0.565491,0.079102,0.25882,0.099792,-0.960724,-0.294617,0.910522,0.289978,0.137115,0.320038,-0.937408,-0.908386,0.345276,-0.235718,-0.936218,0.138763,0.322754,0.366577,0.925934,-0.090637,0.309296,-0.686829,-0.657684,0.66983,0.024445,
0.742065,-0.917999,-0.059113,-0.392059,0.365509,0.462158,-0.807922,0.083374,0.996399,-0.014801,0.593842,0.253143,-0.763672,0.974976,-0.165466,0.148285,0.918976,0.137299,0.369537,0.294952,0.694977,0.655731,0.943085,0.152618,-0.295319,0.58783,-0.598236,0.544495,0.203796,0.678223,0.705994,-0.478821,
-0.661011,0.577667,0.719055,-0.1698,-0.673828,-0.132172,-0.965332,0.225006,-0.981873,-0.14502,0.121979,0.763458,0.579742,0.284546,-0.893188,0.079681,0.442474,-0.795776,-0.523804,0.303802,0.734955,0.67804,-0.007446,0.15506,0.986267,-0.056183,0.258026,0.571503,-0.778931,-0.681549,-0.702087,-0.206116,
-0.96286,-0.177185,0.203613,-0.470978,-0.515106,0.716095,-0.740326,0.57135,0.354095,-0.56012,-0.824982,-0.074982,-0.507874,0.753204,0.417969,-0.503113,0.038147,0.863342,0.594025,0.673553,-0.439758,-0.119873,-0.005524,-0.992737,0.098267,-0.213776,0.971893,-0.615631,0.643951,0.454163,0.896851,-0.441071,
0.032166,-0.555023,0.750763,-0.358093,0.398773,0.304688,0.864929,-0.722961,0.303589,0.620544,-0.63559,-0.621948,-0.457306,-0.293243,0.072327,0.953278,-0.491638,0.661041,-0.566772,-0.304199,-0.572083,-0.761688,0.908081,-0.398956,0.127014,-0.523621,-0.549683,-0.650848,-0.932922,-0.19986,0.299408,0.099426,
0.140869,0.984985,-0.020325,-0.999756,-0.002319,0.952667,0.280853,-0.11615,-0.971893,0.082581,0.220337,0.65921,0.705292,-0.260651,0.733063,-0.175537,0.657043,-0.555206,0.429504,-0.712189,0.400421,-0.89859,0.179352,0.750885,-0.19696,0.630341,0.785675,-0.569336,0.241821,-0.058899,-0.464111,0.883789,
0.129608,-0.94519,0.299622,-0.357819,0.907654,0.219238,-0.842133,-0.439117,-0.312927,-0.313477,0.84433,0.434479,-0.241211,0.053253,0.968994,0.063873,0.823273,0.563965,0.476288,0.862152,-0.172516,0.620941,-0.298126,0.724915,0.25238,-0.749359,-0.612122,-0.577545,0.386566,0.718994,-0.406342,-0.737976,
0.538696,0.04718,0.556305,0.82959,-0.802856,0.587463,0.101166,-0.707733,-0.705963,0.026428,0.374908,0.68457,0.625092,0.472137,0.208405,-0.856506,-0.703064,-0.581085,-0.409821,-0.417206,-0.736328,0.532623,-0.447876,-0.20285,-0.870728,0.086945,-0.990417,0.107086,0.183685,0.018341,-0.982788,0.560638,
-0.428864,0.708282,0.296722,-0.952576,-0.0672,0.135773,0.990265,0.030243,-0.068787,0.654724,0.752686,0.762604,-0.551758,0.337585,-0.819611,-0.407684,0.402466,-0.727844,-0.55072,-0.408539,-0.855774,-0.480011,0.19281,0.693176,-0.079285,0.716339,0.226013,0.650116,-0.725433,0.246704,0.953369,-0.173553,
-0.970398,-0.239227,-0.03244,0.136383,-0.394318,0.908752,0.813232,0.558167,0.164368,0.40451,0.549042,-0.731323,-0.380249,-0.566711,0.730865,0.022156,0.932739,0.359741,0.00824,0.996552,-0.082306,0.956635,-0.065338,-0.283722,-0.743561,0.008209,0.668579,-0.859589,-0.509674,0.035767,-0.852234,0.363678,
-0.375977,-0.201965,-0.970795,-0.12915,0.313477,0.947327,0.06546,-0.254028,-0.528259,0.81015,0.628052,0.601105,0.49411,-0.494385,0.868378,0.037933,0.275635,-0.086426,0.957336,-0.197937,0.468903,-0.860748,0.895599,0.399384,0.195801,0.560791,0.825012,-0.069214,0.304199,-0.849487,0.43103,0.096375,
0.93576,0.339111,-0.051422,0.408966,-0.911072,0.330444,0.942841,-0.042389,-0.452362,-0.786407,0.420563,0.134308,-0.933472,-0.332489,0.80191,-0.566711,-0.188934,-0.987946,-0.105988,0.112518,-0.24408,0.892242,-0.379791,-0.920502,0.229095,-0.316376,0.7789,0.325958,0.535706,-0.912872,0.185211,-0.36377,
-0.184784,0.565369,-0.803833,-0.018463,0.119537,0.992615,-0.259247,-0.935608,0.239532,-0.82373,-0.449127,-0.345947,-0.433105,0.659515,0.614349,-0.822754,0.378845,-0.423676,0.687195,-0.674835,-0.26889,-0.246582,-0.800842,0.545715,-0.729187,-0.207794,0.651978,0.653534,-0.610443,-0.447388,0.492584,-0.023346,
0.869934,0.609039,0.009094,-0.79306,0.962494,-0.271088,-0.00885,0.2659,-0.004913,0.963959,0.651245,0.553619,-0.518951,0.280548,-0.84314,0.458618,-0.175293,-0.983215,0.049805,0.035339,-0.979919,0.196045,-0.982941,0.164307,-0.082245,0.233734,-0.97226,-0.005005,-0.747253,-0.611328,0.260437,0.645599,
0.592773,0.481384,0.117706,-0.949524,-0.29068,-0.535004,-0.791901,-0.294312,-0.627167,-0.214447,0.748718,-0.047974,-0.813477,-0.57959,-0.175537,0.477264,-0.860992,0.738556,-0.414246,-0.53183,0.562561,-0.704071,0.433289,-0.754944,0.64801,-0.100586,0.114716,0.044525,-0.992371,0.966003,0.244873,-0.082764,
0.33783,0.715698,-0.611206,-0.944031,-0.326599,-0.045624,-0.101074,-0.416443,-0.903503,0.799286,0.49411,-0.341949,-0.854645,0.518036,0.033936,0.42514,-0.437866,-0.792114,-0.358948,0.597046,0.717377,-0.985413,0.144714,0.089294,-0.601776,-0.33728,-0.723907,-0.449921,0.594513,0.666382,0.208313,-0.10791,
0.972076,0.575317,0.060425,0.815643,0.293365,-0.875702,-0.383453,0.293762,0.465759,0.834686,-0.846008,-0.233398,-0.47934,-0.115814,0.143036,-0.98291,0.204681,-0.949036,-0.239532,0.946716,-0.263947,0.184326,-0.235596,0.573822,0.784332,0.203705,-0.372253,-0.905487,0.756989,-0.651031,0.055298,0.497803,
0.814697,-0.297363,-0.16214,0.063995,-0.98468,-0.329254,0.834381,0.441925,0.703827,-0.527039,-0.476227,0.956421,0.266113,0.119781,0.480133,0.482849,0.7323,-0.18631,0.961212,-0.203125,-0.748474,-0.656921,-0.090393,-0.085052,-0.165253,0.982544,-0.76947,0.628174,-0.115234,0.383148,0.537659,0.751068,
0.616486,-0.668488,-0.415924,-0.259979,-0.630005,0.73175,0.570953,-0.087952,0.816223,-0.458008,0.023254,0.888611,-0.196167,0.976563,-0.088287,-0.263885,-0.69812,-0.665527,0.437134,-0.892273,-0.112793,-0.621674,-0.230438,0.748566,0.232422,0.900574,-0.367249,0.22229,-0.796143,0.562744,-0.665497,-0.73764,
0.11377,0.670135,0.704803,0.232605,0.895599,0.429749,-0.114655,-0.11557,-0.474243,0.872742,0.621826,0.604004,-0.498444,-0.832214,0.012756,0.55426,-0.702484,0.705994,-0.089661,-0.692017,0.649292,0.315399,-0.175995,-0.977997,0.111877,0.096954,-0.04953,0.994019,0.635284,-0.606689,-0.477783,-0.261261,
-0.607422,-0.750153,0.983276,0.165436,0.075958,-0.29837,0.404083,-0.864655,-0.638672,0.507721,0.578156,0.388214,0.412079,0.824249,0.556183,-0.208832,0.804352,0.778442,0.562012,0.27951,-0.616577,0.781921,-0.091522,0.196289,0.051056,0.979187,-0.121216,0.207153,-0.970734,-0.173401,-0.384735,0.906555,
0.161499,-0.723236,-0.671387,0.178497,-0.006226,-0.983887,-0.126038,0.15799,0.97934,0.830475,-0.024811,0.556458,-0.510132,-0.76944,0.384247,0.81424,0.200104,-0.544891,-0.112549,-0.393311,-0.912445,0.56189,0.152222,-0.813049,0.198914,-0.254517,-0.946381,-0.41217,0.690979,-0.593811,-0.407257,0.324524,
0.853668,-0.690186,0.366119,-0.624115,-0.428345,0.844147,-0.322296,-0.21228,-0.297546,-0.930756,-0.273071,0.516113,0.811798,0.928314,0.371643,0.007233,0.785828,-0.479218,-0.390778,-0.704895,0.058929,0.706818,0.173248,0.203583,0.963562,0.422211,-0.904297,-0.062469,-0.363312,-0.182465,0.913605,0.254028,
-0.552307,-0.793945,-0.28891,-0.765747,-0.574554,0.058319,0.291382,0.954803,0.946136,-0.303925,0.111267,-0.078156,0.443695,-0.892731,0.182098,0.89389,0.409515,-0.680298,-0.213318,0.701141,0.062469,0.848389,-0.525635,-0.72879,-0.641846,0.238342,-0.88089,0.427673,0.202637,-0.532501,-0.21405,0.818878,
0.948975,-0.305084,0.07962,0.925446,0.374664,0.055817,0.820923,0.565491,0.079102,0.25882,0.099792,-0.960724,-0.294617,0.910522,0.289978,0.137115,0.320038,-0.937408,-0.908386,0.345276,-0.235718,-0.936218,0.138763,0.322754,0.366577,0.925934,-0.090637,0.309296,-0.686829,-0.657684,0.66983,0.024445,
0.742065,-0.917999,-0.059113,-0.392059,0.365509,0.462158,-0.807922,0.083374,0.996399,-0.014801,0.593842,0.253143,-0.763672,0.974976,-0.165466,0.148285,0.918976,0.137299,0.369537,0.294952,0.694977,0.655731,0.943085,0.152618,-0.295319,0.58783,-0.598236,0.544495,0.203796,0.678223,0.705994,-0.478821,
-0.661011,0.577667,0.719055,-0.1698,-0.673828,-0.132172,-0.965332,0.225006,-0.981873,-0.14502,0.121979,0.763458,0.579742,0.284546,-0.893188,0.079681,0.442474,-0.795776,-0.523804,0.303802,0.734955,0.67804,-0.007446,0.15506,0.986267,-0.056183,0.258026,0.571503,-0.778931,-0.681549,-0.702087,-0.206116,
-0.96286,-0.177185,0.203613,-0.470978,-0.515106,0.716095,-0.740326,0.57135,0.354095,-0.56012,-0.824982,-0.074982,-0.507874,0.753204,0.417969,-0.503113,0.038147,0.863342,0.594025,0.673553,-0.439758,-0.119873,-0.005524,-0.992737,0.098267,-0.213776,0.971893,-0.615631,0.643951,0.454163,0.896851,-0.441071,
0.032166,-0.555023,0.750763,-0.358093,0.398773,0.304688,0.864929,-0.722961,0.303589,0.620544,-0.63559,-0.621948,-0.457306,-0.293243,0.072327,0.953278,-0.491638,0.661041,-0.566772,-0.304199,-0.572083,-0.761688,0.908081,-0.398956,0.127014,-0.523621,-0.549683,-0.650848,-0.932922,-0.19986,0.299408,0.099426,
0.140869,0.984985,-0.020325,-0.999756,-0.002319,0.952667,0.280853,-0.11615,-0.971893,0.082581,0.220337,0.65921,0.705292,-0.260651,0.733063,-0.175537,0.657043,-0.555206,0.429504,-0.712189,0.400421,-0.89859,0.179352,0.750885,-0.19696,0.630341,0.785675,-0.569336,0.241821,-0.058899,-0.464111,0.883789,
0.129608,-0.94519,0.299622,-0.357819,0.907654,0.219238,-0.842133,-0.439117,-0.312927,-0.313477,0.84433,0.434479,-0.241211,0.053253,0.968994,0.063873,0.823273,0.563965,0.476288,0.862152,-0.172516,0.620941,-0.298126,0.724915,0.25238,-0.749359,-0.612122,-0.577545,0.386566,0.718994,-0.406342,-0.737976,
0.538696,0.04718,0.556305,0.82959,-0.802856,0.587463,0.101166,-0.707733,-0.705963,0.026428,0.374908,0.68457,0.625092,0.472137,0.208405,-0.856506,-0.703064,-0.581085,-0.409821,-0.417206,-0.736328,0.532623,-0.447876,-0.20285,-0.870728,0.086945,-0.990417,0.107086,0.183685,0.018341,-0.982788,0.560638,
-0.428864,0.708282,0.296722,-0.952576,-0.0672,0.135773,0.990265,0.030243,-0.068787,0.654724,0.752686,0.762604,-0.551758,0.337585,-0.819611,-0.407684,0.402466,-0.727844,-0.55072,-0.408539,-0.855774,-0.480011,0.19281,0.693176,-0.079285,0.716339,0.226013,0.650116,-0.725433,0.246704,0.953369,-0.173553,
-0.970398,-0.239227,-0.03244,0.136383,-0.394318,0.908752,0.813232,0.558167,0.164368,0.40451,0.549042,-0.731323,-0.380249,-0.566711,0.730865,0.022156,0.932739,0.359741,0.00824,0.996552,-0.082306,0.956635,-0.065338,-0.283722,-0.743561,0.008209,0.668579,-0.859589,-0.509674,0.035767,-0.852234,0.363678,
-0.375977,-0.201965,-0.970795,-0.12915,0.313477,0.947327,0.06546,-0.254028,-0.528259,0.81015,0.628052,0.601105,0.49411,-0.494385,0.868378,0.037933,0.275635,-0.086426,0.957336,-0.197937,0.468903,-0.860748,0.895599,0.399384,0.195801,0.560791,0.825012,-0.069214,0.304199,-0.849487,0.43103,0.096375,
0.93576,0.339111,-0.051422,0.408966,-0.911072,0.330444,0.942841,-0.042389,-0.452362,-0.786407,0.420563,0.134308,-0.933472,-0.332489,0.80191,-0.566711,-0.188934,-0.987946,-0.105988,0.112518,-0.24408,0.892242,-0.379791,-0.920502,0.229095,-0.316376,0.7789,0.325958,0.535706,-0.912872,0.185211,-0.36377,
-0.184784,0.565369,-0.803833,-0.018463,0.119537,0.992615,-0.259247,-0.935608,0.239532,-0.82373,-0.449127,-0.345947,-0.433105,0.659515,0.614349,-0.822754,0.378845,-0.423676,0.687195,-0.674835,-0.26889,-0.246582,-0.800842,0.545715,-0.729187,-0.207794,0.651978,0.653534,-0.610443,-0.447388,0.492584,-0.023346,
0.869934,0.609039,0.009094,-0.79306,0.962494,-0.271088,-0.00885,0.2659,-0.004913,0.963959,0.651245,0.553619,-0.518951,0.280548,-0.84314,0.458618,-0.175293,-0.983215,0.049805,0.035339,-0.979919,0.196045,-0.982941,0.164307,-0.082245,0.233734,-0.97226,-0.005005,-0.747253,-0.611328,0.260437,0.645599,
0.592773,0.481384,0.117706,-0.949524,-0.29068,-0.535004,-0.791901,-0.294312,-0.627167,-0.214447,0.748718,-0.047974,-0.813477,-0.57959,-0.175537,0.477264,-0.860992,0.738556,-0.414246,-0.53183,0.562561,-0.704071,0.433289,-0.754944,0.64801,-0.100586,0.114716,0.044525,-0.992371,0.966003,0.244873,-0.082764,
0.33783,0.715698,-0.611206,-0.944031,-0.326599,-0.045624};
{0.33783, 0.715698, -0.611206},
{-0.944031, -0.326599, -0.045624},
{-0.101074, -0.416443, -0.903503},
{0.799286, 0.49411, -0.341949},
{-0.854645, 0.518036, 0.033936},
{0.42514, -0.437866, -0.792114},
{-0.358948, 0.597046, 0.717377},
{-0.985413, 0.144714, 0.089294},
{-0.601776, -0.33728, -0.723907},
{-0.449921, 0.594513, 0.666382},
{0.208313, -0.10791, 0.972076},
{0.575317, 0.060425, 0.815643},
{0.293365, -0.875702, -0.383453},
{0.293762, 0.465759, 0.834686},
{-0.846008, -0.233398, -0.47934},
{-0.115814, 0.143036, -0.98291},
{0.204681, -0.949036, -0.239532},
{0.946716, -0.263947, 0.184326},
{-0.235596, 0.573822, 0.784332},
{0.203705, -0.372253, -0.905487},
{0.756989, -0.651031, 0.055298},
{0.497803, 0.814697, -0.297363},
{-0.16214, 0.063995, -0.98468},
{-0.329254, 0.834381, 0.441925},
{0.703827, -0.527039, -0.476227},
{0.956421, 0.266113, 0.119781},
{0.480133, 0.482849, 0.7323},
{-0.18631, 0.961212, -0.203125},
{-0.748474, -0.656921, -0.090393},
{-0.085052, -0.165253, 0.982544},
{-0.76947, 0.628174, -0.115234},
{0.383148, 0.537659, 0.751068},
{0.616486, -0.668488, -0.415924},
{-0.259979, -0.630005, 0.73175},
{0.570953, -0.087952, 0.816223},
{-0.458008, 0.023254, 0.888611},
{-0.196167, 0.976563, -0.088287},
{-0.263885, -0.69812, -0.665527},
{0.437134, -0.892273, -0.112793},
{-0.621674, -0.230438, 0.748566},
{0.232422, 0.900574, -0.367249},
{0.22229, -0.796143, 0.562744},
{-0.665497, -0.73764, 0.11377},
{0.670135, 0.704803, 0.232605},
{0.895599, 0.429749, -0.114655},
{-0.11557, -0.474243, 0.872742},
{0.621826, 0.604004, -0.498444},
{-0.832214, 0.012756, 0.55426},
{-0.702484, 0.705994, -0.089661},
{-0.692017, 0.649292, 0.315399},
{-0.175995, -0.977997, 0.111877},
{0.096954, -0.04953, 0.994019},
{0.635284, -0.606689, -0.477783},
{-0.261261, -0.607422, -0.750153},
{0.983276, 0.165436, 0.075958},
{-0.29837, 0.404083, -0.864655},
{-0.638672, 0.507721, 0.578156},
{0.388214, 0.412079, 0.824249},
{0.556183, -0.208832, 0.804352},
{0.778442, 0.562012, 0.27951},
{-0.616577, 0.781921, -0.091522},
{0.196289, 0.051056, 0.979187},
{-0.121216, 0.207153, -0.970734},
{-0.173401, -0.384735, 0.906555},
{0.161499, -0.723236, -0.671387},
{0.178497, -0.006226, -0.983887},
{-0.126038, 0.15799, 0.97934},
{0.830475, -0.024811, 0.556458},
{-0.510132, -0.76944, 0.384247},
{0.81424, 0.200104, -0.544891},
{-0.112549, -0.393311, -0.912445},
{0.56189, 0.152222, -0.813049},
{0.198914, -0.254517, -0.946381},
{-0.41217, 0.690979, -0.593811},
{-0.407257, 0.324524, 0.853668},
{-0.690186, 0.366119, -0.624115},
{-0.428345, 0.844147, -0.322296},
{-0.21228, -0.297546, -0.930756},
{-0.273071, 0.516113, 0.811798},
{0.928314, 0.371643, 0.007233},
{0.785828, -0.479218, -0.390778},
{-0.704895, 0.058929, 0.706818},
{0.173248, 0.203583, 0.963562},
{0.422211, -0.904297, -0.062469},
{-0.363312, -0.182465, 0.913605},
{0.254028, -0.552307, -0.793945},
{-0.28891, -0.765747, -0.574554},
{0.058319, 0.291382, 0.954803},
{0.946136, -0.303925, 0.111267},
{-0.078156, 0.443695, -0.892731},
{0.182098, 0.89389, 0.409515},
{-0.680298, -0.213318, 0.701141},
{0.062469, 0.848389, -0.525635},
{-0.72879, -0.641846, 0.238342},
{-0.88089, 0.427673, 0.202637},
{-0.532501, -0.21405, 0.818878},
{0.948975, -0.305084, 0.07962},
{0.925446, 0.374664, 0.055817},
{0.820923, 0.565491, 0.079102},
{0.25882, 0.099792, -0.960724},
{-0.294617, 0.910522, 0.289978},
{0.137115, 0.320038, -0.937408},
{-0.908386, 0.345276, -0.235718},
{-0.936218, 0.138763, 0.322754},
{0.366577, 0.925934, -0.090637},
{0.309296, -0.686829, -0.657684},
{0.66983, 0.024445, 0.742065},
{-0.917999, -0.059113, -0.392059},
{0.365509, 0.462158, -0.807922},
{0.083374, 0.996399, -0.014801},
{0.593842, 0.253143, -0.763672},
{0.974976, -0.165466, 0.148285},
{0.918976, 0.137299, 0.369537},
{0.294952, 0.694977, 0.655731},
{0.943085, 0.152618, -0.295319},
{0.58783, -0.598236, 0.544495},
{0.203796, 0.678223, 0.705994},
{-0.478821, -0.661011, 0.577667},
{0.719055, -0.1698, -0.673828},
{-0.132172, -0.965332, 0.225006},
{-0.981873, -0.14502, 0.121979},
{0.763458, 0.579742, 0.284546},
{-0.893188, 0.079681, 0.442474},
{-0.795776, -0.523804, 0.303802},
{0.734955, 0.67804, -0.007446},
{0.15506, 0.986267, -0.056183},
{0.258026, 0.571503, -0.778931},
{-0.681549, -0.702087, -0.206116},
{-0.96286, -0.177185, 0.203613},
{-0.470978, -0.515106, 0.716095},
{-0.740326, 0.57135, 0.354095},
{-0.56012, -0.824982, -0.074982},
{-0.507874, 0.753204, 0.417969},
{-0.503113, 0.038147, 0.863342},
{0.594025, 0.673553, -0.439758},
{-0.119873, -0.005524, -0.992737},
{0.098267, -0.213776, 0.971893},
{-0.615631, 0.643951, 0.454163},
{0.896851, -0.441071, 0.032166},
{-0.555023, 0.750763, -0.358093},
{0.398773, 0.304688, 0.864929},
{-0.722961, 0.303589, 0.620544},
{-0.63559, -0.621948, -0.457306},
{-0.293243, 0.072327, 0.953278},
{-0.491638, 0.661041, -0.566772},
{-0.304199, -0.572083, -0.761688},
{0.908081, -0.398956, 0.127014},
{-0.523621, -0.549683, -0.650848},
{-0.932922, -0.19986, 0.299408},
{0.099426, 0.140869, 0.984985},
{-0.020325, -0.999756, -0.002319},
{0.952667, 0.280853, -0.11615},
{-0.971893, 0.082581, 0.220337},
{0.65921, 0.705292, -0.260651},
{0.733063, -0.175537, 0.657043},
{-0.555206, 0.429504, -0.712189},
{0.400421, -0.89859, 0.179352},
{0.750885, -0.19696, 0.630341},
{0.785675, -0.569336, 0.241821},
{-0.058899, -0.464111, 0.883789},
{0.129608, -0.94519, 0.299622},
{-0.357819, 0.907654, 0.219238},
{-0.842133, -0.439117, -0.312927},
{-0.313477, 0.84433, 0.434479},
{-0.241211, 0.053253, 0.968994},
{0.063873, 0.823273, 0.563965},
{0.476288, 0.862152, -0.172516},
{0.620941, -0.298126, 0.724915},
{0.25238, -0.749359, -0.612122},
{-0.577545, 0.386566, 0.718994},
{-0.406342, -0.737976, 0.538696},
{0.04718, 0.556305, 0.82959},
{-0.802856, 0.587463, 0.101166},
{-0.707733, -0.705963, 0.026428},
{0.374908, 0.68457, 0.625092},
{0.472137, 0.208405, -0.856506},
{-0.703064, -0.581085, -0.409821},
{-0.417206, -0.736328, 0.532623},
{-0.447876, -0.20285, -0.870728},
{0.086945, -0.990417, 0.107086},
{0.183685, 0.018341, -0.982788},
{0.560638, -0.428864, 0.708282},
{0.296722, -0.952576, -0.0672},
{0.135773, 0.990265, 0.030243},
{-0.068787, 0.654724, 0.752686},
{0.762604, -0.551758, 0.337585},
{-0.819611, -0.407684, 0.402466},
{-0.727844, -0.55072, -0.408539},
{-0.855774, -0.480011, 0.19281},
{0.693176, -0.079285, 0.716339},
{0.226013, 0.650116, -0.725433},
{0.246704, 0.953369, -0.173553},
{-0.970398, -0.239227, -0.03244},
{0.136383, -0.394318, 0.908752},
{0.813232, 0.558167, 0.164368},
{0.40451, 0.549042, -0.731323},
{-0.380249, -0.566711, 0.730865},
{0.022156, 0.932739, 0.359741},
{0.00824, 0.996552, -0.082306},
{0.956635, -0.065338, -0.283722},
{-0.743561, 0.008209, 0.668579},
{-0.859589, -0.509674, 0.035767},
{-0.852234, 0.363678, -0.375977},
{-0.201965, -0.970795, -0.12915},
{0.313477, 0.947327, 0.06546},
{-0.254028, -0.528259, 0.81015},
{0.628052, 0.601105, 0.49411},
{-0.494385, 0.868378, 0.037933},
{0.275635, -0.086426, 0.957336},
{-0.197937, 0.468903, -0.860748},
{0.895599, 0.399384, 0.195801},
{0.560791, 0.825012, -0.069214},
{0.304199, -0.849487, 0.43103},
{0.096375, 0.93576, 0.339111},
{-0.051422, 0.408966, -0.911072},
{0.330444, 0.942841, -0.042389},
{-0.452362, -0.786407, 0.420563},
{0.134308, -0.933472, -0.332489},
{0.80191, -0.566711, -0.188934},
{-0.987946, -0.105988, 0.112518},
{-0.24408, 0.892242, -0.379791},
{-0.920502, 0.229095, -0.316376},
{0.7789, 0.325958, 0.535706},
{-0.912872, 0.185211, -0.36377},
{-0.184784, 0.565369, -0.803833},
{-0.018463, 0.119537, 0.992615},
{-0.259247, -0.935608, 0.239532},
{-0.82373, -0.449127, -0.345947},
{-0.433105, 0.659515, 0.614349},
{-0.822754, 0.378845, -0.423676},
{0.687195, -0.674835, -0.26889},
{-0.246582, -0.800842, 0.545715},
{-0.729187, -0.207794, 0.651978},
{0.653534, -0.610443, -0.447388},
{0.492584, -0.023346, 0.869934},
{0.609039, 0.009094, -0.79306},
{0.962494, -0.271088, -0.00885},
{0.2659, -0.004913, 0.963959},
{0.651245, 0.553619, -0.518951},
{0.280548, -0.84314, 0.458618},
{-0.175293, -0.983215, 0.049805},
{0.035339, -0.979919, 0.196045},
{-0.982941, 0.164307, -0.082245},
{0.233734, -0.97226, -0.005005},
{-0.747253, -0.611328, 0.260437},
{0.645599, 0.592773, 0.481384},
{0.117706, -0.949524, -0.29068},
{-0.535004, -0.791901, -0.294312},
{-0.627167, -0.214447, 0.748718},
{-0.047974, -0.813477, -0.57959},
{-0.175537, 0.477264, -0.860992},
{0.738556, -0.414246, -0.53183},
{0.562561, -0.704071, 0.433289},
{-0.754944, 0.64801, -0.100586},
{0.114716, 0.044525, -0.992371},
{0.966003, 0.244873, -0.082764},
{0.33783, 0.715698, -0.611206},
{-0.944031, -0.326599, -0.045624},
{-0.101074, -0.416443, -0.903503},
{0.799286, 0.49411, -0.341949},
{-0.854645, 0.518036, 0.033936},
{0.42514, -0.437866, -0.792114},
{-0.358948, 0.597046, 0.717377},
{-0.985413, 0.144714, 0.089294},
{-0.601776, -0.33728, -0.723907},
{-0.449921, 0.594513, 0.666382},
{0.208313, -0.10791, 0.972076},
{0.575317, 0.060425, 0.815643},
{0.293365, -0.875702, -0.383453},
{0.293762, 0.465759, 0.834686},
{-0.846008, -0.233398, -0.47934},
{-0.115814, 0.143036, -0.98291},
{0.204681, -0.949036, -0.239532},
{0.946716, -0.263947, 0.184326},
{-0.235596, 0.573822, 0.784332},
{0.203705, -0.372253, -0.905487},
{0.756989, -0.651031, 0.055298},
{0.497803, 0.814697, -0.297363},
{-0.16214, 0.063995, -0.98468},
{-0.329254, 0.834381, 0.441925},
{0.703827, -0.527039, -0.476227},
{0.956421, 0.266113, 0.119781},
{0.480133, 0.482849, 0.7323},
{-0.18631, 0.961212, -0.203125},
{-0.748474, -0.656921, -0.090393},
{-0.085052, -0.165253, 0.982544},
{-0.76947, 0.628174, -0.115234},
{0.383148, 0.537659, 0.751068},
{0.616486, -0.668488, -0.415924},
{-0.259979, -0.630005, 0.73175},
{0.570953, -0.087952, 0.816223},
{-0.458008, 0.023254, 0.888611},
{-0.196167, 0.976563, -0.088287},
{-0.263885, -0.69812, -0.665527},
{0.437134, -0.892273, -0.112793},
{-0.621674, -0.230438, 0.748566},
{0.232422, 0.900574, -0.367249},
{0.22229, -0.796143, 0.562744},
{-0.665497, -0.73764, 0.11377},
{0.670135, 0.704803, 0.232605},
{0.895599, 0.429749, -0.114655},
{-0.11557, -0.474243, 0.872742},
{0.621826, 0.604004, -0.498444},
{-0.832214, 0.012756, 0.55426},
{-0.702484, 0.705994, -0.089661},
{-0.692017, 0.649292, 0.315399},
{-0.175995, -0.977997, 0.111877},
{0.096954, -0.04953, 0.994019},
{0.635284, -0.606689, -0.477783},
{-0.261261, -0.607422, -0.750153},
{0.983276, 0.165436, 0.075958},
{-0.29837, 0.404083, -0.864655},
{-0.638672, 0.507721, 0.578156},
{0.388214, 0.412079, 0.824249},
{0.556183, -0.208832, 0.804352},
{0.778442, 0.562012, 0.27951},
{-0.616577, 0.781921, -0.091522},
{0.196289, 0.051056, 0.979187},
{-0.121216, 0.207153, -0.970734},
{-0.173401, -0.384735, 0.906555},
{0.161499, -0.723236, -0.671387},
{0.178497, -0.006226, -0.983887},
{-0.126038, 0.15799, 0.97934},
{0.830475, -0.024811, 0.556458},
{-0.510132, -0.76944, 0.384247},
{0.81424, 0.200104, -0.544891},
{-0.112549, -0.393311, -0.912445},
{0.56189, 0.152222, -0.813049},
{0.198914, -0.254517, -0.946381},
{-0.41217, 0.690979, -0.593811},
{-0.407257, 0.324524, 0.853668},
{-0.690186, 0.366119, -0.624115},
{-0.428345, 0.844147, -0.322296},
{-0.21228, -0.297546, -0.930756},
{-0.273071, 0.516113, 0.811798},
{0.928314, 0.371643, 0.007233},
{0.785828, -0.479218, -0.390778},
{-0.704895, 0.058929, 0.706818},
{0.173248, 0.203583, 0.963562},
{0.422211, -0.904297, -0.062469},
{-0.363312, -0.182465, 0.913605},
{0.254028, -0.552307, -0.793945},
{-0.28891, -0.765747, -0.574554},
{0.058319, 0.291382, 0.954803},
{0.946136, -0.303925, 0.111267},
{-0.078156, 0.443695, -0.892731},
{0.182098, 0.89389, 0.409515},
{-0.680298, -0.213318, 0.701141},
{0.062469, 0.848389, -0.525635},
{-0.72879, -0.641846, 0.238342},
{-0.88089, 0.427673, 0.202637},
{-0.532501, -0.21405, 0.818878},
{0.948975, -0.305084, 0.07962},
{0.925446, 0.374664, 0.055817},
{0.820923, 0.565491, 0.079102},
{0.25882, 0.099792, -0.960724},
{-0.294617, 0.910522, 0.289978},
{0.137115, 0.320038, -0.937408},
{-0.908386, 0.345276, -0.235718},
{-0.936218, 0.138763, 0.322754},
{0.366577, 0.925934, -0.090637},
{0.309296, -0.686829, -0.657684},
{0.66983, 0.024445, 0.742065},
{-0.917999, -0.059113, -0.392059},
{0.365509, 0.462158, -0.807922},
{0.083374, 0.996399, -0.014801},
{0.593842, 0.253143, -0.763672},
{0.974976, -0.165466, 0.148285},
{0.918976, 0.137299, 0.369537},
{0.294952, 0.694977, 0.655731},
{0.943085, 0.152618, -0.295319},
{0.58783, -0.598236, 0.544495},
{0.203796, 0.678223, 0.705994},
{-0.478821, -0.661011, 0.577667},
{0.719055, -0.1698, -0.673828},
{-0.132172, -0.965332, 0.225006},
{-0.981873, -0.14502, 0.121979},
{0.763458, 0.579742, 0.284546},
{-0.893188, 0.079681, 0.442474},
{-0.795776, -0.523804, 0.303802},
{0.734955, 0.67804, -0.007446},
{0.15506, 0.986267, -0.056183},
{0.258026, 0.571503, -0.778931},
{-0.681549, -0.702087, -0.206116},
{-0.96286, -0.177185, 0.203613},
{-0.470978, -0.515106, 0.716095},
{-0.740326, 0.57135, 0.354095},
{-0.56012, -0.824982, -0.074982},
{-0.507874, 0.753204, 0.417969},
{-0.503113, 0.038147, 0.863342},
{0.594025, 0.673553, -0.439758},
{-0.119873, -0.005524, -0.992737},
{0.098267, -0.213776, 0.971893},
{-0.615631, 0.643951, 0.454163},
{0.896851, -0.441071, 0.032166},
{-0.555023, 0.750763, -0.358093},
{0.398773, 0.304688, 0.864929},
{-0.722961, 0.303589, 0.620544},
{-0.63559, -0.621948, -0.457306},
{-0.293243, 0.072327, 0.953278},
{-0.491638, 0.661041, -0.566772},
{-0.304199, -0.572083, -0.761688},
{0.908081, -0.398956, 0.127014},
{-0.523621, -0.549683, -0.650848},
{-0.932922, -0.19986, 0.299408},
{0.099426, 0.140869, 0.984985},
{-0.020325, -0.999756, -0.002319},
{0.952667, 0.280853, -0.11615},
{-0.971893, 0.082581, 0.220337},
{0.65921, 0.705292, -0.260651},
{0.733063, -0.175537, 0.657043},
{-0.555206, 0.429504, -0.712189},
{0.400421, -0.89859, 0.179352},
{0.750885, -0.19696, 0.630341},
{0.785675, -0.569336, 0.241821},
{-0.058899, -0.464111, 0.883789},
{0.129608, -0.94519, 0.299622},
{-0.357819, 0.907654, 0.219238},
{-0.842133, -0.439117, -0.312927},
{-0.313477, 0.84433, 0.434479},
{-0.241211, 0.053253, 0.968994},
{0.063873, 0.823273, 0.563965},
{0.476288, 0.862152, -0.172516},
{0.620941, -0.298126, 0.724915},
{0.25238, -0.749359, -0.612122},
{-0.577545, 0.386566, 0.718994},
{-0.406342, -0.737976, 0.538696},
{0.04718, 0.556305, 0.82959},
{-0.802856, 0.587463, 0.101166},
{-0.707733, -0.705963, 0.026428},
{0.374908, 0.68457, 0.625092},
{0.472137, 0.208405, -0.856506},
{-0.703064, -0.581085, -0.409821},
{-0.417206, -0.736328, 0.532623},
{-0.447876, -0.20285, -0.870728},
{0.086945, -0.990417, 0.107086},
{0.183685, 0.018341, -0.982788},
{0.560638, -0.428864, 0.708282},
{0.296722, -0.952576, -0.0672},
{0.135773, 0.990265, 0.030243},
{-0.068787, 0.654724, 0.752686},
{0.762604, -0.551758, 0.337585},
{-0.819611, -0.407684, 0.402466},
{-0.727844, -0.55072, -0.408539},
{-0.855774, -0.480011, 0.19281},
{0.693176, -0.079285, 0.716339},
{0.226013, 0.650116, -0.725433},
{0.246704, 0.953369, -0.173553},
{-0.970398, -0.239227, -0.03244},
{0.136383, -0.394318, 0.908752},
{0.813232, 0.558167, 0.164368},
{0.40451, 0.549042, -0.731323},
{-0.380249, -0.566711, 0.730865},
{0.022156, 0.932739, 0.359741},
{0.00824, 0.996552, -0.082306},
{0.956635, -0.065338, -0.283722},
{-0.743561, 0.008209, 0.668579},
{-0.859589, -0.509674, 0.035767},
{-0.852234, 0.363678, -0.375977},
{-0.201965, -0.970795, -0.12915},
{0.313477, 0.947327, 0.06546},
{-0.254028, -0.528259, 0.81015},
{0.628052, 0.601105, 0.49411},
{-0.494385, 0.868378, 0.037933},
{0.275635, -0.086426, 0.957336},
{-0.197937, 0.468903, -0.860748},
{0.895599, 0.399384, 0.195801},
{0.560791, 0.825012, -0.069214},
{0.304199, -0.849487, 0.43103},
{0.096375, 0.93576, 0.339111},
{-0.051422, 0.408966, -0.911072},
{0.330444, 0.942841, -0.042389},
{-0.452362, -0.786407, 0.420563},
{0.134308, -0.933472, -0.332489},
{0.80191, -0.566711, -0.188934},
{-0.987946, -0.105988, 0.112518},
{-0.24408, 0.892242, -0.379791},
{-0.920502, 0.229095, -0.316376},
{0.7789, 0.325958, 0.535706},
{-0.912872, 0.185211, -0.36377},
{-0.184784, 0.565369, -0.803833},
{-0.018463, 0.119537, 0.992615},
{-0.259247, -0.935608, 0.239532},
{-0.82373, -0.449127, -0.345947},
{-0.433105, 0.659515, 0.614349},
{-0.822754, 0.378845, -0.423676},
{0.687195, -0.674835, -0.26889},
{-0.246582, -0.800842, 0.545715},
{-0.729187, -0.207794, 0.651978},
{0.653534, -0.610443, -0.447388},
{0.492584, -0.023346, 0.869934},
{0.609039, 0.009094, -0.79306},
{0.962494, -0.271088, -0.00885},
{0.2659, -0.004913, 0.963959},
{0.651245, 0.553619, -0.518951},
{0.280548, -0.84314, 0.458618},
{-0.175293, -0.983215, 0.049805},
{0.035339, -0.979919, 0.196045},
{-0.982941, 0.164307, -0.082245},
{0.233734, -0.97226, -0.005005},
{-0.747253, -0.611328, 0.260437},
{0.645599, 0.592773, 0.481384},
{0.117706, -0.949524, -0.29068},
{-0.535004, -0.791901, -0.294312},
{-0.627167, -0.214447, 0.748718},
{-0.047974, -0.813477, -0.57959},
{-0.175537, 0.477264, -0.860992},
{0.738556, -0.414246, -0.53183},
{0.562561, -0.704071, 0.433289},
{-0.754944, 0.64801, -0.100586},
{0.114716, 0.044525, -0.992371},
{0.966003, 0.244873, -0.082764},
{0.33783, 0.715698, -0.611206},
{-0.944031, -0.326599, -0.045624},
};

View File

@@ -256,290 +256,290 @@ static int sp;
static int savesplines = 1;
static pschar ISOcharlist[NASCII] = {
"/space", 040, 0,
"/exclam", 041, 0,
"/quotedbl", 042, 0,
"/numbersign", 043, 0,
"/dollar", 044, 0,
"/percent", 045, 0,
"/ampersand", 046, 0,
"/quoteright", 047, 0,
{"/space", 040, 0},
{"/exclam", 041, 0},
{"/quotedbl", 042, 0},
{"/numbersign", 043, 0},
{"/dollar", 044, 0},
{"/percent", 045, 0},
{"/ampersand", 046, 0},
{"/quoteright", 047, 0},
"/parenleft", 050, 0,
"/parenright", 051, 0,
"/asterisk", 052, 0,
"/plus", 053, 0,
"/comma", 054, 0,
"/hyphen", 055, 0,
"/period", 056, 0,
"/slash", 057, 0,
{"/parenleft", 050, 0},
{"/parenright", 051, 0},
{"/asterisk", 052, 0},
{"/plus", 053, 0},
{"/comma", 054, 0},
{"/hyphen", 055, 0},
{"/period", 056, 0},
{"/slash", 057, 0},
"/zero", 060, 0,
"/one", 061, 0,
"/two", 062, 0,
"/three", 063, 0,
"/four", 064, 0,
"/five", 065, 0,
"/six", 066, 0,
"/seven", 067, 0,
{"/zero", 060, 0},
{"/one", 061, 0},
{"/two", 062, 0},
{"/three", 063, 0},
{"/four", 064, 0},
{"/five", 065, 0},
{"/six", 066, 0},
{"/seven", 067, 0},
"/eight", 070, 0,
"/nine", 071, 0,
"/colon", 072, 0,
"/semicolon", 073, 0,
"/less", 074, 0,
"/equal", 075, 0,
"/greater", 076, 0,
"/question", 077, 0,
{"/eight", 070, 0},
{"/nine", 071, 0},
{"/colon", 072, 0},
{"/semicolon", 073, 0},
{"/less", 074, 0},
{"/equal", 075, 0},
{"/greater", 076, 0},
{"/question", 077, 0},
"/at", 0100, 0,
"/A", 0101, 0,
"/B", 0102, 0,
"/C", 0103, 0,
"/D", 0104, 0,
"/E", 0105, 0,
"/F", 0106, 0,
"/G", 0107, 0,
{"/at", 0100, 0},
{"/A", 0101, 0},
{"/B", 0102, 0},
{"/C", 0103, 0},
{"/D", 0104, 0},
{"/E", 0105, 0},
{"/F", 0106, 0},
{"/G", 0107, 0},
"/H", 0110, 0,
"/I", 0111, 0,
"/J", 0112, 0,
"/K", 0113, 0,
"/L", 0114, 0,
"/M", 0115, 0,
"/N", 0116, 0,
"/O", 0117, 0,
{"/H", 0110, 0},
{"/I", 0111, 0},
{"/J", 0112, 0},
{"/K", 0113, 0},
{"/L", 0114, 0},
{"/M", 0115, 0},
{"/N", 0116, 0},
{"/O", 0117, 0},
"/P", 0120, 0,
"/Q", 0121, 0,
"/R", 0122, 0,
"/S", 0123, 0,
"/T", 0124, 0,
"/U", 0125, 0,
"/V", 0126, 0,
"/W", 0127, 0,
{"/P", 0120, 0},
{"/Q", 0121, 0},
{"/R", 0122, 0},
{"/S", 0123, 0},
{"/T", 0124, 0},
{"/U", 0125, 0},
{"/V", 0126, 0},
{"/W", 0127, 0},
"/X", 0130, 0,
"/Y", 0131, 0,
"/Z", 0132, 0,
"/bracketleft", 0133, 0,
"/backslash", 0134, 0,
"/bracketright", 0135, 0,
"/asciicircum", 0136, 0,
"/underscore", 0137, 0,
{"/X", 0130, 0},
{"/Y", 0131, 0},
{"/Z", 0132, 0},
{"/bracketleft", 0133, 0},
{"/backslash", 0134, 0},
{"/bracketright", 0135, 0},
{"/asciicircum", 0136, 0},
{"/underscore", 0137, 0},
"/quoteleft", 0140, 0,
"/a", 0141, 0,
"/b", 0142, 0,
"/c", 0143, 0,
"/d", 0144, 0,
"/e", 0145, 0,
"/f", 0146, 0,
"/g", 0147, 0,
{"/quoteleft", 0140, 0},
{"/a", 0141, 0},
{"/b", 0142, 0},
{"/c", 0143, 0},
{"/d", 0144, 0},
{"/e", 0145, 0},
{"/f", 0146, 0},
{"/g", 0147, 0},
"/h", 0150, 0,
"/i", 0151, 0,
"/j", 0152, 0,
"/k", 0153, 0,
"/l", 0154, 0,
"/m", 0155, 0,
"/n", 0156, 0,
"/o", 0157, 0,
{"/h", 0150, 0},
{"/i", 0151, 0},
{"/j", 0152, 0},
{"/k", 0153, 0},
{"/l", 0154, 0},
{"/m", 0155, 0},
{"/n", 0156, 0},
{"/o", 0157, 0},
"/p", 0160, 0,
"/q", 0161, 0,
"/r", 0162, 0,
"/s", 0163, 0,
"/t", 0164, 0,
"/u", 0165, 0,
"/v", 0166, 0,
"/w", 0167, 0,
{"/p", 0160, 0},
{"/q", 0161, 0},
{"/r", 0162, 0},
{"/s", 0163, 0},
{"/t", 0164, 0},
{"/u", 0165, 0},
{"/v", 0166, 0},
{"/w", 0167, 0},
"/x", 0170, 0,
"/y", 0171, 0,
"/z", 0172, 0,
"/braceleft", 0173, 0,
"/bar", 0174, 0,
"/braceright", 0175, 0,
"/asciitilde", 0176, 0,
"/", 0177, 0,
{"/x", 0170, 0},
{"/y", 0171, 0},
{"/z", 0172, 0},
{"/braceleft", 0173, 0},
{"/bar", 0174, 0},
{"/braceright", 0175, 0},
{"/asciitilde", 0176, 0},
{"/", 0177, 0},
/* nonstandard defs */
"/quotedblleft", 0200, 0,
"/quotedblright", 0201, 0,
"/quotedblbase", 0202, 0,
"/quotesinglbase", 0203, 0,
"/guilsinglleft", 0204, 0,
"/guilsinglright", 0205, 0,
"/endash", 0206, 0,
"/dagger", 0207, 0,
{"/quotedblleft", 0200, 0},
{"/quotedblright", 0201, 0},
{"/quotedblbase", 0202, 0},
{"/quotesinglbase", 0203, 0},
{"/guilsinglleft", 0204, 0},
{"/guilsinglright", 0205, 0},
{"/endash", 0206, 0},
{"/dagger", 0207, 0},
"/daggerdbl", 0210, 0,
"/trademark", 0211, 0,
"/bullet", 0212, 0,
"/perthousand", 0213, 0,
"/Lslash", 0214, 0,
"/OE", 0215, 0,
"/lslash", 0216, 0,
"/oe", 0217, 0,
{"/daggerdbl", 0210, 0},
{"/trademark", 0211, 0},
{"/bullet", 0212, 0},
{"/perthousand", 0213, 0},
{"/Lslash", 0214, 0},
{"/OE", 0215, 0},
{"/lslash", 0216, 0},
{"/oe", 0217, 0},
/* endnonstandard defs */
"/dotlessi", 0220, 0,
"/grave", 0221, 0,
"/acute", 0222, 0,
"/circumflex", 0223, 0,
"/tilde", 0224, 0,
"/", 0225, 0,
"/breve", 0226, 0,
"/dotaccent", 0227, 0,
{"/dotlessi", 0220, 0},
{"/grave", 0221, 0},
{"/acute", 0222, 0},
{"/circumflex", 0223, 0},
{"/tilde", 0224, 0},
{"/", 0225, 0},
{"/breve", 0226, 0},
{"/dotaccent", 0227, 0},
"/", 0230, 0,
"/", 0231, 0,
"/ring", 0232, 0,
"/", 0233, 0,
"/", 0234, 0,
"/hungarumlaut", 0235, 0,
"/ogonek", 0236, 0,
"/caron", 0237, 0,
{"/", 0230, 0},
{"/", 0231, 0},
{"/ring", 0232, 0},
{"/", 0233, 0},
{"/", 0234, 0},
{"/hungarumlaut", 0235, 0},
{"/ogonek", 0236, 0},
{"/caron", 0237, 0},
"/", 0240, 0,
"/exclamdown", 0241, 0,
"/cent", 0242, 0,
"/sterling", 0243, 0,
"/florin", 0244, 0,
"/yen", 0245, 0,
"/brokenbar", 0246, 0,
"/section", 0247, 0,
{"/", 0240, 0},
{"/exclamdown", 0241, 0},
{"/cent", 0242, 0},
{"/sterling", 0243, 0},
{"/florin", 0244, 0},
{"/yen", 0245, 0},
{"/brokenbar", 0246, 0},
{"/section", 0247, 0},
"/dieresis", 0250, 0,
"/copyright", 0251, 0,
"/ordfeminine", 0252, 0,
"/guillemotleft", 0253, 0,
"/logicalnot", 0254, 0,
"/hyphen", 0255, 0,
"/registered", 0256, 0,
"/macron", 0257, 0,
{"/dieresis", 0250, 0},
{"/copyright", 0251, 0},
{"/ordfeminine", 0252, 0},
{"/guillemotleft", 0253, 0},
{"/logicalnot", 0254, 0},
{"/hyphen", 0255, 0},
{"/registered", 0256, 0},
{"/macron", 0257, 0},
"/degree", 0260, 0,
"/plusminus", 0261, 0,
"/twosuperior", 0262, 0,
"/threesuperior", 0263, 0,
"/acute", 0264, 0,
"/mu", 0265, 0,
"/paragraph", 0266, 0,
"/periodcentered", 0267, 0,
{"/degree", 0260, 0},
{"/plusminus", 0261, 0},
{"/twosuperior", 0262, 0},
{"/threesuperior", 0263, 0},
{"/acute", 0264, 0},
{"/mu", 0265, 0},
{"/paragraph", 0266, 0},
{"/periodcentered", 0267, 0},
"/cedilla", 0270, 0,
"/onesuperior", 0271, 0,
"/ordmasculine", 0272, 0,
"/guillemotright", 0273, 0,
"/onequarter", 0274, 0,
"/onehalf", 0275, 0,
"/threequarters", 0276, 0,
"/questiondown", 0277, 0,
{"/cedilla", 0270, 0},
{"/onesuperior", 0271, 0},
{"/ordmasculine", 0272, 0},
{"/guillemotright", 0273, 0},
{"/onequarter", 0274, 0},
{"/onehalf", 0275, 0},
{"/threequarters", 0276, 0},
{"/questiondown", 0277, 0},
"/Agrave", 0300, 0,
"/Aacute", 0301, 0,
"/Acircumflex", 0302, 0,
"/Atilde", 0303, 0,
"/Adieresis", 0304, 0,
"/Aring", 0305, 0,
"/AE", 0306, 0,
"/Ccedilla", 0307, 0,
{"/Agrave", 0300, 0},
{"/Aacute", 0301, 0},
{"/Acircumflex", 0302, 0},
{"/Atilde", 0303, 0},
{"/Adieresis", 0304, 0},
{"/Aring", 0305, 0},
{"/AE", 0306, 0},
{"/Ccedilla", 0307, 0},
"/Egrave", 0310, 0,
"/Eacute", 0311, 0,
"/Ecircumflex", 0312, 0,
"/Edieresis", 0313, 0,
"/Igrave", 0314, 0,
"/Iacute", 0315, 0,
"/Icircumflex", 0316, 0,
"/Idieresis", 0317, 0,
{"/Egrave", 0310, 0},
{"/Eacute", 0311, 0},
{"/Ecircumflex", 0312, 0},
{"/Edieresis", 0313, 0},
{"/Igrave", 0314, 0},
{"/Iacute", 0315, 0},
{"/Icircumflex", 0316, 0},
{"/Idieresis", 0317, 0},
"/Eth", 0320, 0,
"/Ntilde", 0321, 0,
"/Ograve", 0322, 0,
"/Oacute", 0323, 0,
"/Ocircumflex", 0324, 0,
"/Otilde", 0325, 0,
"/Odieresis", 0326, 0,
"/multiply", 0327, 0,
{"/Eth", 0320, 0},
{"/Ntilde", 0321, 0},
{"/Ograve", 0322, 0},
{"/Oacute", 0323, 0},
{"/Ocircumflex", 0324, 0},
{"/Otilde", 0325, 0},
{"/Odieresis", 0326, 0},
{"/multiply", 0327, 0},
"/Oslash", 0330, 0,
"/Ugrave", 0331, 0,
"/Uacute", 0332, 0,
"/Ucircumflex", 0333, 0,
"/Udieresis", 0334, 0,
"/Yacute", 0335, 0,
"/Thorn", 0336, 0,
"/germandbls", 0337, 0,
{"/Oslash", 0330, 0},
{"/Ugrave", 0331, 0},
{"/Uacute", 0332, 0},
{"/Ucircumflex",0333, 0},
{"/Udieresis", 0334, 0},
{"/Yacute", 0335, 0},
{"/Thorn", 0336, 0},
{"/germandbls", 0337, 0},
"/agrave", 0340, 0,
"/aacute", 0341, 0,
"/acircumflex", 0342, 0,
"/atilde", 0343, 0,
"/adieresis", 0344, 0,
"/aring", 0345, 0,
"/ae", 0346, 0,
"/ccedilla", 0347, 0,
{"/agrave", 0340, 0},
{"/aacute", 0341, 0},
{"/acircumflex",0342, 0},
{"/atilde", 0343, 0},
{"/adieresis", 0344, 0},
{"/aring", 0345, 0},
{"/ae", 0346, 0},
{"/ccedilla", 0347, 0},
"/egrave", 0350, 0,
"/eacute", 0351, 0,
"/ecircumflex", 0352, 0,
"/edieresis", 0353, 0,
"/igrave", 0354, 0,
"/iacute", 0355, 0,
"/icircumflex", 0356, 0,
"/idieresis", 0357, 0,
{"/egrave", 0350, 0},
{"/eacute", 0351, 0},
{"/ecircumflex", 0352, 0},
{"/edieresis", 0353, 0},
{"/igrave", 0354, 0},
{"/iacute", 0355, 0},
{"/icircumflex", 0356, 0},
{"/idieresis", 0357, 0},
"/eth", 0360, 0,
"/ntilde", 0361, 0,
"/ograve", 0362, 0,
"/oacute", 0363, 0,
"/ocircumflex", 0364, 0,
"/otilde", 0365, 0,
"/odieresis", 0366, 0,
"/divide", 0367, 0,
{"/eth", 0360, 0},
{"/ntilde", 0361, 0},
{"/ograve", 0362, 0},
{"/oacute", 0363, 0},
{"/ocircumflex",0364, 0},
{"/otilde", 0365, 0},
{"/odieresis", 0366, 0},
{"/divide", 0367, 0},
"/oslash", 0370, 0,
"/ugrave", 0371, 0,
"/uacute", 0372, 0,
"/ucircumflex", 0373, 0,
"/udieresis", 0374, 0,
"/yacute", 0375, 0,
"/thorn", 0376, 0,
"/ydieresis", 0377, 0,
{"/oslash", 0370, 0},
{"/ugrave", 0371, 0},
{"/uacute", 0372, 0},
{"/ucircumflex",0373, 0},
{"/udieresis", 0374, 0},
{"/yacute", 0375, 0},
{"/thorn", 0376, 0},
{"/ydieresis", 0377, 0},
};
static short STDvsISO [][2] = {
0341, 0306, /* AE */
0351, 0330, /* Oslash */
0302, 0222, /* acute */
0361, 0346, /* ae */
0306, 0226, /* breve */
0317, 0237, /* caron */
0313, 0270, /* cedilla */
0303, 0223, /* circumflex */
0250, 0244, /* currency */
0310, 0250, /* dieresis */
0307, 0227, /* dotaccent */
0365, 0220, /* dotlessi */
0373, 0337, /* germandbls */
0301, 0221, /* grave */
0315, 0235, /* hungarumlaut */
0055, 0255, /* hyphen */
0305, 0257, /* macron */
0316, 0236, /* ogenek */
0343, 0252, /* ordfeminine */
0353, 0272, /* ordmasculine */
0371, 0370, /* oslash */
0264, 0267, /* periodcentered */
0312, 0232, /* ring */
0304, 0224, /* tilde */
{0341, 0306}, /* AE */
{0351, 0330}, /* Oslash */
{0302, 0222}, /* acute */
{0361, 0346}, /* ae */
{0306, 0226}, /* breve */
{0317, 0237}, /* caron */
{0313, 0270}, /* cedilla */
{0303, 0223}, /* circumflex */
{0250, 0244}, /* currency */
{0310, 0250}, /* dieresis */
{0307, 0227}, /* dotaccent */
{0365, 0220}, /* dotlessi */
{0373, 0337}, /* germandbls */
{0301, 0221}, /* grave */
{0315, 0235}, /* hungarumlaut */
{0055, 0255}, /* hyphen */
{0305, 0257}, /* macron */
{0316, 0236}, /* ogenek */
{0343, 0252}, /* ordfeminine */
{0353, 0272}, /* ordmasculine */
{0371, 0370}, /* oslash */
{0264, 0267}, /* periodcentered */
{0312, 0232}, /* ring */
{0304, 0224}, /* tilde */
};
/* from objfont.c, rest is in lfm_s !!*/

View File

@@ -858,6 +858,8 @@ int BLI_strcaseeq(char *a, char *b) {
* take the dir name, make it absolute, and clean it up, replacing
* excess file entry stuff (like /tmp/../tmp/../)
* note that dir isn't protected for max string names...
*
* If relbase is NULL then its ignored
*/
void BLI_cleanup_dir(const char *relabase, char *dir)
@@ -871,7 +873,6 @@ void BLI_cleanup_file(const char *relabase, char *dir)
{
short a;
char *start, *eind;
if (relabase) {
BLI_convertstringcode(dir, relabase);
} else {
@@ -882,7 +883,15 @@ void BLI_cleanup_file(const char *relabase, char *dir)
dir = dir+2; /* skip the first // */
}
}
/* Note
* memmove( start, eind, strlen(eind)+1 );
* is the same as
* strcpy( start, eind );
* except strcpy should not be used because there is overlap,
* so use memmove's slightly more obscure syntax - Campbell
*/
#ifdef WIN32
if(dir[0]=='.') { /* happens for example in FILE_MAIN */
get_default_root(dir);
@@ -896,17 +905,21 @@ void BLI_cleanup_file(const char *relabase, char *dir)
if (dir[a] == '\\') break;
a--;
}
strcpy(dir+a,eind);
if (a<0) {
break;
} else {
memmove( dir+a, eind, strlen(eind)+1 );
}
}
while ( (start = strstr(dir,"\\.\\")) ){
eind = start + strlen("\\.\\") - 1;
strcpy(start,eind);
memmove( start, eind, strlen(eind)+1 );
}
while ( (start = strstr(dir,"\\\\" )) ){
eind = start + strlen("\\\\") - 1;
strcpy(start,eind);
memmove( start, eind, strlen(eind)+1 );
}
if((a = strlen(dir))){ /* remove the '\\' at the end */
@@ -929,17 +942,21 @@ void BLI_cleanup_file(const char *relabase, char *dir)
if (dir[a] == '/') break;
a--;
}
strcpy(dir+a,eind);
if (a<0) {
break;
} else {
memmove( dir+a, eind, strlen(eind)+1 );
}
}
while ( (start = strstr(dir,"/./")) ){
eind = start + strlen("/./") - 1;
strcpy(start,eind);
memmove( start, eind, strlen(eind)+1 );
}
while ( (start = strstr(dir,"//" )) ){
eind = start + strlen("//") - 1;
strcpy(start,eind);
memmove( start, eind, strlen(eind)+1 );
}
if( (a = strlen(dir)) ){ /* remove all '/' at the end */
@@ -960,7 +977,7 @@ void BLI_makestringcode(const char *relfile, char *file)
char * lslash;
char temp[FILE_MAXDIR+FILE_MAXFILE];
char res[FILE_MAXDIR+FILE_MAXFILE];
/* if file is already relative, bail out */
if(file[0]=='/' && file[1]=='/') return;
@@ -992,7 +1009,11 @@ void BLI_makestringcode(const char *relfile, char *file)
BLI_char_switch(temp, '\\', '/');
BLI_char_switch(file, '\\', '/');
/* remove /./ which confuse the following slash counting... */
BLI_cleanup_file(NULL, file);
BLI_cleanup_file(NULL, temp);
/* the last slash in the file indicates where the path part ends */
lslash = BLI_last_slash(temp);
@@ -1114,8 +1135,8 @@ int BLI_convertstringcode(char *path, const char *basepath)
char vol[3] = {'\0', '\0', '\0'};
BLI_strncpy(vol, path, 3);
wasrelative= (strncmp(vol, "//", 2)==0);
wasrelative= (vol[0]=='/' && vol[1]=='/');
#ifdef WIN32
/* we are checking here if we have an absolute path that is not in the current
blend file as a lib main - we are basically checking for the case that a
@@ -1139,6 +1160,8 @@ int BLI_convertstringcode(char *path, const char *basepath)
BLI_strncpy(base, basepath, FILE_MAX);
BLI_cleanup_file(NULL, base);
/* push slashes into unix mode - strings entering this part are
potentially messed up: having both back- and forward slashes.
Here we push into one conform direction, and at the end we
@@ -1150,7 +1173,7 @@ int BLI_convertstringcode(char *path, const char *basepath)
/* Paths starting with // will get the blend file as their base,
* this isnt standard in any os but is uesed in blender all over the place */
if (tmp[0] == '/' && tmp[1] == '/') {
if (wasrelative) {
char *lslash= BLI_last_slash(base);
if (lslash) {
int baselen= (int) (lslash-base) + 1;
@@ -1184,7 +1207,7 @@ int BLI_convertstringcode(char *path, const char *basepath)
*/
BLI_char_switch(path+2, '/', '\\');
#endif
return wasrelative;
}

View File

@@ -196,6 +196,27 @@ void get_default_root(char* root) {
}
}
int check_file_chars(char *filename)
{
char *p = filename;
while (*p) {
switch (*p) {
case ':':
case '?':
case '*':
case '|':
case '\\':
case '/':
case '\"':
return 0;
break;
}
p++;
}
return 1;
}
#else
static void BLI_WINSTUFF_C_IS_EMPTY_FOR_UNIX(void)

View File

@@ -720,7 +720,7 @@ BHead *blo_firstbhead(FileData *fd)
BHead *blo_prevbhead(FileData *fd, BHead *thisblock)
{
BHeadN *bheadn= (BHeadN *) (((char *) thisblock) - (int) (&((BHeadN*)0)->bhead));
BHeadN *bheadn= (BHeadN *) (((char *) thisblock) - GET_INT_FROM_POINTER( &((BHeadN*)0)->bhead) );
BHeadN *prev= bheadn->prev;
return prev?&prev->bhead:NULL;
@@ -734,7 +734,7 @@ BHead *blo_nextbhead(FileData *fd, BHead *thisblock)
if (thisblock) {
// bhead is actually a sub part of BHeadN
// We calculate the BHeadN pointer from the BHead pointer below
new_bhead = (BHeadN *) (((char *) thisblock) - (int) (&((BHeadN*)0)->bhead));
new_bhead = (BHeadN *) (((char *) thisblock) - GET_INT_FROM_POINTER( &((BHeadN*)0)->bhead) );
// get the next BHeadN. If it doesn't exist we read in the next one
new_bhead = new_bhead->next;

View File

@@ -53,6 +53,7 @@
#include "BLI_blenlib.h" /* util and noise functions */
#include "BLI_threads.h" /* For threadsfe guardedalloc malloc/calloc/free */
#include "IMB_imbuf.h" /* image buffer stuff */
#define GET_INT_FROM_POINTER(i) ((int)(long)(i)) /* should use BKE_utildefines.h */
/* -------------------------------------------------------------------------- */
/* stuff from util.h */
@@ -321,42 +322,43 @@ int pluginapi_force_ref(void);
int pluginapi_force_ref(void)
{
return (int) mallocN +
(int) callocN +
(int) freeN +
(int) mallocT +
(int) callocT +
(int) freeT +
(int) allocImBuf +
(int) dupImBuf +
(int) freeImBuf +
(int) converttocmap +
(int) saveiff +
(int) loadiffmem +
(int) loadifffile +
(int) loadiffname +
(int) testiffname +
(int) onehalf +
(int) onethird +
(int) halflace +
(int) half_x +
(int) half_y +
(int) double_x +
(int) double_y +
(int) double_fast_x +
(int) double_fast_y +
(int) ispic +
(int) dit2 +
(int) dit0 +
(int) scaleImBuf +
(int) scalefastImBuf +
(int) scalefieldImBuf +
(int) scalefastfieldImBuf +
(int) hnoise +
(int) hnoisep +
(int) turbulence +
(int) turbulence1 +
(int) de_interlace +
(int) interlace +
(int) gamwarp;
return
GET_INT_FROM_POINTER( mallocN ) +
GET_INT_FROM_POINTER( callocN ) +
GET_INT_FROM_POINTER( freeN ) +
GET_INT_FROM_POINTER( mallocT ) +
GET_INT_FROM_POINTER( callocT ) +
GET_INT_FROM_POINTER( freeT ) +
GET_INT_FROM_POINTER( allocImBuf ) +
GET_INT_FROM_POINTER( dupImBuf ) +
GET_INT_FROM_POINTER( freeImBuf ) +
GET_INT_FROM_POINTER( converttocmap ) +
GET_INT_FROM_POINTER( saveiff ) +
GET_INT_FROM_POINTER( loadiffmem ) +
GET_INT_FROM_POINTER( loadifffile ) +
GET_INT_FROM_POINTER( loadiffname ) +
GET_INT_FROM_POINTER( testiffname ) +
GET_INT_FROM_POINTER( onehalf ) +
GET_INT_FROM_POINTER( onethird ) +
GET_INT_FROM_POINTER( halflace ) +
GET_INT_FROM_POINTER( half_x ) +
GET_INT_FROM_POINTER( half_y ) +
GET_INT_FROM_POINTER( double_x ) +
GET_INT_FROM_POINTER( double_y ) +
GET_INT_FROM_POINTER( double_fast_x ) +
GET_INT_FROM_POINTER( double_fast_y ) +
GET_INT_FROM_POINTER( ispic ) +
GET_INT_FROM_POINTER( dit2 ) +
GET_INT_FROM_POINTER( dit0 ) +
GET_INT_FROM_POINTER( scaleImBuf ) +
GET_INT_FROM_POINTER( scalefastImBuf ) +
GET_INT_FROM_POINTER( scalefieldImBuf ) +
GET_INT_FROM_POINTER( scalefastfieldImBuf ) +
GET_INT_FROM_POINTER( hnoise ) +
GET_INT_FROM_POINTER( hnoisep ) +
GET_INT_FROM_POINTER( turbulence ) +
GET_INT_FROM_POINTER( turbulence1 ) +
GET_INT_FROM_POINTER( de_interlace ) +
GET_INT_FROM_POINTER( interlace ) +
GET_INT_FROM_POINTER( gamwarp );
}

View File

@@ -146,7 +146,7 @@ extern "C" {
glGenRenderbuffersEXT(2, renderbuffers);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, renderbuffers[0]);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA, re->winx, re->winy);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA16F_ARB, re->winx, re->winy);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, renderbuffers[0]);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, renderbuffers[1]);

View File

@@ -39,4 +39,4 @@ if env['WITH_BF_QUICKTIME']==1:
incs += ' ' + env['BF_QUICKTIME_INC']
defs.append('WITH_QUICKTIME')
env.BlenderLib ( libname = 'bf_imbuf', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [80,40] )
env.BlenderLib ( libname = 'bf_imbuf', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [80, 40] )

View File

@@ -180,7 +180,7 @@ static void openexr_header_compression(Header *header, int compression)
static short imb_save_openexr_half(struct ImBuf *ibuf, char *name, int flags)
{
int channels = ibuf->channels;
int width = ibuf->x;
int height = ibuf->y;
int write_zbuf = (flags & IB_zbuffloat) && ibuf->zbuf_float != NULL; // summarize
@@ -194,7 +194,7 @@ static short imb_save_openexr_half(struct ImBuf *ibuf, char *name, int flags)
header.channels().insert ("R", Channel (HALF));
header.channels().insert ("G", Channel (HALF));
header.channels().insert ("B", Channel (HALF));
if (ibuf->depth==32)
if (ibuf->depth==32 && channels >= 4)
header.channels().insert ("A", Channel (HALF));
if (write_zbuf) // z we do as float always
header.channels().insert ("Z", Channel (FLOAT));
@@ -207,29 +207,29 @@ static short imb_save_openexr_half(struct ImBuf *ibuf, char *name, int flags)
RGBAZ *to = pixels;
int xstride= sizeof (RGBAZ);
int ystride= xstride*width;
/* indicate used buffers */
frameBuffer.insert ("R", Slice (HALF, (char *) &pixels[0].r, xstride, ystride));
frameBuffer.insert ("G", Slice (HALF, (char *) &pixels[0].g, xstride, ystride));
frameBuffer.insert ("B", Slice (HALF, (char *) &pixels[0].b, xstride, ystride));
if (ibuf->depth==32)
if (ibuf->depth==32 && channels >= 4)
frameBuffer.insert ("A", Slice (HALF, (char *) &pixels[0].a, xstride, ystride));
if (write_zbuf)
frameBuffer.insert ("Z", Slice (FLOAT, (char *) ibuf->zbuf_float + 4*(height-1)*width,
frameBuffer.insert ("Z", Slice (FLOAT, (char *)(ibuf->zbuf_float + (height-1)*width),
sizeof(float), sizeof(float) * -width));
if(ibuf->rect_float) {
float *from;
for (int i = ibuf->y-1; i >= 0; i--)
{
from= ibuf->rect_float + 4*i*width;
from= ibuf->rect_float + channels*i*width;
for (int j = ibuf->x; j > 0; j--)
{
to->r = from[0];
to->g = from[1];
to->b = from[2];
to->a = from[3];
to->g = (channels >= 2)? from[1]: from[0];
to->b = (channels >= 3)? from[2]: from[0];
to->a = (channels >= 4)? from[3]: from[0];
to++; from += 4;
}
}
@@ -239,14 +239,14 @@ static short imb_save_openexr_half(struct ImBuf *ibuf, char *name, int flags)
for (int i = ibuf->y-1; i >= 0; i--)
{
from= (unsigned char *)(ibuf->rect + i*width);
from= (unsigned char *)ibuf->rect + channels*i*width;
for (int j = ibuf->x; j > 0; j--)
{
to->r = (float)(from[0])/255.0;
to->g = (float)(from[1])/255.0;
to->b = (float)(from[2])/255.0;
to->a = (float)(from[3])/255.0;
to->g = (float)((channels >= 2)? from[1]: from[0])/255.0;
to->b = (float)((channels >= 3)? from[2]: from[0])/255.0;
to->a = (float)((channels >= 4)? from[3]: from[0])/255.0;
to++; from += 4;
}
}
@@ -272,7 +272,7 @@ static short imb_save_openexr_half(struct ImBuf *ibuf, char *name, int flags)
static short imb_save_openexr_float(struct ImBuf *ibuf, char *name, int flags)
{
int channels = ibuf->channels;
int width = ibuf->x;
int height = ibuf->y;
int write_zbuf = (flags & IB_zbuffloat) && ibuf->zbuf_float != NULL; // summarize
@@ -286,24 +286,29 @@ static short imb_save_openexr_float(struct ImBuf *ibuf, char *name, int flags)
header.channels().insert ("R", Channel (FLOAT));
header.channels().insert ("G", Channel (FLOAT));
header.channels().insert ("B", Channel (FLOAT));
if (ibuf->depth==32)
if (ibuf->depth==32 && channels >= 4)
header.channels().insert ("A", Channel (FLOAT));
if (write_zbuf)
header.channels().insert ("Z", Channel (FLOAT));
FrameBuffer frameBuffer;
OutputFile *file = new OutputFile(name, header);
float *first= ibuf->rect_float + 4*(height-1)*width;
int xstride = sizeof(float) * 4;
int xstride = sizeof(float) * channels;
int ystride = - xstride*width;
float *rect[4] = {NULL, NULL, NULL, NULL};
frameBuffer.insert ("R", Slice (FLOAT, (char *) first, xstride, ystride));
frameBuffer.insert ("G", Slice (FLOAT, (char *) (first+1), xstride, ystride));
frameBuffer.insert ("B", Slice (FLOAT, (char *) (first+2), xstride, ystride));
if (ibuf->depth==32)
frameBuffer.insert ("A", Slice (FLOAT, (char *) (first+3), xstride, ystride));
rect[0]= ibuf->rect_float + channels*(height-1)*width;
rect[1]= (channels >= 2)? rect[0]+1: rect[0];
rect[2]= (channels >= 3)? rect[0]+2: rect[0];
rect[3]= (channels >= 4)? rect[0]+3: rect[0];
frameBuffer.insert ("R", Slice (FLOAT, (char *)rect[0], xstride, ystride));
frameBuffer.insert ("G", Slice (FLOAT, (char *)rect[1], xstride, ystride));
frameBuffer.insert ("B", Slice (FLOAT, (char *)rect[2], xstride, ystride));
if (ibuf->depth==32 && channels >= 4)
frameBuffer.insert ("A", Slice (FLOAT, (char *)rect[3], xstride, ystride));
if (write_zbuf)
frameBuffer.insert ("Z", Slice (FLOAT, (char *) ibuf->zbuf_float + 4*(height-1)*width,
frameBuffer.insert ("Z", Slice (FLOAT, (char *) (ibuf->zbuf_float + (height-1)*width),
sizeof(float), sizeof(float) * -width));
file->setFrameBuffer (frameBuffer);
file->writePixels (height);

View File

@@ -251,7 +251,7 @@ struct ImBuf *imb_loadhdr(unsigned char *mem, int size, int flags)
}
/* ImBuf write */
static int fwritecolrs(FILE* file, int width, unsigned char* ibufscan, float* fpscan)
static int fwritecolrs(FILE* file, int width, int channels, unsigned char* ibufscan, float* fpscan)
{
int x, i, j, beg, c2, cnt=0;
fCOLOR fcol;
@@ -266,16 +266,16 @@ static int fwritecolrs(FILE* file, int width, unsigned char* ibufscan, float* fp
for (i=0;i<width;i++) {
if (fpscan) {
fcol[RED] = fpscan[j];
fcol[GRN] = fpscan[j+1];
fcol[BLU] = fpscan[j+2];
fcol[GRN] = (channels >= 2)? fpscan[j+1]: fpscan[j];
fcol[BLU] = (channels >= 3)? fpscan[j+2]: fpscan[j];
} else {
fcol[RED] = (float)ibufscan[j] / 255.f;
fcol[GRN] = (float)ibufscan[j+1] / 255.f;
fcol[BLU] = (float)ibufscan[j+2] /255.f;
fcol[GRN] = (float)((channels >= 2)? ibufscan[j+1]: ibufscan[j]) / 255.f;
fcol[BLU] = (float)((channels >= 3)? ibufscan[j+2]: ibufscan[j]) / 255.f;
}
FLOAT2RGBE(fcol, rgbe);
copy_rgbe(rgbe, rgbe_scan[i]);
j+=4;
j+=channels;
}
if ((width < MINELEN) | (width > MAXELEN)) { /* OOBs, write out flat */
@@ -348,18 +348,18 @@ short imb_savehdr(struct ImBuf *ibuf, char *name, int flags)
writeHeader(file, width, height);
if(ibuf->rect)
cp= (unsigned char *)(ibuf->rect + (height-1)*width);
cp= (unsigned char *)ibuf->rect + ibuf->channels*(height-1)*width;
if(ibuf->rect_float)
fp= ibuf->rect_float + 4*(height-1)*width;
fp= ibuf->rect_float + ibuf->channels*(height-1)*width;
for (y=height-1;y>=0;y--) {
if (fwritecolrs(file, width, cp, fp) < 0) {
if (fwritecolrs(file, width, ibuf->channels, cp, fp) < 0) {
fclose(file);
printf("HDR write error\n");
return 0;
}
if(cp) cp-= 4*width;
if(fp) fp-= 4*width;
if(cp) cp-= ibuf->channels*width;
if(fp) fp-= ibuf->channels*width;
}
fclose(file);

View File

@@ -31,6 +31,9 @@
#ifdef WIN32
#include <io.h>
#include <stddef.h>
#include <sys/types.h>
#include "mmap_win.h"
#endif
#include "BLI_blenlib.h"
@@ -229,7 +232,7 @@ struct ImBuf *IMB_loadifffile(int file, int flags) {
size = BLI_filesize(file);
#if defined(AMIGA) || defined(__BeOS) || defined(WIN32)
#if defined(AMIGA) || defined(__BeOS)
mem= (int *)malloc(size);
if (mem==0) {
printf("Out of mem\n");

View File

@@ -39,5 +39,7 @@ void set_special_seq_update(int val);
void seq_viewmove(SpaceSeq *sseq);
void seq_reset_imageofs(SpaceSeq *sseq);
void seq_viewzoom(unsigned short event, int invert);
void seq_home(void);
#endif

View File

@@ -24,7 +24,7 @@
#
# ***** END GPL LICENSE BLOCK *****
SET(SRC makesdna.c ../../../../intern/guardedalloc/intern/mallocn.c)
SET(SRC makesdna.c ../../../../intern/guardedalloc/intern/mallocn.c ../../../../intern/guardedalloc/intern/mmap_win.c)
INCLUDE_DIRECTORIES(../../../../intern/guardedalloc ..)

View File

@@ -8,6 +8,7 @@ defines = []
root_build_dir=env['BF_BUILDDIR']
source_files = ['makesdna.c']
header_files = env.Glob('../*.h')
makesdna_tool = env.Copy()
dna = env.Copy()
@@ -35,6 +36,7 @@ else:
dna_dict = dna.Dictionary()
dna.Depends ('dna.c', makesdna)
dna.Depends ('dna.c', header_files)
if env['OURPLATFORM'] != 'linuxcross':
dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna $TARGET")
else:

View File

@@ -44,18 +44,22 @@ static bNodeSocketType cmp_node_displace_out[]= {
{ -1, 0, "" }
};
static float *vecbuf_get_pixel(CompBuf *vecbuf, float *veccol, int x, int y)
{
/* the x-xrad stuff is a bit weird, but i seem to need it otherwise
* my returned pixels are offset weirdly */
return compbuf_get_pixel(vecbuf, veccol, x-vecbuf->xrad, y-vecbuf->yrad, vecbuf->xrad, vecbuf->yrad);
}
static void do_displace(CompBuf *stackbuf, CompBuf *cbuf, CompBuf *vecbuf, float *veccol, float *xscale, float *yscale)
{
ImBuf *ibuf;
int x, y, vx, vy, sx, sy;
float dx=0.0, dy=0.0;
float dspx, dspy;
float uv[2];
float *out= stackbuf->rect, *vec=vecbuf->rect, *in= cbuf->rect;
float uv[2], col[4], colnext[4], colprev[4];
float *vp, *vpnext, *vpprev;
int row = 3*vecbuf->x;
float *out= stackbuf->rect, *vec=vecbuf->rect, *in= cbuf->rect;
int x, y, vx, vy, sx, sy;
/* ibuf needed for sampling */
ibuf= IMB_allocImBuf(cbuf->x, cbuf->y, 32, 0, 0);
@@ -65,13 +69,15 @@ static void do_displace(CompBuf *stackbuf, CompBuf *cbuf, CompBuf *vecbuf, float
sx= stackbuf->x;
sy= stackbuf->y;
QUATCOPY(col, veccol);
QUATCOPY(colnext, veccol);
QUATCOPY(colprev, veccol);
for(y=0; y<sy; y++) {
for(x= 0; x< sx; x++, out+=4, in+=4, vec+=3) {
/* the x-xrad stuff is a bit weird, but i seem to need it otherwise
* my returned pixels are offset weirdly */
vp = compbuf_get_pixel(vecbuf, veccol, x-vecbuf->xrad, y-vecbuf->yrad, vecbuf->xrad, vecbuf->yrad);
vp = vecbuf_get_pixel(vecbuf, col, x, y);
/* this happens in compbuf_get_pixel, need to make sure the following
* check takes them into account */
@@ -87,20 +93,26 @@ static void do_displace(CompBuf *stackbuf, CompBuf *cbuf, CompBuf *vecbuf, float
uv[1] = dspy / (float)sy;
if(vx>0 && vx< vecbuf->x-1 && vy>0 && vy< vecbuf->y-1) {
vpnext = vp+row;
vpprev = vp-row;
/* adaptive sampling, X channel */
dx= 0.5f*(fabs(vp[0]-vp[-3]) + fabs(vp[0]-vp[3]));
dx+= 0.25f*(fabs(vp[0]-vpprev[-3]) + fabs(vp[0]-vpnext[-3]));
dx+= 0.25f*(fabs(vp[0]-vpprev[+3]) + fabs(vp[0]-vpnext[+3]));
/* adaptive sampling, Y channel */
dy= 0.5f*(fabs(vp[1]-vp[-row+1]) + fabs(vp[1]-vp[row+1]));
dy+= 0.25f*(fabs(vp[1]-vpprev[+1-3]) + fabs(vp[1]-vpnext[+1-3]));
dy+= 0.25f*(fabs(vp[1]-vpprev[+1+3]) + fabs(vp[1]-vpnext[+1+3]));
/* adaptive sampling, X and Y channel.
* we call vecbuf_get_pixel for every pixel since the input
* might be a procedural, and then we can't use offsets */
vpprev = vecbuf_get_pixel(vecbuf, colprev, x-1, y);
vpnext = vecbuf_get_pixel(vecbuf, colnext, x+1, y);
dx= 0.5f*(fabs(vp[0]-vpprev[0]) + fabs(vp[0]-vpnext[0]));
vpprev = vecbuf_get_pixel(vecbuf, colprev, x, y-1);
vpnext = vecbuf_get_pixel(vecbuf, colnext, x, y+1);
dy= 0.5f*(fabs(vp[1]-vpnext[1]) + fabs(vp[1]-vpprev[1]));
vpprev = vecbuf_get_pixel(vecbuf, colprev, x-1, y-1);
vpnext = vecbuf_get_pixel(vecbuf, colnext, x-1, y+1);
dx+= 0.25f*(fabs(vp[0]-vpprev[0]) + fabs(vp[0]-vpnext[0]));
dy+= 0.25f*(fabs(vp[1]-vpprev[1]) + fabs(vp[1]-vpnext[1]));
vpprev = vecbuf_get_pixel(vecbuf, colprev, x+1, y-1);
vpnext = vecbuf_get_pixel(vecbuf, colnext, x+1, y+1);
dx+= 0.25f*(fabs(vp[0]-vpprev[0]) + fabs(vp[0]-vpnext[0]));
dy+= 0.25f*(fabs(vp[1]-vpprev[1]) + fabs(vp[1]-vpnext[1]));
/* scaled down to prevent blurriness */
/* 8: magic number, provides a good level of sharpness without getting too aliased */

View File

@@ -52,9 +52,7 @@ static void do_hue_sat_fac(bNode *node, float *out, float *in, float *fac)
hsv[0]+= (nhs->hue - 0.5f);
if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0;
hsv[1]*= nhs->sat;
if(hsv[1]>1.0) hsv[1]= 1.0; else if(hsv[1]<0.0) hsv[1]= 0.0;
hsv[2]*= nhs->val;
if(hsv[2]>1.0) hsv[2]= 1.0; else if(hsv[2]<0.0) hsv[2]= 0.0;
hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2);
out[0]= mfac*in[0] + *fac*col[0];

View File

@@ -54,9 +54,7 @@ static void do_hue_sat_fac(bNode *node, float *out, float *hue, float *sat, floa
hsv[0]+= (*hue - 0.5f);
if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0;
hsv[1]*= *sat;
if(hsv[1]>1.0) hsv[1]= 1.0; else if(hsv[1]<0.0) hsv[1]= 0.0;
hsv[2]*= *val;
if(hsv[2]>1.0) hsv[2]= 1.0; else if(hsv[2]<0.0) hsv[2]= 0.0;
hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2);
out[0]= mfac*in[0] + *fac*col[0];

View File

@@ -84,7 +84,8 @@ extern "C" {
void init_syspath( int first_time );
void syspath_append( char *dir );
void BPY_rebuild_syspath( void );
int BPY_path_update( void );
int BPY_Err_getLinenumber( void );
const char *BPY_Err_getFilename( void );

View File

@@ -428,19 +428,24 @@ void BPY_rebuild_syspath( void )
if(U.pythondir[0] != '\0' ) {
char modpath[FILE_MAX];
int upyslen = strlen(U.pythondir);
BLI_strncpy(dirpath, U.pythondir, FILE_MAX);
/* check if user pydir ends with a slash and, if so, remove the slash
* (for eventual implementations of c library's stat function that might
* not like it) */
if (upyslen > 2) { /* avoids doing anything if dir == '//' */
BLI_add_slash(U.pythondir);
#ifdef WIN32
if (upyslen > 3) {
#else
if (upyslen > 1) {
#endif
if (dirpath[upyslen-1] == '\\' || dirpath[upyslen-1] == '/') {
dirpath[upyslen-1] = '\0';
}
}
BLI_strncpy(dirpath, U.pythondir, FILE_MAX);
BLI_convertstringcode(dirpath, G.sce);
syspath_append(dirpath); /* append to module search path */
BLI_make_file_string("/", modpath, dirpath, "bpymodules");
BLI_join_dirfile( modpath, dirpath, "bpymodules" );
if (BLI_exists(modpath)) syspath_append(modpath);
}
@@ -455,6 +460,16 @@ void BPY_rebuild_syspath( void )
PyGILState_Release(gilstate);
}
int BPY_path_update( void )
{
BPyMenu_RemoveAllEntries(); /* free old data */
BPY_rebuild_syspath();
if (BPyMenu_Init(1) == -1) { /* re-eval scripts registration in menus */
return 0;
}
return 1;
}
/****************************************************************************
* Description: This function finishes Python initialization in Blender.
@@ -622,11 +637,13 @@ int BPY_txt_do_python_Text( struct Text *text )
if( !strcmp( script->id.name + 2, text->id.name + 2 ) ) {
/* if this text is already a running script,
* just move to it: */
SpaceScript *sc;
newspace( curarea, SPACE_SCRIPT );
sc = curarea->spacedata.first;
sc->script = script;
return 1;
if (!G.background) {
SpaceScript *sc;
newspace( curarea, SPACE_SCRIPT );
sc = curarea->spacedata.first;
sc->script = script;
return 1;
}
}
script = script->id.next;
}
@@ -764,7 +781,6 @@ int BPY_run_script(Script *script)
Text *text = NULL;
BPy_constant *info;
int len;
char *buffer=NULL, *s;
FILE *fp = NULL;
@@ -845,7 +861,6 @@ int BPY_run_script(Script *script)
printf("Oops - weakref dict\n");
free_libblock( &G.main->script, script );
ReleaseGlobalDictionary( py_dict );
MEM_freeN( buffer );
PyGILState_Release(gilstate);
return 0;
}
@@ -867,41 +882,41 @@ int BPY_run_script(Script *script)
* 'FILE structs for different C libraries can be different and
* incompatible'.
* So now we load the script file data to a buffer */
char *buffer=NULL, *buffer_ofs=NULL, *b_to, *b_from;
fseek( fp, 0L, SEEK_END );
len = ftell( fp );
fseek( fp, 0L, SEEK_SET );
buffer = MEM_mallocN( len + 2, "pyfilebuf" ); /* len+2 to add '\n\0' */
buffer = buffer_ofs = MEM_mallocN( len + 2, "pyfilebuf" ); /* len+2 to add '\n\0' */
len = fread( buffer, 1, len, fp );
buffer[len] = '\n'; /* fix syntax error in files w/o eol */
buffer[len + 1] = '\0';
/* fast clean-up of dos cr/lf line endings: change '\r' to space */
/* we also have to check for line splitters: '\\' */
/* to avoid possible syntax errors on dos files on win */
/**/
/* but first make sure we won't disturb memory below &buffer[0]: */
if( *buffer == '\r' )
*buffer = ' ';
/* now handle the whole buffer */
for( s = buffer + 1; *s != '\0'; s++ ) {
if( *s == '\r' ) {
if( *( s - 1 ) == '\\' ) { /* special case: long lines split with '\': */
*( s - 1 ) = ' '; /* we write ' \', because '\ ' is a syntax error */
*s = '\\';
} else
*s = ' '; /* not a split line, just replace '\r' with ' ' */
}
/* fast clean-up of dos cr/lf line endings, remove convert '\r\n's to '\n' */
if (*buffer_ofs == '\r' && *(buffer_ofs+1) == '\n') {
buffer_ofs++;
}
b_from = b_to = buffer_ofs;
while(*b_from != '\0') {
if (*b_from == '\r' && *( b_from+1 ) == '\n') {
b_from++;
}
if (b_from != b_to) {
*b_to = *b_from;
}
b_to++;
b_from++;
}
*b_to = '\0';
/* done cleaning the string */
fclose( fp );
py_res = PyRun_String( buffer, Py_file_input, py_dict, py_dict );
py_res = PyRun_String( buffer_ofs, Py_file_input, py_dict, py_dict );
MEM_freeN( buffer );
}
@@ -926,10 +941,12 @@ int BPY_run_script(Script *script)
/* special case: called from the menu in the Scripts window
* we have to change sc->script pointer, since it'll be freed here.*/
if( curarea->spacetype == SPACE_SCRIPT ) {
SpaceScript *sc = curarea->spacedata.first;
sc->script = G.main->script.first; /* can be null, which is ok ... */
/* ... meaning no other script is running right now. */
if (!G.background) {
if( curarea->spacetype == SPACE_SCRIPT ) {
SpaceScript *sc = curarea->spacedata.first;
sc->script = G.main->script.first; /* can be null, which is ok ... */
/* ... meaning no other script is running right now. */
}
}
}

View File

@@ -1110,91 +1110,153 @@ static PyObject *Node_GetInputMap(BPy_Node *self) {
#define REFRACT_D 36
#define STRAND_D 37
static PyObject *ShadeInput_getAttribute(BPy_ShadeInput *self, void *type) {
PyObject *obj = NULL;
if(self->shi) {
switch(GET_INT_FROM_POINTER(type)) {
case SURFACEVIEWVECTOR:
obj = Py_BuildValue("(fff)", self->shi->view[0], self->shi->view[1], self->shi->view[2]);
break;
case VIEWNORMAL:
obj = Py_BuildValue("(fff)", self->shi->vn[0], self->shi->vn[1], self->shi->vn[2]);
break;
case SURFACENORMAL:
obj = Py_BuildValue("(fff)", self->shi->facenor[0], self->shi->facenor[1], self->shi->facenor[2]);
break;
case GLOBALTEXTURE:
obj = Py_BuildValue("(fff)", self->shi->gl[0], self->shi->gl[1], self->shi->gl[2]);
break;
case TEXTURE:
obj = Py_BuildValue("(fff)", self->shi->lo[0], self->shi->lo[1], self->shi->lo[2]);
break;
case PIXEL:
obj = Py_BuildValue("(ii)", self->shi->xs, self->shi->ys);
break;
case COLOR:
obj = Py_BuildValue("(fff)", self->shi->r, self->shi->g, self->shi->b);
break;
case SPECULAR_COLOR:
obj = Py_BuildValue("(fff)", self->shi->specr, self->shi->specg, self->shi->specb);
break;
case MIRROR_COLOR:
obj = Py_BuildValue("(fff)", self->shi->mirr, self->shi->mirg, self->shi->mirb);
break;
case AMBIENT_COLOR:
obj = Py_BuildValue("(fff)", self->shi->ambr, self->shi->ambg, self->shi->ambb);
break;
case AMBIENT:
obj = PyFloat_FromDouble((double)(self->shi->amb));
break;
case EMIT:
obj = PyFloat_FromDouble((double)(self->shi->emit));
break;
case DISPLACE:
obj = Py_BuildValue("(fff)", self->shi->displace[0], self->shi->displace[1], self->shi->displace[2]);
break;
case STRAND:
obj = PyFloat_FromDouble((double)(self->shi->strandco));
break;
case STRESS:
obj = PyFloat_FromDouble((double)(self->shi->stress));
break;
case TANGENT:
obj = Py_BuildValue("(fff)", self->shi->tang[0], self->shi->tang[1], self->shi->tang[2]);
break;
case SURFACE_D:
obj = Py_BuildValue("(fff)(fff)", self->shi->dxco[0], self->shi->dxco[1], self->shi->dxco[2], self->shi->dyco[0], self->shi->dyco[1], self->shi->dyco[2]);
break;
case TEXTURE_D:
obj = Py_BuildValue("(fff)(fff)", self->shi->dxlo[0], self->shi->dxlo[1], self->shi->dxlo[2], self->shi->dylo[0], self->shi->dylo[1], self->shi->dylo[2]);
break;
case GLOBALTEXTURE_D:
obj = Py_BuildValue("(fff)(fff)", self->shi->dxgl[0], self->shi->dxgl[1], self->shi->dxgl[2], self->shi->dygl[0], self->shi->dygl[1], self->shi->dygl[2]);
break;
case REFLECTION_D:
obj = Py_BuildValue("(fff)(fff)", self->shi->dxref[0], self->shi->dxref[1], self->shi->dxref[2], self->shi->dyref[0], self->shi->dyref[1], self->shi->dyref[2]);
break;
case NORMAL_D:
obj = Py_BuildValue("(fff)(fff)", self->shi->dxno[0], self->shi->dxno[1], self->shi->dxno[2], self->shi->dyno[0], self->shi->dyno[1], self->shi->dyno[2]);
break;
case STICKY_D:
obj = Py_BuildValue("(fff)(fff)", self->shi->dxsticky[0], self->shi->dxsticky[1], self->shi->dxsticky[2], self->shi->dysticky[0], self->shi->dysticky[1], self->shi->dysticky[2]);
break;
case REFRACT_D:
obj = Py_BuildValue("(fff)(fff)", self->shi->dxrefract[0], self->shi->dxrefract[1], self->shi->dxrefract[2], self->shi->dyrefract[0], self->shi->dyrefract[1], self->shi->dyrefract[2]);
break;
case STRAND_D:
obj = Py_BuildValue("(ff)", self->shi->dxstrand, self->shi->dystrand);
break;
default:
break;
}
}
/* MACRO time: defining shi getters */
if(!obj) {
Py_RETURN_NONE;
}
return obj;
/* a couple checks that we can redefine to nothing for a tiny performance
* gain */
#define SHI_CHECK_SHI\
if (!self->shi)\
return EXPP_ReturnPyObjError(PyExc_RuntimeError,\
"no shade input data!");
#define SHI_CHECK_OB\
if (!ob)\
return EXPP_ReturnPyObjError(PyExc_RuntimeError,\
"couldn't create vector object!");
/* for shi getters: */
#define SHI_GETATTR_f(name, var)\
static PyObject *ShadeInput_get##name(BPy_ShadeInput *self, void *unused)\
{\
PyObject *ob = NULL;\
\
SHI_CHECK_SHI\
\
ob = PyFloat_FromDouble((double)(self->shi->var));\
\
SHI_CHECK_OB\
\
return ob;\
}
#define SHI_GETATTR_fvec(name, var, len)\
static PyObject *ShadeInput_get##name(BPy_ShadeInput *self, void *unused)\
{\
PyObject *ob = NULL;\
\
SHI_CHECK_SHI\
\
ob = newVectorObject(self->shi->var, len, Py_NEW);\
\
SHI_CHECK_OB\
\
return ob;\
}
#define SHI_GETATTR_2fvec(name, v1, v2, len)\
static PyObject *ShadeInput_get##name(BPy_ShadeInput *self, void *unused)\
{\
PyObject *ob = NULL;\
PyObject *tuple = NULL;\
\
SHI_CHECK_SHI\
\
tuple = PyTuple_New(2);\
\
ob = newVectorObject(self->shi->v1, len, Py_NEW);\
PyTuple_SET_ITEM(tuple, 0, ob);\
\
ob = newVectorObject(self->shi->v2, len, Py_NEW);\
PyTuple_SET_ITEM(tuple, 1, ob);\
\
return tuple;\
}
#define SHI_GETATTR_3f(name, v1, v2, v3)\
static PyObject *ShadeInput_get##name(BPy_ShadeInput *self, void *unused)\
{\
PyObject *ob = NULL;\
float vec[3];\
\
SHI_CHECK_SHI\
\
vec[0] = self->shi->v1;\
vec[1] = self->shi->v2;\
vec[2] = self->shi->v3;\
\
ob = newVectorObject(vec, 3, Py_NEW);\
\
SHI_CHECK_OB\
\
return ob;\
}
/* float */
SHI_GETATTR_f(Ambient, amb);
SHI_GETATTR_f(Emit, emit);
SHI_GETATTR_f(Strand, strandco);
SHI_GETATTR_f(Stress, stress);
/* 3 float vars */
SHI_GETATTR_3f(Color, r, g, b)
SHI_GETATTR_3f(ColorSpecular, specr, specg, specb)
SHI_GETATTR_3f(ColorMirror, mirr, mirg, mirb)
SHI_GETATTR_3f(ColorAmbient, ambr, ambg, ambb)
/* float vector */
SHI_GETATTR_fvec(SurfaceViewVector, view, 3)
SHI_GETATTR_fvec(SurfaceNormal, facenor, 3)
SHI_GETATTR_fvec(ViewNormal, vn, 3)
SHI_GETATTR_fvec(TextureGlobal, gl, 3)
SHI_GETATTR_fvec(Texture, lo, 3)
SHI_GETATTR_fvec(Displace, displace, 3)
SHI_GETATTR_fvec(Tangent, tang, 3)
/* two float vectors */
SHI_GETATTR_2fvec(SurfaceD, dxco, dyco, 3)
SHI_GETATTR_2fvec(TextureD, dxlo, dylo, 3)
SHI_GETATTR_2fvec(TextureGlobalD, dxgl, dygl, 3)
SHI_GETATTR_2fvec(ReflectionD, dxref, dyref, 3)
SHI_GETATTR_2fvec(NormalD, dxno, dyno, 3)
SHI_GETATTR_2fvec(StickyD, dxsticky, dysticky, 3)
SHI_GETATTR_2fvec(RefractD, dxrefract, dyrefract, 3)
/* single cases (for now), not macros: */
static PyObject *ShadeInput_getPixel(BPy_ShadeInput *self, void *unused)
{
PyObject *ob = NULL;
SHI_CHECK_SHI
ob = Py_BuildValue("(ii)", self->shi->xs, self->shi->ys);
SHI_CHECK_OB
return ob;
}
static PyObject *ShadeInput_getStrandD(BPy_ShadeInput *self, void *unused)
{
PyObject *ob = NULL;
float vec[2];
SHI_CHECK_SHI
vec[0] = self->shi->dxstrand;
vec[1] = self->shi->dystrand;
ob = newVectorObject(vec, 2, Py_NEW);
SHI_CHECK_OB
return ob;
}
static BPy_SockMap *Node_CreateOutputMap(bNode *node, bNodeStack **stack) {
@@ -1256,101 +1318,77 @@ static PyGetSetDef BPy_Node_getseters[] = {
static PyGetSetDef BPy_ShadeInput_getseters[] = {
{"texture",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the current texture coordinate (tuple)",
(void*)TEXTURE},
(getter)ShadeInput_getTexture, (setter)NULL,
"Get the current texture coordinate (3-vector)", NULL},
{"textureGlobal",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the current global texture coordinate (tuple)",
(void*)GLOBALTEXTURE},
(getter)ShadeInput_getTextureGlobal, (setter)NULL,
"Get the current global texture coordinate (3-vector)", NULL},
{"surfaceNormal",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the current surface normal (tuple)",
(void*)SURFACENORMAL},
(getter)ShadeInput_getSurfaceNormal, (setter)NULL,
"Get the current surface normal (3-vector)", NULL},
{"viewNormal",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the current view normal (tuple)",
(void*)VIEWNORMAL},
(getter)ShadeInput_getViewNormal, (setter)NULL,
"Get the current view normal (3-vector)", NULL},
{"surfaceViewVector",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the vector pointing to the viewpoint from the point being shaded (tuple)",
(void*)SURFACEVIEWVECTOR},
(getter)ShadeInput_getSurfaceViewVector, (setter)NULL,
"Get the vector pointing to the viewpoint from the point being shaded (3-vector)", NULL},
{"pixel",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the x,y-coordinate for the pixel rendered (tuple)",
(void*)PIXEL},
(getter)ShadeInput_getPixel, (setter)NULL,
"Get the x,y-coordinate for the pixel rendered (3-vector)", NULL},
{"color",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the color for the point being shaded (tuple)",
(void*)COLOR},
(getter)ShadeInput_getColor, (setter)NULL,
"Get the color for the point being shaded (3-vector)", NULL},
{"specularColor",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the specular color for the point being shaded (tuple)",
(void*)SPECULAR_COLOR},
(getter)ShadeInput_getColorSpecular, (setter)NULL,
"Get the specular color for the point being shaded (3-vector)", NULL},
{"mirrorColor",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the mirror color for the point being shaded (tuple)",
(void*)MIRROR_COLOR},
(getter)ShadeInput_getColorMirror, (setter)NULL,
"Get the mirror color for the point being shaded (3-vector)", NULL},
{"ambientColor",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the ambient color for the point being shaded (tuple)",
(void*)AMBIENT_COLOR},
(getter)ShadeInput_getColorAmbient, (setter)NULL,
"Get the ambient color for the point being shaded (3-vector)", NULL},
{"ambient",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the ambient factor for the point being shaded (float)",
(void*)AMBIENT},
(getter)ShadeInput_getAmbient, (setter)NULL,
"Get the ambient factor for the point being shaded (float)", NULL},
{"emit",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the emit factor for the point being shaded (float)",
(void*)EMIT},
(getter)ShadeInput_getEmit, (setter)NULL,
"Get the emit factor for the point being shaded (float)", NULL},
{"displace",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the displace vector for the point being shaded (tuple)",
(void*)DISPLACE},
(getter)ShadeInput_getDisplace, (setter)NULL,
"Get the displace vector for the point being shaded (3-vector)", NULL},
{"strand",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the strand factor(float)",
(void*)STRAND},
(getter)ShadeInput_getStrand, (setter)NULL,
"Get the strand factor(float)", NULL},
{"stress",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the stress factor(float)",
(void*)STRESS},
(getter)ShadeInput_getStress, (setter)NULL,
"Get the stress factor(float)", NULL},
{"tangent",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the tangent vector (tuple)",
(void*)TANGENT},
(getter)ShadeInput_getTangent, (setter)NULL,
"Get the tangent vector (3-vector)", NULL},
{"surfaceD",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the surface d (tuple of tuples)",
(void*)SURFACE_D},
(getter)ShadeInput_getSurfaceD, (setter)NULL,
"Get the surface d (tuple with pair of 3-vectors)", NULL},
{"textureD",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the texture d (tuple of tuples)",
(void*)TEXTURE_D},
(getter)ShadeInput_getTextureD, (setter)NULL,
"Get the texture d (tuple with pair of 3-vectors)", NULL},
{"textureGlobalD",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the global texture d (tuple of tuples)",
(void*)GLOBALTEXTURE_D},
(getter)ShadeInput_getTextureGlobalD, (setter)NULL,
"Get the global texture d (tuple with pair of 3-vectors)", NULL},
{"reflectionD",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the reflection d (tuple of tuples)",
(void*)REFLECTION_D},
(getter)ShadeInput_getReflectionD, (setter)NULL,
"Get the reflection d (tuple with pair of 3-vectors)", NULL},
{"normalD",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the normal d (tuple of tuples)",
(void*)NORMAL_D},
(getter)ShadeInput_getNormalD, (setter)NULL,
"Get the normal d (tuple with pair of 3-vectors)", NULL},
{"stickyD",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the sticky d (tuple of tuples)",
(void*)STICKY_D},
(getter)ShadeInput_getStickyD, (setter)NULL,
"Get the sticky d (tuple with pair of 3-vectors)", NULL},
{"refractD",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the refract d (tuple of tuples)",
(void*)REFRACT_D},
(getter)ShadeInput_getRefractD, (setter)NULL,
"Get the refract d (tuple with pair of 3-vectors)", NULL},
{"strandD",
(getter)ShadeInput_getAttribute, (setter)NULL,
"Get the strand d (tuple)",
(void*)STRAND_D},
(getter)ShadeInput_getStrandD, (setter)NULL,
"Get the strand d (2-vector)", NULL},
{NULL,NULL,NULL,NULL,NULL} /* Sentinel */
};
@@ -1496,7 +1534,7 @@ PyTypeObject ShadeInput_Type = {
/*** Attribute descriptor and subclassing stuff ***/
NULL, /*BPy_Node_methods,*/ /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
BPy_ShadeInput_getseters, /* struct PyGetSetDef *tp_getset; */
BPy_ShadeInput_getseters, /* struct PyGetSetDef *tp_getset; */
NULL, /* struct _typeobject *tp_base; */
NULL, /* PyObject *tp_dict; */
NULL, /* descrgetfunc tp_descr_get; */

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