Merged changes in the trunk up to revision 44561.

Conflicts resolved:
source/blender/bmesh/bmesh.h
source/blender/bmesh/bmesh_operators.h
source/blenderplayer/bad_level_call_stubs/stubs.c
This commit is contained in:
Tamito Kajiyama 2012-02-29 21:35:49 +00:00
commit 35708fe150
455 changed files with 17229 additions and 16271 deletions

@ -1033,8 +1033,8 @@ elseif(WIN32)
if(WITH_BOOST)
set(BOOST ${LIBDIR}/boost)
set(BOOST_INCLUDE_DIR ${BOOST}/include)
set(BOOST_POSTFIX "mgw45-mt-s-1_47")
set(BOOST_DEBUG_POSTFIX "mgw45-mt-sd-1_47")
set(BOOST_POSTFIX "mgw46-mt-s-1_47")
set(BOOST_DEBUG_POSTFIX "mgw46-mt-sd-1_47")
set(BOOST_LIBRARIES
optimized boost_date_time-${BOOST_POSTFIX} boost_filesystem-${BOOST_POSTFIX}
boost_regex-${BOOST_POSTFIX} boost_system-${BOOST_POSTFIX} boost_thread-${BOOST_POSTFIX}
@ -1497,9 +1497,9 @@ if(MSVC10)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(WITH_IK_ITASC)
message(WARNING "Using Clang as CXX compiler: disabling WITH_IK_ITASC, this feature will be missing.")
set(WITH_IK_ITASC OFF)
if(WITH_LIBMV)
message(WARNING "Using Clang as CXX compiler: disabling WITH_LIBMV, this feature will be missing.")
set(WITH_LIBMV OFF)
endif()
endif()

@ -258,7 +258,7 @@ doc_py:
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/contents.html'"
doc_doxy:
cd doc/doxygen; doxygen
cd doc/doxygen; doxygen Doxyfile
@echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'"
doc_dna:

@ -55,7 +55,7 @@ else:
# scons
os.chdir(blender_dir)
scons_cmd = ['python', 'scons/scons.py']
scons_options = []
scons_options = ['BF_FANCY=False']
if builder.find('linux') != -1:
import shutil
@ -65,7 +65,7 @@ else:
build_dir = os.path.join('..', 'build', builder)
install_dir = os.path.join('..', 'install', builder)
common_options = ['BF_INSTALLDIR=' + install_dir]
common_options = ['BF_INSTALLDIR=' + install_dir] + scons_options
# Clean install directory so we'll be sure there's no
if os.path.isdir(install_dir):

@ -41,7 +41,7 @@ if len(sys.argv) >= 3:
# scons does own packaging
if builder.find('scons') != -1:
os.chdir('../blender')
scons_options = ['BF_QUICK=slnt', 'BUILDBOT_BRANCH=' + branch, 'buildslave']
scons_options = ['BF_QUICK=slnt', 'BUILDBOT_BRANCH=' + branch, 'buildslave', 'BF_FANCY=False']
if builder.find('linux') != -1:
buildbot_dir = os.path.dirname(os.path.realpath(__file__))

@ -163,7 +163,7 @@ BF_OIIO_LIBPATH = BF_OIIO + '/lib'
WITH_BF_BOOST = True
BF_BOOST = LIBDIR + '/boost'
BF_BOOST_INC = BF_BOOST + '/include'
BF_BOOST_LIB = 'boost_date_time-mgw45-mt-s-1_47 boost_filesystem-mgw45-mt-s-1_47 boost_regex-mgw45-mt-s-1_47 boost_system-mgw45-mt-s-1_47 boost_thread-mgw45-mt-s-1_47'
BF_BOOST_LIB = 'boost_date_time-mgw46-mt-s-1_47 boost_filesystem-mgw46-mt-s-1_47 boost_regex-mgw46-mt-s-1_47 boost_system-mgw46-mt-s-1_47 boost_thread-mgw46-mt-s-1_47'
BF_BOOST_LIBPATH = BF_BOOST + '/lib/gcc'
#Ray trace optimization

@ -31,7 +31,7 @@ PROJECT_NAME = Blender
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = "V2.59"
PROJECT_NUMBER = "V2.6x"
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
@ -648,7 +648,7 @@ RECURSIVE = YES
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE = ../../source/gameengine/PyDoc
EXCLUDE = ../../build_files, ../../release
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
@ -662,7 +662,7 @@ EXCLUDE_SYMLINKS = NO
# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*
EXCLUDE_PATTERNS = .svn
EXCLUDE_PATTERNS = .svn .git *.py
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the

@ -8,14 +8,14 @@
/** \defgroup render Rendering
* \ingroup blender
*/
/** \defgroup meshedit Mesh Editing */
/** \defgroup bmesh BMesh
* \ingroup blender
*/
/** \defgroup texture Texturing */
/** \defgroup compositor Compositing */
/** \defgroup scripts Scripting */
/** \defgroup python Python
* \ingroup blender scripts
* \ingroup blender
*/
/** \defgroup pygen Python Generic
@ -332,7 +332,7 @@
* \ingroup imbuf
*/
/** \defgorup imbdds DDS
/** \defgroup imbdds DDS
* \ingroup imbuf
*/

49
extern/libmv/patches/clang-3.diff vendored Normal file

@ -0,0 +1,49 @@
Index: third_party/glog/src/utilities.h
===================================================================
--- third_party/glog/src/utilities.h (revision 44501)
+++ third_party/glog/src/utilities.h (working copy)
@@ -105,7 +105,7 @@
# undef STACKTRACE_H
#elif defined(HAVE_LIB_UNWIND)
# define STACKTRACE_H "stacktrace_libunwind-inl.h"
-#elif !defined(NO_FRAME_POINTER)
+#elif !defined(NO_FRAME_POINTER) && !defined(__clang__)
# if defined(__i386__) && __GNUC__ >= 2
# define STACKTRACE_H "stacktrace_x86-inl.h"
# elif defined(__x86_64__) && __GNUC__ >= 2
Index: third_party/glog/src/logging.cc
===================================================================
--- third_party/glog/src/logging.cc (revision 44501)
+++ third_party/glog/src/logging.cc (working copy)
@@ -1231,6 +1231,14 @@
#endif
}
+#if defined(HAVE___ATTRIBUTE__)
+typedef void (*fail_func_t)() __attribute__((noreturn));
+static void logging_fail() __attribute__((noreturn));
+#else
+typedef void (*fail_func_t)();
+static void logging_fail();
+#endif
+
static void logging_fail() {
// #if defined(_DEBUG) && defined(_MSC_VER)
// doesn't work for my laptop (sergey)
@@ -1243,14 +1251,9 @@
#endif
}
-#ifdef HAVE___ATTRIBUTE__
-GOOGLE_GLOG_DLL_DECL
-void (*g_logging_fail_func)() __attribute__((noreturn)) = &logging_fail;
-#else
-GOOGLE_GLOG_DLL_DECL void (*g_logging_fail_func)() = &logging_fail;
-#endif
+GOOGLE_GLOG_DLL_DECL fail_func_t g_logging_fail_func = &logging_fail;
-void InstallFailureFunction(void (*fail_func)()) {
+void InstallFailureFunction(fail_func_t fail_func) {
g_logging_fail_func = fail_func;
}

@ -1,2 +1,3 @@
v3d_verbosity.patch
bundle_tweaks.patch
clang-3.diff

@ -430,6 +430,14 @@ static MeshSet<3> *Carve_addMesh(CSG_FaceIteratorDescriptor &face_it,
return poly;
}
static double triangleArea(carve::geom3d::Vector &v1, carve::geom3d::Vector &v2, carve::geom3d::Vector &v3)
{
carve::geom3d::Vector a = v2 - v1;
carve::geom3d::Vector b = v3 - v1;
return carve::geom::cross(a, b).length();
}
static bool checkValidQuad(std::vector<MeshSet<3>::vertex_t> &vertex_storage, uint quad[4])
{
carve::geom3d::Vector &v1 = vertex_storage[quad[0]].v;
@ -465,12 +473,12 @@ static bool checkValidQuad(std::vector<MeshSet<3>::vertex_t> &vertex_storage, ui
carve::geom3d::Vector current_normal = carve::geom::cross(edges[i], edges[n]);
if (current_normal.length() > 1e-6) {
if (current_normal.length() > DBL_EPSILON) {
if (!normal_set) {
normal = current_normal;
normal_set = true;
}
else if (carve::geom::dot(normal, current_normal) < -1e-6) {
else if (carve::geom::dot(normal, current_normal) < 0) {
return false;
}
}
@ -481,6 +489,10 @@ static bool checkValidQuad(std::vector<MeshSet<3>::vertex_t> &vertex_storage, ui
return false;
}
double area = triangleArea(v1, v2, v3) + triangleArea(v1, v3, v4);
if (area <= DBL_EPSILON)
return false;
return true;
}
@ -535,6 +547,20 @@ static uint quadMerge(std::map<MeshSet<3>::vertex_t*, uint> *vertexToIndex_map,
return 0;
}
static bool Carve_checkDegeneratedFace(MeshSet<3>::face_t *face)
{
/* only tris and quads for now */
if (face->n_edges == 3) {
return triangleArea(face->edge->prev->vert->v, face->edge->vert->v, face->edge->next->vert->v) < DBL_EPSILON;
}
else if (face->n_edges == 4) {
return triangleArea(face->edge->vert->v, face->edge->next->vert->v, face->edge->next->next->vert->v) +
triangleArea(face->edge->prev->vert->v, face->edge->vert->v, face->edge->next->next->vert->v) < DBL_EPSILON;
}
return false;
}
static BSP_CSGMesh *Carve_exportMesh(MeshSet<3>* &poly, carve::interpolate::FaceAttr<uint> &oface_num,
uint num_origfaces)
{
@ -591,13 +617,6 @@ static BSP_CSGMesh *Carve_exportMesh(MeshSet<3>* &poly, carve::interpolate::Face
MeshSet<3>::face_t *f = *(poly->faceBegin() + findex);
// add all information except vertices to the output mesh
outputMesh->FaceSet().push_back(BSP_MFace());
BSP_MFace& outFace = outputMesh->FaceSet().back();
outFace.m_verts.clear();
outFace.m_plane.setValue(f->plane.N.v);
outFace.m_orig_face = orig;
// for each vertex of this face, check other faces containing
// that vertex to see if there is a neighbor also belonging to
// the original face
@ -640,20 +659,36 @@ static BSP_CSGMesh *Carve_exportMesh(MeshSet<3>* &poly, carve::interpolate::Face
}
}
// if we merged faces, use the list of common vertices; otherwise
// use the faces's vertices
if (result) {
// make quat using verts stored in result
outFace.m_verts.push_back(quadverts[0]);
outFace.m_verts.push_back(quadverts[1]);
outFace.m_verts.push_back(quadverts[2]);
outFace.m_verts.push_back(quadverts[3]);
} else {
MeshSet<3>::face_t::edge_iter_t edge_iter = f->begin();
for (; edge_iter != f->end(); ++edge_iter) {
//int index = ofacevert_num.getAttribute(f, edge_iter.idx());
int index = vertexToIndex_map[edge_iter->vert];
outFace.m_verts.push_back( index );
bool degenerativeFace = false;
if (!result) {
/* merged triangles are already checked for degenerative quad */
degenerativeFace = Carve_checkDegeneratedFace(f);
}
if (!degenerativeFace) {
// add all information except vertices to the output mesh
outputMesh->FaceSet().push_back(BSP_MFace());
BSP_MFace& outFace = outputMesh->FaceSet().back();
outFace.m_verts.clear();
outFace.m_plane.setValue(f->plane.N.v);
outFace.m_orig_face = orig;
// if we merged faces, use the list of common vertices; otherwise
// use the faces's vertices
if (result) {
// make quat using verts stored in result
outFace.m_verts.push_back(quadverts[0]);
outFace.m_verts.push_back(quadverts[1]);
outFace.m_verts.push_back(quadverts[2]);
outFace.m_verts.push_back(quadverts[3]);
} else {
MeshSet<3>::face_t::edge_iter_t edge_iter = f->begin();
for (; edge_iter != f->end(); ++edge_iter) {
//int index = ofacevert_num.getAttribute(f, edge_iter.idx());
int index = vertexToIndex_map[edge_iter->vert];
outFace.m_verts.push_back( index );
}
}
}
}

@ -233,17 +233,17 @@ bool BOP_intersect(const MT_Vector3& vL1, const MT_Point3& pL1, const MT_Vector3
MT_Scalar den = (vL1.y()*vL2.x() - vL1.x() * vL2.y());
if (!BOP_fuzzyZero(den)) {
t = (pL2.y()*vL1.x() - vL1.y()*pL2.x() + pL1.x()*vL1.y() - pL1.y()*vL1.x()) / den ;
t = (pL2.y()*vL1.x() - vL1.y()*pL2.x() + pL1.x()*vL1.y() - pL1.y()*vL1.x()) / den;
}
else {
den = (vL1.y()*vL2.z() - vL1.z() * vL2.y());
if (!BOP_fuzzyZero(den)) {
t = (pL2.y()*vL1.z() - vL1.y()*pL2.z() + pL1.z()*vL1.y() - pL1.y()*vL1.z()) / den ;
t = (pL2.y()*vL1.z() - vL1.y()*pL2.z() + pL1.z()*vL1.y() - pL1.y()*vL1.z()) / den;
}
else {
den = (vL1.x()*vL2.z() - vL1.z() * vL2.x());
if (!BOP_fuzzyZero(den)) {
t = (pL2.x()*vL1.z() - vL1.x()*pL2.z() + pL1.z()*vL1.x() - pL1.x()*vL1.z()) / den ;
t = (pL2.x()*vL1.z() - vL1.x()*pL2.z() + pL1.z()*vL1.x() - pL1.x()*vL1.z()) / den;
}
else {
return false;

@ -289,7 +289,7 @@ void BOP_Merge2::cleanup( void )
BOP_Indexs faces = (*edge)->getFaces();
for (BOP_IT_Indexs face = faces.begin(); face != faces.end(); ++face) {
BOP_Face *f = m_mesh->getFace(*face);
if(f->getTAG()== UNCLASSIFIED) ;
if (f->getTAG()== UNCLASSIFIED);
else (*edge)->removeFace(*face);
}
if( (*edge)->getFaces().size() == 0) (*edge)->setUsed(false);

@ -108,11 +108,10 @@ public :
std::vector<BSP_MVertex> &
VertexSet(
) const ;
) const;
std::vector<BSP_MFace> &
FaceSet(
) const ;
) const;
std::vector<BSP_MEdge> &
EdgeSet(

@ -37,42 +37,42 @@
class CTR_Link {
public:
CTR_Link(
) ;
);
CTR_Link(
CTR_Link *next,
CTR_Link *prev
) ;
);
CTR_Link *
getNext(
) const ;
) const;
CTR_Link *
getPrev(
) const ;
) const;
bool
isHead(
) const ;
) const;
bool
isTail(
) const ;
) const;
void
insertBefore(
CTR_Link *link
) ;
);
void
insertAfter(
CTR_Link *link
) ;
);
void
remove(
) ;
);
private:
CTR_Link *m_next;
@ -83,25 +83,25 @@ class CTR_List {
public:
CTR_List(
) ;
);
CTR_Link *
getHead(
) const ;
) const;
CTR_Link *
getTail(
) const ;
) const;
void
addHead(
CTR_Link *link
) ;
);
void
addTail(
CTR_Link *link
) ;
);
private:
CTR_Link m_head;

@ -288,9 +288,11 @@ static void xml_read_camera(const XMLReadState& state, pugi::xml_node node)
xml_read_float(&cam->shutterclose, node, "shutterclose");
if(xml_equal_string(node, "type", "orthographic"))
cam->ortho = true;
cam->type = CAMERA_ORTHOGRAPHIC;
else if(xml_equal_string(node, "type", "perspective"))
cam->ortho = false;
cam->type = CAMERA_PERSPECTIVE;
else if(xml_equal_string(node, "type", "environment"))
cam->type = CAMERA_ENVIRONMENT;
cam->matrix = state.tfm;

