This commit is contained in:
Campbell Barton 2011-09-14 01:32:59 +00:00
commit ac51152ec5
41 changed files with 344 additions and 311 deletions

@ -87,6 +87,10 @@ WITH_BF_STATIC3DMOUSE = True
BF_3DMOUSE = '/home/sources/staticlibs/spnav' BF_3DMOUSE = '/home/sources/staticlibs/spnav'
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib32' BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib32'
# FFT
WITH_BF_FFTW3 = True
WITH_BF_STATICFFTW3 = True
# Compilation and optimization # Compilation and optimization
BF_DEBUG = False BF_DEBUG = False
REL_CFLAGS = ['-O2'] REL_CFLAGS = ['-O2']

@ -87,6 +87,10 @@ WITH_BF_STATIC3DMOUSE = True
BF_3DMOUSE = '/home/sources/staticlibs/spnav' BF_3DMOUSE = '/home/sources/staticlibs/spnav'
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib64' BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib64'
# FFT
WITH_BF_FFTW3 = True
WITH_BF_STATICFFTW3 = True
# Compilation and optimization # Compilation and optimization
BF_DEBUG = False BF_DEBUG = False
REL_CFLAGS = ['-O2'] REL_CFLAGS = ['-O2']

@ -119,8 +119,8 @@ FOREACH(COMPONENT ${_opencollada_FIND_STATIC_COMPONENTS})
# Ubuntu ppa needs this. # Ubuntu ppa needs this.
lib64/opencollada lib/opencollada lib64/opencollada lib/opencollada
) )
MARK_AS_ADVANCED(OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY)
IF(OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY) IF(OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY)
MARK_AS_ADVANCED(OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY)
LIST(APPEND _opencollada_LIBRARIES "${OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY}") LIST(APPEND _opencollada_LIBRARIES "${OPENCOLLADA_${UPPERCOMPONENT}_LIBRARY}")
ENDIF() ENDIF()
ENDFOREACH() ENDFOREACH()

