Merge branch 'master' into sculpt-dev
This commit is contained in:
@@ -39,9 +39,8 @@ Checks: >
|
||||
-modernize-use-nodiscard,
|
||||
-modernize-loop-convert,
|
||||
-modernize-pass-by-value,
|
||||
-modernize-use-default-member-init,
|
||||
-modernize-raw-string-literal,
|
||||
-modernize-avoid-bind,
|
||||
-modernize-use-transparent-functors,
|
||||
|
||||
WarningsAsErrors: '*'
|
||||
CheckOptions:
|
||||
- key: modernize-use-default-member-init.UseAssignment
|
||||
value: 1
|
||||
|
||||
@@ -32,8 +32,8 @@ set(OPENCOLORIO_EXTRA_ARGS
|
||||
|
||||
if(APPLE AND NOT("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
|
||||
set(OPENCOLORIO_EXTRA_ARGS
|
||||
${OPENCOLORIO_EXTRA_ARGS}
|
||||
-DOCIO_USE_SSE=OFF
|
||||
${OPENCOLORIO_EXTRA_ARGS}
|
||||
-DOCIO_USE_SSE=OFF
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ else()
|
||||
set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV})
|
||||
set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python)
|
||||
set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_linux.diff)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(PYTHON_CONFIGURE_EXTRA_ARGS "--with-openssl=${LIBDIR}/ssl")
|
||||
set(PYTHON_CFLAGS "-I${LIBDIR}/sqlite/include -I${LIBDIR}/bzip2/include -I${LIBDIR}/lzma/include -I${LIBDIR}/zlib/include")
|
||||
|
||||
@@ -20,7 +20,7 @@ set(SSL_CONFIGURE_COMMAND ./Configure)
|
||||
set(SSL_PATCH_CMD echo .)
|
||||
|
||||
if(APPLE)
|
||||
set(SSL_OS_COMPILER "blender-darwin-${CMAKE_OSX_ARCHITECTURES}")
|
||||
set(SSL_OS_COMPILER "blender-darwin-${CMAKE_OSX_ARCHITECTURES}")
|
||||
else()
|
||||
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||
set(SSL_EXTRA_ARGS enable-ec_nistp_64_gcc_128)
|
||||
|
||||
@@ -265,7 +265,7 @@ set(PUGIXML_URI https://github.com/zeux/pugixml/archive/v${PUGIXML_VERSION}.tar.
|
||||
set(PUGIXML_HASH 0c208b0664c7fb822bf1b49ad035e8fd)
|
||||
|
||||
set(FLEXBISON_VERSION 2.5.5)
|
||||
set(FLEXBISON_URI http://prdownloads.sourceforge.net/winflexbison//win_flex_bison-2.5.5.zip)
|
||||
set(FLEXBISON_URI http://prdownloads.sourceforge.net/winflexbison/win_flex_bison-2.5.5.zip)
|
||||
set(FLEXBISON_HASH d87a3938194520d904013abef3df10ce)
|
||||
|
||||
# Libraries to keep Python modules static on Linux.
|
||||
@@ -309,7 +309,7 @@ set(LIBGLU_URI ftp://ftp.freedesktop.org/pub/mesa/glu/glu-${LIBGLU_VERSION}.tar.
|
||||
set(LIBGLU_HASH 151aef599b8259efe9acd599c96ea2a3)
|
||||
|
||||
set(MESA_VERSION 18.3.1)
|
||||
set(MESA_URI ftp://ftp.freedesktop.org/pub/mesa//mesa-${MESA_VERSION}.tar.xz)
|
||||
set(MESA_URI ftp://ftp.freedesktop.org/pub/mesa/mesa-${MESA_VERSION}.tar.xz)
|
||||
set(MESA_HASH d60828056d77bfdbae0970f9b15fb1be)
|
||||
|
||||
set(NASM_VERSION 2.15.02)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,7 @@
|
||||
#=============================================================================
|
||||
|
||||
IF(NOT AUDASPACE_ROOT_DIR AND NOT $ENV{AUDASPACE_ROOT_DIR} STREQUAL "")
|
||||
SET(AUDASPACE_ROOT_DIR $ENV{AUDASPACE_ROOT_DIR})
|
||||
SET(AUDASPACE_ROOT_DIR $ENV{AUDASPACE_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_audaspace_SEARCH_DIRS
|
||||
|
||||
@@ -59,14 +59,14 @@ FOREACH(COMPONENT ${_embree_FIND_COMPONENTS})
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
IF (NOT EMBREE_${UPPERCOMPONENT}_LIBRARY)
|
||||
IF (EMBREE_EMBREE3_LIBRARY)
|
||||
IF(NOT EMBREE_${UPPERCOMPONENT}_LIBRARY)
|
||||
IF(EMBREE_EMBREE3_LIBRARY)
|
||||
# If we can't find all the static libraries, try to fall back to the shared library if found.
|
||||
# This allows building with a shared embree library
|
||||
SET(_embree_LIBRARIES ${EMBREE_EMBREE3_LIBRARY})
|
||||
BREAK()
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
LIST(APPEND _embree_LIBRARIES "${EMBREE_${UPPERCOMPONENT}_LIBRARY}")
|
||||
ENDFOREACH()
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@ cmake_policy(SET CMP0057 NEW) # if IN_LIST
|
||||
#------------------------------------------------------------------------------
|
||||
function(gtest_add_tests)
|
||||
|
||||
if (ARGC LESS 1)
|
||||
if(ARGC LESS 1)
|
||||
message(FATAL_ERROR "No arguments supplied to gtest_add_tests()")
|
||||
endif()
|
||||
|
||||
@@ -298,7 +298,7 @@ function(gtest_add_tests)
|
||||
set(autoAddSources YES)
|
||||
else()
|
||||
# Non-keyword syntax, convert to keyword form
|
||||
if (ARGC LESS 3)
|
||||
if(ARGC LESS 3)
|
||||
message(FATAL_ERROR "gtest_add_tests() without keyword options requires at least 3 arguments")
|
||||
endif()
|
||||
set(ARGS_TARGET "${ARGV0}")
|
||||
|
||||
@@ -389,7 +389,7 @@ function(blender_add_lib
|
||||
endfunction()
|
||||
|
||||
function(blender_add_test_suite)
|
||||
if (ARGC LESS 1)
|
||||
if(ARGC LESS 1)
|
||||
message(FATAL_ERROR "No arguments supplied to blender_add_test_suite()")
|
||||
endif()
|
||||
|
||||
@@ -1209,9 +1209,9 @@ function(find_python_package
|
||||
site-packages
|
||||
dist-packages
|
||||
vendor-packages
|
||||
NO_DEFAULT_PATH
|
||||
DOC
|
||||
"Path to python site-packages or dist-packages containing '${package}' module"
|
||||
NO_DEFAULT_PATH
|
||||
DOC
|
||||
"Path to python site-packages or dist-packages containing '${package}' module"
|
||||
)
|
||||
mark_as_advanced(PYTHON_${_upper_package}_PATH)
|
||||
|
||||
|
||||
@@ -353,7 +353,7 @@ endif()
|
||||
if(WITH_PUGIXML)
|
||||
find_package_wrapper(PugiXML)
|
||||
|
||||
if (NOT PUGIXML_FOUND)
|
||||
if(NOT PUGIXML_FOUND)
|
||||
set(WITH_PUGIXML OFF)
|
||||
message(STATUS "PugiXML not found, disabling WITH_PUGIXML")
|
||||
endif()
|
||||
|
||||
5
extern/mantaflow/helper/util/vectorbase.h
vendored
5
extern/mantaflow/helper/util/vectorbase.h
vendored
@@ -664,6 +664,11 @@ template<class T> inline Vec3i toVec3iRound(T v)
|
||||
return Vec3i((int)round(v[0]), (int)round(v[1]), (int)round(v[2]));
|
||||
}
|
||||
|
||||
template<class T> inline Vec3i toVec3iFloor(T v)
|
||||
{
|
||||
return Vec3i((int)floor(v[0]), (int)floor(v[1]), (int)floor(v[2]));
|
||||
}
|
||||
|
||||
//! convert to int Vector if values are close enough to an int
|
||||
template<class T> inline Vec3i toVec3iChecked(T v)
|
||||
{
|
||||
|
||||
10
extern/mantaflow/preprocessed/fileio/iovdb.cpp
vendored
10
extern/mantaflow/preprocessed/fileio/iovdb.cpp
vendored
@@ -209,11 +209,11 @@ typename GridType::Ptr exportVDB(Grid<T> *from, float clip, openvdb::FloatGrid::
|
||||
openvdb::Coord(from->getSizeX() - 1, from->getSizeY() - 1, from->getSizeZ() - 1));
|
||||
openvdb::tools::Dense<ValueT, openvdb::tools::MemoryLayout::LayoutXYZ> dense(bbox, data);
|
||||
|
||||
// Trick: Set clip value to very small / negative value in order to copy all values of dense
|
||||
// grids
|
||||
float tmpClip = (from->saveSparse()) ? clip : -std::numeric_limits<Real>::max();
|
||||
// Use clip value, or (when not exporting in sparse mode) clear it in order to copy all values
|
||||
// of dense grid
|
||||
ValueT tmpClip = (from->saveSparse()) ? ValueT(clip) : ValueT(0);
|
||||
// Copy from dense to sparse grid structure considering clip value
|
||||
openvdb::tools::copyFromDense(dense, *to, ValueT(tmpClip));
|
||||
openvdb::tools::copyFromDense(dense, *to, tmpClip);
|
||||
|
||||
// If present, use clip grid to trim down current vdb grid even more
|
||||
if (from->saveSparse() && clipGrid && !clipGrid->empty()) {
|
||||
@@ -245,10 +245,10 @@ void exportVDB(ParticleDataImpl<MantaType> *from,
|
||||
std::vector<VDBType> vdbValues;
|
||||
std::string name = from->getName();
|
||||
|
||||
BasicParticleSystem *pp = dynamic_cast<BasicParticleSystem *>(from->getParticleSys());
|
||||
FOR_PARTS(*from)
|
||||
{
|
||||
// Optionally, skip exporting particles that have been marked as deleted
|
||||
BasicParticleSystem *pp = dynamic_cast<BasicParticleSystem *>(from->getParticleSys());
|
||||
if (skipDeletedParts && !pp->isActive(idx)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
2
extern/mantaflow/preprocessed/gitinfo.h
vendored
2
extern/mantaflow/preprocessed/gitinfo.h
vendored
@@ -1,3 +1,3 @@
|
||||
|
||||
|
||||
#define MANTA_GIT_VERSION "commit 1c86d86496e7f7473c36248d12ef07bf4d9d2840"
|
||||
#define MANTA_GIT_VERSION "commit 39b7a415721ecbf6643612a24e8eadd221aeb934"
|
||||
|
||||
15
extern/mantaflow/preprocessed/grid.h
vendored
15
extern/mantaflow/preprocessed/grid.h
vendored
@@ -204,14 +204,12 @@ class GridBase : public PbClass {
|
||||
inline void checkIndex(int i, int j, int k) const;
|
||||
//! Check if indices are within bounds, otherwise error (should only be called when debugging)
|
||||
inline void checkIndex(IndexInt idx) const;
|
||||
//! Check if index is within given boundaries
|
||||
inline bool isInBounds(const Vec3i &p, int bnd) const;
|
||||
//! Check if index is within given boundaries
|
||||
inline bool isInBounds(const Vec3i &p) const;
|
||||
//! Check if index is within given boundaries
|
||||
//! Check if vector int is within given boundaries
|
||||
inline bool isInBounds(const Vec3i &p, int bnd = 0) const;
|
||||
//! Check if vector real is within given boundaries
|
||||
inline bool isInBounds(const Vec3 &p, int bnd = 0) const
|
||||
{
|
||||
return isInBounds(toVec3i(p), bnd);
|
||||
return isInBounds(toVec3iFloor(p), bnd);
|
||||
}
|
||||
//! Check if linear index is in the range of the array
|
||||
inline bool isInBounds(IndexInt idx) const;
|
||||
@@ -1785,11 +1783,6 @@ inline void GridBase::checkIndex(IndexInt idx) const
|
||||
}
|
||||
}
|
||||
|
||||
bool GridBase::isInBounds(const Vec3i &p) const
|
||||
{
|
||||
return (p.x >= 0 && p.y >= 0 && p.z >= 0 && p.x < mSize.x && p.y < mSize.y && p.z < mSize.z);
|
||||
}
|
||||
|
||||
bool GridBase::isInBounds(const Vec3i &p, int bnd) const
|
||||
{
|
||||
bool ret = (p.x >= bnd && p.y >= bnd && p.x < mSize.x - bnd && p.y < mSize.y - bnd);
|
||||
|
||||
10
extern/mantaflow/preprocessed/plugin/flip.cpp
vendored
10
extern/mantaflow/preprocessed/plugin/flip.cpp
vendored
@@ -429,7 +429,7 @@ void markFluidCells(const BasicParticleSystem &parts,
|
||||
for (IndexInt idx = 0; idx < parts.size(); idx++) {
|
||||
if (!parts.isActive(idx) || (ptype && ((*ptype)[idx] & exclude)))
|
||||
continue;
|
||||
Vec3i p = toVec3i(parts.getPos(idx));
|
||||
Vec3i p = toVec3iFloor(parts.getPos(idx));
|
||||
if (flags.isInBounds(p) && flags.isEmpty(p))
|
||||
flags(p) = (flags(p) | FlagGrid::TypeFluid) & ~FlagGrid::TypeEmpty;
|
||||
}
|
||||
@@ -544,7 +544,7 @@ void adjustNumber(BasicParticleSystem &parts,
|
||||
// count particles in cells, and delete excess particles
|
||||
for (IndexInt idx = 0; idx < (int)parts.size(); idx++) {
|
||||
if (parts.isActive(idx)) {
|
||||
Vec3i p = toVec3i(parts.getPos(idx));
|
||||
Vec3i p = toVec3iFloor(parts.getPos(idx));
|
||||
if (!tmp.isInBounds(p)) {
|
||||
parts.kill(idx); // out of domain, remove
|
||||
continue;
|
||||
@@ -711,7 +711,7 @@ void gridParticleIndex(const BasicParticleSystem &parts,
|
||||
for (IndexInt idx = 0; idx < (IndexInt)parts.size(); idx++) {
|
||||
if (parts.isActive(idx)) {
|
||||
// check index for validity...
|
||||
Vec3i p = toVec3i(parts.getPos(idx));
|
||||
Vec3i p = toVec3iFloor(parts.getPos(idx));
|
||||
if (!index.isInBounds(p)) {
|
||||
inactive++;
|
||||
continue;
|
||||
@@ -740,7 +740,7 @@ void gridParticleIndex(const BasicParticleSystem &parts,
|
||||
for (IndexInt idx = 0; idx < (IndexInt)parts.size(); idx++) {
|
||||
if (!parts.isActive(idx))
|
||||
continue;
|
||||
Vec3i p = toVec3i(parts.getPos(idx));
|
||||
Vec3i p = toVec3iFloor(parts.getPos(idx));
|
||||
if (!index.isInBounds(p)) {
|
||||
continue;
|
||||
}
|
||||
@@ -1636,7 +1636,7 @@ struct knPushOutofObs : public KernelBase {
|
||||
{
|
||||
if (!parts.isActive(idx) || (ptype && ((*ptype)[idx] & exclude)))
|
||||
return;
|
||||
Vec3i p = toVec3i(parts.getPos(idx));
|
||||
Vec3i p = toVec3iFloor(parts.getPos(idx));
|
||||
|
||||
if (!flags.isInBounds(p))
|
||||
return;
|
||||
|
||||
@@ -2278,7 +2278,7 @@ T convolveGrid(Grid<T> &originGrid, GaussianKernelCreator &gkSigma, Vec3 pos, in
|
||||
step = Vec3(0.0, 0.0, 1.0);
|
||||
T pxResult(0);
|
||||
for (int i = 0; i < gkSigma.mDim; ++i) {
|
||||
Vec3i curpos = toVec3i(pos - step * (i - gkSigma.mDim / 2));
|
||||
Vec3i curpos = toVec3iFloor(pos - step * (i - gkSigma.mDim / 2));
|
||||
if (originGrid.isInBounds(curpos))
|
||||
pxResult += gkSigma.get1DKernelValue(i) * originGrid.get(curpos);
|
||||
else { // TODO , improve...
|
||||
@@ -2423,7 +2423,7 @@ struct KnBlurMACGridGauss : public KernelBase {
|
||||
|
||||
Vec3 pxResult(0.0f);
|
||||
for (int di = 0; di < gkSigma.mDim; ++di) {
|
||||
Vec3i curpos = toVec3i(pos - step * (di - gkSigma.mDim / 2));
|
||||
Vec3i curpos = toVec3iFloor(pos - step * (di - gkSigma.mDim / 2));
|
||||
if (!originGrid.isInBounds(curpos)) {
|
||||
if (curpos.x < 0)
|
||||
curpos.x = 0;
|
||||
|
||||
@@ -1214,8 +1214,8 @@ struct knFlipUpdateSecondaryParticlesLinear : public KernelBase {
|
||||
|
||||
// anti tunneling for small obstacles
|
||||
for (int ct = 1; ct < antitunneling; ct++) {
|
||||
Vec3i tempPos = toVec3i(pts_sec[idx].pos +
|
||||
ct * (1 / Real(antitunneling)) * dt * v_sec[idx]);
|
||||
Vec3i tempPos = toVec3iFloor(pts_sec[idx].pos +
|
||||
ct * (1 / Real(antitunneling)) * dt * v_sec[idx]);
|
||||
if (!flags.isInBounds(tempPos) || flags(tempPos) & FlagGrid::TypeObstacle) {
|
||||
pts_sec.kill(idx);
|
||||
return;
|
||||
@@ -1234,8 +1234,8 @@ struct knFlipUpdateSecondaryParticlesLinear : public KernelBase {
|
||||
|
||||
// anti tunneling for small obstacles
|
||||
for (int ct = 1; ct < antitunneling; ct++) {
|
||||
Vec3i tempPos = toVec3i(pts_sec[idx].pos +
|
||||
ct * (1 / Real(antitunneling)) * dt * v_sec[idx]);
|
||||
Vec3i tempPos = toVec3iFloor(pts_sec[idx].pos +
|
||||
ct * (1 / Real(antitunneling)) * dt * v_sec[idx]);
|
||||
if (!flags.isInBounds(tempPos) || flags(tempPos) & FlagGrid::TypeObstacle) {
|
||||
pts_sec.kill(idx);
|
||||
return;
|
||||
@@ -1252,7 +1252,7 @@ struct knFlipUpdateSecondaryParticlesLinear : public KernelBase {
|
||||
const Vec3 vj = v.getInterpolated(pts_sec[idx].pos);
|
||||
// anti tunneling for small obstacles
|
||||
for (int ct = 1; ct < antitunneling; ct++) {
|
||||
Vec3i tempPos = toVec3i(pts_sec[idx].pos + ct * (1 / Real(antitunneling)) * dt * vj);
|
||||
Vec3i tempPos = toVec3iFloor(pts_sec[idx].pos + ct * (1 / Real(antitunneling)) * dt * vj);
|
||||
if (!flags.isInBounds(tempPos) || flags(tempPos) & FlagGrid::TypeObstacle) {
|
||||
pts_sec.kill(idx);
|
||||
return;
|
||||
@@ -1474,8 +1474,8 @@ struct knFlipUpdateSecondaryParticlesCubic : public KernelBase {
|
||||
|
||||
// anti tunneling for small obstacles
|
||||
for (int ct = 1; ct < antitunneling; ct++) {
|
||||
Vec3i tempPos = toVec3i(pts_sec[idx].pos +
|
||||
ct * (1 / Real(antitunneling)) * dt * v_sec[idx]);
|
||||
Vec3i tempPos = toVec3iFloor(pts_sec[idx].pos +
|
||||
ct * (1 / Real(antitunneling)) * dt * v_sec[idx]);
|
||||
if (!flags.isInBounds(tempPos) || flags(tempPos) & FlagGrid::TypeObstacle) {
|
||||
pts_sec.kill(idx);
|
||||
return;
|
||||
@@ -1515,8 +1515,8 @@ struct knFlipUpdateSecondaryParticlesCubic : public KernelBase {
|
||||
|
||||
// anti tunneling for small obstacles
|
||||
for (int ct = 1; ct < antitunneling; ct++) {
|
||||
Vec3i tempPos = toVec3i(pts_sec[idx].pos +
|
||||
ct * (1 / Real(antitunneling)) * dt * v_sec[idx]);
|
||||
Vec3i tempPos = toVec3iFloor(pts_sec[idx].pos +
|
||||
ct * (1 / Real(antitunneling)) * dt * v_sec[idx]);
|
||||
if (!flags.isInBounds(tempPos) || flags(tempPos) & FlagGrid::TypeObstacle) {
|
||||
pts_sec.kill(idx);
|
||||
return;
|
||||
@@ -1554,8 +1554,8 @@ struct knFlipUpdateSecondaryParticlesCubic : public KernelBase {
|
||||
|
||||
// anti tunneling for small obstacles
|
||||
for (int ct = 1; ct < antitunneling; ct++) {
|
||||
Vec3i tempPos = toVec3i(pts_sec[idx].pos + ct * (1 / Real(antitunneling)) * dt *
|
||||
(sumNumerator / sumDenominator));
|
||||
Vec3i tempPos = toVec3iFloor(pts_sec[idx].pos + ct * (1 / Real(antitunneling)) * dt *
|
||||
(sumNumerator / sumDenominator));
|
||||
if (!flags.isInBounds(tempPos) || flags(tempPos) & FlagGrid::TypeObstacle) {
|
||||
pts_sec.kill(idx);
|
||||
return;
|
||||
@@ -1863,7 +1863,7 @@ struct knFlipDeleteParticlesInObstacle : public KernelBase {
|
||||
return;
|
||||
|
||||
const Vec3 &xi = pts[idx].pos;
|
||||
const Vec3i xidx = toVec3i(xi);
|
||||
const Vec3i xidx = toVec3iFloor(xi);
|
||||
// remove particles that completely left the bounds
|
||||
if (!flags.isInBounds(xidx)) {
|
||||
pts.kill(idx);
|
||||
|
||||
@@ -2145,8 +2145,7 @@ void PbRegister_particleSurfaceTurbulence()
|
||||
void debugCheckParts(const BasicParticleSystem &parts, const FlagGrid &flags)
|
||||
{
|
||||
for (int idx = 0; idx < parts.size(); idx++) {
|
||||
Vec3i p = toVec3i(parts.getPos(idx));
|
||||
if (!flags.isInBounds(p)) {
|
||||
if (!flags.isInBounds(parts.getPos(idx))) {
|
||||
debMsg("bad position??? " << idx << " " << parts.getPos(idx), 1);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
2
extern/quadriflow/CMakeLists.txt
vendored
2
extern/quadriflow/CMakeLists.txt
vendored
@@ -102,7 +102,7 @@ set(SRC
|
||||
)
|
||||
|
||||
set(LIB
|
||||
${BOOST_LIBRARIES}
|
||||
${BOOST_LIBRARIES}
|
||||
)
|
||||
|
||||
blender_add_lib(extern_quadriflow "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
|
||||
|
||||
@@ -103,7 +103,7 @@ static bool compile_cuda(CompilationSettings &settings)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Tranfer options to a classic C array. */
|
||||
/* Transfer options to a classic C array. */
|
||||
vector<const char *> opts(options.size());
|
||||
for (size_t i = 0; i < options.size(); i++) {
|
||||
opts[i] = options[i].c_str();
|
||||
|
||||
@@ -31,7 +31,7 @@ bool BlenderSync::sync_dupli_particle(BL::Object &b_ob,
|
||||
BL::DepsgraphObjectInstance &b_instance,
|
||||
Object *object)
|
||||
{
|
||||
/* test if this dupli was generated from a particle sytem */
|
||||
/* Test if this dupli was generated from a particle system. */
|
||||
BL::ParticleSystem b_psys = b_instance.particle_system();
|
||||
if (!b_psys)
|
||||
return false;
|
||||
|
||||
@@ -136,7 +136,7 @@ class BlenderSession {
|
||||
|
||||
/* ** Resumable render ** */
|
||||
|
||||
/* Overall number of chunks in which the sample range is to be devided. */
|
||||
/* Overall number of chunks in which the sample range is to be divided. */
|
||||
static int num_resumable_chunks;
|
||||
|
||||
/* Current resumable chunk index to render. */
|
||||
|
||||
@@ -942,7 +942,7 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine &b_engine,
|
||||
else if (shadingsystem == 1)
|
||||
params.shadingsystem = SHADINGSYSTEM_OSL;
|
||||
|
||||
/* color managagement */
|
||||
/* Color management. */
|
||||
params.display_buffer_linear = b_engine.support_display_space_shader(b_scene);
|
||||
|
||||
if (b_engine.is_preview()) {
|
||||
|
||||
@@ -703,7 +703,7 @@ BVHNode *BVHBuild::build_node(const BVHRange &range,
|
||||
unalignedSplitSAH = params.sah_node_cost * unaligned_split.bounds.half_area() +
|
||||
params.sah_primitive_cost * unaligned_split.nodeSAH;
|
||||
/* TOOD(sergey): Check we can create leaf already. */
|
||||
/* Check whether unaligned split is better than the regulat one. */
|
||||
/* Check whether unaligned split is better than the regular one. */
|
||||
if (unalignedSplitSAH < splitSAH) {
|
||||
do_unalinged_split = true;
|
||||
}
|
||||
@@ -842,7 +842,7 @@ BVHNode *BVHBuild::create_leaf_node(const BVHRange &range, const vector<BVHRefer
|
||||
vector<BVHReference, LeafReferenceStackAllocator> object_references;
|
||||
|
||||
uint visibility[PRIMITIVE_NUM_TOTAL] = {0};
|
||||
/* NOTE: Keep initializtion in sync with actual number of primitives. */
|
||||
/* NOTE: Keep initialization in sync with actual number of primitives. */
|
||||
BoundBox bounds[PRIMITIVE_NUM_TOTAL] = {
|
||||
BoundBox::empty, BoundBox::empty, BoundBox::empty, BoundBox::empty};
|
||||
int ob_num = 0;
|
||||
|
||||
@@ -383,7 +383,7 @@ if(WITH_CYCLES_OPENSUBDIV)
|
||||
optimized ${OPENSUBDIV_ROOT_DIR}/lib/osdGPU.lib
|
||||
debug ${OPENSUBDIV_ROOT_DIR}/lib/osdCPU_d.lib
|
||||
debug ${OPENSUBDIV_ROOT_DIR}/lib/osdGPU_d.lib
|
||||
)
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -184,7 +184,7 @@ CUDADevice::CUDADevice(DeviceInfo &info, Stats &stats, Profiler &profiler, bool
|
||||
|
||||
functions.loaded = false;
|
||||
|
||||
/* Intialize CUDA. */
|
||||
/* Initialize CUDA. */
|
||||
CUresult result = cuInit(0);
|
||||
if (result != CUDA_SUCCESS) {
|
||||
set_error(string_printf("Failed to initialize CUDA runtime (%s)", cuewErrorString(result)));
|
||||
|
||||
@@ -296,7 +296,7 @@ class MultiDevice : public Device {
|
||||
i++;
|
||||
}
|
||||
|
||||
/* Change geomtry BVH pointers back to the multi BVH */
|
||||
/* Change geometry BVH pointers back to the multi BVH. */
|
||||
for (size_t k = 0; k < bvh->geometry.size(); ++k) {
|
||||
bvh->geometry[k]->bvh = geom_bvhs[k];
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ class network_device_memory : public device_memory {
|
||||
vector<char> local_data;
|
||||
};
|
||||
|
||||
/* Common netowrk error function / object for both DeviceNetwork and DeviceServer*/
|
||||
/* Common network error function / object for both DeviceNetwork and DeviceServer. */
|
||||
class NetworkError {
|
||||
public:
|
||||
NetworkError()
|
||||
|
||||
@@ -34,7 +34,7 @@ CCL_NAMESPACE_BEGIN
|
||||
/* Disable workarounds, seems to be working fine on latest drivers. */
|
||||
# define CYCLES_DISABLE_DRIVER_WORKAROUNDS
|
||||
|
||||
/* Define CYCLES_DISABLE_DRIVER_WORKAROUNDS to disable workaounds for testing */
|
||||
/* Define CYCLES_DISABLE_DRIVER_WORKAROUNDS to disable workarounds for testing. */
|
||||
# ifndef CYCLES_DISABLE_DRIVER_WORKAROUNDS
|
||||
/* Work around AMD driver hangs by ensuring each command is finished before doing anything else. */
|
||||
# undef clEnqueueNDRangeKernel
|
||||
@@ -287,7 +287,7 @@ class OpenCLDevice : public Device {
|
||||
|
||||
/* Try to load the program from device cache or disk */
|
||||
bool load();
|
||||
/* Compile the kernel (first separate, failback to local) */
|
||||
/* Compile the kernel (first separate, fail-back to local). */
|
||||
void compile();
|
||||
/* Create the OpenCL kernels after loading or compiling */
|
||||
void create_kernels();
|
||||
@@ -628,7 +628,7 @@ class OpenCLDevice : public Device {
|
||||
void release_mem_object_safe(cl_mem mem);
|
||||
void release_program_safe(cl_program program);
|
||||
|
||||
/* ** Those guys are for workign around some compiler-specific bugs ** */
|
||||
/* ** Those guys are for working around some compiler-specific bugs ** */
|
||||
|
||||
cl_program load_cached_kernel(ustring key, thread_scoped_lock &cache_locker);
|
||||
|
||||
|
||||
@@ -2151,7 +2151,7 @@ void OpenCLDevice::release_program_safe(cl_program program)
|
||||
}
|
||||
}
|
||||
|
||||
/* ** Those guys are for workign around some compiler-specific bugs ** */
|
||||
/* ** Those guys are for working around some compiler-specific bugs ** */
|
||||
|
||||
cl_program OpenCLDevice::load_cached_kernel(ustring key, thread_scoped_lock &cache_locker)
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ CCL_NAMESPACE_BEGIN
|
||||
|
||||
#define BVH_FEATURE(f) (((BVH_FUNCTION_FEATURES) & (f)) != 0)
|
||||
|
||||
/* Debugging heleprs */
|
||||
/* Debugging helpers. */
|
||||
#ifdef __KERNEL_DEBUG__
|
||||
# define BVH_DEBUG_INIT() \
|
||||
do { \
|
||||
|
||||
@@ -125,7 +125,7 @@ ccl_device_inline void microfacet_beckmann_sample_slopes(KernelGlobals *kg,
|
||||
}
|
||||
*slope_y = fast_ierff(2.0f * randv - 1.0f);
|
||||
#else
|
||||
/* Use precomputed table on CPU, it gives better perfomance. */
|
||||
/* Use precomputed table on CPU, it gives better performance. */
|
||||
int beckmann_table_offset = kernel_data.tables.beckmann_offset;
|
||||
|
||||
*slope_x = lookup_table_read_2D(
|
||||
|
||||
@@ -78,7 +78,7 @@ ccl_device void kernel_filter_construct_transform(const ccl_global float *ccl_re
|
||||
/* === Generate the feature transformation. ===
|
||||
* This transformation maps the num_features-dimensional feature space to a reduced feature
|
||||
* (r-feature) space which generally has fewer dimensions.
|
||||
* This mainly helps to prevent overfitting. */
|
||||
* This mainly helps to prevent over-fitting. */
|
||||
float feature_matrix[DENOISE_FEATURES * DENOISE_FEATURES];
|
||||
math_matrix_zero(feature_matrix, num_features);
|
||||
FOR_PIXEL_WINDOW
|
||||
@@ -91,7 +91,7 @@ ccl_device void kernel_filter_construct_transform(const ccl_global float *ccl_re
|
||||
|
||||
math_matrix_jacobi_eigendecomposition(feature_matrix, transform, num_features, transform_stride);
|
||||
*rank = 0;
|
||||
/* Prevent overfitting when a small window is used. */
|
||||
/* Prevent over-fitting when a small window is used. */
|
||||
int max_rank = min(num_features, num_pixels / 3);
|
||||
if (pca_threshold < 0.0f) {
|
||||
float threshold_energy = 0.0f;
|
||||
|
||||
@@ -93,7 +93,7 @@ ccl_device void kernel_filter_construct_transform(const float *ccl_restrict buff
|
||||
math_matrix_jacobi_eigendecomposition(feature_matrix, transform, num_features, 1);
|
||||
|
||||
*rank = 0;
|
||||
/* Prevent overfitting when a small window is used. */
|
||||
/* Prevent over-fitting when a small window is used. */
|
||||
int max_rank = min(num_features, num_pixels / 3);
|
||||
if (pca_threshold < 0.0f) {
|
||||
float threshold_energy = 0.0f;
|
||||
|
||||
@@ -435,7 +435,7 @@ ccl_device_inline float bvh_instance_push(
|
||||
return t;
|
||||
}
|
||||
|
||||
/* Transorm ray to exit static object in BVH */
|
||||
/* Transform ray to exit static object in BVH. */
|
||||
|
||||
ccl_device_inline float bvh_instance_pop(
|
||||
KernelGlobals *kg, int object, const Ray *ray, float3 *P, float3 *dir, float3 *idir, float t)
|
||||
@@ -497,7 +497,7 @@ ccl_device_inline float bvh_instance_motion_push(KernelGlobals *kg,
|
||||
return t;
|
||||
}
|
||||
|
||||
/* Transorm ray to exit motion blurred object in BVH */
|
||||
/* Transform ray to exit motion blurred object in BVH. */
|
||||
|
||||
ccl_device_inline float bvh_instance_motion_pop(KernelGlobals *kg,
|
||||
int object,
|
||||
|
||||
@@ -251,7 +251,7 @@ ccl_device void kernel_bake_evaluate(
|
||||
path_rng_2D(kg, rng_hash, sample, num_samples, PRNG_FILTER_U, &filter_x, &filter_y);
|
||||
}
|
||||
|
||||
/* Barycentric UV with subpixel offset. */
|
||||
/* Barycentric UV with sub-pixel offset. */
|
||||
float u = primitive[2];
|
||||
float v = primitive[3];
|
||||
|
||||
|
||||
@@ -63,12 +63,12 @@ ccl_device float4 film_map(KernelGlobals *kg, float4 rgba_in, float scale)
|
||||
{
|
||||
float4 result;
|
||||
|
||||
/* conversion to srgb */
|
||||
/* Conversion to SRGB. */
|
||||
result.x = color_linear_to_srgb(rgba_in.x * scale);
|
||||
result.y = color_linear_to_srgb(rgba_in.y * scale);
|
||||
result.z = color_linear_to_srgb(rgba_in.z * scale);
|
||||
|
||||
/* clamp since alpha might be > 1.0 due to russian roulette */
|
||||
/* Clamp since alpha might be > 1.0 due to Russian roulette. */
|
||||
result.w = saturate(rgba_in.w * scale);
|
||||
|
||||
return result;
|
||||
|
||||
@@ -21,7 +21,7 @@ CCL_NAMESPACE_BEGIN
|
||||
/* "Correlated Multi-Jittered Sampling"
|
||||
* Andrew Kensler, Pixar Technical Memo 13-01, 2013 */
|
||||
|
||||
/* todo: find good value, suggested 64 gives pattern on cornell box ceiling */
|
||||
/* TODO: find good value, suggested 64 gives pattern on cornell box ceiling. */
|
||||
#define CMJ_RANDOM_OFFSET_LIMIT 4096
|
||||
|
||||
ccl_device_inline bool cmj_is_pow2(int i)
|
||||
@@ -179,7 +179,7 @@ ccl_device void cmj_sample_2D(int s, int N, int p, float *fx, float *fy)
|
||||
smodm = cmj_fast_mod_pow2(s, m);
|
||||
}
|
||||
else {
|
||||
/* Doing s*inmv gives precision issues here. */
|
||||
/* Doing `s * inmv` gives precision issues here. */
|
||||
sdivm = s / m;
|
||||
smodm = s - sdivm * m;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ ccl_device_forceinline void kernel_branched_path_volume(KernelGlobals *kg,
|
||||
else
|
||||
# endif /* __VOLUME_DECOUPLED__ */
|
||||
{
|
||||
/* GPU: no decoupled ray marching, scatter probalistically */
|
||||
/* GPU: no decoupled ray marching, scatter probabilistically. */
|
||||
int num_samples = kernel_data.integrator.volume_samples;
|
||||
float num_samples_inv = 1.0f / num_samples;
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ ccl_device_inline bool sample_is_even(int pattern, int sample)
|
||||
#elif defined(__KERNEL_OPENCL__)
|
||||
return popcount(sample & 0xaaaaaaaa) & 1;
|
||||
#else
|
||||
/* TODO(Stefan): popcnt intrinsic for Windows with fallback for older CPUs. */
|
||||
/* TODO(Stefan): pop-count intrinsic for Windows with fallback for older CPUs. */
|
||||
int i = sample & 0xaaaaaaaa;
|
||||
i = i - ((i >> 1) & 0x55555555);
|
||||
i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
|
||||
|
||||
@@ -1641,7 +1641,7 @@ enum RayState {
|
||||
RAY_UPDATE_BUFFER,
|
||||
/* Denotes ray needs to skip most surface shader work. */
|
||||
RAY_HAS_ONLY_VOLUME,
|
||||
/* Donotes ray has hit background */
|
||||
/* Denotes ray has hit background */
|
||||
RAY_HIT_BACKGROUND,
|
||||
/* Denotes ray has to be regenerated */
|
||||
RAY_TO_REGENERATE,
|
||||
@@ -1699,7 +1699,7 @@ typedef struct WorkTile {
|
||||
ccl_global float *buffer;
|
||||
} WorkTile;
|
||||
|
||||
/* Precoumputed sample table sizes for PMJ02 sampler. */
|
||||
/* Pre-computed sample table sizes for PMJ02 sampler. */
|
||||
#define NUM_PMJ_SAMPLES 64 * 64
|
||||
#define NUM_PMJ_PATTERNS 48
|
||||
|
||||
|
||||
@@ -1033,7 +1033,7 @@ bool OSLRenderServices::get_background_attribute(
|
||||
return set_attribute_int(f, type, derivatives, val);
|
||||
}
|
||||
else if (name == u_ndc) {
|
||||
/* NDC coordinates with special exception for otho */
|
||||
/* NDC coordinates with special exception for orthographic projection. */
|
||||
OSLThreadData *tdata = kg->osl_tdata;
|
||||
OSL::ShaderGlobals *globals = &tdata->globals;
|
||||
float3 ndc[3];
|
||||
|
||||
@@ -129,7 +129,7 @@ static void shaderdata_to_shaderglobals(
|
||||
/* clear trace data */
|
||||
tdata->tracedata.init = false;
|
||||
|
||||
/* used by renderservices */
|
||||
/* Used by render-services. */
|
||||
sd->osl_globals = kg;
|
||||
sd->osl_path_state = state;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ point map_to_sphere(vector dir)
|
||||
float v, u;
|
||||
if (len > 0.0) {
|
||||
if (dir[0] == 0.0 && dir[1] == 0.0) {
|
||||
u = 0.0; /* Othwise domain error. */
|
||||
u = 0.0; /* Otherwise domain error. */
|
||||
}
|
||||
else {
|
||||
u = (1.0 - atan2(dir[0], dir[1]) / M_PI) / 2.0;
|
||||
|
||||
@@ -41,7 +41,7 @@ ccl_device_inline void kernel_split_branched_path_indirect_loop_init(KernelGloba
|
||||
|
||||
# undef BRANCHED_STORE
|
||||
|
||||
/* set loop counters to intial position */
|
||||
/* Set loop counters to initial position. */
|
||||
branched_state->next_closure = 0;
|
||||
branched_state->next_sample = 0;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ ccl_device_noinline bool kernel_split_branched_path_volume_indirect_light_iter(K
|
||||
PathRadiance *L = &kernel_split_state.path_radiance[ray_index];
|
||||
ShaderData *emission_sd = AS_SHADER_DATA(&kernel_split_state.sd_DL_shadow[ray_index]);
|
||||
|
||||
/* GPU: no decoupled ray marching, scatter probalistically */
|
||||
/* GPU: no decoupled ray marching, scatter probabilistically. */
|
||||
int num_samples = kernel_data.integrator.volume_samples;
|
||||
float num_samples_inv = 1.0f / num_samples;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ ccl_device void kernel_enqueue_inactive(KernelGlobals *kg,
|
||||
ccl_local_param unsigned int *local_queue_atomics)
|
||||
{
|
||||
#ifdef __BRANCHED_PATH__
|
||||
/* Enqeueue RAY_INACTIVE rays into QUEUE_INACTIVE_RAYS queue. */
|
||||
/* Enqueue RAY_INACTIVE rays into QUEUE_INACTIVE_RAYS queue. */
|
||||
if (ccl_local_id(0) == 0 && ccl_local_id(1) == 0) {
|
||||
*local_queue_atomics = 0;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ CCL_NAMESPACE_BEGIN
|
||||
ccl_device void kernel_shader_setup(KernelGlobals *kg,
|
||||
ccl_local_param unsigned int *local_queue_atomics)
|
||||
{
|
||||
/* Enqeueue RAY_TO_REGENERATE rays into QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS queue. */
|
||||
/* Enqueue RAY_TO_REGENERATE rays into QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS queue. */
|
||||
if (ccl_local_id(0) == 0 && ccl_local_id(1) == 0) {
|
||||
*local_queue_atomics = 0;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ ccl_device void svm_node_hsv(
|
||||
|
||||
color = rgb_to_hsv(color);
|
||||
|
||||
/* remember: fmod doesn't work for negative numbers here */
|
||||
/* Remember: `fmodf` doesn't work for negative numbers here. */
|
||||
color.x = fmodf(color.x + hue + 0.5f, 1.0f);
|
||||
color.y = saturate(color.y * sat);
|
||||
color.z *= val;
|
||||
@@ -48,7 +48,7 @@ ccl_device void svm_node_hsv(
|
||||
color.y = fac * color.y + (1.0f - fac) * in_color.y;
|
||||
color.z = fac * color.z + (1.0f - fac) * in_color.z;
|
||||
|
||||
/* Clamp color to prevent negative values caused by oversaturation. */
|
||||
/* Clamp color to prevent negative values caused by over saturation. */
|
||||
color.x = max(color.x, 0.0f);
|
||||
color.y = max(color.y, 0.0f);
|
||||
color.z = max(color.z, 0.0f);
|
||||
|
||||
@@ -38,7 +38,7 @@ ccl_device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y,
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Remap coordnate from 0..1 box to -1..-1 */
|
||||
/* Remap coordinate from 0..1 box to -1..-1 */
|
||||
ccl_device_inline float3 texco_remap_square(float3 co)
|
||||
{
|
||||
return (co - make_float3(0.5f, 0.5f, 0.5f)) * 2.0f;
|
||||
|
||||
@@ -615,8 +615,8 @@ ccl_device_noinline float perlin_3d(float x, float y, float z)
|
||||
*
|
||||
* Point Offset from v0
|
||||
* v0 (0, 0, 0, 0)
|
||||
* v1 (0, 0, 1, 0) The full avx type is computed by inserting the following
|
||||
* v2 (0, 1, 0, 0) sse types into both the low and high parts of the avx.
|
||||
* v1 (0, 0, 1, 0) The full AVX type is computed by inserting the following
|
||||
* v2 (0, 1, 0, 0) sse types into both the low and high parts of the AVX.
|
||||
* v3 (0, 1, 1, 0)
|
||||
* v4 (1, 0, 0, 0)
|
||||
* v5 (1, 0, 1, 0) (0, 1, 0, 1) = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(V, V + 1))
|
||||
|
||||
@@ -205,8 +205,8 @@ typedef enum NodeHairInfo {
|
||||
NODE_INFO_CURVE_IS_STRAND,
|
||||
NODE_INFO_CURVE_INTERCEPT,
|
||||
NODE_INFO_CURVE_THICKNESS,
|
||||
/*fade for minimum hair width transpency*/
|
||||
/*NODE_INFO_CURVE_FADE,*/
|
||||
/* Fade for minimum hair width transiency. */
|
||||
// NODE_INFO_CURVE_FADE,
|
||||
NODE_INFO_CURVE_TANGENT_NORMAL,
|
||||
NODE_INFO_CURVE_RANDOM,
|
||||
} NodeHairInfo;
|
||||
|
||||
@@ -1346,7 +1346,7 @@ void AlembicProcedural::generate(Scene *scene, Progress &progress)
|
||||
|
||||
bool need_shader_updates = false;
|
||||
|
||||
/* check for changes in shaders (newly requested atttributes) */
|
||||
/* Check for changes in shaders (newly requested attributes). */
|
||||
foreach (Node *object_node, objects) {
|
||||
AlembicObject *object = static_cast<AlembicObject *>(object_node);
|
||||
|
||||
@@ -1626,7 +1626,7 @@ void AlembicProcedural::read_subd(Scene *scene,
|
||||
|
||||
mesh->clear_non_sockets();
|
||||
|
||||
/* udpate sockets */
|
||||
/* Update sockets. */
|
||||
|
||||
Object *object = abc_object->get_object();
|
||||
cached_data.transforms.copy_to_socket(frame_time, object, object->get_tfm_socket());
|
||||
@@ -1660,7 +1660,7 @@ void AlembicProcedural::read_subd(Scene *scene,
|
||||
|
||||
mesh->set_num_subd_faces(mesh->get_subd_shader().size());
|
||||
|
||||
/* udpate attributes */
|
||||
/* Update attributes. */
|
||||
|
||||
update_attributes(mesh->subd_attributes, cached_data, frame_time);
|
||||
|
||||
|
||||
@@ -361,7 +361,7 @@ class AlembicProcedural : public Procedural {
|
||||
/* Tag for an update only if something was modified. */
|
||||
void tag_update(Scene *scene);
|
||||
|
||||
/* Returns a pointer to an exisiting or a newly created AlembicObject for the given path. */
|
||||
/* Returns a pointer to an existing or a newly created AlembicObject for the given path. */
|
||||
AlembicObject *get_or_create_object(const ustring &path);
|
||||
|
||||
private:
|
||||
|
||||
@@ -448,7 +448,7 @@ bool RenderBuffers::get_pass_rect(
|
||||
pixels[1] = f.y * scale_exposure;
|
||||
pixels[2] = f.z * scale_exposure;
|
||||
|
||||
/* clamp since alpha might be > 1.0 due to russian roulette */
|
||||
/* Clamp since alpha might be > 1.0 due to Russian roulette. */
|
||||
pixels[3] = saturate(f.w * scale);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,11 +252,11 @@ void Camera::update(Scene *scene)
|
||||
Transform fulltoborder = transform_from_viewplane(viewport_camera_border);
|
||||
Transform bordertofull = transform_inverse(fulltoborder);
|
||||
|
||||
/* ndc to raster */
|
||||
/* NDC to raster. */
|
||||
Transform ndctoraster = transform_scale(width, height, 1.0f) * bordertofull;
|
||||
Transform full_ndctoraster = transform_scale(full_width, full_height, 1.0f) * bordertofull;
|
||||
|
||||
/* raster to screen */
|
||||
/* Raster to screen. */
|
||||
Transform screentondc = fulltoborder * transform_from_viewplane(viewplane);
|
||||
|
||||
Transform screentoraster = ndctoraster * screentondc;
|
||||
@@ -264,7 +264,7 @@ void Camera::update(Scene *scene)
|
||||
Transform full_screentoraster = full_ndctoraster * screentondc;
|
||||
Transform full_rastertoscreen = transform_inverse(full_screentoraster);
|
||||
|
||||
/* screen to camera */
|
||||
/* Screen to camera. */
|
||||
ProjectionTransform cameratoscreen;
|
||||
if (camera_type == CAMERA_PERSPECTIVE)
|
||||
cameratoscreen = projection_perspective(fov, nearclip, farclip);
|
||||
|
||||
@@ -386,7 +386,7 @@ void ColorSpaceManager::free_memory()
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Template instanstations so we don't have to inline functions. */
|
||||
/* Template instantiations so we don't have to inline functions. */
|
||||
template void ColorSpaceManager::to_scene_linear(ustring, uchar *, size_t, bool);
|
||||
template void ColorSpaceManager::to_scene_linear(ustring, ushort *, size_t, bool);
|
||||
template void ColorSpaceManager::to_scene_linear(ustring, half *, size_t, bool);
|
||||
|
||||
@@ -847,7 +847,7 @@ bool DenoiseImage::save_output(const string &out_filepath, string &error)
|
||||
|
||||
out.reset();
|
||||
|
||||
/* Copy temporary file to outputput filepath. */
|
||||
/* Copy temporary file to output filepath. */
|
||||
string rename_error;
|
||||
if (ok && !OIIO::Filesystem::rename(tmp_filepath, out_filepath, rename_error)) {
|
||||
error = "Failed to move denoised image to " + out_filepath + ": " + rename_error;
|
||||
|
||||
@@ -1453,7 +1453,7 @@ void GeometryManager::device_update_preprocess(Device *device, Scene *scene, Pro
|
||||
if (shader->need_update_uvs) {
|
||||
device_update_flags |= ATTR_FLOAT2_NEEDS_REALLOC;
|
||||
|
||||
/* Attributes might need to be tesselated if added. */
|
||||
/* Attributes might need to be tessellated if added. */
|
||||
if (geom->is_mesh()) {
|
||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||
if (mesh->need_tesselation()) {
|
||||
@@ -1465,7 +1465,7 @@ void GeometryManager::device_update_preprocess(Device *device, Scene *scene, Pro
|
||||
if (shader->need_update_attribute) {
|
||||
device_update_flags |= ATTRS_NEED_REALLOC;
|
||||
|
||||
/* Attributes might need to be tesselated if added. */
|
||||
/* Attributes might need to be tessellated if added. */
|
||||
if (geom->is_mesh()) {
|
||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||
if (mesh->need_tesselation()) {
|
||||
|
||||
@@ -276,7 +276,7 @@ void ShaderGraph::connect(ShaderOutput *from, ShaderInput *to)
|
||||
emission->set_color(make_float3(1.0f, 1.0f, 1.0f));
|
||||
emission->set_strength(1.0f);
|
||||
convert = add(emission);
|
||||
/* Connect float inputs to Strength to save an additional Falue->Color conversion. */
|
||||
/* Connect float inputs to Strength to save an additional Value->Color conversion. */
|
||||
if (from->type() == SocketType::FLOAT) {
|
||||
convert_in = convert->input("Strength");
|
||||
}
|
||||
|
||||
@@ -419,7 +419,7 @@ int ImageManager::add_image_slot(ImageLoader *loader,
|
||||
|
||||
thread_scoped_lock device_lock(images_mutex);
|
||||
|
||||
/* Fnd existing image. */
|
||||
/* Find existing image. */
|
||||
for (slot = 0; slot < images.size(); slot++) {
|
||||
img = images[slot];
|
||||
if (img && ImageLoader::equals(img->loader, loader) && img->params == params) {
|
||||
|
||||
@@ -979,7 +979,7 @@ void LightManager::device_update(Device *device,
|
||||
|
||||
VLOG(1) << "Total " << scene->lights.size() << " lights.";
|
||||
|
||||
/* Detect which lights are enabled, also determins if we need to update the background. */
|
||||
/* Detect which lights are enabled, also determines if we need to update the background. */
|
||||
test_enabled_lights(scene);
|
||||
|
||||
device_free(device, dscene, need_update_background);
|
||||
|
||||
@@ -151,7 +151,7 @@ static bool parse_channels(const ImageSpec &in_spec,
|
||||
string layername, passname, channelname;
|
||||
if (parse_channel_name(
|
||||
pass.channel_name, layername, passname, channelname, multiview_channels)) {
|
||||
/* Channer part of a render layer. */
|
||||
/* Channel part of a render layer. */
|
||||
pass.op = parse_channel_operation(passname);
|
||||
}
|
||||
else {
|
||||
@@ -163,7 +163,7 @@ static bool parse_channels(const ImageSpec &in_spec,
|
||||
file_layers[layername].passes.push_back(pass);
|
||||
}
|
||||
|
||||
/* Loop over all detected RenderLayers, check whether they contain a full set of input channels.
|
||||
/* Loop over all detected render-layers, check whether they contain a full set of input channels.
|
||||
* Any channels that won't be processed internally are also passed through. */
|
||||
for (auto &i : file_layers) {
|
||||
const string &name = i.first;
|
||||
@@ -457,7 +457,7 @@ static bool save_output(const string &filepath,
|
||||
|
||||
out.reset();
|
||||
|
||||
/* Copy temporary file to outputput filepath. */
|
||||
/* Copy temporary file to output filepath. */
|
||||
string rename_error;
|
||||
if (ok && !OIIO::Filesystem::rename(tmp_filepath, filepath, rename_error)) {
|
||||
error = "Failed to move merged image to " + filepath + ": " + rename_error;
|
||||
|
||||
@@ -1612,7 +1612,7 @@ class OSLNode : public ShaderNode {
|
||||
|
||||
SHADER_NODE_NO_CLONE_CLASS(OSLNode)
|
||||
|
||||
/* ideally we could beter detect this, but we can't query this now */
|
||||
/* Ideally we could better detect this, but we can't query this now. */
|
||||
bool has_spatial_varying()
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -380,7 +380,7 @@ const char *OSLShaderManager::shader_load_filepath(string filepath)
|
||||
return hash;
|
||||
}
|
||||
|
||||
/* autocompile .OSL to .OSO if needed */
|
||||
/* Auto-compile .OSL to .OSO if needed. */
|
||||
if (oso_modified_time == 0 || (oso_modified_time < modified_time)) {
|
||||
OSLShaderManager::osl_compile(filepath, osopath);
|
||||
modified_time = path_modified_time(osopath);
|
||||
@@ -562,7 +562,7 @@ OSLNode *OSLShaderManager::osl_node(ShaderGraph *graph,
|
||||
}
|
||||
}
|
||||
|
||||
/* set bytcode hash or filepath */
|
||||
/* Set byte-code hash or file-path. */
|
||||
if (!bytecode_hash.empty()) {
|
||||
node->bytecode_hash = bytecode_hash;
|
||||
}
|
||||
|
||||
@@ -358,7 +358,7 @@ class Scene : public NodeOwner {
|
||||
|
||||
DeviceRequestedFeatures get_requested_device_features();
|
||||
|
||||
/* Maximumnumber of closure during session lifetime. */
|
||||
/* Maximum number of closure during session lifetime. */
|
||||
int max_closure_global;
|
||||
|
||||
/* Get maximum number of closures to be used in kernel. */
|
||||
|
||||
@@ -549,7 +549,7 @@ void DiagSplit::split_ngon(const Mesh::SubdFace &face, Patch *patches, size_t pa
|
||||
subpatch.edge_v1.indices_decrease_along_edge = true;
|
||||
subpatch.edge_u0.indices_decrease_along_edge = u0_reversed;
|
||||
|
||||
/* Perfrom split. */
|
||||
/* Perform split. */
|
||||
{
|
||||
subpatch.edge_u0.T = T(subpatch.patch, subpatch.c00, subpatch.c10);
|
||||
subpatch.edge_u1.T = T(subpatch.patch, subpatch.c01, subpatch.c11);
|
||||
@@ -646,7 +646,7 @@ void DiagSplit::post_split()
|
||||
/* Set start and end indices for edges generated from a split. */
|
||||
foreach (Edge &edge, edges) {
|
||||
if (edge.start_vert_index < 0) {
|
||||
/* Fixup offsets. */
|
||||
/* Fix up offsets. */
|
||||
if (edge.top_indices_decrease) {
|
||||
edge.top_offset = edge.top->T - edge.top_offset;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class DiagSplit {
|
||||
SubdParams params;
|
||||
|
||||
vector<Subpatch> subpatches;
|
||||
/* deque is used so that element pointers remain vaild when size is changed. */
|
||||
/* `deque` is used so that element pointers remain valid when size is changed. */
|
||||
deque<Edge> edges;
|
||||
|
||||
float3 to_world(Patch *patch, float2 uv);
|
||||
|
||||
@@ -349,7 +349,7 @@ ccl_device_inline float fractf(float x)
|
||||
return x - floorf(x);
|
||||
}
|
||||
|
||||
/* Adapted from godotengine math_funcs.h. */
|
||||
/* Adapted from godot-engine math_funcs.h. */
|
||||
ccl_device_inline float wrapf(float value, float max, float min)
|
||||
{
|
||||
float range = max - min;
|
||||
@@ -385,7 +385,7 @@ ccl_device_inline float nonzerof(float f, float eps)
|
||||
return f;
|
||||
}
|
||||
|
||||
/* Signum function testing for zero. Matches GLSL and OSL functions. */
|
||||
/* `signum` function testing for zero. Matches GLSL and OSL functions. */
|
||||
ccl_device_inline float compatible_signf(float f)
|
||||
{
|
||||
if (f == 0.0f) {
|
||||
@@ -754,7 +754,7 @@ ccl_device_inline float2 map_to_sphere(const float3 co)
|
||||
float u, v;
|
||||
if (l > 0.0f) {
|
||||
if (UNLIKELY(co.x == 0.0f && co.y == 0.0f)) {
|
||||
u = 0.0f; /* othwise domain error */
|
||||
u = 0.0f; /* Otherwise domain error. */
|
||||
}
|
||||
else {
|
||||
u = (1.0f - atan2f(co.x, co.y) / M_PI_F) / 2.0f;
|
||||
|
||||
@@ -84,7 +84,7 @@ ccl_device_inline int fast_rint(float x)
|
||||
{
|
||||
/* used by sin/cos/tan range reduction. */
|
||||
#ifdef __KERNEL_SSE4__
|
||||
/* Single roundps instruction on SSE4.1+ (for gcc/clang at least). */
|
||||
/* Single `roundps` instruction on SSE4.1+ (for gcc/clang at least). */
|
||||
return float_to_int(rintf(x));
|
||||
#else
|
||||
/* emulate rounding by adding/subtracting 0.5. */
|
||||
@@ -613,7 +613,7 @@ ccl_device_inline float fast_erfcf(float x)
|
||||
|
||||
ccl_device_inline float fast_ierff(float x)
|
||||
{
|
||||
/* From: Approximating the erfinv function by Mike Giles. */
|
||||
/* From: Approximating the `erfinv` function by Mike Giles. */
|
||||
/* To avoid trouble at the limit, clamp input to 1-eps. */
|
||||
float a = fabsf(x);
|
||||
if (a > 0.99999994f) {
|
||||
|
||||
@@ -161,7 +161,7 @@ ccl_device_inline void math_trimatrix_add_gramian(ccl_global float *A,
|
||||
}
|
||||
}
|
||||
|
||||
/* Transpose matrix A inplace. */
|
||||
/* Transpose matrix A in place. */
|
||||
ccl_device_inline void math_matrix_transpose(ccl_global float *A, int n, int stride)
|
||||
{
|
||||
for (int i = 0; i < n; i++) {
|
||||
|
||||
@@ -49,7 +49,7 @@ class MD5Hash {
|
||||
void process(const uint8_t *data);
|
||||
void finish(uint8_t digest[16]);
|
||||
|
||||
uint32_t count[2]; /* message length in bits, lsw first */
|
||||
uint32_t count[2]; /* message length in bits, LSW first. */
|
||||
uint32_t abcd[4]; /* digest buffer */
|
||||
uint8_t buf[64]; /* accumulate block */
|
||||
};
|
||||
|
||||
@@ -126,7 +126,7 @@ template<int SIZE, typename T> class ccl_try_align(16) StackAllocator
|
||||
return size_t(-1);
|
||||
}
|
||||
|
||||
/* Rebind to other ype of allocator. */
|
||||
/* Rebind to other type of allocator. */
|
||||
|
||||
template<class U> struct rebind {
|
||||
typedef StackAllocator<SIZE, U> other;
|
||||
|
||||
@@ -66,9 +66,9 @@ string string_from_wstring(const wstring &path);
|
||||
string string_to_ansi(const string &str);
|
||||
#endif
|
||||
|
||||
/* Make a string from a size in bytes in human readable form */
|
||||
/* Make a string from a size in bytes in human readable form. */
|
||||
string string_human_readable_size(size_t size);
|
||||
/* Make a string from a unitless quantity in human readable form */
|
||||
/* Make a string from a unit-less quantity in human readable form. */
|
||||
string string_human_readable_number(size_t num);
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
@@ -49,16 +49,6 @@
|
||||
|
||||
#include <libswscale/swscale.h>
|
||||
|
||||
/* Stupid way to distinguish FFmpeg from Libav:
|
||||
* - FFmpeg's MICRO version starts from 100 and goes up, while
|
||||
* - Libav's micro is always below 100.
|
||||
*/
|
||||
#if LIBAVCODEC_VERSION_MICRO >= 100
|
||||
# define AV_USING_FFMPEG
|
||||
#else
|
||||
# define AV_USING_LIBAV
|
||||
#endif
|
||||
|
||||
#if (LIBAVFORMAT_VERSION_MAJOR > 52) || \
|
||||
((LIBAVFORMAT_VERSION_MAJOR >= 52) && (LIBAVFORMAT_VERSION_MINOR >= 105))
|
||||
# define FFMPEG_HAVE_AVIO 1
|
||||
@@ -528,22 +518,6 @@ bool av_check_encoded_with_ffmpeg(AVFormatContext *ctx)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Libav doesn't have av_guess_frame_rate().
|
||||
* It was introduced in FFmpeg's lavf 55.1.100. */
|
||||
#ifdef AV_USING_LIBAV
|
||||
AVRational av_guess_frame_rate(AVFormatContext *ctx, AVStream *stream, AVFrame *frame)
|
||||
{
|
||||
(void)ctx;
|
||||
(void)frame;
|
||||
# if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 23, 1)
|
||||
/* For until r_frame_rate was deprecated (in Libav) use it. */
|
||||
return stream->r_frame_rate;
|
||||
# else
|
||||
return stream->avg_frame_rate;
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(51, 32, 0)
|
||||
# define AV_OPT_SEARCH_FAKE_OBJ 0
|
||||
#endif
|
||||
|
||||
@@ -580,7 +580,7 @@ typedef struct {
|
||||
GHOST_TUns32 xPixels;
|
||||
/** Number of lines. */
|
||||
GHOST_TUns32 yPixels;
|
||||
/** Numberof bits per pixel. */
|
||||
/** Number of bits per pixel. */
|
||||
GHOST_TUns32 bpp;
|
||||
/** Refresh rate (in Hertz). */
|
||||
GHOST_TUns32 frequency;
|
||||
|
||||
@@ -127,8 +127,8 @@ class GHOST_Context : public GHOST_IContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the OpenGL framebuffer associated with the OpenGL context
|
||||
* \return The ID of an OpenGL framebuffer object.
|
||||
* Gets the OpenGL frame-buffer associated with the OpenGL context
|
||||
* \return The ID of an OpenGL frame-buffer object.
|
||||
*/
|
||||
virtual unsigned int getDefaultFramebuffer()
|
||||
{
|
||||
|
||||
@@ -115,10 +115,10 @@ class GHOST_ContextCGL : public GHOST_Context {
|
||||
/** The OpenGL drawing context */
|
||||
NSOpenGLContext *m_openGLContext;
|
||||
|
||||
/** The virtualized default framebuffer */
|
||||
/** The virtualized default frame-buffer. */
|
||||
unsigned int m_defaultFramebuffer;
|
||||
|
||||
/** The virtualized default framebuffer's texture */
|
||||
/** The virtualized default frame-buffer's texture. */
|
||||
MTLTexture *m_defaultFramebufferMetalTexture;
|
||||
|
||||
bool m_coreProfile;
|
||||
|
||||
@@ -97,8 +97,8 @@ class GHOST_ContextD3D : public GHOST_Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the OpenGL framebuffer associated with the OpenGL context
|
||||
* \return The ID of an OpenGL framebuffer object.
|
||||
* Gets the OpenGL frame-buffer associated with the OpenGL context
|
||||
* \return The ID of an OpenGL frame-buffer object.
|
||||
*/
|
||||
unsigned int getDefaultFramebuffer()
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# ifdef DEBUG
|
||||
/* Suppress stl-MSVC debug info warning. */
|
||||
/* Suppress STL-MSVC debug info warning. */
|
||||
# pragma warning(disable : 4786)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -203,7 +203,7 @@ void *GHOST_DropTargetX11::getURIListGhostData(unsigned char *dropBuffer, int dr
|
||||
GHOST_TStringArray *strArray = NULL;
|
||||
int totPaths = 0, curLength = 0;
|
||||
|
||||
/* count total number of file pathes in buffer */
|
||||
/* Count total number of file paths in buffer. */
|
||||
for (int i = 0; i <= dropBufferSize; i++) {
|
||||
if (dropBuffer[i] == 0 || dropBuffer[i] == '\n' || dropBuffer[i] == '\r') {
|
||||
if (curLength) {
|
||||
|
||||
@@ -103,22 +103,22 @@ class GHOST_DropTargetX11 {
|
||||
/* Data type of the dragged object */
|
||||
GHOST_TDragnDropTypes m_draggedObjectType;
|
||||
|
||||
/* is dnd stuff initialzied */
|
||||
/* Is drag-and-drop stuff initialized. */
|
||||
static bool m_xdndInitialized;
|
||||
|
||||
/* class holding internal stiff of xdnd library */
|
||||
/* Class holding internal stiff of `xdnd` library. */
|
||||
static DndClass m_dndClass;
|
||||
|
||||
/* list of supported types to be dragged into */
|
||||
/* List of supported types to be dragged into. */
|
||||
static Atom *m_dndTypes;
|
||||
|
||||
/* list of supported dran'n'drop actions */
|
||||
/* List of supported drag-and-drop actions. */
|
||||
static Atom *m_dndActions;
|
||||
|
||||
/* List of supported MIME types to be dragged into */
|
||||
/* List of supported MIME types to be dragged into. */
|
||||
static const char *m_dndMimeTypes[];
|
||||
|
||||
/* counter of references to global XDND structures */
|
||||
/* Counter of references to global #XDND structures. */
|
||||
static int m_refCounter;
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
|
||||
@@ -303,10 +303,10 @@ class GHOST_ImeWin32 {
|
||||
*/
|
||||
void EndIME(HWND window_handle);
|
||||
|
||||
/* Updatg resultInfo and compInfo */
|
||||
/** Update #resultInfo and #compInfo */
|
||||
void UpdateInfo(HWND window_handle);
|
||||
|
||||
/* disable ime when start up */
|
||||
/** Disable IME when start up. */
|
||||
void CheckFirst(HWND window_handle);
|
||||
|
||||
ImeComposition resultInfo, compInfo;
|
||||
|
||||
@@ -40,7 +40,7 @@ GHOST_SystemPathsWin32::~GHOST_SystemPathsWin32()
|
||||
|
||||
const GHOST_TUns8 *GHOST_SystemPathsWin32::getSystemDir(int, const char *versionstr) const
|
||||
{
|
||||
/* 1 utf-16 might translante into 3 utf-8. 2 utf-16 translates into 4 utf-8*/
|
||||
/* 1 utf-16 might translate into 3 utf-8. 2 utf-16 translates into 4 utf-8. */
|
||||
static char knownpath[MAX_PATH * 3 + 128] = {0};
|
||||
PWSTR knownpath_16 = NULL;
|
||||
|
||||
|
||||
@@ -963,7 +963,7 @@ GHOST_EventButton *GHOST_SystemWin32::processButtonEvent(GHOST_TEventType type,
|
||||
processCursorEvent(window);
|
||||
}
|
||||
else {
|
||||
/* Tablet should be hadling inbetween mouse moves, only move to event position. */
|
||||
/* Tablet should be handling in between mouse moves, only move to event position. */
|
||||
DWORD msgPos = ::GetMessagePos();
|
||||
int msgPosX = GET_X_LPARAM(msgPos);
|
||||
int msgPosY = GET_Y_LPARAM(msgPos);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* \ingroup GHOST
|
||||
*/
|
||||
|
||||
#include <X11/XKBlib.h> /* Allow detectable auto-repeate. */
|
||||
#include <X11/XKBlib.h> /* Allow detectable auto-repeat. */
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/keysym.h>
|
||||
@@ -185,10 +185,10 @@ GHOST_SystemX11::GHOST_SystemX11() : GHOST_System(), m_xkb_descr(NULL), m_start_
|
||||
GHOST_ASSERT(false, "Could not instantiate timer!");
|
||||
}
|
||||
|
||||
/* Taking care not to overflow the tv.tv_sec * 1000 */
|
||||
/* Taking care not to overflow the `tv.tv_sec * 1000`. */
|
||||
m_start_time = GHOST_TUns64(tv.tv_sec) * 1000 + tv.tv_usec / 1000;
|
||||
|
||||
/* Use detectable auto-repeate, mac and windows also do this. */
|
||||
/* Use detectable auto-repeat, mac and windows also do this. */
|
||||
int use_xkb;
|
||||
int xkb_opcode, xkb_event, xkb_error;
|
||||
int xkb_major = XkbMajorVersion, xkb_minor = XkbMinorVersion;
|
||||
@@ -528,7 +528,7 @@ bool GHOST_SystemX11::openX11_IM()
|
||||
if (!m_display)
|
||||
return false;
|
||||
|
||||
/* set locale modifiers such as "@im=ibus" specified by XMODIFIERS */
|
||||
/* set locale modifiers such as `@im=ibus` specified by XMODIFIERS. */
|
||||
XSetLocaleModifiers("");
|
||||
|
||||
m_xim = XOpenIM(m_display, NULL, (char *)GHOST_X11_RES_NAME, (char *)GHOST_X11_RES_CLASS);
|
||||
@@ -1146,7 +1146,7 @@ void GHOST_SystemX11::processEvent(XEvent *xe)
|
||||
*/
|
||||
if ((xke->keycode >= 10 && xke->keycode < 20) &&
|
||||
((key_sym = XLookupKeysym(xke, ShiftMask)) >= XK_0) && (key_sym <= XK_9)) {
|
||||
/* pass (keep shift'ed key_sym) */
|
||||
/* Pass (keep shifted `key_sym`). */
|
||||
}
|
||||
else {
|
||||
/* regular case */
|
||||
@@ -1161,12 +1161,12 @@ void GHOST_SystemX11::processEvent(XEvent *xe)
|
||||
#endif
|
||||
|
||||
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
|
||||
/* getting unicode on key-up events gives XLookupNone status */
|
||||
/* Setting unicode on key-up events gives #XLookupNone status. */
|
||||
XIC xic = window->getX11_XIC();
|
||||
if (xic && xke->type == KeyPress) {
|
||||
Status status;
|
||||
|
||||
/* use utf8 because its not locale depentant, from xorg docs */
|
||||
/* Use utf8 because its not locale repentant, from XORG docs. */
|
||||
if (!(len = Xutf8LookupString(
|
||||
xic, xke, utf8_buf, sizeof(utf8_array) - 5, &key_sym, &status))) {
|
||||
utf8_buf[0] = '\0';
|
||||
@@ -1269,8 +1269,7 @@ void GHOST_SystemX11::processEvent(XEvent *xe)
|
||||
gbmask = GHOST_kButtonMaskRight;
|
||||
/* It seems events 6 and 7 are for horizontal scrolling.
|
||||
* you can re-order button mapping like this... (swaps 6,7 with 8,9)
|
||||
* xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7"
|
||||
*/
|
||||
* `xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7"` */
|
||||
else if (xbe.button == 6)
|
||||
gbmask = GHOST_kButtonMaskButton6;
|
||||
else if (xbe.button == 7)
|
||||
@@ -1289,8 +1288,7 @@ void GHOST_SystemX11::processEvent(XEvent *xe)
|
||||
|
||||
/* change of size, border, layer etc. */
|
||||
case ConfigureNotify: {
|
||||
/* XConfigureEvent & xce = xe->xconfigure; */
|
||||
|
||||
// XConfigureEvent & xce = xe->xconfigure;
|
||||
g_event = new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowSize, window);
|
||||
break;
|
||||
}
|
||||
@@ -1934,8 +1932,8 @@ static GHOST_TKey ghost_key_from_keycode(const XkbDescPtr xkb_descr, const KeyCo
|
||||
#define XCLIB_XCOUT_SENTCONVSEL 1 /* sent a request */
|
||||
#define XCLIB_XCOUT_INCR 2 /* in an incr loop */
|
||||
#define XCLIB_XCOUT_FALLBACK 3 /* STRING failed, need fallback to UTF8 */
|
||||
#define XCLIB_XCOUT_FALLBACK_UTF8 4 /* UTF8 failed, move to compouned */
|
||||
#define XCLIB_XCOUT_FALLBACK_COMP 5 /* compouned failed, move to text. */
|
||||
#define XCLIB_XCOUT_FALLBACK_UTF8 4 /* UTF8 failed, move to compound. */
|
||||
#define XCLIB_XCOUT_FALLBACK_COMP 5 /* compound failed, move to text. */
|
||||
#define XCLIB_XCOUT_FALLBACK_TEXT 6
|
||||
|
||||
/* Retrieves the contents of a selections. */
|
||||
@@ -2198,30 +2196,30 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
|
||||
restore_events.push_back(evt);
|
||||
}
|
||||
|
||||
/* fallback is needed. set XA_STRING to target and restart the loop. */
|
||||
/* Fallback is needed. Set #XA_STRING to target and restart the loop. */
|
||||
if (context == XCLIB_XCOUT_FALLBACK) {
|
||||
context = XCLIB_XCOUT_NONE;
|
||||
target = m_atom.STRING;
|
||||
continue;
|
||||
}
|
||||
else if (context == XCLIB_XCOUT_FALLBACK_UTF8) {
|
||||
/* utf8 fail, move to compouned text. */
|
||||
/* utf8 fail, move to compound text. */
|
||||
context = XCLIB_XCOUT_NONE;
|
||||
target = m_atom.COMPOUND_TEXT;
|
||||
continue;
|
||||
}
|
||||
else if (context == XCLIB_XCOUT_FALLBACK_COMP) {
|
||||
/* compouned text fail, move to text. */
|
||||
/* Compound text fail, move to text. */
|
||||
context = XCLIB_XCOUT_NONE;
|
||||
target = m_atom.TEXT;
|
||||
continue;
|
||||
}
|
||||
else if (context == XCLIB_XCOUT_FALLBACK_TEXT) {
|
||||
/* text fail, nothing else to try, break. */
|
||||
/* Text fail, nothing else to try, break. */
|
||||
context = XCLIB_XCOUT_NONE;
|
||||
}
|
||||
|
||||
/* only continue if xcout() is doing something */
|
||||
/* Only continue if #xcout() is doing something. */
|
||||
if (context == XCLIB_XCOUT_NONE)
|
||||
break;
|
||||
}
|
||||
@@ -2232,9 +2230,7 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
|
||||
}
|
||||
|
||||
if (sel_len) {
|
||||
/* only print the buffer out, and free it, if it's not
|
||||
* empty
|
||||
*/
|
||||
/* Only print the buffer out, and free it, if it's not empty. */
|
||||
unsigned char *tmp_data = (unsigned char *)malloc(sel_len + 1);
|
||||
memcpy((char *)tmp_data, (char *)sel_buf, sel_len);
|
||||
tmp_data[sel_len] = '\0';
|
||||
@@ -2288,28 +2284,28 @@ void GHOST_SystemX11::putClipboard(GHOST_TInt8 *buffer, bool selection) const
|
||||
* \{ */
|
||||
class DialogData {
|
||||
public:
|
||||
/* Width of the dialog */
|
||||
/* Width of the dialog. */
|
||||
uint width;
|
||||
/* Heigth of the dialog */
|
||||
/* Height of the dialog. */
|
||||
uint height;
|
||||
/* Default padding (x direction) between controls and edge of dialog */
|
||||
/* Default padding (x direction) between controls and edge of dialog. */
|
||||
uint padding_x;
|
||||
/* Default padding (y direction) between controls and edge of dialog */
|
||||
/* Default padding (y direction) between controls and edge of dialog. */
|
||||
uint padding_y;
|
||||
/* Width of a single button */
|
||||
/* Width of a single button. */
|
||||
uint button_width;
|
||||
/* Height of a single button */
|
||||
/* Height of a single button. */
|
||||
uint button_height;
|
||||
/* Inset of a button to its text */
|
||||
/* Inset of a button to its text. */
|
||||
uint button_inset_x;
|
||||
/* Size of the border of the button */
|
||||
/* Size of the border of the button. */
|
||||
uint button_border_size;
|
||||
/* Height of a line of text */
|
||||
uint line_height;
|
||||
/* offset of the text inside the button */
|
||||
/* Offset of the text inside the button. */
|
||||
uint button_text_offset_y;
|
||||
|
||||
/* Construct a new DialogData with the default settings */
|
||||
/* Construct a new #DialogData with the default settings. */
|
||||
DialogData()
|
||||
: width(640),
|
||||
height(175),
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <X11/XKBlib.h> /* Allow detectable auto-repeate. */
|
||||
#include <X11/XKBlib.h> /* Allow detectable auto-repeat. */
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
#include "../GHOST_Types.h"
|
||||
|
||||
@@ -392,7 +392,7 @@ class GHOST_Window : public GHOST_IWindow {
|
||||
/** Stores whether this is a full screen window. */
|
||||
bool m_fullScreen;
|
||||
|
||||
/** Whether to attempt to initialize a context with a stereo framebuffer. */
|
||||
/** Whether to attempt to initialize a context with a stereo frame-buffer. */
|
||||
bool m_wantStereoVisual;
|
||||
|
||||
/** Full-screen width */
|
||||
|
||||
@@ -1368,7 +1368,7 @@ GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(GHOST_TUns8 *bitmap
|
||||
GHOST_TUns32 fullBitRow, fullMaskRow;
|
||||
int x, y, cols;
|
||||
|
||||
cols = sizeX / 8; /* Num of whole bytes per row (width of bm/mask) */
|
||||
cols = sizeX / 8; /* Number of whole bytes per row (width of bm/mask). */
|
||||
if (sizeX % 8)
|
||||
cols++;
|
||||
|
||||
@@ -1407,7 +1407,7 @@ GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(GHOST_TUns8 *bitmap
|
||||
|
||||
GHOST_TSuccess GHOST_WindowWin32::setProgressBar(float progress)
|
||||
{
|
||||
/*SetProgressValue sets state to TBPF_NORMAL automaticly*/
|
||||
/* #SetProgressValue sets state to #TBPF_NORMAL automatically. */
|
||||
if (m_Bar && S_OK == m_Bar->SetProgressValue(m_hWnd, 10000 * progress, 10000))
|
||||
return GHOST_kSuccess;
|
||||
|
||||
|
||||
@@ -573,7 +573,7 @@ class GHOST_WindowWin32 : public GHOST_Window {
|
||||
|
||||
/** Pointer to system. */
|
||||
GHOST_SystemWin32 *m_system;
|
||||
/** Pointer to COM IDropTarget implementor. */
|
||||
/** Pointer to COM #IDropTarget implementer. */
|
||||
GHOST_DropTargetWin32 *m_dropTarget;
|
||||
/** Window handle. */
|
||||
HWND m_hWnd;
|
||||
@@ -582,14 +582,16 @@ class GHOST_WindowWin32 : public GHOST_Window {
|
||||
|
||||
/** Flag for if window has captured the mouse. */
|
||||
bool m_hasMouseCaptured;
|
||||
/** Flag if an operator grabs the mouse with WM_cursor_grab_enable/ungrab().
|
||||
* Multiple grabs must be released with a single ungrab. */
|
||||
/**
|
||||
* Flag if an operator grabs the mouse with #WM_cursor_grab_enable, #WM_cursor_grab_disable
|
||||
* Multiple grabs must be released with a single un-grab.
|
||||
*/
|
||||
bool m_hasGrabMouse;
|
||||
/** Count of number of pressed buttons. */
|
||||
int m_nPressedButtons;
|
||||
/** HCURSOR structure of the custom cursor. */
|
||||
HCURSOR m_customCursor;
|
||||
/** Request GL context aith alpha channel. */
|
||||
/** Request GL context with alpha channel. */
|
||||
bool m_wantAlphaBackground;
|
||||
|
||||
/** ITaskbarList3 structure for progress bar. */
|
||||
|
||||
@@ -1169,7 +1169,7 @@ GHOST_TSuccess GHOST_WindowX11::setOrder(GHOST_TWindowOrder order)
|
||||
|
||||
XGetWindowAttributes(m_display, m_window, &attr);
|
||||
|
||||
/* iconized windows give bad match error */
|
||||
/* Minimized windows give bad match error. */
|
||||
if (attr.map_state == IsViewable)
|
||||
XSetInputFocus(m_display, m_window, RevertToPointerRoot, CurrentTime);
|
||||
XFlush(m_display);
|
||||
|
||||
@@ -125,7 +125,7 @@ class GHOST_XrGraphicsBindingOpenGL : public GHOST_IXrGraphicsBinding {
|
||||
oxr_binding.wgl.hGLRC = ctx_wgl.m_hGLRC;
|
||||
#endif
|
||||
|
||||
/* Generate a framebuffer to use for blitting into the texture. */
|
||||
/* Generate a frame-buffer to use for blitting into the texture. */
|
||||
glGenFramebuffers(1, &m_fbo);
|
||||
}
|
||||
|
||||
|
||||
@@ -338,7 +338,7 @@ void GHOST_XrSession::endFrameDrawing(std::vector<XrCompositionLayerBaseHeader *
|
||||
void GHOST_XrSession::draw(void *draw_customdata)
|
||||
{
|
||||
std::vector<XrCompositionLayerProjectionView>
|
||||
projection_layer_views; /* Keep alive until xrEndFrame() call! */
|
||||
projection_layer_views; /* Keep alive until #xrEndFrame() call! */
|
||||
XrCompositionLayerProjection proj_layer;
|
||||
std::vector<XrCompositionLayerBaseHeader *> layers;
|
||||
|
||||
@@ -354,7 +354,7 @@ void GHOST_XrSession::draw(void *draw_customdata)
|
||||
|
||||
static void copy_openxr_pose_to_ghost_pose(const XrPosef &oxr_pose, GHOST_XrPose &r_ghost_pose)
|
||||
{
|
||||
/* Set and convert to Blender coodinate space. */
|
||||
/* Set and convert to Blender coordinate space. */
|
||||
r_ghost_pose.position[0] = oxr_pose.position.x;
|
||||
r_ghost_pose.position[1] = oxr_pose.position.y;
|
||||
r_ghost_pose.position[2] = oxr_pose.position.z;
|
||||
@@ -366,7 +366,7 @@ static void copy_openxr_pose_to_ghost_pose(const XrPosef &oxr_pose, GHOST_XrPose
|
||||
|
||||
static void ghost_xr_draw_view_info_from_view(const XrView &view, GHOST_XrDrawViewInfo &r_info)
|
||||
{
|
||||
/* Set and convert to Blender coodinate space. */
|
||||
/* Set and convert to Blender coordinate space. */
|
||||
copy_openxr_pose_to_ghost_pose(view.pose, r_info.eye_pose);
|
||||
|
||||
r_info.fov.angle_left = view.fov.angleLeft;
|
||||
|
||||
@@ -16,7 +16,7 @@ cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(GhostMultiTest)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../..//build_files/cmake/Modules")
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../../../build_files/cmake/Modules")
|
||||
|
||||
set(WITH_GUARDEDALLOC ON)
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ void IK_QJacobian::InvertSDLS()
|
||||
// singular the least squares inverse tries to minimize |J(dtheta) - dX)|
|
||||
// and doesn't try to minimize dTheta. This results in eratic changes in
|
||||
// angle. The damped least squares minimizes |dtheta| to try and reduce this
|
||||
// erratic behaviour.
|
||||
// erratic behavior.
|
||||
//
|
||||
// The selectively damped least squares (SDLS) is used here instead of the
|
||||
// DLS. The SDLS damps individual singular values, instead of using a single
|
||||
@@ -325,7 +325,7 @@ void IK_QJacobian::InvertDLS()
|
||||
// inverse tries to minimize |J(dtheta) - dX)| and doesn't
|
||||
// try to minimize dTheta. This results in eratic changes in angle.
|
||||
// Damped least squares minimizes |dtheta| to try and reduce this
|
||||
// erratic behaviour.
|
||||
// erratic behavior.
|
||||
|
||||
// We don't want to use the damped solution everywhere so we
|
||||
// only increase lamda from zero as we approach a singularity.
|
||||
|
||||
@@ -463,7 +463,7 @@ inline bool isnan(double i) {
|
||||
#endif
|
||||
}
|
||||
|
||||
/// Ceil function that has the same behaviour for positive
|
||||
/// Ceil function that has the same behavior for positive
|
||||
/// and negative values
|
||||
template <typename FloatType>
|
||||
FloatType ceil0(const FloatType& value) {
|
||||
|
||||
@@ -138,7 +138,7 @@ MIKK_INLINE tbool VNotZero(const SVec3 v)
|
||||
|
||||
// Shift operations in C are only defined for shift values which are
|
||||
// not negative and smaller than sizeof(value) * CHAR_BIT.
|
||||
// The mask, used with bitwise-and (&), prevents undefined behaviour
|
||||
// The mask, used with bitwise-and (&), prevents undefined behavior
|
||||
// when the shift count is 0 or >= the width of unsigned int.
|
||||
MIKK_INLINE unsigned int rotl(unsigned int value, unsigned int count)
|
||||
{
|
||||
@@ -1454,12 +1454,12 @@ static void BuildNeighborsFast(STriInfo pTriInfos[],
|
||||
pEdges[f * 3 + i].f = f; // record face number
|
||||
}
|
||||
|
||||
// sort over all edges by i0, this is the pricy one.
|
||||
// sort over all edges by i0, this is the pricey one.
|
||||
QuickSortEdges(pEdges, 0, iNrTrianglesIn * 3 - 1, 0, uSeed); // sort channel 0 which is i0
|
||||
|
||||
// sub sort over i1, should be fast.
|
||||
// could replace this with a 64 bit int sort over (i0,i1)
|
||||
// with i0 as msb in the quicksort call above.
|
||||
// with i0 as msb in the quick-sort call above.
|
||||
iEntries = iNrTrianglesIn * 3;
|
||||
iCurStartIndex = 0;
|
||||
for (i = 1; i < iEntries; i++) {
|
||||
|
||||
@@ -235,6 +235,7 @@ class IMAGE_MT_image(Menu):
|
||||
|
||||
layout.menu("IMAGE_MT_image_invert")
|
||||
layout.operator("image.resize", text="Resize")
|
||||
layout.menu("IMAGE_MT_image_flip")
|
||||
|
||||
if ima and not show_render:
|
||||
if ima.packed_file:
|
||||
@@ -250,6 +251,13 @@ class IMAGE_MT_image(Menu):
|
||||
layout.operator("palette.extract_from_image", text="Extract Palette")
|
||||
layout.operator("gpencil.image_to_grease_pencil", text="Generate Grease Pencil")
|
||||
|
||||
class IMAGE_MT_image_flip(Menu):
|
||||
bl_label = "Flip"
|
||||
|
||||
def draw(self, _context):
|
||||
layout = self.layout
|
||||
layout.operator("image.flip", text="Horizontally").use_flip_horizontal = True
|
||||
layout.operator("image.flip", text="Vertically").use_flip_vertical = True
|
||||
|
||||
class IMAGE_MT_image_invert(Menu):
|
||||
bl_label = "Invert"
|
||||
@@ -1584,6 +1592,7 @@ classes = (
|
||||
IMAGE_MT_select,
|
||||
IMAGE_MT_select_linked,
|
||||
IMAGE_MT_image,
|
||||
IMAGE_MT_image_flip,
|
||||
IMAGE_MT_image_invert,
|
||||
IMAGE_MT_uvs,
|
||||
IMAGE_MT_uvs_showhide,
|
||||
|
||||
@@ -487,6 +487,7 @@ geometry_node_categories = [
|
||||
NodeItem("GeometryNodeAttributeCompare"),
|
||||
NodeItem("GeometryNodeAttributeFill"),
|
||||
NodeItem("GeometryNodeAttributeMix"),
|
||||
NodeItem("GeometryNodeAttributeProximity"),
|
||||
NodeItem("GeometryNodeAttributeColorRamp"),
|
||||
NodeItem("GeometryNodeAttributeVectorMath"),
|
||||
NodeItem("GeometryNodeAttributeSampleTexture"),
|
||||
@@ -525,6 +526,7 @@ geometry_node_categories = [
|
||||
]),
|
||||
GeometryNodeCategory("GEO_VOLUME", "Volume", items=[
|
||||
NodeItem("GeometryNodePointsToVolume"),
|
||||
NodeItem("GeometryNodeVolumeToMesh"),
|
||||
]),
|
||||
GeometryNodeCategory("GEO_UTILITIES", "Utilities", items=[
|
||||
NodeItem("ShaderNodeMapRange"),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user