@ -177,11 +177,14 @@ class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
col = split.column()
col.prop(scene, "layers", text="Scene")
col.label(text="Material:")
col.prop(rl, "material_override", text="")
col.prop(rl, "use_zmask");
col = split.column()
col.prop(rl, "layers", text="Layer")
layout.separator()
col.label(text="Mask Layers:")
col.prop(rl, "layers_zmask", text="")
split = layout.split()
@ -194,6 +197,7 @@ class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
col.prop(rl, "use_pass_material_index")
col.prop(rl, "use_pass_emit")
col.prop(rl, "use_pass_environment")
col.prop(rl, "use_pass_ambient_occlusion")
col = split.column()
col.label()
@ -213,11 +217,6 @@ class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
row.prop(rl, "use_pass_transmission_indirect", text="Indirect", toggle=True)
row.prop(rl, "use_pass_transmission_color", text="Color", toggle=True)
layout.separator()
rl = rd.layers[0]
layout.prop(rl, "material_override", text="Material")
class Cycles_PT_post_processing(CyclesButtonsPanel, Panel):
bl_label = "Post Processing"
@ -486,6 +485,45 @@ class CyclesWorld_PT_surface(CyclesButtonsPanel, Panel):
if not panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Surface'):
layout.prop(world, "horizon_color", text="Color")
class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel):
bl_label = "Volume"
bl_context = "world"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
# world = context.world
# world and world.node_tree and CyclesButtonsPanel.poll(context)
return False
def draw(self, context):
layout = self.layout
layout.active = False
world = context.world
panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Volume')
class CyclesWorld_PT_ambient_occlusion(CyclesButtonsPanel, Panel):
bl_label = "Ambient Occlusion"
bl_context = "world"
@classmethod
def poll(cls, context):
return context.world and CyclesButtonsPanel.poll(context)
def draw_header(self, context):
light = context.world.light_settings
self.layout.prop(light, "use_ambient_occlusion", text="")
def draw(self, context):
layout = self.layout
light = context.world.light_settings
layout.active = light.use_ambient_occlusion
split = layout.split()
split.prop(light, "ao_factor", text="Factor")
split.prop(light, "distance", text="Distance")
class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
bl_label = "Settings"
@ -509,26 +547,6 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
row.active = cworld.sample_as_light
row.prop(cworld, "sample_map_resolution")
class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel):
bl_label = "Volume"
bl_context = "world"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
# world = context.world
# world and world.node_tree and CyclesButtonsPanel.poll(context)
return False
def draw(self, context):
layout = self.layout
layout.active = False
world = context.world
panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Volume')
class CyclesMaterial_PT_surface(CyclesButtonsPanel, Panel):
bl_label = "Surface"
bl_context = "material"