@ -1,43 +1,69 @@
# - Try to find the PCRE regular expression library # - Find PCRE library
# Once done this will define # Find the native PCRE includes and library
# This module defines
# PCRE_INCLUDE_DIRS, where to find pcre.h, Set when
# PCRE_INCLUDE_DIR is found.
# PCRE_LIBRARIES, libraries to link against to use PCRE.
# PCRE_ROOT_DIR, The base directory to search for PCRE.
# This can also be an environment variable.
# PCRE_FOUND, If false, do not try to use PCRE.
# #
# PCRE_FOUND - system has the PCRE library # also defined, but not for general use are
# PCRE_INCLUDE_DIR - the PCRE include directory # PCRE_LIBRARY, where to find the PCRE library.
# PCRE_LIBRARIES - The libraries needed to use PCRE
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org> #=============================================================================
# Copyright 2011 Blender Foundation.
# #
# Redistribution and use is allowed according to the terms of the BSD license. # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
if (PCRE_INCLUDE_DIR AND PCRE_PCREPOSIX_LIBRARY AND PCRE_PCRE_LIBRARY) # If PCRE_ROOT_DIR was defined in the environment, use it.
# Already in cache, be silent IF(NOT PCRE_ROOT_DIR AND NOT $ENV{PCRE_ROOT_DIR} STREQUAL "")
set(PCRE_FIND_QUIETLY TRUE) SET(PCRE_ROOT_DIR $ENV{PCRE_ROOT_DIR})
endif (PCRE_INCLUDE_DIR AND PCRE_PCREPOSIX_LIBRARY AND PCRE_PCRE_LIBRARY)
if (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
pkg_check_modules(PC_PCRE QUIET libpcre)
set(PCRE_DEFINITIONS ${PC_PCRE_CFLAGS_OTHER})
endif (NOT WIN32)
find_path(PCRE_INCLUDE_DIR pcre.h
HINTS ${PC_PCRE_INCLUDEDIR} ${PC_PCRE_INCLUDE_DIRS}
PATH_SUFFIXES pcre)
find_library(PCRE_PCRE_LIBRARY NAMES pcre HINTS ${PC_PCRE_LIBDIR} ${PC_PCRE_LIBRARY_DIRS})
find_library(PCRE_PCREPOSIX_LIBRARY NAMES pcreposix HINTS ${PC_PCRE_LIBDIR} ${PC_PCRE_LIBRARY_DIRS})
include(FindPackageHandleStandardArgs)
IF(NOT WIN32)
find_package_handle_standard_args(PCRE DEFAULT_MSG PCRE_INCLUDE_DIR PCRE_PCRE_LIBRARY PCRE_PCREPOSIX_LIBRARY )
mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARIES PCRE_PCREPOSIX_LIBRARY PCRE_PCRE_LIBRARY)
set(PCRE_LIBRARIES ${PCRE_PCRE_LIBRARY} ${PCRE_PCREPOSIX_LIBRARY})
ELSE()
find_package_handle_standard_args(PCRE DEFAULT_MSG PCRE_INCLUDE_DIR PCRE_PCRE_LIBRARY )
set(PCRE_LIBRARIES ${PCRE_PCRE_LIBRARY} )
mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARIES PCRE_PCRE_LIBRARY)
ENDIF() ENDIF()
SET(_pcre_SEARCH_DIRS
${PCRE_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
)
FIND_PATH(PCRE_INCLUDE_DIR pcre.h
HINTS
${_pcre_SEARCH_DIRS}
PATH_SUFFIXES
include
include
)
FIND_LIBRARY(PCRE_LIBRARY
NAMES
pcre
HINTS
${_pcre_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG
PCRE_LIBRARY PCRE_INCLUDE_DIR)
IF(PCRE_FOUND)
SET(PCRE_LIBRARIES ${PCRE_LIBRARY})
SET(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR})
ENDIF(PCRE_FOUND)
MARK_AS_ADVANCED(
PCRE_INCLUDE_DIR
PCRE_LIBRARY
)

@ -1,88 +1,68 @@
# - Try to find XML2 # - Find XML2 library
# Once done this will define # Find the native XML2 includes and library
# # This module defines
# XML2_FOUND - system has XML2 # XML2_INCLUDE_DIRS, where to find xml2.h, Set when
# XML2_INCLUDE_DIRS - the XML2 include directory # XML2_INCLUDE_DIR is found.
# XML2_LIBRARIES - Link these to use XML2 # XML2_LIBRARIES, libraries to link against to use XML2.
# XML2_DEFINITIONS - Compiler switches required for using XML2 # XML2_ROOT_DIR, The base directory to search for XML2.
# # This can also be an environment variable.
# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org> # XML2_FOUND, If false, do not try to use XML2.
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# #
# also defined, but not for general use are
# XML2_LIBRARY, where to find the XML2 library.
#=============================================================================
# Copyright 2011 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
if (XML2_LIBRARIES AND XML2_INCLUDE_DIRS) # If XML2_ROOT_DIR was defined in the environment, use it.
# in cache already IF(NOT XML2_ROOT_DIR AND NOT $ENV{XML2_ROOT_DIR} STREQUAL "")
set(XML2_FOUND TRUE) SET(XML2_ROOT_DIR $ENV{XML2_ROOT_DIR})
else (XML2_LIBRARIES AND XML2_INCLUDE_DIRS) ENDIF()
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls SET(_xml2_SEARCH_DIRS
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) ${XML2_ROOT_DIR}
include(UsePkgConfig) /usr/local
pkgconfig(libxml-2.0 _XML2_INCLUDEDIR _XML2_LIBDIR _XML2_LDFLAGS _XML2_CFLAGS) /sw # Fink
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) /opt/local # DarwinPorts
find_package(PkgConfig) /opt/csw # Blastwave
if (PKG_CONFIG_FOUND) )
pkg_check_modules(_XML2 libxml-2.0)
endif (PKG_CONFIG_FOUND) FIND_PATH(XML2_INCLUDE_DIR libxml2/libxml/xpath.h
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) HINTS
find_path(XML2_INCLUDE_DIR ${_xml2_SEARCH_DIRS}
NAMES PATH_SUFFIXES
libxml/xpath.h include
PATHS )
${_XML2_INCLUDEDIR}
/usr/include FIND_LIBRARY(XML2_LIBRARY
/usr/local/include NAMES
/opt/local/include xml2
/sw/include HINTS
PATH_SUFFIXES ${_xml2_SEARCH_DIRS}
libxml2 PATH_SUFFIXES
lib64 lib
) )
find_library(XML2_LIBRARY # handle the QUIETLY and REQUIRED arguments and set XML2_FOUND to TRUE if
NAMES # all listed variables are TRUE
xml2 INCLUDE(FindPackageHandleStandardArgs)
PATHS FIND_PACKAGE_HANDLE_STANDARD_ARGS(XML2 DEFAULT_MSG
${_XML2_LIBDIR} XML2_LIBRARY XML2_INCLUDE_DIR)
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
if (XML2_LIBRARY) IF(XML2_FOUND)
set(XML2_FOUND TRUE) SET(XML2_LIBRARIES ${XML2_LIBRARY})
endif (XML2_LIBRARY) SET(XML2_INCLUDE_DIRS ${XML2_INCLUDE_DIR})
ENDIF(XML2_FOUND)
set(XML2_INCLUDE_DIRS
${XML2_INCLUDE_DIR}
)
if (XML2_FOUND)
set(XML2_LIBRARIES
${XML2_LIBRARIES}
${XML2_LIBRARY}
)
endif (XML2_FOUND)
if (XML2_INCLUDE_DIRS AND XML2_LIBRARIES)
set(XML2_FOUND TRUE)
endif (XML2_INCLUDE_DIRS AND XML2_LIBRARIES)
if (XML2_FOUND)
if (NOT XML2_FIND_QUIETLY)
message(STATUS "Found XML2: ${XML2_LIBRARIES}")
endif (NOT XML2_FIND_QUIETLY)
else (XML2_FOUND)
if (XML2_FIND_REQUIRED)
message(FATAL_ERROR "Could not find XML2")
endif (XML2_FIND_REQUIRED)
endif (XML2_FOUND)
# show the XML2_INCLUDE_DIRS and XML2_LIBRARIES variables only in the advanced view
mark_as_advanced(XML2_INCLUDE_DIRS XML2_LIBRARIES)
endif (XML2_LIBRARIES AND XML2_INCLUDE_DIRS)
MARK_AS_ADVANCED(
XML2_INCLUDE_DIR
XML2_LIBRARY
)

@ -36,7 +36,7 @@ static const int DT_TILE_VERTS_PER_POLYGON = 6;
static const int DT_MAX_TILES = 1 << DT_TILE_REF_TILE_BITS; static const int DT_MAX_TILES = 1 << DT_TILE_REF_TILE_BITS;
static const int DT_MAX_POLYGONS = 1 << DT_TILE_REF_POLY_BITS; static const int DT_MAX_POLYGONS = 1 << DT_TILE_REF_POLY_BITS;
static const int DT_TILE_NAVMESH_MAGIC = (('N'<<24) | ('A'<<16) | ('V'<<8) | 'M'); static const int DT_TILE_NAVMESH_MAGIC = (('N'<<24) | ('A'<<16) | ('V'<<8) | 'T');
static const int DT_TILE_NAVMESH_VERSION = 2; static const int DT_TILE_NAVMESH_VERSION = 2;
// Structure holding the navigation polygon data. // Structure holding the navigation polygon data.

@ -94,7 +94,20 @@ static int circumCircle(const float xp, const float yp,
return (drsqr <= rsqr) ? 1 : 0; return (drsqr <= rsqr) ? 1 : 0;
} }
#ifdef FREE_WINDOWS
static float *_mingw_verts;
static int ptcmp(const void *v1, const void *v2)
{
const float* p1 = &_mingw_verts[(*(const int*)v1)*3];
const float* p2 = &_mingw_verts[(*(const int*)v2)*3];
if (p1[0] < p2[0])
return -1;
else if (p1[0] > p2[0])
return 1;
else
return 0;
}
#else
#if defined(_MSC_VER) #if defined(_MSC_VER)
static int ptcmp(void* up, const void *v1, const void *v2) static int ptcmp(void* up, const void *v1, const void *v2)
#elif defined(__APPLE__) || defined(__FreeBSD__) #elif defined(__APPLE__) || defined(__FreeBSD__)
@ -113,6 +126,7 @@ static int ptcmp(const void *v1, const void *v2, void* up)
else else
return 0; return 0;
} }
#endif
// Based on Paul Bourke's triangulate.c // Based on Paul Bourke's triangulate.c
// http://astronomy.swin.edu.au/~pbourke/terrain/triangulate/triangulate.c // http://astronomy.swin.edu.au/~pbourke/terrain/triangulate/triangulate.c
@ -126,6 +140,9 @@ static void delaunay(const int nv, float *verts, rcIntArray& idx, rcIntArray& tr
qsort_s(&idx[0], idx.size(), sizeof(int), ptcmp, verts); qsort_s(&idx[0], idx.size(), sizeof(int), ptcmp, verts);
#elif defined(__APPLE__) || defined(__FreeBSD__) #elif defined(__APPLE__) || defined(__FreeBSD__)
qsort_r(&idx[0], idx.size(), sizeof(int), verts, ptcmp); qsort_r(&idx[0], idx.size(), sizeof(int), verts, ptcmp);
#elif defined(FREE_WINDOWS)
_mingw_verts = verts;
qsort(&idx[0], idx.size(), sizeof(int), ptcmp);
#else #else
qsort_r(&idx[0], idx.size(), sizeof(int), ptcmp, verts); qsort_r(&idx[0], idx.size(), sizeof(int), ptcmp, verts);
#endif #endif

@ -34,14 +34,16 @@
* \since March 2001 * \since March 2001
* \author nzc * \author nzc
*/ */
struct BevList;
struct BezTriple;
struct Curve; struct Curve;
struct EditNurb;
struct ListBase; struct ListBase;
struct ListBase;
struct Nurb;
struct Object; struct Object;
struct Scene; struct Scene;
struct Nurb;
struct ListBase;
struct BezTriple;
struct BevList;
#define KNOTSU(nu) ( (nu)->orderu+ (nu)->pntsu+ (((nu)->flagu & CU_NURB_CYCLIC) ? ((nu)->orderu-1) : 0) ) #define KNOTSU(nu) ( (nu)->orderu+ (nu)->pntsu+ (((nu)->flagu & CU_NURB_CYCLIC) ? ((nu)->orderu-1) : 0) )
#define KNOTSV(nu) ( (nu)->orderv+ (nu)->pntsv+ (((nu)->flagv & CU_NURB_CYCLIC) ? ((nu)->orderv-1) : 0) ) #define KNOTSV(nu) ( (nu)->orderv+ (nu)->pntsv+ (((nu)->flagv & CU_NURB_CYCLIC) ? ((nu)->orderv-1) : 0) )
@ -55,11 +57,14 @@ struct BevList;
void unlink_curve( struct Curve *cu); void unlink_curve( struct Curve *cu);
void free_curve_editNurb_keyIndex(struct EditNurb *editnurb);
void free_curve_editNurb(struct Curve *cu);
void free_curve( struct Curve *cu); void free_curve( struct Curve *cu);
void BKE_free_editfont(struct Curve *cu); void BKE_free_editfont(struct Curve *cu);
struct Curve *add_curve(const char *name, int type); struct Curve *add_curve(const char *name, int type);
struct Curve *copy_curve( struct Curve *cu); struct Curve *copy_curve( struct Curve *cu);
void make_local_curve( struct Curve *cu); void make_local_curve( struct Curve *cu);
struct ListBase *curve_editnurbs(struct Curve *cu);
short curve_type( struct Curve *cu); short curve_type( struct Curve *cu);
void test_curve_type( struct Object *ob); void test_curve_type( struct Object *ob);
void tex_space_curve( struct Curve *cu); void tex_space_curve( struct Curve *cu);

@ -128,6 +128,7 @@ void *object_tfm_backup(struct Object *ob);
void object_tfm_restore(struct Object *ob, void *obtfm_pt); void object_tfm_restore(struct Object *ob, void *obtfm_pt);
void object_handle_update(struct Scene *scene, struct Object *ob); void object_handle_update(struct Scene *scene, struct Object *ob);
void object_sculpt_modifiers_changed(struct Object *ob);
float give_timeoffset(struct Object *ob); float give_timeoffset(struct Object *ob);
int give_obdata_texspace(struct Object *ob, short **texflag, float **loc, float **size, float **rot); int give_obdata_texspace(struct Object *ob, short **texflag, float **loc, float **size, float **rot);

@ -98,5 +98,6 @@ typedef struct SculptSession {
} SculptSession; } SculptSession;
void free_sculptsession(struct Object *ob); void free_sculptsession(struct Object *ob);
void free_sculptsession_deformMats(struct SculptSession *ss);
#endif #endif

@ -35,7 +35,6 @@ set(INC
../blenfont ../blenfont
../blenlib ../blenlib
../blenloader ../blenloader
../editors/include
../gpu ../gpu
../ikplugin ../ikplugin
../imbuf ../imbuf

@ -4,7 +4,7 @@ import os
sources = env.Glob('intern/*.c') + env.Glob('intern/*.cpp') sources = env.Glob('intern/*.c') + env.Glob('intern/*.cpp')
incs = '. #/intern/guardedalloc #/intern/memutil ../editors/include' incs = '. #/intern/guardedalloc #/intern/memutil'
incs += ' ../blenlib ../blenfont ../makesdna ../windowmanager' incs += ' ../blenlib ../blenfont ../makesdna ../windowmanager'
incs += ' ../render/extern/include #/intern/decimation/extern ../makesrna' incs += ' ../render/extern/include #/intern/decimation/extern ../makesrna'
incs += ' ../imbuf ../ikplugin ../avi #/intern/elbeem/extern ../nodes ../modifiers' incs += ' ../imbuf ../ikplugin ../avi #/intern/elbeem/extern ../nodes ../modifiers'

@ -63,18 +63,16 @@
#include "BKE_texture.h" #include "BKE_texture.h"
#include "BKE_multires.h" #include "BKE_multires.h"
#include "BLO_sys_types.h" // for intptr_t support #include "BLO_sys_types.h" // for intptr_t support
#include "BIF_gl.h" #include "GL/glew.h"
#include "BIF_glutil.h"
#include "GPU_buffers.h" #include "GPU_buffers.h"
#include "GPU_draw.h" #include "GPU_draw.h"
#include "GPU_extensions.h" #include "GPU_extensions.h"
#include "GPU_material.h" #include "GPU_material.h"
#include "ED_sculpt.h" /* for ED_sculpt_modifiers_changed */ extern GLubyte stipple_quarttone[128]; /* glutil.c, bad level data */
// Jason was here, this is for multi-paint // Jason was here, this is for multi-paint
#include "ED_armature.h" #include "ED_armature.h"
@ -2401,7 +2399,7 @@ static void clear_mesh_caches(Object *ob)
} }
if(ob->sculpt) { if(ob->sculpt) {
ED_sculpt_modifiers_changed(ob); object_sculpt_modifiers_changed(ob);
} }
} }

