forked from bartvdbraak/blender
Merged changes in the trunk up to revision 48695.
This commit is contained in:
commit
b7b5029814
@ -148,7 +148,7 @@ mark_as_advanced(WITH_AUDASPACE)
|
||||
|
||||
|
||||
# (unix defaults to OpenMP On)
|
||||
if(UNIX AND NOT APPLE)
|
||||
if((UNIX AND NOT APPLE) OR (MINGW))
|
||||
set(PLATFORM_DEFAULT ON)
|
||||
else()
|
||||
set(PLATFORM_DEFAULT OFF)
|
||||
@ -990,9 +990,11 @@ elseif(WIN32)
|
||||
set(BOOST ${LIBDIR}/boost)
|
||||
set(BOOST_INCLUDE_DIR ${BOOST}/include)
|
||||
if(MSVC10)
|
||||
set(BOOST_POSTFIX "vc100-mt-s-1_47.lib")
|
||||
set(BOOST_DEBUG_POSTFIX "vc100-mt-sgd-1_47.lib")
|
||||
set(BOOST_LIBPATH ${BOOST}/lib/vc_10)
|
||||
set(BOOST_POSTFIX "vc100-mt-s-1_49.lib")
|
||||
set(BOOST_DEBUG_POSTFIX "vc100-mt-sgd-1_49.lib")
|
||||
else()
|
||||
set(BOOST_LIBPATH ${BOOST}/lib)
|
||||
set(BOOST_POSTFIX "vc90-mt-s-1_49.lib")
|
||||
set(BOOST_DEBUG_POSTFIX "vc90-mt-sgd-1_49.lib")
|
||||
endif()
|
||||
@ -1001,11 +1003,6 @@ elseif(WIN32)
|
||||
optimized libboost_regex-${BOOST_POSTFIX} optimized libboost_system-${BOOST_POSTFIX} optimized libboost_thread-${BOOST_POSTFIX}
|
||||
debug libboost_date_time-${BOOST_DEBUG_POSTFIX} debug libboost_filesystem-${BOOST_DEBUG_POSTFIX}
|
||||
debug libboost_regex-${BOOST_DEBUG_POSTFIX} debug libboost_system-${BOOST_DEBUG_POSTFIX} debug libboost_thread-${BOOST_DEBUG_POSTFIX})
|
||||
if(MSVC10)
|
||||
set(BOOST_LIBPATH ${BOOST}/lib/vc_10)
|
||||
else()
|
||||
set(BOOST_LIBPATH ${BOOST}/lib)
|
||||
endif()
|
||||
set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
|
||||
endif()
|
||||
|
||||
|
@ -162,21 +162,21 @@ help:
|
||||
@echo " * package_pacman - build an arch linux pacmanpackage"
|
||||
@echo " * package_archive - build an archive package"
|
||||
@echo ""
|
||||
@echo "Testing Targets (not assosiated with building blender)"
|
||||
@echo "Testing Targets (not associated with building blender)"
|
||||
@echo " * test - run ctest, currently tests import/export, operator execution and that python modules load"
|
||||
@echo " * test_cmake - runs our own cmake file checker which detects errors in the cmake file list definitions"
|
||||
@echo " * test_pep8 - checks all python script are pep8 which are tagged to use the stricter formatting"
|
||||
@echo " * test_deprecated - checks for deprecation tags in our code which may need to be removed"
|
||||
@echo " * test_style - checks C/C++ conforms with blenders style guide: http://wiki.blender.org/index.php/Dev:Doc/CodeStyle"
|
||||
@echo ""
|
||||
@echo "Static Source Code Checking (not assosiated with building blender)"
|
||||
@echo "Static Source Code Checking (not associated with building blender)"
|
||||
@echo " * check_cppcheck - run blender source through cppcheck (C & C++)"
|
||||
@echo " * check_splint - run blenders source through splint (C only)"
|
||||
@echo " * check_sparse - run blenders source through sparse (C only)"
|
||||
@echo " * check_spelling_c - check for spelling errors (C/C++ only)"
|
||||
@echo " * check_spelling_py - check for spelling errors (Python only)"
|
||||
@echo ""
|
||||
@echo "Documentation Targets (not assosiated with building blender)"
|
||||
@echo "Documentation Targets (not associated with building blender)"
|
||||
@echo " * doc_py - generate sphinx python api docs"
|
||||
@echo " * doc_doxy - generate doxygen C/C++ docs"
|
||||
@echo " * doc_dna - generate blender file format reference"
|
||||
|
@ -769,8 +769,13 @@ if env['OURPLATFORM'] == 'win64-mingw':
|
||||
if env['WITH_BF_SDL']:
|
||||
dllsources.append('${LCGDIR}/sdl/lib/SDL.dll')
|
||||
|
||||
if(env['WITH_BF_OPENMP']):
|
||||
dllsources.append('${LCGDIR}/binaries/libgomp-1.dll')
|
||||
|
||||
dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb64.dll')
|
||||
dllsources.append('${LCGDIR}/binaries/pthreadGC2-w64.dll')
|
||||
dllsources.append('${LCGDIR}/binaries/libgcc_s_sjlj-1.dll')
|
||||
dllsources.append('${LCGDIR}/binaries/libwinpthread-1.dll')
|
||||
dllsources.append('${LCGDIR}/binaries/libstdc++-6.dll')
|
||||
dllsources.append('#source/icons/blender.exe.manifest')
|
||||
|
||||
windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
|
||||
|
@ -169,8 +169,8 @@ BF_BOOST_LIBPATH = BF_BOOST + '/lib'
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2']
|
||||
|
||||
#Produces errors while rendering with subsurf/multires,
|
||||
WITH_BF_OPENMP = False
|
||||
#May produce errors with unsupported MinGW-w64 builds
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
##
|
||||
CC = 'gcc'
|
||||
|
@ -37,7 +37,7 @@
|
||||
Much of the actual functionality can be found in the python scripts
|
||||
in the directory $BLENDERHOME/tools, with Blender.py defining the
|
||||
bulk of the functionality. btools.py has some helper functions, and
|
||||
bcolors.py is for the terminal colours. mstoolkit.py and crossmingw.py
|
||||
bcolors.py is for the terminal colors. mstoolkit.py and crossmingw.py
|
||||
are modules which set up SCons for the MS VC++ 2003 toolkit and
|
||||
the cross-compile toolset for compiling Windows binaries on Linux
|
||||
respectively. Note: the cross-compile doesn't work yet for Blender,
|
||||
|
@ -48,7 +48,7 @@
|
||||
% python ./scons/scons.py
|
||||
|
||||
This will start the build process with default values. Depending
|
||||
on your platform you may see colour in your output (non-Windows
|
||||
on your platform you may see color in your output (non-Windows
|
||||
machines). In the the beginning an overview of targets and arguments
|
||||
from the command-line is given, then all libraries and binaries to
|
||||
build are configured.
|
||||
@ -123,11 +123,11 @@
|
||||
|
||||
This rewrite features a cleaner output during the build process. If
|
||||
you need to see the full command-line for compiles, then you can
|
||||
change that behaviour. Also the use of colours can be changed:
|
||||
change that behaviour. Also the use of colors can be changed:
|
||||
|
||||
% python scons\scons.py BF_FANCY=0
|
||||
|
||||
This will disable the use of colours.
|
||||
This will disable the use of colors.
|
||||
|
||||
% python scons\scons.py BF_QUIET=0
|
||||
|
||||
|
@ -173,7 +173,7 @@ drawtype:
|
||||
UI_EMBOSSN 2 /* Button with no border */
|
||||
UI_EMBOSSF 3 /* Square embossed button (file select) */
|
||||
UI_EMBOSSM 4 /* Colored, for pulldown menus */
|
||||
UI_EMBOSSP 5 /* Simple borderless coloured button (like blender sensors) */
|
||||
UI_EMBOSSP 5 /* Simple borderless colored button (like blender sensors) */
|
||||
|
||||
font:
|
||||
UI_HELV 0 /* normal font */
|
||||
|
@ -94,11 +94,11 @@ Functions
|
||||
If filename starts with // the image will be saved relative to the current directory.
|
||||
If the filename contains # it will be replaced with the frame number.
|
||||
|
||||
The standalone player saves .png files. It does not support colour space conversion
|
||||
The standalone player saves .png files. It does not support color space conversion
|
||||
or gamma correction.
|
||||
|
||||
When run from Blender, makeScreenshot supports Iris, IrisZ, TGA, Raw TGA, PNG, HamX, and Jpeg.
|
||||
Gamma, Colourspace conversion and Jpeg compression are taken from the Render settings panels.
|
||||
Gamma, Colorspace conversion and Jpeg compression are taken from the Render settings panels.
|
||||
|
||||
:type filename: string
|
||||
|
||||
@ -125,14 +125,14 @@ Functions
|
||||
|
||||
.. function:: setBackgroundColor(rgba)
|
||||
|
||||
Sets the window background colour.
|
||||
Sets the window background color.
|
||||
|
||||
:type rgba: list [r, g, b, a]
|
||||
|
||||
|
||||
.. function:: setMistColor(rgb)
|
||||
|
||||
Sets the mist colour.
|
||||
Sets the mist color.
|
||||
|
||||
:type rgb: list [r, g, b]
|
||||
|
||||
@ -153,8 +153,8 @@ Functions
|
||||
|
||||
.. function:: setMistEnd(end)
|
||||
|
||||
Sets the mist end value. Objects further away from this will be coloured solid with
|
||||
the colour set by setMistColor().
|
||||
Sets the mist end value. Objects further away from this will be colored solid with
|
||||
the color set by setMistColor().
|
||||
|
||||
:type end: float
|
||||
|
||||
|
@ -1683,7 +1683,7 @@ Game Types (bge.types)
|
||||
light = co.owner
|
||||
|
||||
light.energy = 1.0
|
||||
light.colour = [1.0, 0.0, 0.0]
|
||||
light.color = [1.0, 0.0, 0.0]
|
||||
|
||||
.. data:: SPOT
|
||||
|
||||
@ -1719,15 +1719,15 @@ Game Types (bge.types)
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: colour
|
||||
.. attribute:: color
|
||||
|
||||
The colour of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
|
||||
The color of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
|
||||
|
||||
:type: list [r, g, b]
|
||||
|
||||
.. attribute:: color
|
||||
.. attribute:: colour
|
||||
|
||||
Synonym for colour.
|
||||
Synonym for color.
|
||||
|
||||
.. attribute:: lin_attenuation
|
||||
|
||||
@ -1782,7 +1782,7 @@ Game Types (bge.types)
|
||||
#. They are at the same position
|
||||
#. UV coordinates are the same
|
||||
#. Their normals are the same (both polygons are "Set Smooth")
|
||||
#. They are the same colour, for example: a cube has 24 vertices: 6 faces with 4 vertices per face.
|
||||
#. They are the same color, for example: a cube has 24 vertices: 6 faces with 4 vertices per face.
|
||||
|
||||
The correct method of iterating over every :class:`KX_VertexProxy` in a game object
|
||||
|
||||
@ -1798,8 +1798,8 @@ Game Types (bge.types)
|
||||
for v_index in range(mesh.getVertexArrayLength(m_index)):
|
||||
vertex = mesh.getVertex(m_index, v_index)
|
||||
# Do something with vertex here...
|
||||
# ... eg: colour the vertex red.
|
||||
vertex.colour = [1.0, 0.0, 0.0, 1.0]
|
||||
# ... eg: color the vertex red.
|
||||
vertex.color = [1.0, 0.0, 0.0, 1.0]
|
||||
|
||||
.. attribute:: materials
|
||||
|
||||
@ -2538,13 +2538,13 @@ Game Types (bge.types)
|
||||
|
||||
.. attribute:: diffuse
|
||||
|
||||
The diffuse colour of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0].
|
||||
The diffuse color of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0].
|
||||
|
||||
:type: list [r, g, b]
|
||||
|
||||
.. attribute:: specular
|
||||
|
||||
The specular colour of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0].
|
||||
The specular color of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0].
|
||||
|
||||
:type: list [r, g, b]
|
||||
|
||||
@ -3381,7 +3381,7 @@ Game Types (bge.types)
|
||||
|
||||
.. class:: KX_VertexProxy(SCA_IObject)
|
||||
|
||||
A vertex holds position, UV, colour and normal information.
|
||||
A vertex holds position, UV, color and normal information.
|
||||
|
||||
Note:
|
||||
The physics simulation is NOT currently updated - physics will not respond
|
||||
@ -3405,17 +3405,17 @@ Game Types (bge.types)
|
||||
|
||||
:type: list [nx, ny, nz]
|
||||
|
||||
.. attribute:: colour
|
||||
.. attribute:: color
|
||||
|
||||
The colour of the vertex.
|
||||
The color of the vertex.
|
||||
|
||||
:type: list [r, g, b, a]
|
||||
|
||||
Black = [0.0, 0.0, 0.0, 1.0], White = [1.0, 1.0, 1.0, 1.0]
|
||||
|
||||
.. attribute:: color
|
||||
.. attribute:: colour
|
||||
|
||||
Synonym for colour.
|
||||
Synonym for color.
|
||||
|
||||
.. attribute:: x
|
||||
|
||||
@ -3461,25 +3461,25 @@ Game Types (bge.types)
|
||||
|
||||
.. attribute:: r
|
||||
|
||||
The red component of the vertex colour. 0.0 <= r <= 1.0.
|
||||
The red component of the vertex color. 0.0 <= r <= 1.0.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: g
|
||||
|
||||
The green component of the vertex colour. 0.0 <= g <= 1.0.
|
||||
The green component of the vertex color. 0.0 <= g <= 1.0.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: b
|
||||
|
||||
The blue component of the vertex colour. 0.0 <= b <= 1.0.
|
||||
The blue component of the vertex color. 0.0 <= b <= 1.0.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: a
|
||||
|
||||
The alpha component of the vertex colour. 0.0 <= a <= 1.0.
|
||||
The alpha component of the vertex color. 0.0 <= a <= 1.0.
|
||||
|
||||
:type: float
|
||||
|
||||
@ -3529,15 +3529,15 @@ Game Types (bge.types)
|
||||
|
||||
.. method:: getRGBA()
|
||||
|
||||
Gets the colour of this vertex.
|
||||
Gets the color of this vertex.
|
||||
|
||||
The colour is represented as four bytes packed into an integer value. The colour is
|
||||
The color is represented as four bytes packed into an integer value. The color is
|
||||
packed as RGBA.
|
||||
|
||||
Since Python offers no way to get each byte without shifting, you must use the struct module to
|
||||
access colour in an machine independent way.
|
||||
access color in an machine independent way.
|
||||
|
||||
Because of this, it is suggested you use the r, g, b and a attributes or the colour attribute instead.
|
||||
Because of this, it is suggested you use the r, g, b and a attributes or the color attribute instead.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@ -3547,17 +3547,17 @@ Game Types (bge.types)
|
||||
# black = ( 0, 0, 0, 255)
|
||||
# white = (255, 255, 255, 255)
|
||||
|
||||
:return: packed colour. 4 byte integer with one byte per colour channel in RGBA format.
|
||||
:return: packed color. 4 byte integer with one byte per color channel in RGBA format.
|
||||
:rtype: integer
|
||||
|
||||
.. method:: setRGBA(col)
|
||||
|
||||
Sets the colour of this vertex.
|
||||
Sets the color of this vertex.
|
||||
|
||||
See getRGBA() for the format of col, and its relevant problems. Use the r, g, b and a attributes
|
||||
or the colour attribute instead.
|
||||
or the color attribute instead.
|
||||
|
||||
setRGBA() also accepts a four component list as argument col. The list represents the colour as [r, g, b, a]
|
||||
setRGBA() also accepts a four component list as argument col. The list represents the color as [r, g, b, a]
|
||||
with black = [0.0, 0.0, 0.0, 1.0] and white = [1.0, 1.0, 1.0, 1.0]
|
||||
|
||||
.. code-block:: python
|
||||
@ -3567,14 +3567,14 @@ Game Types (bge.types)
|
||||
v.setRGBA([1.0, 0.0, 0.0, 1.0]) # Red
|
||||
v.setRGBA([0.0, 1.0, 0.0, 1.0]) # Green on all platforms.
|
||||
|
||||
:arg col: the new colour of this vertex in packed RGBA format.
|
||||
:arg col: the new color of this vertex in packed RGBA format.
|
||||
:type col: integer or list [r, g, b, a]
|
||||
|
||||
.. method:: getNormal()
|
||||
|
||||
Gets the normal vector of this vertex.
|
||||
|
||||
:return: normalised normal vector.
|
||||
:return: normalized normal vector.
|
||||
:rtype: list [nx, ny, nz]
|
||||
|
||||
.. method:: setNormal(normal)
|
||||
|
46
extern/carve/include/carve/csg.hpp
vendored
46
extern/carve/include/carve/csg.hpp
vendored
@ -174,34 +174,34 @@ namespace carve {
|
||||
|
||||
void groupIntersections();
|
||||
|
||||
void _generateVertexVertexIntersections(carve::mesh::MeshSet<3>::vertex_t *va,
|
||||
carve::mesh::MeshSet<3>::edge_t *eb);
|
||||
void generateVertexVertexIntersections(carve::mesh::MeshSet<3>::face_t *a,
|
||||
const std::vector<carve::mesh::MeshSet<3>::face_t *> &b);
|
||||
void _generateVertexVertexIntersections(meshset_t::vertex_t *va,
|
||||
meshset_t::edge_t *eb);
|
||||
void generateVertexVertexIntersections(meshset_t::face_t *a,
|
||||
const std::vector<meshset_t::face_t *> &b);
|
||||
|
||||
void _generateVertexEdgeIntersections(carve::mesh::MeshSet<3>::vertex_t *va,
|
||||
carve::mesh::MeshSet<3>::edge_t *eb);
|
||||
void generateVertexEdgeIntersections(carve::mesh::MeshSet<3>::face_t *a,
|
||||
const std::vector<carve::mesh::MeshSet<3>::face_t *> &b);
|
||||
void _generateVertexEdgeIntersections(meshset_t::vertex_t *va,
|
||||
meshset_t::edge_t *eb);
|
||||
void generateVertexEdgeIntersections(meshset_t::face_t *a,
|
||||
const std::vector<meshset_t::face_t *> &b);
|
||||
|
||||
void _generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::edge_t *ea,
|
||||
carve::mesh::MeshSet<3>::edge_t *eb);
|
||||
void generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::face_t *a,
|
||||
const std::vector<carve::mesh::MeshSet<3>::face_t *> &b);
|
||||
void _generateEdgeEdgeIntersections(meshset_t::edge_t *ea,
|
||||
meshset_t::edge_t *eb);
|
||||
void generateEdgeEdgeIntersections(meshset_t::face_t *a,
|
||||
const std::vector<meshset_t::face_t *> &b);
|
||||
|
||||
void _generateVertexFaceIntersections(carve::mesh::MeshSet<3>::face_t *fa,
|
||||
carve::mesh::MeshSet<3>::edge_t *eb);
|
||||
void generateVertexFaceIntersections(carve::mesh::MeshSet<3>::face_t *a,
|
||||
const std::vector<carve::mesh::MeshSet<3>::face_t *> &b);
|
||||
void _generateVertexFaceIntersections(meshset_t::face_t *fa,
|
||||
meshset_t::edge_t *eb);
|
||||
void generateVertexFaceIntersections(meshset_t::face_t *a,
|
||||
const std::vector<meshset_t::face_t *> &b);
|
||||
|
||||
void _generateEdgeFaceIntersections(carve::mesh::MeshSet<3>::face_t *fa,
|
||||
carve::mesh::MeshSet<3>::edge_t *eb);
|
||||
void generateEdgeFaceIntersections(carve::mesh::MeshSet<3>::face_t *a,
|
||||
const std::vector<carve::mesh::MeshSet<3>::face_t *> &b);
|
||||
void _generateEdgeFaceIntersections(meshset_t::face_t *fa,
|
||||
meshset_t::edge_t *eb);
|
||||
void generateEdgeFaceIntersections(meshset_t::face_t *a,
|
||||
const std::vector<meshset_t::face_t *> &b);
|
||||
|
||||
void generateIntersectionCandidates(carve::mesh::MeshSet<3> *a,
|
||||
void generateIntersectionCandidates(meshset_t *a,
|
||||
const face_rtree_t *a_node,
|
||||
carve::mesh::MeshSet<3> *b,
|
||||
meshset_t *b,
|
||||
const face_rtree_t *b_node,
|
||||
face_pairs_t &face_pairs,
|
||||
bool descend_a = true);
|
||||
@ -287,7 +287,7 @@ namespace carve {
|
||||
* @param[out] out_loops A list of grouped face loops.
|
||||
*/
|
||||
void groupFaceLoops(
|
||||
carve::mesh::MeshSet<3> *src,
|
||||
meshset_t *src,
|
||||
FaceLoopList &face_loops,
|
||||
const detail::LoopEdges &loop_edges,
|
||||
const V2Set &no_cross,
|
||||
|
5
extern/carve/include/carve/polyline_decl.hpp
vendored
5
extern/carve/include/carve/polyline_decl.hpp
vendored
@ -138,6 +138,11 @@ namespace carve {
|
||||
PolylineSet(const std::vector<carve::geom3d::Vector> &points);
|
||||
PolylineSet() {
|
||||
}
|
||||
~PolylineSet() {
|
||||
for (line_iter i = lines.begin(); i != lines.end(); ++i) {
|
||||
delete *i;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename iter_t>
|
||||
void addPolyline(bool closed, iter_t begin, iter_t end);
|
||||
|
13
extern/carve/include/carve/rtree.hpp
vendored
13
extern/carve/include/carve/rtree.hpp
vendored
@ -49,8 +49,6 @@ namespace carve {
|
||||
|
||||
aabb_t getAABB() const { return bbox; }
|
||||
|
||||
|
||||
|
||||
struct data_aabb_t {
|
||||
aabb_t bbox;
|
||||
data_t data;
|
||||
@ -164,6 +162,17 @@ namespace carve {
|
||||
_fill(begin, end, typename std::iterator_traits<iter_t>::value_type());
|
||||
}
|
||||
|
||||
~RTreeNode() {
|
||||
if (child) {
|
||||
RTreeNode *next = child;
|
||||
while (next) {
|
||||
RTreeNode *curr = next;
|
||||
next = next->sibling;
|
||||
delete curr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// functor for ordering nodes by increasing aabb midpoint, along a specified axis.
|
||||
|
4
extern/carve/lib/csg_data.hpp
vendored
4
extern/carve/lib/csg_data.hpp
vendored
@ -30,7 +30,7 @@ struct carve::csg::detail::Data {
|
||||
VVMap vmap;
|
||||
|
||||
// map from intersected edge to intersection points.
|
||||
EVSMap emap;
|
||||
EIntMap emap;
|
||||
|
||||
// map from intersected face to intersection points.
|
||||
FVSMap fmap;
|
||||
@ -39,7 +39,7 @@ struct carve::csg::detail::Data {
|
||||
VFSMap fmap_rev;
|
||||
|
||||
// created by divideEdges().
|
||||
// holds, for each edge, a
|
||||
// holds, for each edge, an ordered vector of inserted vertices.
|
||||
EVVMap divided_edges;
|
||||
|
||||
// created by faceSplitEdges.
|
||||
|
30
extern/carve/lib/csg_detail.hpp
vendored
30
extern/carve/lib/csg_detail.hpp
vendored
@ -24,30 +24,32 @@
|
||||
namespace carve {
|
||||
namespace csg {
|
||||
namespace detail {
|
||||
typedef std::map<carve::mesh::MeshSet<3>::vertex_t *,
|
||||
std::set<std::pair<carve::mesh::MeshSet<3>::face_t *, double> > > EdgeIntInfo;
|
||||
|
||||
typedef std::unordered_set<carve::mesh::MeshSet<3>::vertex_t *> VSet;
|
||||
typedef std::unordered_set<carve::mesh::MeshSet<3>::face_t *> FSet;
|
||||
typedef std::unordered_set<carve::mesh::MeshSet<3>::vertex_t *> VSet;
|
||||
typedef std::unordered_set<carve::mesh::MeshSet<3>::face_t *> FSet;
|
||||
|
||||
typedef std::set<carve::mesh::MeshSet<3>::vertex_t *> VSetSmall;
|
||||
typedef std::set<csg::V2> V2SetSmall;
|
||||
typedef std::set<carve::mesh::MeshSet<3>::face_t *> FSetSmall;
|
||||
typedef std::set<carve::mesh::MeshSet<3>::vertex_t *> VSetSmall;
|
||||
typedef std::set<csg::V2> V2SetSmall;
|
||||
typedef std::set<carve::mesh::MeshSet<3>::face_t *> FSetSmall;
|
||||
|
||||
typedef std::unordered_map<carve::mesh::MeshSet<3>::vertex_t *, VSetSmall> VVSMap;
|
||||
typedef std::unordered_map<carve::mesh::MeshSet<3>::edge_t *, VSetSmall> EVSMap;
|
||||
typedef std::unordered_map<carve::mesh::MeshSet<3>::face_t *, VSetSmall> FVSMap;
|
||||
typedef std::unordered_map<carve::mesh::MeshSet<3>::vertex_t *, VSetSmall> VVSMap;
|
||||
typedef std::unordered_map<carve::mesh::MeshSet<3>::edge_t *, EdgeIntInfo> EIntMap;
|
||||
typedef std::unordered_map<carve::mesh::MeshSet<3>::face_t *, VSetSmall> FVSMap;
|
||||
|
||||
typedef std::unordered_map<carve::mesh::MeshSet<3>::vertex_t *, FSetSmall> VFSMap;
|
||||
typedef std::unordered_map<carve::mesh::MeshSet<3>::face_t *, V2SetSmall> FV2SMap;
|
||||
typedef std::unordered_map<carve::mesh::MeshSet<3>::vertex_t *, FSetSmall> VFSMap;
|
||||
typedef std::unordered_map<carve::mesh::MeshSet<3>::face_t *, V2SetSmall> FV2SMap;
|
||||
|
||||
typedef std::unordered_map<
|
||||
carve::mesh::MeshSet<3>::edge_t *,
|
||||
std::vector<carve::mesh::MeshSet<3>::vertex_t *> > EVVMap;
|
||||
typedef std::unordered_map<
|
||||
carve::mesh::MeshSet<3>::edge_t *,
|
||||
std::vector<carve::mesh::MeshSet<3>::vertex_t *> > EVVMap;
|
||||
|
||||
typedef std::unordered_map<carve::mesh::MeshSet<3>::vertex_t *,
|
||||
std::vector<carve::mesh::MeshSet<3>::edge_t *> > VEVecMap;
|
||||
|
||||
|
||||
class LoopEdges : public std::unordered_map<V2, std::list<FaceLoop *> > {
|
||||
class LoopEdges : public std::unordered_map<V2, std::list<FaceLoop *> > {
|
||||
typedef std::unordered_map<V2, std::list<FaceLoop *> > super;
|
||||
|
||||
public:
|
||||
|
291
extern/carve/lib/intersect.cpp
vendored
291
extern/carve/lib/intersect.cpp
vendored
@ -41,6 +41,7 @@
|
||||
#include <carve/timing.hpp>
|
||||
#include <carve/colour.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
|
||||
@ -114,7 +115,7 @@ namespace {
|
||||
ordered_vertices.reserve(std::distance(beg, end));
|
||||
|
||||
for (; beg != end; ++beg) {
|
||||
carve::mesh::MeshSet<3>::vertex_t *v = (*beg);
|
||||
carve::mesh::MeshSet<3>::vertex_t *v = *beg;
|
||||
ordered_vertices.push_back(std::make_pair(carve::geom::dot(v->v - base, dir), v));
|
||||
}
|
||||
|
||||
@ -130,6 +131,37 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
template<typename iter_t>
|
||||
void orderEdgeIntersectionVertices(iter_t beg, const iter_t end,
|
||||
const carve::mesh::MeshSet<3>::vertex_t::vector_t &dir,
|
||||
const carve::mesh::MeshSet<3>::vertex_t::vector_t &base,
|
||||
std::vector<carve::mesh::MeshSet<3>::vertex_t *> &out) {
|
||||
typedef std::vector<std::pair<std::pair<double, double>, carve::mesh::MeshSet<3>::vertex_t *> > DVVector;
|
||||
DVVector ordered_vertices;
|
||||
|
||||
ordered_vertices.reserve(std::distance(beg, end));
|
||||
|
||||
for (; beg != end; ++beg) {
|
||||
carve::mesh::MeshSet<3>::vertex_t *v = (*beg).first;
|
||||
double ovec = 0.0;
|
||||
for (carve::csg::detail::EdgeIntInfo::mapped_type::const_iterator j = (*beg).second.begin(); j != (*beg).second.end(); ++j) {
|
||||
ovec += (*j).second;
|
||||
}
|
||||
ordered_vertices.push_back(std::make_pair(std::make_pair(carve::geom::dot(v->v - base, dir), -ovec), v));
|
||||
}
|
||||
|
||||
std::sort(ordered_vertices.begin(), ordered_vertices.end());
|
||||
|
||||
out.clear();
|
||||
out.reserve(ordered_vertices.size());
|
||||
for (DVVector::const_iterator
|
||||
i = ordered_vertices.begin(), e = ordered_vertices.end();
|
||||
i != e;
|
||||
++i) {
|
||||
out.push_back((*i).second);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@ -346,7 +378,7 @@ bool carve::csg::CSG::Hooks::hasHook(unsigned hook_num) {
|
||||
return hooks[hook_num].size() > 0;
|
||||
}
|
||||
|
||||
void carve::csg::CSG::Hooks::intersectionVertex(const carve::mesh::MeshSet<3>::vertex_t *vertex,
|
||||
void carve::csg::CSG::Hooks::intersectionVertex(const meshset_t::vertex_t *vertex,
|
||||
const IObjPairSet &intersections) {
|
||||
for (std::list<Hook *>::iterator j = hooks[INTERSECTION_VERTEX_HOOK].begin();
|
||||
j != hooks[INTERSECTION_VERTEX_HOOK].end();
|
||||
@ -355,8 +387,8 @@ void carve::csg::CSG::Hooks::intersectionVertex(const carve::mesh::MeshSet<3>::v
|
||||
}
|
||||
}
|
||||
|
||||
void carve::csg::CSG::Hooks::processOutputFace(std::vector<carve::mesh::MeshSet<3>::face_t *> &faces,
|
||||
const carve::mesh::MeshSet<3>::face_t *orig_face,
|
||||
void carve::csg::CSG::Hooks::processOutputFace(std::vector<meshset_t::face_t *> &faces,
|
||||
const meshset_t::face_t *orig_face,
|
||||
bool flipped) {
|
||||
for (std::list<Hook *>::iterator j = hooks[PROCESS_OUTPUT_FACE_HOOK].begin();
|
||||
j != hooks[PROCESS_OUTPUT_FACE_HOOK].end();
|
||||
@ -365,8 +397,8 @@ void carve::csg::CSG::Hooks::processOutputFace(std::vector<carve::mesh::MeshSet<
|
||||
}
|
||||
}
|
||||
|
||||
void carve::csg::CSG::Hooks::resultFace(const carve::mesh::MeshSet<3>::face_t *new_face,
|
||||
const carve::mesh::MeshSet<3>::face_t *orig_face,
|
||||
void carve::csg::CSG::Hooks::resultFace(const meshset_t::face_t *new_face,
|
||||
const meshset_t::face_t *orig_face,
|
||||
bool flipped) {
|
||||
for (std::list<Hook *>::iterator j = hooks[RESULT_FACE_HOOK].begin();
|
||||
j != hooks[RESULT_FACE_HOOK].end();
|
||||
@ -425,7 +457,7 @@ void carve::csg::CSG::makeVertexIntersections() {
|
||||
j != je;
|
||||
++j) {
|
||||
const IObj &i_tgt = ((*j).first);
|
||||
carve::mesh::MeshSet<3>::vertex_t *i_pt = ((*j).second);
|
||||
meshset_t::vertex_t *i_pt = ((*j).second);
|
||||
|
||||
vertex_intersections[i_pt].insert(std::make_pair(i_src, i_tgt));
|
||||
}
|
||||
@ -499,7 +531,7 @@ void carve::csg::CSG::groupIntersections() {
|
||||
|
||||
carve::TimingBlock block(GROUP_INTERSECTONS);
|
||||
|
||||
std::vector<carve::mesh::MeshSet<3>::vertex_t *> vertices;
|
||||
std::vector<meshset_t::vertex_t *> vertices;
|
||||
detail::VVSMap graph;
|
||||
#if defined(CARVE_DEBUG)
|
||||
std::cerr << "groupIntersections()" << ": vertex_intersections.size()==" << vertex_intersections.size() << std::endl;
|
||||
@ -521,7 +553,7 @@ void carve::csg::CSG::groupIntersections() {
|
||||
|
||||
vertex_intersections_octree.addVertices(vertices);
|
||||
|
||||
std::vector<carve::mesh::MeshSet<3>::vertex_t *> out;
|
||||
std::vector<meshset_t::vertex_t *> out;
|
||||
for (size_t i = 0, l = vertices.size(); i != l; ++i) {
|
||||
// let's find all the vertices near this one.
|
||||
out.clear();
|
||||
@ -546,7 +578,7 @@ void carve::csg::CSG::groupIntersections() {
|
||||
open.insert((*i).first);
|
||||
while (open.size()) {
|
||||
detail::VSet::iterator t = open.begin();
|
||||
const carve::mesh::MeshSet<3>::vertex_t *o = (*t);
|
||||
const meshset_t::vertex_t *o = (*t);
|
||||
open.erase(t);
|
||||
i = graph.find(o);
|
||||
CARVE_ASSERT(i != graph.end());
|
||||
@ -568,6 +600,19 @@ void carve::csg::CSG::groupIntersections() {
|
||||
}
|
||||
|
||||
|
||||
static void recordEdgeIntersectionInfo(carve::mesh::MeshSet<3>::vertex_t *intersection,
|
||||
carve::mesh::MeshSet<3>::edge_t *edge,
|
||||
const carve::csg::detail::VFSMap::mapped_type &intersected_faces,
|
||||
carve::csg::detail::Data &data) {
|
||||
carve::mesh::MeshSet<3>::vertex_t::vector_t edge_dir = edge->v2()->v - edge->v1()->v;
|
||||
carve::csg::detail::EdgeIntInfo::mapped_type &eint_info = data.emap[edge][intersection];
|
||||
|
||||
for (carve::csg::detail::VFSMap::mapped_type::const_iterator i = intersected_faces.begin(); i != intersected_faces.end(); ++i) {
|
||||
carve::mesh::MeshSet<3>::vertex_t::vector_t normal = (*i)->plane.N;
|
||||
eint_info.insert(std::make_pair((*i), carve::geom::dot(edge_dir, normal)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void carve::csg::CSG::intersectingFacePairs(detail::Data &data) {
|
||||
static carve::TimingName FUNC_NAME("CSG::intersectingFacePairs()");
|
||||
@ -575,30 +620,36 @@ void carve::csg::CSG::intersectingFacePairs(detail::Data &data) {
|
||||
|
||||
// iterate over all intersection points.
|
||||
for (VertexIntersections::const_iterator i = vertex_intersections.begin(), ie = vertex_intersections.end(); i != ie; ++i) {
|
||||
carve::mesh::MeshSet<3>::vertex_t *i_pt = ((*i).first);
|
||||
meshset_t::vertex_t *i_pt = ((*i).first);
|
||||
detail::VFSMap::mapped_type &face_set = (data.fmap_rev[i_pt]);
|
||||
|
||||
detail::VFSMap::mapped_type src_face_set;
|
||||
detail::VFSMap::mapped_type tgt_face_set;
|
||||
// for all pairs of intersecting objects at this point
|
||||
for (VertexIntersections::data_type::const_iterator j = (*i).second.begin(), je = (*i).second.end(); j != je; ++j) {
|
||||
const IObj &i_src = ((*j).first);
|
||||
const IObj &i_tgt = ((*j).second);
|
||||
|
||||
// work out the faces involved. this updates fmap_rev.
|
||||
facesForObject(i_src, data.vert_to_edges, face_set);
|
||||
facesForObject(i_tgt, data.vert_to_edges, face_set);
|
||||
src_face_set.clear();
|
||||
tgt_face_set.clear();
|
||||
// work out the faces involved.
|
||||
facesForObject(i_src, data.vert_to_edges, src_face_set);
|
||||
facesForObject(i_tgt, data.vert_to_edges, tgt_face_set);
|
||||
// this updates fmap_rev.
|
||||
std::copy(src_face_set.begin(), src_face_set.end(), set_inserter(face_set));
|
||||
std::copy(tgt_face_set.begin(), tgt_face_set.end(), set_inserter(face_set));
|
||||
|
||||
// record the intersection with respect to any involved vertex.
|
||||
if (i_src.obtype == IObj::OBTYPE_VERTEX) data.vmap[i_src.vertex] = i_pt;
|
||||
if (i_tgt.obtype == IObj::OBTYPE_VERTEX) data.vmap[i_tgt.vertex] = i_pt;
|
||||
|
||||
// record the intersection with respect to any involved edge.
|
||||
if (i_src.obtype == IObj::OBTYPE_EDGE) data.emap[i_src.edge].insert(i_pt);
|
||||
if (i_tgt.obtype == IObj::OBTYPE_EDGE) data.emap[i_tgt.edge].insert(i_pt);
|
||||
if (i_src.obtype == IObj::OBTYPE_EDGE) recordEdgeIntersectionInfo(i_pt, i_src.edge, tgt_face_set, data);
|
||||
if (i_tgt.obtype == IObj::OBTYPE_EDGE) recordEdgeIntersectionInfo(i_pt, i_tgt.edge, src_face_set, data);
|
||||
}
|
||||
|
||||
// record the intersection with respect to each face.
|
||||
for (carve::csg::detail::VFSMap::mapped_type::const_iterator k = face_set.begin(), ke = face_set.end(); k != ke; ++k) {
|
||||
carve::mesh::MeshSet<3>::face_t *f = (*k);
|
||||
meshset_t::face_t *f = (*k);
|
||||
data.fmap[f].insert(i_pt);
|
||||
}
|
||||
}
|
||||
@ -606,8 +657,8 @@ void carve::csg::CSG::intersectingFacePairs(detail::Data &data) {
|
||||
|
||||
|
||||
|
||||
void carve::csg::CSG::_generateVertexVertexIntersections(carve::mesh::MeshSet<3>::vertex_t *va,
|
||||
carve::mesh::MeshSet<3>::edge_t *eb) {
|
||||
void carve::csg::CSG::_generateVertexVertexIntersections(meshset_t::vertex_t *va,
|
||||
meshset_t::edge_t *eb) {
|
||||
if (intersections.intersects(va, eb->v1())) {
|
||||
return;
|
||||
}
|
||||
@ -621,14 +672,14 @@ void carve::csg::CSG::_generateVertexVertexIntersections(carve::mesh::MeshSet<3>
|
||||
|
||||
|
||||
|
||||
void carve::csg::CSG::generateVertexVertexIntersections(carve::mesh::MeshSet<3>::face_t *a,
|
||||
const std::vector<carve::mesh::MeshSet<3>::face_t *> &b) {
|
||||
carve::mesh::MeshSet<3>::edge_t *ea, *eb;
|
||||
void carve::csg::CSG::generateVertexVertexIntersections(meshset_t::face_t *a,
|
||||
const std::vector<meshset_t::face_t *> &b) {
|
||||
meshset_t::edge_t *ea, *eb;
|
||||
|
||||
ea = a->edge;
|
||||
do {
|
||||
for (size_t i = 0; i < b.size(); ++i) {
|
||||
carve::mesh::MeshSet<3>::face_t *t = b[i];
|
||||
meshset_t::face_t *t = b[i];
|
||||
eb = t->edge;
|
||||
do {
|
||||
_generateVertexVertexIntersections(ea->v1(), eb);
|
||||
@ -641,8 +692,8 @@ void carve::csg::CSG::generateVertexVertexIntersections(carve::mesh::MeshSet<3>:
|
||||
|
||||
|
||||
|
||||
void carve::csg::CSG::_generateVertexEdgeIntersections(carve::mesh::MeshSet<3>::vertex_t *va,
|
||||
carve::mesh::MeshSet<3>::edge_t *eb) {
|
||||
void carve::csg::CSG::_generateVertexEdgeIntersections(meshset_t::vertex_t *va,
|
||||
meshset_t::edge_t *eb) {
|
||||
if (intersections.intersects(va, eb)) {
|
||||
return;
|
||||
}
|
||||
@ -665,14 +716,14 @@ void carve::csg::CSG::_generateVertexEdgeIntersections(carve::mesh::MeshSet<3>::
|
||||
|
||||
|
||||
|
||||
void carve::csg::CSG::generateVertexEdgeIntersections(carve::mesh::MeshSet<3>::face_t *a,
|
||||
const std::vector<carve::mesh::MeshSet<3>::face_t *> &b) {
|
||||
carve::mesh::MeshSet<3>::edge_t *ea, *eb;
|
||||
void carve::csg::CSG::generateVertexEdgeIntersections(meshset_t::face_t *a,
|
||||
const std::vector<meshset_t::face_t *> &b) {
|
||||
meshset_t::edge_t *ea, *eb;
|
||||
|
||||
ea = a->edge;
|
||||
do {
|
||||
for (size_t i = 0; i < b.size(); ++i) {
|
||||
carve::mesh::MeshSet<3>::face_t *t = b[i];
|
||||
meshset_t::face_t *t = b[i];
|
||||
eb = t->edge;
|
||||
do {
|
||||
_generateVertexEdgeIntersections(ea->v1(), eb);
|
||||
@ -685,21 +736,21 @@ void carve::csg::CSG::generateVertexEdgeIntersections(carve::mesh::MeshSet<3>::f
|
||||
|
||||
|
||||
|
||||
void carve::csg::CSG::_generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::edge_t *ea,
|
||||
carve::mesh::MeshSet<3>::edge_t *eb) {
|
||||
void carve::csg::CSG::_generateEdgeEdgeIntersections(meshset_t::edge_t *ea,
|
||||
meshset_t::edge_t *eb) {
|
||||
if (intersections.intersects(ea, eb)) {
|
||||
return;
|
||||
}
|
||||
|
||||
carve::mesh::MeshSet<3>::vertex_t *v1 = ea->v1(), *v2 = ea->v2();
|
||||
carve::mesh::MeshSet<3>::vertex_t *v3 = eb->v1(), *v4 = eb->v2();
|
||||
meshset_t::vertex_t *v1 = ea->v1(), *v2 = ea->v2();
|
||||
meshset_t::vertex_t *v3 = eb->v1(), *v4 = eb->v2();
|
||||
|
||||
carve::geom::aabb<3> ea_aabb, eb_aabb;
|
||||
ea_aabb.fit(v1->v, v2->v);
|
||||
eb_aabb.fit(v3->v, v4->v);
|
||||
if (ea_aabb.maxAxisSeparation(eb_aabb) > EPSILON) return;
|
||||
|
||||
carve::mesh::MeshSet<3>::vertex_t::vector_t p1, p2;
|
||||
meshset_t::vertex_t::vector_t p1, p2;
|
||||
double mu1, mu2;
|
||||
|
||||
switch (carve::geom3d::rayRayIntersection(carve::geom3d::Ray(v2->v - v1->v, v1->v),
|
||||
@ -708,7 +759,7 @@ void carve::csg::CSG::_generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::ed
|
||||
case carve::RR_INTERSECTION: {
|
||||
// edges intersect
|
||||
if (mu1 >= 0.0 && mu1 <= 1.0 && mu2 >= 0.0 && mu2 <= 1.0) {
|
||||
carve::mesh::MeshSet<3>::vertex_t *p = vertex_pool.get((p1 + p2) / 2.0);
|
||||
meshset_t::vertex_t *p = vertex_pool.get((p1 + p2) / 2.0);
|
||||
intersections.record(ea, eb, p);
|
||||
if (ea->rev) intersections.record(ea->rev, eb, p);
|
||||
if (eb->rev) intersections.record(ea, eb->rev, p);
|
||||
@ -733,14 +784,14 @@ void carve::csg::CSG::_generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::ed
|
||||
|
||||
|
||||
|
||||
void carve::csg::CSG::generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::face_t *a,
|
||||
const std::vector<carve::mesh::MeshSet<3>::face_t *> &b) {
|
||||
carve::mesh::MeshSet<3>::edge_t *ea, *eb;
|
||||
void carve::csg::CSG::generateEdgeEdgeIntersections(meshset_t::face_t *a,
|
||||
const std::vector<meshset_t::face_t *> &b) {
|
||||
meshset_t::edge_t *ea, *eb;
|
||||
|
||||
ea = a->edge;
|
||||
do {
|
||||
for (size_t i = 0; i < b.size(); ++i) {
|
||||
carve::mesh::MeshSet<3>::face_t *t = b[i];
|
||||
meshset_t::face_t *t = b[i];
|
||||
eb = t->edge;
|
||||
do {
|
||||
_generateEdgeEdgeIntersections(ea, eb);
|
||||
@ -753,8 +804,8 @@ void carve::csg::CSG::generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::fac
|
||||
|
||||
|
||||
|
||||
void carve::csg::CSG::_generateVertexFaceIntersections(carve::mesh::MeshSet<3>::face_t *fa,
|
||||
carve::mesh::MeshSet<3>::edge_t *eb) {
|
||||
void carve::csg::CSG::_generateVertexFaceIntersections(meshset_t::face_t *fa,
|
||||
meshset_t::edge_t *eb) {
|
||||
if (intersections.intersects(eb->v1(), fa)) {
|
||||
return;
|
||||
}
|
||||
@ -769,12 +820,12 @@ void carve::csg::CSG::_generateVertexFaceIntersections(carve::mesh::MeshSet<3>::
|
||||
|
||||
|
||||
|
||||
void carve::csg::CSG::generateVertexFaceIntersections(carve::mesh::MeshSet<3>::face_t *a,
|
||||
const std::vector<carve::mesh::MeshSet<3>::face_t *> &b) {
|
||||
carve::mesh::MeshSet<3>::edge_t *ea, *eb;
|
||||
void carve::csg::CSG::generateVertexFaceIntersections(meshset_t::face_t *a,
|
||||
const std::vector<meshset_t::face_t *> &b) {
|
||||
meshset_t::edge_t *eb;
|
||||
|
||||
for (size_t i = 0; i < b.size(); ++i) {
|
||||
carve::mesh::MeshSet<3>::face_t *t = b[i];
|
||||
meshset_t::face_t *t = b[i];
|
||||
eb = t->edge;
|
||||
do {
|
||||
_generateVertexFaceIntersections(a, eb);
|
||||
@ -785,15 +836,15 @@ void carve::csg::CSG::generateVertexFaceIntersections(carve::mesh::MeshSet<3>::f
|
||||
|
||||
|
||||
|
||||
void carve::csg::CSG::_generateEdgeFaceIntersections(carve::mesh::MeshSet<3>::face_t *fa,
|
||||
carve::mesh::MeshSet<3>::edge_t *eb) {
|
||||
void carve::csg::CSG::_generateEdgeFaceIntersections(meshset_t::face_t *fa,
|
||||
meshset_t::edge_t *eb) {
|
||||
if (intersections.intersects(eb, fa)) {
|
||||
return;
|
||||
}
|
||||
|
||||
carve::mesh::MeshSet<3>::vertex_t::vector_t _p;
|
||||
meshset_t::vertex_t::vector_t _p;
|
||||
if (fa->simpleLineSegmentIntersection(carve::geom3d::LineSegment(eb->v1()->v, eb->v2()->v), _p)) {
|
||||
carve::mesh::MeshSet<3>::vertex_t *p = vertex_pool.get(_p);
|
||||
meshset_t::vertex_t *p = vertex_pool.get(_p);
|
||||
intersections.record(eb, fa, p);
|
||||
if (eb->rev) intersections.record(eb->rev, fa, p);
|
||||
}
|
||||
@ -801,12 +852,12 @@ void carve::csg::CSG::_generateEdgeFaceIntersections(carve::mesh::MeshSet<3>::fa
|
||||
|
||||
|
||||
|
||||
void carve::csg::CSG::generateEdgeFaceIntersections(carve::mesh::MeshSet<3>::face_t *a,
|
||||
const std::vector<carve::mesh::MeshSet<3>::face_t *> &b) {
|
||||
carve::mesh::MeshSet<3>::edge_t *ea, *eb;
|
||||
void carve::csg::CSG::generateEdgeFaceIntersections(meshset_t::face_t *a,
|
||||
const std::vector<meshset_t::face_t *> &b) {
|
||||
meshset_t::edge_t *eb;
|
||||
|
||||
for (size_t i = 0; i < b.size(); ++i) {
|
||||
carve::mesh::MeshSet<3>::face_t *t = b[i];
|
||||
meshset_t::face_t *t = b[i];
|
||||
eb = t->edge;
|
||||
do {
|
||||
_generateEdgeFaceIntersections(a, eb);
|
||||
@ -817,9 +868,9 @@ void carve::csg::CSG::generateEdgeFaceIntersections(carve::mesh::MeshSet<3>::fac
|
||||
|
||||
|
||||
|
||||
void carve::csg::CSG::generateIntersectionCandidates(carve::mesh::MeshSet<3> *a,
|
||||
void carve::csg::CSG::generateIntersectionCandidates(meshset_t *a,
|
||||
const face_rtree_t *a_node,
|
||||
carve::mesh::MeshSet<3> *b,
|
||||
meshset_t *b,
|
||||
const face_rtree_t *b_node,
|
||||
face_pairs_t &face_pairs,
|
||||
bool descend_a) {
|
||||
@ -837,12 +888,12 @@ void carve::csg::CSG::generateIntersectionCandidates(carve::mesh::MeshSet<3> *a,
|
||||
}
|
||||
} else {
|
||||
for (size_t i = 0; i < a_node->data.size(); ++i) {
|
||||
carve::mesh::MeshSet<3>::face_t *fa = a_node->data[i];
|
||||
meshset_t::face_t *fa = a_node->data[i];
|
||||
carve::geom::aabb<3> aabb_a = fa->getAABB();
|
||||
if (aabb_a.maxAxisSeparation(b_node->bbox) > carve::EPSILON) continue;
|
||||
|
||||
for (size_t j = 0; j < b_node->data.size(); ++j) {
|
||||
carve::mesh::MeshSet<3>::face_t *fb = b_node->data[j];
|
||||
meshset_t::face_t *fb = b_node->data[j];
|
||||
carve::geom::aabb<3> aabb_b = fb->getAABB();
|
||||
if (aabb_b.maxAxisSeparation(aabb_a) > carve::EPSILON) continue;
|
||||
|
||||
@ -866,17 +917,17 @@ void carve::csg::CSG::generateIntersectionCandidates(carve::mesh::MeshSet<3> *a,
|
||||
|
||||
|
||||
|
||||
void carve::csg::CSG::generateIntersections(carve::mesh::MeshSet<3> *a,
|
||||
void carve::csg::CSG::generateIntersections(meshset_t *a,
|
||||
const face_rtree_t *a_rtree,
|
||||
carve::mesh::MeshSet<3> *b,
|
||||
meshset_t *b,
|
||||
const face_rtree_t *b_rtree,
|
||||
detail::Data &data) {
|
||||
face_pairs_t face_pairs;
|
||||
generateIntersectionCandidates(a, a_rtree, b, b_rtree, face_pairs);
|
||||
|
||||
for (face_pairs_t::const_iterator i = face_pairs.begin(); i != face_pairs.end(); ++i) {
|
||||
carve::mesh::MeshSet<3>::face_t *f = (*i).first;
|
||||
carve::mesh::MeshSet<3>::edge_t *e = f->edge;
|
||||
meshset_t::face_t *f = (*i).first;
|
||||
meshset_t::edge_t *e = f->edge;
|
||||
do {
|
||||
data.vert_to_edges[e->v1()].push_back(e);
|
||||
e = e->next;
|
||||
@ -958,13 +1009,13 @@ void carve::csg::CSG::divideIntersectedEdges(detail::Data &data) {
|
||||
static carve::TimingName FUNC_NAME("CSG::divideIntersectedEdges()");
|
||||
carve::TimingBlock block(FUNC_NAME);
|
||||
|
||||
for (detail::EVSMap::const_iterator i = data.emap.begin(), ei = data.emap.end(); i != ei; ++i) {
|
||||
carve::mesh::MeshSet<3>::edge_t *edge = (*i).first;
|
||||
const detail::EVSMap::mapped_type &vertices = (*i).second;
|
||||
std::vector<carve::mesh::MeshSet<3>::vertex_t *> &verts = data.divided_edges[edge];
|
||||
orderVertices(vertices.begin(), vertices.end(),
|
||||
edge->v2()->v - edge->v1()->v, edge->v1()->v,
|
||||
verts);
|
||||
for (detail::EIntMap::const_iterator i = data.emap.begin(), ei = data.emap.end(); i != ei; ++i) {
|
||||
meshset_t::edge_t *edge = (*i).first;
|
||||
const detail::EIntMap::mapped_type &int_info = (*i).second;
|
||||
std::vector<meshset_t::vertex_t *> &verts = data.divided_edges[edge];
|
||||
orderEdgeIntersectionVertices(int_info.begin(), int_info.end(),
|
||||
edge->v2()->v - edge->v1()->v, edge->v1()->v,
|
||||
verts);
|
||||
}
|
||||
}
|
||||
|
||||
@ -982,7 +1033,7 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
|
||||
i = data.fmap.begin(), ie = data.fmap.end();
|
||||
i != ie;
|
||||
++i) {
|
||||
carve::mesh::MeshSet<3>::face_t *face_a = (*i).first;
|
||||
meshset_t::face_t *face_a = (*i).first;
|
||||
const detail::FVSMap::mapped_type &face_a_intersections = ((*i).second);
|
||||
face_b_set.clear();
|
||||
|
||||
@ -995,7 +1046,7 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
|
||||
k = data.fmap_rev[*j].begin(), ke = data.fmap_rev[*j].end();
|
||||
k != ke;
|
||||
++k) {
|
||||
carve::mesh::MeshSet<3>::face_t *face_b = (*k);
|
||||
meshset_t::face_t *face_b = (*k);
|
||||
if (face_a != face_b && face_b->mesh->meshset != face_a->mesh->meshset) {
|
||||
face_b_set.insert(face_b);
|
||||
}
|
||||
@ -1007,10 +1058,10 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
|
||||
j = face_b_set.begin(), je = face_b_set.end();
|
||||
j != je;
|
||||
++j) {
|
||||
carve::mesh::MeshSet<3>::face_t *face_b = (*j);
|
||||
meshset_t::face_t *face_b = (*j);
|
||||
const detail::FVSMap::mapped_type &face_b_intersections = (data.fmap[face_b]);
|
||||
|
||||
std::vector<carve::mesh::MeshSet<3>::vertex_t *> vertices;
|
||||
std::vector<meshset_t::vertex_t *> vertices;
|
||||
vertices.reserve(std::min(face_a_intersections.size(), face_b_intersections.size()));
|
||||
|
||||
// record the points of intersection between face_a and face_b
|
||||
@ -1024,7 +1075,7 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
|
||||
std::cerr << "face pair: "
|
||||
<< face_a << ":" << face_b
|
||||
<< " N(verts) " << vertices.size() << std::endl;
|
||||
for (std::vector<carve::mesh::MeshSet<3>::vertex_t *>::const_iterator i = vertices.begin(), e = vertices.end(); i != e; ++i) {
|
||||
for (std::vector<meshset_t::vertex_t *>::const_iterator i = vertices.begin(), e = vertices.end(); i != e; ++i) {
|
||||
std::cerr << (*i) << " " << (*i)->v << " ("
|
||||
<< carve::geom::distance(face_a->plane, (*i)->v) << ","
|
||||
<< carve::geom::distance(face_b->plane, (*i)->v) << ")"
|
||||
@ -1036,8 +1087,8 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
|
||||
|
||||
// if there are two points of intersection, then the added edge is simple to determine.
|
||||
if (vertices.size() == 2) {
|
||||
carve::mesh::MeshSet<3>::vertex_t *v1 = vertices[0];
|
||||
carve::mesh::MeshSet<3>::vertex_t *v2 = vertices[1];
|
||||
meshset_t::vertex_t *v1 = vertices[0];
|
||||
meshset_t::vertex_t *v2 = vertices[1];
|
||||
carve::geom3d::Vector c = (v1->v + v2->v) / 2;
|
||||
|
||||
// determine whether the midpoint of the implied edge is contained in face_a and face_b
|
||||
@ -1065,7 +1116,7 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
|
||||
|
||||
// otherwise, it's more complex.
|
||||
carve::geom3d::Vector base, dir;
|
||||
std::vector<carve::mesh::MeshSet<3>::vertex_t *> ordered;
|
||||
std::vector<meshset_t::vertex_t *> ordered;
|
||||
|
||||
// skip coplanar edges. this simplifies the resulting
|
||||
// mesh. eventually all coplanar face regions of two polyhedra
|
||||
@ -1080,8 +1131,8 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
|
||||
// for each possible edge in the ordering, test the midpoint,
|
||||
// and record if it's contained in face_a and face_b.
|
||||
for (int k = 0, ke = (int)ordered.size() - 1; k < ke; ++k) {
|
||||
carve::mesh::MeshSet<3>::vertex_t *v1 = ordered[k];
|
||||
carve::mesh::MeshSet<3>::vertex_t *v2 = ordered[k + 1];
|
||||
meshset_t::vertex_t *v1 = ordered[k];
|
||||
meshset_t::vertex_t *v2 = ordered[k + 1];
|
||||
carve::geom3d::Vector c = (v1->v + v2->v) / 2;
|
||||
|
||||
#if defined(CARVE_DEBUG)
|
||||
@ -1125,7 +1176,7 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
|
||||
|
||||
carve::line::PolylineSet intersection_graph;
|
||||
intersection_graph.vertices.resize(vertices.size());
|
||||
std::map<const carve::mesh::MeshSet<3>::vertex_t *, size_t> vmap;
|
||||
std::map<const meshset_t::vertex_t *, size_t> vmap;
|
||||
|
||||
size_t j = 0;
|
||||
for (detail::VSet::const_iterator i = vertices.begin(); i != vertices.end(); ++i) {
|
||||
@ -1195,9 +1246,9 @@ static void checkFaceLoopIntegrity(carve::csg::FaceLoopList &fll) {
|
||||
* @param b_edge_count
|
||||
* @param hooks
|
||||
*/
|
||||
void carve::csg::CSG::calc(carve::mesh::MeshSet<3> *a,
|
||||
void carve::csg::CSG::calc(meshset_t *a,
|
||||
const face_rtree_t *a_rtree,
|
||||
carve::mesh::MeshSet<3> *b,
|
||||
meshset_t *b,
|
||||
const face_rtree_t *b_rtree,
|
||||
carve::csg::VertexClassification &vclass,
|
||||
carve::csg::EdgeClassification &eclass,
|
||||
@ -1260,12 +1311,12 @@ void carve::csg::CSG::calc(carve::mesh::MeshSet<3> *a,
|
||||
|
||||
#if defined(CARVE_DEBUG_WRITE_PLY_DATA)
|
||||
{
|
||||
std::string out("/tmp/a_split.ply");
|
||||
writePLY(out, faceLoopsToPolyhedron(a_face_loops), false);
|
||||
std::auto_ptr<carve::mesh::MeshSet<3> > poly(faceLoopsToPolyhedron(a_face_loops));
|
||||
writePLY("/tmp/a_split.ply", poly.get(), false);
|
||||
}
|
||||
{
|
||||
std::string out("/tmp/b_split.ply");
|
||||
writePLY(out, faceLoopsToPolyhedron(b_face_loops), false);
|
||||
std::auto_ptr<carve::mesh::MeshSet<3> > poly(faceLoopsToPolyhedron(b_face_loops));
|
||||
writePLY("/tmp/b_split.ply", poly.get(), false);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1276,11 +1327,11 @@ void carve::csg::CSG::calc(carve::mesh::MeshSet<3> *a,
|
||||
std::cerr << "classify" << std::endl;
|
||||
#endif
|
||||
// initialize some classification information.
|
||||
for (std::vector<carve::mesh::MeshSet<3>::vertex_t>::iterator
|
||||
for (std::vector<meshset_t::vertex_t>::iterator
|
||||
i = a->vertex_storage.begin(), e = a->vertex_storage.end(); i != e; ++i) {
|
||||
vclass[map_vertex(data.vmap, &(*i))].cls[0] = POINT_ON;
|
||||
}
|
||||
for (std::vector<carve::mesh::MeshSet<3>::vertex_t>::iterator
|
||||
for (std::vector<meshset_t::vertex_t>::iterator
|
||||
i = b->vertex_storage.begin(), e = b->vertex_storage.end(); i != e; ++i) {
|
||||
vclass[map_vertex(data.vmap, &(*i))].cls[1] = POINT_ON;
|
||||
}
|
||||
@ -1351,8 +1402,8 @@ void returnSharedEdges(carve::csg::V2Set &shared_edges,
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
carve::mesh::MeshSet<3> *carve::csg::CSG::compute(carve::mesh::MeshSet<3> *a,
|
||||
carve::mesh::MeshSet<3> *b,
|
||||
carve::mesh::MeshSet<3> *carve::csg::CSG::compute(meshset_t *a,
|
||||
meshset_t *b,
|
||||
carve::csg::CSG::Collector &collector,
|
||||
carve::csg::V2Set *shared_edges_ptr,
|
||||
CLASSIFY_TYPE classify_type) {
|
||||
@ -1371,13 +1422,13 @@ carve::mesh::MeshSet<3> *carve::csg::CSG::compute(carve::mesh::MeshSet<3> *a,
|
||||
size_t a_edge_count;
|
||||
size_t b_edge_count;
|
||||
|
||||
face_rtree_t *a_rtree = face_rtree_t::construct_STR(a->faceBegin(), a->faceEnd(), 4, 4);
|
||||
face_rtree_t *b_rtree = face_rtree_t::construct_STR(b->faceBegin(), b->faceEnd(), 4, 4);
|
||||
std::auto_ptr<face_rtree_t> a_rtree(face_rtree_t::construct_STR(a->faceBegin(), a->faceEnd(), 4, 4));
|
||||
std::auto_ptr<face_rtree_t> b_rtree(face_rtree_t::construct_STR(b->faceBegin(), b->faceEnd(), 4, 4));
|
||||
|
||||
{
|
||||
static carve::TimingName FUNC_NAME("CSG::compute - calc()");
|
||||
carve::TimingBlock block(FUNC_NAME);
|
||||
calc(a, a_rtree, b, b_rtree, vclass, eclass,a_face_loops, b_face_loops, a_edge_count, b_edge_count);
|
||||
calc(a, a_rtree.get(), b, b_rtree.get(), vclass, eclass,a_face_loops, b_face_loops, a_edge_count, b_edge_count);
|
||||
}
|
||||
|
||||
detail::LoopEdges a_edge_map;
|
||||
@ -1445,11 +1496,11 @@ carve::mesh::MeshSet<3> *carve::csg::CSG::compute(carve::mesh::MeshSet<3> *a,
|
||||
classifyFaceGroupsEdge(shared_edges,
|
||||
vclass,
|
||||
a,
|
||||
a_rtree,
|
||||
a_rtree.get(),
|
||||
a_loops_grouped,
|
||||
a_edge_map,
|
||||
b,
|
||||
b_rtree,
|
||||
b_rtree.get(),
|
||||
b_loops_grouped,
|
||||
b_edge_map,
|
||||
collector);
|
||||
@ -1458,20 +1509,20 @@ carve::mesh::MeshSet<3> *carve::csg::CSG::compute(carve::mesh::MeshSet<3> *a,
|
||||
classifyFaceGroups(shared_edges,
|
||||
vclass,
|
||||
a,
|
||||
a_rtree,
|
||||
a_rtree.get(),
|
||||
a_loops_grouped,
|
||||
a_edge_map,
|
||||
b,
|
||||
b_rtree,
|
||||
b_rtree.get(),
|
||||
b_loops_grouped,
|
||||
b_edge_map,
|
||||
collector);
|
||||
break;
|
||||
}
|
||||
|
||||
carve::mesh::MeshSet<3> *result = collector.done(hooks);
|
||||
meshset_t *result = collector.done(hooks);
|
||||
if (result != NULL && shared_edges_ptr != NULL) {
|
||||
std::list<carve::mesh::MeshSet<3> *> result_list;
|
||||
std::list<meshset_t *> result_list;
|
||||
result_list.push_back(result);
|
||||
returnSharedEdges(shared_edges, result_list, shared_edges_ptr);
|
||||
}
|
||||
@ -1492,15 +1543,15 @@ carve::mesh::MeshSet<3> *carve::csg::CSG::compute(carve::mesh::MeshSet<3> *a,
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
carve::mesh::MeshSet<3> *carve::csg::CSG::compute(carve::mesh::MeshSet<3> *a,
|
||||
carve::mesh::MeshSet<3> *b,
|
||||
carve::mesh::MeshSet<3> *carve::csg::CSG::compute(meshset_t *a,
|
||||
meshset_t *b,
|
||||
carve::csg::CSG::OP op,
|
||||
carve::csg::V2Set *shared_edges,
|
||||
CLASSIFY_TYPE classify_type) {
|
||||
Collector *coll = makeCollector(op, a, b);
|
||||
if (!coll) return NULL;
|
||||
|
||||
carve::mesh::MeshSet<3> *result = compute(a, b, *coll, shared_edges, classify_type);
|
||||
meshset_t *result = compute(a, b, *coll, shared_edges, classify_type);
|
||||
|
||||
delete coll;
|
||||
|
||||
@ -1521,9 +1572,9 @@ carve::mesh::MeshSet<3> *carve::csg::CSG::compute(carve::mesh::MeshSet<3> *a,
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
bool carve::csg::CSG::sliceAndClassify(carve::mesh::MeshSet<3> *closed,
|
||||
carve::mesh::MeshSet<3> *open,
|
||||
std::list<std::pair<FaceClass, carve::mesh::MeshSet<3> *> > &result,
|
||||
bool carve::csg::CSG::sliceAndClassify(meshset_t *closed,
|
||||
meshset_t *open,
|
||||
std::list<std::pair<FaceClass, meshset_t *> > &result,
|
||||
carve::csg::V2Set *shared_edges_ptr) {
|
||||
if (!closed->isClosed()) return false;
|
||||
carve::csg::VertexClassification vclass;
|
||||
@ -1538,10 +1589,10 @@ bool carve::csg::CSG::sliceAndClassify(carve::mesh::MeshSet<3> *closed,
|
||||
size_t a_edge_count;
|
||||
size_t b_edge_count;
|
||||
|
||||
face_rtree_t *closed_rtree = face_rtree_t::construct_STR(closed->faceBegin(), closed->faceEnd(), 4, 4);
|
||||
face_rtree_t *open_rtree = face_rtree_t::construct_STR(open->faceBegin(), open->faceEnd(), 4, 4);
|
||||
std::auto_ptr<face_rtree_t> closed_rtree(face_rtree_t::construct_STR(closed->faceBegin(), closed->faceEnd(), 4, 4));
|
||||
std::auto_ptr<face_rtree_t> open_rtree(face_rtree_t::construct_STR(open->faceBegin(), open->faceEnd(), 4, 4));
|
||||
|
||||
calc(closed, closed_rtree, open, open_rtree, vclass, eclass,a_face_loops, b_face_loops, a_edge_count, b_edge_count);
|
||||
calc(closed, closed_rtree.get(), open, open_rtree.get(), vclass, eclass,a_face_loops, b_face_loops, a_edge_count, b_edge_count);
|
||||
|
||||
detail::LoopEdges a_edge_map;
|
||||
detail::LoopEdges b_edge_map;
|
||||
@ -1559,18 +1610,18 @@ bool carve::csg::CSG::sliceAndClassify(carve::mesh::MeshSet<3> *closed,
|
||||
halfClassifyFaceGroups(shared_edges,
|
||||
vclass,
|
||||
closed,
|
||||
closed_rtree,
|
||||
closed_rtree.get(),
|
||||
a_loops_grouped,
|
||||
a_edge_map,
|
||||
open,
|
||||
open_rtree,
|
||||
open_rtree.get(),
|
||||
b_loops_grouped,
|
||||
b_edge_map,
|
||||
result);
|
||||
|
||||
if (shared_edges_ptr != NULL) {
|
||||
std::list<carve::mesh::MeshSet<3> *> result_list;
|
||||
for (std::list<std::pair<FaceClass, carve::mesh::MeshSet<3> *> >::iterator it = result.begin(); it != result.end(); it++) {
|
||||
std::list<meshset_t *> result_list;
|
||||
for (std::list<std::pair<FaceClass, meshset_t *> >::iterator it = result.begin(); it != result.end(); it++) {
|
||||
result_list.push_back(it->second);
|
||||
}
|
||||
returnSharedEdges(shared_edges, result_list, shared_edges_ptr);
|
||||
@ -1590,10 +1641,10 @@ bool carve::csg::CSG::sliceAndClassify(carve::mesh::MeshSet<3> *closed,
|
||||
* @param hooks
|
||||
* @param shared_edges_ptr
|
||||
*/
|
||||
void carve::csg::CSG::slice(carve::mesh::MeshSet<3> *a,
|
||||
carve::mesh::MeshSet<3> *b,
|
||||
std::list<carve::mesh::MeshSet<3> *> &a_sliced,
|
||||
std::list<carve::mesh::MeshSet<3> *> &b_sliced,
|
||||
void carve::csg::CSG::slice(meshset_t *a,
|
||||
meshset_t *b,
|
||||
std::list<meshset_t *> &a_sliced,
|
||||
std::list<meshset_t *> &b_sliced,
|
||||
carve::csg::V2Set *shared_edges_ptr) {
|
||||
carve::csg::VertexClassification vclass;
|
||||
carve::csg::EdgeClassification eclass;
|
||||
@ -1607,10 +1658,10 @@ void carve::csg::CSG::slice(carve::mesh::MeshSet<3> *a,
|
||||
size_t a_edge_count;
|
||||
size_t b_edge_count;
|
||||
|
||||
face_rtree_t *a_rtree = face_rtree_t::construct_STR(a->faceBegin(), a->faceEnd(), 4, 4);
|
||||
face_rtree_t *b_rtree = face_rtree_t::construct_STR(b->faceBegin(), b->faceEnd(), 4, 4);
|
||||
std::auto_ptr<face_rtree_t> a_rtree(face_rtree_t::construct_STR(a->faceBegin(), a->faceEnd(), 4, 4));
|
||||
std::auto_ptr<face_rtree_t> b_rtree(face_rtree_t::construct_STR(b->faceBegin(), b->faceEnd(), 4, 4));
|
||||
|
||||
calc(a, a_rtree, b, b_rtree, vclass, eclass,a_face_loops, b_face_loops, a_edge_count, b_edge_count);
|
||||
calc(a, a_rtree.get(), b, b_rtree.get(), vclass, eclass,a_face_loops, b_face_loops, a_edge_count, b_edge_count);
|
||||
|
||||
detail::LoopEdges a_edge_map;
|
||||
detail::LoopEdges b_edge_map;
|
||||
@ -1645,7 +1696,7 @@ void carve::csg::CSG::slice(carve::mesh::MeshSet<3> *a,
|
||||
delete all;
|
||||
}
|
||||
if (shared_edges_ptr != NULL) {
|
||||
std::list<carve::mesh::MeshSet<3> *> result_list;
|
||||
std::list<meshset_t *> result_list;
|
||||
result_list.insert(result_list.end(), a_sliced.begin(), a_sliced.end());
|
||||
result_list.insert(result_list.end(), b_sliced.begin(), b_sliced.end());
|
||||
returnSharedEdges(shared_edges, result_list, shared_edges_ptr);
|
||||
|
6
extern/carve/patches/strict_flags.patch
vendored
6
extern/carve/patches/strict_flags.patch
vendored
@ -9,9 +9,9 @@ diff -r 47dfdaff1dd5 include/carve/csg_triangulator.hpp
|
||||
}
|
||||
|
||||
carve::mesh::MeshSet<3>::face_t *mergeQuad(edge_map_t::iterator i, edge_map_t &edge_map) {
|
||||
diff -r 47dfdaff1dd5 src/selfintersect.cpp
|
||||
--- a/src/selfintersect.cpp Thu Jan 12 15:49:04 2012 -0500
|
||||
+++ b/src/selfintersect.cpp Fri Jan 13 03:13:32 2012 +0600
|
||||
diff -r 47dfdaff1dd5 lib/selfintersect.cpp
|
||||
--- a/lib/selfintersect.cpp Thu Jan 12 15:49:04 2012 -0500
|
||||
+++ b/lib/selfintersect.cpp Fri Jan 13 03:13:32 2012 +0600
|
||||
@@ -465,6 +465,7 @@
|
||||
|
||||
// returns true if no intersection, based upon edge^a_i and edge^b_j separating axis.
|
||||
|
@ -244,7 +244,7 @@ PyObject* AUD_initPython()
|
||||
return module;
|
||||
}
|
||||
|
||||
PyObject* AUD_getPythonFactory(AUD_Sound* sound)
|
||||
void* AUD_getPythonFactory(AUD_Sound* sound)
|
||||
{
|
||||
if(sound)
|
||||
{
|
||||
@ -259,9 +259,9 @@ PyObject* AUD_getPythonFactory(AUD_Sound* sound)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
AUD_Sound* AUD_getPythonSound(PyObject* sound)
|
||||
AUD_Sound* AUD_getPythonSound(void* sound)
|
||||
{
|
||||
Factory* factory = checkFactory(sound);
|
||||
Factory* factory = checkFactory((PyObject *)sound);
|
||||
|
||||
if(!factory)
|
||||
return NULL;
|
||||
|
@ -29,10 +29,6 @@
|
||||
#ifndef __AUD_C_API_H__
|
||||
#define __AUD_C_API_H__
|
||||
|
||||
#ifdef WITH_PYTHON
|
||||
#include "Python.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -740,14 +736,14 @@ extern AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* seque
|
||||
* \param sound The sound factory.
|
||||
* \return The python factory.
|
||||
*/
|
||||
extern PyObject* AUD_getPythonFactory(AUD_Sound* sound);
|
||||
extern void* AUD_getPythonFactory(AUD_Sound* sound);
|
||||
|
||||
/**
|
||||
* Retrieves the sound factory of a python factory.
|
||||
* \param sound The python factory.
|
||||
* \return The sound factory.
|
||||
*/
|
||||
extern AUD_Sound* AUD_getPythonSound(PyObject* sound);
|
||||
extern AUD_Sound* AUD_getPythonSound(void* sound);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -143,7 +143,9 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
|
||||
|
||||
cls.min_bounces = IntProperty(
|
||||
name="Min Bounces",
|
||||
description="Minimum number of bounces, setting this lower than the maximum enables probalistic path termination (faster but noisier)",
|
||||
description="Minimum number of bounces, setting this lower "
|
||||
"than the maximum enables probabilistic path "
|
||||
"termination (faster but noisier)",
|
||||
min=0, max=1024,
|
||||
default=3,
|
||||
)
|
||||
@ -175,7 +177,10 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
|
||||
|
||||
cls.transparent_min_bounces = IntProperty(
|
||||
name="Transparent Min Bounces",
|
||||
description="Minimum number of transparent bounces, setting this lower than the maximum enables probalistic path termination (faster but noisier)",
|
||||
description="Minimum number of transparent bounces, setting "
|
||||
"this lower than the maximum enables "
|
||||
"probabilistic path termination (faster but "
|
||||
"noisier)",
|
||||
min=0, max=1024,
|
||||
default=8,
|
||||
)
|
||||
|
@ -109,8 +109,11 @@ int ImageManager::add_image(const string& filename, bool& is_float)
|
||||
|
||||
if(slot == float_images.size()) {
|
||||
/* max images limit reached */
|
||||
if(float_images.size() == TEX_NUM_FLOAT_IMAGES)
|
||||
if(float_images.size() == TEX_NUM_FLOAT_IMAGES) {
|
||||
printf("ImageManager::add_image: byte image limit reached %d, skipping '%s'\n",
|
||||
TEX_NUM_IMAGES, filename.c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
float_images.resize(float_images.size() + 1);
|
||||
}
|
||||
@ -141,8 +144,11 @@ int ImageManager::add_image(const string& filename, bool& is_float)
|
||||
|
||||
if(slot == images.size()) {
|
||||
/* max images limit reached */
|
||||
if(images.size() == TEX_NUM_IMAGES)
|
||||
if(images.size() == TEX_NUM_IMAGES) {
|
||||
printf("ImageManager::add_image: byte image limit reached %d, skipping '%s'\n",
|
||||
TEX_NUM_IMAGES, filename.c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
images.resize(images.size() + 1);
|
||||
}
|
||||
@ -353,13 +359,13 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
|
||||
device->tex_free(tex_img);
|
||||
|
||||
if(!file_load_float_image(img, tex_img)) {
|
||||
/* on failure to load, we set a 1x1 pixels black image */
|
||||
/* on failure to load, we set a 1x1 pixels pink image */
|
||||
float *pixels = (float*)tex_img.resize(1, 1);
|
||||
|
||||
pixels[0] = 0.0f;
|
||||
pixels[1] = 0.0f;
|
||||
pixels[2] = 0.0f;
|
||||
pixels[3] = 0.0f;
|
||||
pixels[0] = TEX_IMAGE_MISSING_R;
|
||||
pixels[1] = TEX_IMAGE_MISSING_G;
|
||||
pixels[2] = TEX_IMAGE_MISSING_B;
|
||||
pixels[3] = TEX_IMAGE_MISSING_A;
|
||||
}
|
||||
|
||||
string name;
|
||||
@ -380,13 +386,13 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
|
||||
device->tex_free(tex_img);
|
||||
|
||||
if(!file_load_image(img, tex_img)) {
|
||||
/* on failure to load, we set a 1x1 pixels black image */
|
||||
/* on failure to load, we set a 1x1 pixels pink image */
|
||||
uchar *pixels = (uchar*)tex_img.resize(1, 1);
|
||||
|
||||
pixels[0] = 0;
|
||||
pixels[1] = 0;
|
||||
pixels[2] = 0;
|
||||
pixels[3] = 0;
|
||||
pixels[0] = (TEX_IMAGE_MISSING_R * 255);
|
||||
pixels[1] = (TEX_IMAGE_MISSING_G * 255);
|
||||
pixels[2] = (TEX_IMAGE_MISSING_B * 255);
|
||||
pixels[3] = (TEX_IMAGE_MISSING_A * 255);
|
||||
}
|
||||
|
||||
string name;
|
||||
|
@ -31,6 +31,12 @@ CCL_NAMESPACE_BEGIN
|
||||
#define TEX_IMAGE_MAX (TEX_NUM_IMAGES + TEX_NUM_FLOAT_IMAGES)
|
||||
#define TEX_IMAGE_FLOAT_START TEX_NUM_IMAGES
|
||||
|
||||
/* color to use when textures are not found */
|
||||
#define TEX_IMAGE_MISSING_R 1
|
||||
#define TEX_IMAGE_MISSING_G 0
|
||||
#define TEX_IMAGE_MISSING_B 1
|
||||
#define TEX_IMAGE_MISSING_A 1
|
||||
|
||||
class Device;
|
||||
class DeviceScene;
|
||||
class Progress;
|
||||
|
@ -184,10 +184,12 @@ void ImageTextureNode::compile(SVMCompiler& compiler)
|
||||
/* image not found */
|
||||
if(!color_out->links.empty()) {
|
||||
compiler.add_node(NODE_VALUE_V, color_out->stack_offset);
|
||||
compiler.add_node(NODE_VALUE_V, make_float3(0, 0, 0));
|
||||
compiler.add_node(NODE_VALUE_V, make_float3(TEX_IMAGE_MISSING_R,
|
||||
TEX_IMAGE_MISSING_G,
|
||||
TEX_IMAGE_MISSING_B));
|
||||
}
|
||||
if(!alpha_out->links.empty())
|
||||
compiler.add_node(NODE_VALUE_F, __float_as_int(0.0f), alpha_out->stack_offset);
|
||||
compiler.add_node(NODE_VALUE_F, __float_as_int(TEX_IMAGE_MISSING_A), alpha_out->stack_offset);
|
||||
}
|
||||
}
|
||||
|
||||
@ -288,10 +290,12 @@ void EnvironmentTextureNode::compile(SVMCompiler& compiler)
|
||||
/* image not found */
|
||||
if(!color_out->links.empty()) {
|
||||
compiler.add_node(NODE_VALUE_V, color_out->stack_offset);
|
||||
compiler.add_node(NODE_VALUE_V, make_float3(0, 0, 0));
|
||||
compiler.add_node(NODE_VALUE_V, make_float3(TEX_IMAGE_MISSING_R,
|
||||
TEX_IMAGE_MISSING_G,
|
||||
TEX_IMAGE_MISSING_B));
|
||||
}
|
||||
if(!alpha_out->links.empty())
|
||||
compiler.add_node(NODE_VALUE_F, __float_as_int(0.0f), alpha_out->stack_offset);
|
||||
compiler.add_node(NODE_VALUE_F, __float_as_int(TEX_IMAGE_MISSING_A), alpha_out->stack_offset);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -328,7 +328,8 @@ extern GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle
|
||||
* @param windowhandle The handle to the window
|
||||
* @param bitmap The bitmap data for the cursor.
|
||||
* @param mask The mask data for the cursor.
|
||||
* @parm sizex, sizey The size of the cursor
|
||||
* @param sizex The width of the cursor
|
||||
* @param sizey The height of the cursor
|
||||
* @param hotX The X coordinate of the cursor hotspot.
|
||||
* @param hotY The Y coordinate of the cursor hotspot.
|
||||
* @param fg_color, bg_color Colors of the cursor
|
||||
|
@ -395,7 +395,7 @@ void GHOST_NDOFManager::setDeadZone(float dz)
|
||||
dz = 0.f;
|
||||
}
|
||||
else if (dz > 0.5f) {
|
||||
// warn the rogue user/programmer, but allow it
|
||||
// warn the rogue user/developer, but allow it
|
||||
GHOST_PRINTF("ndof: dead zone of %.2f is rather high...\n", dz);
|
||||
}
|
||||
m_deadZone = dz;
|
||||
|
@ -34,8 +34,8 @@
|
||||
#define __PLX__FAKE_AA__
|
||||
|
||||
/* from BLI_utildefines.h */
|
||||
#define MIN2(x, y) ( (x) < (y) ? (x) : (y) )
|
||||
#define MAX2(x, y) ( (x) > (y) ? (x) : (y) )
|
||||
#define MIN2(x, y) ( (x) < (y) ? (x) : (y) )
|
||||
#define MAX2(x, y) ( (x) > (y) ? (x) : (y) )
|
||||
#define ABS(a) ( (a) < 0 ? (-(a)) : (a) )
|
||||
|
||||
struct e_status {
|
||||
@ -96,7 +96,8 @@ static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *v
|
||||
/* we're not at the last vert, so end of the edge is the previous vertex */
|
||||
xend = v[i - 1].x;
|
||||
yend = v[i - 1].y;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
/* we're at the first vertex, so the "end" of this edge is the last vertex */
|
||||
xend = v[num_verts - 1].x;
|
||||
yend = v[num_verts - 1].y;
|
||||
@ -125,7 +126,8 @@ static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *v
|
||||
if (dx > 0) {
|
||||
e_new->xdir = 1;
|
||||
xdist = dx;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
e_new->xdir = -1;
|
||||
xdist = -dx;
|
||||
}
|
||||
@ -138,13 +140,15 @@ static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *v
|
||||
/* calculate deltas for incremental drawing */
|
||||
if (dx >= 0) {
|
||||
e_new->drift = 0;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
e_new->drift = -dy + 1;
|
||||
}
|
||||
if (dy >= xdist) {
|
||||
e_new->drift_inc = xdist;
|
||||
e_new->xshift = 0;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
e_new->drift_inc = xdist % dy;
|
||||
e_new->xshift = (xdist / dy) * e_new->xdir;
|
||||
}
|
||||
@ -187,7 +191,7 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
|
||||
* If the number of verts specified to render as a polygon is less than 3,
|
||||
* return immediately. Obviously we cant render a poly with sides < 3. The
|
||||
* return for this we set to 1, simply so it can be distinguished from the
|
||||
* next place we could return, /home/guest/blender-svn/soc-2011-tomato/intern/raskter/raskter.
|
||||
* next place we could return.
|
||||
* which is a failure to allocate memory.
|
||||
*/
|
||||
if (num_verts < 3) {
|
||||
@ -211,6 +215,12 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
|
||||
*/
|
||||
preprocess_all_edges(ctx, verts, num_verts, edgbuf);
|
||||
|
||||
/* can happen with a zero area mask */
|
||||
if (ctx->all_edges == NULL) {
|
||||
free(edgbuf);
|
||||
return(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the pointer for tracking the edges currently in processing to NULL to make sure
|
||||
* we don't get some crazy value after initialization.
|
||||
@ -258,7 +268,8 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
|
||||
edgec = &ctx->all_edges->e_next; /* Set our list to the next edge's location in memory. */
|
||||
ctx->all_edges = e_temp; /* Skip the NULL or bad X edge, set pointer to next edge. */
|
||||
break; /* Stop looping edges (since we ran out or hit empty X span. */
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
edgec = &e_curr->e_next; /* Set the pointer to the edge list the "next" edge. */
|
||||
}
|
||||
}
|
||||
@ -320,7 +331,8 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
|
||||
for (edgec = &ctx->possible_edges; (e_curr = *edgec); ) {
|
||||
if (!(--(e_curr->num))) {
|
||||
*edgec = e_curr->e_next;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
e_curr->x += e_curr->xshift;
|
||||
if ((e_curr->drift += e_curr->drift_inc) > 0) {
|
||||
e_curr->x += e_curr->xdir;
|
||||
@ -379,8 +391,9 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
|
||||
}
|
||||
|
||||
int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
|
||||
float *buf, int buf_x, int buf_y, int do_mask_AA) {
|
||||
int subdiv_AA = (do_mask_AA != 0)? 8:0;
|
||||
float *buf, int buf_x, int buf_y, int do_mask_AA)
|
||||
{
|
||||
int subdiv_AA = (do_mask_AA != 0) ? 8 : 0;
|
||||
int i; /* i: Loop counter. */
|
||||
int sAx;
|
||||
int sAy;
|
||||
@ -388,7 +401,7 @@ int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
|
||||
struct r_fill_context ctx = {0};
|
||||
const float buf_x_f = (float)(buf_x);
|
||||
const float buf_y_f = (float)(buf_y);
|
||||
float div_offset=(1.0f / (float)(subdiv_AA));
|
||||
float div_offset = (1.0f / (float)(subdiv_AA));
|
||||
float div_offset_static = 0.5f * (float)(subdiv_AA) * div_offset;
|
||||
/*
|
||||
* Allocate enough memory for our poly_vert list. It'll be the size of the poly_vert
|
||||
@ -413,21 +426,22 @@ int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
|
||||
* drawn will be 1.0f in value, there is no anti-aliasing.
|
||||
*/
|
||||
|
||||
if(!subdiv_AA) {
|
||||
for (i = 0; i < num_base_verts; i++) { /* Loop over all base_verts. */
|
||||
ply[i].x = (int)((base_verts[i][0] * buf_x_f) + 0.5f); /* Range expand normalized X to integer buffer-space X. */
|
||||
if (!subdiv_AA) {
|
||||
for (i = 0; i < num_base_verts; i++) { /* Loop over all base_verts. */
|
||||
ply[i].x = (int)((base_verts[i][0] * buf_x_f) + 0.5f); /* Range expand normalized X to integer buffer-space X. */
|
||||
ply[i].y = (int)((base_verts[i][1] * buf_y_f) + 0.5f); /* Range expand normalized Y to integer buffer-space Y. */
|
||||
}
|
||||
}
|
||||
|
||||
i = rast_scan_fill(&ctx, ply, num_base_verts,1.0f); /* Call our rasterizer, passing in the integer coords for each vert. */
|
||||
} else {
|
||||
for(sAx=0; sAx < subdiv_AA; sAx++) {
|
||||
for(sAy=0; sAy < subdiv_AA; sAy++) {
|
||||
for(i=0; i < num_base_verts; i++) {
|
||||
ply[i].x = (int)((base_verts[i][0]*buf_x_f)+0.5f - div_offset_static + (div_offset*(float)(sAx)));
|
||||
ply[i].y = (int)((base_verts[i][1]*buf_y_f)+0.5f - div_offset_static + (div_offset*(float)(sAy)));
|
||||
i = rast_scan_fill(&ctx, ply, num_base_verts, 1.0f); /* Call our rasterizer, passing in the integer coords for each vert. */
|
||||
}
|
||||
else {
|
||||
for (sAx = 0; sAx < subdiv_AA; sAx++) {
|
||||
for (sAy = 0; sAy < subdiv_AA; sAy++) {
|
||||
for (i = 0; i < num_base_verts; i++) {
|
||||
ply[i].x = (int)((base_verts[i][0] * buf_x_f) + 0.5f - div_offset_static + (div_offset * (float)(sAx)));
|
||||
ply[i].y = (int)((base_verts[i][1] * buf_y_f) + 0.5f - div_offset_static + (div_offset * (float)(sAy)));
|
||||
}
|
||||
i = rast_scan_fill(&ctx, ply, num_base_verts,(1.0f / (float)(subdiv_AA*subdiv_AA)));
|
||||
i = rast_scan_fill(&ctx, ply, num_base_verts, (1.0f / (float)(subdiv_AA * subdiv_AA)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -442,7 +456,8 @@ int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
|
||||
*/
|
||||
static int rast_scan_feather(struct r_fill_context *ctx,
|
||||
float (*base_verts_f)[2], int num_base_verts,
|
||||
struct poly_vert *feather_verts, float(*feather_verts_f)[2], int num_feather_verts) {
|
||||
struct poly_vert *feather_verts, float(*feather_verts_f)[2], int num_feather_verts)
|
||||
{
|
||||
int x_curr; /* current pixel position in X */
|
||||
int y_curr; /* current scan line being drawn */
|
||||
int yp; /* y-pixel's position in frame buffer */
|
||||
@ -477,7 +492,7 @@ static int rast_scan_feather(struct r_fill_context *ctx,
|
||||
* If the number of verts specified to render as a polygon is less than 3,
|
||||
* return immediately. Obviously we cant render a poly with sides < 3. The
|
||||
* return for this we set to 1, simply so it can be distinguished from the
|
||||
* next place we could return, /home/guest/blender-svn/soc-2011-tomato/intern/raskter/raskter
|
||||
* next place we could return,
|
||||
* which is a failure to allocate memory.
|
||||
*/
|
||||
if (num_feather_verts < 3) {
|
||||
@ -501,6 +516,12 @@ static int rast_scan_feather(struct r_fill_context *ctx,
|
||||
*/
|
||||
preprocess_all_edges(ctx, feather_verts, num_feather_verts, edgbuf);
|
||||
|
||||
/* can happen with a zero area mask */
|
||||
if (ctx->all_edges == NULL) {
|
||||
free(edgbuf);
|
||||
return(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the pointer for tracking the edges currently in processing to NULL to make sure
|
||||
* we don't get some crazy value after initialization.
|
||||
@ -548,7 +569,8 @@ static int rast_scan_feather(struct r_fill_context *ctx,
|
||||
edgec = &ctx->all_edges->e_next; /* Set our list to the next edge's location in memory. */
|
||||
ctx->all_edges = e_temp; /* Skip the NULL or bad X edge, set pointer to next edge. */
|
||||
break; /* Stop looping edges (since we ran out or hit empty X span. */
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
edgec = &e_curr->e_next; /* Set the pointer to the edge list the "next" edge. */
|
||||
}
|
||||
}
|
||||
@ -658,7 +680,8 @@ static int rast_scan_feather(struct r_fill_context *ctx,
|
||||
for (edgec = &ctx->possible_edges; (e_curr = *edgec); ) {
|
||||
if (!(--(e_curr->num))) {
|
||||
*edgec = e_curr->e_next;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
e_curr->x += e_curr->xshift;
|
||||
if ((e_curr->drift += e_curr->drift_inc) > 0) {
|
||||
e_curr->x += e_curr->xdir;
|
||||
@ -992,7 +1015,8 @@ int PLX_antialias_buffer(float *buf, int buf_x, int buf_y)
|
||||
if(!horzSpan) {
|
||||
lumaN = lumaW;
|
||||
lumaS = lumaE;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
lengthSign = 1.0f / (float)(buf_y);
|
||||
}
|
||||
subpixB = (subpixA * (1.0f/12.0f)) - lumaM;
|
||||
@ -1014,7 +1038,8 @@ int PLX_antialias_buffer(float *buf, int buf_x, int buf_y)
|
||||
offNP_y = (horzSpan) ? 0.0f:(1.0f / (float)(buf_y));
|
||||
if(!horzSpan) {
|
||||
posB_x += lengthSign * 0.5f;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
posB_y += lengthSign * 0.5f;
|
||||
}
|
||||
|
||||
@ -1324,7 +1349,8 @@ int PLX_antialias_buffer(float *buf, int buf_x, int buf_y)
|
||||
pixelOffsetSubpix = MAX2(pixelOffsetGood, subpixH);
|
||||
if(!horzSpan) {
|
||||
posM_x += pixelOffsetSubpix * lengthSign;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
posM_y += pixelOffsetSubpix * lengthSign;
|
||||
}
|
||||
//may need bilinear filtered get_pixel_intensity() here...
|
||||
|
@ -234,7 +234,7 @@ inline void MTRand::seed( uint32 *const bigSeed, const uint32 seedLength )
|
||||
initialize(19650218UL);
|
||||
register int i = 1;
|
||||
register uint32 j = 0;
|
||||
register int k = ( N > seedLength ? N : seedLength );
|
||||
register int k = ( (uint32)N > seedLength ? (uint32)N : seedLength );
|
||||
for( ; k; --k )
|
||||
{
|
||||
state[i] =
|
||||
|
@ -198,8 +198,8 @@ extern "C" void smoke_export(FLUID_3D *fluid, float *dt, float *dx, float **dens
|
||||
*vyold = fluid->_yVelocityOld;
|
||||
*vzold = fluid->_zVelocityOld;
|
||||
*obstacles = fluid->_obstacles;
|
||||
dt = &(fluid->_dt);
|
||||
dx = &(fluid->_dx);
|
||||
*dt = fluid->_dt;
|
||||
*dx = fluid->_dx;
|
||||
|
||||
}
|
||||
|
||||
|
@ -157,8 +157,8 @@ def find_path_new(id_data, data_path, rna_update_dict, rna_update_from_map):
|
||||
|
||||
|
||||
def update_data_paths(rna_update):
|
||||
''' rna_update triple [(class_name, from, to), ...]
|
||||
'''
|
||||
""" rna_update triple [(class_name, from, to), ...]
|
||||
"""
|
||||
|
||||
# make a faster lookup dict
|
||||
rna_update_dict = {}
|
||||
|
@ -24,10 +24,9 @@
|
||||
|
||||
import os
|
||||
|
||||
# Quite an ugly hack… But the simplest solution for now!
|
||||
#import sys
|
||||
#sys.path.append(os.path.abspath(os.path.dirname(__file__)))
|
||||
import i18n.settings as settings
|
||||
# XXX Relative import does not work here when used from Blender...
|
||||
#from . import settings
|
||||
import bl_i18n_utils.settings as settings
|
||||
|
||||
|
||||
#classes = set()
|
||||
@ -108,8 +107,10 @@ def dump_messages_rna(messages, check_ctxt):
|
||||
path_resolve = type(bpy.context).__base__.path_resolve
|
||||
for idname in op_ids:
|
||||
op = get_instance(idname)
|
||||
if 'INTERNAL' in path_resolve(op, "bl_options"):
|
||||
blacklist_rna_class.append(idname)
|
||||
# XXX Do not skip INTERNAL's anymore, some of those ops
|
||||
# show up in UI now!
|
||||
# if 'INTERNAL' in path_resolve(op, "bl_options"):
|
||||
# blacklist_rna_class.append(idname)
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Collect builtin classes we don't need to doc
|
||||
@ -466,6 +467,8 @@ def dump_messages(do_messages, do_checks):
|
||||
keys = set()
|
||||
for c in check_ctxt.values():
|
||||
keys |= c
|
||||
# XXX Temp, see below
|
||||
keys -= check_ctxt["multi_rnatip"]
|
||||
for key in keys:
|
||||
if key in check_ctxt["undoc_ops"]:
|
||||
print("\tThe following operators are undocumented:")
|
@ -66,9 +66,32 @@ PYGETTEXT_CONTEXTS_DEFSRC = os.path.join("source", "blender", "blenfont",
|
||||
PYGETTEXT_CONTEXTS = "#define\\s+(BLF_I18NCONTEXT_[A-Z_0-9]+)\\s+\"([^\"]*)\""
|
||||
|
||||
# Keywords' regex.
|
||||
_str_whole_re = ("(?P<{_}>[\"'])(?:[^(?P={_})]|(?<=\\\\)(?P={_})|"
|
||||
"(?:(?P={_})\\s*\\+?\\s*(?P={_})))+(?P={_})")
|
||||
str_clean_re = "(?P<_grp>[\"'])(?P<clean>(?:[^(?P=_grp)]|(?<=\\\\)(?P=_grp))+)(?P=_grp)"
|
||||
# XXX Most unfortunately, we can't use named backreferences inside character sets,
|
||||
# which makes the regexes even more twisty... :/
|
||||
_str_base = (
|
||||
# Match void string
|
||||
"(?P<{_}1>[\"'])(?P={_}1)" # Get opening quote (' or "), and closing immediately.
|
||||
"|"
|
||||
# Or match non-void string
|
||||
"(?P<{_}2>[\"'])" # Get opening quote (' or ").
|
||||
"(?{capt}(?:"
|
||||
# This one is for crazy things like "hi \\\\\" folks!"...
|
||||
r"(?:(?!<\\)(?:\\\\)*\\(?=(?P={_}2)))|"
|
||||
# The most common case.
|
||||
".(?!(?P={_}2))"
|
||||
")+.)" # Don't forget the last char!
|
||||
"(?P={_}2)" # And closing quote.
|
||||
)
|
||||
str_clean_re = _str_base.format(_="g", capt="P<clean>")
|
||||
# Here we have to consider two different cases (empty string and other).
|
||||
_str_whole_re = (
|
||||
_str_base.format(_="{_}1_", capt=":") +
|
||||
# Optional loop start, this handles "split" strings...
|
||||
"(?:(?<=[\"'])\\s*(?=[\"'])(?:"
|
||||
+ _str_base.format(_="{_}2_", capt=":") +
|
||||
# End of loop.
|
||||
"))*"
|
||||
)
|
||||
_ctxt_re = r"(?P<ctxt_raw>(?:" + _str_whole_re.format(_="_ctxt") + r")|(?:[A-Z_0-9]+))"
|
||||
_msg_re = r"(?P<msg_raw>" + _str_whole_re.format(_="_msg") + r")"
|
||||
PYGETTEXT_KEYWORDS = (() +
|
||||
@ -252,7 +275,7 @@ SPELL_CACHE = os.path.join("/tmp", ".spell_cache")
|
||||
import sys
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
try:
|
||||
from i18n_override_settings import *
|
||||
from bl_i18n_override_settings import *
|
||||
except ImportError: # If no i18n_override_settings available, it’s no error!
|
||||
pass
|
||||
|
@ -38,6 +38,7 @@ dict_uimsgs = {
|
||||
"betweens", # yuck! in-betweens!
|
||||
"boolean", "booleans",
|
||||
"decrement",
|
||||
"derivate",
|
||||
"doesn", # doesn't
|
||||
"fader",
|
||||
"hoc", # ad-hoc
|
||||
@ -62,7 +63,7 @@ dict_uimsgs = {
|
||||
"autoscale",
|
||||
"autosmooth",
|
||||
"autosplit",
|
||||
"backface",
|
||||
"backface", "backfacing",
|
||||
"backimage",
|
||||
"backscattered",
|
||||
"bandnoise",
|
||||
@ -88,7 +89,7 @@ dict_uimsgs = {
|
||||
"fullscreen",
|
||||
"gridline",
|
||||
"hemi",
|
||||
"inscatter",
|
||||
"inscatter", "inscattering",
|
||||
"lightless",
|
||||
"lookup", "lookups",
|
||||
"mathutils",
|
||||
@ -146,7 +147,7 @@ dict_uimsgs = {
|
||||
"unbake",
|
||||
"uncomment",
|
||||
"undeformed",
|
||||
"undistort",
|
||||
"undistort", "undistortion",
|
||||
"ungroup",
|
||||
"unhide",
|
||||
"unindent",
|
||||
@ -161,15 +162,18 @@ dict_uimsgs = {
|
||||
"unspill",
|
||||
"unstitchable",
|
||||
"vectorscope",
|
||||
"whitespace", "whitespaces",
|
||||
"worldspace",
|
||||
"workflow",
|
||||
|
||||
# Neologisms, slangs
|
||||
"affectable",
|
||||
"automagic", "automagically",
|
||||
"blobby",
|
||||
"blockiness", "blocky",
|
||||
"collider", "colliders",
|
||||
"deformer", "deformers",
|
||||
"determinator",
|
||||
"editability",
|
||||
"keyer",
|
||||
"lacunarity",
|
||||
@ -180,6 +184,7 @@ dict_uimsgs = {
|
||||
"polygonization",
|
||||
"selectability",
|
||||
"slurph",
|
||||
"stitchable",
|
||||
"trackability",
|
||||
"transmissivity",
|
||||
"rasterized", "rasterization",
|
||||
@ -194,11 +199,15 @@ dict_uimsgs = {
|
||||
"config", "configs",
|
||||
"const",
|
||||
"coord", "coords",
|
||||
"degr",
|
||||
"dof",
|
||||
"dupli", "duplis",
|
||||
"eg",
|
||||
"esc",
|
||||
"expr",
|
||||
"fac",
|
||||
"fra",
|
||||
"frs",
|
||||
"grless",
|
||||
"http",
|
||||
"init",
|
||||
@ -210,6 +219,7 @@ dict_uimsgs = {
|
||||
"multicam",
|
||||
"num",
|
||||
"ok",
|
||||
"orco",
|
||||
"ortho",
|
||||
"persp",
|
||||
"pref", "prefs",
|
||||
@ -316,6 +326,7 @@ dict_uimsgs = {
|
||||
"breakdowner",
|
||||
"bspline",
|
||||
"bweight",
|
||||
"colorband",
|
||||
"datablock", "datablocks",
|
||||
"dopesheet",
|
||||
"dupliface", "duplifaces",
|
||||
@ -323,6 +334,8 @@ dict_uimsgs = {
|
||||
"dupliobject", "dupliob",
|
||||
"dupligroup",
|
||||
"duplivert",
|
||||
"editbone",
|
||||
"editmode",
|
||||
"fcurve", "fcurves",
|
||||
"fluidsim",
|
||||
"frameserver",
|
0
release/scripts/modules/i18n/update_trunk.py → release/scripts/modules/bl_i18n_utils/update_trunk.py
0
release/scripts/modules/i18n/update_trunk.py → release/scripts/modules/bl_i18n_utils/update_trunk.py
@ -31,16 +31,16 @@ op_get_instance = ops_module.get_instance
|
||||
|
||||
|
||||
class BPyOps(object):
|
||||
'''
|
||||
"""
|
||||
Fake module like class.
|
||||
|
||||
bpy.ops
|
||||
'''
|
||||
"""
|
||||
|
||||
def __getattr__(self, module):
|
||||
'''
|
||||
"""
|
||||
gets a bpy.ops submodule
|
||||
'''
|
||||
"""
|
||||
if module.startswith('__'):
|
||||
raise AttributeError(module)
|
||||
return BPyOpsSubMod(module)
|
||||
@ -69,20 +69,20 @@ class BPyOps(object):
|
||||
|
||||
|
||||
class BPyOpsSubMod(object):
|
||||
'''
|
||||
"""
|
||||
Utility class to fake submodules.
|
||||
|
||||
eg. bpy.ops.object
|
||||
'''
|
||||
"""
|
||||
__keys__ = ("module",)
|
||||
|
||||
def __init__(self, module):
|
||||
self.module = module
|
||||
|
||||
def __getattr__(self, func):
|
||||
'''
|
||||
"""
|
||||
gets a bpy.ops.submodule function
|
||||
'''
|
||||
"""
|
||||
if func.startswith('__'):
|
||||
raise AttributeError(func)
|
||||
return BPyOpsSubModOp(self.module, func)
|
||||
@ -105,11 +105,11 @@ class BPyOpsSubMod(object):
|
||||
|
||||
|
||||
class BPyOpsSubModOp(object):
|
||||
'''
|
||||
"""
|
||||
Utility class to fake submodule operators.
|
||||
|
||||
eg. bpy.ops.object.somefunc
|
||||
'''
|
||||
"""
|
||||
|
||||
__keys__ = ("module", "func")
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
"""
|
||||
This module contains utility functions specific to blender but
|
||||
not assosiated with blenders internal data.
|
||||
not associated with blenders internal data.
|
||||
"""
|
||||
|
||||
__all__ = (
|
||||
|
@ -19,7 +19,7 @@
|
||||
# <pep8-80 compliant>
|
||||
|
||||
"""
|
||||
Utility modules assosiated with the bpy module.
|
||||
Utility modules associated with the bpy module.
|
||||
"""
|
||||
|
||||
__all__ = (
|
||||
|
@ -330,7 +330,7 @@ path_reference_mode = EnumProperty(
|
||||
description="Method used to reference paths",
|
||||
items=(('AUTO', "Auto", "Use Relative paths with subdirectories only"),
|
||||
('ABSOLUTE', "Absolute", "Always write absolute paths"),
|
||||
('RELATIVE', "Relative", "Always write relative patsh "
|
||||
('RELATIVE', "Relative", "Always write relative paths "
|
||||
"(where possible)"),
|
||||
('MATCH', "Match", "Match Absolute/Relative "
|
||||
"setting with input path"),
|
||||
|
@ -319,7 +319,7 @@ def edge_loops_from_edges(mesh, edges=None):
|
||||
|
||||
|
||||
def ngon_tessellate(from_data, indices, fix_loops=True):
|
||||
'''
|
||||
"""
|
||||
Takes a polyline of indices (fgon) and returns a list of face
|
||||
indicie lists. Designed to be used for importers that need indices for an
|
||||
fgon to create from existing verts.
|
||||
@ -329,7 +329,7 @@ def ngon_tessellate(from_data, indices, fix_loops=True):
|
||||
to fill, and can be a subset of the data given.
|
||||
fix_loops: If this is enabled polylines that use loops to make multiple
|
||||
polylines are delt with correctly.
|
||||
'''
|
||||
"""
|
||||
|
||||
from mathutils.geometry import tessellate_polygon
|
||||
from mathutils import Vector
|
||||
@ -352,9 +352,9 @@ def ngon_tessellate(from_data, indices, fix_loops=True):
|
||||
return v1[1], v2[1]
|
||||
|
||||
if not fix_loops:
|
||||
'''
|
||||
"""
|
||||
Normal single concave loop filling
|
||||
'''
|
||||
"""
|
||||
if type(from_data) in {tuple, list}:
|
||||
verts = [Vector(from_data[i]) for ii, i in enumerate(indices)]
|
||||
else:
|
||||
@ -368,10 +368,10 @@ def ngon_tessellate(from_data, indices, fix_loops=True):
|
||||
fill = tessellate_polygon([verts])
|
||||
|
||||
else:
|
||||
'''
|
||||
"""
|
||||
Seperate this loop into multiple loops be finding edges that are
|
||||
used twice. This is used by lightwave LWO files a lot
|
||||
'''
|
||||
"""
|
||||
|
||||
if type(from_data) in {tuple, list}:
|
||||
verts = [vert_treplet(Vector(from_data[i]), ii)
|
||||
|
@ -85,10 +85,10 @@ def _call_recursive(context, base, py_node):
|
||||
|
||||
|
||||
class BPyML_BaseUI():
|
||||
'''
|
||||
"""
|
||||
This is a mix-in class that defines a draw function
|
||||
which checks for draw_data
|
||||
'''
|
||||
"""
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
@ -48,14 +48,14 @@ def replace_help(namespace):
|
||||
|
||||
|
||||
def get_console(console_id):
|
||||
'''
|
||||
"""
|
||||
helper function for console operators
|
||||
currently each text data block gets its own
|
||||
console - code.InteractiveConsole()
|
||||
...which is stored in this function.
|
||||
|
||||
console_id can be any hashable type
|
||||
'''
|
||||
"""
|
||||
from code import InteractiveConsole
|
||||
|
||||
consoles = getattr(get_console, "consoles", None)
|
||||
|
@ -24,8 +24,8 @@ language_id = "shell"
|
||||
|
||||
|
||||
def add_scrollback(text, text_type):
|
||||
for l in text.split('\n'):
|
||||
bpy.ops.console.scrollback_append(text=l.replace('\t', ' '),
|
||||
for l in text.split("\n"):
|
||||
bpy.ops.console.scrollback_append(text=l.replace("\t", " "),
|
||||
type=text_type)
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ def shell_run(text):
|
||||
|
||||
add_scrollback(output, style)
|
||||
|
||||
PROMPT = '$ '
|
||||
PROMPT = "$ "
|
||||
|
||||
|
||||
def execute(context):
|
||||
|
@ -437,9 +437,9 @@ def BuildRNAInfo():
|
||||
# rna_functions_dict = {} # store all functions directly in this type (not inherited)
|
||||
|
||||
def full_rna_struct_path(rna_struct):
|
||||
'''
|
||||
"""
|
||||
Needed when referencing one struct from another
|
||||
'''
|
||||
"""
|
||||
nested = rna_struct.nested
|
||||
if nested:
|
||||
return "%s.%s" % (full_rna_struct_path(nested), rna_struct.identifier)
|
||||
|
@ -1,8 +1,6 @@
|
||||
import bpy
|
||||
settings = bpy.context.edit_movieclip.tracking.settings
|
||||
|
||||
settings.default_tracker = 'Hybrid'
|
||||
settings.default_pyramid_levels = 2
|
||||
settings.default_correlation_min = 0.75
|
||||
settings.default_pattern_size = 21
|
||||
settings.default_search_size = 100
|
||||
|
@ -1,8 +1,6 @@
|
||||
import bpy
|
||||
settings = bpy.context.edit_movieclip.tracking.settings
|
||||
|
||||
settings.default_tracker = 'KLT'
|
||||
settings.default_pyramid_levels = 4
|
||||
settings.default_correlation_min = 0.75
|
||||
settings.default_pattern_size = 11
|
||||
settings.default_search_size = 202
|
||||
|
@ -1,8 +1,6 @@
|
||||
import bpy
|
||||
settings = bpy.context.edit_movieclip.tracking.settings
|
||||
|
||||
settings.default_tracker = 'Hybrid'
|
||||
settings.default_pyramid_levels = 2
|
||||
settings.default_correlation_min = 0.75
|
||||
settings.default_pattern_size = 11
|
||||
settings.default_search_size = 61
|
||||
|
@ -1,8 +1,6 @@
|
||||
import bpy
|
||||
settings = bpy.context.edit_movieclip.tracking.settings
|
||||
|
||||
settings.default_tracker = 'Hybrid'
|
||||
settings.default_pyramid_levels = 2
|
||||
settings.default_correlation_min = 0.7
|
||||
settings.default_pattern_size = 31
|
||||
settings.default_search_size = 300
|
||||
|
@ -84,7 +84,7 @@ def add_torus(major_rad, minor_rad, major_seg, minor_seg):
|
||||
|
||||
|
||||
class AddTorus(Operator, object_utils.AddObjectHelper):
|
||||
'''Add a torus mesh'''
|
||||
"""Add a torus mesh"""
|
||||
bl_idname = "mesh.primitive_torus_add"
|
||||
bl_label = "Add Torus"
|
||||
bl_options = {'REGISTER', 'UNDO', 'PRESET'}
|
||||
|
@ -105,8 +105,6 @@ def CLIP_default_settings_from_track(clip, track):
|
||||
search[0] = search[0] * width
|
||||
search[1] = search[1] * height
|
||||
|
||||
settings.default_tracker = track.tracker
|
||||
settings.default_pyramid_levels = track.pyramid_levels
|
||||
settings.default_correlation_min = track.correlation_min
|
||||
settings.default_pattern_size = max(pattern[0], pattern[1])
|
||||
settings.default_search_size = max(search[0], search[1])
|
||||
@ -497,7 +495,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
|
||||
fg = rlayers[0]
|
||||
fg.name = 'Foreground'
|
||||
else:
|
||||
fg = scene.render.layers.new('Foreground')
|
||||
fg = scene.render.layers.new("Foreground")
|
||||
|
||||
fg.use_sky = False
|
||||
fg.layers = [True] + [False] * 19
|
||||
@ -505,7 +503,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
|
||||
fg.use_pass_vector = True
|
||||
|
||||
if not scene.render.layers.get("Background"):
|
||||
bg = scene.render.layers.new('Background')
|
||||
bg = scene.render.layers.new("Background")
|
||||
bg.use_pass_shadow = True
|
||||
bg.use_pass_ambient_occlusion = True
|
||||
bg.layers = [False] * 10 + [True] + [False] * 9
|
||||
@ -560,7 +558,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
|
||||
space.show_backdrop = True
|
||||
|
||||
CLIP_spaces_walk(context, True, 'NODE_EDITOR', 'NODE_EDITOR',
|
||||
setup_space)
|
||||
setup_space)
|
||||
|
||||
sc = context.space_data
|
||||
scene = context.scene
|
||||
@ -612,46 +610,46 @@ class CLIP_OT_setup_tracking_scene(Operator):
|
||||
add_shadow.blend_type = 'ADD'
|
||||
|
||||
mul_shadow.blend_type = 'MULTIPLY'
|
||||
mul_shadow.inputs['Fac'].default_value = 0.8
|
||||
mul_shadow.inputs["Fac"].default_value = 0.8
|
||||
|
||||
mul_image.blend_type = 'MULTIPLY'
|
||||
mul_image.inputs['Fac'].default_value = 0.8
|
||||
mul_image.inputs["Fac"].default_value = 0.8
|
||||
|
||||
vector_blur.factor = 0.75
|
||||
|
||||
# create links
|
||||
tree.links.new(movieclip.outputs['Image'], distortion.inputs['Image'])
|
||||
tree.links.new(movieclip.outputs["Image"], distortion.inputs["Image"])
|
||||
|
||||
if need_stabilization:
|
||||
tree.links.new(distortion.outputs['Image'],
|
||||
stabilize.inputs['Image'])
|
||||
tree.links.new(stabilize.outputs['Image'], scale.inputs['Image'])
|
||||
tree.links.new(distortion.outputs["Image"],
|
||||
stabilize.inputs["Image"])
|
||||
tree.links.new(stabilize.outputs["Image"], scale.inputs["Image"])
|
||||
else:
|
||||
tree.links.new(distortion.outputs['Image'], scale.inputs['Image'])
|
||||
tree.links.new(distortion.outputs["Image"], scale.inputs["Image"])
|
||||
|
||||
tree.links.new(rlayer_bg.outputs['Alpha'], invert.inputs['Color'])
|
||||
tree.links.new(rlayer_bg.outputs["Alpha"], invert.inputs["Color"])
|
||||
|
||||
tree.links.new(invert.outputs['Color'], add_shadow.inputs[1])
|
||||
tree.links.new(rlayer_bg.outputs['Shadow'], add_shadow.inputs[2])
|
||||
tree.links.new(invert.outputs["Color"], add_shadow.inputs[1])
|
||||
tree.links.new(rlayer_bg.outputs["Shadow"], add_shadow.inputs[2])
|
||||
|
||||
tree.links.new(invert.outputs['Color'], add_ao.inputs[1])
|
||||
tree.links.new(rlayer_bg.outputs['AO'], add_ao.inputs[2])
|
||||
tree.links.new(invert.outputs["Color"], add_ao.inputs[1])
|
||||
tree.links.new(rlayer_bg.outputs["AO"], add_ao.inputs[2])
|
||||
|
||||
tree.links.new(add_ao.outputs['Image'], mul_shadow.inputs[1])
|
||||
tree.links.new(add_shadow.outputs['Image'], mul_shadow.inputs[2])
|
||||
tree.links.new(add_ao.outputs["Image"], mul_shadow.inputs[1])
|
||||
tree.links.new(add_shadow.outputs["Image"], mul_shadow.inputs[2])
|
||||
|
||||
tree.links.new(scale.outputs['Image'], mul_image.inputs[1])
|
||||
tree.links.new(mul_shadow.outputs['Image'], mul_image.inputs[2])
|
||||
tree.links.new(scale.outputs["Image"], mul_image.inputs[1])
|
||||
tree.links.new(mul_shadow.outputs["Image"], mul_image.inputs[2])
|
||||
|
||||
tree.links.new(rlayer_fg.outputs['Image'], vector_blur.inputs['Image'])
|
||||
tree.links.new(rlayer_fg.outputs['Z'], vector_blur.inputs['Z'])
|
||||
tree.links.new(rlayer_fg.outputs['Speed'], vector_blur.inputs['Speed'])
|
||||
tree.links.new(rlayer_fg.outputs["Image"], vector_blur.inputs["Image"])
|
||||
tree.links.new(rlayer_fg.outputs["Z"], vector_blur.inputs["Z"])
|
||||
tree.links.new(rlayer_fg.outputs["Speed"], vector_blur.inputs["Speed"])
|
||||
|
||||
tree.links.new(mul_image.outputs['Image'], alphaover.inputs[1])
|
||||
tree.links.new(vector_blur.outputs['Image'], alphaover.inputs[2])
|
||||
tree.links.new(mul_image.outputs["Image"], alphaover.inputs[1])
|
||||
tree.links.new(vector_blur.outputs["Image"], alphaover.inputs[2])
|
||||
|
||||
tree.links.new(alphaover.outputs['Image'], composite.inputs['Image'])
|
||||
tree.links.new(alphaover.outputs['Image'], viewer.inputs['Image'])
|
||||
tree.links.new(alphaover.outputs["Image"], composite.inputs["Image"])
|
||||
tree.links.new(alphaover.outputs["Image"], viewer.inputs["Image"])
|
||||
|
||||
# place nodes
|
||||
movieclip.location = Vector((-300.0, 350.0))
|
||||
|
@ -24,7 +24,7 @@ from bpy.props import StringProperty
|
||||
|
||||
|
||||
class EditExternally(Operator):
|
||||
'''Edit image in an external application'''
|
||||
"""Edit image in an external application"""
|
||||
bl_idname = "image.external_edit"
|
||||
bl_label = "Image Edit Externally"
|
||||
bl_options = {'REGISTER'}
|
||||
|
@ -25,7 +25,7 @@ from bpy.props import EnumProperty
|
||||
|
||||
|
||||
class MeshMirrorUV(Operator):
|
||||
'''Copy mirror UV coordinates on the X axis based on a mirrored mesh'''
|
||||
"""Copy mirror UV coordinates on the X axis based on a mirrored mesh"""
|
||||
bl_idname = "mesh.faces_mirror_uv"
|
||||
bl_label = "Copy Mirrored UV coords"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
@ -27,7 +27,7 @@ from bpy.props import (StringProperty,
|
||||
|
||||
|
||||
class SelectPattern(Operator):
|
||||
'''Select objects matching a naming pattern'''
|
||||
"""Select objects matching a naming pattern"""
|
||||
bl_idname = "object.select_pattern"
|
||||
bl_label = "Select Pattern"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
@ -105,7 +105,7 @@ class SelectPattern(Operator):
|
||||
|
||||
|
||||
class SelectCamera(Operator):
|
||||
'''Select the active camera'''
|
||||
"""Select the active camera"""
|
||||
bl_idname = "object.select_camera"
|
||||
bl_label = "Select Camera"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
@ -131,7 +131,7 @@ class SelectCamera(Operator):
|
||||
|
||||
|
||||
class SelectHierarchy(Operator):
|
||||
"""Select object relative to the active object's position """
|
||||
"""Select object relative to the active object's position """ \
|
||||
"""in the hierarchy"""
|
||||
bl_idname = "object.select_hierarchy"
|
||||
bl_label = "Select Hierarchy"
|
||||
@ -198,7 +198,7 @@ class SelectHierarchy(Operator):
|
||||
|
||||
|
||||
class SubdivisionSet(Operator):
|
||||
'''Sets a Subdivision Surface Level (1-5)'''
|
||||
"""Sets a Subdivision Surface Level (1-5)"""
|
||||
|
||||
bl_idname = "object.subdivision_set"
|
||||
bl_label = "Subdivision Set"
|
||||
@ -278,7 +278,7 @@ class SubdivisionSet(Operator):
|
||||
|
||||
|
||||
class ShapeTransfer(Operator):
|
||||
"""Copy another selected objects active shape to this one by """
|
||||
"""Copy another selected objects active shape to this one by """ \
|
||||
"""applying the relative offsets"""
|
||||
|
||||
bl_idname = "object.shape_key_transfer"
|
||||
@ -468,7 +468,7 @@ class ShapeTransfer(Operator):
|
||||
|
||||
|
||||
class JoinUVs(Operator):
|
||||
'''Copy UV Layout to objects with matching geometry'''
|
||||
"""Copy UV Layout to objects with matching geometry"""
|
||||
bl_idname = "object.join_uvs"
|
||||
bl_label = "Join as UVs"
|
||||
|
||||
@ -547,7 +547,7 @@ class JoinUVs(Operator):
|
||||
|
||||
|
||||
class MakeDupliFace(Operator):
|
||||
'''Make linked objects into dupli-faces'''
|
||||
"""Make linked objects into dupli-faces"""
|
||||
bl_idname = "object.make_dupli_face"
|
||||
bl_label = "Make Dupli-Face"
|
||||
|
||||
@ -642,7 +642,7 @@ class IsolateTypeRender(Operator):
|
||||
|
||||
|
||||
class ClearAllRestrictRender(Operator):
|
||||
'''Reveal all render objects by setting the hide render flag'''
|
||||
"""Reveal all render objects by setting the hide render flag"""
|
||||
bl_idname = "object.hide_render_clear_all"
|
||||
bl_label = "Clear All Restrict Render"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
@ -654,7 +654,7 @@ class ClearAllRestrictRender(Operator):
|
||||
|
||||
|
||||
class TransformsToDeltasAnim(Operator):
|
||||
'''Convert object animation for normal transforms to delta transforms'''
|
||||
"""Convert object animation for normal transforms to delta transforms"""
|
||||
bl_idname = "object.anim_transforms_to_deltas"
|
||||
bl_label = "Animated Transforms to Deltas"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
@ -700,7 +700,7 @@ class TransformsToDeltasAnim(Operator):
|
||||
|
||||
|
||||
class DupliOffsetFromCursor(Operator):
|
||||
'''Set offset used for DupliGroup based on cursor position'''
|
||||
"""Set offset used for DupliGroup based on cursor position"""
|
||||
bl_idname = "object.dupli_offset_from_cursor"
|
||||
bl_label = "Set Offset From Cursor"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
@ -341,7 +341,7 @@ from bpy.props import EnumProperty, BoolProperty
|
||||
|
||||
|
||||
class AlignObjects(Operator):
|
||||
'''Align Objects'''
|
||||
"""Align Objects"""
|
||||
bl_idname = "object.align"
|
||||
bl_label = "Align Objects"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
@ -95,7 +95,7 @@ from bpy.props import (IntProperty,
|
||||
|
||||
|
||||
class RandomizeLocRotSize(Operator):
|
||||
'''Randomize objects loc/rot/scale'''
|
||||
"""Randomize objects loc/rot/scale"""
|
||||
bl_idname = "object.randomize_transform"
|
||||
bl_label = "Randomize Transform"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
@ -120,7 +120,7 @@ class RandomizeLocRotSize(Operator):
|
||||
)
|
||||
loc = FloatVectorProperty(
|
||||
name="Location",
|
||||
description=("Maximun distance the objects "
|
||||
description=("Maximum distance the objects "
|
||||
"can spread over each axis"),
|
||||
min=-100.0,
|
||||
max=100.0,
|
||||
@ -134,7 +134,7 @@ class RandomizeLocRotSize(Operator):
|
||||
)
|
||||
rot = FloatVectorProperty(
|
||||
name="Rotation",
|
||||
description="Maximun rotation over each axis",
|
||||
description="Maximum rotation over each axis",
|
||||
min=-3.141592, # math.pi
|
||||
max=+3.141592,
|
||||
default=(0.0, 0.0, 0.0),
|
||||
|
@ -24,10 +24,10 @@ from bpy.props import StringProperty, BoolProperty
|
||||
|
||||
|
||||
class AddPresetBase():
|
||||
'''Base preset class, only for subclassing
|
||||
"""Base preset class, only for subclassing
|
||||
subclasses must define
|
||||
- preset_values
|
||||
- preset_subdir '''
|
||||
- preset_subdir """
|
||||
# bl_idname = "script.preset_base_add"
|
||||
# bl_label = "Add a Python Preset"
|
||||
bl_options = {'REGISTER'} # only because invoke_props_popup requires.
|
||||
@ -179,7 +179,7 @@ class AddPresetBase():
|
||||
|
||||
|
||||
class ExecutePreset(Operator):
|
||||
'''Execute a preset'''
|
||||
"""Execute a preset"""
|
||||
bl_idname = "script.execute_preset"
|
||||
bl_label = "Execute a Python Preset"
|
||||
|
||||
@ -217,7 +217,7 @@ class ExecutePreset(Operator):
|
||||
|
||||
|
||||
class AddPresetRender(AddPresetBase, Operator):
|
||||
'''Add a Render Preset'''
|
||||
"""Add a Render Preset"""
|
||||
bl_idname = "render.preset_add"
|
||||
bl_label = "Add Render Preset"
|
||||
preset_menu = "RENDER_MT_presets"
|
||||
@ -243,7 +243,7 @@ class AddPresetRender(AddPresetBase, Operator):
|
||||
|
||||
|
||||
class AddPresetCamera(AddPresetBase, Operator):
|
||||
'''Add a Camera Preset'''
|
||||
"""Add a Camera Preset"""
|
||||
bl_idname = "camera.preset_add"
|
||||
bl_label = "Add Camera Preset"
|
||||
preset_menu = "CAMERA_MT_presets"
|
||||
@ -262,7 +262,7 @@ class AddPresetCamera(AddPresetBase, Operator):
|
||||
|
||||
|
||||
class AddPresetSSS(AddPresetBase, Operator):
|
||||
'''Add a Subsurface Scattering Preset'''
|
||||
"""Add a Subsurface Scattering Preset"""
|
||||
bl_idname = "material.sss_preset_add"
|
||||
bl_label = "Add SSS Preset"
|
||||
preset_menu = "MATERIAL_MT_sss_presets"
|
||||
@ -290,7 +290,7 @@ class AddPresetSSS(AddPresetBase, Operator):
|
||||
|
||||
|
||||
class AddPresetCloth(AddPresetBase, Operator):
|
||||
'''Add a Cloth Preset'''
|
||||
"""Add a Cloth Preset"""
|
||||
bl_idname = "cloth.preset_add"
|
||||
bl_label = "Add Cloth Preset"
|
||||
preset_menu = "CLOTH_MT_presets"
|
||||
@ -312,7 +312,7 @@ class AddPresetCloth(AddPresetBase, Operator):
|
||||
|
||||
|
||||
class AddPresetFluid(AddPresetBase, Operator):
|
||||
'''Add a Fluid Preset'''
|
||||
"""Add a Fluid Preset"""
|
||||
bl_idname = "fluid.preset_add"
|
||||
bl_label = "Add Fluid Preset"
|
||||
preset_menu = "FLUID_MT_presets"
|
||||
@ -330,7 +330,7 @@ class AddPresetFluid(AddPresetBase, Operator):
|
||||
|
||||
|
||||
class AddPresetSunSky(AddPresetBase, Operator):
|
||||
'''Add a Sky & Atmosphere Preset'''
|
||||
"""Add a Sky & Atmosphere Preset"""
|
||||
bl_idname = "lamp.sunsky_preset_add"
|
||||
bl_label = "Add Sunsky Preset"
|
||||
preset_menu = "LAMP_MT_sunsky_presets"
|
||||
@ -359,7 +359,7 @@ class AddPresetSunSky(AddPresetBase, Operator):
|
||||
|
||||
|
||||
class AddPresetInteraction(AddPresetBase, Operator):
|
||||
'''Add an Application Interaction Preset'''
|
||||
"""Add an Application Interaction Preset"""
|
||||
bl_idname = "wm.interaction_preset_add"
|
||||
bl_label = "Add Interaction Preset"
|
||||
preset_menu = "USERPREF_MT_interaction_presets"
|
||||
@ -385,7 +385,7 @@ class AddPresetInteraction(AddPresetBase, Operator):
|
||||
|
||||
|
||||
class AddPresetTrackingCamera(AddPresetBase, Operator):
|
||||
'''Add a Tracking Camera Intrinsics Preset'''
|
||||
"""Add a Tracking Camera Intrinsics Preset"""
|
||||
bl_idname = "clip.camera_preset_add"
|
||||
bl_label = "Add Camera Preset"
|
||||
preset_menu = "CLIP_MT_camera_presets"
|
||||
@ -408,7 +408,7 @@ class AddPresetTrackingCamera(AddPresetBase, Operator):
|
||||
|
||||
|
||||
class AddPresetTrackingTrackColor(AddPresetBase, Operator):
|
||||
'''Add a Clip Track Color Preset'''
|
||||
"""Add a Clip Track Color Preset"""
|
||||
bl_idname = "clip.track_color_preset_add"
|
||||
bl_label = "Add Track Color Preset"
|
||||
preset_menu = "CLIP_MT_track_color_presets"
|
||||
@ -426,7 +426,7 @@ class AddPresetTrackingTrackColor(AddPresetBase, Operator):
|
||||
|
||||
|
||||
class AddPresetTrackingSettings(AddPresetBase, Operator):
|
||||
'''Add a motion tracking settings preset'''
|
||||
"""Add a motion tracking settings preset"""
|
||||
bl_idname = "clip.tracking_settings_preset_add"
|
||||
bl_label = "Add Tracking Settings Preset"
|
||||
preset_menu = "CLIP_MT_tracking_settings_presets"
|
||||
@ -436,8 +436,6 @@ class AddPresetTrackingSettings(AddPresetBase, Operator):
|
||||
]
|
||||
|
||||
preset_values = [
|
||||
"settings.default_tracker",
|
||||
"settings.default_pyramid_levels",
|
||||
"settings.default_correlation_min",
|
||||
"settings.default_pattern_size",
|
||||
"settings.default_search_size",
|
||||
@ -453,7 +451,7 @@ class AddPresetTrackingSettings(AddPresetBase, Operator):
|
||||
|
||||
|
||||
class AddPresetNodeColor(AddPresetBase, Operator):
|
||||
'''Add a Node Color Preset'''
|
||||
"""Add a Node Color Preset"""
|
||||
bl_idname = "node.node_color_preset_add"
|
||||
bl_label = "Add Node Color Preset"
|
||||
preset_menu = "NODE_MT_node_color_presets"
|
||||
@ -471,7 +469,7 @@ class AddPresetNodeColor(AddPresetBase, Operator):
|
||||
|
||||
|
||||
class AddPresetInterfaceTheme(AddPresetBase, Operator):
|
||||
'''Add a theme preset'''
|
||||
"""Add a theme preset"""
|
||||
bl_idname = "wm.interface_theme_preset_add"
|
||||
bl_label = "Add Tracking Settings Preset"
|
||||
preset_menu = "USERPREF_MT_interface_theme_presets"
|
||||
@ -479,7 +477,7 @@ class AddPresetInterfaceTheme(AddPresetBase, Operator):
|
||||
|
||||
|
||||
class AddPresetKeyconfig(AddPresetBase, Operator):
|
||||
'''Add a Key-config Preset'''
|
||||
"""Add a Key-config Preset"""
|
||||
bl_idname = "wm.keyconfig_preset_add"
|
||||
bl_label = "Add Keyconfig Preset"
|
||||
preset_menu = "USERPREF_MT_keyconfigs"
|
||||
@ -502,7 +500,7 @@ class AddPresetKeyconfig(AddPresetBase, Operator):
|
||||
|
||||
|
||||
class AddPresetOperator(AddPresetBase, Operator):
|
||||
'''Add an Application Interaction Preset'''
|
||||
"""Add an Application Interaction Preset"""
|
||||
bl_idname = "wm.operator_preset_add"
|
||||
bl_label = "Operator Preset"
|
||||
preset_menu = "WM_MT_operator_presets"
|
||||
|
@ -66,7 +66,7 @@ def guess_player_path(preset):
|
||||
|
||||
|
||||
class PlayRenderedAnim(Operator):
|
||||
'''Play back rendered frames/movies using an external player'''
|
||||
"""Play back rendered frames/movies using an external player"""
|
||||
bl_idname = "render.play_rendered_anim"
|
||||
bl_label = "Play Rendered Animation"
|
||||
bl_options = {'REGISTER'}
|
||||
|
@ -25,7 +25,7 @@ from bpy.props import IntProperty
|
||||
|
||||
|
||||
class SequencerCrossfadeSounds(Operator):
|
||||
'''Do cross-fading volume animation of two selected sound strips'''
|
||||
"""Do cross-fading volume animation of two selected sound strips"""
|
||||
|
||||
bl_idname = "sequencer.crossfade_sounds"
|
||||
bl_label = "Crossfade sounds"
|
||||
@ -76,7 +76,7 @@ class SequencerCrossfadeSounds(Operator):
|
||||
|
||||
|
||||
class SequencerCutMulticam(Operator):
|
||||
'''Cut multi-cam strip and select camera'''
|
||||
"""Cut multi-cam strip and select camera"""
|
||||
|
||||
bl_idname = "sequencer.cut_multicam"
|
||||
bl_label = "Cut multicam"
|
||||
@ -118,7 +118,7 @@ class SequencerCutMulticam(Operator):
|
||||
|
||||
|
||||
class SequencerDeinterlaceSelectedMovies(Operator):
|
||||
'''Deinterlace all selected movie sources'''
|
||||
"""Deinterlace all selected movie sources"""
|
||||
|
||||
bl_idname = "sequencer.deinterlace_selected_movies"
|
||||
bl_label = "Deinterlace Movies"
|
||||
|
@ -46,11 +46,11 @@ def extend(obj, operator, EXTEND_MODE):
|
||||
OTHER_INDEX = 2, 3, 0, 1
|
||||
|
||||
def extend_uvs(face_source, face_target, edge_key):
|
||||
'''
|
||||
"""
|
||||
Takes 2 faces,
|
||||
Projects its extends its UV coords onto the face next to it.
|
||||
Both faces must share an edge
|
||||
'''
|
||||
"""
|
||||
|
||||
def face_edge_vs(vi):
|
||||
vlen = len(vi)
|
||||
@ -224,7 +224,7 @@ def main(context, operator):
|
||||
|
||||
|
||||
class FollowActiveQuads(Operator):
|
||||
'''Follow UVs from active quads along continuous face loops'''
|
||||
"""Follow UVs from active quads along continuous face loops"""
|
||||
bl_idname = "uv.follow_active_quads"
|
||||
bl_label = "Follow Active Quads"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
@ -232,7 +232,7 @@ class FollowActiveQuads(Operator):
|
||||
mode = bpy.props.EnumProperty(
|
||||
name="Edge Length Mode",
|
||||
description="Method to space UV edge loops",
|
||||
items=(('EVEN', "Even", "Space all UVs evently"),
|
||||
items=(('EVEN', "Even", "Space all UVs evenly"),
|
||||
('LENGTH', "Length", "Average space UVs edge length of each loop")),
|
||||
default='LENGTH',
|
||||
)
|
||||
|
@ -197,12 +197,12 @@ def lightmap_uvpack(meshes,
|
||||
PREF_BOX_DIV=8,
|
||||
PREF_MARGIN_DIV=512
|
||||
):
|
||||
'''
|
||||
"""
|
||||
BOX_DIV if the maximum division of the UV map that
|
||||
a box may be consolidated into.
|
||||
Basically, a lower value will be slower but waist less space
|
||||
and a higher value will have more clumpy boxes but more wasted space
|
||||
'''
|
||||
"""
|
||||
import time
|
||||
from math import sqrt
|
||||
|
||||
@ -545,7 +545,7 @@ from bpy.props import BoolProperty, FloatProperty, IntProperty
|
||||
|
||||
|
||||
class LightMapPack(Operator):
|
||||
'''Follow UVs from active quads along continuous face loops'''
|
||||
"""Follow UVs from active quads along continuous face loops"""
|
||||
bl_idname = "uv.lightmap_pack"
|
||||
bl_label = "Lightmap Pack"
|
||||
|
||||
@ -561,7 +561,7 @@ class LightMapPack(Operator):
|
||||
|
||||
PREF_CONTEXT = bpy.props.EnumProperty(
|
||||
name="Selection",
|
||||
items=(('SEL_FACES', "Selected Faces", "Space all UVs evently"),
|
||||
items=(('SEL_FACES', "Selected Faces", "Space all UVs evenly"),
|
||||
('ALL_FACES', "All Faces", "Average space UVs edge length of each loop"),
|
||||
('ALL_OBJECTS', "Selected Mesh Object", "Average space UVs edge length of each loop")
|
||||
),
|
||||
|
@ -492,7 +492,7 @@ def mergeUvIslands(islandList):
|
||||
pass
|
||||
|
||||
if Intersect == 2: # Source inside target
|
||||
'''
|
||||
"""
|
||||
We have an intersection, if we are inside the target
|
||||
then move us 1 whole width across,
|
||||
Its possible this is a bad idea since 2 skinny Angular faces
|
||||
@ -500,7 +500,7 @@ def mergeUvIslands(islandList):
|
||||
since we have already tested for it.
|
||||
|
||||
It gives about 10% speedup with minimal errors.
|
||||
'''
|
||||
"""
|
||||
# Move the test along its width + SMALL_NUM
|
||||
#boxLeft += sourceIsland[4] + SMALL_NUM
|
||||
boxLeft += sourceIsland[4]
|
||||
@ -694,11 +694,11 @@ def packIslands(islandList):
|
||||
islandIdx -=1
|
||||
continue
|
||||
|
||||
'''Save the offset to be applied later,
|
||||
"""Save the offset to be applied later,
|
||||
we could apply to the UVs now and allign them to the bottom left hand area
|
||||
of the UV coords like the box packer imagines they are
|
||||
but, its quicker just to remember their offset and
|
||||
apply the packing and offset in 1 pass '''
|
||||
apply the packing and offset in 1 pass """
|
||||
islandOffsetList.append((minx, miny))
|
||||
|
||||
# Add to boxList. use the island idx for the BOX id.
|
||||
@ -709,7 +709,7 @@ def packIslands(islandList):
|
||||
# with the islands.
|
||||
|
||||
#print '\tPacking UV Islands...'
|
||||
#XXX Window.DrawProgressBar(0.7, 'Packing %i UV Islands...' % len(packBoxes) )
|
||||
#XXX Window.DrawProgressBar(0.7, "Packing %i UV Islands..." % len(packBoxes) )
|
||||
|
||||
# time1 = time.time()
|
||||
packWidth, packHeight = geometry.box_pack_2d(packBoxes)
|
||||
@ -720,7 +720,7 @@ def packIslands(islandList):
|
||||
# raise "Error packed boxes differs from original length"
|
||||
|
||||
#print '\tWriting Packed Data to faces'
|
||||
#XXX Window.DrawProgressBar(0.8, 'Writing Packed Data to faces')
|
||||
#XXX Window.DrawProgressBar(0.8, "Writing Packed Data to faces")
|
||||
|
||||
# Sort by ID, so there in sync again
|
||||
islandIdx = len(islandList)
|
||||
@ -1104,8 +1104,9 @@ from bpy.props import FloatProperty
|
||||
|
||||
|
||||
class SmartProject(Operator):
|
||||
'''This script projection unwraps the selected faces of a mesh ''' \
|
||||
'''(it operates on all selected mesh objects, and can be used to unwrap selected faces, or all faces)'''
|
||||
"""This script projection unwraps the selected faces of a mesh """ \
|
||||
"""(it operates on all selected mesh objects, and can be used """ \
|
||||
"""to unwrap selected faces, or all faces)"""
|
||||
bl_idname = "uv.smart_project"
|
||||
bl_label = "Smart UV Project"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
@ -31,7 +31,8 @@ from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear
|
||||
|
||||
|
||||
class MESH_OT_delete_edgeloop(Operator):
|
||||
'''Delete an edge loop by merging the faces on each side to a single face loop'''
|
||||
"""Delete an edge loop by merging the faces on each side """ \
|
||||
"""to a single face loop"""
|
||||
bl_idname = "mesh.delete_edgeloop"
|
||||
bl_label = "Delete Edge Loop"
|
||||
|
||||
@ -173,7 +174,7 @@ class BRUSH_OT_active_index_set(Operator):
|
||||
|
||||
|
||||
class WM_OT_context_set_boolean(Operator):
|
||||
'''Set a context value'''
|
||||
"""Set a context value"""
|
||||
bl_idname = "wm.context_set_boolean"
|
||||
bl_label = "Context Set Boolean"
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
@ -189,7 +190,7 @@ class WM_OT_context_set_boolean(Operator):
|
||||
|
||||
|
||||
class WM_OT_context_set_int(Operator): # same as enum
|
||||
'''Set a context value'''
|
||||
"""Set a context value"""
|
||||
bl_idname = "wm.context_set_int"
|
||||
bl_label = "Context Set"
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
@ -206,7 +207,7 @@ class WM_OT_context_set_int(Operator): # same as enum
|
||||
|
||||
|
||||
class WM_OT_context_scale_int(Operator):
|
||||
'''Scale an int context value'''
|
||||
"""Scale an int context value"""
|
||||
bl_idname = "wm.context_scale_int"
|
||||
bl_label = "Context Set"
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
@ -249,7 +250,7 @@ class WM_OT_context_scale_int(Operator):
|
||||
|
||||
|
||||
class WM_OT_context_set_float(Operator): # same as enum
|
||||
'''Set a context value'''
|
||||
"""Set a context value"""
|
||||
bl_idname = "wm.context_set_float"
|
||||
bl_label = "Context Set Float"
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
@ -266,7 +267,7 @@ class WM_OT_context_set_float(Operator): # same as enum
|
||||
|
||||
|
||||
class WM_OT_context_set_string(Operator): # same as enum
|
||||
'''Set a context value'''
|
||||
"""Set a context value"""
|
||||
bl_idname = "wm.context_set_string"
|
||||
bl_label = "Context Set String"
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
@ -282,7 +283,7 @@ class WM_OT_context_set_string(Operator): # same as enum
|
||||
|
||||
|
||||
class WM_OT_context_set_enum(Operator):
|
||||
'''Set a context value'''
|
||||
"""Set a context value"""
|
||||
bl_idname = "wm.context_set_enum"
|
||||
bl_label = "Context Set Enum"
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
@ -298,7 +299,7 @@ class WM_OT_context_set_enum(Operator):
|
||||
|
||||
|
||||
class WM_OT_context_set_value(Operator):
|
||||
'''Set a context value'''
|
||||
"""Set a context value"""
|
||||
bl_idname = "wm.context_set_value"
|
||||
bl_label = "Context Set Value"
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
@ -319,7 +320,7 @@ class WM_OT_context_set_value(Operator):
|
||||
|
||||
|
||||
class WM_OT_context_toggle(Operator):
|
||||
'''Toggle a context value'''
|
||||
"""Toggle a context value"""
|
||||
bl_idname = "wm.context_toggle"
|
||||
bl_label = "Context Toggle"
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
@ -338,7 +339,7 @@ class WM_OT_context_toggle(Operator):
|
||||
|
||||
|
||||
class WM_OT_context_toggle_enum(Operator):
|
||||
'''Toggle a context value'''
|
||||
"""Toggle a context value"""
|
||||
bl_idname = "wm.context_toggle_enum"
|
||||
bl_label = "Context Toggle Values"
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
@ -371,7 +372,7 @@ class WM_OT_context_toggle_enum(Operator):
|
||||
|
||||
|
||||
class WM_OT_context_cycle_int(Operator):
|
||||
"""Set a context value. Useful for cycling active material, """
|
||||
"""Set a context value. Useful for cycling active material, """ \
|
||||
"""vertex keys, groups' etc"""
|
||||
bl_idname = "wm.context_cycle_int"
|
||||
bl_label = "Context Int Cycle"
|
||||
@ -406,7 +407,7 @@ class WM_OT_context_cycle_int(Operator):
|
||||
|
||||
|
||||
class WM_OT_context_cycle_enum(Operator):
|
||||
'''Toggle a context value'''
|
||||
"""Toggle a context value"""
|
||||
bl_idname = "wm.context_cycle_enum"
|
||||
bl_label = "Context Enum Cycle"
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
@ -458,8 +459,8 @@ class WM_OT_context_cycle_enum(Operator):
|
||||
|
||||
|
||||
class WM_OT_context_cycle_array(Operator):
|
||||
'''Set a context array value. '''
|
||||
'''Useful for cycling the active mesh edit mode'''
|
||||
"""Set a context array value """ \
|
||||
"""(useful for cycling the active mesh edit mode)"""
|
||||
bl_idname = "wm.context_cycle_array"
|
||||
bl_label = "Context Array Cycle"
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
@ -519,7 +520,7 @@ class WM_OT_context_menu_enum(Operator):
|
||||
|
||||
|
||||
class WM_OT_context_set_id(Operator):
|
||||
'''Toggle a context value'''
|
||||
"""Toggle a context value"""
|
||||
bl_idname = "wm.context_set_id"
|
||||
bl_label = "Set Library ID"
|
||||
bl_options = {'UNDO', 'INTERNAL'}
|
||||
@ -575,7 +576,7 @@ data_path_item = StringProperty(
|
||||
|
||||
|
||||
class WM_OT_context_collection_boolean_set(Operator):
|
||||
'''Set boolean values for a collection of items'''
|
||||
"""Set boolean values for a collection of items"""
|
||||
bl_idname = "wm.context_collection_boolean_set"
|
||||
bl_label = "Context Collection Boolean Set"
|
||||
bl_options = {'UNDO', 'REGISTER', 'INTERNAL'}
|
||||
@ -634,7 +635,7 @@ class WM_OT_context_collection_boolean_set(Operator):
|
||||
|
||||
|
||||
class WM_OT_context_modal_mouse(Operator):
|
||||
'''Adjust arbitrary values with mouse input'''
|
||||
"""Adjust arbitrary values with mouse input"""
|
||||
bl_idname = "wm.context_modal_mouse"
|
||||
bl_label = "Context Modal Mouse"
|
||||
bl_options = {'GRAB_POINTER', 'BLOCKING', 'UNDO', 'INTERNAL'}
|
||||
@ -836,7 +837,7 @@ def _wm_doc_get_id(doc_id, do_url=True, url_prefix=""):
|
||||
|
||||
|
||||
class WM_OT_doc_view_manual(Operator):
|
||||
'''Load online manual'''
|
||||
"""Load online manual"""
|
||||
bl_idname = "wm.doc_view_manual"
|
||||
bl_label = "View Manual"
|
||||
|
||||
@ -881,7 +882,7 @@ class WM_OT_doc_view_manual(Operator):
|
||||
|
||||
|
||||
class WM_OT_doc_view(Operator):
|
||||
'''Load online reference docs'''
|
||||
"""Load online reference docs"""
|
||||
bl_idname = "wm.doc_view"
|
||||
bl_label = "View Documentation"
|
||||
|
||||
@ -905,7 +906,7 @@ class WM_OT_doc_view(Operator):
|
||||
|
||||
|
||||
class WM_OT_doc_edit(Operator):
|
||||
'''Load online reference docs'''
|
||||
"""Load online reference docs"""
|
||||
bl_idname = "wm.doc_edit"
|
||||
bl_label = "Edit Documentation"
|
||||
|
||||
@ -1008,7 +1009,7 @@ rna_max = FloatProperty(
|
||||
|
||||
|
||||
class WM_OT_properties_edit(Operator):
|
||||
'''Internal use (edit a property data_path)'''
|
||||
"""Internal use (edit a property data_path)"""
|
||||
bl_idname = "wm.properties_edit"
|
||||
bl_label = "Edit Property"
|
||||
bl_options = {'REGISTER'} # only because invoke_props_popup requires.
|
||||
@ -1094,7 +1095,7 @@ class WM_OT_properties_edit(Operator):
|
||||
|
||||
|
||||
class WM_OT_properties_add(Operator):
|
||||
'''Internal use (edit a property data_path)'''
|
||||
"""Internal use (edit a property data_path)"""
|
||||
bl_idname = "wm.properties_add"
|
||||
bl_label = "Add Property"
|
||||
bl_options = {'UNDO'}
|
||||
@ -1137,7 +1138,7 @@ class WM_OT_properties_context_change(Operator):
|
||||
|
||||
|
||||
class WM_OT_properties_remove(Operator):
|
||||
'''Internal use (edit a property data_path)'''
|
||||
"""Internal use (edit a property data_path)"""
|
||||
bl_idname = "wm.properties_remove"
|
||||
bl_label = "Remove Property"
|
||||
bl_options = {'UNDO'}
|
||||
@ -1203,7 +1204,7 @@ class WM_OT_appconfig_activate(Operator):
|
||||
|
||||
|
||||
class WM_OT_sysinfo(Operator):
|
||||
'''Generate System Info'''
|
||||
"""Generate System Info"""
|
||||
bl_idname = "wm.sysinfo"
|
||||
bl_label = "System Info"
|
||||
|
||||
@ -1214,7 +1215,7 @@ class WM_OT_sysinfo(Operator):
|
||||
|
||||
|
||||
class WM_OT_copy_prev_settings(Operator):
|
||||
'''Copy settings from previous version'''
|
||||
"""Copy settings from previous version"""
|
||||
bl_idname = "wm.copy_prev_settings"
|
||||
bl_label = "Copy Previous Settings"
|
||||
|
||||
@ -1251,7 +1252,7 @@ class WM_OT_copy_prev_settings(Operator):
|
||||
|
||||
|
||||
class WM_OT_blenderplayer_start(Operator):
|
||||
'''Launch the blender-player with the current blend-file'''
|
||||
"""Launch the blender-player with the current blend-file"""
|
||||
bl_idname = "wm.blenderplayer_start"
|
||||
bl_label = "Start Game In Player"
|
||||
|
||||
@ -1394,8 +1395,8 @@ class WM_OT_keyconfig_export(Operator):
|
||||
if not self.filepath:
|
||||
raise Exception("Filepath not set")
|
||||
|
||||
if not self.filepath.endswith('.py'):
|
||||
self.filepath += '.py'
|
||||
if not self.filepath.endswith(".py"):
|
||||
self.filepath += ".py"
|
||||
|
||||
wm = context.window_manager
|
||||
|
||||
|
@ -203,7 +203,7 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
|
||||
col.operator("poselib.pose_remove", icon='ZOOMOUT', text="")
|
||||
col.operator("poselib.apply_pose", icon='ZOOM_SELECTED', text="").pose_index = poselib.pose_markers.active_index
|
||||
|
||||
col.operator("poselib.action_sanitise", icon='HELP', text="") # XXX: put in menu?
|
||||
col.operator("poselib.action_sanitize", icon='HELP', text="") # XXX: put in menu?
|
||||
|
||||
# properties for active marker
|
||||
if pose_marker_active is not None:
|
||||
@ -304,7 +304,7 @@ class DATA_PT_motion_paths(MotionPathButtonsPanel, Panel):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
avs = ob.pose.animation_visualisation
|
||||
avs = ob.pose.animation_visualization
|
||||
|
||||
pchan = context.active_pose_bone
|
||||
mpath = pchan.motion_path if pchan else None
|
||||
@ -323,7 +323,7 @@ class DATA_PT_onion_skinning(OnionSkinButtonsPanel): # , Panel): # inherit from
|
||||
|
||||
def draw(self, context):
|
||||
ob = context.object
|
||||
self.draw_settings(context, ob.pose.animation_visualisation, bones=True)
|
||||
self.draw_settings(context, ob.pose.animation_visualization, bones=True)
|
||||
|
||||
|
||||
class DATA_PT_custom_props_arm(ArmatureButtonsPanel, PropertyPanel, Panel):
|
||||
|
@ -33,7 +33,7 @@ class CurveButtonsPanel():
|
||||
|
||||
|
||||
class CurveButtonsPanelCurve(CurveButtonsPanel):
|
||||
'''Same as above but for curves only'''
|
||||
"""Same as above but for curves only"""
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@ -41,7 +41,7 @@ class CurveButtonsPanelCurve(CurveButtonsPanel):
|
||||
|
||||
|
||||
class CurveButtonsPanelActive(CurveButtonsPanel):
|
||||
'''Same as above but for curves only'''
|
||||
"""Same as above but for curves only"""
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
|
@ -971,8 +971,8 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
||||
split = layout.split()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.operator("object.skin_loose_mark_clear", text="Mark Loose").action = "MARK"
|
||||
col.operator("object.skin_loose_mark_clear", text="Clear Loose").action = "CLEAR"
|
||||
col.operator("object.skin_loose_mark_clear", text="Mark Loose").action = 'MARK'
|
||||
col.operator("object.skin_loose_mark_clear", text="Clear Loose").action = 'CLEAR'
|
||||
|
||||
col = split.column()
|
||||
col.operator("object.skin_root_mark", text="Mark Root")
|
||||
|
@ -454,7 +454,7 @@ class SCENE_PT_game_navmesh(SceneButtonsPanel, Panel):
|
||||
|
||||
rd = context.scene.game_settings.recast_data
|
||||
|
||||
layout.operator("mesh.navmesh_make", text='Build navigation mesh')
|
||||
layout.operator("mesh.navmesh_make", text="Build navigation mesh")
|
||||
|
||||
col = layout.column()
|
||||
col.label(text="Rasterization:")
|
||||
|
@ -159,7 +159,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
obj = context.object
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.operator("object.group_link", text="Add to Group")
|
||||
@ -167,8 +167,13 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel):
|
||||
|
||||
# XXX, this is bad practice, yes, I wrote it :( - campbell
|
||||
index = 0
|
||||
obj_name = obj.name
|
||||
for group in bpy.data.groups:
|
||||
if ob.name in group.objects:
|
||||
# XXX this is slow and stupid!, we need 2 checks, one thats fast
|
||||
# and another that we can be sure its not a name collission
|
||||
# from linked library data
|
||||
group_objects = group.objects
|
||||
if obj_name in group.objects and obj in group_objects[:]:
|
||||
col = layout.column(align=True)
|
||||
|
||||
col.context_pointer_set("group", group)
|
||||
@ -214,7 +219,7 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
|
||||
col = split.column()
|
||||
col.prop(ob, "show_name", text="Name")
|
||||
col.prop(ob, "show_axis", text="Axis")
|
||||
if ob.type in {"MESH", "CURVE", "SURFACE", "META", "FONT"}:
|
||||
if ob.type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT'}:
|
||||
# Makes no sense for cameras, armtures, etc.!
|
||||
col.prop(ob, "show_wire", text="Wire")
|
||||
# Only useful with object having faces/materials...
|
||||
@ -304,7 +309,7 @@ class OBJECT_PT_motion_paths(MotionPathButtonsPanel, Panel):
|
||||
layout = self.layout
|
||||
|
||||
ob = context.object
|
||||
avs = ob.animation_visualisation
|
||||
avs = ob.animation_visualization
|
||||
mpath = ob.motion_path
|
||||
|
||||
self.draw_settings(context, avs, mpath)
|
||||
@ -321,7 +326,7 @@ class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel): # , Panel): # inherit fr
|
||||
def draw(self, context):
|
||||
ob = context.object
|
||||
|
||||
self.draw_settings(context, ob.animation_visualisation)
|
||||
self.draw_settings(context, ob.animation_visualization)
|
||||
|
||||
|
||||
class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, Panel):
|
||||
|
@ -86,7 +86,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
if context.scene.render.engine == "BLENDER_GAME":
|
||||
if context.scene.render.engine == 'BLENDER_GAME':
|
||||
layout.label("Not available in the Game Engine")
|
||||
return
|
||||
|
||||
|
@ -195,7 +195,7 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, Panel):
|
||||
col = split.column()
|
||||
col.label(text="Particle:")
|
||||
col.prop(settings, "permeability", slider=True)
|
||||
col.prop(settings, "stickness")
|
||||
col.prop(settings, "stickiness")
|
||||
col.prop(settings, "use_particle_kill")
|
||||
col.label(text="Particle Damping:")
|
||||
sub = col.column(align=True)
|
||||
|
@ -117,10 +117,14 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
|
||||
col.prop(fluid, "use_animated_mesh")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Slip Type:")
|
||||
col.prop(fluid, "slip_type", text="")
|
||||
subsplit = col.split()
|
||||
subcol = subsplit.column()
|
||||
if fluid.use_animated_mesh:
|
||||
subcol.enabled = False
|
||||
subcol.label(text="Slip Type:")
|
||||
subcol.prop(fluid, "slip_type", text="")
|
||||
if fluid.slip_type == 'PARTIALSLIP':
|
||||
col.prop(fluid, "partial_slip_factor", slider=True, text="Amount")
|
||||
subcol.prop(fluid, "partial_slip_factor", slider=True, text="Amount")
|
||||
|
||||
col.label(text="Impact:")
|
||||
col.prop(fluid, "impact_factor", text="Factor")
|
||||
@ -223,10 +227,10 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel):
|
||||
col.label(text="Use Scene Size Units", icon='SCENE_DATA')
|
||||
sub = col.column()
|
||||
sub.enabled = False
|
||||
sub.prop(fluid, "simulation_scale", text="Metres")
|
||||
sub.prop(fluid, "simulation_scale", text="Meters")
|
||||
else:
|
||||
col.label(text="Real World Size:")
|
||||
col.prop(fluid, "simulation_scale", text="Metres")
|
||||
col.prop(fluid, "simulation_scale", text="Meters")
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Viscosity Presets:")
|
||||
|
@ -74,7 +74,7 @@ class CONSOLE_MT_language(Menu):
|
||||
languages = []
|
||||
for modname, mod in sys.modules.items():
|
||||
if modname.startswith("console_") and hasattr(mod, "execute"):
|
||||
languages.append(modname.split('_', 1)[-1])
|
||||
languages.append(modname.split("_", 1)[-1])
|
||||
|
||||
languages.sort()
|
||||
|
||||
@ -83,7 +83,7 @@ class CONSOLE_MT_language(Menu):
|
||||
|
||||
|
||||
def add_scrollback(text, text_type):
|
||||
for l in text.split('\n'):
|
||||
for l in text.split("\n"):
|
||||
bpy.ops.console.scrollback_append(text=l.replace('\t', ' '),
|
||||
type=text_type)
|
||||
|
||||
|
@ -797,12 +797,12 @@ class IMAGE_UV_sculpt_curve(Panel):
|
||||
layout.template_curve_mapping(brush, "curve")
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.operator("brush.curve_preset", icon="SMOOTHCURVE", text="").shape = 'SMOOTH'
|
||||
row.operator("brush.curve_preset", icon="SPHERECURVE", text="").shape = 'ROUND'
|
||||
row.operator("brush.curve_preset", icon="ROOTCURVE", text="").shape = 'ROOT'
|
||||
row.operator("brush.curve_preset", icon="SHARPCURVE", text="").shape = 'SHARP'
|
||||
row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LINE'
|
||||
row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX'
|
||||
row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH'
|
||||
row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND'
|
||||
row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT'
|
||||
row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP'
|
||||
row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE'
|
||||
row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX'
|
||||
|
||||
|
||||
class IMAGE_UV_sculpt(Panel, ImagePaintPanel):
|
||||
|
@ -217,7 +217,7 @@ class NODE_PT_properties(Panel):
|
||||
class NODE_PT_quality(bpy.types.Panel):
|
||||
bl_space_type = 'NODE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Quality"
|
||||
bl_label = "Performance"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@ -233,7 +233,9 @@ class NODE_PT_quality(bpy.types.Panel):
|
||||
layout.prop(tree, "edit_quality", text="Edit")
|
||||
layout.prop(tree, "chunk_size")
|
||||
layout.prop(tree, "use_opencl")
|
||||
|
||||
layout.prop(tree, "two_pass")
|
||||
layout.prop(snode, "show_highlight")
|
||||
|
||||
|
||||
class NODE_MT_node_color_presets(Menu):
|
||||
"""Predefined node color"""
|
||||
|
@ -117,7 +117,7 @@ class SEQUENCER_MT_view(Menu):
|
||||
layout.operator_context = 'INVOKE_DEFAULT'
|
||||
|
||||
# # XXX, invokes in the header view
|
||||
# layout.operator("sequencer.view_ghost_border", text='Overlay Border')
|
||||
# layout.operator("sequencer.view_ghost_border", text="Overlay Border")
|
||||
|
||||
layout.operator("sequencer.view_selected")
|
||||
|
||||
@ -820,7 +820,7 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
|
||||
col.label(text="Build JPEG quality")
|
||||
col.prop(strip.proxy, "quality")
|
||||
|
||||
if strip.type == "MOVIE":
|
||||
if strip.type == 'MOVIE':
|
||||
col = layout.column()
|
||||
col.label(text="Use timecode index:")
|
||||
|
||||
|
@ -1121,7 +1121,7 @@ class VIEW3D_MT_brush(Menu):
|
||||
sculpt_tool = brush.sculpt_tool
|
||||
|
||||
layout.separator()
|
||||
layout.operator_menu_enum("brush.curve_preset", "shape", text='Curve Preset')
|
||||
layout.operator_menu_enum("brush.curve_preset", "shape", text="Curve Preset")
|
||||
layout.separator()
|
||||
|
||||
if sculpt_tool != 'GRAB':
|
||||
@ -1772,7 +1772,7 @@ class VIEW3D_MT_edit_mesh_vertices(Menu):
|
||||
|
||||
layout.operator("mesh.vertices_smooth")
|
||||
layout.operator("mesh.remove_doubles")
|
||||
layout.operator("mesh.sort_elements", text="Sort Vertices").elements = {"VERT"}
|
||||
layout.operator("mesh.sort_elements", text="Sort Vertices").elements = {'VERT'}
|
||||
|
||||
layout.operator("mesh.select_vertex_path")
|
||||
|
||||
@ -1827,7 +1827,7 @@ class VIEW3D_MT_edit_mesh_edges(Menu):
|
||||
layout.operator("mesh.bevel")
|
||||
layout.operator("mesh.edge_split")
|
||||
layout.operator("mesh.bridge_edge_loops")
|
||||
layout.operator("mesh.sort_elements", text="Sort Edges").elements = {"EDGE"}
|
||||
layout.operator("mesh.sort_elements", text="Sort Edges").elements = {'EDGE'}
|
||||
|
||||
layout.separator()
|
||||
|
||||
@ -1860,7 +1860,7 @@ class VIEW3D_MT_edit_mesh_faces(Menu):
|
||||
layout.operator("mesh.bevel")
|
||||
layout.operator("mesh.solidify")
|
||||
layout.operator("mesh.wireframe")
|
||||
layout.operator("mesh.sort_elements", text="Sort Faces").elements = {"FACE"}
|
||||
layout.operator("mesh.sort_elements", text="Sort Faces").elements = {'FACE'}
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
@ -65,7 +65,7 @@ def add_object_button(self, context):
|
||||
self.layout.operator(
|
||||
OBJECT_OT_add_object.bl_idname,
|
||||
text="Add Object",
|
||||
icon="PLUGIN")
|
||||
icon='PLUGIN')
|
||||
|
||||
|
||||
def register():
|
||||
|
@ -21,23 +21,23 @@ def main():
|
||||
|
||||
# Some example functions, remove to write your own script.
|
||||
# check for a positive sensor, will run on any object without errors.
|
||||
print('Logic info for KX_GameObject', own.name)
|
||||
print("Logic info for KX_GameObject", own.name)
|
||||
input = False
|
||||
|
||||
for sens in cont.sensors:
|
||||
# The sensor can be on another object, we may want to use it
|
||||
own_sens = sens.owner
|
||||
print(' sensor:', sens.name, end=' ')
|
||||
print(" sensor:", sens.name, end=" ")
|
||||
if sens.positive:
|
||||
print('(true)')
|
||||
print("(true)")
|
||||
input = True
|
||||
else:
|
||||
print('(false)')
|
||||
print("(false)")
|
||||
|
||||
for actu in cont.actuators:
|
||||
# The actuator can be on another object, we may want to use it
|
||||
own_actu = actu.owner
|
||||
print(' actuator:', actu.name)
|
||||
print(" actuator:", actu.name)
|
||||
|
||||
# This runs the actuator or turns it off
|
||||
# note that actuators will continue to run unless explicitly turned off.
|
||||
@ -49,25 +49,25 @@ def main():
|
||||
# Its also good practice to get sensors and actuators by name
|
||||
# rather then index so any changes to their order wont break the script.
|
||||
|
||||
# sens_key = cont.sensors['key_sensor']
|
||||
# actu_motion = cont.actuators['motion']
|
||||
# sens_key = cont.sensors["key_sensor"]
|
||||
# actu_motion = cont.actuators["motion"]
|
||||
|
||||
# Loop through all other objects in the scene
|
||||
sce = bge.logic.getCurrentScene()
|
||||
print('Scene Objects:', sce.name)
|
||||
print("Scene Objects:", sce.name)
|
||||
for ob in sce.objects:
|
||||
print(' ', ob.name, ob.worldPosition)
|
||||
print(" ", ob.name, ob.worldPosition)
|
||||
|
||||
# Example where collision objects are checked for their properties
|
||||
# adding to our objects "life" property
|
||||
"""
|
||||
actu_collide = cont.sensors['collision_sens']
|
||||
actu_collide = cont.sensors["collision_sens"]
|
||||
for ob in actu_collide.objectHitList:
|
||||
# Check to see the object has this property
|
||||
if ob.has_key('life'):
|
||||
own['life'] += ob['life']
|
||||
ob['life'] = 0
|
||||
print(own['life'])
|
||||
if "life" in ob:
|
||||
own["life"] += ob["life"]
|
||||
ob["life"] = 0
|
||||
print(own["life"])
|
||||
"""
|
||||
|
||||
main()
|
||||
|
@ -1,7 +1,7 @@
|
||||
import bpy
|
||||
|
||||
|
||||
def main(operator, context):
|
||||
def main(context):
|
||||
space = context.space_data
|
||||
node_tree = space.node_tree
|
||||
node_active = context.active_node
|
||||
|
@ -5,8 +5,8 @@ class HelloWorldPanel(bpy.types.Panel):
|
||||
"""Creates a Panel in the Object properties window"""
|
||||
bl_label = "Hello World Panel"
|
||||
bl_idname = "OBJECT_PT_hello"
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = "object"
|
||||
|
||||
def draw(self, context):
|
||||
|
@ -113,7 +113,7 @@ struct bActionGroup *get_active_actiongroup(struct bAction *act);
|
||||
void set_active_action_group(struct bAction *act, struct bActionGroup *agrp, short select);
|
||||
|
||||
/* Sync colors used for action/bone group with theme settings */
|
||||
void action_group_colors_sync(struct bActionGroup *grp);
|
||||
void action_group_colors_sync(struct bActionGroup *grp, const struct bActionGroup *ref_grp);
|
||||
|
||||
/* Add a new action group with the given name to the action */
|
||||
struct bActionGroup *action_groups_add_new(struct bAction *act, const char name[]);
|
||||
|
@ -43,7 +43,7 @@ struct bPoseChannel;
|
||||
struct ReportList;
|
||||
|
||||
/* ---------------------------------------------------- */
|
||||
/* Animation Visualisation */
|
||||
/* Animation Visualization */
|
||||
|
||||
void animviz_settings_init(struct bAnimVizSettings *avs);
|
||||
|
||||
|
@ -157,7 +157,7 @@ void BKE_image_assign_ibuf(struct Image *ima, struct ImBuf *ibuf);
|
||||
/* called on frame change or before render */
|
||||
void BKE_image_user_frame_calc(struct ImageUser *iuser, int cfra, int fieldnr);
|
||||
void BKE_image_user_check_frame_calc(struct ImageUser *iuser, int cfra, int fieldnr);
|
||||
int BKE_image_user_frame_get(const struct ImageUser *iuser, int cfra, int fieldnr);
|
||||
int BKE_image_user_frame_get(const struct ImageUser *iuser, int cfra, int fieldnr, short *r_is_in_range);
|
||||
void BKE_image_user_file_path(struct ImageUser *iuser, struct Image *ima, char *path);
|
||||
|
||||
/* sets index offset for multilayer files */
|
||||
|
@ -27,6 +27,7 @@
|
||||
#ifndef __BKE_MASK_H__
|
||||
#define __BKE_MASK_H__
|
||||
|
||||
struct ListBase;
|
||||
struct Main;
|
||||
struct Mask;
|
||||
struct MaskParent;
|
||||
@ -50,12 +51,16 @@ void BKE_mask_layer_remove(struct Mask *mask, struct MaskLayer *masklay);
|
||||
|
||||
void BKE_mask_layer_free_shapes(struct MaskLayer *masklay);
|
||||
void BKE_mask_layer_free(struct MaskLayer *masklay);
|
||||
void BKE_mask_layer_free_list(struct ListBase *masklayers);
|
||||
void BKE_mask_spline_free(struct MaskSpline *spline);
|
||||
struct MaskSpline *BKE_mask_spline_copy(struct MaskSpline *spline);
|
||||
void BKE_mask_point_free(struct MaskSplinePoint *point);
|
||||
|
||||
void BKE_mask_layer_unique_name(struct Mask *mask, struct MaskLayer *masklay);
|
||||
|
||||
struct MaskLayer *BKE_mask_layer_copy(struct MaskLayer *layer);
|
||||
void BKE_mask_layer_copy_list(struct ListBase *masklayers_new, struct ListBase *masklayers);
|
||||
|
||||
/* splines */
|
||||
struct MaskSpline *BKE_mask_spline_add(struct MaskLayer *masklay);
|
||||
|
||||
@ -170,6 +175,11 @@ void BKE_mask_layer_shape_changed_remove(struct MaskLayer *masklay, int index, i
|
||||
|
||||
/* rasterization */
|
||||
int BKE_mask_get_duration(struct Mask *mask);
|
||||
|
||||
void BKE_mask_rasterize_layers(struct ListBase *masklayers, int width, int height, float *buffer,
|
||||
const short do_aspect_correct, const short do_mask_aa,
|
||||
const short do_feather);
|
||||
|
||||
void BKE_mask_rasterize(struct Mask *mask, int width, int height, float *buffer,
|
||||
const short do_aspect_correct, const short do_mask_aa,
|
||||
const short do_feather);
|
||||
|
@ -42,6 +42,7 @@ struct ID;
|
||||
struct Object;
|
||||
struct Mesh;
|
||||
struct MTFace;
|
||||
struct Scene;
|
||||
|
||||
/* materials */
|
||||
|
||||
@ -92,6 +93,9 @@ int material_in_material(struct Material *parmat, struct Material *mat);
|
||||
|
||||
void ramp_blend(int type, float r_col[3], const float fac, const float col[3]);
|
||||
|
||||
/* driver update hacks */
|
||||
void material_drivers_update(struct Scene *scene, struct Material *mat, float ctime);
|
||||
|
||||
/* copy/paste */
|
||||
void clear_matcopybuf(void);
|
||||
void free_matcopybuf(void);
|
||||
|
@ -345,6 +345,7 @@ void modifiers_clearErrors(struct Object *ob);
|
||||
int modifiers_getCageIndex(struct Scene *scene, struct Object *ob,
|
||||
int *lastPossibleCageIndex_r, int virtual_);
|
||||
|
||||
int modifiers_isModifierEnabled(struct Object *ob, int modifierType);
|
||||
int modifiers_isSoftbodyEnabled(struct Object *ob);
|
||||
int modifiers_isClothEnabled(struct Object *ob);
|
||||
int modifiers_isParticleEnabled(struct Object *ob);
|
||||
|
@ -320,9 +320,6 @@ if(WITH_PYTHON)
|
||||
list(APPEND INC
|
||||
../python
|
||||
)
|
||||
list(APPEND INC_SYS
|
||||
${PYTHON_INCLUDE_DIRS}
|
||||
)
|
||||
add_definitions(-DWITH_PYTHON)
|
||||
|
||||
if(WITH_PYTHON_SECURITY)
|
||||
|
@ -32,7 +32,6 @@ if env['WITH_BF_FRAMESERVER']:
|
||||
|
||||
if env['WITH_BF_PYTHON']:
|
||||
incs += ' ../python'
|
||||
incs += ' ' + env['BF_PYTHON_INC']
|
||||
defs.append('WITH_PYTHON')
|
||||
if env['BF_DEBUG']:
|
||||
defs.append('DEBUG')
|
||||
|
@ -253,7 +253,7 @@ void set_active_action_group(bAction *act, bActionGroup *agrp, short select)
|
||||
}
|
||||
|
||||
/* Sync colors used for action/bone group with theme settings */
|
||||
void action_group_colors_sync(bActionGroup *grp)
|
||||
void action_group_colors_sync(bActionGroup *grp, const bActionGroup *ref_grp)
|
||||
{
|
||||
/* only do color copying if using a custom color (i.e. not default color) */
|
||||
if (grp->customCol) {
|
||||
@ -265,9 +265,15 @@ void action_group_colors_sync(bActionGroup *grp)
|
||||
memcpy(&grp->cs, col_set, sizeof(ThemeWireColor));
|
||||
}
|
||||
else {
|
||||
/* init custom colors with a generic multi-color rgb set, if not initialized already
|
||||
* (for custom color set) */
|
||||
if (grp->cs.solid[0] == 0) {
|
||||
/* if a reference group is provided, use the custom color from there... */
|
||||
if (ref_grp) {
|
||||
/* assumption: reference group has a color set */
|
||||
memcpy(&grp->cs, &ref_grp->cs, sizeof(ThemeWireColor));
|
||||
}
|
||||
/* otherwise, init custom color with a generic/placeholder color set if
|
||||
* no previous theme color was used that we can just keep using
|
||||
*/
|
||||
else if (grp->cs.solid[0] == 0) {
|
||||
/* define for setting colors in theme below */
|
||||
rgba_char_args_set(grp->cs.solid, 0xff, 0x00, 0x00, 255);
|
||||
rgba_char_args_set(grp->cs.select, 0x81, 0xe6, 0x14, 255);
|
||||
|
@ -78,9 +78,9 @@
|
||||
static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBase *duplilist, float par_space_mat[][4], int par_index, int level, int animated);
|
||||
|
||||
/* ******************************************************************** */
|
||||
/* Animation Visualisation */
|
||||
/* Animation Visualization */
|
||||
|
||||
/* Initialize the default settings for animation visualisation */
|
||||
/* Initialize the default settings for animation visualization */
|
||||
void animviz_settings_init(bAnimVizSettings *avs)
|
||||
{
|
||||
/* sanity check */
|
||||
|
@ -1864,7 +1864,7 @@ static void nlastrip_evaluate_transition(PointerRNA *ptr, ListBase *channels, Li
|
||||
/* prepare template for 'evaluation strip'
|
||||
* - based on the transition strip's evaluation strip data
|
||||
* - strip_mode is NES_TIME_TRANSITION_* based on which endpoint
|
||||
* - strip_time is the 'normalised' (i.e. in-strip) time for evaluation,
|
||||
* - strip_time is the 'normalized' (i.e. in-strip) time for evaluation,
|
||||
* which doubles up as an additional weighting factor for the strip influences
|
||||
* which allows us to appear to be 'interpolating' between the two extremes
|
||||
*/
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user