@ -31,7 +31,7 @@ struct BlenderCamera {
float nearclip;
float farclip;
bool ortho;
CameraType type;
float ortho_scale;
float lens;
@ -58,6 +58,7 @@ static void blender_camera_init(BlenderCamera *bcam)
{
memset(bcam, 0, sizeof(BlenderCamera));
bcam->type = CAMERA_PERSPECTIVE;
bcam->zoom = 1.0f;
bcam->pixelaspect = make_float2(1.0f, 1.0f);
bcam->sensor_width = 32.0f;
@ -91,7 +92,9 @@ static void blender_camera_from_object(BlenderCamera *bcam, BL::Object b_ob)
bcam->nearclip = b_camera.clip_start();
bcam->farclip = b_camera.clip_end();
bcam->ortho = (b_camera.type() == BL::Camera::type_ORTHO);
bcam->type = (b_camera.type() == BL::Camera::type_ORTHO)? CAMERA_ORTHOGRAPHIC: CAMERA_PERSPECTIVE;
if(bcam->type == CAMERA_PERSPECTIVE && b_camera.use_panorama())
bcam->type = CAMERA_ENVIRONMENT;
bcam->ortho_scale = b_camera.ortho_scale();
bcam->lens = b_camera.lens();
@ -159,39 +162,48 @@ static void blender_camera_sync(Camera *cam, BlenderCamera *bcam, int width, int
}
/* modify aspect for orthographic scale */
if(bcam->ortho) {
if(bcam->type == CAMERA_ORTHOGRAPHIC) {
xaspect = xaspect*bcam->ortho_scale/(aspectratio*2.0f);
yaspect = yaspect*bcam->ortho_scale/(aspectratio*2.0f);
aspectratio = bcam->ortho_scale/2.0f;
}
/* set viewplane */
cam->left = -xaspect;
cam->right = xaspect;
cam->bottom = -yaspect;
cam->top = yaspect;
if(bcam->type == CAMERA_ENVIRONMENT) {
/* set viewplane */
cam->left = 0.0f;
cam->right = 1.0f;
cam->bottom = 0.0f;
cam->top = 1.0f;
}
else {
/* set viewplane */
cam->left = -xaspect;
cam->right = xaspect;
cam->bottom = -yaspect;
cam->top = yaspect;
/* zoom for 3d camera view */
cam->left *= bcam->zoom;
cam->right *= bcam->zoom;
cam->bottom *= bcam->zoom;
cam->top *= bcam->zoom;
/* zoom for 3d camera view */
cam->left *= bcam->zoom;
cam->right *= bcam->zoom;
cam->bottom *= bcam->zoom;
cam->top *= bcam->zoom;
/* modify viewplane with camera shift and 3d camera view offset */
float dx = 2.0f*(aspectratio*bcam->shift.x + bcam->offset.x*xaspect*2.0f);
float dy = 2.0f*(aspectratio*bcam->shift.y + bcam->offset.y*yaspect*2.0f);
/* modify viewplane with camera shift and 3d camera view offset */
float dx = 2.0f*(aspectratio*bcam->shift.x + bcam->offset.x*xaspect*2.0f);
float dy = 2.0f*(aspectratio*bcam->shift.y + bcam->offset.y*yaspect*2.0f);
cam->left += dx;
cam->right += dx;
cam->bottom += dy;
cam->top += dy;
cam->left += dx;
cam->right += dx;
cam->bottom += dy;
cam->top += dy;
}
/* clipping distances */
cam->nearclip = bcam->nearclip;
cam->farclip = bcam->farclip;
/* orthographic */
cam->ortho = bcam->ortho;
/* type */
cam->type = bcam->type;
/* perspective */
cam->fov = 2.0f*atan((0.5f*sensor_size)/bcam->lens/aspectratio);
@ -200,8 +212,24 @@ static void blender_camera_sync(Camera *cam, BlenderCamera *bcam, int width, int
cam->blades = bcam->apertureblades;
cam->bladesrotation = bcam->aperturerotation;
/* transform, note the blender camera points along the negative z-axis */
cam->matrix = bcam->matrix * transform_scale(1.0f, 1.0f, -1.0f);
/* transform */
cam->matrix = bcam->matrix;
if(bcam->type == CAMERA_ENVIRONMENT) {
/* make it so environment camera needs to be pointed in the direction
of the positive x-axis to match an environment texture, this way
it is looking at the center of the texture */
cam->matrix = cam->matrix *
make_transform( 0.0f, -1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
-1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f);
}
else {
/* note the blender camera points along the negative z-axis */
cam->matrix = cam->matrix * transform_scale(1.0f, 1.0f, -1.0f);
}
cam->matrix = transform_clear_scale(cam->matrix);
/* set update flag */
@ -269,7 +297,7 @@ void BlenderSync::sync_view(BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int
bcam.farclip *= 0.5;
bcam.nearclip = -bcam.farclip;
bcam.ortho = true;
bcam.type = CAMERA_ORTHOGRAPHIC;
bcam.ortho_scale = b_rv3d.view_distance();
}

@ -222,20 +222,22 @@ static void create_subd_mesh(Mesh *mesh, BL::Mesh b_mesh, PointerRNA *cmesh, con
/* Sync */
Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated)
Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool holdout, bool object_updated)
{
/* test if we can instance or if the object is modified */
BL::ID b_ob_data = b_ob.data();
BL::ID key = (object_is_modified(b_ob))? b_ob: b_ob_data;
BL::ID key = (object_is_modified(b_ob) || holdout)? b_ob: b_ob_data;
/* find shader indices */
vector<uint> used_shaders;
BL::Object::material_slots_iterator slot;
for(b_ob.material_slots.begin(slot); slot != b_ob.material_slots.end(); ++slot) {
BL::Material material_override = render_layers.front().material_override;
BL::Material material_override = render_layer.material_override;
if(material_override)
if(holdout)
find_shader(PointerRNA_NULL, used_shaders, scene->default_holdout);
else if(material_override)
find_shader(material_override, used_shaders, scene->default_surface);
else
find_shader(slot->material(), used_shaders, scene->default_surface);

@ -208,8 +208,11 @@ void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob,
if(object_map.sync(&object, b_ob, b_parent, key))
object_updated = true;
/* holdout? */
bool holdout = (layer_flag & render_layer.holdout_layer) != 0;
/* mesh sync */
object->mesh = sync_mesh(b_ob, object_updated);
object->mesh = sync_mesh(b_ob, holdout, object_updated);
/* object sync */
if(object_updated || (object->mesh && object->mesh->need_update)) {
@ -238,7 +241,7 @@ void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob,
void BlenderSync::sync_objects(BL::SpaceView3D b_v3d)
{
/* layer data */
uint scene_layer = render_layers.front().scene_layer;
uint scene_layer = render_layer.scene_layer;
/* prepare for sync */
light_map.pre_sync();

@ -158,10 +158,11 @@ static PassType get_pass_type(BL::RenderPass b_pass)
return PASS_EMISSION;
case BL::RenderPass::type_ENVIRONMENT:
return PASS_BACKGROUND;
case BL::RenderPass::type_AO:
return PASS_AO;
case BL::RenderPass::type_DIFFUSE:
case BL::RenderPass::type_SHADOW:
case BL::RenderPass::type_AO:
case BL::RenderPass::type_COLOR:
case BL::RenderPass::type_REFRACTION:
case BL::RenderPass::type_SPECULAR:

@ -696,6 +696,18 @@ void BlenderSync::sync_world()
graph->connect(closure->output("Background"), out->input("Surface"));
}
/* AO */
if(b_world) {
BL::WorldLighting b_light = b_world.light_settings();
if(b_light.use_ambient_occlusion())
background->ao_factor = b_light.ao_factor();
else
background->ao_factor = 0.0f;
background->ao_distance = b_light.distance();
}
shader->set_graph(graph);
shader->tag_update(scene);
}

@ -48,8 +48,7 @@ BlenderSync::BlenderSync(BL::BlendData b_data_, BL::Scene b_scene_, Scene *scene
light_map(&scene_->lights),
world_map(NULL),
world_recalc(false),
experimental(false),
active_layer(0)
experimental(false)
{
scene = scene_;
preview = preview_;
@ -124,8 +123,8 @@ bool BlenderSync::sync_recalc()
void BlenderSync::sync_data(BL::SpaceView3D b_v3d, const char *layer)
{
sync_render_layers(b_v3d);
sync_integrator(layer);
sync_render_layers(b_v3d, layer);
sync_integrator();
sync_film();
sync_shaders();
sync_objects(b_v3d);
@ -133,7 +132,7 @@ void BlenderSync::sync_data(BL::SpaceView3D b_v3d, const char *layer)
/* Integrator */
void BlenderSync::sync_integrator(const char *layer)
void BlenderSync::sync_integrator()
{
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
@ -156,19 +155,7 @@ void BlenderSync::sync_integrator(const char *layer)
integrator->no_caustics = get_boolean(cscene, "no_caustics");
integrator->seed = get_int(cscene, "seed");
/* render layer */
int active_layer = 0;
if(layer) {
for(int i = 0; i < render_layers.size(); i++) {
if(render_layers[i].name == layer) {
active_layer = i;
break;
}
}
}
integrator->layer_flag = render_layers[active_layer].layer;
integrator->layer_flag = render_layer.layer;
if(integrator->modified(previntegrator))
integrator->tag_update(scene);
@ -200,33 +187,29 @@ void BlenderSync::sync_film()
/* Render Layer */
void BlenderSync::sync_render_layers(BL::SpaceView3D b_v3d)
void BlenderSync::sync_render_layers(BL::SpaceView3D b_v3d, const char *layer)
{
render_layers.clear();
if(b_v3d) {
RenderLayerInfo rlay;
rlay.scene_layer = get_layer(b_v3d.layers());
rlay.layer = rlay.scene_layer;
rlay.material_override = PointerRNA_NULL;
render_layers.push_back(rlay);
render_layer.scene_layer = get_layer(b_v3d.layers());
render_layer.layer = render_layer.scene_layer;
render_layer.material_override = PointerRNA_NULL;
}
else {
BL::RenderSettings r = b_scene.render();
BL::RenderSettings::layers_iterator b_rlay;
bool first_layer = true;
for(r.layers.begin(b_rlay); b_rlay != r.layers.end(); ++b_rlay) {
/* single layer for now */
RenderLayerInfo rlay;
if((!layer && first_layer) || (layer && b_rlay->name() == layer)) {
render_layer.name = b_rlay->name();
render_layer.scene_layer = get_layer(b_scene.layers());
render_layer.layer = get_layer(b_rlay->layers());
render_layer.holdout_layer = (b_rlay->use_zmask())? ~get_layer(b_rlay->layers_zmask()): 0;
render_layer.layer |= render_layer.holdout_layer;
render_layer.material_override = b_rlay->material_override();
}
rlay.name = b_rlay->name();
rlay.scene_layer = get_layer(b_scene.layers());
rlay.layer = get_layer(b_rlay->layers());
rlay.material_override = b_rlay->material_override();
render_layers.push_back(rlay);
first_layer = false;
}
}
}

@ -70,14 +70,14 @@ private:
void sync_materials();
void sync_objects(BL::SpaceView3D b_v3d);
void sync_film();
void sync_integrator(const char *layer);
void sync_integrator();
void sync_view();
void sync_world();
void sync_render_layers(BL::SpaceView3D b_v3d);
void sync_render_layers(BL::SpaceView3D b_v3d, const char *layer);
void sync_shaders();
void sync_nodes(Shader *shader, BL::ShaderNodeTree b_ntree);
Mesh *sync_mesh(BL::Object b_ob, bool object_updated);
Mesh *sync_mesh(BL::Object b_ob, bool holdout, bool object_updated);
void sync_object(BL::Object b_parent, int b_index, BL::Object b_object, Transform& tfm, uint layer_flag);
void sync_light(BL::Object b_parent, int b_index, BL::Object b_ob, Transform& tfm);
void sync_background_light();
@ -113,11 +113,9 @@ private:
string name;
uint scene_layer;
uint layer;
uint holdout_layer;
BL::Material material_override;
};
vector<RenderLayerInfo> render_layers;
int active_layer;
} render_layer;
};
CCL_NAMESPACE_END

@ -135,6 +135,7 @@ __device_inline void path_radiance_init(PathRadiance *L, int use_light_pass)
L->emission = make_float3(0.0f, 0.0f, 0.0f);
L->background = make_float3(0.0f, 0.0f, 0.0f);
L->ao = make_float3(0.0f, 0.0f, 0.0f);
}
else
L->emission = make_float3(0.0f, 0.0f, 0.0f);
@ -199,6 +200,27 @@ __device_inline void path_radiance_accum_emission(PathRadiance *L, float3 throug
#endif
}
__device_inline void path_radiance_accum_ao(PathRadiance *L, float3 throughput, float3 bsdf, float3 ao, int bounce)
{
#ifdef __PASSES__
if(L->use_light_pass) {
if(bounce == 0) {
/* directly visible lighting */
L->direct_diffuse += throughput*bsdf*ao;
L->ao += throughput*ao;
}
else {
/* indirectly visible lighting after BSDF bounce */
L->indirect += throughput*bsdf*ao;
}
}
else
L->emission += throughput*bsdf*ao;
#else
*L += throughput*bsdf*ao;
#endif
}
__device_inline void path_radiance_accum_light(PathRadiance *L, float3 throughput, BsdfEval *bsdf_eval, int bounce)
{
#ifdef __PASSES__

@ -122,6 +122,44 @@ __device void camera_sample_orthographic(KernelGlobals *kg, float raster_x, floa
#endif
}
/* Environment Camera */
__device void camera_sample_environment(KernelGlobals *kg, float raster_x, float raster_y, Ray *ray)
{
Transform rastertocamera = kernel_data.cam.rastertocamera;
float3 Pcamera = transform(&rastertocamera, make_float3(raster_x, raster_y, 0.0f));
/* create ray form raster position */
ray->P = make_float3(0.0, 0.0f, 0.0f);
ray->D = equirectangular_to_direction(Pcamera.x, Pcamera.y);
/* transform ray from camera to world */
Transform cameratoworld = kernel_data.cam.cameratoworld;
ray->P = transform(&cameratoworld, ray->P);
ray->D = transform_direction(&cameratoworld, ray->D);
ray->D = normalize(ray->D);
#ifdef __RAY_DIFFERENTIALS__
/* ray differential */
ray->dP.dx = make_float3(0.0f, 0.0f, 0.0f);
ray->dP.dy = make_float3(0.0f, 0.0f, 0.0f);
Pcamera = transform(&rastertocamera, make_float3(raster_x + 1.0f, raster_y, 0.0f));
ray->dD.dx = equirectangular_to_direction(Pcamera.x, Pcamera.y) - ray->D;
Pcamera = transform(&rastertocamera, make_float3(raster_x, raster_y + 1.0f, 0.0f));
ray->dD.dy = equirectangular_to_direction(Pcamera.x, Pcamera.y) - ray->D;
#endif
#ifdef __CAMERA_CLIPPING__
/* clipping */
ray->t = kernel_data.cam.cliplength;
#else
ray->t = FLT_MAX;
#endif
}
/* Common */
__device void camera_sample(KernelGlobals *kg, int x, int y, float filter_u, float filter_v, float lens_u, float lens_v, Ray *ray)
@ -134,10 +172,12 @@ __device void camera_sample(KernelGlobals *kg, int x, int y, float filter_u, flo
//ray->time = lerp(time_t, kernel_data.cam.shutter_open, kernel_data.cam.shutter_close);
/* sample */
if(kernel_data.cam.ortho)
if(kernel_data.cam.type == CAMERA_PERSPECTIVE)
camera_sample_perspective(kg, raster_x, raster_y, lens_u, lens_v, ray);
else if(kernel_data.cam.type == CAMERA_ORTHOGRAPHIC)
camera_sample_orthographic(kg, raster_x, raster_y, ray);
else
camera_sample_perspective(kg, raster_x, raster_y, lens_u, lens_v, ray);
camera_sample_environment(kg, raster_x, raster_y, ray);
}
CCL_NAMESPACE_END

@ -41,9 +41,11 @@ __device void kernel_shader_evaluate(KernelGlobals *kg, uint4 *input, float4 *ou
else { // SHADER_EVAL_BACKGROUND
/* setup ray */
Ray ray;
float u = __int_as_float(in.x);
float v = __int_as_float(in.y);
ray.P = make_float3(0.0f, 0.0f, 0.0f);
ray.D = make_float3(__int_as_float(in.x), __int_as_float(in.y), __int_as_float(in.z));
ray.D = equirectangular_to_direction(u, v);
ray.t = 0.0f;
#ifdef __RAY_DIFFERENTIALS__

@ -120,13 +120,9 @@ __device float3 background_light_sample(KernelGlobals *kg, float randu, float ra
float du = (randu - cdf_u.y) / (cdf_next_u.y - cdf_u.y);
float u = (index_u + du) / res;
/* spherical coordinates */
float theta = v * M_PI_F;
float phi = u * M_PI_F * 2.0f;
/* compute pdf */
float denom = cdf_last_u.x * cdf_last_v.x;
float sin_theta = sinf(theta);
float sin_theta = sinf(M_PI_F * v);
if(sin_theta == 0.0f || denom == 0.0f)
*pdf = 0.0f;
@ -136,7 +132,7 @@ __device float3 background_light_sample(KernelGlobals *kg, float randu, float ra
*pdf *= kernel_data.integrator.pdf_lights;
/* compute direction */
return spherical_to_direction(theta, phi);
return -equirectangular_to_direction(u, v);
}
__device float background_light_pdf(KernelGlobals *kg, float3 direction)

@ -185,7 +185,7 @@ __device float2 regular_polygon_sample(float corners, float rotation, float u, f
return make_float2(cr*p.x - sr*p.y, sr*p.x + cr*p.y);
}
/* Spherical coordinates <-> Cartesion direction */
/* Spherical coordinates <-> Cartesian direction */
__device float2 direction_to_spherical(float3 dir)
{
@ -203,11 +203,11 @@ __device float3 spherical_to_direction(float theta, float phi)
cosf(theta));
}
/* Equirectangular */
/* Equirectangular coordinates <-> Cartesian direction */
__device float2 direction_to_equirectangular(float3 dir)
{
float u = (atan2f(dir.y, dir.x) + M_PI_F)/(2.0f*M_PI_F);
float u = -atan2f(dir.y, dir.x)/(2.0f*M_PI_F) + 0.5f;
float v = atan2f(dir.z, hypotf(dir.x, dir.y))/M_PI_F + 0.5f;
return make_float2(u, v);
@ -215,9 +215,8 @@ __device float2 direction_to_equirectangular(float3 dir)
__device float3 equirectangular_to_direction(float u, float v)
{
/* XXX check correctness? */
float theta = M_PI_F*v;
float phi = 2.0f*M_PI_F*u;
float phi = M_PI_F*(1.0f - 2.0f*u);
float theta = M_PI_F*(1.0f - v);
return make_float3(
sin(theta)*cos(phi),

@ -123,6 +123,8 @@ __device_inline void kernel_write_light_passes(KernelGlobals *kg, __global float
kernel_write_pass_float3(buffer + kernel_data.film.pass_emission, sample, L->emission);
if(flag & PASS_BACKGROUND)
kernel_write_pass_float3(buffer + kernel_data.film.pass_background, sample, L->background);
if(flag & PASS_AO)
kernel_write_pass_float3(buffer + kernel_data.film.pass_ao, sample, L->ao);
if(flag & PASS_DIFFUSE_COLOR)
kernel_write_pass_float3(buffer + kernel_data.film.pass_diffuse_color, sample, L->color_diffuse);

@ -145,12 +145,15 @@ __device_inline float path_state_terminate_probability(KernelGlobals *kg, PathSt
return average(throughput);
}
__device_inline bool shadow_blocked(KernelGlobals *kg, PathState *state, Ray *ray, Intersection *isect, BsdfEval *L_light)
__device_inline bool shadow_blocked(KernelGlobals *kg, PathState *state, Ray *ray, float3 *shadow)
{
if(ray->t == 0.0f)
return false;
bool result = scene_intersect(kg, ray, PATH_RAY_SHADOW_OPAQUE, isect);
Intersection isect;
bool result = scene_intersect(kg, ray, PATH_RAY_SHADOW_OPAQUE, &isect);
*shadow = make_float3(1.0f, 1.0f, 1.0f);
#ifdef __TRANSPARENT_SHADOWS__
if(result && kernel_data.integrator.transparent_shadows) {
@ -162,7 +165,7 @@ __device_inline bool shadow_blocked(KernelGlobals *kg, PathState *state, Ray *ra
also note that for this to work correct, multi close sampling must
be used, since we don't pass a random number to shader_eval_surface */
if(shader_transparent_shadow(kg, isect)) {
if(shader_transparent_shadow(kg, &isect)) {
float3 throughput = make_float3(1.0f, 1.0f, 1.0f);
float3 Pend = ray->P + ray->D*ray->t;
int bounce = state->transparent_bounce;
@ -184,16 +187,16 @@ __device_inline bool shadow_blocked(KernelGlobals *kg, PathState *state, Ray *ra
#endif
}
if(!scene_intersect(kg, ray, PATH_RAY_SHADOW_TRANSPARENT, isect)) {
bsdf_eval_mul(L_light, throughput);
if(!scene_intersect(kg, ray, PATH_RAY_SHADOW_TRANSPARENT, &isect)) {
*shadow *= throughput;
return false;
}
if(!shader_transparent_shadow(kg, isect))
if(!shader_transparent_shadow(kg, &isect))
return true;
ShaderData sd;
shader_setup_from_ray(kg, &sd, isect, ray);
shader_setup_from_ray(kg, &sd, &isect, ray);
shader_eval_surface(kg, &sd, 0.0f, PATH_RAY_SHADOW);
throughput *= shader_bsdf_transparency(kg, &sd);
@ -285,6 +288,35 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
throughput /= probability;
#ifdef __AO__
/* ambient occlusion */
if(kernel_data.integrator.use_ambient_occlusion) {
/* todo: solve correlation */
float bsdf_u = path_rng(kg, rng, sample, rng_offset + PRNG_BSDF_U);
float bsdf_v = path_rng(kg, rng, sample, rng_offset + PRNG_BSDF_V);
float3 ao_D;
float ao_pdf;
sample_cos_hemisphere(sd.N, bsdf_u, bsdf_v, &ao_D, &ao_pdf);
if(dot(sd.Ng, ao_D) > 0.0f && ao_pdf != 0.0f) {
Ray light_ray;
float3 ao_shadow;
light_ray.P = ray_offset(sd.P, sd.Ng);
light_ray.D = ao_D;
light_ray.t = kernel_data.background.ao_distance;
if(!shadow_blocked(kg, &state, &light_ray, &ao_shadow)) {
float3 ao_bsdf = shader_bsdf_diffuse(kg, &sd)*kernel_data.background.ao_factor;
path_radiance_accum_ao(&L, throughput, ao_bsdf, ao_shadow, state.bounce);
}
}
}
#endif
#ifdef __EMISSION__
if(kernel_data.integrator.use_direct_light) {
/* sample illumination from lights to find path contribution */
@ -307,8 +339,13 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
#endif
if(direct_emission(kg, &sd, i, light_t, light_o, light_u, light_v, &light_ray, &L_light)) {
/* trace shadow ray */
if(!shadow_blocked(kg, &state, &light_ray, &isect, &L_light))
float3 shadow;
if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
/* accumulate */
bsdf_eval_mul(&L_light, shadow);
path_radiance_accum_light(&L, throughput, &L_light, state.bounce);
}
}
#ifdef __MULTI_LIGHT__
}

@ -72,6 +72,7 @@ CCL_NAMESPACE_BEGIN
#define __TRANSPARENT_SHADOWS__
#define __PASSES__
#define __BACKGROUND_MIS__
#define __AO__
#endif
//#define __MULTI_LIGHT__
@ -172,7 +173,8 @@ typedef enum PassType {
PASS_GLOSSY_DIRECT = 16384,
PASS_TRANSMISSION_DIRECT = 32768,
PASS_EMISSION = 65536,
PASS_BACKGROUND = 131072
PASS_BACKGROUND = 131072,
PASS_AO = 262144
} PassType;
#define PASS_ALL (~0)
@ -186,6 +188,7 @@ typedef struct PathRadiance {
float3 emission;
float3 background;
float3 ao;
float3 indirect;
float3 direct_throughput;
@ -237,9 +240,18 @@ typedef enum LightType {
LIGHT_POINT,
LIGHT_DISTANT,
LIGHT_BACKGROUND,
LIGHT_AREA
LIGHT_AREA,
LIGHT_AO
} LightType;
/* Camera Type */
enum CameraType {
CAMERA_PERSPECTIVE,
CAMERA_ORTHOGRAPHIC,
CAMERA_ENVIRONMENT
};
/* Differential */
typedef struct differential3 {
@ -387,7 +399,7 @@ typedef struct ShaderData {
typedef struct KernelCamera {
/* type */
int ortho;
int type;
int pad1, pad2, pad3;
/* matrices */
@ -450,7 +462,7 @@ typedef struct KernelFilm {
int pass_emission;
int pass_background;
int pass_pad1;
int pass_ao;
int pass_pad2;
} KernelFilm;
@ -458,7 +470,10 @@ typedef struct KernelBackground {
/* only shader index */
int shader;
int transparent;
int pad1, pad2;
/* ambient occlusion */
float ao_factor;
float ao_distance;
} KernelBackground;
typedef struct KernelSunSky {
@ -474,6 +489,7 @@ typedef struct KernelSunSky {
typedef struct KernelIntegrator {
/* emission */
int use_direct_light;
int use_ambient_occlusion;
int num_distribution;
int num_all_lights;
float pdf_triangles;
@ -501,7 +517,7 @@ typedef struct KernelIntegrator {
/* render layer */
int layer_flag;
int pad1, pad2, pad3;
int pad1, pad2;
} KernelIntegrator;
typedef struct KernelBVH {

@ -101,9 +101,9 @@ ustring Attribute::standard_name(Attribute::Standard std)
/* Attribute Set */
AttributeSet::AttributeSet(Mesh *mesh_)
AttributeSet::AttributeSet()
{
mesh = mesh_;
mesh = NULL;
}
AttributeSet::~AttributeSet()
@ -133,7 +133,8 @@ Attribute *AttributeSet::add(ustring name, TypeDesc type, Attribute::Element ele
else if(element == Attribute::CORNER)
attr->set(name, type, element);
attr->reserve(mesh->verts.size(), mesh->triangles.size());
if(mesh)
attr->reserve(mesh->verts.size(), mesh->triangles.size());
return attr;
}

@ -94,7 +94,7 @@ public:
Mesh *mesh;
list<Attribute> attributes;
AttributeSet(Mesh *mesh);
AttributeSet();
~AttributeSet();
Attribute *add(ustring name, TypeDesc type, Attribute::Element element);

@ -18,6 +18,7 @@
#include "background.h"
#include "device.h"
#include "integrator.h"
#include "graph.h"
#include "nodes.h"
#include "scene.h"
@ -31,6 +32,9 @@ CCL_NAMESPACE_BEGIN
Background::Background()
{
ao_factor = 0.0f;
ao_distance = FLT_MAX;
transparent = false;
need_update = true;
}
@ -48,6 +52,10 @@ void Background::device_update(Device *device, DeviceScene *dscene, Scene *scene
/* set shader index and transparent option */
KernelBackground *kbackground = &dscene->data.background;
kbackground->ao_factor = ao_factor;
kbackground->ao_distance = ao_distance;
kbackground->transparent = transparent;
kbackground->shader = scene->shader_manager->get_shader_id(scene->default_background);
@ -60,11 +68,14 @@ void Background::device_free(Device *device, DeviceScene *dscene)
bool Background::modified(const Background& background)
{
return !(transparent == background.transparent);
return !(transparent == background.transparent &&
ao_factor == background.ao_factor &&
ao_distance == background.ao_distance);
}
void Background::tag_update(Scene *scene)
{
scene->integrator->tag_update(scene);
need_update = true;
}

@ -29,6 +29,9 @@ class Scene;
class Background {
public:
float ao_factor;
float ao_distance;
bool transparent;
bool need_update;

@ -35,7 +35,7 @@ Camera::Camera()
matrix = transform_identity();
ortho = false;
type = CAMERA_PERSPECTIVE;
fov = M_PI_F/4.0f;
nearclip = 1e-5f;
@ -77,17 +77,21 @@ void Camera::update()
Transform ndctoraster = transform_scale(width, height, 1.0f);
/* raster to screen */
Transform screentoraster = ndctoraster *
Transform screentoraster = ndctoraster;
screentoraster = ndctoraster *
transform_scale(1.0f/(right - left), 1.0f/(top - bottom), 1.0f) *
transform_translate(-left, -bottom, 0.0f);
Transform rastertoscreen = transform_inverse(screentoraster);
/* screen to camera */
if(ortho)
if(type == CAMERA_PERSPECTIVE)
screentocamera = transform_inverse(transform_perspective(fov, nearclip, farclip));
else if(type == CAMERA_ORTHOGRAPHIC)
screentocamera = transform_inverse(transform_orthographic(nearclip, farclip));
else
screentocamera = transform_inverse(transform_perspective(fov, nearclip, farclip));
screentocamera = transform_identity();
rastertocamera = screentocamera * rastertoscreen;
@ -98,16 +102,20 @@ void Camera::update()
worldtoraster = transform_inverse(rastertoworld);
/* differentials */
if(ortho) {
if(type == CAMERA_ORTHOGRAPHIC) {
dx = transform_direction(&rastertocamera, make_float3(1, 0, 0));
dy = transform_direction(&rastertocamera, make_float3(0, 1, 0));
}
else {
else if(type == CAMERA_PERSPECTIVE) {
dx = transform(&rastertocamera, make_float3(1, 0, 0)) -
transform(&rastertocamera, make_float3(0, 0, 0));
dy = transform(&rastertocamera, make_float3(0, 1, 0)) -
transform(&rastertocamera, make_float3(0, 0, 0));
}
else {
dx = make_float3(0, 0, 0);
dy = make_float3(0, 0, 0);
}
dx = transform_direction(&cameratoworld, dx);
dy = transform_direction(&cameratoworld, dy);
@ -147,7 +155,7 @@ void Camera::device_update(Device *device, DeviceScene *dscene)
kcam->shutterclose = shutterclose;
/* type */
kcam->ortho = ortho;
kcam->type = type;
/* store differentials */
kcam->dx = float3_to_float4(dx);
@ -173,7 +181,7 @@ bool Camera::modified(const Camera& cam)
(blades == cam.blades) &&
(bladesrotation == cam.bladesrotation) &&
(focaldistance == cam.focaldistance) &&
(ortho == cam.ortho) &&
(type == cam.type) &&
(fov == cam.fov) &&
(nearclip == cam.nearclip) &&
(farclip == cam.farclip) &&

@ -19,6 +19,8 @@
#ifndef __CAMERA_H__
#define __CAMERA_H__
#include "kernel_types.h"
#include "util_transform.h"
#include "util_types.h"
@ -44,8 +46,8 @@ public:
uint blades;
float bladesrotation;
/* orthographic/perspective */
bool ortho;
/* type */
CameraType type;
float fov;
/* clipping */

@ -19,6 +19,7 @@
#include "camera.h"
#include "device.h"
#include "film.h"
#include "integrator.h"
#include "scene.h"
#include "util_algorithm.h"
@ -111,6 +112,10 @@ void Pass::add(PassType type, vector<Pass>& passes)
pass.components = 4;
pass.exposure = true;
break;
case PASS_AO:
pass.components = 4;
pass.exposure = true;
break;
}
passes.push_back(pass);
@ -224,6 +229,9 @@ void Film::device_update(Device *device, DeviceScene *dscene)
case PASS_BACKGROUND:
kfilm->pass_background = kfilm->pass_stride;
kfilm->use_light_pass = 1;
case PASS_AO:
kfilm->pass_ao = kfilm->pass_stride;
kfilm->use_light_pass = 1;
case PASS_NONE:
break;
}
@ -248,6 +256,7 @@ bool Film::modified(const Film& film)
void Film::tag_update(Scene *scene)
{
scene->integrator->tag_update(scene);
need_update = true;
}

@ -83,6 +83,9 @@ void Integrator::device_update(Device *device, DeviceScene *dscene)
kintegrator->seed = hash_int(seed);
kintegrator->layer_flag = layer_flag << PATH_RAY_LAYER_SHIFT;
kintegrator->use_ambient_occlusion =
((dscene->data.film.pass_flag & PASS_AO) || dscene->data.background.ao_factor != 0.0f);
/* sobol directions table */
int dimensions = PRNG_BASE_NUM + (max_bounce + transparent_max_bounce + 2)*PRNG_BOUNCE_NUM;
uint *directions = dscene->sobol_directions.resize(SOBOL_BITS*dimensions);

@ -45,9 +45,8 @@ static void dump_background_pixels(Device *device, DeviceScene *dscene, int res,
for(int x = 0; x < width; x++) {
float u = x/(float)width;
float v = y/(float)height;
float3 D = -equirectangular_to_direction(u, v);
uint4 in = make_uint4(__float_as_int(D.x), __float_as_int(D.y), __float_as_int(D.z), 0);
uint4 in = make_uint4(__float_as_int(u), __float_as_int(v), 0, 0);
d_input_data[x + y*width] = in;
}
}

@ -38,7 +38,6 @@ CCL_NAMESPACE_BEGIN
/* Mesh */
Mesh::Mesh()
: attributes(this)
{
need_update = true;
transform_applied = false;
@ -49,6 +48,8 @@ Mesh::Mesh()
tri_offset = 0;
vert_offset = 0;
attributes.mesh = this;
}
Mesh::~Mesh()

@ -152,13 +152,13 @@ void Scene::device_update(Device *device_, Progress& progress)
if(progress.get_cancel()) return;
progress.set_status("Updating Integrator");
integrator->device_update(device, &dscene);
progress.set_status("Updating Film");
film->device_update(device, &dscene);
if(progress.get_cancel()) return;
progress.set_status("Updating Film");
film->device_update(device, &dscene);
progress.set_status("Updating Integrator");
integrator->device_update(device, &dscene);
if(progress.get_cancel()) return;

@ -156,6 +156,7 @@ public:
int default_surface;
int default_light;
int default_background;
int default_holdout;
/* device */
Device *device;

@ -256,6 +256,22 @@ void ShaderManager::add_default(Scene *scene)
scene->shaders.push_back(shader);
scene->default_background = scene->shaders.size() - 1;
}
/* default holdout */
{
graph = new ShaderGraph();
closure = graph->add(new HoldoutNode());
out = graph->output();
graph->connect(closure->output("Holdout"), out->input("Surface"));
shader = new Shader();
shader->name = "default_holdout";
shader->graph = graph;
scene->shaders.push_back(shader);
scene->default_holdout = scene->shaders.size() - 1;
}
}
CCL_NAMESPACE_END

@ -235,6 +235,9 @@ int clLibraryInit()
__clewEnqueueBarrier = (PFNCLENQUEUEBARRIER )CLCC_DYNLIB_IMPORT(module, "clEnqueueBarrier");
__clewGetExtensionFunctionAddress = (PFNCLGETEXTENSIONFUNCTIONADDRESS )CLCC_DYNLIB_IMPORT(module, "clGetExtensionFunctionAddress");
if(__clewGetPlatformIDs == NULL)
return 0;
return 1;
}

@ -122,7 +122,7 @@ private :
MT_Vector3
ComputeNormal(
const LOD_TriFace &face
) const ;
) const;
const
MT_Vector3

@ -128,7 +128,7 @@ private :
MT_Vector3
ComputeNormal(
const LOD_TriFace &face
) const ;
) const;
const
MT_Vector3

@ -76,11 +76,11 @@ public:
std::vector<LOD_Vertex> &
VertexSet(
) const ;
) const;
std::vector<LOD_TriFace> &
FaceSet(
) const ;
) const;
std::vector<LOD_Edge> &
EdgeSet(

@ -50,7 +50,7 @@ public :
bool m_select_tag;
LOD_Vertex(
) ;
);
bool
RemoveEdge(
@ -109,13 +109,13 @@ public :
LOD_FaceInd
OpFace(
LOD_FaceInd f
) const ;
) const;
void
SwapFace(
LOD_FaceInd old_f,
LOD_FaceInd new_f
) ;
);
// return the half edge face - the half edge is defined
@ -139,11 +139,11 @@ public :
SwapVertex(
LOD_VertexInd v_old,
LOD_VertexInd v_new
) ;
);
bool
SelectTag(
) const ;
) const;
void
SetSelectTag(
@ -157,7 +157,7 @@ public :
void
SetOpenTag(
int tag
) ;
);
bool
Degenerate(

@ -494,7 +494,7 @@ extern void GHOST_SetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle,
* @param windowhandle The handle to the window
* @return The validity of the window.
*/
extern int GHOST_GetValid(GHOST_WindowHandle windowhandle) ;
extern int GHOST_GetValid(GHOST_WindowHandle windowhandle);
/**
* Returns the type of drawing context used in this window.
@ -592,7 +592,7 @@ extern void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle,
GHOST_TInt32 inX,
GHOST_TInt32 inY,
GHOST_TInt32* outX,
GHOST_TInt32* outY) ;
GHOST_TInt32* outY);
/**
* Converts a point in screen coordinates to client rectangle coordinates

@ -66,6 +66,11 @@ static const char* ndof_button_names[] = {
"NDOF_BUTTON_DOMINANT",
"NDOF_BUTTON_PLUS",
"NDOF_BUTTON_MINUS",
// keyboard emulation
"NDOF_BUTTON_ESC",
"NDOF_BUTTON_ALT",
"NDOF_BUTTON_SHIFT",
"NDOF_BUTTON_CTRL",
// general-purpose buttons
"NDOF_BUTTON_1",
"NDOF_BUTTON_2",
@ -86,30 +91,10 @@ static const char* ndof_button_names[] = {
};
#endif
static const NDOF_ButtonT SpaceNavigator_HID_map[] = {
NDOF_BUTTON_MENU,
NDOF_BUTTON_FIT
};
static const NDOF_ButtonT SpaceExplorer_HID_map[] = {
NDOF_BUTTON_1,
NDOF_BUTTON_2,
NDOF_BUTTON_TOP,
NDOF_BUTTON_LEFT,
NDOF_BUTTON_RIGHT,
NDOF_BUTTON_FRONT,
NDOF_BUTTON_NONE, // esc key
NDOF_BUTTON_NONE, // alt key
NDOF_BUTTON_NONE, // shift key
NDOF_BUTTON_NONE, // ctrl key
NDOF_BUTTON_FIT,
NDOF_BUTTON_MENU,
NDOF_BUTTON_PLUS,
NDOF_BUTTON_MINUS,
NDOF_BUTTON_ROTATE
};
static const NDOF_ButtonT SpacePilotPro_HID_map[] = {
// shared by the latest 3Dconnexion hardware
// SpacePilotPro uses all of these
// smaller devices use only some, based on button mask
static const NDOF_ButtonT Modern3Dx_HID_map[] = {
NDOF_BUTTON_MENU,
NDOF_BUTTON_FIT,
NDOF_BUTTON_TOP,
@ -132,10 +117,10 @@ static const NDOF_ButtonT SpacePilotPro_HID_map[] = {
NDOF_BUTTON_8,
NDOF_BUTTON_9,
NDOF_BUTTON_10,
NDOF_BUTTON_NONE, // esc key
NDOF_BUTTON_NONE, // alt key
NDOF_BUTTON_NONE, // shift key
NDOF_BUTTON_NONE, // ctrl key
NDOF_BUTTON_ESC,
NDOF_BUTTON_ALT,
NDOF_BUTTON_SHIFT,
NDOF_BUTTON_CTRL,
NDOF_BUTTON_ROTATE,
NDOF_BUTTON_PANZOOM,
NDOF_BUTTON_DOMINANT,
@ -143,35 +128,22 @@ static const NDOF_ButtonT SpacePilotPro_HID_map[] = {
NDOF_BUTTON_MINUS
};
// latest HW: button-compatible with SpacePilotPro, just fewer of them
static const NDOF_ButtonT SpaceMousePro_HID_map[] = {
NDOF_BUTTON_MENU,
NDOF_BUTTON_FIT,
NDOF_BUTTON_TOP,
NDOF_BUTTON_NONE, // left
NDOF_BUTTON_RIGHT,
NDOF_BUTTON_FRONT,
NDOF_BUTTON_NONE, // bottom
NDOF_BUTTON_NONE, // back
NDOF_BUTTON_ROLL_CW,
NDOF_BUTTON_NONE, // roll ccw
NDOF_BUTTON_NONE, // iso 1
NDOF_BUTTON_NONE, // iso 2
static const NDOF_ButtonT SpaceExplorer_HID_map[] = {
NDOF_BUTTON_1,
NDOF_BUTTON_2,
NDOF_BUTTON_3,
NDOF_BUTTON_4,
NDOF_BUTTON_NONE, // 5
NDOF_BUTTON_NONE, // 6
NDOF_BUTTON_NONE, // 7
NDOF_BUTTON_NONE, // 8
NDOF_BUTTON_NONE, // 9
NDOF_BUTTON_NONE, // 10
NDOF_BUTTON_NONE, // esc key
NDOF_BUTTON_NONE, // alt key
NDOF_BUTTON_NONE, // shift key
NDOF_BUTTON_NONE, // ctrl key
NDOF_BUTTON_ROTATE,
NDOF_BUTTON_TOP,
NDOF_BUTTON_LEFT,
NDOF_BUTTON_RIGHT,
NDOF_BUTTON_FRONT,
NDOF_BUTTON_ESC,
NDOF_BUTTON_ALT,
NDOF_BUTTON_SHIFT,
NDOF_BUTTON_CTRL,
NDOF_BUTTON_FIT,
NDOF_BUTTON_MENU,
NDOF_BUTTON_PLUS,
NDOF_BUTTON_MINUS,
NDOF_BUTTON_ROTATE
};
/* this is the older SpacePilot (sans Pro)
@ -187,10 +159,10 @@ static const NDOF_ButtonT SpacePilot_HID_map[] = {
NDOF_BUTTON_LEFT,
NDOF_BUTTON_RIGHT,
NDOF_BUTTON_FRONT,
NDOF_BUTTON_NONE, // esc key
NDOF_BUTTON_NONE, // alt key
NDOF_BUTTON_NONE, // shift key
NDOF_BUTTON_NONE, // ctrl key
NDOF_BUTTON_ESC,
NDOF_BUTTON_ALT,
NDOF_BUTTON_SHIFT,
NDOF_BUTTON_CTRL,
NDOF_BUTTON_FIT,
NDOF_BUTTON_MENU,
NDOF_BUTTON_PLUS,
@ -200,9 +172,7 @@ static const NDOF_ButtonT SpacePilot_HID_map[] = {
NDOF_BUTTON_NONE // the CONFIG button -- what does it do?
};
/* this is the older Spaceball 5000 USB
* thanks to Tehrasha Darkon for info about this device */
static const NDOF_ButtonT Spaceball5000_HID_map[] = {
static const NDOF_ButtonT Generic_HID_map[] = {
NDOF_BUTTON_1,
NDOF_BUTTON_2,
NDOF_BUTTON_3,
@ -217,11 +187,14 @@ static const NDOF_ButtonT Spaceball5000_HID_map[] = {
NDOF_BUTTON_C
};
static const int genericButtonCount = sizeof(Generic_HID_map) / sizeof(NDOF_ButtonT);
GHOST_NDOFManager::GHOST_NDOFManager(GHOST_System& sys)
: m_system(sys)
, m_deviceType(NDOF_UnknownDevice) // each platform has its own device detection code
, m_buttonCount(0)
, m_buttonCount(genericButtonCount)
, m_buttonMask(0)
, m_hidMap(Generic_HID_map)
, m_buttons(0)
, m_motionTime(0)
, m_prevMotionTime(0)
@ -237,38 +210,53 @@ GHOST_NDOFManager::GHOST_NDOFManager(GHOST_System& sys)
bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short product_id)
{
// default to NDOF_UnknownDevice so rogue button events will get discarded
// call this function until it returns true
// it's a good idea to stop calling it after that, as it will "forget"
// whichever device it already found
// default to safe generic behavior for "unknown" devices
// unidentified devices will emit motion events like normal
// rogue buttons do nothing by default, but can be customized by the user
m_deviceType = NDOF_UnknownDevice;
m_hidMap = Generic_HID_map;
m_buttonCount = genericButtonCount;
m_buttonMask = 0;
// "mystery device" owners can help build a HID_map for their hardware
// A few users have already contributed information about several older devices
// that I don't have access to. Thanks!
switch (vendor_id) {
case 0x046D: // Logitech (3Dconnexion)
switch (product_id) {
// -- current devices --
case 0xC626:
case 0xC626: // full-size SpaceNavigator
case 0xC628: // the "for Notebooks" one
puts("ndof: using SpaceNavigator");
m_deviceType = NDOF_SpaceNavigator;
m_buttonCount = 2;
break;
case 0xC628:
puts("ndof: using SpaceNavigator for Notebooks");
m_deviceType = NDOF_SpaceNavigator; // for Notebooks
m_buttonCount = 2;
m_hidMap = Modern3Dx_HID_map;
break;
case 0xC627:
puts("ndof: using SpaceExplorer");
m_deviceType = NDOF_SpaceExplorer;
m_buttonCount = 15;
m_hidMap = SpaceExplorer_HID_map;
break;
case 0xC629:
puts("ndof: using SpacePilot Pro");
m_deviceType = NDOF_SpacePilotPro;
m_buttonCount = 31;
m_hidMap = Modern3Dx_HID_map;
break;
case 0xC62B:
puts("ndof: using SpaceMouse Pro");
m_deviceType = NDOF_SpaceMousePro;
m_buttonCount = 27;
// ^^ actually has 15 buttons, but their HID codes range from 0 to 26
m_buttonMask = 0x07C0F137;
m_hidMap = Modern3Dx_HID_map;
break;
// -- older devices --
@ -276,16 +264,16 @@ bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short produ
puts("ndof: using SpacePilot");
m_deviceType = NDOF_SpacePilot;
m_buttonCount = 21;
m_hidMap = SpacePilot_HID_map;
break;
case 0xC621:
puts("ndof: using Spaceball 5000");
m_deviceType = NDOF_Spaceball5000;
m_buttonCount = 12;
break;
case 0xC623:
puts("ndof: SpaceTraveler not supported, please file a bug report");
puts("ndof: using SpaceTraveler");
m_deviceType = NDOF_SpaceTraveler;
m_buttonCount = 8;
break;
@ -297,20 +285,14 @@ bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short produ
printf("ndof: unknown device %04hx:%04hx\n", vendor_id, product_id);
}
if (m_deviceType == NDOF_UnknownDevice) {
return false;
}
else {
if (m_buttonMask == 0)
m_buttonMask = ~(-1 << m_buttonCount);
// special case for SpaceMousePro? maybe...
#ifdef DEBUG_NDOF_BUTTONS
printf("ndof: %d buttons -> hex:%X\n", m_buttonCount, m_buttonMask);
printf("ndof: %d buttons -> hex:%X\n", m_buttonCount, m_buttonMask);
#endif
return true;
}
return m_deviceType != NDOF_UnknownDevice;
}
void GHOST_NDOFManager::updateTranslation(short t[3], GHOST_TUns64 time)
@ -329,15 +311,8 @@ void GHOST_NDOFManager::updateRotation(short r[3], GHOST_TUns64 time)
void GHOST_NDOFManager::sendButtonEvent(NDOF_ButtonT button, bool press, GHOST_TUns64 time, GHOST_IWindow* window)
{
if (button == NDOF_BUTTON_NONE) {
// just being exceptionally cautious...
// air-tight button masking and proper function key emulation
// should guarantee we never get to this point
#ifdef DEBUG_NDOF_BUTTONS
printf("discarding NDOF_BUTTON_NONE (should not escape the NDOF manager)\n");
#endif
return;
}
GHOST_ASSERT(button > NDOF_BUTTON_NONE && button < NDOF_BUTTON_LAST,
"rogue button trying to escape NDOF manager");
GHOST_EventNDOFButton* event = new GHOST_EventNDOFButton(time, window);
GHOST_TEventNDOFButtonData* data = (GHOST_TEventNDOFButtonData*) event->getData();
@ -369,66 +344,23 @@ void GHOST_NDOFManager::updateButton(int button_number, bool press, GHOST_TUns64
GHOST_IWindow* window = m_system.getWindowManager()->getActiveWindow();
#ifdef DEBUG_NDOF_BUTTONS
if (m_deviceType != NDOF_UnknownDevice)
printf("ndof: button %d -> ", button_number);
printf("ndof: button %d -> ", button_number);
#endif
switch (m_deviceType) {
case NDOF_SpaceNavigator:
sendButtonEvent(SpaceNavigator_HID_map[button_number], press, time, window);
NDOF_ButtonT button = (button_number < m_buttonCount) ? m_hidMap[button_number] : NDOF_BUTTON_NONE;
switch (button)
{
case NDOF_BUTTON_NONE:
#ifdef DEBUG_NDOF_BUTTONS
printf("discarded\n");
#endif
break;
case NDOF_SpaceExplorer:
switch (button_number) {
case 6: sendKeyEvent(GHOST_kKeyEsc, press, time, window); break;
case 7: sendKeyEvent(GHOST_kKeyLeftAlt, press, time, window); break;
case 8: sendKeyEvent(GHOST_kKeyLeftShift, press, time, window); break;
case 9: sendKeyEvent(GHOST_kKeyLeftControl, press, time, window); break;
default: sendButtonEvent(SpaceExplorer_HID_map[button_number], press, time, window);
}
break;
case NDOF_SpacePilotPro:
switch (button_number) {
case 22: sendKeyEvent(GHOST_kKeyEsc, press, time, window); break;
case 23: sendKeyEvent(GHOST_kKeyLeftAlt, press, time, window); break;
case 24: sendKeyEvent(GHOST_kKeyLeftShift, press, time, window); break;
case 25: sendKeyEvent(GHOST_kKeyLeftControl, press, time, window); break;
default: sendButtonEvent(SpacePilotPro_HID_map[button_number], press, time, window);
}
break;
case NDOF_SpaceMousePro:
switch (button_number) {
case 22: sendKeyEvent(GHOST_kKeyEsc, press, time, window); break;
case 23: sendKeyEvent(GHOST_kKeyLeftAlt, press, time, window); break;
case 24: sendKeyEvent(GHOST_kKeyLeftShift, press, time, window); break;
case 25: sendKeyEvent(GHOST_kKeyLeftControl, press, time, window); break;
default: sendButtonEvent(SpaceMousePro_HID_map[button_number], press, time, window);
}
break;
case NDOF_SpacePilot:
switch (button_number) {
case 10: sendKeyEvent(GHOST_kKeyEsc, press, time, window); break;
case 11: sendKeyEvent(GHOST_kKeyLeftAlt, press, time, window); break;
case 12: sendKeyEvent(GHOST_kKeyLeftShift, press, time, window); break;
case 13: sendKeyEvent(GHOST_kKeyLeftControl, press, time, window); break;
case 20: puts("ndof: ignoring CONFIG button"); break;
default: sendButtonEvent(SpacePilot_HID_map[button_number], press, time, window);
}
break;
case NDOF_Spaceball5000:
// has no special 'keyboard' buttons
sendButtonEvent(Spaceball5000_HID_map[button_number], press, time, window);
break;
case NDOF_UnknownDevice:
printf("ndof: button %d on unknown device (", button_number);
// map to the 'general purpose' buttons
// this is mainly for old serial devices
if (button_number < NDOF_BUTTON_LAST - NDOF_BUTTON_1) {
printf("sending)\n");
sendButtonEvent((NDOF_ButtonT)(NDOF_BUTTON_1 + button_number), press, time, window);
}
else {
printf("discarding)\n");
}
case NDOF_BUTTON_ESC: sendKeyEvent(GHOST_kKeyEsc, press, time, window); break;
case NDOF_BUTTON_ALT: sendKeyEvent(GHOST_kKeyLeftAlt, press, time, window); break;
case NDOF_BUTTON_SHIFT: sendKeyEvent(GHOST_kKeyLeftShift, press, time, window); break;
case NDOF_BUTTON_CTRL: sendKeyEvent(GHOST_kKeyLeftControl, press, time, window); break;
default: sendButtonEvent(button, press, time, window);
}
int mask = 1 << button_number;
@ -558,6 +490,9 @@ bool GHOST_NDOFManager::sendMotionEvent()
printf("ndof motion sent -- %s\n", progress_string[data->progress]);
// show details about this motion event
printf(" T=(%d,%d,%d) R=(%d,%d,%d) raw\n",
m_translation[0], m_translation[1], m_translation[2],
m_rotation[0], m_rotation[1], m_rotation[2]);
printf(" T=(%.2f,%.2f,%.2f) R=(%.2f,%.2f,%.2f) dt=%.3f\n",
data->tx, data->ty, data->tz,
data->rx, data->ry, data->rz,

@ -31,7 +31,7 @@
// #define DEBUG_NDOF_BUTTONS
typedef enum {
NDOF_UnknownDevice, // <-- motion will work fine, buttons are ignored
NDOF_UnknownDevice,
// current devices
NDOF_SpaceNavigator,
@ -41,7 +41,8 @@ typedef enum {
// older devices
NDOF_SpacePilot,
NDOF_Spaceball5000
NDOF_Spaceball5000,
NDOF_SpaceTraveler
} NDOF_DeviceT;
@ -76,6 +77,11 @@ typedef enum {
NDOF_BUTTON_DOMINANT,
NDOF_BUTTON_PLUS,
NDOF_BUTTON_MINUS,
// keyboard emulation
NDOF_BUTTON_ESC,
NDOF_BUTTON_ALT,
NDOF_BUTTON_SHIFT,
NDOF_BUTTON_CTRL,
// general-purpose buttons
// users can assign functions via keymap editor
NDOF_BUTTON_1,
@ -149,6 +155,7 @@ private:
NDOF_DeviceT m_deviceType;
int m_buttonCount;
int m_buttonMask;
const NDOF_ButtonT* m_hidMap;
short m_translation[3];
short m_rotation[3];

@ -47,7 +47,7 @@
#endif
#ifdef PREFIX
static const char *static_path= PREFIX "/share" ;
static const char *static_path= PREFIX "/share";
#else
static const char *static_path= NULL;
#endif

@ -716,7 +716,7 @@ GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, RAWINP
GHOST_EventKey* event;
if (key != GHOST_kKeyUnknown) {
char utf8_char[6] = {0} ;
char utf8_char[6] = {0};
char ascii = 0;
wchar_t utf16[2]={0};

@ -174,7 +174,7 @@ public:
GHOST_TSuccess
getModifierKeys(
GHOST_ModifierKeys& keys
) const ;
) const;
/**
* Returns the state of the mouse buttons (ouside the message queue).
@ -310,7 +310,7 @@ private :
GHOST_WindowX11 *
findGhostWindow(
Window xwind
) const ;
) const;
void
processEvent(

@ -67,7 +67,7 @@ GHOST_WindowSDL::GHOST_WindowSDL(GHOST_SystemSDL *system,
m_sdl_glcontext= SDL_GL_CreateContext(m_sdl_win);
//fprintf(stderr, "Ignoring Xlib error: error code %d request code %d\n",
// theEvent->error_code, theEvent->request_code) ;
// theEvent->error_code, theEvent->request_code);
setTitle(title);
}

@ -373,7 +373,7 @@ GHOST_WindowX11(
XFree(xsizehints);
XClassHint * xclasshint = XAllocClassHint();
int len = title.Length() +1 ;
const int len = title.Length() + 1;
char *wmclass = (char *)malloc(sizeof(char) * len);
strncpy(wmclass, (const char*)title, sizeof(char) * len);
xclasshint->res_name = wmclass;
@ -485,10 +485,10 @@ GHOST_WindowX11(
static int ApplicationErrorHandler(Display *display, XErrorEvent *theEvent)
{
fprintf(stderr, "Ignoring Xlib error: error code %d request code %d\n",
theEvent->error_code, theEvent->request_code) ;
theEvent->error_code, theEvent->request_code);
/* No exit! - but keep lint happy */
return 0 ;
return 0;
}
/* These C functions are copied from Wine 1.1.13's wintab.c */
@ -588,7 +588,7 @@ static BOOL is_eraser(const char *name, const char *type)
void GHOST_WindowX11::initXInputDevices()
{
static XErrorHandler old_handler = (XErrorHandler) 0 ;
static XErrorHandler old_handler = (XErrorHandler) 0;
XExtensionVersion *version = XGetExtensionVersion(m_display, INAME);
if(version && (version != (XExtensionVersion*)NoSuchExtension)) {
@ -600,7 +600,7 @@ void GHOST_WindowX11::initXInputDevices()
m_xtablet.CommonData.Active= GHOST_kTabletModeNone;
/* Install our error handler to override Xlib's termination behavior */
old_handler = XSetErrorHandler(ApplicationErrorHandler) ;
old_handler = XSetErrorHandler(ApplicationErrorHandler);
for(int i=0; i<device_count; ++i) {
char *device_type = device_info[i].type ? XGetAtomName(m_display, device_info[i].type) : NULL;
@ -648,7 +648,7 @@ void GHOST_WindowX11::initXInputDevices()
}
/* Restore handler */
(void) XSetErrorHandler(old_handler) ;
(void) XSetErrorHandler(old_handler);
XFreeDeviceList(device_info);

@ -146,7 +146,7 @@ public:
GHOST_TWindowState
getState(
) const ;
) const;
GHOST_TSuccess
setState(

@ -118,7 +118,7 @@ int main (int argc, char *argv[])
}
/* now corrupt a few blocks...*/
ip = (int*) p[5] - 50 ;
ip = (int*) p[5] - 50;
for (i = 0; i< 1000; i++,ip++) *ip = i+1;
ip = (int*) p[6];
*(ip+10005) = 0;

@ -335,7 +335,7 @@ path_reference_mode = EnumProperty(
('MATCH', "Match", "Match Absolute/Relative "
"setting with input path"),
('STRIP', "Strip Path", "Filename only"),
('COPY', "Copy", "copy the file to the destination path "
('COPY', "Copy", "Copy the file to the destination path "
"(or subdirectory)"),
),
default='AUTO'

@ -366,7 +366,7 @@ class Mesh(bpy_types.ID):
:type edges: iterable object
:arg faces:
iterator of faces, each faces contains three or four indices to
iterator of faces, each faces contains three or more indices to
the *vertices* argument. eg: [(5, 6, 8, 9), (1, 2, 3), ...]
:type faces: iterable object
@ -394,6 +394,10 @@ class Mesh(bpy_types.ID):
p.vertices = f
loop_index += loop_len
# if no edges - calculae them
if faces and (not edges):
self.update(calc_edges=True)
@property
def edge_keys(self):
return [ed.key for ed in self.edges]

@ -333,7 +333,7 @@ kmi = km.keymap_items.new('mesh.fill', 'F', 'PRESS', alt=True)
kmi = km.keymap_items.new('mesh.beautify_fill', 'F', 'PRESS', shift=True, alt=True)
kmi = km.keymap_items.new('mesh.quads_convert_to_tris', 'T', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('mesh.tris_convert_to_quads', 'J', 'PRESS', alt=True)
kmi = km.keymap_items.new('mesh.edge_flip', 'F', 'PRESS', shift=True, ctrl=True)
# kmi = km.keymap_items.new('mesh.edge_flip', 'F', 'PRESS', shift=True, ctrl=True) # removed since bmesh, can be made into something else?
kmi = km.keymap_items.new('mesh.rip_move', 'V', 'PRESS')
kmi = km.keymap_items.new('mesh.merge', 'M', 'PRESS', alt=True)
kmi = km.keymap_items.new('transform.shrink_fatten', 'S', 'PRESS', ctrl=True, alt=True)

@ -1114,7 +1114,7 @@ class SmartProject(Operator):
angle_limit = FloatProperty(
name="Angle Limit",
description="lower for more projection groups, higher for less distortion",
description="Lower for more projection groups, higher for less distortion",
min=1.0, max=89.0,
default=66.0,
)

@ -146,12 +146,12 @@ class BRUSH_OT_active_index_set(Operator):
bl_label = "Set Brush Number"
mode = StringProperty(
name="mode",
name="Mode",
description="Paint mode to set brush for",
maxlen=1024,
)
index = IntProperty(
name="number",
name="Number",
description="Brush number",
)
@ -707,9 +707,14 @@ class WM_OT_context_modal_mouse(Operator):
if event_type == 'MOUSEMOVE':
delta = event.mouse_x - self.initial_x
self._values_delta(delta)
if self.header_text:
for item, value_orig in self._values.items():
context.area.header_text_set(self.header_text % eval("item.%s" % self.data_path_item))
header_text = self.header_text
if header_text:
if len(self._values) == 1:
(item, ) = self._values.keys()
header_text = header_text % eval("item.%s" % self.data_path_item)
else:
header_text = (self.header_text % delta) + " (delta)"
context.area.header_text_set(header_text)
elif 'LEFTMOUSE' == event_type:
item = next(iter(self._values.keys()))

@ -88,11 +88,7 @@ class DATA_PT_lens(CameraButtonsPanel, Panel):
col.prop(cam, "ortho_scale")
col = layout.column()
if cam.type == 'ORTHO':
if cam.use_panorama:
col.alert = True
else:
col.enabled = False
col.enabled = cam.type == 'PERSPECTIVE'
col.prop(cam, "use_panorama")

@ -113,6 +113,14 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel):
sub.prop(curve, "fill_mode", text="")
col.prop(curve, "use_fill_deform")
if is_curve:
col.label(text="Path / Curve-Deform:")
sub = col.column()
rowsub = sub.row()
rowsub.prop(curve, "use_radius")
rowsub.prop(curve, "use_stretch")
sub.prop(curve, "use_deform_bounds")
class DATA_PT_curve_texture_space(CurveButtonsPanel, Panel):
bl_label = "Texture Space"
@ -189,16 +197,11 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
layout.prop(curve, "path_duration", text="Frames")
layout.prop(curve, "eval_time")
split = layout.split()
col = split.column()
col.prop(curve, "use_path_follow")
col.prop(curve, "use_stretch")
col.prop(curve, "use_deform_bounds")
col = split.column()
col.prop(curve, "use_radius")
col.prop(curve, "use_time_offset", text="Offset Children")
# these are for paths only
row = layout.row()
row.prop(curve, "use_path_follow")
row.prop(curve, "use_time_offset", text="Offset Children")
class DATA_PT_active_spline(CurveButtonsPanelActive, Panel):

@ -264,6 +264,9 @@ class SEQUENCER_MT_strip(Menu):
layout.separator()
# layout.operator("sequencer.movie_change")
layout.operator("sequencer.rendersize")
elif stype == 'SOUND':
layout.separator()
layout.operator("sequencer.crossfade_sounds")
layout.separator()

@ -88,7 +88,7 @@ class VIEW3D_HT_header(Header):
row = layout.row(align=True)
row.prop(toolsettings, "use_snap", text="")
row.prop(toolsettings, "snap_element", text="", icon_only=True)
if snap_element not in ('INCREMENT', 'VOLUME'):
if snap_element not in {'INCREMENT', 'VOLUME'}:
row.prop(toolsettings, "snap_target", text="")
if obj:
if obj.mode == 'OBJECT':
@ -1730,7 +1730,6 @@ class VIEW3D_MT_edit_mesh_faces(Menu):
layout.operator("mesh.quads_convert_to_tris")
layout.operator("mesh.tris_convert_to_quads")
layout.operator("mesh.edge_flip")
layout.separator()

@ -1133,13 +1133,15 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel):
row = split.row()
row.active = (ipaint.use_stencil_layer)
row.menu("VIEW3D_MT_tools_projectpaint_stencil", text=mesh.uv_texture_stencil.name)
stencil_text = mesh.uv_texture_stencil.name if mesh.uv_texture_stencil else ""
row.menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text)
row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
row = layout.row()
row.active = (settings.brush.image_tool == 'CLONE')
row.prop(ipaint, "use_clone_layer", text="Layer")
row.menu("VIEW3D_MT_tools_projectpaint_clone", text=mesh.uv_texture_clone.name)
row.prop(ipaint, "use_clone_layer", text="Clone")
clone_text = mesh.uv_texture_clone.name if mesh.uv_texture_clone else ""
row.menu("VIEW3D_MT_tools_projectpaint_clone", text=clone_text)
layout.prop(ipaint, "seam_bleed")

@ -249,7 +249,7 @@ AviError AVI_open_compress (char *name, AviMovie *movie, int streams, ...);
AviError AVI_close_compress (AviMovie *movie);
/**
* Choose a compression option for <movie>. Possible options are
* Choose a compression option for \<movie\>. Possible options are
* AVI_OPTION_TYPE_MAIN, AVI_OPTION_TYPE_STRH, AVI_OPTION_TYPE_STRF
*/
AviError AVI_set_compress_option (AviMovie *movie,
@ -272,7 +272,7 @@ AviError AVI_set_compress_option (AviMovie *movie,
#define AVI_OPTION_TYPE_STRF 2
/**
* Direct the streams <avist_type> to <movie>. Redirect <stream_num>
* Direct the streams \<avist_type\> to \<movie\>. Redirect \<stream_num\>
* streams.
*/
int AVI_get_stream (AviMovie *movie, int avist_type, int stream_num);

@ -836,8 +836,10 @@ AviError AVI_open_compress (char *name, AviMovie *movie, int streams, ...)
tmp->f = 2;
tmp->g = 1;
}
} else if (movie->streams[i].sh.Type == FCC("auds")) {
;
}
else if (movie->streams[i].sh.Type == FCC("auds")) {
// pass
}
*/
}
}

@ -57,8 +57,6 @@ void BLF_lang_init(void);
void BLF_lang_set(const char *);
/* Set the current encoding name. */
void BLF_lang_encoding_name(const char *str);
void BLF_lang_encoding(const char *str);
/* translation */

@ -271,10 +271,6 @@ struct DerivedMesh {
*/
struct ListBase *(*getPolyMap)(struct Object *ob, DerivedMesh *dm);
/* Get a map of vertices to faces
*/
struct ListBase *(*getFaceMap)(struct Object *ob, DerivedMesh *dm);
/* Get the BVH used for paint modes
*/
struct PBVH *(*getPBVH)(struct Object *ob, DerivedMesh *dm);
@ -617,7 +613,6 @@ DerivedMesh *mesh_create_derived_no_virtual(struct Scene *scene, struct Object *
DerivedMesh *mesh_create_derived_physics(struct Scene *scene, struct Object *ob, float (*vertCos)[3],
CustomDataMask dataMask);
DerivedMesh *editbmesh_get_derived(struct BMEditMesh *em, float (*vertexCos)[3]);
DerivedMesh *editbmesh_get_derived_base(struct Object *, struct BMEditMesh *em);
DerivedMesh *editbmesh_get_derived_cage(struct Scene *scene, struct Object *,
struct BMEditMesh *em, CustomDataMask dataMask);
@ -634,11 +629,6 @@ void makeDerivedMesh(struct Scene *scene, struct Object *ob, struct BMEditMesh *
int editbmesh_get_first_deform_matrices(struct Scene *, struct Object *, struct BMEditMesh *em,
float (**deformmats)[3][3], float (**deformcos)[3]);
/* returns an array of deform matrices for crazyspace correction when sculpting,
and the number of modifiers left */
int sculpt_get_deform_matrices(struct Scene *scene, struct Object *ob,
float (**deformmats)[3][3], float (**deformcos)[3]);
void weight_to_rgb(float r_rgb[3], const float weight);
/* Update the weight MCOL preview layer.
* If weights are NULL, use object's active vgroup(s).

@ -97,16 +97,16 @@ void where_is_pose_bone_tail(struct bPoseChannel *pchan);
/* get_objectspace_bone_matrix has to be removed still */
void get_objectspace_bone_matrix (struct Bone* bone, float M_accumulatedMatrix[][4], int root, int posed);
void vec_roll_to_mat3(float *vec, float roll, float mat[][3]);
void vec_roll_to_mat3(const float vec[3], const float roll, float mat[][3]);
void mat3_to_vec_roll(float mat[][3], float *vec, float *roll);
int get_selected_defgroups(struct Object *ob, char *defbase_sel, int defbase_len);
/* Common Conversions Between Co-ordinate Spaces */
void armature_mat_world_to_pose(struct Object *ob, float inmat[][4], float outmat[][4]);
void armature_loc_world_to_pose(struct Object *ob, float *inloc, float *outloc);
void armature_loc_world_to_pose(struct Object *ob, const float inloc[3], float outloc[3]);
void armature_mat_pose_to_bone(struct bPoseChannel *pchan, float inmat[][4], float outmat[][4]);
void armature_loc_pose_to_bone(struct bPoseChannel *pchan, float *inloc, float *outloc);
void armature_loc_pose_to_bone(struct bPoseChannel *pchan, const float inloc[3], float outloc[3]);
void armature_mat_bone_to_pose(struct bPoseChannel *pchan, float inmat[][4], float outmat[][4]);
void armature_mat_pose_to_delta(float delta_mat[][4], float pose_mat[][4], float arm_mat[][4]);

@ -90,7 +90,6 @@ extern void BKE_reset_undo(void);
extern char *BKE_undo_menu_string(void);
extern void BKE_undo_number(struct bContext *C, int nr);
extern const char *BKE_undo_get_name(int nr, int *active);
void BKE_undo_save(char *fname);
extern void BKE_undo_save_quit(void);
extern struct Main *BKE_undo_get_main(struct Scene **scene);

@ -35,159 +35,8 @@
*
*/
#include "DNA_listBase.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "BLI_mempool.h"
#include "BLI_memarena.h"
#include "DNA_image_types.h"
#include "BKE_DerivedMesh.h"
//XXX #include "transform.h"
#include "bmesh.h"
/*forward declerations*/
struct BME_Vert;
struct BME_Edge;
struct BME_Poly;
struct BME_Loop;
/*NOTE: this is the bmesh 1.0 code. it's completely outdated.*/
/*Notes on further structure Cleanup:
-Remove the tflags, they belong in custom data layers
-Remove the eflags completely, they are mostly not used
-Remove the selection/vis/bevel weight flag/values ect and move them to custom data
-Remove EID member and move to custom data
-Add a radial cycle length, disk cycle length and loop cycle length attributes to custom data and have eulers maintain/use them if present.
-Move data such as vertex coordinates/normals to custom data and leave pointers in structures to active layer data.
-Remove BME_CycleNode structure?
*/
typedef struct BME_CycleNode{
struct BME_CycleNode *next, *prev;
void *data;
} BME_CycleNode;
typedef struct BME_Mesh
{
ListBase verts, edges, polys;
/*memory pools used for storing mesh elements*/
struct BLI_mempool *vpool;
struct BLI_mempool *epool;
struct BLI_mempool *ppool;
struct BLI_mempool *lpool;
/*some scratch arrays used by eulers*/
struct BME_Vert **vtar;
struct BME_Edge **edar;
struct BME_Loop **lpar;
struct BME_Poly **plar;
int vtarlen, edarlen, lparlen, plarlen;
int totvert, totedge, totpoly, totloop; /*record keeping*/
int nextv, nexte, nextp, nextl; /*Next element ID for verts/edges/faces/loops. Never reused*/
struct CustomData vdata, edata, pdata, ldata; /*Custom Data Layer information*/
} BME_Mesh;
typedef struct BME_Vert
{
struct BME_Vert *next, *prev;
int EID;
float co[3];
float no[3];
struct BME_Edge *edge; /*first edge in the disk cycle for this vertex*/
void *data; /*custom vertex data*/
int eflag1, eflag2; /*reserved for use by eulers*/
int tflag1, tflag2; /*reserved for use by tools*/
unsigned short flag, h;
float bweight;
} BME_Vert;
typedef struct BME_Edge
{
struct BME_Edge *next, *prev;
int EID;
struct BME_Vert *v1, *v2; /*note that order of vertex pointers means nothing to eulers*/
struct BME_CycleNode d1, d2; /*disk cycle nodes for v1 and v2 respectivley*/
struct BME_Loop *loop; /*first BME_Loop in the radial cycle around this edge*/
void *data; /*custom edge data*/
int eflag1, eflag2; /*reserved for use by eulers*/
int tflag1, tflag2; /*reserved for use by tools*/
unsigned short flag, h;
float crease, bweight;
} BME_Edge;
typedef struct BME_Loop
{
struct BME_Loop *next, *prev; /*circularly linked list around face*/
int EID;
struct BME_CycleNode radial; /*circularly linked list used to find faces around an edge*/
struct BME_Vert *v; /*vertex that this loop starts at.*/
struct BME_Edge *e; /*edge this loop belongs to*/
struct BME_Poly *f; /*face this loop belongs to*/
void *data; /*custom per face vertex data*/
int eflag1, eflag2; /*reserved for use by eulers*/
int tflag1, tflag2; /*reserved for use by tools*/
unsigned short flag, h;
} BME_Loop;
typedef struct BME_Poly
{
struct BME_Poly *next, *prev;
int EID;
struct BME_Loop *loopbase; /*First editloop around Polygon.*/
unsigned int len; /*total length of the face. Eulers should preserve this data*/
void *data; /*custom face data*/
int eflag1, eflag2; /*reserved for use by eulers*/
int tflag1, tflag2; /*reserved for use by tools*/
unsigned short flag, h, mat_nr;
} BME_Poly;
/*EDGE UTILITIES*/
int BME_verts_in_edge(struct BME_Vert *v1, struct BME_Vert *v2, struct BME_Edge *e);
int BME_vert_in_edge(struct BME_Edge *e, BME_Vert *v);
struct BME_Vert *BME_edge_getothervert(struct BME_Edge *e, struct BME_Vert *v);
/*GENERAL CYCLE*/
int BME_cycle_length(void *h);
/*DISK CYCLE*/
struct BME_Edge *BME_disk_nextedge(struct BME_Edge *e, struct BME_Vert *v);
struct BME_CycleNode *BME_disk_getpointer(struct BME_Edge *e, struct BME_Vert *v);
struct BME_Edge *BME_disk_next_edgeflag(struct BME_Edge *e, struct BME_Vert *v, int eflag, int tflag);
int BME_disk_count_edgeflag(struct BME_Vert *v, int eflag, int tflag);
/*RADIAL CYCLE*/
struct BME_Loop *BME_radial_nextloop(struct BME_Loop *l);
int BME_radial_find_face(struct BME_Edge *e,struct BME_Poly *f);
/*LOOP CYCLE*/
struct BME_Loop *BME_loop_find_loop(struct BME_Poly *f, struct BME_Vert *v);
/*MESH CREATION/DESTRUCTION*/
struct BME_Mesh *BME_make_mesh(int allocsize[4]);
void BME_free_mesh(struct BME_Mesh *bm);
/*FULL MESH VALIDATION*/
int BME_validate_mesh(struct BME_Mesh *bm, int halt);
/*ENTER/EXIT MODELLING LOOP*/
int BME_model_begin(struct BME_Mesh *bm);
void BME_model_end(struct BME_Mesh *bm);
/*MESH CONSTRUCTION API.*/
/*MAKE*/
struct BME_Vert *BME_MV(struct BME_Mesh *bm, float *vec);
struct BME_Edge *BME_ME(struct BME_Mesh *bm, struct BME_Vert *v1, struct BME_Vert *v2);
struct BME_Poly *BME_MF(struct BME_Mesh *bm, struct BME_Vert *v1, struct BME_Vert *v2, struct BME_Edge **elist, int len);
/*KILL*/
int BME_KV(struct BME_Mesh *bm, struct BME_Vert *v);
int BME_KE(struct BME_Mesh *bm, struct BME_Edge *e);
int BME_KF(struct BME_Mesh *bm, struct BME_Poly *bply);
/*SPLIT*/
struct BME_Vert *BME_SEMV(struct BME_Mesh *bm, struct BME_Vert *tv, struct BME_Edge *e, struct BME_Edge **re);
struct BME_Poly *BME_SFME(struct BME_Mesh *bm, struct BME_Poly *f, struct BME_Vert *v1, struct BME_Vert *v2, struct BME_Loop **rl);
/*JOIN*/
int BME_JEKV(struct BME_Mesh *bm, struct BME_Edge *ke, struct BME_Vert *kv);
struct BME_Poly *BME_JFKE(struct BME_Mesh *bm, struct BME_Poly *f1, struct BME_Poly *f2,struct BME_Edge *e); /*no reason to return BME_Poly pointer?*/
/*NORMAL FLIP(Is its own inverse)*/
int BME_loop_reverse(struct BME_Mesh *bm, struct BME_Poly *f);
/* bevel tool defines */
/* element flags */
#define BME_BEVEL_ORIG 1
@ -214,8 +63,8 @@ int BME_loop_reverse(struct BME_Mesh *bm, struct BME_Poly *f);
#define BME_BEVEL_DIST (1<<12) /* same as above */
typedef struct BME_TransData {
BMesh *bm; /* the bmesh the vert belongs to */
BMVert *v; /* pointer to the vert this tdata applies to */
struct BMesh *bm; /* the bmesh the vert belongs to */
struct BMVert *v; /* pointer to the vert this tdata applies to */
float co[3]; /* the original coordinate */
float org[3]; /* the origin */
float vec[3]; /* a directional vector; always, always normalize! */
@ -230,13 +79,13 @@ typedef struct BME_TransData {
} BME_TransData;
typedef struct BME_TransData_Head {
GHash *gh; /* the hash structure for element lookup */
MemArena *ma; /* the memory "pool" we will be drawing individual elements from */
struct GHash *gh; /* the hash structure for element lookup */
struct MemArena *ma; /* the memory "pool" we will be drawing individual elements from */
int len;
} BME_TransData_Head;
typedef struct BME_Glob { /* stored in Global G for Transform() purposes */
BMesh *bm;
struct BMesh *bm;
BME_TransData_Head *td;
struct TransInfo *Trans; /* a pointer to the global Trans struct */
int imval[2]; /* for restoring original mouse co when initTransform() is called multiple times */
@ -246,7 +95,6 @@ typedef struct BME_Glob { /* stored in Global G for Transform() purposes */
struct BME_TransData *BME_get_transdata(struct BME_TransData_Head *td, struct BMVert *v);
void BME_free_transdata(struct BME_TransData_Head *td);
float *BME_bevel_calc_polynormal(struct BME_Poly *f, struct BME_TransData_Head *td);
struct BMesh *BME_bevel(struct BMEditMesh *em, float value, int res, int options, int defgrp_index, float angle, BME_TransData_Head **rtd);
#endif

@ -1,105 +0,0 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2004 Blender Foundation.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): Geoffrey Bantle.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __BKE_BMESHCUSTOMDATA_H__
#define __BKE_BMESHCUSTOMDATA_H__
/** \file BKE_bmeshCustomData.h
* \ingroup bke
* \since January 2007
* \brief BMesh modeler structure and functions - custom data.
*/
struct BLI_mempool;
/*Custom Data Types and defines
Eventual plan is to move almost everything to custom data and let caller
decide when making the mesh what layers they want to store in the mesh
This stuff should probably go in a seperate file....
*/
#define BME_CD_FACETEX 0 /*Image texture/texface*/
#define BME_CD_LOOPTEX 1 /*UV coordinates*/
#define BME_CD_LOOPCOL 2 /*Vcolors*/
#define BME_CD_DEFORMVERT 3 /*Vertex Group/Weights*/
#define BME_CD_NUMTYPES 4
typedef struct BME_CustomDataLayer {
int type; /* type of data in layer */
int offset; /* offset of layer in block */
int active; /* offset of active layer*/
char name[32]; /* layer name */
} BME_CustomDataLayer;
typedef struct BME_CustomData {
struct BME_CustomDataLayer *layers; /*Custom Data Layers*/
struct BLI_mempool *pool; /*pool for alloc of blocks*/
int totlayer, totsize; /*total layers and total size in bytes of each block*/
} BME_CustomData;
typedef struct BME_CustomDataInit{
int layout[BME_CD_NUMTYPES];
int active[BME_CD_NUMTYPES];
int totlayers;
char *nametemplate;
} BME_CustomDataInit;
/*Custom data types*/
typedef struct BME_DeformWeight {
int def_nr;
float weight;
} BME_DeformWeight;
typedef struct BME_DeformVert {
struct BME_DeformWeight *dw;
int totweight;
} BME_DeformVert;
typedef struct BME_facetex{
struct Image *tpage;
char flag, transp;
short mode, tile, unwrap;
}BME_facetex;
typedef struct BME_looptex{
float u, v;
}BME_looptex;
typedef struct BME_loopcol{
char r, g, b, a;
}BME_loopcol;
/*CUSTOM DATA API*/
void BME_CD_Create(struct BME_CustomData *data, struct BME_CustomDataInit *init, int initalloc);
void BME_CD_Free(struct BME_CustomData *data);
void BME_CD_free_block(struct BME_CustomData *data, void **block);
void BME_CD_copy_data(const struct BME_CustomData *source, struct BME_CustomData *dest, void *src_block, void **dest_block);
void BME_CD_set_default(struct BME_CustomData *data, void **block);
#endif

@ -52,7 +52,6 @@ void brush_reset_sculpt(struct Brush *brush);
struct ImBuf *get_brush_icon(struct Brush *brush);
/* brush library operations used by different paint panels */
int brush_delete(struct Brush **current_brush);
int brush_texture_set_nr(struct Brush *brush, int nr);
int brush_texture_delete(struct Brush *brush);
int brush_clone_image_set_nr(struct Brush *brush, int nr);
@ -60,7 +59,7 @@ int brush_clone_image_delete(struct Brush *brush);
/* jitter */
void brush_jitter_pos(const struct Scene *scene, struct Brush *brush,
float *pos, float *jitterpos);
const float pos[2], float jitterpos[2]);
/* brush curve */
void brush_curve_preset(struct Brush *b, /*enum CurveMappingPreset*/int preset);
@ -75,13 +74,13 @@ void brush_imbuf_new(const struct Scene *scene, struct Brush *brush, short flt,
/* painting */
struct BrushPainter;
typedef struct BrushPainter BrushPainter;
typedef int (*BrushFunc)(void *user, struct ImBuf *ibuf, float *lastpos, float *pos);
typedef int (*BrushFunc)(void *user, struct ImBuf *ibuf, const float lastpos[2], const float pos[2]);
BrushPainter *brush_painter_new(struct Scene *scene, struct Brush *brush);
void brush_painter_require_imbuf(BrushPainter *painter, short flt,
short texonly, int size);
int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos,
double time, float pressure, void *user, int use_color_correction);
short texonly, int size);
int brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2],
double time, float pressure, void *user, int use_color_correction);
void brush_painter_break_stroke(BrushPainter *painter);
void brush_painter_free(BrushPainter *painter);

@ -203,11 +203,6 @@ int implicit_free ( struct ClothModifierData *clmd );
int implicit_solver ( struct Object *ob, float frame, struct ClothModifierData *clmd, struct ListBase *effectors );
void implicit_set_positions ( struct ClothModifierData *clmd );
// globally needed
void clmdSetInterruptCallBack ( int ( *f ) ( void ) );
////////////////////////////////////////////////
/////////////////////////////////////////////////
// cloth.c
////////////////////////////////////////////////
@ -218,7 +213,6 @@ void cloth_free_modifier ( struct ClothModifierData *clmd );
void cloth_init ( struct ClothModifierData *clmd );
void clothModifier_do ( struct ClothModifierData *clmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm, float (*vertexCos)[3]);
void cloth_update_normals ( ClothVertex *verts, int nVerts, struct MFace *face, int totface );
int cloth_uses_vgroup(struct ClothModifierData *clmd);
// needed for collision.c

@ -135,16 +135,10 @@ void bvhtree_update_from_mvert ( BVHTree * bvhtree, struct MFace *faces, int num
/////////////////////////////////////////////////
struct LinkNode *BLI_linklist_append_fast ( struct LinkNode **listp, void *ptr );
// move Collision modifier object inter-frame with step = [0,1]
// defined in collisions.c
void collision_move_object ( struct CollisionModifierData *collmd, float step, float prevstep );
// interface for collision functions
void collisions_compute_barycentric ( float pv[3], float p1[3], float p2[3], float p3[3], float *w1, float *w2, float *w3 );
void interpolateOnTriangle ( float to[3], float v1[3], float v2[3], float v3[3], double w1, double w2, double w3 );
/////////////////////////////////////////////////
// used in effect.c
/////////////////////////////////////////////////

@ -291,11 +291,7 @@ void CustomData_bmesh_set_default(struct CustomData *data, void **block);
void CustomData_bmesh_free_block(struct CustomData *data, void **block);
/* copy custom data to/from layers as in mesh/derivedmesh, to editmesh
blocks of data. the CustomData's must not be compatible */
void CustomData_to_em_block(const struct CustomData *source,
struct CustomData *dest, int index, void **block);
void CustomData_from_em_block(const struct CustomData *source,
struct CustomData *dest, void *block, int index);
* blocks of data. the CustomData's must not be compatible */
void CustomData_to_bmesh_block(const struct CustomData *source,
struct CustomData *dest, int src_index, void **dest_block);
void CustomData_from_bmesh_block(const struct CustomData *source,

@ -97,9 +97,6 @@ short are_obs_related(struct DagForest *dag, void *ob1, void *ob2);
int is_acyclic(struct DagForest *dag); //
//int get_cycles(struct DagForest *dag, struct DagNodeQueue **queues, int *count); //
void boundbox_deps(void);
void draw_all_deps(void);
/* ********** API *************** */
/* Note that the DAG never executes changes in Objects, only sets flags in Objects */

@ -109,10 +109,6 @@ typedef struct EffectorCache {
int flag;
} EffectorCache;
struct Effect *copy_effect(struct Effect *eff);
void copy_effects(struct ListBase *lbn, struct ListBase *lb);
void deselectall_eff(struct Object *ob);
void free_partdeflect(struct PartDeflect *pd);
struct ListBase *pdInitEffectors(struct Scene *scene, struct Object *ob_src, struct ParticleSystem *psys_src, struct EffectorWeights *weights);
void pdEndEffectors(struct ListBase **effectors);

@ -82,7 +82,7 @@ void BKE_previewimg_free(struct PreviewImage **prv);
void BKE_previewimg_free_id(struct ID *id);
/* create a new preview image */
struct PreviewImage* BKE_previewimg_create(void) ;
struct PreviewImage* BKE_previewimg_create(void);
/* create a copy of the preview image */
struct PreviewImage* BKE_previewimg_copy(struct PreviewImage *prv);

@ -77,7 +77,7 @@ int BKE_idcode_is_valid(int code);
/**
* Return an ID code and steps the index forward 1.
*
* @param index, start as 0.
* @param index start as 0.
* @return the code, 0 when all codes have been returned.
*/
int BKE_idcode_iter_step(int *index);

@ -75,7 +75,6 @@ void IDP_ResizeIDPArray(struct IDProperty *prop, int len);
/*this function works for strings too!*/
void IDP_ResizeArray(struct IDProperty *prop, int newlen);
void IDP_FreeArray(struct IDProperty *prop);
void IDP_UnlinkArray(struct IDProperty *prop);
/* ---------- String Type ------------ */
IDProperty *IDP_NewString(const char *st, const char *name, int maxlen);/* maxlen excludes '\0' */

@ -149,9 +149,6 @@ void BKE_image_assign_ibuf(struct Image *ima, struct ImBuf *ibuf);
void BKE_image_user_calc_frame(struct ImageUser *iuser, int cfra, int fieldnr);
int BKE_image_user_get_frame(const struct ImageUser *iuser, int cfra, int fieldnr);
/* fix things in ImageUser when new image gets assigned */
void BKE_image_user_new_image(struct Image *ima, struct ImageUser *iuser);
/* sets index offset for multilayer files */
struct RenderPass *BKE_image_multilayer_index(struct RenderResult *rr, struct ImageUser *iuser);

@ -83,9 +83,10 @@ void BKE_library_make_local(struct Main *bmain, struct Library *lib, int untagge
struct ID *find_id(const char *type, const char *name);
void clear_id_newpoins(void);
void IDnames_to_pupstring(const char **str, const char *title, const char *extraops, struct ListBase *lb,struct ID* link, short *nr);
void IMAnames_to_pupstring(const char **str, const char *title, const char *extraops, struct ListBase *lb, struct ID *link, short *nr);
void IPOnames_to_pupstring(const char **str, const char *title, const char *extraops, struct ListBase *lb, struct ID* link, short *nr, int blocktype);
void IDnames_to_pupstring(const char **str, const char *title, const char *extraops,
struct ListBase *lb,struct ID* link, short *nr);
void IMAnames_to_pupstring(const char **str, const char *title, const char *extraops,
struct ListBase *lb, struct ID *link, short *nr);
void flag_listbase_ids(ListBase *lb, short flag, short value);
void flag_all_listbases_ids(short flag, short value);

@ -50,7 +50,6 @@ void free_material(struct Material *sc);
void test_object_materials(struct ID *id);
void resize_object_material(struct Object *ob, const short totcol);
void init_material(struct Material *ma);
struct Material *add_material_main(struct Main *main, const char *name);
struct Material *add_material(const char *name);
struct Material *copy_material(struct Material *ma);
struct Material *localize_material(struct Material *ma);
@ -99,10 +98,6 @@ void free_matcopybuf(void);
void copy_matcopybuf(struct Material *ma);
void paste_matcopybuf(struct Material *ma);
void clear_mat_mtex_copybuf(void);
void copy_mat_mtex_copybuf(struct ID *id);
void paste_mat_mtex_copybuf(struct ID *id);
/* handle backward compatibility for tface/materials called from doversion (fileload=1) or Help Menu (fileload=0) */
int do_version_tface(struct Main *main, int fileload);

@ -166,7 +166,7 @@ struct Object *find_basis_mball(struct Scene *scene, struct Object *ob);
int is_basis_mball(struct Object *ob);
int is_mball_basis_for(struct Object *ob1, struct Object *ob2);
void metaball_polygonize(struct Scene *scene, struct Object *ob, struct ListBase *dispbase);
void calc_mballco(struct MetaElem *ml, float *vec);
void calc_mballco(struct MetaElem *ml, float vec[3]);
float densfunc(struct MetaElem *ball, float x, float y, float z);
float metaball(float x, float y, float z);
void accum_mballfaces(int i1, int i2, int i3, int i4);
@ -174,5 +174,10 @@ void *new_pgn_element(int size);
int nextcwedge (int edge, int face);
void BKE_freecubetable(void);
int BKE_metaball_minmax(struct MetaBall *mb, float min[3], float max[3]);
int BKE_metaball_center_median(struct MetaBall *mb, float cent[3]);
int BKE_metaball_center_bounds(struct MetaBall *mb, float cent[3]);
void BKE_metaball_translate(struct MetaBall *mb, float offset[3]);
#endif

@ -99,6 +99,18 @@ void mesh_calc_poly_center(struct MPoly *mpoly, struct MLoop *loopstart,
float mesh_calc_poly_area(struct MPoly *mpoly, struct MLoop *loopstart,
struct MVert *mvarray, float polynormal[3]);
/* Find the index of the loop in 'poly' which references vertex,
returns -1 if not found */
int poly_find_loop_from_vert(const struct MPoly *poly,
const struct MLoop *loopstart,
unsigned vert);
/* Fill 'adj_r' with the loop indices in 'poly' adjacent to the
vertex. Returns the index of the loop matching vertex, or -1 if the
vertex is not in 'poly' */
int poly_get_adj_loops_from_vert(unsigned adj_r[3], const struct MPoly *poly,
const struct MLoop *mloop, unsigned vert);
void unlink_mesh(struct Mesh *me);
void free_mesh(struct Mesh *me, int unlink);
struct Mesh *add_mesh(const char *name);
@ -136,7 +148,7 @@ void mesh_calc_normals_tessface(struct MVert *mverts, int numVerts,struct MFace
const char *mesh_cmp(struct Mesh *me1, struct Mesh *me2, float thresh);
struct BoundBox *mesh_get_bb(struct Object *ob);
void mesh_get_texspace(struct Mesh *me, float *loc_r, float *rot_r, float *size_r);
void mesh_get_texspace(struct Mesh *me, float r_loc[3], float r_rot[3], float r_size[3]);
/* if old, it converts mface->edcode to edge drawflags */
void make_edges(struct Mesh *me, int old);
@ -238,16 +250,9 @@ typedef struct IndexNode {
void create_vert_poly_map(struct ListBase **map, IndexNode **mem,
struct MPoly *mface, struct MLoop *mloop,
const int totvert, const int totface, const int totloop);
void create_vert_face_map(struct ListBase **map, IndexNode **mem, const struct MFace *mface,
const int totvert, const int totface);
void create_vert_edge_map(struct ListBase **map, IndexNode **mem, const struct MEdge *medge,
const int totvert, const int totedge);
/* functions for making menu's from customdata layers */
int mesh_layers_menu_charlen(struct CustomData *data, int type); /* use this to work out how many chars to allocate */
void mesh_layers_menu_concat(struct CustomData *data, int type, char *str);
int mesh_layers_menu(struct CustomData *data, int type);
/* vertex level transformations & checks (no derived mesh) */
int minmax_mesh(struct Mesh *me, float min[3], float max[3]);

@ -55,8 +55,6 @@ void BKE_movieclip_aspect(struct MovieClip *clip, float *aspx, float *aspy);
int BKE_movieclip_has_frame(struct MovieClip *clip, struct MovieClipUser *user);
void BKE_movieclip_user_set_frame(struct MovieClipUser *user, int framenr);
void BKE_movieclip_select_track(struct MovieClip *clip, struct MovieTrackingTrack *track, int area, int extend);
void BKE_movieclip_update_scopes(struct MovieClip *clip, struct MovieClipUser *user, struct MovieClipScopes *scopes);
void BKE_movieclip_get_cache_segments(struct MovieClip *clip, struct MovieClipUser *user, int *totseg_r, int **points_r);

@ -165,7 +165,7 @@ typedef struct bNodeType {
/// Create a template from an existing node.
struct bNodeTemplate (*templatefunc)(struct bNode *);
/** If a node can be made from the template in the given node tree.
* \example Node groups can not be created inside their own node tree.
* \note Node groups can not be created inside their own node tree.
*/
int (*validfunc)(struct bNodeTree *ntree, struct bNodeTemplate *ntemp);
@ -180,6 +180,10 @@ typedef struct bNodeType {
struct bNodeTree *(*group_edit_set)(struct bNode *node, int edit);
void (*group_edit_clear)(struct bNode *node);
/* Generate a temporary list of internal links (bNodeLink), for muting and disconnect operators.
* Result must be freed by caller!
*/
ListBase (*internal_connect)(struct bNodeTree *, struct bNode *node);
/* **** execution callbacks **** */
void *(*initexecfunc)(struct bNode *node);
@ -189,24 +193,10 @@ typedef struct bNodeType {
* when a final generic version of execution code is defined, this will be changed anyway
*/
void (*newexecfunc)(void *data, int thread, struct bNode *, void *nodedata, struct bNodeStack **, struct bNodeStack **);
/* This is the muting callback.
* XXX Mimics the newexecfunc signature... Not sure all of this will be useful, we will see.
*/
void (*mutefunc)(void *data, int thread, struct bNode *, void *nodedata, struct bNodeStack **, struct bNodeStack **);
/* And the muting util.
* Returns links as a ListBase, as pairs of bNodeStack* if in/out bNodeStacks were provided,
* else as pairs of bNodeSocket* if node tree was provided.
*/
ListBase (*mutelinksfunc)(struct bNodeTree *, struct bNode *, struct bNodeStack **, struct bNodeStack **,
struct GPUNodeStack *, struct GPUNodeStack *);
/* gpu */
int (*gpufunc)(struct GPUMaterial *mat, struct bNode *node, struct GPUNodeStack *in, struct GPUNodeStack *out);
/* extended gpu function */
int (*gpuextfunc)(struct GPUMaterial *mat, struct bNode *node, void *nodedata, struct GPUNodeStack *in, struct GPUNodeStack *out);
/* This is the muting gpu callback.
* XXX Mimics the gpuextfunc signature... Not sure all of this will be useful, we will see.
*/
int (*gpumutefunc)(struct GPUMaterial *, struct bNode *, void *, struct GPUNodeStack *, struct GPUNodeStack *);
} bNodeType;
/* node->exec, now in use for composites (#define for break is same as ready yes) */
@ -284,12 +274,8 @@ typedef struct bNodeTreeType
int (*validate_link)(struct bNodeTree *ntree, struct bNodeLink *link);
/* Default muting pointers. */
void (*mutefunc)(void *data, int thread, struct bNode *, void *nodedata, struct bNodeStack **, struct bNodeStack **);
ListBase (*mutelinksfunc)(struct bNodeTree *, struct bNode *, struct bNodeStack **, struct bNodeStack **,
struct GPUNodeStack *, struct GPUNodeStack *);
/* gpu */
int (*gpumutefunc)(struct GPUMaterial *, struct bNode *, void *, struct GPUNodeStack *, struct GPUNodeStack *);
/* Default internal linking. */
ListBase (*internal_connect)(struct bNodeTree *, struct bNode *node);
} bNodeTreeType;
/* ************** GENERIC API, TREES *************** */
@ -343,7 +329,7 @@ struct bNode *nodeAddNode(struct bNodeTree *ntree, struct bNodeTemplate *ntemp);
void nodeUnlinkNode(struct bNodeTree *ntree, struct bNode *node);
void nodeUniqueName(struct bNodeTree *ntree, struct bNode *node);
void nodeRegisterType(struct bNodeTreeType *ttype, struct bNodeType *ntype) ;
void nodeRegisterType(struct bNodeTreeType *ttype, struct bNodeType *ntype);
void nodeMakeDynamicType(struct bNode *node);
int nodeDynamicUnlinkText(struct ID *txtid);
@ -353,6 +339,7 @@ struct bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node);
struct bNodeLink *nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock);
void nodeRemLink(struct bNodeTree *ntree, struct bNodeLink *link);
void nodeRemSocketLinks(struct bNodeTree *ntree, struct bNodeSocket *sock);
void nodeInternalRelink(struct bNodeTree *ntree, struct bNode *node);
void nodeSpaceCoords(struct bNode *node, float *locx, float *locy);
void nodeAttachNode(struct bNode *node, struct bNode *parent);
@ -418,18 +405,12 @@ void node_type_exec_new(struct bNodeType *ntype,
void (*freeexecfunc)(struct bNode *node, void *nodedata),
void (*newexecfunc)(void *data, int thread, struct bNode *, void *nodedata,
struct bNodeStack **, struct bNodeStack **));
void node_type_mute(struct bNodeType *ntype,
void (*mutefunc)(void *data, int thread, struct bNode *, void *nodedata,
struct bNodeStack **, struct bNodeStack **),
ListBase (*mutelinksfunc)(struct bNodeTree *, struct bNode *, struct bNodeStack **,
struct bNodeStack **, struct GPUNodeStack*, struct GPUNodeStack*));
void node_type_internal_connect(struct bNodeType *ntype, ListBase (*internal_connect)(struct bNodeTree *, struct bNode *));
void node_type_gpu(struct bNodeType *ntype, int (*gpufunc)(struct GPUMaterial *mat, struct bNode *node,
struct GPUNodeStack *in, struct GPUNodeStack *out));
void node_type_gpu_ext(struct bNodeType *ntype, int (*gpuextfunc)(struct GPUMaterial *mat, struct bNode *node,
void *nodedata, struct GPUNodeStack *in,
struct GPUNodeStack *out));
void node_type_gpu_mute(struct bNodeType *ntype, int (*gpumutefunc)(struct GPUMaterial *, struct bNode *, void *,
struct GPUNodeStack *, struct GPUNodeStack *));
void node_type_compatibility(struct bNodeType *ntype, short compatibility);
/* ************** COMMON NODES *************** */
@ -732,9 +713,7 @@ struct TexResult;
/* API */
int ntreeTexTagAnimated(struct bNodeTree *ntree);
void ntreeTexSetPreviewFlag(int);
void ntreeTexCheckCyclics(struct bNodeTree *ntree);
char* ntreeTexOutputMenu(struct bNodeTree *ntree);
struct bNodeTreeExec *ntreeTexBeginExecTree(struct bNodeTree *ntree, int use_tree_data);
void ntreeTexEndExecTree(struct bNodeTreeExec *exec, int use_tree_data);

@ -83,9 +83,6 @@ struct Object *copy_object(struct Object *ob);
void make_local_object(struct Object *ob);
int object_is_libdata(struct Object *ob);
int object_data_is_libdata(struct Object *ob);
void set_mblur_offs(float blur);
void set_field_offs(float field);
void disable_speed_curve(int val);
void object_scale_to_mat3(struct Object *ob, float mat[][3]);
void object_rot_to_mat3(struct Object *ob, float mat[][3]);
@ -104,11 +101,11 @@ void where_is_object_mat(struct Scene *scene, struct Object *ob, float obmat[4][
struct BoundBox *unit_boundbox(void);
void boundbox_set_from_min_max(struct BoundBox *bb, float min[3], float max[3]);
struct BoundBox *object_get_boundbox(struct Object *ob);
void object_get_dimensions(struct Object *ob, float *value);
void object_get_dimensions(struct Object *ob, float vec[3]);
void object_set_dimensions(struct Object *ob, const float *value);
void object_boundbox_flag(struct Object *ob, int flag, int set);
void minmax_object(struct Object *ob, float min[3], float max[3]);
int minmax_object_duplis(struct Scene *scene, struct Object *ob, float *min, float *max);
int minmax_object_duplis(struct Scene *scene, struct Object *ob, float min[3], float max[3]);
/* sometimes min-max isnt enough, we need to loop over each point */
void BKE_object_foreach_display_point(
@ -122,7 +119,6 @@ void BKE_scene_foreach_display_point(
int BKE_object_parent_loop_check(const struct Object *parent, const struct Object *ob);
void solve_tracking (struct Object *ob, float targetmat[][4]);
int ray_hit_boundbox(struct BoundBox *bb, float ray_start[3], float ray_normal[3]);
void *object_tfm_backup(struct Object *ob);

@ -319,7 +319,7 @@ void psys_free_particles(struct ParticleSystem *psys);
void psys_free_children(struct ParticleSystem *psys);
void psys_interpolate_particle(short type, struct ParticleKey keys[4], float dt, struct ParticleKey *result, int velocity);
void psys_vec_rot_to_face(struct DerivedMesh *dm, struct ParticleData *pa, float *vec);
void psys_vec_rot_to_face(struct DerivedMesh *dm, struct ParticleData *pa, float vec[3]);
void psys_mat_hair_to_object(struct Object *ob, struct DerivedMesh *dm, short from, struct ParticleData *pa, float hairmat[][4]);
void psys_mat_hair_to_global(struct Object *ob, struct DerivedMesh *dm, short from, struct ParticleData *pa, float hairmat[][4]);
void psys_mat_hair_to_orco(struct Object *ob, struct DerivedMesh *dm, short from, struct ParticleData *pa, float hairmat[][4]);

@ -288,12 +288,6 @@ void BKE_ptcache_mem_pointers_init(struct PTCacheMem *pm);
void BKE_ptcache_mem_pointers_incr(struct PTCacheMem *pm);
int BKE_ptcache_mem_pointers_seek(int point_index, struct PTCacheMem *pm);
/* Copy a specific data type from cache data to point data. */
void BKE_ptcache_data_get(void **data, int type, int index, void *to);
/* Copy a specific data type from point data to cache data. */
void BKE_ptcache_data_set(void **data, int type, void *from);
/* Main cache reading call. */
int BKE_ptcache_read(PTCacheID *pid, float cfra);

@ -40,6 +40,8 @@ struct Strip;
struct StripElem;
struct bSound;
struct SeqIndexBuildContext;
#define BUILD_SEQAR_COUNT_NOTHING 0
#define BUILD_SEQAR_COUNT_CURRENT 1
#define BUILD_SEQAR_COUNT_CHILDREN 2
@ -194,9 +196,10 @@ void update_changed_seq_and_deps(struct Scene *scene, struct Sequence *changed_s
int input_have_to_preprocess(
SeqRenderData context, struct Sequence * seq, float cfra);
void seq_proxy_rebuild(struct Main * bmain,
struct Scene *scene, struct Sequence * seq,
struct SeqIndexBuildContext *seq_proxy_rebuild_context(struct Main *bmain, struct Scene *scene, struct Sequence *seq);
void seq_proxy_rebuild(struct SeqIndexBuildContext *context,
short *stop, short *do_update, float *progress);
void seq_proxy_rebuild_finish(struct SeqIndexBuildContext *context, short stop);
/* **********************************************************************
@ -283,7 +286,6 @@ void seq_update_sound_bounds_all(struct Scene *scene);
void seq_update_sound_bounds(struct Scene* scene, struct Sequence *seq);
void seq_update_muting(struct Editing *ed);
void seq_update_sound(struct Scene *scene, struct bSound *sound);
void seqbase_sound_reload(struct Scene *scene, ListBase *seqbase);
void seqbase_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq);
void seqbase_dupli_recursive(struct Scene *scene, struct Scene *scene_to, ListBase *nseqbase, ListBase *seqbase, int dupe_flag);

@ -142,7 +142,7 @@ void sk_reverseStroke(SK_Stroke *stk);
void sk_filterLastContinuousStroke(SK_Stroke *stk);
void sk_filterStroke(SK_Stroke *stk, int start, int end);
void sk_initPoint(SK_Point *pt, SK_DrawData *dd, float *no);
void sk_initPoint(SK_Point *pt, SK_DrawData *dd, const float no[3]);
void sk_copyPoint(SK_Point *dst, SK_Point *src);
int sk_stroke_filtermval(SK_DrawData *dd);

@ -41,10 +41,10 @@ struct MultiresSubsurf;
struct Object;
struct PBVH;
struct SubsurfModifierData;
struct _CCGEdge;
struct _CCGFace;
struct _CCGSubsurf;
struct _CCGVert;
struct CCGEdge;
struct CCGFace;
struct CCGSubsurf;
struct CCGVert;
struct EdgeHash;
struct PBVH;
struct DMGridData;
@ -65,14 +65,14 @@ void subsurf_calculate_limit_positions(struct Mesh *me, float (*positions_r)[3])
typedef struct CCGDerivedMesh {
DerivedMesh dm;
struct _CCGSubSurf *ss;
struct CCGSubSurf *ss;
int freeSS;
int drawInteriorEdges, useSubsurfUv;
struct {int startVert; struct _CCGVert *vert;} *vertMap;
struct {int startVert; int startEdge; struct _CCGEdge *edge;} *edgeMap;
struct {int startVert; struct CCGVert *vert;} *vertMap;
struct {int startVert; int startEdge; struct CCGEdge *edge;} *edgeMap;
struct {int startVert; int startEdge;
int startFace; struct _CCGFace *face;} *faceMap;
int startFace; struct CCGFace *face;} *faceMap;
short *edgeFlags;
char *faceFlags;
@ -89,7 +89,7 @@ typedef struct CCGDerivedMesh {
struct DMGridData **gridData;
struct DMGridAdjacency *gridAdjacency;
int *gridOffset;
struct _CCGFace **gridFaces;
struct CCGFace **gridFaces;
struct {
struct MultiresModifierData *mmd;

@ -92,8 +92,6 @@ void txt_backspace_word (struct Text *text);
int txt_add_char (struct Text *text, unsigned int add);
int txt_add_raw_char (struct Text *text, unsigned int add);
int txt_replace_char (struct Text *text, unsigned int add);
void txt_export_to_object(struct Text *text);
void txt_export_to_objects(struct Text *text);
void txt_unindent (struct Text *text);
void txt_comment (struct Text *text);
void txt_indent (struct Text *text);
@ -107,8 +105,6 @@ struct TextMarker *txt_find_marker (struct Text *text, struct TextLine *line, i
struct TextMarker *txt_find_marker_region (struct Text *text, struct TextLine *line, int start, int end, int group, int flags);
struct TextMarker *txt_prev_marker (struct Text *text, struct TextMarker *marker);
struct TextMarker *txt_next_marker (struct Text *text, struct TextMarker *marker);
struct TextMarker *txt_prev_marker_color (struct Text *text, struct TextMarker *marker);
struct TextMarker *txt_next_marker_color (struct Text *text, struct TextMarker *marker);
/* utility functions, could be moved somewhere more generic but are python/text related */
int text_check_bracket(char ch);

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