@ -36,10 +36,7 @@
* \ingroup bke * \ingroup bke
*/ */
#include "GL/glew.h"
/* TODO maybe BIF_gl.h should include string.h? */
#include <string.h>
#include "BIF_gl.h"
#include "BLI_blenlib.h" #include "BLI_blenlib.h"
#include "BLI_edgehash.h" #include "BLI_edgehash.h"

@ -41,9 +41,10 @@
#include "MEM_guardedalloc.h" #include "MEM_guardedalloc.h"
#include "BLI_blenlib.h" #include "BLI_blenlib.h"
#include "BLI_math.h" #include "BLI_math.h"
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "DNA_curve_types.h" #include "DNA_curve_types.h"
#include "DNA_material_types.h" #include "DNA_material_types.h"
@ -66,9 +67,6 @@
#include "BKE_object.h" #include "BKE_object.h"
#include "BKE_material.h" #include "BKE_material.h"
#include "ED_curve.h"
/* globals */ /* globals */
/* local */ /* local */
@ -118,6 +116,25 @@ void BKE_free_editfont(Curve *cu)
} }
} }
void free_curve_editNurb_keyIndex(EditNurb *editnurb)
{
if (!editnurb->keyindex) {
return;
}
BLI_ghash_free(editnurb->keyindex, NULL, (GHashValFreeFP)MEM_freeN);
editnurb->keyindex= NULL;
}
void free_curve_editNurb (Curve *cu)
{
if(cu->editnurb) {
freeNurblist(&cu->editnurb->nurbs);
free_curve_editNurb_keyIndex(cu->editnurb);
MEM_freeN(cu->editnurb);
cu->editnurb= NULL;
}
}
/* don't free curve itself */ /* don't free curve itself */
void free_curve(Curve *cu) void free_curve(Curve *cu)
{ {
@ -281,6 +298,16 @@ void make_local_curve(Curve *cu)
} }
} }
/* Get list of nurbs from editnurbs structure */
ListBase *curve_editnurbs(Curve *cu)
{
if (cu->editnurb) {
return &cu->editnurb->nurbs;
}
return NULL;
}
short curve_type(Curve *cu) short curve_type(Curve *cu)
{ {
Nurb *nu; Nurb *nu;
@ -358,7 +385,6 @@ void tex_space_curve(Curve *cu)
} }
} }
int count_curveverts(ListBase *nurb) int count_curveverts(ListBase *nurb)
{ {
Nurb *nu; Nurb *nu;
@ -2049,7 +2075,7 @@ void makeBevelList(Object *ob)
BLI_freelistN(&(cu->bev)); BLI_freelistN(&(cu->bev));
if(cu->editnurb && ob->type!=OB_FONT) { if(cu->editnurb && ob->type!=OB_FONT) {
ListBase *nurbs= ED_curve_editnurbs(cu); ListBase *nurbs= curve_editnurbs(cu);
nu= nurbs->first; nu= nurbs->first;
} else nu= cu->nurb.first; } else nu= cu->nurb.first;
@ -3157,7 +3183,7 @@ int clamp_nurb_order_v( struct Nurb *nu)
ListBase *BKE_curve_nurbs(Curve *cu) ListBase *BKE_curve_nurbs(Curve *cu)
{ {
if (cu->editnurb) { if (cu->editnurb) {
return ED_curve_editnurbs(cu); return curve_editnurbs(cu);
} }
return &cu->nurb; return &cu->nurb;

@ -67,8 +67,6 @@
#include "BLO_sys_types.h" // for intptr_t support #include "BLO_sys_types.h" // for intptr_t support
#include "ED_curve.h" /* for BKE_curve_nurbs */
extern Material defmaterial; /* material.c */ extern Material defmaterial; /* material.c */
static void boundbox_displist(Object *ob); static void boundbox_displist(Object *ob);
@ -1102,7 +1100,7 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase,
float (*deformedVerts)[3]; float (*deformedVerts)[3];
if(!forRender && cu->editnurb) if(!forRender && cu->editnurb)
nubase= ED_curve_editnurbs(cu); nubase= curve_editnurbs(cu);
else else
nubase= &cu->nurb; nubase= &cu->nurb;

@ -143,7 +143,7 @@ int BKE_mesh_validate_arrays(Mesh *me, MVert *UNUSED(mverts), unsigned int totve
BLI_assert(!(do_fixes && me == NULL)); BLI_assert(!(do_fixes && me == NULL));
PRINT("ED_mesh_validate: verts(%u), edges(%u), faces(%u)\n", totvert, totedge, totface); PRINT("%s: verts(%u), edges(%u), faces(%u)\n", __func__, totvert, totedge, totface);
if(totedge == 0 && totface != 0) { if(totedge == 0 && totface != 0) {
PRINT(" locical error, %u faces and 0 edges\n", totface); PRINT(" locical error, %u faces and 0 edges\n", totface);

@ -289,6 +289,15 @@ struct SortContext
const int* recastData; const int* recastData;
const int* trisToFacesMap; const int* trisToFacesMap;
}; };
#ifdef FREE_WINDOWS
static SortContext *_mingw_context;
static int compareByData(const void * a, const void * b)
{
return ( _mingw_context->recastData[_mingw_context->trisToFacesMap[*(int*)a]] -
_mingw_context->recastData[_mingw_context->trisToFacesMap[*(int*)b]] );
}
#else
#if defined(_MSC_VER) #if defined(_MSC_VER)
static int compareByData(void* data, const void * a, const void * b) static int compareByData(void* data, const void * a, const void * b)
#elif defined(__APPLE__) || defined(__FreeBSD__) #elif defined(__APPLE__) || defined(__FreeBSD__)
@ -301,6 +310,7 @@ static int compareByData(const void * a, const void * b, void* data)
return ( context->recastData[context->trisToFacesMap[*(int*)a]] - return ( context->recastData[context->trisToFacesMap[*(int*)a]] -
context->recastData[context->trisToFacesMap[*(int*)b]] ); context->recastData[context->trisToFacesMap[*(int*)b]] );
} }
#endif
bool buildNavMeshData(const int nverts, const float* verts, bool buildNavMeshData(const int nverts, const float* verts,
const int ntris, const unsigned short *tris, const int ntris, const unsigned short *tris,
@ -327,6 +337,9 @@ bool buildNavMeshData(const int nverts, const float* verts,
qsort_s(trisMapping, ntris, sizeof(int), compareByData, &context); qsort_s(trisMapping, ntris, sizeof(int), compareByData, &context);
#elif defined(__APPLE__) || defined(__FreeBSD__) #elif defined(__APPLE__) || defined(__FreeBSD__)
qsort_r(trisMapping, ntris, sizeof(int), &context, compareByData); qsort_r(trisMapping, ntris, sizeof(int), &context, compareByData);
#elif defined(FREE_WINDOWS)
_mingw_context = &context;
qsort(trisMapping, ntris, sizeof(int), compareByData);
#else #else
qsort_r(trisMapping, ntris, sizeof(int), compareByData, &context); qsort_r(trisMapping, ntris, sizeof(int), compareByData, &context);
#endif #endif

@ -235,6 +235,17 @@ void object_free_display(Object *ob)
freedisplist(&ob->disp); freedisplist(&ob->disp);
} }
void free_sculptsession_deformMats(SculptSession *ss)
{
if(ss->orig_cos) MEM_freeN(ss->orig_cos);
if(ss->deform_cos) MEM_freeN(ss->deform_cos);
if(ss->deform_imats) MEM_freeN(ss->deform_imats);
ss->orig_cos = NULL;
ss->deform_cos = NULL;
ss->deform_imats = NULL;
}
void free_sculptsession(Object *ob) void free_sculptsession(Object *ob)
{ {
if(ob && ob->sculpt) { if(ob && ob->sculpt) {
@ -265,6 +276,7 @@ void free_sculptsession(Object *ob)
} }
} }
/* do not free object itself */ /* do not free object itself */
void free_object(Object *ob) void free_object(Object *ob)
{ {
@ -2759,6 +2771,33 @@ void object_handle_update(Scene *scene, Object *ob)
} }
} }
void object_sculpt_modifiers_changed(Object *ob)
{
SculptSession *ss= ob->sculpt;
if(!ss->cache) {
/* we free pbvh on changes, except during sculpt since it can't deal with
changing PVBH node organization, we hope topology does not change in
the meantime .. weak */
if(ss->pbvh) {
BLI_pbvh_free(ss->pbvh);
ss->pbvh= NULL;
}
free_sculptsession_deformMats(ob->sculpt);
} else {
PBVHNode **nodes;
int n, totnode;
BLI_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode);
for(n = 0; n < totnode; n++)
BLI_pbvh_node_mark_update(nodes[n]);
MEM_freeN(nodes);
}
}
float give_timeoffset(Object *ob) { float give_timeoffset(Object *ob) {
if ((ob->ipoflag & OB_OFFS_PARENTADD) && ob->parent) { if ((ob->ipoflag & OB_OFFS_PARENTADD) && ob->parent) {
return ob->sf + give_timeoffset(ob->parent); return ob->sf + give_timeoffset(ob->parent);

@ -61,9 +61,7 @@
#include "BKE_scene.h" #include "BKE_scene.h"
#include "BKE_subsurf.h" #include "BKE_subsurf.h"
#include "GL/glew.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "GPU_draw.h" #include "GPU_draw.h"
#include "GPU_extensions.h" #include "GPU_extensions.h"
@ -71,6 +69,8 @@
#include "CCGSubSurf.h" #include "CCGSubSurf.h"
extern GLubyte stipple_quarttone[128]; /* glutil.c, bad level data */
static int ccgDM_getVertMapIndex(CCGSubSurf *ss, CCGVert *v); static int ccgDM_getVertMapIndex(CCGSubSurf *ss, CCGVert *v);
static int ccgDM_getEdgeMapIndex(CCGSubSurf *ss, CCGEdge *e); static int ccgDM_getEdgeMapIndex(CCGSubSurf *ss, CCGEdge *e);
static int ccgDM_getFaceMapIndex(CCGSubSurf *ss, CCGFace *f); static int ccgDM_getFaceMapIndex(CCGSubSurf *ss, CCGFace *f);

@ -46,14 +46,12 @@
#include "WM_api.h" #include "WM_api.h"
#include "WM_types.h" #include "WM_types.h"
#include "ED_curve.h"
#include "ED_object.h" #include "ED_object.h"
#include "ED_screen.h" #include "ED_screen.h"
#include "ED_transform.h" #include "ED_transform.h"
#include "curve_intern.h" #include "curve_intern.h"
/************************* registration ****************************/ /************************* registration ****************************/
void ED_operatortypes_curve(void) void ED_operatortypes_curve(void)

@ -117,7 +117,7 @@ static float nurbcircle[8][2]= {
{0.0, 1.0}, { 1.0, 1.0}, { 1.0, 0.0}, { 1.0, -1.0} {0.0, 1.0}, { 1.0, 1.0}, { 1.0, 0.0}, { 1.0, -1.0}
}; };
ListBase *curve_get_editcurve(Object *ob) ListBase *object_editcurve_get(Object *ob)
{ {
if(ob && ELEM(ob->type, OB_CURVE, OB_SURF)) { if(ob && ELEM(ob->type, OB_CURVE, OB_SURF)) {
Curve *cu= ob->data; Curve *cu= ob->data;
@ -134,7 +134,7 @@ static void set_actNurb(Object *obedit, Nurb *nu)
if(nu==NULL) if(nu==NULL)
cu->actnu = -1; cu->actnu = -1;
else { else {
ListBase *nurbs= ED_curve_editnurbs(cu); ListBase *nurbs= curve_editnurbs(cu);
cu->actnu = BLI_findindex(nurbs, nu); cu->actnu = BLI_findindex(nurbs, nu);
} }
} }
@ -142,7 +142,7 @@ static void set_actNurb(Object *obedit, Nurb *nu)
static Nurb *get_actNurb(Object *obedit) static Nurb *get_actNurb(Object *obedit)
{ {
Curve *cu= obedit->data; Curve *cu= obedit->data;
ListBase *nurbs= ED_curve_editnurbs(cu); ListBase *nurbs= curve_editnurbs(cu);
return BLI_findlink(nurbs, cu->actnu); return BLI_findlink(nurbs, cu->actnu);
} }
@ -268,7 +268,7 @@ static int isNurbsel_count(Curve *cu, Nurb *nu)
void printknots(Object *obedit) void printknots(Object *obedit)
{ {
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
int a, num; int a, num;
@ -302,11 +302,6 @@ static CVKeyIndex *init_cvKeyIndex(void *cv, int key_index, int nu_index, int pt
return cvIndex; return cvIndex;
} }
static void free_cvKeyIndex(CVKeyIndex *pointIndex)
{
MEM_freeN(pointIndex);
}
static void init_editNurb_keyIndex(EditNurb *editnurb, ListBase *origBase) static void init_editNurb_keyIndex(EditNurb *editnurb, ListBase *origBase)
{ {
Nurb *nu= editnurb->nurbs.first; Nurb *nu= editnurb->nurbs.first;
@ -358,15 +353,6 @@ static void init_editNurb_keyIndex(EditNurb *editnurb, ListBase *origBase)
editnurb->keyindex= gh; editnurb->keyindex= gh;
} }
static void free_editNurb_keyIndex(EditNurb *editnurb)
{
if (!editnurb->keyindex) {
return;
}
BLI_ghash_free(editnurb->keyindex, NULL, (GHashValFreeFP)free_cvKeyIndex);
editnurb->keyindex= NULL;
}
static CVKeyIndex *getCVKeyIndex(EditNurb *editnurb, void *cv) static CVKeyIndex *getCVKeyIndex(EditNurb *editnurb, void *cv)
{ {
return BLI_ghash_lookup(editnurb->keyindex, cv); return BLI_ghash_lookup(editnurb->keyindex, cv);
@ -411,7 +397,7 @@ static void keyIndex_delCV(EditNurb *editnurb, void *cv)
return; return;
} }
BLI_ghash_remove(editnurb->keyindex, cv, NULL, (GHashValFreeFP)free_cvKeyIndex); BLI_ghash_remove(editnurb->keyindex, cv, NULL, (GHashValFreeFP)MEM_freeN);
} }
static void keyIndex_delBezt(EditNurb *editnurb, BezTriple *bezt) static void keyIndex_delBezt(EditNurb *editnurb, BezTriple *bezt)
@ -437,7 +423,7 @@ static void keyIndex_delNurb(EditNurb *editnurb, Nurb *nu)
a= nu->pntsu; a= nu->pntsu;
while (a--) { while (a--) {
BLI_ghash_remove(editnurb->keyindex, bezt, NULL, (GHashValFreeFP)free_cvKeyIndex); BLI_ghash_remove(editnurb->keyindex, bezt, NULL, (GHashValFreeFP)MEM_freeN);
++bezt; ++bezt;
} }
} else { } else {
@ -445,7 +431,7 @@ static void keyIndex_delNurb(EditNurb *editnurb, Nurb *nu)
a= nu->pntsu * nu->pntsv; a= nu->pntsu * nu->pntsv;
while (a--) { while (a--) {
BLI_ghash_remove(editnurb->keyindex, bp, NULL, (GHashValFreeFP)free_cvKeyIndex); BLI_ghash_remove(editnurb->keyindex, bp, NULL, (GHashValFreeFP)MEM_freeN);
++bp; ++bp;
} }
} }
@ -1198,7 +1184,7 @@ int ED_curve_updateAnimPaths(Object *obedit)
/* load editNurb in object */ /* load editNurb in object */
void load_editNurb(Object *obedit) void load_editNurb(Object *obedit)
{ {
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
if(obedit==NULL) return; if(obedit==NULL) return;
@ -1251,7 +1237,7 @@ void make_editNurb(Object *obedit)
if(editnurb) { if(editnurb) {
freeNurblist(&editnurb->nurbs); freeNurblist(&editnurb->nurbs);
free_editNurb_keyIndex(editnurb); free_curve_editNurb_keyIndex(editnurb);
editnurb->keyindex= NULL; editnurb->keyindex= NULL;
} else { } else {
editnurb= MEM_callocN(sizeof(EditNurb), "editnurb"); editnurb= MEM_callocN(sizeof(EditNurb), "editnurb");
@ -1283,16 +1269,6 @@ void make_editNurb(Object *obedit)
} }
} }
void free_curve_editNurb (Curve *cu)
{
if(cu->editnurb) {
freeNurblist(&cu->editnurb->nurbs);
free_editNurb_keyIndex(cu->editnurb);
MEM_freeN(cu->editnurb);
cu->editnurb= NULL;
}
}
void free_editNurb(Object *obedit) void free_editNurb(Object *obedit)
{ {
Curve *cu= obedit->data; Curve *cu= obedit->data;
@ -1302,7 +1278,7 @@ void free_editNurb(Object *obedit)
void CU_deselect_all(Object *obedit) void CU_deselect_all(Object *obedit)
{ {
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
if (editnurb) { if (editnurb) {
selectend_nurb(obedit, FIRST, 0, DESELECT); /* set first control points as unselected */ selectend_nurb(obedit, FIRST, 0, DESELECT); /* set first control points as unselected */
@ -1312,7 +1288,7 @@ void CU_deselect_all(Object *obedit)
void CU_select_all(Object *obedit) void CU_select_all(Object *obedit)
{ {
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
if (editnurb) { if (editnurb) {
selectend_nurb(obedit, FIRST, 0, SELECT); /* set first control points as unselected */ selectend_nurb(obedit, FIRST, 0, SELECT); /* set first control points as unselected */
@ -1322,7 +1298,7 @@ void CU_select_all(Object *obedit)
void CU_select_swap(Object *obedit) void CU_select_swap(Object *obedit)
{ {
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
if (editnurb) { if (editnurb) {
Curve *cu= obedit->data; Curve *cu= obedit->data;
@ -1397,7 +1373,7 @@ static int separate_exec(bContext *C, wmOperator *op)
make_editNurb(newob); make_editNurb(newob);
newedit= newcu->editnurb; newedit= newcu->editnurb;
freeNurblist(&newedit->nurbs); freeNurblist(&newedit->nurbs);
free_editNurb_keyIndex(newedit); free_curve_editNurb_keyIndex(newedit);
/* 3. move over parts from old object */ /* 3. move over parts from old object */
for(nu= oldedit->nurbs.first; nu; nu=nu1) { for(nu= oldedit->nurbs.first; nu; nu=nu1) {
@ -1588,7 +1564,7 @@ static int deleteflagNurb(bContext *C, wmOperator *UNUSED(op), int flag)
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data; Curve *cu= obedit->data;
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu, *next; Nurb *nu, *next;
BPoint *bp, *bpn, *newbp; BPoint *bp, *bpn, *newbp;
int a, b, newu, newv, sel; int a, b, newu, newv, sel;
@ -1835,7 +1811,7 @@ static short extrudeflagNurb(EditNurb *editnurb, int flag)
static void adduplicateflagNurb(Object *obedit, short flag) static void adduplicateflagNurb(Object *obedit, short flag)
{ {
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu, *newnu; Nurb *nu, *newnu;
BezTriple *bezt, *bezt1; BezTriple *bezt, *bezt1;
BPoint *bp, *bp1; BPoint *bp, *bp1;
@ -2051,7 +2027,7 @@ void CURVE_OT_switch_direction(wmOperatorType *ot)
static int set_goal_weight_exec(bContext *C, wmOperator *op) static int set_goal_weight_exec(bContext *C, wmOperator *op)
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
BezTriple *bezt; BezTriple *bezt;
BPoint *bp; BPoint *bp;
@ -2103,7 +2079,7 @@ void CURVE_OT_spline_weight_set(wmOperatorType *ot)
static int set_radius_exec(bContext *C, wmOperator *op) static int set_radius_exec(bContext *C, wmOperator *op)
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
BezTriple *bezt; BezTriple *bezt;
BPoint *bp; BPoint *bp;
@ -2155,7 +2131,7 @@ void CURVE_OT_radius_set(wmOperatorType *ot)
static int smooth_exec(bContext *C, wmOperator *UNUSED(op)) static int smooth_exec(bContext *C, wmOperator *UNUSED(op))
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
BezTriple *bezt, *beztOrig; BezTriple *bezt, *beztOrig;
BPoint *bp, *bpOrig; BPoint *bp, *bpOrig;
@ -2228,7 +2204,7 @@ void CURVE_OT_smooth(wmOperatorType *ot)
static int smooth_radius_exec(bContext *C, wmOperator *UNUSED(op)) static int smooth_radius_exec(bContext *C, wmOperator *UNUSED(op))
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
BezTriple *bezt; BezTriple *bezt;
BPoint *bp; BPoint *bp;
@ -2461,7 +2437,7 @@ static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short
/* selstatus: selection status in case doswap is false */ /* selstatus: selection status in case doswap is false */
void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatus) void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatus)
{ {
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
BPoint *bp; BPoint *bp;
BezTriple *bezt; BezTriple *bezt;
@ -2603,7 +2579,7 @@ static short nurb_has_selected_cps(ListBase *editnurb)
static int de_select_all_exec(bContext *C, wmOperator *op) static int de_select_all_exec(bContext *C, wmOperator *op)
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
int action = RNA_enum_get(op->ptr, "action"); int action = RNA_enum_get(op->ptr, "action");
if (action == SEL_TOGGLE) { if (action == SEL_TOGGLE) {
@ -2652,7 +2628,7 @@ static int hide_exec(bContext *C, wmOperator *op)
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data; Curve *cu= obedit->data;
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
BPoint *bp; BPoint *bp;
BezTriple *bezt; BezTriple *bezt;
@ -2725,7 +2701,7 @@ void CURVE_OT_hide(wmOperatorType *ot)
static int reveal_exec(bContext *C, wmOperator *UNUSED(op)) static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
BPoint *bp; BPoint *bp;
BezTriple *bezt; BezTriple *bezt;
@ -2783,7 +2759,7 @@ static int select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data; Curve *cu= obedit->data;
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
BPoint *bp; BPoint *bp;
BezTriple *bezt; BezTriple *bezt;
@ -3542,7 +3518,7 @@ void ED_nurb_set_spline_type(Nurb *nu, int type)
static int set_spline_type_exec(bContext *C, wmOperator *op) static int set_spline_type_exec(bContext *C, wmOperator *op)
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
int changed=0, type= RNA_enum_get(op->ptr, "type"); int changed=0, type= RNA_enum_get(op->ptr, "type");
@ -3606,7 +3582,7 @@ void CURVE_OT_spline_type_set(wmOperatorType *ot)
static int set_handle_type_exec(bContext *C, wmOperator *op) static int set_handle_type_exec(bContext *C, wmOperator *op)
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
sethandlesNurb(editnurb, RNA_enum_get(op->ptr, "type")); sethandlesNurb(editnurb, RNA_enum_get(op->ptr, "type"));
@ -3928,7 +3904,7 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu
static int merge_nurb(bContext *C, wmOperator *op) static int merge_nurb(bContext *C, wmOperator *op)
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
NurbSort *nus1, *nus2; NurbSort *nus1, *nus2;
int ok= 1; int ok= 1;
@ -3984,7 +3960,7 @@ static int make_segment_exec(bContext *C, wmOperator *op)
/* joins 2 curves */ /* joins 2 curves */
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data; Curve *cu= obedit->data;
ListBase *nubase= curve_get_editcurve(obedit); ListBase *nubase= object_editcurve_get(obedit);
Nurb *nu, *nu1=NULL, *nu2=NULL; Nurb *nu, *nu1=NULL, *nu2=NULL;
BPoint *bp; BPoint *bp;
float *fp, offset; float *fp, offset;
@ -4180,7 +4156,7 @@ int mouse_nurb(bContext *C, const int mval[2], int extend)
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data; Curve *cu= obedit->data;
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
ViewContext vc; ViewContext vc;
Nurb *nu; Nurb *nu;
BezTriple *bezt=NULL; BezTriple *bezt=NULL;
@ -4264,7 +4240,7 @@ int mouse_nurb(bContext *C, const int mval[2], int extend)
static int spin_nurb(float viewmat[][4], Object *obedit, float *axis, float *cent) static int spin_nurb(float viewmat[][4], Object *obedit, float *axis, float *cent)
{ {
Curve *cu= (Curve*)obedit->data; Curve *cu= (Curve*)obedit->data;
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
float si,phi,n[3],q[4],cmat[3][3],tmat[3][3],imat[3][3]; float si,phi,n[3],q[4],cmat[3][3],tmat[3][3],imat[3][3];
float bmat[3][3], rotmat[3][3], scalemat1[3][3], scalemat2[3][3]; float bmat[3][3], rotmat[3][3], scalemat1[3][3], scalemat2[3][3];
@ -4786,7 +4762,7 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op)
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data; Curve *cu= obedit->data;
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
BezTriple *bezt; BezTriple *bezt;
BPoint *bp; BPoint *bp;
@ -4863,7 +4839,7 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op)
static int toggle_cyclic_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) static int toggle_cyclic_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
uiPopupMenu *pup; uiPopupMenu *pup;
uiLayout *layout; uiLayout *layout;
Nurb *nu; Nurb *nu;
@ -5050,7 +5026,7 @@ static int select_row_exec(bContext *C, wmOperator *UNUSED(op))
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data; Curve *cu= obedit->data;
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
static BPoint *last= NULL; static BPoint *last= NULL;
static int direction=0; static int direction=0;
Nurb *nu; Nurb *nu;
@ -5124,7 +5100,7 @@ void CURVE_OT_select_row(wmOperatorType *ot)
static int select_next_exec(bContext *C, wmOperator *UNUSED(op)) static int select_next_exec(bContext *C, wmOperator *UNUSED(op))
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
select_adjacent_cp(editnurb, 1, 0, SELECT); select_adjacent_cp(editnurb, 1, 0, SELECT);
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
@ -5151,7 +5127,7 @@ void CURVE_OT_select_next(wmOperatorType *ot)
static int select_previous_exec(bContext *C, wmOperator *UNUSED(op)) static int select_previous_exec(bContext *C, wmOperator *UNUSED(op))
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
select_adjacent_cp(editnurb, -1, 0, SELECT); select_adjacent_cp(editnurb, -1, 0, SELECT);
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
@ -5178,7 +5154,7 @@ void CURVE_OT_select_previous(wmOperatorType *ot)
static int select_more_exec(bContext *C, wmOperator *UNUSED(op)) static int select_more_exec(bContext *C, wmOperator *UNUSED(op))
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
BPoint *bp, *tempbp; BPoint *bp, *tempbp;
int a; int a;
@ -5266,7 +5242,7 @@ void CURVE_OT_select_more(wmOperatorType *ot)
static int select_less_exec(bContext *C, wmOperator *UNUSED(op)) static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
BPoint *bp; BPoint *bp;
BezTriple *bezt; BezTriple *bezt;
@ -5458,7 +5434,7 @@ static void selectrandom_curve(ListBase *editnurb, float randfac)
static int select_random_exec(bContext *C, wmOperator *op) static int select_random_exec(bContext *C, wmOperator *op)
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
if(!RNA_boolean_get(op->ptr, "extend")) if(!RNA_boolean_get(op->ptr, "extend"))
CU_deselect_all(obedit); CU_deselect_all(obedit);
@ -5550,7 +5526,7 @@ static void select_nth_bp(Nurb *nu, BPoint *bp, int nth)
int CU_select_nth(Object *obedit, int nth) int CU_select_nth(Object *obedit, int nth)
{ {
Curve *cu= (Curve*)obedit->data; Curve *cu= (Curve*)obedit->data;
ListBase *nubase= ED_curve_editnurbs(cu); ListBase *nubase= curve_editnurbs(cu);
Nurb *nu; Nurb *nu;
int ok=0; int ok=0;
@ -6024,7 +6000,7 @@ void CURVE_OT_delete(wmOperatorType *ot)
static int shade_smooth_exec(bContext *C, wmOperator *op) static int shade_smooth_exec(bContext *C, wmOperator *op)
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
int clear= (strcmp(op->idname, "CURVE_OT_shade_flat") == 0); int clear= (strcmp(op->idname, "CURVE_OT_shade_flat") == 0);
@ -6196,7 +6172,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
{ {
static int xzproj= 0; /* this function calls itself... */ static int xzproj= 0; /* this function calls itself... */
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
View3D *v3d= CTX_wm_view3d(C); View3D *v3d= CTX_wm_view3d(C);
RegionView3D *rv3d= ED_view3d_context_rv3d(C); RegionView3D *rv3d= ED_view3d_context_rv3d(C);
Nurb *nu = NULL; Nurb *nu = NULL;
@ -6612,7 +6588,7 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
ED_object_new_primitive_matrix(C, obedit, loc, rot, mat); ED_object_new_primitive_matrix(C, obedit, loc, rot, mat);
nu= add_nurbs_primitive(C, mat, type, newob); nu= add_nurbs_primitive(C, mat, type, newob);
editnurb= curve_get_editcurve(obedit); editnurb= object_editcurve_get(obedit);
BLI_addtail(editnurb, nu); BLI_addtail(editnurb, nu);
/* userdef */ /* userdef */
@ -6895,7 +6871,7 @@ static int clear_tilt_exec(bContext *C, wmOperator *UNUSED(op))
{ {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data; Curve *cu= obedit->data;
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
BezTriple *bezt; BezTriple *bezt;
BPoint *bp; BPoint *bp;
@ -6965,7 +6941,7 @@ static void undoCurve_to_editCurve(void *ucu, void *obe)
Curve *cu= (Curve*)obedit->data; Curve *cu= (Curve*)obedit->data;
UndoCurve *undoCurve= ucu; UndoCurve *undoCurve= ucu;
ListBase *undobase= &undoCurve->nubase; ListBase *undobase= &undoCurve->nubase;
ListBase *editbase= ED_curve_editnurbs(cu); ListBase *editbase= curve_editnurbs(cu);
Nurb *nu, *newnu; Nurb *nu, *newnu;
EditNurb *editnurb= cu->editnurb; EditNurb *editnurb= cu->editnurb;
void *lastsel= NULL; void *lastsel= NULL;
@ -6974,7 +6950,7 @@ static void undoCurve_to_editCurve(void *ucu, void *obe)
freeNurblist(editbase); freeNurblist(editbase);
if (undoCurve->undoIndex) { if (undoCurve->undoIndex) {
BLI_ghash_free(editnurb->keyindex, NULL, (GHashValFreeFP)free_cvKeyIndex); BLI_ghash_free(editnurb->keyindex, NULL, (GHashValFreeFP)MEM_freeN);
editnurb->keyindex= dupli_keyIndexHash(undoCurve->undoIndex); editnurb->keyindex= dupli_keyIndexHash(undoCurve->undoIndex);
} }
@ -7013,7 +6989,7 @@ static void *editCurve_to_undoCurve(void *obe)
{ {
Object *obedit= obe; Object *obedit= obe;
Curve *cu= (Curve*)obedit->data; Curve *cu= (Curve*)obedit->data;
ListBase *nubase= ED_curve_editnurbs(cu); ListBase *nubase= curve_editnurbs(cu);
UndoCurve *undoCurve; UndoCurve *undoCurve;
EditNurb *editnurb= cu->editnurb, tmpEditnurb; EditNurb *editnurb= cu->editnurb, tmpEditnurb;
Nurb *nu, *newnu; Nurb *nu, *newnu;
@ -7062,7 +7038,7 @@ static void free_undoCurve(void *ucv)
freeNurblist(&undoCurve->nubase); freeNurblist(&undoCurve->nubase);
if(undoCurve->undoIndex) if(undoCurve->undoIndex)
BLI_ghash_free(undoCurve->undoIndex, NULL, (GHashValFreeFP)free_cvKeyIndex); BLI_ghash_free(undoCurve->undoIndex, NULL, (GHashValFreeFP)MEM_freeN);
free_fcurves(&undoCurve->fcurves); free_fcurves(&undoCurve->fcurves);
free_fcurves(&undoCurve->drivers); free_fcurves(&undoCurve->drivers);
@ -7082,15 +7058,6 @@ void undo_push_curve(bContext *C, const char *name)
undo_editmode_push(C, name, get_data, free_undoCurve, undoCurve_to_editCurve, editCurve_to_undoCurve, NULL); undo_editmode_push(C, name, get_data, free_undoCurve, undoCurve_to_editCurve, editCurve_to_undoCurve, NULL);
} }
/* Get list of nurbs from editnurbs structure */
ListBase *ED_curve_editnurbs(Curve *cu)
{
if (cu->editnurb) {
return &cu->editnurb->nurbs;
}
return NULL;
}
void ED_curve_beztcpy(EditNurb *editnurb, BezTriple *dst, BezTriple *src, int count) void ED_curve_beztcpy(EditNurb *editnurb, BezTriple *dst, BezTriple *src, int count)
{ {
memcpy(dst, src, count*sizeof(BezTriple)); memcpy(dst, src, count*sizeof(BezTriple));

@ -58,7 +58,7 @@ void CU_select_swap(struct Object *obedit);
void undo_push_curve (struct bContext *C, const char *name); void undo_push_curve (struct bContext *C, const char *name);
ListBase *curve_get_editcurve(struct Object *ob); ListBase *object_editcurve_get(struct Object *ob);
void load_editNurb (struct Object *obedit); void load_editNurb (struct Object *obedit);
void make_editNurb (struct Object *obedit); void make_editNurb (struct Object *obedit);

@ -44,7 +44,6 @@ void ED_operatortypes_sculpt(void);
void sculpt_get_redraw_planes(float planes[4][4], struct ARegion *ar, void sculpt_get_redraw_planes(float planes[4][4], struct ARegion *ar,
struct RegionView3D *rv3d, struct Object *ob); struct RegionView3D *rv3d, struct Object *ob);
void ED_sculpt_force_update(struct bContext *C); void ED_sculpt_force_update(struct bContext *C);
void ED_sculpt_modifiers_changed(struct Object *ob);
/* paint_ops.c */ /* paint_ops.c */
void ED_operatortypes_paint(void); void ED_operatortypes_paint(void);

@ -400,7 +400,7 @@ static Object *effector_add_type(bContext *C, wmOperator *op, int type)
((Curve*)ob->data)->flag |= CU_PATH|CU_3D; ((Curve*)ob->data)->flag |= CU_PATH|CU_3D;
ED_object_enter_editmode(C, 0); ED_object_enter_editmode(C, 0);
ED_object_new_primitive_matrix(C, ob, loc, rot, mat); ED_object_new_primitive_matrix(C, ob, loc, rot, mat);
BLI_addtail(curve_get_editcurve(ob), add_nurbs_primitive(C, mat, CU_NURBS|CU_PRIM_PATH, 1)); BLI_addtail(object_editcurve_get(ob), add_nurbs_primitive(C, mat, CU_NURBS|CU_PRIM_PATH, 1));
if(!enter_editmode) if(!enter_editmode)
ED_object_exit_editmode(C, EM_FREEDATA); ED_object_exit_editmode(C, EM_FREEDATA);

@ -217,7 +217,7 @@ static void select_editlattice_hook(Object *obedit, HookModifierData *hmd)
static int return_editcurve_indexar(Object *obedit, int *tot, int **indexar, float *cent) static int return_editcurve_indexar(Object *obedit, int *tot, int **indexar, float *cent)
{ {
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
BPoint *bp; BPoint *bp;
BezTriple *bezt; BezTriple *bezt;
@ -329,7 +329,7 @@ static int object_hook_index_array(Object *obedit, int *tot, int **indexar, char
static void select_editcurve_hook(Object *obedit, HookModifierData *hmd) static void select_editcurve_hook(Object *obedit, HookModifierData *hmd)
{ {
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
Nurb *nu; Nurb *nu;
BPoint *bp; BPoint *bp;
BezTriple *bezt; BezTriple *bezt;

@ -140,7 +140,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
BKE_mesh_end_editmesh(me, em); BKE_mesh_end_editmesh(me, em);
} }
else if(ELEM(obedit->type, OB_SURF, OB_CURVE)) { else if(ELEM(obedit->type, OB_SURF, OB_CURVE)) {
ListBase *editnurb= curve_get_editcurve(obedit); ListBase *editnurb= object_editcurve_get(obedit);
cu= obedit->data; cu= obedit->data;

@ -52,6 +52,7 @@
#include "BKE_animsys.h" #include "BKE_animsys.h"
#include "BKE_context.h" #include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_depsgraph.h" #include "BKE_depsgraph.h"
#include "BKE_font.h" #include "BKE_font.h"
#include "BKE_global.h" #include "BKE_global.h"
@ -176,7 +177,7 @@ static int material_slot_assign_exec(bContext *C, wmOperator *UNUSED(op))
} }
else if(ELEM(ob->type, OB_CURVE, OB_SURF)) { else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
Nurb *nu; Nurb *nu;
ListBase *nurbs= ED_curve_editnurbs((Curve*)ob->data); ListBase *nurbs= curve_editnurbs((Curve*)ob->data);
if(nurbs) { if(nurbs) {
for(nu= nurbs->first; nu; nu= nu->next) for(nu= nurbs->first; nu; nu= nu->next)
@ -234,7 +235,7 @@ static int material_slot_de_select(bContext *C, int select)
} }
} }
else if ELEM(ob->type, OB_CURVE, OB_SURF) { else if ELEM(ob->type, OB_CURVE, OB_SURF) {
ListBase *nurbs= ED_curve_editnurbs((Curve*)ob->data); ListBase *nurbs= curve_editnurbs((Curve*)ob->data);
Nurb *nu; Nurb *nu;
BPoint *bp; BPoint *bp;
BezTriple *bezt; BezTriple *bezt;

@ -102,33 +102,6 @@ void ED_sculpt_force_update(bContext *C)
multires_force_update(ob); multires_force_update(ob);
} }
void ED_sculpt_modifiers_changed(Object *ob)
{
SculptSession *ss= ob->sculpt;
if(!ss->cache) {
/* we free pbvh on changes, except during sculpt since it can't deal with
changing PVBH node organization, we hope topology does not change in
the meantime .. weak */
if(ss->pbvh) {
BLI_pbvh_free(ss->pbvh);
ss->pbvh= NULL;
}
sculpt_free_deformMats(ob->sculpt);
} else {
PBVHNode **nodes;
int n, totnode;
BLI_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode);
for(n = 0; n < totnode; n++)
BLI_pbvh_node_mark_update(nodes[n]);
MEM_freeN(nodes);
}
}
/* Sculpt mode handles multires differently from regular meshes, but only if /* Sculpt mode handles multires differently from regular meshes, but only if
it's the last modifier on the stack and it is not on the first level */ it's the last modifier on the stack and it is not on the first level */
struct MultiresModifierData *sculpt_multires_active(Scene *scene, Object *ob) struct MultiresModifierData *sculpt_multires_active(Scene *scene, Object *ob)
@ -2694,17 +2667,6 @@ static void sculpt_update_tex(Sculpt *sd, SculptSession *ss)
} }
} }
void sculpt_free_deformMats(SculptSession *ss)
{
if(ss->orig_cos) MEM_freeN(ss->orig_cos);
if(ss->deform_cos) MEM_freeN(ss->deform_cos);
if(ss->deform_imats) MEM_freeN(ss->deform_imats);
ss->orig_cos = NULL;
ss->deform_cos = NULL;
ss->deform_imats = NULL;
}
void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob, int need_fmap) void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob, int need_fmap)
{ {
DerivedMesh *dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH); DerivedMesh *dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
@ -2741,7 +2703,7 @@ void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob, int need_
if(!ss->orig_cos) { if(!ss->orig_cos) {
int a; int a;
sculpt_free_deformMats(ss); free_sculptsession_deformMats(ss);
if(ss->kb) ss->orig_cos = key_to_vertcos(ob, ss->kb); if(ss->kb) ss->orig_cos = key_to_vertcos(ob, ss->kb);
else ss->orig_cos = mesh_getVertexCos(ob->data, NULL); else ss->orig_cos = mesh_getVertexCos(ob->data, NULL);
@ -2752,7 +2714,7 @@ void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob, int need_
for(a = 0; a < ((Mesh*)ob->data)->totvert; ++a) for(a = 0; a < ((Mesh*)ob->data)->totvert; ++a)
invert_m3(ss->deform_imats[a]); invert_m3(ss->deform_imats[a]);
} }
} else sculpt_free_deformMats(ss); } else free_sculptsession_deformMats(ss);
/* if pbvh is deformed, key block is already applied to it */ /* if pbvh is deformed, key block is already applied to it */
if (ss->kb && !BLI_pbvh_isDeformed(ss->pbvh)) { if (ss->kb && !BLI_pbvh_isDeformed(ss->pbvh)) {

@ -67,7 +67,7 @@ int sculpt_poll(struct bContext *C);
void sculpt_update_mesh_elements(struct Scene *scene, struct Sculpt *sd, struct Object *ob, int need_fmap); void sculpt_update_mesh_elements(struct Scene *scene, struct Sculpt *sd, struct Object *ob, int need_fmap);
/* Deformed mesh sculpt */ /* Deformed mesh sculpt */
void sculpt_free_deformMats(struct SculptSession *ss); void free_sculptsession_deformMats(struct SculptSession *ss);
/* Stroke */ /* Stroke */
struct SculptStroke *sculpt_stroke_new(const int max); struct SculptStroke *sculpt_stroke_new(const int max);

@ -199,7 +199,7 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
Mesh *me= ob->data; Mesh *me= ob->data;
mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL); mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL);
sculpt_free_deformMats(ss); free_sculptsession_deformMats(ss);
tag_update|= 1; tag_update|= 1;
} }

@ -42,6 +42,7 @@
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BKE_anim.h" #include "BKE_anim.h"
#include "BKE_curve.h"
#include "BKE_displist.h" #include "BKE_displist.h"
#include "BKE_DerivedMesh.h" #include "BKE_DerivedMesh.h"
#include "BKE_key.h" #include "BKE_key.h"
@ -51,7 +52,6 @@
#include "ED_info.h" #include "ED_info.h"
#include "ED_armature.h" #include "ED_armature.h"
#include "ED_mesh.h" #include "ED_mesh.h"
#include "ED_curve.h" /* for ED_curve_editnurbs */
#include "BLI_editVert.h" #include "BLI_editVert.h"
@ -193,7 +193,7 @@ static void stats_object_edit(Object *obedit, SceneStats *stats)
BezTriple *bezt; BezTriple *bezt;
BPoint *bp; BPoint *bp;
int a; int a;
ListBase *nurbs= ED_curve_editnurbs(cu); ListBase *nurbs= curve_editnurbs(cu);
for(nu=nurbs->first; nu; nu=nu->next) { for(nu=nurbs->first; nu; nu=nu->next) {
if(nu->type == CU_BEZIER) { if(nu->type == CU_BEZIER) {

@ -58,6 +58,7 @@
#include "BKE_anim.h" //for the where_on_path function #include "BKE_anim.h" //for the where_on_path function
#include "BKE_constraint.h" // for the get_constraint_target function #include "BKE_constraint.h" // for the get_constraint_target function
#include "BKE_curve.h"
#include "BKE_DerivedMesh.h" #include "BKE_DerivedMesh.h"
#include "BKE_deform.h" #include "BKE_deform.h"
#include "BKE_displist.h" #include "BKE_displist.h"
@ -92,7 +93,7 @@
#include "ED_screen.h" #include "ED_screen.h"
#include "ED_sculpt.h" #include "ED_sculpt.h"
#include "ED_types.h" #include "ED_types.h"
#include "ED_curve.h" /* for ED_curve_editnurbs */ #include "ED_curve.h" /* for curve_editnurbs */
#include "UI_resources.h" #include "UI_resources.h"
@ -1834,7 +1835,7 @@ void nurbs_foreachScreenVert(ViewContext *vc, void (*func)(void *userData, Nurb
short s[2] = {IS_CLIPPED, 0}; short s[2] = {IS_CLIPPED, 0};
Nurb *nu; Nurb *nu;
int i; int i;
ListBase *nurbs= ED_curve_editnurbs(cu); ListBase *nurbs= curve_editnurbs(cu);
ED_view3d_local_clipping(vc->rv3d, vc->obedit->obmat); /* for local clipping lookups */ ED_view3d_local_clipping(vc->rv3d, vc->obedit->obmat); /* for local clipping lookups */
@ -6109,7 +6110,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
cu= ob->data; cu= ob->data;
if(cu->editnurb) { if(cu->editnurb) {
ListBase *nurbs= ED_curve_editnurbs(cu); ListBase *nurbs= curve_editnurbs(cu);
drawnurb(scene, v3d, rv3d, base, nurbs->first, dt); drawnurb(scene, v3d, rv3d, base, nurbs->first, dt);
} }
else if(dt==OB_BOUNDBOX) { else if(dt==OB_BOUNDBOX) {

@ -210,7 +210,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
BPoint *bp; BPoint *bp;
BezTriple *bezt; BezTriple *bezt;
int a; int a;
ListBase *nurbs= ED_curve_editnurbs(cu); ListBase *nurbs= curve_editnurbs(cu);
nu= nurbs->first; nu= nurbs->first;
while(nu) { while(nu) {
@ -457,7 +457,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
BPoint *bp; BPoint *bp;
BezTriple *bezt; BezTriple *bezt;
int a; int a;
ListBase *nurbs= ED_curve_editnurbs(cu); ListBase *nurbs= curve_editnurbs(cu);
nu= nurbs->first; nu= nurbs->first;
while(nu) { while(nu) {

@ -66,7 +66,7 @@
#include "ED_armature.h" #include "ED_armature.h"
#include "ED_mesh.h" #include "ED_mesh.h"
#include "ED_screen.h" #include "ED_screen.h"
#include "ED_curve.h" /* for ED_curve_editnurbs */ #include "ED_curve.h" /* for curve_editnurbs */
#include "view3d_intern.h" #include "view3d_intern.h"
@ -102,7 +102,7 @@ static void special_transvert_update(Object *obedit)
} }
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) { else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
Curve *cu= obedit->data; Curve *cu= obedit->data;
ListBase *nurbs= ED_curve_editnurbs(cu); ListBase *nurbs= curve_editnurbs(cu);
Nurb *nu= nurbs->first; Nurb *nu= nurbs->first;
while(nu) { while(nu) {
@ -312,7 +312,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) { else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) {
Curve *cu= obedit->data; Curve *cu= obedit->data;
int totmalloc= 0; int totmalloc= 0;
ListBase *nurbs= ED_curve_editnurbs(cu); ListBase *nurbs= curve_editnurbs(cu);
for(nu= nurbs->first; nu; nu= nu->next) { for(nu= nurbs->first; nu; nu= nu->next) {
if(nu->type == CU_BEZIER) if(nu->type == CU_BEZIER)

@ -90,7 +90,6 @@
#include "ED_node.h" #include "ED_node.h"
#include "ED_types.h" #include "ED_types.h"
#include "ED_uvedit.h" #include "ED_uvedit.h"
#include "ED_curve.h" /* for ED_curve_editnurbs */
#include "ED_util.h" /* for crazyspace correction */ #include "ED_util.h" /* for crazyspace correction */
#include "UI_view2d.h" #include "UI_view2d.h"
@ -1395,7 +1394,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t)
if(cu->editnurb==NULL) return; if(cu->editnurb==NULL) return;
/* count total of vertices, check identical as in 2nd loop for making transdata! */ /* count total of vertices, check identical as in 2nd loop for making transdata! */
nurbs= ED_curve_editnurbs(cu); nurbs= curve_editnurbs(cu);
for(nu= nurbs->first; nu; nu= nu->next) { for(nu= nurbs->first; nu; nu= nu->next) {
if(nu->type == CU_BEZIER) { if(nu->type == CU_BEZIER) {
for(a=0, bezt= nu->bezt; a<nu->pntsu; a++, bezt++) { for(a=0, bezt= nu->bezt; a<nu->pntsu; a++, bezt++) {

@ -84,7 +84,7 @@
#include "ED_space_api.h" #include "ED_space_api.h"
#include "ED_uvedit.h" #include "ED_uvedit.h"
#include "ED_view3d.h" #include "ED_view3d.h"
#include "ED_curve.h" /* for ED_curve_editnurbs */ #include "ED_curve.h" /* for curve_editnurbs */
//#include "BDR_unwrapper.h" //#include "BDR_unwrapper.h"
@ -626,7 +626,7 @@ static void recalcData_view3d(TransInfo *t)
if (t->obedit) { if (t->obedit) {
if ELEM(t->obedit->type, OB_CURVE, OB_SURF) { if ELEM(t->obedit->type, OB_CURVE, OB_SURF) {
Curve *cu= t->obedit->data; Curve *cu= t->obedit->data;
ListBase *nurbs= ED_curve_editnurbs(cu); ListBase *nurbs= curve_editnurbs(cu);
Nurb *nu= nurbs->first; Nurb *nu= nurbs->first;
if(t->state != TRANS_CANCEL) { if(t->state != TRANS_CANCEL) {

@ -57,6 +57,7 @@
#include "BKE_action.h" #include "BKE_action.h"
#include "BKE_context.h" #include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_global.h" #include "BKE_global.h"
#include "BKE_mesh.h" #include "BKE_mesh.h"
#include "BKE_particle.h" #include "BKE_particle.h"
@ -75,7 +76,6 @@
#include "ED_mesh.h" #include "ED_mesh.h"
#include "ED_particle.h" #include "ED_particle.h"
#include "ED_view3d.h" #include "ED_view3d.h"
#include "ED_curve.h" /* for ED_curve_editnurbs */
#include "UI_resources.h" #include "UI_resources.h"
@ -395,7 +395,7 @@ int calc_manipulator_stats(const bContext *C)
Nurb *nu; Nurb *nu;
BezTriple *bezt; BezTriple *bezt;
BPoint *bp; BPoint *bp;
ListBase *nurbs= ED_curve_editnurbs(cu); ListBase *nurbs= curve_editnurbs(cu);
nu= nurbs->first; nu= nurbs->first;
while(nu) { while(nu) {

@ -41,6 +41,7 @@
#include "BKE_armature.h" #include "BKE_armature.h"
#include "BKE_curve.h"
#include "BKE_context.h" #include "BKE_context.h"
#include "BKE_report.h" #include "BKE_report.h"
@ -56,8 +57,6 @@
#include "ED_armature.h" #include "ED_armature.h"
#include "ED_mesh.h" #include "ED_mesh.h"
#include "ED_curve.h" /* for ED_curve_editnurbs */
#include "RNA_define.h" #include "RNA_define.h"
@ -721,7 +720,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
Nurb *nu; Nurb *nu;
BezTriple *bezt; BezTriple *bezt;
int a; int a;
ListBase *nurbs= ED_curve_editnurbs(cu); ListBase *nurbs= curve_editnurbs(cu);
for (nu = nurbs->first; nu; nu = nu->next) for (nu = nurbs->first; nu; nu = nu->next)
{ {

@ -81,6 +81,7 @@ struct SculptSession;
struct ShadeInput; struct ShadeInput;
struct ShadeResult; struct ShadeResult;
struct SpaceImage; struct SpaceImage;
struct SpaceNode;
struct Tex; struct Tex;
struct TexResult; struct TexResult;
struct Text; struct Text;
@ -105,7 +106,6 @@ struct bConstraintOb;
struct Context; struct Context;
struct ChannelDriver; struct ChannelDriver;
/*new render funcs */ /*new render funcs */
float *RE_RenderLayerGetPass(struct RenderLayer *rl, int passtype) {return (float *) NULL;} float *RE_RenderLayerGetPass(struct RenderLayer *rl, int passtype) {return (float *) NULL;}
float RE_filter_value(int type, float x) {return 0.0f;} float RE_filter_value(int type, float x) {return 0.0f;}
@ -298,8 +298,6 @@ void ED_sequencer_update_view(struct bContext *C, int view){}
float ED_rollBoneToVector(struct EditBone *bone, float new_up_axis[3]){return 0.0f;} float ED_rollBoneToVector(struct EditBone *bone, float new_up_axis[3]){return 0.0f;}
void ED_space_image_size(struct SpaceImage *sima, int *width, int *height){} void ED_space_image_size(struct SpaceImage *sima, int *width, int *height){}
struct ListBase *ED_curve_editnurbs(struct Curve *cu){return NULL;}
void free_curve_editNurb (struct Curve *cu){}
void ED_nurb_set_spline_type(struct Nurb *nu, int type){} void ED_nurb_set_spline_type(struct Nurb *nu, int type){}
void EM_selectmode_set(struct EditMesh *em){} void EM_selectmode_set(struct EditMesh *em){}

@ -712,7 +712,11 @@ add_dependencies(blender makesdna)
get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS) get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS)
set(BLENDER_LINK_LIBS bf_nodes ${BLENDER_LINK_LIBS} bf_windowmanager bf_render) set(BLENDER_LINK_LIBS
${BLENDER_LINK_LIBS}
bf_windowmanager
bf_render
)
if(WITH_MOD_FLUID) if(WITH_MOD_FLUID)
list(APPEND BLENDER_LINK_LIBS bf_intern_elbeem) list(APPEND BLENDER_LINK_LIBS bf_intern_elbeem)
@ -797,8 +801,8 @@ endif()
bf_intern_smoke bf_intern_smoke
extern_minilzo extern_minilzo
extern_lzma extern_lzma
extern_recastnavigation
ge_logic_ketsji ge_logic_ketsji
extern_recastnavigation
ge_phys_common ge_phys_common
ge_logic ge_logic
ge_rasterizer ge_rasterizer
@ -806,7 +810,6 @@ endif()
ge_logic_expressions ge_logic_expressions
ge_scenegraph ge_scenegraph
ge_logic_network ge_logic_network
bf_python # duplicate for BPY_driver_exec
ge_logic_ngnetwork ge_logic_ngnetwork
extern_bullet extern_bullet
ge_logic_loopbacknetwork ge_logic_loopbacknetwork
@ -819,8 +822,6 @@ endif()
bf_blenfont bf_blenfont
bf_intern_audaspace bf_intern_audaspace
bf_intern_mikktspace bf_intern_mikktspace
extern_recastnavigation
bf_editor_util # --- BAD LEVEL CALL HERE --- XXX, this should be removed before release!
) )
if(WITH_MOD_CLOTH_ELTOPO) if(WITH_MOD_CLOTH_ELTOPO)