Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--build_files/cmake/macros.cmake26
-rw-r--r--intern/ghost/test/multitest/MultiTest.c27
-rw-r--r--intern/smoke/intern/FLUID_3D_STATIC.cpp10
-rw-r--r--release/plugins/sequence/gamma.c4
-rw-r--r--source/blender/blenfont/intern/blf.c4
-rw-r--r--source/blender/blenfont/intern/blf_font.c4
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c17
-rw-r--r--source/blender/blenkernel/intern/blender.c6
-rw-r--r--source/blender/blenkernel/intern/bullet.c2
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c4
-rw-r--r--source/blender/blenkernel/intern/constraint.c92
-rw-r--r--source/blender/blenkernel/intern/context.c2
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c2
-rw-r--r--source/blender/blenkernel/intern/editderivedmesh.c6
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c4
-rw-r--r--source/blender/blenkernel/intern/group.c2
-rw-r--r--source/blender/blenkernel/intern/image.c4
-rw-r--r--source/blender/blenkernel/intern/ipo.c12
-rw-r--r--source/blender/blenkernel/intern/lattice.c2
-rw-r--r--source/blender/blenkernel/intern/library.c4
-rw-r--r--source/blender/blenkernel/intern/material.c4
-rw-r--r--source/blender/blenkernel/intern/mball.c4
-rw-r--r--source/blender/blenkernel/intern/mesh.c4
-rw-r--r--source/blender/blenkernel/intern/multires.c2
-rw-r--r--source/blender/blenkernel/intern/particle.c2
-rw-r--r--source/blender/blenkernel/intern/scene.c2
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c10
-rw-r--r--source/blender/blenkernel/intern/sequencer.c6
-rw-r--r--source/blender/blenkernel/intern/smoke.c7
-rw-r--r--source/blender/blenkernel/intern/softbody.c25
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c2
-rw-r--r--source/blender/blenkernel/intern/text.c12
-rw-r--r--source/blender/blenlib/intern/BLI_heap.c2
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c4
-rw-r--r--source/blender/blenlib/intern/bpath.c2
-rw-r--r--source/blender/blenlib/intern/edgehash.c2
-rw-r--r--source/blender/blenlib/intern/noise.c2
-rw-r--r--source/blender/blenlib/intern/string_utf8.c10
-rw-r--r--source/blender/blenlib/intern/threads.c8
-rw-r--r--source/blender/blenloader/intern/runtime.c44
-rw-r--r--source/blender/bmesh/intern/bmesh_core.c12
-rw-r--r--source/blender/bmesh/operators/bmo_connect.c2
-rw-r--r--source/blender/collada/SceneExporter.cpp1
-rw-r--r--source/blender/compositor/intern/COM_WorkScheduler.cpp4
-rw-r--r--source/blender/compositor/operations/COM_MovieClipOperation.cpp13
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c10
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c6
-rw-r--r--source/blender/editors/animation/drivers.c8
-rw-r--r--source/blender/editors/animation/fmodifier_ui.c2
-rw-r--r--source/blender/editors/animation/keyframes_edit.c4
-rw-r--r--source/blender/editors/armature/poselib.c6
-rw-r--r--source/blender/editors/armature/poseobject.c6
-rw-r--r--source/blender/editors/curve/editcurve.c12
-rw-r--r--source/blender/editors/datafiles/Bfont.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c2
-rw-r--r--source/blender/editors/interface/interface_panel.c19
-rw-r--r--source/blender/editors/interface/interface_regions.c10
-rw-r--r--source/blender/editors/interface/interface_templates.c4
-rw-r--r--source/blender/editors/interface/interface_widgets.c2
-rw-r--r--source/blender/editors/interface/resources.c4
-rw-r--r--source/blender/editors/interface/view2d.c14
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c6
-rw-r--r--source/blender/editors/space_buttons/buttons_header.c4
-rw-r--r--source/blender/editors/space_node/drawnode.c1194
-rw-r--r--source/blender/editors/space_outliner/outliner_intern.h2
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c12
-rw-r--r--source/blender/editors/space_view3d/drawobject.c2
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c2
-rw-r--r--source/blender/imbuf/intern/anim_movie.c2
-rw-r--r--source/blender/imbuf/intern/jp2.c2
-rw-r--r--source/blender/imbuf/intern/jpeg.c2
-rw-r--r--source/blender/imbuf/intern/targa.c2
-rw-r--r--source/blender/makesdna/intern/CMakeLists.txt1
-rw-r--r--source/blender/makesdna/intern/dna_genfile.c2
-rw-r--r--source/blender/makesdna/intern/makesdna.c6
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt1
-rw-r--r--source/blender/makesrna/intern/makesrna.c32
-rw-r--r--source/blender/makesrna/intern/rna_access.c14
-rw-r--r--source/blender/makesrna/intern/rna_color.c2
-rw-r--r--source/blender/makesrna/intern/rna_define.c2
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c4
-rw-r--r--source/blender/nodes/composite/node_composite_util.c2
-rw-r--r--source/blender/nodes/intern/node_common.c4
-rw-r--r--source/blender/python/intern/bpy_props.c48
-rw-r--r--source/blender/python/intern/bpy_rna.c4
-rw-r--r--source/blender/render/intern/source/strand.c4
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c2
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c2
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c2
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c6
-rw-r--r--source/blender/windowmanager/intern/wm_subwindow.c2
-rw-r--r--source/blender/windowmanager/intern/wm_window.c2
-rw-r--r--source/blenderplayer/CMakeLists.txt1
-rw-r--r--source/creator/CMakeLists.txt1
-rw-r--r--source/gameengine/CMakeLists.txt1
-rw-r--r--source/tests/CMakeLists.txt1
97 files changed, 983 insertions, 931 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 038d6a075dd..4d0df909453 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,3 @@
-# -*- mode: cmake; indent-tabs-mode: t; -*-
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
@@ -559,7 +558,7 @@ if(UNIX AND NOT APPLE)
endif()
mark_as_advanced(FFMPEG)
- set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
+ set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include ${FFMPEG}/include/ffmpeg)
mark_as_advanced(FFMPEG_LIBRARIES)
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
@@ -1107,7 +1106,7 @@ elseif(WIN32)
if(WITH_CODEC_FFMPEG)
set(FFMPEG ${LIBDIR}/ffmpeg)
- set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include ${FFMPEG}/include)
+ set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
if(WITH_MINGW64)
set(FFMPEG_LIBRARIES avcodec.dll avformat.dll avdevice.dll avutil.dll swscale.dll swresample.dll)
else()
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index fbd28cc2398..2b61ddca648 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -1,5 +1,27 @@
-# -*- mode: cmake; indent-tabs-mode: t; -*-
-
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Jacques Beaurain.
+#
+# ***** END GPL LICENSE BLOCK *****
# foo_bar.spam --> foo_barMySuffix.spam
macro(file_suffix
diff --git a/intern/ghost/test/multitest/MultiTest.c b/intern/ghost/test/multitest/MultiTest.c
index b6fe785cba7..da1c56d0a3a 100644
--- a/intern/ghost/test/multitest/MultiTest.c
+++ b/intern/ghost/test/multitest/MultiTest.c
@@ -656,7 +656,8 @@ typedef struct {
int size[2];
} ExtraWindow;
-static void extrawindow_do_draw(ExtraWindow *ew) {
+static void extrawindow_do_draw(ExtraWindow *ew)
+{
GHOST_ActivateWindowDrawingContext(ew->win);
glClearColor(1, 1, 1, 1);
@@ -668,7 +669,8 @@ static void extrawindow_do_draw(ExtraWindow *ew) {
GHOST_SwapWindowBuffers(ew->win);
}
-static void extrawindow_do_reshape(ExtraWindow *ew) {
+static void extrawindow_do_reshape(ExtraWindow *ew)
+{
GHOST_RectangleHandle bounds = GHOST_GetClientBounds(ew->win);
GHOST_ActivateWindowDrawingContext(ew->win);
@@ -687,7 +689,8 @@ static void extrawindow_do_reshape(ExtraWindow *ew) {
glLoadIdentity();
}
-static void extrawindow_do_key(ExtraWindow *ew, GHOST_TKey key, int press) {
+static void extrawindow_do_key(ExtraWindow *ew, GHOST_TKey key, int press)
+{
switch (key) {
case GHOST_kKeyE:
if (press)
@@ -696,7 +699,8 @@ static void extrawindow_do_key(ExtraWindow *ew, GHOST_TKey key, int press) {
}
}
-static void extrawindow_spin_cursor(ExtraWindow *ew, GHOST_TUns64 time) {
+static void extrawindow_spin_cursor(ExtraWindow *ew, GHOST_TUns64 time)
+{
GHOST_TUns8 bitmap[16][2];
GHOST_TUns8 mask[16][2];
double ftime = (double) ((GHOST_TInt64) time) / 1000;
@@ -728,7 +732,8 @@ static void extrawindow_spin_cursor(ExtraWindow *ew, GHOST_TUns64 time) {
GHOST_SetCustomCursorShape(ew->win, bitmap, mask, 0, 0);
}
-static void extrawindow_handle(void *priv, GHOST_EventHandle evt) {
+static void extrawindow_handle(void *priv, GHOST_EventHandle evt)
+{
ExtraWindow *ew = priv;
GHOST_TEventType type = GHOST_GetEventType(evt);
char buf[256];
@@ -785,7 +790,8 @@ ExtraWindow *extrawindow_new(MultiTestApp *app) {
}
}
-void extrawindow_free(ExtraWindow *ew) {
+void extrawindow_free(ExtraWindow *ew)
+{
GHOST_SystemHandle sys = multitestapp_get_system(ew->app);
windowdata_free(GHOST_GetWindowUserData(ew->win));
@@ -806,7 +812,8 @@ struct _MultiTestApp {
int exit;
};
-static int multitest_event_handler(GHOST_EventHandle evt, GHOST_TUserDataPtr data) {
+static int multitest_event_handler(GHOST_EventHandle evt, GHOST_TUserDataPtr data)
+{
MultiTestApp *app = data;
GHOST_WindowHandle win;
@@ -876,12 +883,14 @@ GHOST_SystemHandle multitestapp_get_system(MultiTestApp *app) {
return app->sys;
}
-void multitestapp_free_extrawindow(MultiTestApp *app) {
+void multitestapp_free_extrawindow(MultiTestApp *app)
+{
extrawindow_free(app->extra);
app->extra = NULL;
}
-void multitestapp_toggle_extra_window(MultiTestApp *app) {
+void multitestapp_toggle_extra_window(MultiTestApp *app)
+{
if (app->extra) {
multitestapp_free_extrawindow(app);
}
diff --git a/intern/smoke/intern/FLUID_3D_STATIC.cpp b/intern/smoke/intern/FLUID_3D_STATIC.cpp
index 74c2c9c7e2d..c7a0ddcd04c 100644
--- a/intern/smoke/intern/FLUID_3D_STATIC.cpp
+++ b/intern/smoke/intern/FLUID_3D_STATIC.cpp
@@ -153,9 +153,13 @@ void FLUID_3D::setNeumannZ(float* field, Vec3Int res, int zBegin, int zEnd)
index = x + y * res[0];
field[index] = field[index + 2 * slabSize];
/* only allow outwards flux */
- if(field[index]>0.) field[index] = 0.;
- index += slabSize;
- if(field[index]>0.) field[index] = 0.;
+
+ // DG: Disable this for z-axis.
+ // The problem is that smoke somehow gets sucked in again
+ // from the TOP slab when this is enabled
+ // if(field[index]>0.) field[index] = 0.;
+ // index += slabSize;
+ // if(field[index]>0.) field[index] = 0.;
}
}
diff --git a/release/plugins/sequence/gamma.c b/release/plugins/sequence/gamma.c
index d6181eb0e9d..db04902413d 100644
--- a/release/plugins/sequence/gamma.c
+++ b/release/plugins/sequence/gamma.c
@@ -176,8 +176,8 @@ void plugin_seq_doit(Cast *cast, float facf0, float facf1, int width,
o[l]=CLAMP(i[l],0.f,1.f);
o[3]=1.0;
}
- i+=4;
- o+=4;
+ i += 4;
+ o += 4;
}
}
}
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index 626c591c40f..70794a11ff2 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -154,7 +154,7 @@ int BLF_load(const char *name)
/* check if we already load this font. */
i = blf_search(name);
if (i >= 0) {
- /*font= global_font[i];*/ /*UNUSED*/
+ /*font = global_font[i];*/ /*UNUSED*/
return i;
}
@@ -237,7 +237,7 @@ int BLF_load_mem(const char *name, unsigned char *mem, int mem_size)
i = blf_search(name);
if (i >= 0) {
- /*font= global_font[i];*/ /*UNUSED*/
+ /*font = global_font[i];*/ /*UNUSED*/
return i;
}
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 1b4ce59067d..6ab942f4e4d 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -132,7 +132,7 @@ static void blf_font_ensure_ascii_table(FontBLF *font)
_g = blf_glyph_add(_font, \
FT_Get_Char_Index((_font)->face, _c), _c); \
} \
- } \
+ } (void)0
#define BLF_KERNING_VARS(_font, _has_kerning, _kern_mode) \
@@ -155,7 +155,7 @@ static void blf_font_ensure_ascii_table(FontBLF *font)
_pen_x += delta.x >> 6; \
} \
} \
-} \
+} (void)0
void blf_font_draw(FontBLF *font, const char *str, unsigned int len)
{
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index b66a90ab911..1358c2e34a8 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -744,7 +744,7 @@ void BKE_animdata_main_cb(Main *mainptr, ID_AnimData_Edit_Callback func, void *u
for (id = first; id; id = id->next) { \
AnimData *adt = BKE_animdata_from_id(id); \
if (adt) func(id, adt, user_data); \
- }
+ } (void)0
/* "embedded" nodetree cases (i.e. scene/material/texture->nodetree) */
#define ANIMDATA_NODETREE_IDS_CB(first, NtId_Type) \
@@ -756,7 +756,7 @@ void BKE_animdata_main_cb(Main *mainptr, ID_AnimData_Edit_Callback func, void *u
if (adt2) func(id, adt2, user_data); \
} \
if (adt) func(id, adt, user_data); \
- }
+ } (void)0
/* nodes */
ANIMDATA_IDS_CB(mainptr->nodetree.first);
@@ -828,7 +828,7 @@ void BKE_all_animdata_fix_paths_rename(ID *ref_id, const char *prefix, const cha
for (id = first; id; id = id->next) { \
AnimData *adt = BKE_animdata_from_id(id); \
BKE_animdata_fix_paths_rename(id, adt, ref_id, prefix, oldName, newName, 0, 0, 1); \
- }
+ } (void)0
/* another version of this macro for nodetrees */
#define RENAMEFIX_ANIM_NODETREE_IDS(first, NtId_Type) \
@@ -840,7 +840,7 @@ void BKE_all_animdata_fix_paths_rename(ID *ref_id, const char *prefix, const cha
BKE_animdata_fix_paths_rename((ID *)ntp, adt2, ref_id, prefix, oldName, newName, 0, 0, 1); \
} \
BKE_animdata_fix_paths_rename(id, adt, ref_id, prefix, oldName, newName, 0, 0, 1); \
- }
+ } (void)0
/* nodes */
RENAMEFIX_ANIM_IDS(mainptr->nodetree.first);
@@ -1577,7 +1577,7 @@ static NlaEvalChannel *nlaevalchan_verify(PointerRNA *ptr, ListBase *channels, N
PropertyRNA *prop;
PointerRNA new_ptr;
char *path = NULL;
- /* short free_path=0; */
+ /* short free_path = 0; */
/* sanity checks */
if (channels == NULL)
@@ -1585,7 +1585,7 @@ static NlaEvalChannel *nlaevalchan_verify(PointerRNA *ptr, ListBase *channels, N
/* get RNA pointer+property info from F-Curve for more convenient handling */
/* get path, remapped as appropriate to work in its new environment */
- /* free_path= */ /* UNUSED */ animsys_remap_path(strip->remap, fcu->rna_path, &path);
+ /* free_path = */ /* UNUSED */ animsys_remap_path(strip->remap, fcu->rna_path, &path);
/* a valid property must be available, and it must be animatable */
if (RNA_path_resolve(ptr, path, &new_ptr, &prop) == 0) {
@@ -2266,7 +2266,8 @@ void BKE_animsys_evaluate_all_animation(Main *main, Scene *scene, float ctime)
AnimData *adt = BKE_animdata_from_id(id); \
BKE_animsys_evaluate_animdata(scene, id, adt, ctime, aflag); \
} \
- }
+ } (void)0
+
/* another macro for the "embedded" nodetree cases
* - this is like EVAL_ANIM_IDS, but this handles the case "embedded nodetrees"
* (i.e. scene/material/texture->nodetree) which we need a special exception
@@ -2284,7 +2285,7 @@ void BKE_animsys_evaluate_all_animation(Main *main, Scene *scene, float ctime)
} \
BKE_animsys_evaluate_animdata(scene, id, adt, ctime, aflag); \
} \
- }
+ } (void)0
/* optimization:
* when there are no actions, don't go over database and loop over heaps of datablocks,
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index e6333ed74aa..0def299c24a 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -518,7 +518,7 @@ void BKE_write_undo(bContext *C, const char *name)
if ( (U.uiflag & USER_GLOBALUNDO) == 0) return;
if (U.undosteps == 0) return;
- /* remove all undos after (also when curundo==NULL) */
+ /* remove all undos after (also when curundo == NULL) */
while (undobase.last != curundo) {
uel = undobase.last;
BLI_remlink(&undobase, uel);
@@ -564,7 +564,7 @@ void BKE_write_undo(bContext *C, const char *name)
BLI_snprintf(numstr, sizeof(numstr), "%d.blend", counter);
BLI_make_file_string("/", filepath, BLI_temporary_dir(), numstr);
- /* success= */ /* UNUSED */ BLO_write_file(CTX_data_main(C), filepath, fileflags, NULL, NULL);
+ /* success = */ /* UNUSED */ BLO_write_file(CTX_data_main(C), filepath, fileflags, NULL, NULL);
BLI_strncpy(curundo->str, filepath, sizeof(curundo->str));
}
@@ -574,7 +574,7 @@ void BKE_write_undo(bContext *C, const char *name)
if (curundo->prev) prevfile = &(curundo->prev->memfile);
memused = MEM_get_memory_in_use();
- /* success= */ /* UNUSED */ BLO_write_file_mem(CTX_data_main(C), prevfile, &curundo->memfile, G.fileflags);
+ /* success = */ /* UNUSED */ BLO_write_file_mem(CTX_data_main(C), prevfile, &curundo->memfile, G.fileflags);
curundo->undosize = MEM_get_memory_in_use() - memused;
}
diff --git a/source/blender/blenkernel/intern/bullet.c b/source/blender/blenkernel/intern/bullet.c
index 9fcb4389c62..7defa7e1be3 100644
--- a/source/blender/blenkernel/intern/bullet.c
+++ b/source/blender/blenkernel/intern/bullet.c
@@ -45,7 +45,7 @@ BulletSoftBody *bsbNew(void)
{
BulletSoftBody *bsb;
- bsb= MEM_callocN(sizeof(BulletSoftBody), "bulletsoftbody");
+ bsb = MEM_callocN(sizeof(BulletSoftBody), "bulletsoftbody");
bsb->flag = OB_BSB_BENDING_CONSTRAINTS | OB_BSB_SHAPE_MATCHING | OB_BSB_AERO_VPOINT;
bsb->linStiff = 0.5f;
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index f6eee44b92c..4e6a4b4a43c 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -927,7 +927,7 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
//int actualFace = dm->drawObject->triangle_to_mface[i];
int actualFace = next_actualFace;
MFace *mface = mf + actualFace;
- /*int drawSmooth= (flag & DM_DRAW_ALWAYS_SMOOTH) ? 1 : (mface->flag & ME_SMOOTH);*/ /* UNUSED */
+ /*int drawSmooth = (flag & DM_DRAW_ALWAYS_SMOOTH) ? 1 : (mface->flag & ME_SMOOTH);*/ /* UNUSED */
DMDrawOption draw_option = DM_DRAW_OPTION_NORMAL;
int flush = 0;
@@ -1208,7 +1208,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
else {
/* if the buffer was set, don't use it again.
* prevdraw was assumed true but didnt run so set to false - [#21036] */
- /* prevdraw= 0; */ /* UNUSED */
+ /* prevdraw = 0; */ /* UNUSED */
buffer = NULL;
}
}
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index da9350cc7b9..c6a0ecc057a 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -701,7 +701,7 @@ static void default_get_tarmat(bConstraint *con, bConstraintOb *UNUSED(cob), bCo
} \
\
BLI_addtail(list, ct); \
- }
+ } (void)0
/* This following macro should be used for all standard single-target *_get_tars functions
* to save typing and reduce maintenance woes. It does not do the subtarget related operations
@@ -720,7 +720,7 @@ static void default_get_tarmat(bConstraint *con, bConstraintOb *UNUSED(cob), bCo
if (ct->tar) ct->type = CONSTRAINT_OBTYPE_OBJECT; \
\
BLI_addtail(list, ct); \
- }
+ } (void)0
/* This following macro should be used for all standard single-target *_flush_tars functions
* to save typing and reduce maintenance woes.
@@ -741,7 +741,7 @@ static void default_get_tarmat(bConstraint *con, bConstraintOb *UNUSED(cob), bCo
BLI_freelinkN(list, ct); \
ct = ctn; \
} \
- }
+ } (void)0
/* This following macro should be used for all standard single-target *_flush_tars functions
* to save typing and reduce maintenance woes. It does not do the subtarget related operations.
@@ -761,7 +761,7 @@ static void default_get_tarmat(bConstraint *con, bConstraintOb *UNUSED(cob), bCo
BLI_freelinkN(list, ct); \
ct = ctn; \
} \
- }
+ } (void)0
/* --------- ChildOf Constraint ------------ */
@@ -790,7 +790,7 @@ static int childof_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints */
- SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list)
+ SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list);
return 1;
}
@@ -805,7 +805,7 @@ static void childof_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy)
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
}
}
@@ -925,7 +925,7 @@ static int trackto_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints */
- SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list)
+ SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list);
return 1;
}
@@ -940,7 +940,7 @@ static void trackto_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy)
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
}
}
@@ -1108,8 +1108,8 @@ static int kinematic_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints is used twice here */
- SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list)
- SINGLETARGET_GET_TARS(con, data->poletar, data->polesubtarget, ct, list)
+ SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list);
+ SINGLETARGET_GET_TARS(con, data->poletar, data->polesubtarget, ct, list);
return 2;
}
@@ -1124,8 +1124,8 @@ static void kinematic_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy)
- SINGLETARGET_FLUSH_TARS(con, data->poletar, data->polesubtarget, ct, list, nocopy)
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->poletar, data->polesubtarget, ct, list, nocopy);
}
}
@@ -1197,7 +1197,7 @@ static int followpath_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints without subtargets */
- SINGLETARGETNS_GET_TARS(con, data->tar, ct, list)
+ SINGLETARGETNS_GET_TARS(con, data->tar, ct, list);
return 1;
}
@@ -1212,7 +1212,7 @@ static void followpath_flush_tars(bConstraint *con, ListBase *list, short nocopy
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, nocopy)
+ SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, nocopy);
}
}
@@ -1543,7 +1543,7 @@ static int loclike_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints */
- SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list)
+ SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list);
return 1;
}
@@ -1558,7 +1558,7 @@ static void loclike_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy)
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
}
}
@@ -1633,7 +1633,7 @@ static int rotlike_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints */
- SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list)
+ SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list);
return 1;
}
@@ -1648,7 +1648,7 @@ static void rotlike_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy)
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
}
}
@@ -1745,7 +1745,7 @@ static int sizelike_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints */
- SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list)
+ SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list);
return 1;
}
@@ -1760,7 +1760,7 @@ static void sizelike_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy)
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
}
}
@@ -1834,7 +1834,7 @@ static int translike_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints */
- SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list)
+ SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list);
return 1;
}
@@ -1849,7 +1849,7 @@ static void translike_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy)
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
}
}
@@ -2093,7 +2093,7 @@ static int actcon_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints */
- SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list)
+ SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list);
return 1;
}
@@ -2108,7 +2108,7 @@ static void actcon_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy)
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
}
}
@@ -2255,7 +2255,7 @@ static int locktrack_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list)
+ SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list);
return 1;
}
@@ -2270,7 +2270,7 @@ static void locktrack_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy)
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
}
}
@@ -2565,7 +2565,7 @@ static int distlimit_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints */
- SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list)
+ SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list);
return 1;
}
@@ -2580,7 +2580,7 @@ static void distlimit_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy)
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
}
}
@@ -2692,7 +2692,7 @@ static int stretchto_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints */
- SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list)
+ SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list);
return 1;
}
@@ -2707,7 +2707,7 @@ static void stretchto_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy)
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
}
}
@@ -2866,7 +2866,7 @@ static int minmax_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints */
- SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list)
+ SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list);
return 1;
}
@@ -2881,7 +2881,7 @@ static void minmax_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy)
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
}
}
@@ -3009,7 +3009,7 @@ static int rbj_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints without subtargets */
- SINGLETARGETNS_GET_TARS(con, data->tar, ct, list)
+ SINGLETARGETNS_GET_TARS(con, data->tar, ct, list);
return 1;
}
@@ -3024,7 +3024,7 @@ static void rbj_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, nocopy)
+ SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, nocopy);
}
}
@@ -3060,7 +3060,7 @@ static int clampto_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints without subtargets */
- SINGLETARGETNS_GET_TARS(con, data->tar, ct, list)
+ SINGLETARGETNS_GET_TARS(con, data->tar, ct, list);
return 1;
}
@@ -3075,7 +3075,7 @@ static void clampto_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, nocopy)
+ SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, nocopy);
}
}
@@ -3244,7 +3244,7 @@ static int transform_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints */
- SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list)
+ SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list);
return 1;
}
@@ -3259,7 +3259,7 @@ static void transform_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy)
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
}
}
@@ -3380,7 +3380,7 @@ static int shrinkwrap_get_tars(bConstraint *con, ListBase *list)
bShrinkwrapConstraint *data = con->data;
bConstraintTarget *ct;
- SINGLETARGETNS_GET_TARS(con, data->target, ct, list)
+ SINGLETARGETNS_GET_TARS(con, data->target, ct, list);
return 1;
}
@@ -3395,7 +3395,7 @@ static void shrinkwrap_flush_tars(bConstraint *con, ListBase *list, short nocopy
bShrinkwrapConstraint *data = con->data;
bConstraintTarget *ct = list->first;
- SINGLETARGETNS_FLUSH_TARS(con, data->target, ct, list, nocopy)
+ SINGLETARGETNS_FLUSH_TARS(con, data->target, ct, list, nocopy);
}
}
@@ -3545,7 +3545,7 @@ static int damptrack_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list)
+ SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list);
return 1;
}
@@ -3560,7 +3560,7 @@ static void damptrack_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy)
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
}
}
@@ -3690,7 +3690,7 @@ static int splineik_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints without subtargets */
- SINGLETARGETNS_GET_TARS(con, data->tar, ct, list)
+ SINGLETARGETNS_GET_TARS(con, data->tar, ct, list);
return 1;
}
@@ -3705,7 +3705,7 @@ static void splineik_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, nocopy)
+ SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, nocopy);
}
}
@@ -3762,7 +3762,7 @@ static int pivotcon_get_tars(bConstraint *con, ListBase *list)
bConstraintTarget *ct;
/* standard target-getting macro for single-target constraints */
- SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list)
+ SINGLETARGET_GET_TARS(con, data->tar, data->subtarget, ct, list);
return 1;
}
@@ -3777,7 +3777,7 @@ static void pivotcon_flush_tars(bConstraint *con, ListBase *list, short nocopy)
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy)
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
}
}
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
index 734c8553850..ff2dd27e0c9 100644
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@ -267,7 +267,7 @@ static int ctx_data_get(bContext *C, const char *member, bContextDataResult *res
* loops requesting data from ourselfs in a context callback */
/* Ok, this looks evil...
- * if (ret) done= -(-ret | -done);
+ * if (ret) done = -(-ret | -done);
*
* Values in order of importance
* (0, -1, 1) - Where 1 is highest priority
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index bfdc8f891b7..53bc9c4cb7e 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -2950,7 +2950,7 @@ void DAG_pose_sort(Object *ob)
queue_delete(nqueue);
// printf("\nordered\n");
-// for (pchan = pose->chanbase.first; pchan; pchan= pchan->next) {
+// for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
// printf(" %s\n", pchan->name);
// }
diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c
index e0c3b257273..335758fec11 100644
--- a/source/blender/blenkernel/intern/editderivedmesh.c
+++ b/source/blender/blenkernel/intern/editderivedmesh.c
@@ -594,7 +594,7 @@ static void emDM_drawMappedFaces(DerivedMesh *dm,
float (*vertexCos)[3] = bmdm->vertexCos;
float (*vertexNos)[3] = bmdm->vertexNos;
float (*polyNos)[3] = bmdm->polyNos;
- // int *triPolyMap= bmdm->triPolyMap;
+ // int *triPolyMap = bmdm->triPolyMap;
BM_mesh_elem_index_ensure(bmdm->tc->bm, BM_VERT | BM_FACE);
@@ -802,7 +802,7 @@ static void emDM_drawFacesTex_common(DerivedMesh *dm,
BMLoop **ls = em->looptris[i];
MTexPoly *tp = has_uv ? CustomData_bmesh_get(&bm->pdata, ls[0]->f->head.data, CD_MTEXPOLY) : NULL;
MTFace mtf = {{{0}}};
- /*unsigned char *cp= NULL;*/ /*UNUSED*/
+ /*unsigned char *cp = NULL;*/ /*UNUSED*/
int drawSmooth = BM_elem_flag_test(ls[0]->f, BM_ELEM_SMOOTH);
DMDrawOption draw_option;
@@ -874,7 +874,7 @@ static void emDM_drawFacesTex_common(DerivedMesh *dm,
BMLoop **ls = em->looptris[i];
MTexPoly *tp = has_uv ? CustomData_bmesh_get(&bm->pdata, ls[0]->f->head.data, CD_MTEXPOLY) : NULL;
MTFace mtf = {{{0}}};
- /*unsigned char *cp= NULL;*/ /*UNUSED*/
+ /*unsigned char *cp = NULL;*/ /*UNUSED*/
int drawSmooth = BM_elem_flag_test(ls[0]->f, BM_ELEM_SMOOTH);
DMDrawOption draw_option;
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index 59c8a529d85..b7ede15d00b 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -613,7 +613,7 @@ static float fcm_cycles_time(FCurve *fcu, FModifier *fcm, float UNUSED(cvalue),
/* check that cyclic is still enabled for the specified time */
if (cycles == 0) {
- /* catch this case so that we don't exit when we have cycles=0
+ /* catch this case so that we don't exit when we have (cycles = 0)
* as this indicates infinite cycles...
*/
}
@@ -810,7 +810,7 @@ static void fcm_python_copy(FModifier *fcm, FModifier *src)
static void fcm_python_evaluate(FCurve *UNUSED(fcu), FModifier *UNUSED(fcm), float *UNUSED(cvalue), float UNUSED(evaltime))
{
#ifdef WITH_PYTHON
- //FMod_Python *data= (FMod_Python *)fcm->data;
+ //FMod_Python *data = (FMod_Python *)fcm->data;
/* FIXME... need to implement this modifier...
* It will need it execute a script using the custom properties
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c
index 8f077ab107c..0725b1732d3 100644
--- a/source/blender/blenkernel/intern/group.c
+++ b/source/blender/blenkernel/intern/group.c
@@ -196,7 +196,7 @@ int add_to_group(Group *group, Object *object, Scene *scene, Base *base)
}
}
-/* also used for ob==NULL */
+/* also used for (ob == NULL) */
static int rem_from_group_internal(Group *group, Object *ob)
{
GroupObject *go, *gon;
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 80b192c7a42..a2b1fb10500 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -290,7 +290,7 @@ static void image_assign_ibuf(Image *ima, ImBuf *ibuf, int index, int frame)
else
ibuf->flags &= ~IB_cm_predivide;
- /* this function accepts link==NULL */
+ /* this function accepts (link == NULL) */
BLI_insertlinkbefore(&ima->ibufs, link, ibuf);
/* now we don't want copies? */
@@ -802,7 +802,7 @@ void BKE_image_free_all_textures(void)
{
Tex *tex;
Image *ima;
- /* unsigned int totsize= 0; */
+ /* unsigned int totsize = 0; */
for (ima = G.main->image.first; ima; ima = ima->id.next)
ima->id.flag &= ~LIB_DOIT;
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 1077b5ad7c3..9737888e0b2 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -162,14 +162,14 @@ static AdrBit2Path ma_mode_bits[] = {
static AdrBit2Path *adrcode_bitmaps_to_paths(int blocktype, int adrcode, int *tot)
{
/* Object layers */
- if ((blocktype == ID_OB) && (adrcode == OB_LAY))
+ if ((blocktype == ID_OB) && (adrcode == OB_LAY))
RET_ABP(ob_layer_bits)
- else if ((blocktype == ID_MA) && (adrcode == MA_MODE))
- RET_ABP(ma_mode_bits)
- // XXX TODO: add other types...
+ else if ((blocktype == ID_MA) && (adrcode == MA_MODE))
+ RET_ABP(ma_mode_bits)
+ // XXX TODO: add other types...
- /* Normal curve */
- return NULL;
+ /* Normal curve */
+ return NULL;
}
/* *************************************************** */
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 15db290ff14..e3495a15871 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -305,7 +305,7 @@ void init_latt_deform(Object *oblatt, Object *ob)
fp = lt->latticedata = MEM_mallocN(sizeof(float) * 3 * lt->pntsu * lt->pntsv * lt->pntsw, "latticedata");
- /* for example with a particle system: ob==0 */
+ /* for example with a particle system: (ob == NULL) */
if (ob == NULL) {
/* in deformspace, calc matrix */
invert_m4_m4(lt->latmat, oblatt->obmat);
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 970356610d1..0abeb483745 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -650,7 +650,7 @@ static ID *alloc_libblock_notest(short type)
id = MEM_callocN(sizeof(Text), "text");
break;
case ID_SCRIPT:
- //XXX id= MEM_callocN(sizeof(Script), "script");
+ //XXX id = MEM_callocN(sizeof(Script), "script");
break;
case ID_SPK:
id = MEM_callocN(sizeof(Speaker), "speaker");
@@ -1043,7 +1043,7 @@ static void IDnames_to_dyn_pupstring(DynStr *pupds, ListBase *lb, ID *link, shor
/* used by headerbuttons.c buttons.c editobject.c editseq.c */
-/* if nr==NULL no MAX_IDPUP, this for non-header browsing */
+/* if (nr == NULL) no MAX_IDPUP, this for non-header browsing */
void IDnames_to_pupstring(const char **str, const char *title, const char *extraops, ListBase *lb, ID *link, short *nr)
{
DynStr *pupds = BLI_dynstr_new();
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 0eeb16be699..55ae7e4d11a 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -607,7 +607,7 @@ Material *give_current_material(Object *ob, short act)
if (ob == NULL) return NULL;
- /* if object cannot have material, totcolp==NULL */
+ /* if object cannot have material, (totcolp == NULL) */
totcolp = give_totcolp(ob);
if (totcolp == NULL || ob->totcol == 0) return NULL;
@@ -1179,7 +1179,7 @@ int object_remove_material_slot(Object *ob)
}
-/* r_col = current value, col = new value, fac==0 is no change */
+/* r_col = current value, col = new value, (fac == 0) is no change */
void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
{
float tmp, facm = 1.0f - fac;
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index bef5f2e18a3..b5b03a8924f 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -816,7 +816,7 @@ static int totindex, curindex;
static void accum_mballfaces(int i1, int i2, int i3, int i4)
{
int *newi, *cur;
- /* static int i=0; I would like to delete altogether, but I don't dare to, yet */
+ /* static int i = 0; I would like to delete altogether, but I don't dare to, yet */
if (totindex == curindex) {
totindex += 256;
@@ -1701,7 +1701,7 @@ static float init_meta(Scene *scene, Object *ob) /* return totsize */
MetaBall *mb;
MetaElem *ml;
float size, totsize, obinv[4][4], obmat[4][4], vec[3];
- //float max=0.0;
+ //float max = 0.0f;
int a, obnr, zero_size = 0;
char obname[MAX_ID_NAME];
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 9eb74986b29..fd952b7b518 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -1823,7 +1823,7 @@ void BKE_mesh_calc_normals_mapping_ex(MVert *mverts, int numVerts,
}
if (origIndexFace &&
- /* fnors==faceNors_r */ /* NO NEED TO ALLOC YET */
+ /* fnors == faceNors_r */ /* NO NEED TO ALLOC YET */
fnors != NULL &&
numFaces)
{
@@ -2004,7 +2004,7 @@ static void bm_corners_to_loops(Mesh *me, int findex, int loopstart, int numTex,
if (corners == 0) {
/* Empty MDisp layers appear in at least one of the sintel.blend files.
* Not sure why this happens, but it seems fine to just ignore them here.
- * If corners==0 for a non-empty layer though, something went wrong. */
+ * If (corners == 0) for a non-empty layer though, something went wrong. */
BLI_assert(fd->totdisp == 0);
}
else {
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index 4e8b67bd55b..d818ca09f20 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -685,7 +685,7 @@ static void multires_del_higher(MultiresModifierData *mmd, Object *ob, int lvl)
multires_set_tot_level(ob, mmd, lvl);
}
-/* direction=1 for delete higher, direction=0 for lower (not implemented yet) */
+/* (direction = 1) for delete higher, (direction = 0) for lower (not implemented yet) */
void multiresModifier_del_levels(MultiresModifierData *mmd, Object *ob, int direction)
{
Mesh *me = BKE_mesh_from_object(ob);
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index cd5efb9951b..9537a31838c 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -2411,7 +2411,7 @@ static void get_strand_normal(Material *ma, const float surfnor[3], float surfdi
static int psys_threads_init_path(ParticleThread *threads, Scene *scene, float cfra, int editupdate)
{
ParticleThreadContext *ctx = threads[0].ctx;
-/* Object *ob= ctx->sim.ob; */
+/* Object *ob = ctx->sim.ob; */
ParticleSystem *psys = ctx->sim.psys;
ParticleSettings *part = psys->part;
/* ParticleEditSettings *pset = &scene->toolsettings->particle; */
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 752203a5453..edcddd6d540 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -605,7 +605,7 @@ void BKE_scene_set_background(Main *bmain, Scene *scene)
base->flag |= flag;
/* not too nice... for recovering objects with lost data */
- //if (ob->pose==NULL) base->flag &= ~OB_POSEMODE;
+ //if (ob->pose == NULL) base->flag &= ~OB_POSEMODE;
ob->flag = base->flag;
ob->ctime = -1234567.0; /* force ipo to be calculated later */
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index 915f5557925..252ddb78887 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -143,7 +143,7 @@ static void open_plugin_seq(PluginSeq *pis, const char *seqname)
BLI_dynlib_get_error_as_string(NULL);
/* if (pis->handle) BLI_dynlib_close(pis->handle); */
- /* pis->handle= 0; */
+ /* pis->handle = 0; */
/* open the needed object */
pis->handle = BLI_dynlib_open(pis->name);
@@ -1480,8 +1480,8 @@ static void do_mul_effect_byte(float facf0, float facf1, int x, int y,
fac3 = (int)(256.0f * facf1);
/* formula:
- * fac*(a*b) + (1-fac)*a => fac*a*(b-1)+axaux= c*px + py*s ;//+centx
- * yaux= -s*px + c*py;//+centy
+ * fac * (a * b) + (1-fac)*a => fac * a * (b - 1) + axaux = c * px + py * s; //+centx
+ * yaux = -s * px + c * py; //+centy
*/
while (y--) {
@@ -2339,7 +2339,7 @@ static void RVBlurBitmap2_byte(unsigned char *map, int width, int height,
/* Swap buffers */
- swap = temp; temp = map; /* map=swap; */ /* UNUSED */
+ swap = temp; temp = map; /* map = swap; */ /* UNUSED */
/* Tidy up */
MEM_freeN(filter);
@@ -2509,7 +2509,7 @@ static void RVBlurBitmap2_float(float *map, int width, int height,
/* Swap buffers */
- swap = temp; temp = map; /* map=swap; */ /* UNUSED */
+ swap = temp; temp = map; /* map = swap; */ /* UNUSED */
/* Tidy up */
MEM_freeN(filter);
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 8fbb3ee9800..5892a6a7b3e 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -612,8 +612,8 @@ void calc_sequence(Scene *scene, Sequence *seq)
/* we take the largest start and smallest end */
- // seq->start= seq->startdisp= MAX2(seq->seq1->startdisp, seq->seq2->startdisp);
- // seq->enddisp= MIN2(seq->seq1->enddisp, seq->seq2->enddisp);
+ // seq->start = seq->startdisp = MAX2(seq->seq1->startdisp, seq->seq2->startdisp);
+ // seq->enddisp = MIN2(seq->seq1->enddisp, seq->seq2->enddisp);
if (seq->seq1) {
/* XXX These resets should not be necessary, but users used to be able to
@@ -1553,7 +1553,7 @@ static void make_cb_table_byte(float lift, float gain, float gamma,
for (y = 0; y < 256; y++) {
float v = color_balance_fl((float)y * (1.0f / 255.0f), lift, gain, gamma, mul);
CLAMP(v, 0.0f, 1.0f);
- table[y] = v * 255;
+ table[y] = round(v * 255);
}
}
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index edb4348dc5a..ce739a00bb4 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -1592,8 +1592,8 @@ static void step(Scene *scene, Object *ob, SmokeModifierData *smd, float fps)
/* adapt timestep for different framerates, dt = 0.1 is at 25fps */
dt *= (25.0f / fps);
- // maximum timestep/"CFL" constraint: dt < dx * maxVel
- maxVel = (sds->dx * 1.0);
+ // maximum timestep/"CFL" constraint: dt < 5.0 *dx / maxVel
+ maxVel = (sds->dx * 5.0);
for(i = 0; i < size; i++)
{
@@ -1607,7 +1607,8 @@ static void step(Scene *scene, Object *ob, SmokeModifierData *smd, float fps)
totalSubsteps = (totalSubsteps < 1) ? 1 : totalSubsteps;
totalSubsteps = (totalSubsteps > maxSubSteps) ? maxSubSteps : totalSubsteps;
- // totalSubsteps = 2.0f; // DEBUG
+ /* Disable substeps for now, since it results in numerical instability */
+ totalSubsteps = 1.0f;
dtSubdiv = (float)dt / (float)totalSubsteps;
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index 5abc4bc3830..63f0a29821f 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -3514,7 +3514,9 @@ static void lattice_to_softbody(Scene *scene, Object *ob)
{
Lattice *lt= ob->data;
SoftBody *sb;
- int totvert, totspring = 0;
+ int totvert, totspring = 0, a;
+ BodyPoint *bp;
+ BPoint *bpnt = lt->def;
totvert= lt->pntsu*lt->pntsv*lt->pntsw;
@@ -3531,18 +3533,17 @@ static void lattice_to_softbody(Scene *scene, Object *ob)
/* renew ends with ob->soft with points and edges, also checks & makes ob->soft */
renew_softbody(scene, ob, totvert, totspring);
sb= ob->soft; /* can be created in renew_softbody() */
+ bp = sb->bpoint;
- /* weights from bpoints, same code used as for mesh vertices */
- /* if ((ob->softflag & OB_SB_GOAL) && sb->vertgroup) { 2.4x one*/
- /* new! take the weights from lattice vertex anyhow */
- if (ob->softflag & OB_SB_GOAL) {
- BodyPoint *bp= sb->bpoint;
- BPoint *bpnt= lt->def;
- /* jow_go_for2_5 */
- int a;
-
- for (a=0; a<totvert; a++, bp++, bpnt++) {
- bp->goal= bpnt->weight;
+ /* same code used as for mesh vertices */
+ for (a = 0; a < totvert; a++, bp++, bpnt++) {
+ if ((ob->softflag & OB_SB_GOAL) && sb->vertgroup) {
+ get_scalar_from_vertexgroup(ob, a, (short) (sb->vertgroup - 1), &bp->goal);
+ }
+ else {
+ if (ob->softflag & OB_SB_GOAL) {
+ bp->goal = sb->defgoal;
+ }
}
}
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 22e702d5930..5c387e8cee0 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -125,7 +125,7 @@ static CCGSubSurf *_getSubSurf(CCGSubSurf *prevSS, int subdivLevels,
int useArena = flags & CCG_USE_ARENA;
int normalOffset = 0;
- /* subdivLevels==0 is not allowed */
+ /* (subdivLevels == 0) is not allowed */
subdivLevels = MAX2(subdivLevels, 1);
if (prevSS) {
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 7bfd4189cc3..eefdb31c001 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -813,7 +813,7 @@ void txt_move_up(Text *text, short sel)
if (sel) txt_curs_sel(text, &linep, &charp);
else { txt_pop_first(text); txt_curs_cur(text, &linep, &charp); }
if (!*linep) return;
- /* old= *charp; */ /* UNUSED */
+ /* old = *charp; */ /* UNUSED */
if ((*linep)->prev) {
int index = txt_utf8_offset_to_index((*linep)->line, *charp);
@@ -841,7 +841,7 @@ void txt_move_down(Text *text, short sel)
if (sel) txt_curs_sel(text, &linep, &charp);
else { txt_pop_last(text); txt_curs_cur(text, &linep, &charp); }
if (!*linep) return;
- /* old= *charp; */ /* UNUSED */
+ /* old = *charp; */ /* UNUSED */
if ((*linep)->next) {
int index = txt_utf8_offset_to_index((*linep)->line, *charp);
@@ -3226,8 +3226,8 @@ short txt_clear_marker_region(Text *text, TextLine *line, int start, int end, in
}
/* Clears all markers in the specified group (if given) with at least the
- * specified flags set. Useful for clearing temporary markers (group=0,
- * flags=TMARK_TEMP) */
+ * specified flags set. Useful for clearing temporary markers (group = 0,
+ * flags = TMARK_TEMP) */
short txt_clear_markers(Text *text, int group, int flags)
{
TextMarker *marker, *next;
@@ -3276,7 +3276,7 @@ TextMarker *txt_prev_marker(Text *text, TextMarker *marker)
if (tmp->group == marker->group)
return tmp;
}
- return NULL; /* Only if marker==NULL */
+ return NULL; /* Only if (marker == NULL) */
}
/* Finds the next marker in the same group. If no other is found, the same
@@ -3290,7 +3290,7 @@ TextMarker *txt_next_marker(Text *text, TextMarker *marker)
if (tmp->group == marker->group)
return tmp;
}
- return NULL; /* Only if marker==NULL */
+ return NULL; /* Only if (marker == NULL) */
}
diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c
index 0a281786100..c1175192434 100644
--- a/source/blender/blenlib/intern/BLI_heap.c
+++ b/source/blender/blenlib/intern/BLI_heap.c
@@ -63,7 +63,7 @@ struct Heap {
{ \
SWAP(int, heap->tree[i]->index, heap->tree[j]->index); \
SWAP(HeapNode *, heap->tree[i], heap->tree[j]); \
- }
+ } (void)0
/***/
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index e9ee91505de..6a4ee64ebcd 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -139,7 +139,7 @@ static float KDOP_AXES[13][3] = {
else break; \
} \
heap[child] = element; \
- }
+ } (void)0
#define POP_HEAP_BODY(HEAP_TYPE, PRIORITY, heap, heap_size) \
{ \
@@ -158,7 +158,7 @@ static float KDOP_AXES[13][3] = {
parent = child2; \
} \
heap[parent] = element; \
- }
+ } (void)0
#if 0
static int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, int *max_size, int size_per_item)
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index 1aba8bbeaf2..f90bb4d6152 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -417,7 +417,7 @@ void BLI_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
bpath_user_data); \
} \
} \
- } \
+ } (void)0
{
diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c
index cdaf270adcb..d58ccbbd48e 100644
--- a/source/blender/blenlib/intern/edgehash.c
+++ b/source/blender/blenlib/intern/edgehash.c
@@ -56,7 +56,7 @@ static unsigned int _ehash_hashsizes[] = {
v0 ^= v1; \
v1 ^= v0; \
v0 ^= v1; \
- }
+ } (void)0
/***/
diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c
index e01d2061743..2ff0b564592 100644
--- a/source/blender/blenlib/intern/noise.c
+++ b/source/blender/blenlib/intern/noise.c
@@ -992,7 +992,7 @@ static float g[512 + 2][3] = {
b1 = (b0 + 1) & 255; \
r0 = t - floorf(t); \
r1 = r0 - 1.0f; \
- }
+ } (void)0
static float noise3_perlin(float vec[3])
diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c
index 77bebfaf2e8..e9bccd4244b 100644
--- a/source/blender/blenlib/intern/string_utf8.c
+++ b/source/blender/blenlib/intern/string_utf8.c
@@ -178,14 +178,14 @@ static const size_t utf8_skip_data[256] = {
} \
} \
*dst= '\0'; \
- }
+ } (void)0
char *BLI_strncpy_utf8(char *dst, const char *src, size_t maxncpy)
{
char *dst_r= dst;
/* note: currently we don't attempt to deal with invalid utf8 chars */
- BLI_STR_UTF8_CPY(dst, src, maxncpy)
+ BLI_STR_UTF8_CPY(dst, src, maxncpy);
return dst_r;
}
@@ -197,7 +197,7 @@ char *BLI_strncat_utf8(char *dst, const char *src, size_t maxncpy)
maxncpy--;
}
- BLI_STR_UTF8_CPY(dst, src, maxncpy)
+ BLI_STR_UTF8_CPY(dst, src, maxncpy);
return dst;
}
@@ -315,7 +315,7 @@ size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst_w, const char *src_c, const size
} \
else { \
Len = -1; \
- }
+ } (void)0
/* same as glib define but added an 'Err' arg */
#define UTF8_GET(Result, Chars, Count, Mask, Len, Err) \
@@ -327,7 +327,7 @@ size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst_w, const char *src_c, const size
} \
(Result) <<= 6; \
(Result) |= ((Chars)[(Count)] & 0x3f); \
- }
+ } (void)0
/* uses glib functions but not from glib */
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c
index 4f5ea0b23bd..f9f677d7c22 100644
--- a/source/blender/blenlib/intern/threads.c
+++ b/source/blender/blenlib/intern/threads.c
@@ -71,8 +71,8 @@ static void *thread_tls_data;
* A sample loop can look like this (pseudo c);
*
* ListBase lb;
- * int maxthreads= 2;
- * int cont= 1;
+ * int maxthreads = 2;
+ * int cont = 1;
*
* BLI_init_threads(&lb, do_something_func, maxthreads);
*
@@ -85,14 +85,14 @@ static void *thread_tls_data;
* else PIL_sleep_ms(50);
*
* // find if a job is ready, this the do_something_func() should write in job somewhere
- * cont= 0;
+ * cont = 0;
* for (go over all jobs)
* if (job is ready) {
* if (job was not removed) {
* BLI_remove_thread(&lb, job);
* }
* }
- * else cont= 1;
+ * else cont = 1;
* }
* // conditions to exit loop
* if (if escape loop event) {
diff --git a/source/blender/blenloader/intern/runtime.c b/source/blender/blenloader/intern/runtime.c
index 2f86c810da0..a7dae22cda2 100644
--- a/source/blender/blenloader/intern/runtime.c
+++ b/source/blender/blenloader/intern/runtime.c
@@ -39,10 +39,10 @@
#include <errno.h>
#ifdef WIN32
-# include <io.h> // read, open
+# include <io.h> // read, open
# include "BLI_winstuff.h"
#else // ! WIN32
-# include <unistd.h> // read
+# include <unistd.h> // read
#endif
#include "BLO_readfile.h"
@@ -63,33 +63,33 @@ static int handle_read_msb_int(int handle)
if (read(handle, buf, 4) != 4)
return -1;
- return (buf[0]<<24) + (buf[1]<<16) + (buf[2]<<8) + (buf[3]<<0);
+ return (buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + (buf[3] << 0);
}
int BLO_is_a_runtime(const char *path)
{
- int res= 0, fd= BLI_open(path, O_BINARY|O_RDONLY, 0);
+ int res = 0, fd = BLI_open(path, O_BINARY | O_RDONLY, 0);
int datastart;
char buf[8];
- if (fd==-1)
+ if (fd == -1)
goto cleanup;
lseek(fd, -12, SEEK_END);
- datastart= handle_read_msb_int(fd);
+ datastart = handle_read_msb_int(fd);
- if (datastart==-1)
+ if (datastart == -1)
goto cleanup;
- else if (read(fd, buf, 8)!=8)
+ else if (read(fd, buf, 8) != 8)
goto cleanup;
- else if (memcmp(buf, "BRUNTIME", 8)!=0)
+ else if (memcmp(buf, "BRUNTIME", 8) != 0)
goto cleanup;
else
- res= 1;
+ res = 1;
cleanup:
- if (fd!=-1)
+ if (fd != -1)
close(fd);
return res;
@@ -97,45 +97,45 @@ cleanup:
BlendFileData *BLO_read_runtime(const char *path, ReportList *reports)
{
- BlendFileData *bfd= NULL;
+ BlendFileData *bfd = NULL;
size_t actualsize;
int fd, datastart;
char buf[8];
- fd= BLI_open(path, O_BINARY|O_RDONLY, 0);
+ fd = BLI_open(path, O_BINARY | O_RDONLY, 0);
- if (fd==-1) {
+ if (fd == -1) {
BKE_reportf(reports, RPT_ERROR, "Unable to open \"%s\": %s.", path, strerror(errno));
goto cleanup;
}
- actualsize= BLI_file_descriptor_size(fd);
+ actualsize = BLI_file_descriptor_size(fd);
lseek(fd, -12, SEEK_END);
- datastart= handle_read_msb_int(fd);
+ datastart = handle_read_msb_int(fd);
- if (datastart==-1) {
+ if (datastart == -1) {
BKE_reportf(reports, RPT_ERROR, "Unable to read \"%s\" (problem seeking)", path);
goto cleanup;
}
- else if (read(fd, buf, 8)!=8) {
+ else if (read(fd, buf, 8) != 8) {
BKE_reportf(reports, RPT_ERROR, "Unable to read \"%s\" (truncated header)", path);
goto cleanup;
}
- else if (memcmp(buf, "BRUNTIME", 8)!=0) {
+ else if (memcmp(buf, "BRUNTIME", 8) != 0) {
BKE_reportf(reports, RPT_ERROR, "Unable to read \"%s\" (not a blend file)", path);
goto cleanup;
}
else {
//printf("starting to read runtime from %s at datastart %d\n", path, datastart);
lseek(fd, datastart, SEEK_SET);
- bfd = blo_read_blendafterruntime(fd, path, actualsize-datastart, reports);
- fd= -1; // file was closed in blo_read_blendafterruntime()
+ bfd = blo_read_blendafterruntime(fd, path, actualsize - datastart, reports);
+ fd = -1; // file was closed in blo_read_blendafterruntime()
}
cleanup:
- if (fd!=-1)
+ if (fd != -1)
close(fd);
return bfd;
diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c
index 736a43e1676..a14d602c586 100644
--- a/source/blender/bmesh/intern/bmesh_core.c
+++ b/source/blender/bmesh/intern/bmesh_core.c
@@ -42,11 +42,11 @@
// #define USE_DEBUG_INDEX_MEMCHECK
#ifdef USE_DEBUG_INDEX_MEMCHECK
-#define DEBUG_MEMCHECK_INDEX_INVALIDATE(ele) \
- { \
- int undef_idx; \
- BM_elem_index_set(ele, undef_idx); /* set_ok_invalid */ \
- } \
+#define DEBUG_MEMCHECK_INDEX_INVALIDATE(ele) \
+ { \
+ int undef_idx; \
+ BM_elem_index_set(ele, undef_idx); /* set_ok_invalid */ \
+ } (void)0
#endif
@@ -92,7 +92,7 @@ BMVert *BM_vert_create(BMesh *bm, const float co[3], const BMVert *example)
* \brief Main function for creating a new edge.
*
* \note Duplicate edges are supported by the API however users should _never_ see them.
- * so unless you need a unique edge or know the edge won't exist, you should call wih \a nodouble=TRUE
+ * so unless you need a unique edge or know the edge won't exist, you should call wih \a nodouble = TRUE
*/
BMEdge *BM_edge_create(BMesh *bm, BMVert *v1, BMVert *v2, const BMEdge *example, int nodouble)
{
diff --git a/source/blender/bmesh/operators/bmo_connect.c b/source/blender/bmesh/operators/bmo_connect.c
index 2d4c15dbaa5..653bbaf8602 100644
--- a/source/blender/bmesh/operators/bmo_connect.c
+++ b/source/blender/bmesh/operators/bmo_connect.c
@@ -178,7 +178,7 @@ static int clamp_index(const int x, const int len)
BLI_array_append(arr2, arr_tmp[i]); \
} \
BLI_array_free(arr_tmp); \
- }
+ } (void)0
/* get the 2 loops matching 2 verts.
* first attempt to get the face corners that use the edge defined by v1 & v2,
diff --git a/source/blender/collada/SceneExporter.cpp b/source/blender/collada/SceneExporter.cpp
index 83ac496db0e..d258f4ef5e1 100644
--- a/source/blender/collada/SceneExporter.cpp
+++ b/source/blender/collada/SceneExporter.cpp
@@ -72,6 +72,7 @@ void SceneExporter::writeNodes(Object *ob, Scene *sce)
{
COLLADASW::Node node(mSW);
node.setNodeId(translate_id(id_name(ob)));
+ node.setNodeName(translate_id(id_name(ob)));
node.setType(COLLADASW::Node::NODE);
node.start();
diff --git a/source/blender/compositor/intern/COM_WorkScheduler.cpp b/source/blender/compositor/intern/COM_WorkScheduler.cpp
index 406f0acf724..c5a5a585c19 100644
--- a/source/blender/compositor/intern/COM_WorkScheduler.cpp
+++ b/source/blender/compositor/intern/COM_WorkScheduler.cpp
@@ -289,8 +289,8 @@ void WorkScheduler::initialize()
printf("%s\n", resultString);
}
}
- delete cldevices;
- delete platforms;
+ delete [] cldevices;
+ delete [] platforms;
}
#endif
#endif
diff --git a/source/blender/compositor/operations/COM_MovieClipOperation.cpp b/source/blender/compositor/operations/COM_MovieClipOperation.cpp
index b565e48345c..6019ab879be 100644
--- a/source/blender/compositor/operations/COM_MovieClipOperation.cpp
+++ b/source/blender/compositor/operations/COM_MovieClipOperation.cpp
@@ -70,19 +70,16 @@ void MovieClipOperation::deinitExecution()
void MovieClipOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
{
- ImBuf *ibuf;
-
resolution[0] = 0;
resolution[1] = 0;
if (this->movieClip) {
- ibuf = BKE_movieclip_get_ibuf(this->movieClip, this->movieClipUser);
- if (ibuf) {
- resolution[0] = ibuf->x;
- resolution[1] = ibuf->y;
+ int width, height;
- IMB_freeImBuf(ibuf);
- }
+ BKE_movieclip_get_size(this->movieClip, this->movieClipUser, &width, &height);
+
+ resolution[0] = width;
+ resolution[1] = height;
}
}
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index c4fca2d4ea5..08672a22666 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -850,7 +850,7 @@ static int acf_group_setting_flag(bAnimContext *ac, int setting, short *neg)
return AGRP_MUTED;
case ACHANNEL_SETTING_PROTECT: /* protected */
- // *neg= 1; - if we change this to edtiability
+ // *neg = 1; - if we change this to edtiability
return AGRP_PROTECTED;
case ACHANNEL_SETTING_VISIBLE: /* visiblity - graph editor */
@@ -938,7 +938,7 @@ static int acf_fcurve_setting_flag(bAnimContext *UNUSED(ac), int setting, short
return FCURVE_MUTED;
case ACHANNEL_SETTING_PROTECT: /* protected */
- // *neg= 1; - if we change this to edtiability
+ // *neg = 1; - if we change this to edtiability
return FCURVE_PROTECTED;
case ACHANNEL_SETTING_VISIBLE: /* visiblity - graph editor */
@@ -2483,7 +2483,7 @@ static int acf_gpl_setting_flag(bAnimContext *UNUSED(ac), int setting, short *ne
return GP_LAYER_HIDE;
case ACHANNEL_SETTING_PROTECT: /* protected */
- // *neg= 1; - if we change this to edtiability
+ // *neg = 1; - if we change this to edtiability
return GP_LAYER_LOCKED;
default: /* unsupported */
@@ -2699,7 +2699,7 @@ short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, int setting
else if (smode == ACHANNEL_SETFLAG_ADD) (sval) |= (sflag); \
else (sval) &= ~(sflag); \
} \
- }
+ } (void)0
/* Change value of some setting for a channel
* - setting: eAnimChannel_Settings
@@ -3096,7 +3096,7 @@ static void draw_setting_widget(bAnimContext *ac, bAnimListElem *ale, bAnimChann
/* get the base icon for the setting */
switch (setting) {
case ACHANNEL_SETTING_VISIBLE: /* visibility eyes */
- //icon= ((enabled)? ICON_VISIBLE_IPO_ON : ICON_VISIBLE_IPO_OFF);
+ //icon = ((enabled) ? ICON_VISIBLE_IPO_ON : ICON_VISIBLE_IPO_OFF);
icon = ICON_VISIBLE_IPO_OFF;
if (ale->type == ANIMTYPE_FCURVE)
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index 159c4681951..dc0886a473e 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -496,7 +496,7 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAn
break;
/* store this level as the 'old' level now */
- // prevLevel= level; // XXX: prevLevel is unused
+ // prevLevel = level; // XXX: prevLevel is unused
}
}
}
@@ -2017,7 +2017,7 @@ static int animchannels_rename_invoke(bContext *C, wmOperator *UNUSED(op), wmEve
v2d = &ar->v2d;
/* figure out which channel user clicked in
- * Note: although channels technically start at y= ACHANNEL_FIRST, we need to adjust by half a channel's height
+ * Note: although channels technically start at (y = ACHANNEL_FIRST), we need to adjust by half a channel's height
* so that the tops of channels get caught ok. Since ACHANNEL_FIRST is really ACHANNEL_HEIGHT, we simply use
* ACHANNEL_HEIGHT_HALF.
*/
@@ -2330,7 +2330,7 @@ static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *
selectmode = SELECT_REPLACE;
/* figure out which channel user clicked in
- * Note: although channels technically start at y= ACHANNEL_FIRST, we need to adjust by half a channel's height
+ * Note: although channels technically start at (y = ACHANNEL_FIRST), we need to adjust by half a channel's height
* so that the tops of channels get caught ok. Since ACHANNEL_FIRST is really ACHANNEL_HEIGHT, we simply use
* ACHANNEL_HEIGHT_HALF.
*/
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index 416df6bccba..4a5966948ae 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -521,7 +521,7 @@ void ANIM_OT_driver_button_add(wmOperatorType *ot)
/* callbacks */
ot->exec = add_driver_button_exec;
- //op->poll= ??? // TODO: need to have some animatable property to do this
+ //op->poll = ??? // TODO: need to have some animatable property to do this
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -573,7 +573,7 @@ void ANIM_OT_driver_button_remove(wmOperatorType *ot)
/* callbacks */
ot->exec = remove_driver_button_exec;
- //op->poll= ??? // TODO: need to have some driver to be able to do this...
+ //op->poll = ??? // TODO: need to have some driver to be able to do this...
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -620,7 +620,7 @@ void ANIM_OT_copy_driver_button(wmOperatorType *ot)
/* callbacks */
ot->exec = copy_driver_button_exec;
- //op->poll= ??? // TODO: need to have some driver to be able to do this...
+ //op->poll = ??? // TODO: need to have some driver to be able to do this...
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -664,7 +664,7 @@ void ANIM_OT_paste_driver_button(wmOperatorType *ot)
/* callbacks */
ot->exec = paste_driver_button_exec;
- //op->poll= ??? // TODO: need to have some driver to be able to do this...
+ //op->poll = ??? // TODO: need to have some driver to be able to do this...
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c
index 24cae5d8652..ea875567705 100644
--- a/source/blender/editors/animation/fmodifier_ui.c
+++ b/source/blender/editors/animation/fmodifier_ui.c
@@ -79,7 +79,7 @@
#define DRAW_BACKDROP(height) \
{ \
uiDefBut(block, ROUNDBOX, B_REDR, "", -3, yco - height, width + 3, height - 1, NULL, 5.0, 0.0, 12.0, (float)rb_col, ""); \
- }
+ } (void)0
/* callback to verify modifier data */
static void validate_fmodifier_cb(bContext *UNUSED(C), void *fcm_v, void *UNUSED(arg))
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index b92d0fb345a..88627a6dabd 100644
--- a/source/blender/editors/animation/keyframes_edit.c
+++ b/source/blender/editors/animation/keyframes_edit.c
@@ -429,7 +429,7 @@ void ANIM_editkeyframes_refresh(bAnimContext *ac)
if (check(2)) \
ok |= KEYFRAME_OK_H2; \
} \
- }
+ } (void)0
/* ------------------------ */
@@ -766,7 +766,7 @@ KeyframeEditFunc ANIM_editkeyframes_mirror(short type)
bezt->h1 = HD_FREE; \
if (ELEM3(bezt->h2, HD_ALIGN, HD_AUTO, HD_AUTO_ANIM)) \
bezt->h2 = HD_FREE; \
- }
+ } (void)0
/* Sets the selected bezier handles to type 'auto' */
static short set_bezier_auto(KeyframeEditData *UNUSED(ked), BezTriple *bezt)
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index 36c15c50809..18e3d967835 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -1236,7 +1236,7 @@ static int poselib_preview_handle_event(bContext *UNUSED(C), wmOperator *op, wmE
case PAD5: case PAD6: case PAD7: case PAD8: case PAD9:
case PADPLUSKEY: case PADMINUS:
case MIDDLEMOUSE: case MOUSEMOVE:
- //pld->redraw= PL_PREVIEW_REDRAWHEADER;
+ //pld->redraw = PL_PREVIEW_REDRAWHEADER;
ret = OPERATOR_PASS_THROUGH;
break;
@@ -1365,7 +1365,7 @@ static int poselib_preview_handle_event(bContext *UNUSED(C), wmOperator *op, wmE
* even though we still maintain control (as RUNNING_MODAL flag is still set too)
*/
case MIDDLEMOUSE: case MOUSEMOVE:
- //pld->redraw= PL_PREVIEW_REDRAWHEADER;
+ //pld->redraw = PL_PREVIEW_REDRAWHEADER;
ret = OPERATOR_PASS_THROUGH;
break;
@@ -1379,7 +1379,7 @@ static int poselib_preview_handle_event(bContext *UNUSED(C), wmOperator *op, wmE
}
else {
/* view manipulation (see above) */
- //pld->redraw= PL_PREVIEW_REDRAWHEADER;
+ //pld->redraw = PL_PREVIEW_REDRAWHEADER;
ret = OPERATOR_PASS_THROUGH;
}
break;
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index df970171a54..a8e84116699 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -119,8 +119,8 @@ void ED_armature_exit_posemode(bContext *C, Base *base)
}
}
-/* if a selected or active bone is protected, throw error (oonly if warn==1) and return 1 */
-/* only_selected==1 : the active bone is allowed to be protected */
+/* if a selected or active bone is protected, throw error (oonly if warn == 1) and return 1 */
+/* only_selected == 1: the active bone is allowed to be protected */
#if 0 /* UNUSED 2.5 */
static short pose_has_protected_selected(Object *ob, short warn)
{
@@ -571,7 +571,7 @@ static short pose_select_same_group(bContext *C, Object *ob, short extend)
/* alloc a small array to keep track of the groups to use
* - each cell stores on/off state for whether group should be used
- * - size is numGroups + 1, since index=0 is used for no-group
+ * - size is (numGroups + 1), since (index = 0) is used for no-group
*/
group_flags = MEM_callocN(numGroups + 1, "pose_select_same_group");
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 431ce15a26d..492111ff8e7 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -1448,7 +1448,7 @@ static short isNurbselUV(Nurb *nu, int *u, int *v, int flag)
if (*u == -1) *u = b;
else return 0;
}
- else if (sel > 1) return 0; /* because sel==1 is still ok */
+ else if (sel > 1) return 0; /* because sel == 1 is still ok */
}
for (a = 0; a < nu->pntsu; a++) {
@@ -2965,7 +2965,7 @@ static void subdividenurb(Object *obedit, int number_cuts)
BKE_nurb_knot_calc_u(nu);
}
}
- } /* End of 'else if (nu->pntsv==1)' */
+ } /* End of 'else if (nu->pntsv == 1)' */
else if (nu->type == CU_NURBS) {
/* This is a very strange test ... */
/**
@@ -3085,7 +3085,7 @@ static void subdividenurb(Object *obedit, int number_cuts)
nu->pntsv = (number_cuts + 1) * nu->pntsv - number_cuts;
BKE_nurb_knot_calc_u(nu);
BKE_nurb_knot_calc_v(nu);
- } /* End of 'if (sel== nu->pntsu*nu->pntsv)' (subdivide entire NURB) */
+ } /* End of 'if (sel == nu->pntsu*nu->pntsv)' (subdivide entire NURB) */
else {
/* subdivide in v direction? */
sel = 0;
@@ -3258,7 +3258,7 @@ static void findnearestNurbvert__doClosest(void *userData, Nurb *nu, BPoint *bp,
static short findnearestNurbvert(ViewContext *vc, short sel, const int mval[2], Nurb **nurb, BezTriple **bezt, BPoint **bp)
{
- /* sel==1: selected gets a disadvantage */
+ /* (sel == 1): selected gets a disadvantage */
/* in nurb and bezt or bp the nearest is written */
/* return 0 1 2: handlepunt */
struct { BPoint *bp; BezTriple *bezt; Nurb *nurb; int dist, hpoint, select, mval[2]; } data = {NULL};
@@ -3765,8 +3765,8 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu
if (is_u_selected(nu1, nu1->pntsu - 1) ) ;
else {
- /* For 2D curves blender uses orderv=0. It doesn't make any sense mathematically. */
- /* but after rotating orderu=0 will be confusing. */
+ /* For 2D curves blender uses (orderv = 0). It doesn't make any sense mathematically. */
+ /* but after rotating (orderu = 0) will be confusing. */
if (nu1->orderv == 0) nu1->orderv = 1;
rotate_direction_nurb(nu1);
diff --git a/source/blender/editors/datafiles/Bfont.c b/source/blender/editors/datafiles/Bfont.c
index 969bc5a844d..30126c97d34 100644
--- a/source/blender/editors/datafiles/Bfont.c
+++ b/source/blender/editors/datafiles/Bfont.c
@@ -30,8 +30,8 @@
* \brief DataToC output of file <Bfont>
*/
-int datatoc_Bfont_size= 25181;
-char datatoc_Bfont[25181]= {
+int datatoc_Bfont_size = 25181;
+char datatoc_Bfont[25181] = {
128, 1, 228, 1, 0, 0, 37, 33, 80, 83, 45, 65, 100, 111, 98, 101,
70, 111, 110, 116, 45, 49, 46, 48, 58, 32, 66, 102, 111, 110, 116, 32,
48, 48, 49, 46, 48, 48, 49, 10, 49, 49, 32, 100, 105, 99, 116, 32,
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index f1b31446e4b..89d8ed9c465 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -526,7 +526,7 @@ static void gp_stroke_simplify(tGPsdata *p)
co[0] += (float)(old_points[offs].x * sfac); \
co[1] += (float)(old_points[offs].y * sfac); \
pressure += old_points[offs].pressure * sfac; \
- }
+ } (void)0
for (i = 0, j = 0; i < num_points; i++) {
if (i - j == 3) {
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index cbe44505263..92d92359814 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -164,6 +164,18 @@ static int panels_re_align(ScrArea *sa, ARegion *ar, Panel **r_pa)
/****************************** panels ******************************/
+static void panels_collapse_all(ScrArea *sa, ARegion *ar)
+{
+ Panel *pa;
+ int align = panel_aligned(sa, ar);
+
+ for (pa= ar->panels.first; pa; pa= pa->next) {
+ if (pa->type && !(pa->type->flag & PNL_NO_HEADER))
+ pa->flag = (align==BUT_HORIZONTAL)? PNL_CLOSEDX: PNL_CLOSEDY;
+ }
+}
+
+
static void ui_panel_copy_offset(Panel *pa, Panel *papar)
{
/* with respect to sizes... papar is parent */
@@ -932,7 +944,7 @@ static void check_panel_overlap(ARegion *ar, Panel *panel)
{
Panel *pa;
- /* also called with panel==NULL for clear */
+ /* also called with (panel == NULL) for clear */
for (pa = ar->panels.first; pa; pa = pa->next) {
pa->flag &= ~PNL_OVERLAP;
@@ -1024,7 +1036,7 @@ static void ui_handle_panel_header(const bContext *C, uiBlock *block, int mx, in
else if (block->panel->control & UI_PNL_CLOSE) {
/* whole of header can be used to collapse panel (except top-right corner) */
if (mx <= block->maxx - 8 - PNL_ICON) button = 2;
- //else if (mx <= block->minx+10+2*PNL_ICON+2) button= 1;
+ //else if (mx <= block->minx + 10 + 2 * PNL_ICON + 2) button = 1;
}
else if (mx <= block->maxx - PNL_ICON - 12) {
button = 1;
@@ -1074,6 +1086,7 @@ static void ui_handle_panel_header(const bContext *C, uiBlock *block, int mx, in
int ui_handler_panel_region(bContext *C, wmEvent *event)
{
+ ScrArea *sa = CTX_wm_area(C);
ARegion *ar = CTX_wm_region(C);
uiBlock *block;
Panel *pa;
@@ -1141,6 +1154,8 @@ int ui_handler_panel_region(bContext *C, wmEvent *event)
}
else if (event->type == LEFTMOUSE) {
if (inside_header) {
+ if (event->ctrl)
+ panels_collapse_all(sa, ar);
ui_handle_panel_header(C, block, mx, my, 0);
break;
}
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index b690d1f9dc9..dd6be9141ca 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -1304,16 +1304,16 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but,
}
}
- /*aspect= (float)(block->maxx - block->minx + 4);*/ /*UNUSED*/
+ /* aspect = (float)(block->maxx - block->minx + 4);*/ /*UNUSED*/
ui_block_to_window_fl(butregion, but->block, &block->minx, &block->miny);
ui_block_to_window_fl(butregion, but->block, &block->maxx, &block->maxy);
- //block->minx-= 2.0; block->miny-= 2.0;
- //block->maxx+= 2.0; block->maxy+= 2.0;
+ //block->minx -= 2.0; block->miny -= 2.0;
+ //block->maxx += 2.0; block->maxy += 2.0;
xsize = block->maxx - block->minx + 4; // 4 for shadow
ysize = block->maxy - block->miny + 4;
- /*aspect/= (float)xsize;*/ /*UNUSED*/
+ /* aspect /= (float)xsize;*/ /*UNUSED*/
{
int left = 0, right = 0, top = 0, down = 0;
@@ -2706,7 +2706,7 @@ void uiPupBlockEx(bContext *C, uiBlockCreateFunc func, uiBlockHandleFunc popup_f
handle->popup_arg = arg;
handle->popup_func = popup_func;
handle->cancel_func = cancel_func;
- // handle->opcontext= opcontext;
+ // handle->opcontext = opcontext;
UI_add_popup_handlers(C, &window->modalhandlers, handle);
WM_event_add_mousemove(C);
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 30f8003afbd..78835192574 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -350,7 +350,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
idptr = RNA_property_pointer_get(&template->ptr, template->prop);
id = idptr.data;
idfrom = template->ptr.id.data;
- // lb= template->idlb;
+ // lb = template->idlb;
block = uiLayoutGetBlock(layout);
uiBlockBeginAlign(block);
@@ -2301,7 +2301,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, PointerRNA *activeptr, const char *activepropname, const char *prop_list, int rows, int maxrows, int listtype)
{
- //Scene *scene= CTX_data_scene(C);
+ //Scene *scene = CTX_data_scene(C);
PropertyRNA *prop = NULL, *activeprop;
PropertyType type, activetype;
StructRNA *ptype;
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 87c2f2dc20b..1a7fc98ef74 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -2245,7 +2245,7 @@ void ui_draw_link_bezier(rcti *rect)
if (ui_link_bezier_points(rect, coord_array, LINK_RESOL)) {
/* we can reuse the dist variable here to increment the GL curve eval amount*/
- // const float dist= 1.0f/(float)LINK_RESOL; // UNUSED
+ // const float dist = 1.0f/(float)LINK_RESOL; // UNUSED
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 0d16e0f4dc0..edad33953b9 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1265,7 +1265,7 @@ void init_userdef_do_versions(void)
if (U.undosteps == 0) U.undosteps = 32;
for (btheme = U.themes.first; btheme; btheme = btheme->next) {
- /* check for alpha==0 is safe, then color was never set */
+ /* check for (alpha == 0) is safe, then color was never set */
if (btheme->tv3d.edge_seam[3] == 0) {
rgba_char_args_set(btheme->tv3d.edge_seam, 230, 150, 50, 255);
}
@@ -1290,7 +1290,7 @@ void init_userdef_do_versions(void)
bTheme *btheme;
/* new space type */
for (btheme = U.themes.first; btheme; btheme = btheme->next) {
- /* check for alpha==0 is safe, then color was never set */
+ /* check for (alpha == 0) is safe, then color was never set */
if (btheme->ttime.back[3] == 0) {
// copied from ui_theme_init_default
btheme->ttime = btheme->tv3d;
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 1d315e9a5b8..b2227405d8b 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -272,7 +272,7 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
v2d->keepzoom = (V2D_KEEPASPECT | V2D_LIMITZOOM | V2D_KEEPZOOM);
v2d->minzoom = 0.5f;
v2d->maxzoom = 2.0f;
- //tot_changed= 1;
+ //tot_changed = 1;
v2d->align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_POS_Y);
v2d->keeptot = V2D_KEEPTOT_BOUNDS;
@@ -428,7 +428,7 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
if (winx != v2d->oldwinx) do_x = TRUE;
if (winy != v2d->oldwiny) do_y = TRUE;
- /* curRatio= height / width; */ /* UNUSED */
+ /* curRatio = height / width; */ /* UNUSED */
winRatio = winy / winx;
/* both sizes change (area/region maximised) */
@@ -442,7 +442,7 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
else do_x = TRUE;
}
do_cur = do_x;
- /* do_win= do_y; */ /* UNUSED */
+ /* do_win = do_y; */ /* UNUSED */
if (do_cur) {
if ((v2d->keeptot == V2D_KEEPTOT_STRICT) && (winx != v2d->oldwinx)) {
@@ -806,7 +806,7 @@ void UI_view2d_curRect_reset(View2D *v2d)
v2d->cur.xmax = (float)width;
}
else {
- /* width is centered around x==0 */
+ /* width is centered around (x == 0) */
const float dx = (float)width / 2.0f;
v2d->cur.xmin = -dx;
@@ -825,7 +825,7 @@ void UI_view2d_curRect_reset(View2D *v2d)
v2d->cur.ymax = (float)height;
}
else {
- /* height is centered around y==0 */
+ /* height is centered around (y == 0) */
const float dy = (float)height / 2.0f;
v2d->cur.ymin = -dy;
@@ -869,7 +869,7 @@ void UI_view2d_totRect_set_resize(View2D *v2d, int width, int height, int resize
v2d->tot.xmax = (float)width;
}
else {
- /* width is centered around x==0 */
+ /* width is centered around (x == 0) */
const float dx = (float)width / 2.0f;
v2d->tot.xmin = -dx;
@@ -888,7 +888,7 @@ void UI_view2d_totRect_set_resize(View2D *v2d, int width, int height, int resize
v2d->tot.ymax = (float)height;
}
else {
- /* height is centered around y==0 */
+ /* height is centered around (y == 0) */
const float dy = (float)height / 2.0f;
v2d->tot.ymin = -dy;
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 88fb728f334..ed86cb67687 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -2242,11 +2242,11 @@ static void project_bucket_clip_face(
*
* i = l
* while i < len(me.verts):
- * ii = i+1
- * if ii==len(me.verts):
+ * ii = i + 1
+ * if ii == len(me.verts):
* ii = l
* me.edges.extend([i, ii])
- * i+=1
+ * i += 1
*
* if __name__ == '__main__':
* main()
diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c
index 661f7ad7d0f..b13ba9a1aa3 100644
--- a/source/blender/editors/space_buttons/buttons_header.c
+++ b/source/blender/editors/space_buttons/buttons_header.c
@@ -125,9 +125,9 @@ void buttons_header_buttons(const bContext *C, ARegion *ar)
if (sbuts->pathflag & (1 << _ctx)) { \
but = uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, _icon, xco += BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)_ctx, 0, 0, TIP_(_tip)); \
uiButClearFlag(but, UI_BUT_UNDO); \
- } \
+ } (void)0
- BUTTON_HEADER_CTX(BCONTEXT_RENDER, ICON_SCENE, N_("Render"))
+ BUTTON_HEADER_CTX(BCONTEXT_RENDER, ICON_SCENE, N_("Render"));
BUTTON_HEADER_CTX(BCONTEXT_SCENE, ICON_SCENE_DATA, N_("Scene"));
BUTTON_HEADER_CTX(BCONTEXT_WORLD, ICON_WORLD, N_("World"));
BUTTON_HEADER_CTX(BCONTEXT_OBJECT, ICON_OBJECT_DATA, N_("Object"));
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 5c2b021c055..3c070b4e637 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -88,24 +88,24 @@ extern void ui_dropshadow(rctf *rct, float radius, float aspect, int select);
static void node_sync_cb(bContext *UNUSED(C), void *snode_v, void *node_v)
{
- SpaceNode *snode= snode_v;
+ SpaceNode *snode = snode_v;
- if (snode->treetype==NTREE_SHADER) {
+ if (snode->treetype == NTREE_SHADER) {
nodeShaderSynchronizeID(node_v, 1);
// allqueue(REDRAWBUTSSHADING, 0);
}
}
static void node_socket_button_label(const bContext *UNUSED(C), uiBlock *block,
- bNodeTree *UNUSED(ntree), bNode *UNUSED(node), bNodeSocket *sock,
- const char *UNUSED(name), int x, int y, int width)
+ bNodeTree *UNUSED(ntree), bNode *UNUSED(node), bNodeSocket *sock,
+ const char *UNUSED(name), int x, int y, int width)
{
uiDefBut(block, LABEL, 0, sock->name, x, y, width, NODE_DY, NULL, 0, 0, 0, 0, "");
}
static void node_socket_button_default(const bContext *C, uiBlock *block,
- bNodeTree *ntree, bNode *node, bNodeSocket *sock,
- const char *name, int x, int y, int width)
+ bNodeTree *ntree, bNode *node, bNodeSocket *sock,
+ const char *name, int x, int y, int width)
{
if (sock->link || (sock->flag & SOCK_HIDE_VALUE))
node_socket_button_label(C, block, ntree, node, sock, name, x, y, width);
@@ -116,8 +116,8 @@ static void node_socket_button_default(const bContext *C, uiBlock *block,
RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr);
bt = uiDefButR(block, NUM, B_NODE_EXEC, name,
- x, y+1, width, NODE_DY-2,
- &ptr, "default_value", 0, 0, 0, -1, -1, NULL);
+ x, y + 1, width, NODE_DY - 2,
+ &ptr, "default_value", 0, 0, 0, -1, -1, NULL);
if (node)
uiButSetFunc(bt, node_sync_cb, CTX_wm_space_node(C), node);
}
@@ -132,22 +132,22 @@ typedef struct SocketComponentMenuArgs {
/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */
static uiBlock *socket_component_menu(bContext *C, ARegion *ar, void *args_v)
{
- SocketComponentMenuArgs *args= (SocketComponentMenuArgs*)args_v;
+ SocketComponentMenuArgs *args = (SocketComponentMenuArgs *)args_v;
uiBlock *block;
uiLayout *layout;
- block= uiBeginBlock(C, ar, __func__, UI_EMBOSS);
+ block = uiBeginBlock(C, ar, __func__, UI_EMBOSS);
uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN);
- layout= uiLayoutColumn(uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, args->x, args->y+2, args->width, NODE_DY, UI_GetStyle()), 0);
+ layout = uiLayoutColumn(uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, args->x, args->y + 2, args->width, NODE_DY, UI_GetStyle()), 0);
uiItemR(layout, &args->ptr, "default_value", UI_ITEM_R_EXPAND, "", ICON_NONE);
return block;
}
static void node_socket_button_components(const bContext *C, uiBlock *block,
- bNodeTree *ntree, bNode *node, bNodeSocket *sock,
- const char *name, int x, int y, int width)
+ bNodeTree *ntree, bNode *node, bNodeSocket *sock,
+ const char *name, int x, int y, int width)
{
if (sock->link || (sock->flag & SOCK_HIDE_VALUE))
node_socket_button_label(C, block, ntree, node, sock, name, x, y, width);
@@ -157,7 +157,7 @@ static void node_socket_button_components(const bContext *C, uiBlock *block,
RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr);
- args= MEM_callocN(sizeof(SocketComponentMenuArgs), "SocketComponentMenuArgs");
+ args = MEM_callocN(sizeof(SocketComponentMenuArgs), "SocketComponentMenuArgs");
args->ptr = ptr;
args->x = x;
@@ -167,37 +167,37 @@ static void node_socket_button_components(const bContext *C, uiBlock *block,
args->arg1 = CTX_wm_space_node(C);
args->arg2 = node;
- uiDefBlockButN(block, socket_component_menu, args, name, x, y+1, width, NODE_DY-2, "");
+ uiDefBlockButN(block, socket_component_menu, args, name, x, y + 1, width, NODE_DY - 2, "");
}
}
static void node_socket_button_color(const bContext *C, uiBlock *block,
- bNodeTree *ntree, bNode *node, bNodeSocket *sock,
- const char *name, int x, int y, int width)
+ bNodeTree *ntree, bNode *node, bNodeSocket *sock,
+ const char *name, int x, int y, int width)
{
if (sock->link || (sock->flag & SOCK_HIDE_VALUE))
node_socket_button_label(C, block, ntree, node, sock, name, x, y, width);
else {
PointerRNA ptr;
uiBut *bt;
- int labelw= width - 40;
+ int labelw = width - 40;
RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr);
- bt=uiDefButR(block, COL, B_NODE_EXEC, "",
- x, y+2, (labelw>0 ? 40 : width), NODE_DY-2,
- &ptr, "default_value", 0, 0, 0, -1, -1, NULL);
+ bt = uiDefButR(block, COL, B_NODE_EXEC, "",
+ x, y + 2, (labelw > 0 ? 40 : width), NODE_DY - 2,
+ &ptr, "default_value", 0, 0, 0, -1, -1, NULL);
if (node)
uiButSetFunc(bt, node_sync_cb, CTX_wm_space_node(C), node);
- if (name[0]!='\0' && labelw>0)
- uiDefBut(block, LABEL, 0, name, x + 40, y+2, labelw, NODE_DY-2, NULL, 0, 0, 0, 0, "");
+ if (name[0] != '\0' && labelw > 0)
+ uiDefBut(block, LABEL, 0, name, x + 40, y + 2, labelw, NODE_DY - 2, NULL, 0, 0, 0, 0, "");
}
}
/* standard draw function, display the default input value */
static void node_draw_input_default(const bContext *C, uiBlock *block,
- bNodeTree *ntree, bNode *node, bNodeSocket *sock,
- const char *name, int x, int y, int width)
+ bNodeTree *ntree, bNode *node, bNodeSocket *sock,
+ const char *name, int x, int y, int width)
{
bNodeSocketType *stype = ntreeGetSocketType(sock->type);
if (stype->buttonfunc)
@@ -214,13 +214,13 @@ static void node_draw_output_default(const bContext *C, uiBlock *block,
float slen;
int ofs = 0;
UI_ThemeColor(TH_TEXT);
- slen= snode->aspect*UI_GetStringWidth(name);
+ slen = snode->aspect * UI_GetStringWidth(name);
while (slen > node->width) {
ofs++;
- slen= snode->aspect*UI_GetStringWidth(name+ofs);
+ slen = snode->aspect * UI_GetStringWidth(name + ofs);
}
- uiDefBut(block, LABEL, 0, name+ofs, (short)(sock->locx-15.0f-slen), (short)(sock->locy-9.0f),
- (short)(node->width-NODE_DY), NODE_DY, NULL, 0, 0, 0, 0, "");
+ uiDefBut(block, LABEL, 0, name + ofs, (short)(sock->locx - 15.0f - slen), (short)(sock->locy - 9.0f),
+ (short)(node->width - NODE_DY), NODE_DY, NULL, 0, 0, 0, 0, "");
}
/* ****************** BASE DRAW FUNCTIONS FOR NEW OPERATOR NODES ***************** */
@@ -228,37 +228,37 @@ static void node_draw_output_default(const bContext *C, uiBlock *block,
#if 0 /* UNUSED */
static void node_draw_socket_new(bNodeSocket *sock, float size)
{
- float x=sock->locx, y=sock->locy;
+ float x = sock->locx, y = sock->locy;
/* 16 values of sin function */
static float si[16] = {
- 0.00000000f, 0.39435585f, 0.72479278f,0.93775213f,
- 0.99871650f,0.89780453f,0.65137248f,0.29936312f,
- -0.10116832f,-0.48530196f,-0.79077573f,-0.96807711f,
- -0.98846832f,-0.84864425f,-0.57126821f,-0.20129852f
+ 0.00000000f, 0.39435585f, 0.72479278f, 0.93775213f,
+ 0.99871650f, 0.89780453f, 0.65137248f, 0.29936312f,
+ -0.10116832f, -0.48530196f, -0.79077573f, -0.96807711f,
+ -0.98846832f, -0.84864425f, -0.57126821f, -0.20129852f
};
/* 16 values of cos function */
- static float co[16] ={
- 1.00000000f,0.91895781f,0.68896691f,0.34730525f,
- -0.05064916f,-0.44039415f,-0.75875812f,-0.95413925f,
- -0.99486932f,-0.87434661f,-0.61210598f,-0.25065253f,
- 0.15142777f,0.52896401f,0.82076344f,0.97952994f,
+ static float co[16] = {
+ 1.00000000f, 0.91895781f, 0.68896691f, 0.34730525f,
+ -0.05064916f, -0.44039415f, -0.75875812f, -0.95413925f,
+ -0.99486932f, -0.87434661f, -0.61210598f, -0.25065253f,
+ 0.15142777f, 0.52896401f, 0.82076344f, 0.97952994f,
};
int a;
glColor3ub(180, 180, 180);
glBegin(GL_POLYGON);
- for (a=0; a<16; a++)
- glVertex2f(x+size*si[a], y+size*co[a]);
+ for (a = 0; a < 16; a++)
+ glVertex2f(x + size * si[a], y + size * co[a]);
glEnd();
glColor4ub(0, 0, 0, 150);
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
glBegin(GL_LINE_LOOP);
- for (a=0; a<16; a++)
- glVertex2f(x+size*si[a], y+size*co[a]);
+ for (a = 0; a < 16; a++)
+ glVertex2f(x + size * si[a], y + size * co[a]);
glEnd();
glDisable(GL_LINE_SMOOTH);
glDisable(GL_BLEND);
@@ -298,9 +298,9 @@ static void node_buts_mix_rgb(uiLayout *layout, bContext *UNUSED(C), PointerRNA
{
uiLayout *row;
- bNodeTree *ntree= (bNodeTree*)ptr->id.data;
+ bNodeTree *ntree = (bNodeTree *)ptr->id.data;
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
uiItemR(row, ptr, "blend_type", 0, "", ICON_NONE);
if (ntree->type == NTREE_COMPOSIT)
uiItemR(row, ptr, "use_alpha", 0, "", ICON_IMAGE_RGB_ALPHA);
@@ -311,19 +311,19 @@ static void node_buts_time(uiLayout *layout, bContext *UNUSED(C), PointerRNA *pt
uiLayout *row;
#if 0
/* XXX no context access here .. */
- bNode *node= ptr->data;
- CurveMapping *cumap= node->storage;
+ bNode *node = ptr->data;
+ CurveMapping *cumap = node->storage;
if (cumap) {
cumap->flag |= CUMA_DRAW_CFRA;
- if (node->custom1<node->custom2)
- cumap->sample[0]= (float)(CFRA - node->custom1)/(float)(node->custom2-node->custom1);
+ if (node->custom1 < node->custom2)
+ cumap->sample[0] = (float)(CFRA - node->custom1) / (float)(node->custom2 - node->custom1);
}
#endif
uiTemplateCurveMapping(layout, ptr, "curve", 's', 0, 0);
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
uiItemR(row, ptr, "frame_start", 0, "Sta", ICON_NONE);
uiItemR(row, ptr, "frame_end", 0, "End", ICON_NONE);
}
@@ -338,18 +338,18 @@ static void node_buts_curvevec(uiLayout *layout, bContext *UNUSED(C), PointerRNA
uiTemplateCurveMapping(layout, ptr, "mapping", 'v', 0, 0);
}
-static float *_sample_col= NULL; // bad bad, 2.5 will do better?
+static float *_sample_col = NULL; // bad bad, 2.5 will do better?
#if 0
static void node_curvemap_sample(float *col)
{
- _sample_col= col;
+ _sample_col = col;
}
#endif
static void node_buts_curvecol(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
- bNode *node= ptr->data;
- CurveMapping *cumap= node->storage;
+ bNode *node = ptr->data;
+ CurveMapping *cumap = node->storage;
if (_sample_col) {
cumap->flag |= CUMA_DRAW_SAMPLE;
@@ -366,79 +366,79 @@ static void node_normal_cb(bContext *C, void *ntree_v, void *node_v)
Main *bmain = CTX_data_main(C);
ED_node_generic_update(bmain, ntree_v, node_v);
- WM_event_add_notifier(C, NC_NODE|NA_EDITED, ntree_v);
+ WM_event_add_notifier(C, NC_NODE | NA_EDITED, ntree_v);
}
static void node_buts_normal(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
- uiBlock *block= uiLayoutAbsoluteBlock(layout);
- bNodeTree *ntree= ptr->id.data;
- bNode *node= ptr->data;
- rctf *butr= &node->butr;
- bNodeSocket *sock= node->outputs.first; /* first socket stores normal */
- float *nor= ((bNodeSocketValueVector*)sock->default_value)->value;
+ uiBlock *block = uiLayoutAbsoluteBlock(layout);
+ bNodeTree *ntree = ptr->id.data;
+ bNode *node = ptr->data;
+ rctf *butr = &node->butr;
+ bNodeSocket *sock = node->outputs.first; /* first socket stores normal */
+ float *nor = ((bNodeSocketValueVector *)sock->default_value)->value;
uiBut *bt;
- bt= uiDefButF(block, BUT_NORMAL, B_NODE_EXEC, "",
- (short)butr->xmin, (short)butr->xmin,
- butr->xmax-butr->xmin, butr->xmax-butr->xmin,
- nor, 0.0f, 1.0f, 0, 0, "");
+ bt = uiDefButF(block, BUT_NORMAL, B_NODE_EXEC, "",
+ (short)butr->xmin, (short)butr->xmin,
+ butr->xmax - butr->xmin, butr->xmax - butr->xmin,
+ nor, 0.0f, 1.0f, 0, 0, "");
uiButSetFunc(bt, node_normal_cb, ntree, node);
}
#if 0 // not used in 2.5x yet
static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v)
{
- Main *bmain= CTX_data_main(C);
- bNodeTree *ntree= ntree_v;
- bNode *node= node_v;
+ Main *bmain = CTX_data_main(C);
+ bNodeTree *ntree = ntree_v;
+ bNode *node = node_v;
Tex *tex;
- if (node->menunr<1) return;
+ if (node->menunr < 1) return;
if (node->id) {
node->id->us--;
- node->id= NULL;
+ node->id = NULL;
}
- tex= BLI_findlink(&bmain->tex, node->menunr-1);
+ tex = BLI_findlink(&bmain->tex, node->menunr - 1);
- node->id= &tex->id;
+ node->id = &tex->id;
id_us_plus(node->id);
- BLI_strncpy(node->name, node->id->name+2, sizeof(node->name));
+ BLI_strncpy(node->name, node->id->name + 2, sizeof(node->name));
nodeSetActive(ntree, node);
- if ( ntree->type == NTREE_TEXTURE )
+ if (ntree->type == NTREE_TEXTURE)
ntreeTexCheckCyclics(ntree);
// allqueue(REDRAWBUTSSHADING, 0);
// allqueue(REDRAWNODE, 0);
NodeTagChanged(ntree, node);
- node->menunr= 0;
+ node->menunr = 0;
}
#endif
static void node_dynamic_update_cb(bContext *C, void *UNUSED(ntree_v), void *node_v)
{
- Main *bmain= CTX_data_main(C);
+ Main *bmain = CTX_data_main(C);
Material *ma;
- bNode *node= (bNode *)node_v;
- ID *id= node->id;
- int error= 0;
+ bNode *node = (bNode *)node_v;
+ ID *id = node->id;
+ int error = 0;
- if (BTST(node->custom1, NODE_DYNAMIC_ERROR)) error= 1;
+ if (BTST(node->custom1, NODE_DYNAMIC_ERROR)) error = 1;
/* Users only have to press the "update" button in one pynode
* and we also update all others sharing the same script */
- for (ma= bmain->mat.first; ma; ma= ma->id.next) {
+ for (ma = bmain->mat.first; ma; ma = ma->id.next) {
if (ma->nodetree) {
bNode *nd;
- for (nd= ma->nodetree->nodes.first; nd; nd= nd->next) {
+ for (nd = ma->nodetree->nodes.first; nd; nd = nd->next) {
if ((nd->type == NODE_DYNAMIC) && (nd->id == id)) {
- nd->custom1= 0;
- nd->custom1= BSET(nd->custom1, NODE_DYNAMIC_REPARSE);
- nd->menunr= 0;
+ nd->custom1 = 0;
+ nd->custom1 = BSET(nd->custom1, NODE_DYNAMIC_REPARSE);
+ nd->menunr = 0;
if (error)
- nd->custom1= BSET(nd->custom1, NODE_DYNAMIC_ERROR);
+ nd->custom1 = BSET(nd->custom1, NODE_DYNAMIC_ERROR);
}
}
}
@@ -451,14 +451,14 @@ static void node_dynamic_update_cb(bContext *C, void *UNUSED(ntree_v), void *nod
static void node_buts_texture(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
- bNode *node= ptr->data;
+ bNode *node = ptr->data;
short multi = (
- node->id &&
- ((Tex*)node->id)->use_nodes &&
- (node->type != CMP_NODE_TEXTURE) &&
- (node->type != TEX_NODE_TEXTURE)
- );
+ node->id &&
+ ((Tex *)node->id)->use_nodes &&
+ (node->type != CMP_NODE_TEXTURE) &&
+ (node->type != TEX_NODE_TEXTURE)
+ );
uiItemR(layout, ptr, "texture", 0, "", ICON_NONE);
@@ -476,9 +476,9 @@ static void node_buts_math(uiLayout *layout, bContext *UNUSED(C), PointerRNA *pt
static int node_resize_area_default(bNode *node, int x, int y)
{
if (node->flag & NODE_HIDDEN) {
- rctf totr= node->totr;
+ rctf totr = node->totr;
/* right part of node */
- totr.xmin = node->totr.xmax-20.0f;
+ totr.xmin = node->totr.xmax - 20.0f;
if (BLI_in_rctf(&totr, x, y))
return NODE_RESIZE_RIGHT;
else
@@ -486,12 +486,12 @@ static int node_resize_area_default(bNode *node, int x, int y)
}
else {
const float size = 10.0f;
- rctf totr= node->totr;
+ rctf totr = node->totr;
int dir = 0;
- if (x >= totr.xmax-size && x < totr.xmax && y >= totr.ymin && y < totr.ymax)
+ if (x >= totr.xmax - size && x < totr.xmax && y >= totr.ymin && y < totr.ymax)
dir |= NODE_RESIZE_RIGHT;
- if (x >= totr.xmin && x < totr.xmin+size && y >= totr.ymin && y < totr.ymax)
+ if (x >= totr.xmin && x < totr.xmin + size && y >= totr.ymin && y < totr.ymax)
dir |= NODE_RESIZE_LEFT;
return dir;
}
@@ -500,7 +500,7 @@ static int node_resize_area_default(bNode *node, int x, int y)
/* ****************** BUTTON CALLBACKS FOR COMMON NODES ***************** */
/* width of socket columns in group display */
-#define NODE_GROUP_FRAME 120
+#define NODE_GROUP_FRAME 120
/* based on settings in node, sets drawing rect info. each redraw! */
/* note: this assumes only 1 group at a time is drawn (linked data) */
@@ -511,13 +511,13 @@ static void node_update_group(const bContext *C, bNodeTree *ntree, bNode *gnode)
node_update_default(C, ntree, gnode);
}
else {
- bNodeTree *ngroup= (bNodeTree *)gnode->id;
+ bNodeTree *ngroup = (bNodeTree *)gnode->id;
bNode *node;
bNodeSocket *sock, *gsock;
float locx, locy;
- rctf *rect= &gnode->totr;
- float node_group_frame= U.dpi*NODE_GROUP_FRAME/72;
- float group_header= 26*U.dpi/72;
+ rctf *rect = &gnode->totr;
+ float node_group_frame = U.dpi * NODE_GROUP_FRAME / 72;
+ float group_header = 26 * U.dpi / 72;
int counter;
int dy;
@@ -530,64 +530,64 @@ static void node_update_group(const bContext *C, bNodeTree *ntree, bNode *gnode)
rect->xmin = rect->xmax = locx;
rect->ymin = rect->ymax = locy;
- counter= 1;
- for (node= ngroup->nodes.first; node; node= node->next) {
+ counter = 1;
+ for (node = ngroup->nodes.first; node; node = node->next) {
if (counter) {
- *rect= node->totr;
- counter= 0;
+ *rect = node->totr;
+ counter = 0;
}
else
BLI_union_rctf(rect, &node->totr);
}
/* add some room for links to group sockets */
- rect->xmin -= 4*NODE_DY;
- rect->xmax += 4*NODE_DY;
- rect->ymin-= NODE_DY;
- rect->ymax+= NODE_DY;
+ rect->xmin -= 4 * NODE_DY;
+ rect->xmax += 4 * NODE_DY;
+ rect->ymin -= NODE_DY;
+ rect->ymax += NODE_DY;
/* input sockets */
- dy = 0.5f*(rect->ymin+rect->ymax) + NODE_DY*(BLI_countlist(&gnode->inputs)-1);
- gsock=ngroup->inputs.first;
- sock=gnode->inputs.first;
+ dy = 0.5f * (rect->ymin + rect->ymax) + NODE_DY * (BLI_countlist(&gnode->inputs) - 1);
+ gsock = ngroup->inputs.first;
+ sock = gnode->inputs.first;
while (gsock || sock) {
while (sock && !sock->groupsock) {
sock->locx = rect->xmin - node_group_frame;
sock->locy = dy;
/* prevent long socket lists from growing out of the group box */
- if (dy-3*NODE_DYS < rect->ymin)
- rect->ymin = dy-3*NODE_DYS;
- if (dy+3*NODE_DYS > rect->ymax)
- rect->ymax = dy+3*NODE_DYS;
- dy -= 2*NODE_DY;
+ if (dy - 3 * NODE_DYS < rect->ymin)
+ rect->ymin = dy - 3 * NODE_DYS;
+ if (dy + 3 * NODE_DYS > rect->ymax)
+ rect->ymax = dy + 3 * NODE_DYS;
+ dy -= 2 * NODE_DY;
sock = sock->next;
}
- while (gsock && (!sock || sock->groupsock!=gsock)) {
+ while (gsock && (!sock || sock->groupsock != gsock)) {
gsock->locx = rect->xmin;
gsock->locy = dy;
/* prevent long socket lists from growing out of the group box */
- if (dy-3*NODE_DYS < rect->ymin)
- rect->ymin = dy-3*NODE_DYS;
- if (dy+3*NODE_DYS > rect->ymax)
- rect->ymax = dy+3*NODE_DYS;
- dy -= 2*NODE_DY;
+ if (dy - 3 * NODE_DYS < rect->ymin)
+ rect->ymin = dy - 3 * NODE_DYS;
+ if (dy + 3 * NODE_DYS > rect->ymax)
+ rect->ymax = dy + 3 * NODE_DYS;
+ dy -= 2 * NODE_DY;
gsock = gsock->next;
}
- while (sock && gsock && sock->groupsock==gsock) {
+ while (sock && gsock && sock->groupsock == gsock) {
gsock->locx = rect->xmin;
sock->locx = rect->xmin - node_group_frame;
sock->locy = gsock->locy = dy;
/* prevent long socket lists from growing out of the group box */
- if (dy-3*NODE_DYS < rect->ymin)
- rect->ymin = dy-3*NODE_DYS;
- if (dy+3*NODE_DYS > rect->ymax)
- rect->ymax = dy+3*NODE_DYS;
- dy -= 2*NODE_DY;
+ if (dy - 3 * NODE_DYS < rect->ymin)
+ rect->ymin = dy - 3 * NODE_DYS;
+ if (dy + 3 * NODE_DYS > rect->ymax)
+ rect->ymax = dy + 3 * NODE_DYS;
+ dy -= 2 * NODE_DY;
sock = sock->next;
gsock = gsock->next;
@@ -595,47 +595,47 @@ static void node_update_group(const bContext *C, bNodeTree *ntree, bNode *gnode)
}
/* output sockets */
- dy = 0.5f*(rect->ymin+rect->ymax) + NODE_DY*(BLI_countlist(&gnode->outputs)-1);
- gsock=ngroup->outputs.first;
- sock=gnode->outputs.first;
+ dy = 0.5f * (rect->ymin + rect->ymax) + NODE_DY * (BLI_countlist(&gnode->outputs) - 1);
+ gsock = ngroup->outputs.first;
+ sock = gnode->outputs.first;
while (gsock || sock) {
while (sock && !sock->groupsock) {
sock->locx = rect->xmax + node_group_frame;
sock->locy = dy - NODE_DYS;
/* prevent long socket lists from growing out of the group box */
- if (dy-3*NODE_DYS < rect->ymin)
- rect->ymin = dy-3*NODE_DYS;
- if (dy+3*NODE_DYS > rect->ymax)
- rect->ymax = dy+3*NODE_DYS;
- dy -= 2*NODE_DY;
+ if (dy - 3 * NODE_DYS < rect->ymin)
+ rect->ymin = dy - 3 * NODE_DYS;
+ if (dy + 3 * NODE_DYS > rect->ymax)
+ rect->ymax = dy + 3 * NODE_DYS;
+ dy -= 2 * NODE_DY;
sock = sock->next;
}
- while (gsock && (!sock || sock->groupsock!=gsock)) {
+ while (gsock && (!sock || sock->groupsock != gsock)) {
gsock->locx = rect->xmax;
gsock->locy = dy - NODE_DYS;
/* prevent long socket lists from growing out of the group box */
- if (dy-3*NODE_DYS < rect->ymin)
- rect->ymin = dy-3*NODE_DYS;
- if (dy+3*NODE_DYS > rect->ymax)
- rect->ymax = dy+3*NODE_DYS;
- dy -= 2*NODE_DY;
+ if (dy - 3 * NODE_DYS < rect->ymin)
+ rect->ymin = dy - 3 * NODE_DYS;
+ if (dy + 3 * NODE_DYS > rect->ymax)
+ rect->ymax = dy + 3 * NODE_DYS;
+ dy -= 2 * NODE_DY;
gsock = gsock->next;
}
- while (sock && gsock && sock->groupsock==gsock) {
+ while (sock && gsock && sock->groupsock == gsock) {
gsock->locx = rect->xmax;
sock->locx = rect->xmax + node_group_frame;
sock->locy = gsock->locy = dy - NODE_DYS;
/* prevent long socket lists from growing out of the group box */
- if (dy-3*NODE_DYS < rect->ymin)
- rect->ymin = dy-3*NODE_DYS;
- if (dy+3*NODE_DYS > rect->ymax)
- rect->ymax = dy+3*NODE_DYS;
- dy -= 2*NODE_DY;
+ if (dy - 3 * NODE_DYS < rect->ymin)
+ rect->ymin = dy - 3 * NODE_DYS;
+ if (dy + 3 * NODE_DYS > rect->ymax)
+ rect->ymax = dy + 3 * NODE_DYS;
+ dy -= 2 * NODE_DY;
sock = sock->next;
gsock = gsock->next;
@@ -646,16 +646,16 @@ static void node_update_group(const bContext *C, bNodeTree *ntree, bNode *gnode)
* Add margin for header and input/output columns.
*/
uiExplicitBoundsBlock(gnode->block,
- rect->xmin - node_group_frame,
- rect->ymin,
- rect->xmax + node_group_frame,
- rect->ymax + group_header);
+ rect->xmin - node_group_frame,
+ rect->ymin,
+ rect->xmax + node_group_frame,
+ rect->ymax + group_header);
}
}
static void update_group_input_cb(bContext *UNUSED(C), void *UNUSED(snode_v), void *ngroup_v)
{
- bNodeTree *ngroup= (bNodeTree*)ngroup_v;
+ bNodeTree *ngroup = (bNodeTree *)ngroup_v;
ngroup->update |= NTREE_UPDATE_GROUP_IN;
ntreeUpdateTree(ngroup);
@@ -663,7 +663,7 @@ static void update_group_input_cb(bContext *UNUSED(C), void *UNUSED(snode_v), vo
static void update_group_output_cb(bContext *UNUSED(C), void *UNUSED(snode_v), void *ngroup_v)
{
- bNodeTree *ngroup= (bNodeTree*)ngroup_v;
+ bNodeTree *ngroup = (bNodeTree *)ngroup_v;
ngroup->update |= NTREE_UPDATE_GROUP_OUT;
ntreeUpdateTree(ngroup);
@@ -671,44 +671,44 @@ static void update_group_output_cb(bContext *UNUSED(C), void *UNUSED(snode_v), v
static void draw_group_socket_name(SpaceNode *snode, bNode *gnode, bNodeSocket *sock, int in_out, float xoffset, float yoffset)
{
- bNodeTree *ngroup= (bNodeTree*)gnode->id;
+ bNodeTree *ngroup = (bNodeTree *)gnode->id;
uiBut *bt;
if (sock->flag & SOCK_DYNAMIC) {
bt = uiDefBut(gnode->block, TEX, 0, "",
- sock->locx+xoffset, sock->locy+1+yoffset, 72, NODE_DY,
- sock->name, 0, sizeof(sock->name), 0, 0, "");
- if (in_out==SOCK_IN)
+ sock->locx + xoffset, sock->locy + 1 + yoffset, 72, NODE_DY,
+ sock->name, 0, sizeof(sock->name), 0, 0, "");
+ if (in_out == SOCK_IN)
uiButSetFunc(bt, update_group_input_cb, snode, ngroup);
else
uiButSetFunc(bt, update_group_output_cb, snode, ngroup);
}
else {
uiDefBut(gnode->block, LABEL, 0, sock->name,
- sock->locx+xoffset, sock->locy+1+yoffset, 72, NODE_DY,
+ sock->locx + xoffset, sock->locy + 1 + yoffset, 72, NODE_DY,
NULL, 0, sizeof(sock->name), 0, 0, "");
}
}
static void draw_group_socket(const bContext *C, SpaceNode *snode, bNodeTree *ntree, bNode *gnode, bNodeSocket *sock, bNodeSocket *gsock, int index, int in_out)
{
- bNodeTree *ngroup= (bNodeTree*)gnode->id;
- bNodeSocketType *stype= ntreeGetSocketType(gsock ? gsock->type : sock->type);
+ bNodeTree *ngroup = (bNodeTree *)gnode->id;
+ bNodeSocketType *stype = ntreeGetSocketType(gsock ? gsock->type : sock->type);
uiBut *bt;
float offset;
int draw_value;
- float node_group_frame= U.dpi*NODE_GROUP_FRAME/72;
- float socket_size= NODE_SOCKSIZE*U.dpi/72;
- float arrowbutw= 0.8f*UI_UNIT_X;
+ float node_group_frame = U.dpi * NODE_GROUP_FRAME / 72;
+ float socket_size = NODE_SOCKSIZE * U.dpi / 72;
+ float arrowbutw = 0.8f * UI_UNIT_X;
/* layout stuff for buttons on group left frame */
- float colw= 0.6f*node_group_frame;
- float col1= 6 - node_group_frame;
- float col2= col1 + colw+6;
- float col3= - arrowbutw - 6;
+ float colw = 0.6f * node_group_frame;
+ float col1 = 6 - node_group_frame;
+ float col2 = col1 + colw + 6;
+ float col3 = -arrowbutw - 6;
/* layout stuff for buttons on group right frame */
- float cor1= 6;
- float cor2= cor1 + arrowbutw + 6;
- float cor3= cor2 + arrowbutw + 6;
+ float cor1 = 6;
+ float cor2 = cor1 + arrowbutw + 6;
+ float cor3 = cor2 + arrowbutw + 6;
/* node and group socket circles */
if (sock)
@@ -717,9 +717,9 @@ static void draw_group_socket(const bContext *C, SpaceNode *snode, bNodeTree *nt
node_socket_circle_draw(ngroup, gsock, socket_size);
/* socket name */
- offset = (in_out==SOCK_IN ? col1 : cor3);
+ offset = (in_out == SOCK_IN ? col1 : cor3);
if (!gsock)
- offset += (in_out==SOCK_IN ? node_group_frame : -node_group_frame);
+ offset += (in_out == SOCK_IN ? node_group_frame : -node_group_frame);
/* draw both name and value button if:
* 1) input: not internal
@@ -727,25 +727,25 @@ static void draw_group_socket(const bContext *C, SpaceNode *snode, bNodeTree *nt
*/
draw_value = 0;
switch (in_out) {
- case SOCK_IN:
- draw_value = !(gsock && (gsock->flag & SOCK_INTERNAL));
- break;
- case SOCK_OUT:
- if (gnode->typeinfo->flag & NODE_CONST_OUTPUT)
- draw_value = !(gsock && gsock->link);
- break;
+ case SOCK_IN:
+ draw_value = !(gsock && (gsock->flag & SOCK_INTERNAL));
+ break;
+ case SOCK_OUT:
+ if (gnode->typeinfo->flag & NODE_CONST_OUTPUT)
+ draw_value = !(gsock && gsock->link);
+ break;
}
if (draw_value) {
/* both name and value buttons */
if (gsock) {
draw_group_socket_name(snode, gnode, gsock, in_out, offset, 0);
if (stype->buttonfunc)
- stype->buttonfunc(C, gnode->block, ngroup, NULL, gsock, "", gsock->locx+offset, gsock->locy-NODE_DY, colw);
+ stype->buttonfunc(C, gnode->block, ngroup, NULL, gsock, "", gsock->locx + offset, gsock->locy - NODE_DY, colw);
}
else {
draw_group_socket_name(snode, gnode, sock, in_out, offset, 0);
if (stype->buttonfunc)
- stype->buttonfunc(C, gnode->block, ngroup, NULL, sock, "", sock->locx+offset, sock->locy-NODE_DY, colw);
+ stype->buttonfunc(C, gnode->block, ngroup, NULL, sock, "", sock->locx + offset, sock->locy - NODE_DY, colw);
}
}
else {
@@ -758,17 +758,17 @@ static void draw_group_socket(const bContext *C, SpaceNode *snode, bNodeTree *nt
if (gsock && (gsock->flag & SOCK_DYNAMIC)) {
/* up/down buttons */
- offset = (in_out==SOCK_IN ? col2 : cor2);
+ offset = (in_out == SOCK_IN ? col2 : cor2);
uiBlockSetDirection(gnode->block, UI_TOP);
uiBlockBeginAlign(gnode->block);
bt = uiDefIconButO(gnode->block, BUT, "NODE_OT_group_socket_move_up", 0, ICON_TRIA_UP,
- gsock->locx+offset, gsock->locy, arrowbutw, arrowbutw, "");
+ gsock->locx + offset, gsock->locy, arrowbutw, arrowbutw, "");
if (!gsock->prev || !(gsock->prev->flag & SOCK_DYNAMIC))
uiButSetFlag(bt, UI_BUT_DISABLED);
RNA_int_set(uiButGetOperatorPtrRNA(bt), "index", index);
RNA_enum_set(uiButGetOperatorPtrRNA(bt), "in_out", in_out);
bt = uiDefIconButO(gnode->block, BUT, "NODE_OT_group_socket_move_down", 0, ICON_TRIA_DOWN,
- gsock->locx+offset, gsock->locy-arrowbutw, arrowbutw, arrowbutw, "");
+ gsock->locx + offset, gsock->locy - arrowbutw, arrowbutw, arrowbutw, "");
if (!gsock->next || !(gsock->next->flag & SOCK_DYNAMIC))
uiButSetFlag(bt, UI_BUT_DISABLED);
RNA_int_set(uiButGetOperatorPtrRNA(bt), "index", index);
@@ -777,10 +777,10 @@ static void draw_group_socket(const bContext *C, SpaceNode *snode, bNodeTree *nt
uiBlockSetDirection(gnode->block, 0);
/* remove button */
- offset = (in_out==SOCK_IN ? col3 : cor1);
+ offset = (in_out == SOCK_IN ? col3 : cor1);
uiBlockSetEmboss(gnode->block, UI_EMBOSSN);
bt = uiDefIconButO(gnode->block, BUT, "NODE_OT_group_socket_remove", 0, ICON_X,
- gsock->locx+offset, gsock->locy-0.5f*arrowbutw, arrowbutw, arrowbutw, "");
+ gsock->locx + offset, gsock->locy - 0.5f * arrowbutw, arrowbutw, arrowbutw, "");
RNA_int_set(uiButGetOperatorPtrRNA(bt), "index", index);
RNA_enum_set(uiButGetOperatorPtrRNA(bt), "in_out", in_out);
uiBlockSetEmboss(gnode->block, UI_EMBOSS);
@@ -794,13 +794,13 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
node_draw_default(C, ar, snode, ntree, gnode);
}
else {
- bNodeTree *ngroup= (bNodeTree *)gnode->id;
+ bNodeTree *ngroup = (bNodeTree *)gnode->id;
bNodeSocket *sock, *gsock;
uiLayout *layout;
PointerRNA ptr;
- rctf rect= gnode->totr;
- float node_group_frame= U.dpi*NODE_GROUP_FRAME/72;
- float group_header= 26*U.dpi/72;
+ rctf rect = gnode->totr;
+ float node_group_frame = U.dpi * NODE_GROUP_FRAME / 72;
+ float group_header = 26 * U.dpi / 72;
int index;
@@ -808,7 +808,7 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
glEnable(GL_BLEND);
uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
UI_ThemeColorShadeAlpha(TH_NODE_GROUP, 0, -70);
- uiDrawBox(GL_POLYGON, rect.xmin-node_group_frame, rect.ymax, rect.xmax+node_group_frame, rect.ymax+group_header, BASIS_RAD);
+ uiDrawBox(GL_POLYGON, rect.xmin - node_group_frame, rect.ymax, rect.xmax + node_group_frame, rect.ymax + group_header, BASIS_RAD);
/* backdrop body */
UI_ThemeColorShadeAlpha(TH_BACK, -8, -70);
@@ -818,12 +818,12 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
/* input column */
UI_ThemeColorShadeAlpha(TH_BACK, 10, -50);
uiSetRoundBox(UI_CNR_BOTTOM_LEFT);
- uiDrawBox(GL_POLYGON, rect.xmin-node_group_frame, rect.ymin, rect.xmin, rect.ymax, BASIS_RAD);
+ uiDrawBox(GL_POLYGON, rect.xmin - node_group_frame, rect.ymin, rect.xmin, rect.ymax, BASIS_RAD);
/* output column */
UI_ThemeColorShadeAlpha(TH_BACK, 10, -50);
uiSetRoundBox(UI_CNR_BOTTOM_RIGHT);
- uiDrawBox(GL_POLYGON, rect.xmax, rect.ymin, rect.xmax+node_group_frame, rect.ymax, BASIS_RAD);
+ uiDrawBox(GL_POLYGON, rect.xmax, rect.ymin, rect.xmax + node_group_frame, rect.ymax, BASIS_RAD);
/* input column separator */
glColor4ub(200, 200, 200, 140);
@@ -843,57 +843,57 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
uiSetRoundBox(UI_CNR_ALL);
glColor4ub(200, 200, 200, 140);
glEnable(GL_LINE_SMOOTH);
- uiDrawBox(GL_LINE_LOOP, rect.xmin-node_group_frame, rect.ymin, rect.xmax+node_group_frame, rect.ymax+group_header, BASIS_RAD);
+ uiDrawBox(GL_LINE_LOOP, rect.xmin - node_group_frame, rect.ymin, rect.xmax + node_group_frame, rect.ymax + group_header, BASIS_RAD);
glDisable(GL_LINE_SMOOTH);
glDisable(GL_BLEND);
/* backdrop title */
UI_ThemeColor(TH_TEXT_HI);
- layout = uiBlockLayout(gnode->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, (short)(rect.xmin+15), (short)(rect.ymax+group_header),
- MIN2((int)(rect.xmax - rect.xmin-18.0f), node_group_frame+20), group_header, UI_GetStyle());
+ layout = uiBlockLayout(gnode->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, (short)(rect.xmin + 15), (short)(rect.ymax + group_header),
+ MIN2((int)(rect.xmax - rect.xmin - 18.0f), node_group_frame + 20), group_header, UI_GetStyle());
RNA_pointer_create(&ntree->id, &RNA_Node, gnode, &ptr);
- uiTemplateIDBrowse(layout, (bContext*)C, &ptr, "node_tree", NULL, NULL, NULL);
+ uiTemplateIDBrowse(layout, (bContext *)C, &ptr, "node_tree", NULL, NULL, NULL);
uiBlockLayoutResolve(gnode->block, NULL, NULL);
/* draw the internal tree nodes and links */
node_draw_nodetree(C, ar, snode, ngroup);
/* group sockets */
- gsock=ngroup->inputs.first;
- sock=gnode->inputs.first;
+ gsock = ngroup->inputs.first;
+ sock = gnode->inputs.first;
index = 0;
while (gsock || sock) {
while (sock && !sock->groupsock) {
draw_group_socket(C, snode, ntree, gnode, sock, NULL, index, SOCK_IN);
sock = sock->next;
}
- while (gsock && (!sock || sock->groupsock!=gsock)) {
+ while (gsock && (!sock || sock->groupsock != gsock)) {
draw_group_socket(C, snode, ntree, gnode, NULL, gsock, index, SOCK_IN);
gsock = gsock->next;
++index;
}
- while (sock && gsock && sock->groupsock==gsock) {
+ while (sock && gsock && sock->groupsock == gsock) {
draw_group_socket(C, snode, ntree, gnode, sock, gsock, index, SOCK_IN);
sock = sock->next;
gsock = gsock->next;
++index;
}
}
- gsock=ngroup->outputs.first;
- sock=gnode->outputs.first;
+ gsock = ngroup->outputs.first;
+ sock = gnode->outputs.first;
index = 0;
while (gsock || sock) {
while (sock && !sock->groupsock) {
draw_group_socket(C, snode, ntree, gnode, sock, NULL, index, SOCK_OUT);
sock = sock->next;
}
- while (gsock && (!sock || sock->groupsock!=gsock)) {
+ while (gsock && (!sock || sock->groupsock != gsock)) {
draw_group_socket(C, snode, ntree, gnode, NULL, gsock, index, SOCK_OUT);
gsock = gsock->next;
++index;
}
- while (sock && gsock && sock->groupsock==gsock) {
+ while (sock && gsock && sock->groupsock == gsock) {
draw_group_socket(C, snode, ntree, gnode, sock, gsock, index, SOCK_OUT);
sock = sock->next;
gsock = gsock->next;
@@ -903,7 +903,7 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
uiEndBlock(C, gnode->block);
uiDrawBlock(C, gnode->block);
- gnode->block= NULL;
+ gnode->block = NULL;
}
}
@@ -932,15 +932,15 @@ static void node_update_frame(const bContext *UNUSED(C), bNodeTree *ntree, bNode
/* init rect from current frame size */
nodeToView(node, node->offsetx, node->offsety, &rect.xmin, &rect.ymax);
- nodeToView(node, node->offsetx+node->width, node->offsety-node->height, &rect.xmax, &rect.ymin);
+ nodeToView(node, node->offsetx + node->width, node->offsety - node->height, &rect.xmax, &rect.ymin);
/* frame can be resized manually only if shrinking is disabled or no children are attached */
data->flag |= NODE_FRAME_RESIZEABLE;
/* for shrinking bbox, initialize the rect from first child node */
bbinit = (data->flag & NODE_FRAME_SHRINK);
/* fit bounding box to all children */
- for (tnode=ntree->nodes.first; tnode; tnode=tnode->next) {
- if (tnode->parent!=node)
+ for (tnode = ntree->nodes.first; tnode; tnode = tnode->next) {
+ if (tnode->parent != node)
continue;
/* add margin to node rect */
@@ -974,8 +974,8 @@ static void node_draw_frame_label(bNode *node)
/* XXX font id is crap design */
const int fontid = blf_mono_font;
NodeFrame *data = (NodeFrame *)node->storage;
- rctf *rct= &node->totr;
- int color_id= node_get_colorid(node);
+ rctf *rct = &node->totr;
+ int color_id = node_get_colorid(node);
char label[128];
/* XXX a bit hacky, should use separate align values for x and y */
float width, ascender;
@@ -990,7 +990,7 @@ static void node_draw_frame_label(bNode *node)
width = BLF_width(fontid, label);
ascender = BLF_ascender(fontid);
- x = 0.5f*(rct->xmin + rct->xmax) - 0.5f*width;
+ x = 0.5f * (rct->xmin + rct->xmax) - 0.5f * width;
y = rct->ymax - NODE_DYS - ascender;
BLF_position(fontid, x, y, 0);
@@ -999,15 +999,15 @@ static void node_draw_frame_label(bNode *node)
static void node_draw_frame(const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *UNUSED(ntree), bNode *node)
{
- rctf *rct= &node->totr;
- int color_id= node_get_colorid(node);
+ rctf *rct = &node->totr;
+ int color_id = node_get_colorid(node);
/* skip if out of view */
if (node->totr.xmax < ar->v2d.cur.xmin || node->totr.xmin > ar->v2d.cur.xmax ||
- node->totr.ymax < ar->v2d.cur.ymin || node->totr.ymin > ar->v2d.cur.ymax) {
+ node->totr.ymax < ar->v2d.cur.ymin || node->totr.ymin > ar->v2d.cur.ymax) {
uiEndBlock(C, node->block);
- node->block= NULL;
+ node->block = NULL;
return;
}
@@ -1025,9 +1025,9 @@ static void node_draw_frame(const bContext *C, ARegion *ar, SpaceNode *snode, bN
glDisable(GL_BLEND);
/* outline active and selected emphasis */
- if ( node->flag & (NODE_ACTIVE|SELECT) ) {
+ if (node->flag & (NODE_ACTIVE | SELECT) ) {
glEnable(GL_BLEND);
- glEnable( GL_LINE_SMOOTH );
+ glEnable(GL_LINE_SMOOTH);
if (node->flag & NODE_ACTIVE)
UI_ThemeColorShadeAlpha(TH_ACTIVE, 0, -40);
@@ -1036,7 +1036,7 @@ static void node_draw_frame(const bContext *C, ARegion *ar, SpaceNode *snode, bN
uiSetRoundBox(UI_CNR_ALL);
uiDrawBox(GL_LINE_LOOP, rct->xmin, rct->ymin, rct->xmax, rct->ymax, BASIS_RAD);
- glDisable( GL_LINE_SMOOTH );
+ glDisable(GL_LINE_SMOOTH);
glDisable(GL_BLEND);
}
@@ -1047,27 +1047,27 @@ static void node_draw_frame(const bContext *C, ARegion *ar, SpaceNode *snode, bN
uiEndBlock(C, node->block);
uiDrawBlock(C, node->block);
- node->block= NULL;
+ node->block = NULL;
}
static int node_resize_area_frame(bNode *node, int x, int y)
{
const float size = 10.0f;
NodeFrame *data = (NodeFrame *)node->storage;
- rctf totr= node->totr;
+ rctf totr = node->totr;
int dir = 0;
/* shrinking frame size is determined by child nodes */
if (!(data->flag & NODE_FRAME_RESIZEABLE))
return 0;
- if (x >= totr.xmax-size && x < totr.xmax && y >= totr.ymin && y < totr.ymax)
+ if (x >= totr.xmax - size && x < totr.xmax && y >= totr.ymin && y < totr.ymax)
dir |= NODE_RESIZE_RIGHT;
- if (x >= totr.xmin && x < totr.xmin+size && y >= totr.ymin && y < totr.ymax)
+ if (x >= totr.xmin && x < totr.xmin + size && y >= totr.ymin && y < totr.ymax)
dir |= NODE_RESIZE_LEFT;
- if (x >= totr.xmin && x < totr.xmax && y >= totr.ymax-size && y < totr.ymax)
+ if (x >= totr.xmin && x < totr.xmax && y >= totr.ymax - size && y < totr.ymax)
dir |= NODE_RESIZE_TOP;
- if (x >= totr.xmin && x < totr.xmax && y >= totr.ymin && y < totr.ymin+size)
+ if (x >= totr.xmin && x < totr.xmax && y >= totr.ymin && y < totr.ymin + size)
dir |= NODE_RESIZE_BOTTOM;
return dir;
@@ -1083,25 +1083,25 @@ static void node_common_set_butfunc(bNodeType *ntype)
{
switch (ntype->type) {
case NODE_GROUP:
- ntype->uifunc= node_uifunc_group;
- ntype->drawfunc= node_draw_group;
- ntype->drawupdatefunc= node_update_group;
+ ntype->uifunc = node_uifunc_group;
+ ntype->drawfunc = node_draw_group;
+ ntype->drawupdatefunc = node_update_group;
break;
case NODE_FORLOOP:
// ntype->uifunc= node_common_buts_group;
- ntype->drawfunc= node_draw_group;
- ntype->drawupdatefunc= node_update_group;
+ ntype->drawfunc = node_draw_group;
+ ntype->drawupdatefunc = node_update_group;
break;
case NODE_WHILELOOP:
- ntype->uifunc= node_common_buts_whileloop;
- ntype->drawfunc= node_draw_group;
- ntype->drawupdatefunc= node_update_group;
+ ntype->uifunc = node_common_buts_whileloop;
+ ntype->drawfunc = node_draw_group;
+ ntype->drawupdatefunc = node_update_group;
break;
case NODE_FRAME:
- ntype->drawfunc= node_draw_frame;
- ntype->drawupdatefunc= node_update_frame;
- ntype->uifuncbut= node_buts_frame_details;
- ntype->resize_area_func= node_resize_area_frame;
+ ntype->drawfunc = node_draw_frame;
+ ntype->drawupdatefunc = node_update_frame;
+ ntype->uifuncbut = node_buts_frame_details;
+ ntype->resize_area_func = node_resize_area_frame;
break;
}
}
@@ -1110,41 +1110,41 @@ static void node_common_set_butfunc(bNodeType *ntype)
static void node_browse_text_cb(bContext *C, void *ntree_v, void *node_v)
{
- Main *bmain= CTX_data_main(C);
- bNodeTree *ntree= ntree_v;
- bNode *node= node_v;
+ Main *bmain = CTX_data_main(C);
+ bNodeTree *ntree = ntree_v;
+ bNode *node = node_v;
/* ID *oldid; */ /* UNUSED */
- if (node->menunr<1) return;
+ if (node->menunr < 1) return;
if (node->id) {
node->id->us--;
}
/* oldid= node->id; */ /* UNUSED */
- node->id= BLI_findlink(&bmain->text, node->menunr-1);
+ node->id = BLI_findlink(&bmain->text, node->menunr - 1);
id_us_plus(node->id);
- BLI_strncpy(node->name, node->id->name+2, sizeof(node->name));
+ BLI_strncpy(node->name, node->id->name + 2, sizeof(node->name));
- node->custom1= BSET(node->custom1, NODE_DYNAMIC_NEW);
+ node->custom1 = BSET(node->custom1, NODE_DYNAMIC_NEW);
nodeSetActive(ntree, node);
// allqueue(REDRAWBUTSSHADING, 0);
// allqueue(REDRAWNODE, 0);
- node->menunr= 0;
+ node->menunr = 0;
}
static void node_shader_buts_material(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- bNode *node= ptr->data;
+ bNode *node = ptr->data;
uiLayout *col;
uiTemplateID(layout, C, ptr, "material", "MATERIAL_OT_new", NULL, NULL);
if (!node->id) return;
- col= uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
uiItemR(col, ptr, "use_diffuse", 0, NULL, ICON_NONE);
uiItemR(col, ptr, "use_specular", 0, NULL, ICON_NONE);
uiItemR(col, ptr, "invert_normal", 0, NULL, ICON_NONE);
@@ -1155,22 +1155,22 @@ static void node_shader_buts_mapping(uiLayout *layout, bContext *UNUSED(C), Poin
uiLayout *row;
uiItemL(layout, "Location:", ICON_NONE);
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
uiItemR(row, ptr, "translation", 0, "", ICON_NONE);
uiItemL(layout, "Rotation:", ICON_NONE);
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
uiItemR(row, ptr, "rotation", 0, "", ICON_NONE);
uiItemL(layout, "Scale:", ICON_NONE);
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
uiItemR(row, ptr, "scale", 0, "", ICON_NONE);
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
uiItemR(row, ptr, "use_min", 0, "Min", ICON_NONE);
uiItemR(row, ptr, "min", 0, "", ICON_NONE);
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
uiItemR(row, ptr, "use_max", 0, "Max", ICON_NONE);
uiItemR(row, ptr, "max", 0, "", ICON_NONE);
}
@@ -1182,13 +1182,13 @@ static void node_shader_buts_vect_math(uiLayout *layout, bContext *UNUSED(C), Po
static void node_shader_buts_geometry(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- PointerRNA obptr= CTX_data_pointer_get(C, "active_object");
+ PointerRNA obptr = CTX_data_pointer_get(C, "active_object");
uiLayout *col;
- col= uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
if (obptr.data && RNA_enum_get(&obptr, "type") == OB_MESH) {
- PointerRNA dataptr= RNA_pointer_get(&obptr, "data");
+ PointerRNA dataptr = RNA_pointer_get(&obptr, "data");
uiItemPointerR(col, ptr, "uv_layer", &dataptr, "uv_textures", "", ICON_NONE);
uiItemPointerR(col, ptr, "color_layer", &dataptr, "vertex_colors", "", ICON_NONE);
@@ -1256,32 +1256,32 @@ static void node_shader_buts_glossy(uiLayout *layout, bContext *UNUSED(C), Point
static void node_shader_buts_dynamic(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- Main *bmain= CTX_data_main(C);
- uiBlock *block= uiLayoutAbsoluteBlock(layout);
- bNode *node= ptr->data;
- bNodeTree *ntree= ptr->id.data;
- rctf *butr= &node->butr;
+ Main *bmain = CTX_data_main(C);
+ uiBlock *block = uiLayoutAbsoluteBlock(layout);
+ bNode *node = ptr->data;
+ bNodeTree *ntree = ptr->id.data;
+ rctf *butr = &node->butr;
uiBut *bt;
// XXX SpaceNode *snode= curarea->spacedata.first;
- short dy= (short)butr->ymin;
- int xoff=0;
+ short dy = (short)butr->ymin;
+ int xoff = 0;
/* B_NODE_EXEC is handled in butspace.c do_node_buts */
if (!node->id) {
- const char *strp;
- IDnames_to_pupstring(&strp, NULL, "", &(bmain->text), NULL, NULL);
- node->menunr= 0;
- bt= uiDefButS(block, MENU, B_NODE_EXEC/*+node->nr*/, strp,
- butr->xmin, dy, 19, 19,
- &node->menunr, 0, 0, 0, 0, "Browses existing choices");
- uiButSetFunc(bt, node_browse_text_cb, ntree, node);
- xoff=19;
- if (strp) MEM_freeN((void *)strp);
+ const char *strp;
+ IDnames_to_pupstring(&strp, NULL, "", &(bmain->text), NULL, NULL);
+ node->menunr = 0;
+ bt = uiDefButS(block, MENU, B_NODE_EXEC /*+node->nr*/, strp,
+ butr->xmin, dy, 19, 19,
+ &node->menunr, 0, 0, 0, 0, "Browses existing choices");
+ uiButSetFunc(bt, node_browse_text_cb, ntree, node);
+ xoff = 19;
+ if (strp) MEM_freeN((void *)strp);
}
else {
bt = uiDefBut(block, BUT, B_NOP, "Update",
- butr->xmin+xoff, butr->ymin+20, 50, 19,
- &node->menunr, 0.0, 19.0, 0, 0, "Refresh this node (and all others that use the same script)");
+ butr->xmin + xoff, butr->ymin + 20, 50, 19,
+ &node->menunr, 0.0, 19.0, 0, 0, "Refresh this node (and all others that use the same script)");
uiButSetFunc(bt, node_dynamic_update_cb, ntree, node);
if (BTST(node->custom1, NODE_DYNAMIC_ERROR)) {
@@ -1301,77 +1301,77 @@ static void node_shader_set_butfunc(bNodeType *ntype)
case SH_NODE_MATERIAL:
case SH_NODE_MATERIAL_EXT:
- ntype->uifunc= node_shader_buts_material;
+ ntype->uifunc = node_shader_buts_material;
break;
case SH_NODE_TEXTURE:
- ntype->uifunc= node_buts_texture;
+ ntype->uifunc = node_buts_texture;
break;
case SH_NODE_NORMAL:
- ntype->uifunc= node_buts_normal;
+ ntype->uifunc = node_buts_normal;
break;
case SH_NODE_CURVE_VEC:
- ntype->uifunc= node_buts_curvevec;
+ ntype->uifunc = node_buts_curvevec;
break;
case SH_NODE_CURVE_RGB:
- ntype->uifunc= node_buts_curvecol;
+ ntype->uifunc = node_buts_curvecol;
break;
case SH_NODE_MAPPING:
- ntype->uifunc= node_shader_buts_mapping;
+ ntype->uifunc = node_shader_buts_mapping;
break;
case SH_NODE_VALUE:
- ntype->uifunc= node_buts_value;
+ ntype->uifunc = node_buts_value;
break;
case SH_NODE_RGB:
- ntype->uifunc= node_buts_rgb;
+ ntype->uifunc = node_buts_rgb;
break;
case SH_NODE_MIX_RGB:
- ntype->uifunc= node_buts_mix_rgb;
+ ntype->uifunc = node_buts_mix_rgb;
break;
case SH_NODE_VALTORGB:
- ntype->uifunc= node_buts_colorramp;
+ ntype->uifunc = node_buts_colorramp;
break;
case SH_NODE_MATH:
- ntype->uifunc= node_buts_math;
+ ntype->uifunc = node_buts_math;
break;
case SH_NODE_VECT_MATH:
- ntype->uifunc= node_shader_buts_vect_math;
+ ntype->uifunc = node_shader_buts_vect_math;
break;
case SH_NODE_GEOMETRY:
- ntype->uifunc= node_shader_buts_geometry;
+ ntype->uifunc = node_shader_buts_geometry;
break;
case SH_NODE_ATTRIBUTE:
- ntype->uifunc= node_shader_buts_attribute;
+ ntype->uifunc = node_shader_buts_attribute;
break;
case SH_NODE_TEX_SKY:
- ntype->uifunc= node_shader_buts_tex_sky;
+ ntype->uifunc = node_shader_buts_tex_sky;
break;
case SH_NODE_TEX_IMAGE:
- ntype->uifunc= node_shader_buts_tex_image;
+ ntype->uifunc = node_shader_buts_tex_image;
break;
case SH_NODE_TEX_ENVIRONMENT:
- ntype->uifunc= node_shader_buts_tex_environment;
+ ntype->uifunc = node_shader_buts_tex_environment;
break;
case SH_NODE_TEX_GRADIENT:
- ntype->uifunc= node_shader_buts_tex_gradient;
+ ntype->uifunc = node_shader_buts_tex_gradient;
break;
case SH_NODE_TEX_MAGIC:
- ntype->uifunc= node_shader_buts_tex_magic;
+ ntype->uifunc = node_shader_buts_tex_magic;
break;
case SH_NODE_TEX_WAVE:
- ntype->uifunc= node_shader_buts_tex_wave;
+ ntype->uifunc = node_shader_buts_tex_wave;
break;
case SH_NODE_TEX_MUSGRAVE:
- ntype->uifunc= node_shader_buts_tex_musgrave;
+ ntype->uifunc = node_shader_buts_tex_musgrave;
break;
case SH_NODE_TEX_VORONOI:
- ntype->uifunc= node_shader_buts_tex_voronoi;
+ ntype->uifunc = node_shader_buts_tex_voronoi;
break;
case SH_NODE_BSDF_GLOSSY:
case SH_NODE_BSDF_GLASS:
- ntype->uifunc= node_shader_buts_glossy;
+ ntype->uifunc = node_shader_buts_glossy;
break;
case NODE_DYNAMIC:
- ntype->uifunc= node_shader_buts_dynamic;
+ ntype->uifunc = node_shader_buts_dynamic;
break;
}
}
@@ -1381,7 +1381,7 @@ static void node_shader_set_butfunc(bNodeType *ntype)
static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
uiLayout *col;
- bNode *node= ptr->data;
+ bNode *node = ptr->data;
PointerRNA imaptr;
PropertyRNA *prop;
int source;
@@ -1392,26 +1392,26 @@ static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *
prop = RNA_struct_find_property(ptr, "image");
if (!prop || RNA_property_type(prop) != PROP_POINTER) return;
- imaptr= RNA_property_pointer_get(ptr, prop);
+ imaptr = RNA_property_pointer_get(ptr, prop);
- col= uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
uiItemR(col, &imaptr, "source", 0, NULL, ICON_NONE);
- source= RNA_enum_get(&imaptr, "source");
+ source = RNA_enum_get(&imaptr, "source");
if (source == IMA_SRC_SEQUENCE) {
/* don't use iuser->framenr directly because it may not be updated if auto-refresh is off */
- Scene *scene= CTX_data_scene(C);
- ImageUser *iuser= node->storage;
+ Scene *scene = CTX_data_scene(C);
+ ImageUser *iuser = node->storage;
char numstr[32];
- const int framenr= BKE_image_user_frame_get(iuser, CFRA, 0);
+ const int framenr = BKE_image_user_frame_get(iuser, CFRA, 0);
BLI_snprintf(numstr, sizeof(numstr), "Frame: %d", framenr);
uiItemL(layout, numstr, ICON_NONE);
}
if (ELEM(source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) {
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
uiItemR(col, ptr, "frame_duration", 0, NULL, ICON_NONE);
uiItemR(col, ptr, "frame_start", 0, NULL, ICON_NONE);
uiItemR(col, ptr, "frame_offset", 0, NULL, ICON_NONE);
@@ -1419,21 +1419,21 @@ static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *
uiItemR(col, ptr, "use_auto_refresh", UI_ITEM_R_ICON_ONLY, NULL, ICON_NONE);
}
- col= uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
- if (RNA_enum_get(&imaptr, "type")== IMA_TYPE_MULTILAYER)
+ if (RNA_enum_get(&imaptr, "type") == IMA_TYPE_MULTILAYER)
uiItemR(col, ptr, "layer", 0, NULL, ICON_NONE);
}
static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- bNode *node= ptr->data;
+ bNode *node = ptr->data;
uiLayout *col, *row;
PointerRNA op_ptr;
PointerRNA scn_ptr;
PropertyRNA *prop;
const char *layer_name;
- char scene_name[MAX_ID_NAME-2];
+ char scene_name[MAX_ID_NAME - 2];
wmOperatorType *ot = WM_operatortype_find("RENDER_OT_render", 1);
BLI_assert(ot != 0);
@@ -1442,7 +1442,7 @@ static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, Point
if (!node->id) return;
- col= uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
row = uiLayoutRow(col, 0);
uiItemR(row, ptr, "layer", 0, "", ICON_NONE);
@@ -1465,10 +1465,10 @@ static void node_composit_buts_blur(uiLayout *layout, bContext *UNUSED(C), Point
{
uiLayout *col, *row;
- col= uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
uiItemR(col, ptr, "filter_type", 0, "", ICON_NONE);
- if (RNA_enum_get(ptr, "filter_type")!= R_FILTER_FAST_GAUSS) {
+ if (RNA_enum_get(ptr, "filter_type") != R_FILTER_FAST_GAUSS) {
uiItemR(col, ptr, "use_bokeh", 0, NULL, ICON_NONE);
uiItemR(col, ptr, "use_gamma_correction", 0, NULL, ICON_NONE);
}
@@ -1477,15 +1477,15 @@ static void node_composit_buts_blur(uiLayout *layout, bContext *UNUSED(C), Point
if (RNA_boolean_get(ptr, "use_relative")) {
uiItemL(col, "Aspect Correction", 0);
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
uiItemR(row, ptr, "aspect_correction", UI_ITEM_R_EXPAND, NULL, 0);
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
uiItemR(col, ptr, "factor_x", 0, "X", ICON_NONE);
uiItemR(col, ptr, "factor_y", 0, "Y", ICON_NONE);
}
else {
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
uiItemR(col, ptr, "size_x", 0, "X", ICON_NONE);
uiItemR(col, ptr, "size_y", 0, "Y", ICON_NONE);
}
@@ -1498,14 +1498,14 @@ static void node_composit_buts_dblur(uiLayout *layout, bContext *UNUSED(C), Poin
uiItemR(layout, ptr, "iterations", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "use_wrap", 0, NULL, ICON_NONE);
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
uiItemL(col, "Center:", ICON_NONE);
uiItemR(col, ptr, "center_x", 0, "X", ICON_NONE);
uiItemR(col, ptr, "center_y", 0, "Y", ICON_NONE);
uiItemS(layout);
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
uiItemR(col, ptr, "distance", 0, NULL, ICON_NONE);
uiItemR(col, ptr, "angle", 0, NULL, ICON_NONE);
@@ -1519,7 +1519,7 @@ static void node_composit_buts_bilateralblur(uiLayout *layout, bContext *UNUSED(
{
uiLayout *col;
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
uiItemR(col, ptr, "iterations", 0, NULL, ICON_NONE);
uiItemR(col, ptr, "sigma_color", 0, NULL, ICON_NONE);
uiItemR(col, ptr, "sigma_space", 0, NULL, ICON_NONE);
@@ -1529,7 +1529,7 @@ static void node_composit_buts_defocus(uiLayout *layout, bContext *UNUSED(C), Po
{
uiLayout *sub, *col;
- col= uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
uiItemL(col, "Bokeh Type:", ICON_NONE);
uiItemR(col, ptr, "bokeh", 0, "", ICON_NONE);
uiItemR(col, ptr, "angle", 0, NULL, ICON_NONE);
@@ -1562,27 +1562,27 @@ static void node_composit_buts_glare(uiLayout *layout, bContext *UNUSED(C), Poin
uiItemR(layout, ptr, "glare_type", 0, "", ICON_NONE);
uiItemR(layout, ptr, "quality", 0, "", ICON_NONE);
- if (RNA_enum_get(ptr, "glare_type")!= 1) {
+ if (RNA_enum_get(ptr, "glare_type") != 1) {
uiItemR(layout, ptr, "iterations", 0, NULL, ICON_NONE);
- if (RNA_enum_get(ptr, "glare_type")!= 0)
+ if (RNA_enum_get(ptr, "glare_type") != 0)
uiItemR(layout, ptr, "color_modulation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
}
uiItemR(layout, ptr, "mix", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "threshold", 0, NULL, ICON_NONE);
- if (RNA_enum_get(ptr, "glare_type")== 2) {
+ if (RNA_enum_get(ptr, "glare_type") == 2) {
uiItemR(layout, ptr, "streaks", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "angle_offset", 0, NULL, ICON_NONE);
}
- if (RNA_enum_get(ptr, "glare_type")== 0 || RNA_enum_get(ptr, "glare_type")== 2) {
+ if (RNA_enum_get(ptr, "glare_type") == 0 || RNA_enum_get(ptr, "glare_type") == 2) {
uiItemR(layout, ptr, "fade", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
- if (RNA_enum_get(ptr, "glare_type")== 0)
+ if (RNA_enum_get(ptr, "glare_type") == 0)
uiItemR(layout, ptr, "use_rotate_45", 0, NULL, ICON_NONE);
}
- if (RNA_enum_get(ptr, "glare_type")== 1) {
+ if (RNA_enum_get(ptr, "glare_type") == 1) {
uiItemR(layout, ptr, "size", 0, NULL, ICON_NONE);
}
}
@@ -1593,7 +1593,7 @@ static void node_composit_buts_tonemap(uiLayout *layout, bContext *UNUSED(C), Po
col = uiLayoutColumn(layout, 0);
uiItemR(col, ptr, "tonemap_type", 0, "", ICON_NONE);
- if (RNA_enum_get(ptr, "tonemap_type")== 0) {
+ if (RNA_enum_get(ptr, "tonemap_type") == 0) {
uiItemR(col, ptr, "key", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
uiItemR(col, ptr, "offset", 0, NULL, ICON_NONE);
uiItemR(col, ptr, "gamma", 0, NULL, ICON_NONE);
@@ -1610,7 +1610,7 @@ static void node_composit_buts_lensdist(uiLayout *layout, bContext *UNUSED(C), P
{
uiLayout *col;
- col= uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
uiItemR(col, ptr, "use_projector", 0, NULL, ICON_NONE);
col = uiLayoutColumn(col, 0);
@@ -1623,11 +1623,11 @@ static void node_composit_buts_vecblur(uiLayout *layout, bContext *UNUSED(C), Po
{
uiLayout *col;
- col= uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
uiItemR(col, ptr, "samples", 0, NULL, ICON_NONE);
uiItemR(col, ptr, "factor", 0, "Blur", ICON_NONE);
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
uiItemL(col, "Speed:", ICON_NONE);
uiItemR(col, ptr, "speed_min", 0, "Min", ICON_NONE);
uiItemR(col, ptr, "speed_max", 0, "Max", ICON_NONE);
@@ -1652,7 +1652,7 @@ static void node_composit_buts_crop(uiLayout *layout, bContext *UNUSED(C), Point
uiItemR(layout, ptr, "use_crop_size", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "relative", 0, NULL, ICON_NONE);
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
if (RNA_boolean_get(ptr, "relative")) {
uiItemR(col, ptr, "rel_min_x", 0, "Left", ICON_NONE);
uiItemR(col, ptr, "rel_max_x", 0, "Right", ICON_NONE);
@@ -1671,8 +1671,8 @@ static void node_composit_buts_splitviewer(uiLayout *layout, bContext *UNUSED(C)
{
uiLayout *row, *col;
- col= uiLayoutColumn(layout, 0);
- row= uiLayoutRow(col, 0);
+ col = uiLayoutColumn(layout, 0);
+ row = uiLayoutRow(col, 0);
uiItemR(row, ptr, "axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
uiItemR(col, ptr, "factor", 0, NULL, ICON_NONE);
}
@@ -1681,7 +1681,7 @@ static void node_composit_buts_double_edge_mask(uiLayout *layout, bContext *UNUS
{
uiLayout *col;
- col= uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
uiItemL(col, "Inner Edge:", ICON_NONE);
uiItemR(col, ptr, "inner_mode", 0, "", ICON_NONE);
@@ -1763,7 +1763,7 @@ static void node_composit_buts_distance_matte(uiLayout *layout, bContext *UNUSED
col = uiLayoutColumn(layout, 1);
uiItemL(layout, "Color Space:", ICON_NONE);
- row= uiLayoutRow(layout, 0);
+ row = uiLayoutRow(layout, 0);
uiItemR(row, ptr, "channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
uiItemR(col, ptr, "tolerance", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
@@ -1778,12 +1778,12 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C)
row = uiLayoutRow(layout, 0);
uiItemR(row, ptr, "channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
- col= uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE);
- if (RNA_enum_get(ptr, "limit_method")==0) {
+ if (RNA_enum_get(ptr, "limit_method") == 0) {
uiItemL(col, "Limiting Channel:", ICON_NONE);
- row=uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
}
@@ -1800,11 +1800,11 @@ static void node_composit_buts_chroma_matte(uiLayout *layout, bContext *UNUSED(C
{
uiLayout *col;
- col= uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
uiItemR(col, ptr, "tolerance", 0, NULL, ICON_NONE);
uiItemR(col, ptr, "threshold", 0, NULL, ICON_NONE);
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
/*uiItemR(col, ptr, "lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE); Removed for now */
uiItemR(col, ptr, "gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
/*uiItemR(col, ptr, "shadow_adjust", UI_ITEM_R_SLIDER, NULL, ICON_NONE); Removed for now*/
@@ -1814,7 +1814,7 @@ static void node_composit_buts_color_matte(uiLayout *layout, bContext *UNUSED(C)
{
uiLayout *col;
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
uiItemR(col, ptr, "color_hue", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
uiItemR(col, ptr, "color_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
uiItemR(col, ptr, "color_value", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
@@ -1825,20 +1825,20 @@ static void node_composit_buts_channel_matte(uiLayout *layout, bContext *UNUSED(
uiLayout *col, *row;
uiItemL(layout, "Color Space:", ICON_NONE);
- row= uiLayoutRow(layout, 0);
+ row = uiLayoutRow(layout, 0);
uiItemR(row, ptr, "color_space", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
- col=uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
uiItemL(col, "Key Channel:", ICON_NONE);
- row= uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
uiItemR(row, ptr, "matte_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
col = uiLayoutColumn(layout, 0);
uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE);
- if (RNA_enum_get(ptr, "limit_method")==0) {
+ if (RNA_enum_get(ptr, "limit_method") == 0) {
uiItemL(col, "Limiting Channel:", ICON_NONE);
- row=uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
}
@@ -1850,7 +1850,7 @@ static void node_composit_buts_luma_matte(uiLayout *layout, bContext *UNUSED(C),
{
uiLayout *col;
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
uiItemR(col, ptr, "limit_max", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
uiItemR(col, ptr, "limit_min", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
}
@@ -1868,8 +1868,8 @@ static void node_composit_buts_id_mask(uiLayout *layout, bContext *UNUSED(C), Po
/* draw function for file output node sockets, displays only sub-path and format, no value button */
static void node_draw_input_file_output(const bContext *C, uiBlock *block,
- bNodeTree *ntree, bNode *node, bNodeSocket *sock,
- const char *UNUSED(name), int x, int y, int width)
+ bNodeTree *ntree, bNode *node, bNodeSocket *sock,
+ const char *UNUSED(name), int x, int y, int width)
{
uiLayout *layout, *row;
PointerRNA nodeptr, inputptr, imfptr;
@@ -1877,7 +1877,7 @@ static void node_draw_input_file_output(const bContext *C, uiBlock *block,
int rx, ry;
RNA_pointer_create(&ntree->id, &RNA_Node, node, &nodeptr);
- layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, x, y+NODE_DY, width, 20, UI_GetStyle());
+ layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, x, y + NODE_DY, width, 20, UI_GetStyle());
row = uiLayoutRow(layout, 0);
imfptr = RNA_pointer_get(&nodeptr, "format");
@@ -1900,7 +1900,7 @@ static void node_draw_input_file_output(const bContext *C, uiBlock *block,
imfptr = RNA_pointer_get(&inputptr, "format");
imtype_prop = RNA_struct_find_property(&imfptr, "file_format");
- RNA_property_enum_name((bContext*)C, &imfptr, imtype_prop, RNA_property_enum_get(&imfptr, imtype_prop), &imtype_name);
+ RNA_property_enum_name((bContext *)C, &imfptr, imtype_prop, RNA_property_enum_get(&imfptr, imtype_prop), &imtype_name);
uiBlockSetEmboss(block, UI_EMBOSSP);
uiItemL(row, imtype_name, 0);
uiBlockSetEmboss(block, UI_EMBOSSN);
@@ -1979,7 +1979,7 @@ static void node_composit_buts_file_output_details(uiLayout *layout, bContext *C
uiItemL(col, "Format:", 0);
uiItemR(col, &active_input_ptr, "use_node_format", 0, NULL, 0);
- col= uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
uiLayoutSetActive(col, RNA_boolean_get(&active_input_ptr, "use_node_format") == FALSE);
uiTemplateImageSettings(col, &imfptr);
}
@@ -2000,7 +2000,7 @@ static void node_composit_buts_invert(uiLayout *layout, bContext *UNUSED(C), Poi
{
uiLayout *col;
- col= uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
uiItemR(col, ptr, "invert_rgb", 0, NULL, ICON_NONE);
uiItemR(col, ptr, "invert_alpha", 0, NULL, ICON_NONE);
}
@@ -2021,7 +2021,7 @@ static void node_composit_buts_colorbalance(uiLayout *layout, bContext *UNUSED(C
uiItemR(layout, ptr, "correction_method", 0, NULL, ICON_NONE);
- if (RNA_enum_get(ptr, "correction_method")== 0) {
+ if (RNA_enum_get(ptr, "correction_method") == 0) {
split = uiLayoutSplit(layout, 0, 0);
col = uiLayoutColumn(split, 0);
@@ -2064,9 +2064,9 @@ static void node_composit_buts_colorbalance_but(uiLayout *layout, bContext *UNUS
{
uiItemR(layout, ptr, "correction_method", 0, NULL, ICON_NONE);
- if (RNA_enum_get(ptr, "correction_method")== 0) {
+ if (RNA_enum_get(ptr, "correction_method") == 0) {
- uiTemplateColorWheel(layout, ptr, "lift", 1, 1, 0, 1);
+ uiTemplateColorWheel(layout, ptr, "lift", 1, 1, 0, 1);
uiItemR(layout, ptr, "lift", 0, NULL, ICON_NONE);
uiTemplateColorWheel(layout, ptr, "gamma", 1, 1, 1, 1);
@@ -2105,7 +2105,7 @@ static void node_composit_buts_movieclip(uiLayout *layout, bContext *C, PointerR
static void node_composit_buts_stabilize2d(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- bNode *node= ptr->data;
+ bNode *node = ptr->data;
uiTemplateID(layout, C, ptr, "clip", NULL, "CLIP_OT_open", NULL);
@@ -2122,7 +2122,7 @@ static void node_composit_buts_transform(uiLayout *layout, bContext *UNUSED(C),
static void node_composit_buts_moviedistortion(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- bNode *node= ptr->data;
+ bNode *node = ptr->data;
uiTemplateID(layout, C, ptr, "clip", NULL, "CLIP_OT_open", NULL);
@@ -2239,11 +2239,11 @@ static void node_composit_buts_boxmask(uiLayout *layout, bContext *UNUSED(C), Po
{
uiLayout *row;
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
uiItemR(row, ptr, "x", 0, NULL, ICON_NONE);
uiItemR(row, ptr, "y", 0, NULL, ICON_NONE);
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
uiItemR(row, ptr, "width", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
uiItemR(row, ptr, "height", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
@@ -2260,32 +2260,32 @@ static void node_composit_buts_bokehimage(uiLayout *layout, bContext *UNUSED(C),
uiItemR(layout, ptr, "shift", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
}
-void node_composit_backdrop_viewer(SpaceNode* snode, ImBuf* backdrop, bNode* node, int x, int y)
+void node_composit_backdrop_viewer(SpaceNode *snode, ImBuf *backdrop, bNode *node, int x, int y)
{
// node_composit_backdrop_canvas(snode, backdrop, node, x, y);
if (node->custom1 == 0) { /// @todo: why did we need this one?
const float backdropWidth = backdrop->x;
const float backdropHeight = backdrop->y;
- const float cx = x+snode->zoom*backdropWidth*node->custom3;
- const float cy = y+snode->zoom*backdropHeight*node->custom4;
+ const float cx = x + snode->zoom * backdropWidth * node->custom3;
+ const float cy = y + snode->zoom * backdropHeight * node->custom4;
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_LINES);
- glVertex2f(cx-25, cy-25);
- glVertex2f(cx+25, cy+25);
- glVertex2f(cx+25, cy-25);
- glVertex2f(cx-25, cy+25);
+ glVertex2f(cx - 25, cy - 25);
+ glVertex2f(cx + 25, cy + 25);
+ glVertex2f(cx + 25, cy - 25);
+ glVertex2f(cx - 25, cy + 25);
glEnd();
}
}
-void node_composit_backdrop_boxmask(SpaceNode* snode, ImBuf* backdrop, bNode* node, int x, int y)
+void node_composit_backdrop_boxmask(SpaceNode *snode, ImBuf *backdrop, bNode *node, int x, int y)
{
NodeBoxMask *boxmask = node->storage;
const float backdropWidth = backdrop->x;
const float backdropHeight = backdrop->y;
- const float aspect = backdropWidth/backdropHeight;
+ const float aspect = backdropWidth / backdropHeight;
const float rad = DEG2RADF(-boxmask->rotation);
const float cosine = cosf(rad);
const float sine = sinf(rad);
@@ -2301,17 +2301,17 @@ void node_composit_backdrop_boxmask(SpaceNode* snode, ImBuf* backdrop, bNode* no
glColor3f(1.0, 1.0, 1.0);
- cx = x+snode->zoom*backdropWidth*boxmask->x;
- cy = y+snode->zoom*backdropHeight*boxmask->y;
+ cx = x + snode->zoom * backdropWidth * boxmask->x;
+ cy = y + snode->zoom * backdropHeight * boxmask->y;
- x1 = cx - (cosine*halveBoxWidth+sine*halveBoxHeight)*snode->zoom;
- x2 = cx - (cosine*-halveBoxWidth+sine*halveBoxHeight)*snode->zoom;
- x3 = cx - (cosine*-halveBoxWidth+sine*-halveBoxHeight)*snode->zoom;
- x4 = cx - (cosine*halveBoxWidth+sine*-halveBoxHeight)*snode->zoom;
- y1 = cy - (-sine*halveBoxWidth + cosine*halveBoxHeight)*snode->zoom;
- y2 = cy - (-sine*-halveBoxWidth + cosine*halveBoxHeight)*snode->zoom;
- y3 = cy - (-sine*-halveBoxWidth + cosine*-halveBoxHeight)*snode->zoom;
- y4 = cy - (-sine*halveBoxWidth + cosine*-halveBoxHeight)*snode->zoom;
+ x1 = cx - (cosine * halveBoxWidth + sine * halveBoxHeight) * snode->zoom;
+ x2 = cx - (cosine * -halveBoxWidth + sine * halveBoxHeight) * snode->zoom;
+ x3 = cx - (cosine * -halveBoxWidth + sine * -halveBoxHeight) * snode->zoom;
+ x4 = cx - (cosine * halveBoxWidth + sine * -halveBoxHeight) * snode->zoom;
+ y1 = cy - (-sine * halveBoxWidth + cosine * halveBoxHeight) * snode->zoom;
+ y2 = cy - (-sine * -halveBoxWidth + cosine * halveBoxHeight) * snode->zoom;
+ y3 = cy - (-sine * -halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom;
+ y4 = cy - (-sine * halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom;
glBegin(GL_LINE_LOOP);
glVertex2f(x1, y1);
@@ -2321,9 +2321,9 @@ void node_composit_backdrop_boxmask(SpaceNode* snode, ImBuf* backdrop, bNode* no
glEnd();
}
-void node_composit_backdrop_ellipsemask(SpaceNode* snode, ImBuf* backdrop, bNode* node, int x, int y)
+void node_composit_backdrop_ellipsemask(SpaceNode *snode, ImBuf *backdrop, bNode *node, int x, int y)
{
- NodeEllipseMask * ellipsemask = node->storage;
+ NodeEllipseMask *ellipsemask = node->storage;
const float backdropWidth = backdrop->x;
const float backdropHeight = backdrop->y;
const float aspect = backdropWidth / backdropHeight;
@@ -2342,17 +2342,17 @@ void node_composit_backdrop_ellipsemask(SpaceNode* snode, ImBuf* backdrop, bNode
glColor3f(1.0, 1.0, 1.0);
- cx = x+snode->zoom*backdropWidth*ellipsemask->x;
- cy = y+snode->zoom*backdropHeight*ellipsemask->y;
+ cx = x + snode->zoom * backdropWidth * ellipsemask->x;
+ cy = y + snode->zoom * backdropHeight * ellipsemask->y;
- x1 = cx - (cosine*halveBoxWidth+sine*halveBoxHeight)*snode->zoom;
- x2 = cx - (cosine*-halveBoxWidth+sine*halveBoxHeight)*snode->zoom;
- x3 = cx - (cosine*-halveBoxWidth+sine*-halveBoxHeight)*snode->zoom;
- x4 = cx - (cosine*halveBoxWidth+sine*-halveBoxHeight)*snode->zoom;
- y1 = cy - (-sine*halveBoxWidth + cosine*halveBoxHeight)*snode->zoom;
- y2 = cy - (-sine*-halveBoxWidth + cosine*halveBoxHeight)*snode->zoom;
- y3 = cy - (-sine*-halveBoxWidth + cosine*-halveBoxHeight)*snode->zoom;
- y4 = cy - (-sine*halveBoxWidth + cosine*-halveBoxHeight)*snode->zoom;
+ x1 = cx - (cosine * halveBoxWidth + sine * halveBoxHeight) * snode->zoom;
+ x2 = cx - (cosine * -halveBoxWidth + sine * halveBoxHeight) * snode->zoom;
+ x3 = cx - (cosine * -halveBoxWidth + sine * -halveBoxHeight) * snode->zoom;
+ x4 = cx - (cosine * halveBoxWidth + sine * -halveBoxHeight) * snode->zoom;
+ y1 = cy - (-sine * halveBoxWidth + cosine * halveBoxHeight) * snode->zoom;
+ y2 = cy - (-sine * -halveBoxWidth + cosine * halveBoxHeight) * snode->zoom;
+ y3 = cy - (-sine * -halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom;
+ y4 = cy - (-sine * halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom;
glBegin(GL_LINE_LOOP);
@@ -2366,10 +2366,10 @@ void node_composit_backdrop_ellipsemask(SpaceNode* snode, ImBuf* backdrop, bNode
static void node_composit_buts_ellipsemask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiLayout *row;
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
uiItemR(row, ptr, "x", 0, NULL, ICON_NONE);
uiItemR(row, ptr, "y", 0, NULL, ICON_NONE);
- row= uiLayoutRow(layout, 1);
+ row = uiLayoutRow(layout, 1);
uiItemR(row, ptr, "width", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
uiItemR(row, ptr, "height", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
@@ -2382,8 +2382,8 @@ static void node_composit_buts_viewer_but(uiLayout *layout, bContext *UNUSED(C),
uiLayout *col;
uiItemR(layout, ptr, "tile_order", 0, NULL, ICON_NONE);
- if (RNA_enum_get(ptr, "tile_order")==0) {
- col= uiLayoutColumn(layout, 1);
+ if (RNA_enum_get(ptr, "tile_order") == 0) {
+ col = uiLayoutColumn(layout, 1);
uiItemR(col, ptr, "center_x", 0, NULL, ICON_NONE);
uiItemR(col, ptr, "center_y", 0, NULL, ICON_NONE);
}
@@ -2401,49 +2401,49 @@ static void node_composit_set_butfunc(bNodeType *ntype)
/* case NODE_GROUP: note, typeinfo for group is generated... see "XXX ugly hack" */
case CMP_NODE_IMAGE:
- ntype->uifunc= node_composit_buts_image;
+ ntype->uifunc = node_composit_buts_image;
break;
case CMP_NODE_R_LAYERS:
- ntype->uifunc= node_composit_buts_renderlayers;
+ ntype->uifunc = node_composit_buts_renderlayers;
break;
case CMP_NODE_NORMAL:
- ntype->uifunc= node_buts_normal;
+ ntype->uifunc = node_buts_normal;
break;
case CMP_NODE_CURVE_VEC:
- ntype->uifunc= node_buts_curvevec;
+ ntype->uifunc = node_buts_curvevec;
break;
case CMP_NODE_CURVE_RGB:
- ntype->uifunc= node_buts_curvecol;
+ ntype->uifunc = node_buts_curvecol;
break;
case CMP_NODE_VALUE:
- ntype->uifunc= node_buts_value;
+ ntype->uifunc = node_buts_value;
break;
case CMP_NODE_RGB:
- ntype->uifunc= node_buts_rgb;
+ ntype->uifunc = node_buts_rgb;
break;
case CMP_NODE_FLIP:
- ntype->uifunc= node_composit_buts_flip;
+ ntype->uifunc = node_composit_buts_flip;
break;
case CMP_NODE_SPLITVIEWER:
- ntype->uifunc= node_composit_buts_splitviewer;
+ ntype->uifunc = node_composit_buts_splitviewer;
break;
case CMP_NODE_MIX_RGB:
- ntype->uifunc= node_buts_mix_rgb;
+ ntype->uifunc = node_buts_mix_rgb;
break;
case CMP_NODE_VALTORGB:
- ntype->uifunc= node_buts_colorramp;
+ ntype->uifunc = node_buts_colorramp;
break;
case CMP_NODE_CROP:
- ntype->uifunc= node_composit_buts_crop;
+ ntype->uifunc = node_composit_buts_crop;
break;
case CMP_NODE_BLUR:
- ntype->uifunc= node_composit_buts_blur;
+ ntype->uifunc = node_composit_buts_blur;
break;
case CMP_NODE_DBLUR:
- ntype->uifunc= node_composit_buts_dblur;
+ ntype->uifunc = node_composit_buts_dblur;
break;
case CMP_NODE_BILATERALBLUR:
- ntype->uifunc= node_composit_buts_bilateralblur;
+ ntype->uifunc = node_composit_buts_bilateralblur;
break;
case CMP_NODE_DEFOCUS:
ntype->uifunc = node_composit_buts_defocus;
@@ -2458,129 +2458,129 @@ static void node_composit_set_butfunc(bNodeType *ntype)
ntype->uifunc = node_composit_buts_lensdist;
break;
case CMP_NODE_VECBLUR:
- ntype->uifunc= node_composit_buts_vecblur;
+ ntype->uifunc = node_composit_buts_vecblur;
break;
case CMP_NODE_FILTER:
- ntype->uifunc= node_composit_buts_filter;
+ ntype->uifunc = node_composit_buts_filter;
break;
case CMP_NODE_MAP_VALUE:
- ntype->uifunc= node_composit_buts_map_value;
+ ntype->uifunc = node_composit_buts_map_value;
break;
case CMP_NODE_TIME:
- ntype->uifunc= node_buts_time;
+ ntype->uifunc = node_buts_time;
break;
case CMP_NODE_ALPHAOVER:
- ntype->uifunc= node_composit_buts_alphaover;
+ ntype->uifunc = node_composit_buts_alphaover;
break;
case CMP_NODE_HUE_SAT:
- ntype->uifunc= node_composit_buts_hue_sat;
+ ntype->uifunc = node_composit_buts_hue_sat;
break;
case CMP_NODE_TEXTURE:
- ntype->uifunc= node_buts_texture;
+ ntype->uifunc = node_buts_texture;
break;
case CMP_NODE_DILATEERODE:
- ntype->uifunc= node_composit_buts_dilateerode;
+ ntype->uifunc = node_composit_buts_dilateerode;
break;
case CMP_NODE_OUTPUT_FILE:
- ntype->uifunc= node_composit_buts_file_output;
- ntype->uifuncbut= node_composit_buts_file_output_details;
+ ntype->uifunc = node_composit_buts_file_output;
+ ntype->uifuncbut = node_composit_buts_file_output_details;
ntype->drawinputfunc = node_draw_input_file_output;
break;
case CMP_NODE_DIFF_MATTE:
- ntype->uifunc=node_composit_buts_diff_matte;
+ ntype->uifunc = node_composit_buts_diff_matte;
break;
case CMP_NODE_DIST_MATTE:
- ntype->uifunc=node_composit_buts_distance_matte;
+ ntype->uifunc = node_composit_buts_distance_matte;
break;
case CMP_NODE_COLOR_SPILL:
- ntype->uifunc=node_composit_buts_color_spill;
+ ntype->uifunc = node_composit_buts_color_spill;
break;
case CMP_NODE_CHROMA_MATTE:
- ntype->uifunc=node_composit_buts_chroma_matte;
+ ntype->uifunc = node_composit_buts_chroma_matte;
break;
case CMP_NODE_COLOR_MATTE:
- ntype->uifunc=node_composit_buts_color_matte;
+ ntype->uifunc = node_composit_buts_color_matte;
break;
case CMP_NODE_SCALE:
- ntype->uifunc= node_composit_buts_scale;
+ ntype->uifunc = node_composit_buts_scale;
break;
case CMP_NODE_ROTATE:
- ntype->uifunc=node_composit_buts_rotate;
+ ntype->uifunc = node_composit_buts_rotate;
break;
case CMP_NODE_CHANNEL_MATTE:
- ntype->uifunc= node_composit_buts_channel_matte;
+ ntype->uifunc = node_composit_buts_channel_matte;
break;
case CMP_NODE_LUMA_MATTE:
- ntype->uifunc= node_composit_buts_luma_matte;
+ ntype->uifunc = node_composit_buts_luma_matte;
break;
case CMP_NODE_MAP_UV:
- ntype->uifunc= node_composit_buts_map_uv;
+ ntype->uifunc = node_composit_buts_map_uv;
break;
case CMP_NODE_ID_MASK:
- ntype->uifunc= node_composit_buts_id_mask;
+ ntype->uifunc = node_composit_buts_id_mask;
break;
case CMP_NODE_DOUBLEEDGEMASK:
- ntype->uifunc= node_composit_buts_double_edge_mask;
+ ntype->uifunc = node_composit_buts_double_edge_mask;
break;
case CMP_NODE_MATH:
- ntype->uifunc= node_buts_math;
+ ntype->uifunc = node_buts_math;
break;
case CMP_NODE_INVERT:
- ntype->uifunc= node_composit_buts_invert;
+ ntype->uifunc = node_composit_buts_invert;
break;
case CMP_NODE_PREMULKEY:
- ntype->uifunc= node_composit_buts_premulkey;
+ ntype->uifunc = node_composit_buts_premulkey;
break;
case CMP_NODE_VIEW_LEVELS:
- ntype->uifunc=node_composit_buts_view_levels;
+ ntype->uifunc = node_composit_buts_view_levels;
break;
case CMP_NODE_COLORBALANCE:
- ntype->uifunc=node_composit_buts_colorbalance;
- ntype->uifuncbut=node_composit_buts_colorbalance_but;
+ ntype->uifunc = node_composit_buts_colorbalance;
+ ntype->uifuncbut = node_composit_buts_colorbalance_but;
break;
case CMP_NODE_HUECORRECT:
- ntype->uifunc=node_composit_buts_huecorrect;
+ ntype->uifunc = node_composit_buts_huecorrect;
break;
case CMP_NODE_ZCOMBINE:
- ntype->uifunc=node_composit_buts_zcombine;
+ ntype->uifunc = node_composit_buts_zcombine;
break;
case CMP_NODE_COMBYCCA:
case CMP_NODE_SEPYCCA:
- ntype->uifunc=node_composit_buts_ycc;
+ ntype->uifunc = node_composit_buts_ycc;
break;
case CMP_NODE_MOVIECLIP:
- ntype->uifunc= node_composit_buts_movieclip;
+ ntype->uifunc = node_composit_buts_movieclip;
break;
case CMP_NODE_STABILIZE2D:
- ntype->uifunc= node_composit_buts_stabilize2d;
+ ntype->uifunc = node_composit_buts_stabilize2d;
break;
case CMP_NODE_TRANSFORM:
- ntype->uifunc= node_composit_buts_transform;
+ ntype->uifunc = node_composit_buts_transform;
break;
case CMP_NODE_MOVIEDISTORTION:
- ntype->uifunc= node_composit_buts_moviedistortion;
+ ntype->uifunc = node_composit_buts_moviedistortion;
break;
case CMP_NODE_COLORCORRECTION:
- ntype->uifunc=node_composit_buts_colorcorrection;
- ntype->uifuncbut=node_composit_buts_colorcorrection_but;
+ ntype->uifunc = node_composit_buts_colorcorrection;
+ ntype->uifuncbut = node_composit_buts_colorcorrection_but;
break;
case CMP_NODE_SWITCH:
- ntype->uifunc= node_composit_buts_switch;
+ ntype->uifunc = node_composit_buts_switch;
break;
case CMP_NODE_MASK_BOX:
- ntype->uifunc= node_composit_buts_boxmask;
+ ntype->uifunc = node_composit_buts_boxmask;
ntype->uibackdropfunc = node_composit_backdrop_boxmask;
break;
case CMP_NODE_MASK_ELLIPSE:
- ntype->uifunc= node_composit_buts_ellipsemask;
+ ntype->uifunc = node_composit_buts_ellipsemask;
ntype->uibackdropfunc = node_composit_backdrop_ellipsemask;
break;
case CMP_NODE_BOKEHIMAGE:
- ntype->uifunc= node_composit_buts_bokehimage;
+ ntype->uifunc = node_composit_buts_bokehimage;
break;
case CMP_NODE_VIEWER:
ntype->uifunc = NULL;
- ntype->uifuncbut= node_composit_buts_viewer_but;
+ ntype->uifuncbut = node_composit_buts_viewer_but;
ntype->uibackdropfunc = node_composit_backdrop_viewer;
break;
case CMP_NODE_MASK:
@@ -2588,7 +2588,7 @@ static void node_composit_set_butfunc(bNodeType *ntype)
break;
default:
- ntype->uifunc= NULL;
+ ntype->uifunc = NULL;
}
}
@@ -2598,11 +2598,11 @@ static void node_texture_buts_bricks(uiLayout *layout, bContext *UNUSED(C), Poin
{
uiLayout *col;
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
uiItemR(col, ptr, "offset", 0, "Offset", ICON_NONE);
uiItemR(col, ptr, "offset_frequency", 0, "Frequency", ICON_NONE);
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
uiItemR(col, ptr, "squash", 0, "Squash", ICON_NONE);
uiItemR(col, ptr, "squash_frequency", 0, "Frequency", ICON_NONE);
}
@@ -2610,30 +2610,30 @@ static void node_texture_buts_bricks(uiLayout *layout, bContext *UNUSED(C), Poin
static void node_texture_buts_proc(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
PointerRNA tex_ptr;
- bNode *node= ptr->data;
- ID *id= ptr->id.data;
+ bNode *node = ptr->data;
+ ID *id = ptr->id.data;
Tex *tex = (Tex *)node->storage;
uiLayout *col, *row;
RNA_pointer_create(id, &RNA_Texture, tex, &tex_ptr);
- col= uiLayoutColumn(layout, 0);
+ col = uiLayoutColumn(layout, 0);
- switch ( tex->type ) {
+ switch (tex->type) {
case TEX_BLEND:
uiItemR(col, &tex_ptr, "progression", 0, "", ICON_NONE);
- row= uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
uiItemR(row, &tex_ptr, "use_flip_axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
break;
case TEX_MARBLE:
- row= uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
uiItemR(row, &tex_ptr, "marble_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
- row= uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
uiItemR(row, &tex_ptr, "noise_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
- row= uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
uiItemR(row, &tex_ptr, "noise_basis", 0, "", ICON_NONE);
- row= uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
uiItemR(row, &tex_ptr, "noise_basis_2", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
break;
@@ -2642,9 +2642,9 @@ static void node_texture_buts_proc(uiLayout *layout, bContext *UNUSED(C), Pointe
break;
case TEX_STUCCI:
- row= uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
uiItemR(row, &tex_ptr, "stucci_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
- row= uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
uiItemR(row, &tex_ptr, "noise_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
uiItemR(col, &tex_ptr, "noise_basis", 0, "", ICON_NONE);
break;
@@ -2652,18 +2652,18 @@ static void node_texture_buts_proc(uiLayout *layout, bContext *UNUSED(C), Pointe
case TEX_WOOD:
uiItemR(col, &tex_ptr, "noise_basis", 0, "", ICON_NONE);
uiItemR(col, &tex_ptr, "wood_type", 0, "", ICON_NONE);
- row= uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
uiItemR(row, &tex_ptr, "noise_basis_2", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
- row= uiLayoutRow(col, 0);
- uiLayoutSetActive(row, !(RNA_enum_get(&tex_ptr, "wood_type")==TEX_BAND || RNA_enum_get(&tex_ptr, "wood_type")==TEX_RING));
+ row = uiLayoutRow(col, 0);
+ uiLayoutSetActive(row, !(RNA_enum_get(&tex_ptr, "wood_type") == TEX_BAND || RNA_enum_get(&tex_ptr, "wood_type") == TEX_RING));
uiItemR(row, &tex_ptr, "noise_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
break;
case TEX_CLOUDS:
uiItemR(col, &tex_ptr, "noise_basis", 0, "", ICON_NONE);
- row= uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
uiItemR(row, &tex_ptr, "cloud_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
- row= uiLayoutRow(col, 0);
+ row = uiLayoutRow(col, 0);
uiItemR(row, &tex_ptr, "noise_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
uiItemR(col, &tex_ptr, "noise_depth", UI_ITEM_R_EXPAND, "Depth", ICON_NONE);
break;
@@ -2700,47 +2700,47 @@ static void node_texture_buts_output(uiLayout *layout, bContext *UNUSED(C), Poin
/* only once called */
static void node_texture_set_butfunc(bNodeType *ntype)
{
- if ( ntype->type >= TEX_NODE_PROC && ntype->type < TEX_NODE_PROC_MAX ) {
+ if (ntype->type >= TEX_NODE_PROC && ntype->type < TEX_NODE_PROC_MAX) {
ntype->uifunc = node_texture_buts_proc;
}
else {
switch (ntype->type) {
- case TEX_NODE_MATH:
- ntype->uifunc = node_buts_math;
- break;
+ case TEX_NODE_MATH:
+ ntype->uifunc = node_buts_math;
+ break;
- case TEX_NODE_MIX_RGB:
- ntype->uifunc = node_buts_mix_rgb;
- break;
+ case TEX_NODE_MIX_RGB:
+ ntype->uifunc = node_buts_mix_rgb;
+ break;
- case TEX_NODE_VALTORGB:
- ntype->uifunc = node_buts_colorramp;
- break;
+ case TEX_NODE_VALTORGB:
+ ntype->uifunc = node_buts_colorramp;
+ break;
- case TEX_NODE_CURVE_RGB:
- ntype->uifunc= node_buts_curvecol;
- break;
+ case TEX_NODE_CURVE_RGB:
+ ntype->uifunc = node_buts_curvecol;
+ break;
- case TEX_NODE_CURVE_TIME:
- ntype->uifunc = node_buts_time;
- break;
+ case TEX_NODE_CURVE_TIME:
+ ntype->uifunc = node_buts_time;
+ break;
- case TEX_NODE_TEXTURE:
- ntype->uifunc = node_buts_texture;
- break;
+ case TEX_NODE_TEXTURE:
+ ntype->uifunc = node_buts_texture;
+ break;
- case TEX_NODE_BRICKS:
- ntype->uifunc = node_texture_buts_bricks;
- break;
+ case TEX_NODE_BRICKS:
+ ntype->uifunc = node_texture_buts_bricks;
+ break;
- case TEX_NODE_IMAGE:
- ntype->uifunc = node_texture_buts_image;
- break;
+ case TEX_NODE_IMAGE:
+ ntype->uifunc = node_texture_buts_image;
+ break;
- case TEX_NODE_OUTPUT:
- ntype->uifunc = node_texture_buts_output;
- break;
+ case TEX_NODE_OUTPUT:
+ ntype->uifunc = node_texture_buts_output;
+ break;
}
}
}
@@ -2755,10 +2755,10 @@ void ED_init_node_butfuncs(void)
int i;
/* node type ui functions */
- for (i=0; i < NUM_NTREE_TYPES; ++i) {
+ for (i = 0; i < NUM_NTREE_TYPES; ++i) {
treetype = ntreeGetType(i);
if (treetype) {
- for (ntype= treetype->node_types.first; ntype; ntype= ntype->next) {
+ for (ntype = treetype->node_types.first; ntype; ntype = ntype->next) {
/* default ui functions */
ntype->drawfunc = node_draw_default;
ntype->drawupdatefunc = node_update_default;
@@ -2771,41 +2771,41 @@ void ED_init_node_butfuncs(void)
node_common_set_butfunc(ntype);
switch (i) {
- case NTREE_COMPOSIT:
- node_composit_set_butfunc(ntype);
- break;
- case NTREE_SHADER:
- node_shader_set_butfunc(ntype);
- break;
- case NTREE_TEXTURE:
- node_texture_set_butfunc(ntype);
- break;
+ case NTREE_COMPOSIT:
+ node_composit_set_butfunc(ntype);
+ break;
+ case NTREE_SHADER:
+ node_shader_set_butfunc(ntype);
+ break;
+ case NTREE_TEXTURE:
+ node_texture_set_butfunc(ntype);
+ break;
}
}
}
}
/* socket type ui functions */
- for (i=0; i < NUM_SOCKET_TYPES; ++i) {
+ for (i = 0; i < NUM_SOCKET_TYPES; ++i) {
stype = ntreeGetSocketType(i);
if (stype) {
switch (stype->type) {
- case SOCK_FLOAT:
- case SOCK_INT:
- case SOCK_BOOLEAN:
- stype->buttonfunc = node_socket_button_default;
- break;
- case SOCK_VECTOR:
- stype->buttonfunc = node_socket_button_components;
- break;
- case SOCK_RGBA:
- stype->buttonfunc = node_socket_button_color;
- break;
- case SOCK_SHADER:
- stype->buttonfunc = node_socket_button_label;
- break;
- default:
- stype->buttonfunc = NULL;
+ case SOCK_FLOAT:
+ case SOCK_INT:
+ case SOCK_BOOLEAN:
+ stype->buttonfunc = node_socket_button_default;
+ break;
+ case SOCK_VECTOR:
+ stype->buttonfunc = node_socket_button_components;
+ break;
+ case SOCK_RGBA:
+ stype->buttonfunc = node_socket_button_color;
+ break;
+ case SOCK_SHADER:
+ stype->buttonfunc = node_socket_button_label;
+ break;
+ default:
+ stype->buttonfunc = NULL;
}
}
}
@@ -2816,10 +2816,10 @@ void ED_init_node_butfuncs(void)
void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage)
{
- if ((snode->flag & SNODE_BACKDRAW) && snode->treetype==NTREE_COMPOSIT) {
- Image *ima= BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node");
+ if ((snode->flag & SNODE_BACKDRAW) && snode->treetype == NTREE_COMPOSIT) {
+ Image *ima = BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node");
void *lock;
- ImBuf *ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock);
+ ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
if (ibuf) {
float x, y;
@@ -2829,16 +2829,16 @@ void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage)
glPushMatrix();
/* keep this, saves us from a version patch */
- if (snode->zoom==0.0f) snode->zoom= 1.0f;
+ if (snode->zoom == 0.0f) snode->zoom = 1.0f;
/* somehow the offset has to be calculated inverse */
glaDefine2DArea(&ar->winrct);
/* ortho at pixel level curarea */
- wmOrtho2(-0.375, ar->winx-0.375, -0.375, ar->winy-0.375);
+ wmOrtho2(-0.375, ar->winx - 0.375, -0.375, ar->winy - 0.375);
- x = (ar->winx-snode->zoom*ibuf->x)/2 + snode->xof;
- y = (ar->winy-snode->zoom*ibuf->y)/2 + snode->yof;
+ x = (ar->winx - snode->zoom * ibuf->x) / 2 + snode->xof;
+ y = (ar->winy - snode->zoom * ibuf->y) / 2 + snode->yof;
if (!ibuf->rect) {
if (color_manage)
@@ -2910,8 +2910,8 @@ static void draw_nodespace_back_tex(ScrArea *sa, SpaceNode *snode)
draw_nodespace_grid(snode);
if (snode->flag & SNODE_BACKDRAW) {
- Image *ima= BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node");
- ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
+ Image *ima = BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node");
+ ImBuf *ibuf = BKE_image_get_ibuf(ima, NULL);
if (ibuf) {
int x, y;
float zoom = 1.0;
@@ -2925,20 +2925,20 @@ static void draw_nodespace_back_tex(ScrArea *sa, SpaceNode *snode)
if (ibuf->x > sa->winx || ibuf->y > sa->winy) {
float zoomx, zoomy;
- zoomx= (float)sa->winx/ibuf->x;
- zoomy= (float)sa->winy/ibuf->y;
+ zoomx = (float)sa->winx / ibuf->x;
+ zoomy = (float)sa->winy / ibuf->y;
zoom = MIN2(zoomx, zoomy);
}
- x = (sa->winx-zoom*ibuf->x)/2 + snode->xof;
- y = (sa->winy-zoom*ibuf->y)/2 + snode->yof;
+ x = (sa->winx - zoom * ibuf->x) / 2 + snode->xof;
+ y = (sa->winy - zoom * ibuf->y) / 2 + snode->yof;
glPixelZoom(zoom, zoom);
glColor4f(1.0, 1.0, 1.0, 1.0);
if (ibuf->rect)
glaDrawPixelsTex(x, y, ibuf->x, ibuf->y, GL_UNSIGNED_BYTE, ibuf->rect);
- else if (ibuf->channels==4)
+ else if (ibuf->channels == 4)
glaDrawPixelsTex(x, y, ibuf->x, ibuf->y, GL_FLOAT, ibuf->rect_float);
glPixelZoom(1.0, 1.0);
@@ -2959,50 +2959,50 @@ int node_link_bezier_points(View2D *v2d, SpaceNode *snode, bNodeLink *link, floa
/* in v0 and v3 we put begin/end points */
if (link->fromsock) {
- vec[0][0]= link->fromsock->locx;
- vec[0][1]= link->fromsock->locy;
+ vec[0][0] = link->fromsock->locx;
+ vec[0][1] = link->fromsock->locy;
}
else {
- if (snode==NULL) return 0;
- vec[0][0]= snode->mx;
- vec[0][1]= snode->my;
+ if (snode == NULL) return 0;
+ vec[0][0] = snode->mx;
+ vec[0][1] = snode->my;
}
if (link->tosock) {
- vec[3][0]= link->tosock->locx;
- vec[3][1]= link->tosock->locy;
+ vec[3][0] = link->tosock->locx;
+ vec[3][1] = link->tosock->locy;
}
else {
- if (snode==NULL) return 0;
- vec[3][0]= snode->mx;
- vec[3][1]= snode->my;
+ if (snode == NULL) return 0;
+ vec[3][0] = snode->mx;
+ vec[3][1] = snode->my;
}
- dist= UI_GetThemeValue(TH_NODE_CURVING)*0.10f*ABS(vec[0][0] - vec[3][0]);
+ dist = UI_GetThemeValue(TH_NODE_CURVING) * 0.10f * ABS(vec[0][0] - vec[3][0]);
/* check direction later, for top sockets */
- vec[1][0]= vec[0][0]+dist;
- vec[1][1]= vec[0][1];
+ vec[1][0] = vec[0][0] + dist;
+ vec[1][1] = vec[0][1];
- vec[2][0]= vec[3][0]-dist;
- vec[2][1]= vec[3][1];
+ vec[2][0] = vec[3][0] - dist;
+ vec[2][1] = vec[3][1];
- if (v2d && MIN4(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) > v2d->cur.xmax); /* clipped */
- else if (v2d && MAX4(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) < v2d->cur.xmin); /* clipped */
+ if (v2d && MIN4(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) > v2d->cur.xmax) ; /* clipped */
+ else if (v2d && MAX4(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) < v2d->cur.xmin) ; /* clipped */
else {
/* always do all three, to prevent data hanging around */
- BKE_curve_forward_diff_bezier(vec[0][0], vec[1][0], vec[2][0], vec[3][0], coord_array[0], resol, sizeof(float)*2);
- BKE_curve_forward_diff_bezier(vec[0][1], vec[1][1], vec[2][1], vec[3][1], coord_array[0]+1, resol, sizeof(float)*2);
+ BKE_curve_forward_diff_bezier(vec[0][0], vec[1][0], vec[2][0], vec[3][0], coord_array[0], resol, sizeof(float) * 2);
+ BKE_curve_forward_diff_bezier(vec[0][1], vec[1][1], vec[2][1], vec[3][1], coord_array[0] + 1, resol, sizeof(float) * 2);
return 1;
}
return 0;
}
-#define LINK_RESOL 24
-void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int th_col1, int do_shaded, int th_col2, int do_triple, int th_col3 )
+#define LINK_RESOL 24
+void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int th_col1, int do_shaded, int th_col2, int do_triple, int th_col3)
{
- float coord_array[LINK_RESOL+1][2];
+ float coord_array[LINK_RESOL + 1][2];
if (node_link_bezier_points(v2d, snode, link, coord_array, LINK_RESOL)) {
float dist, spline_step = 0.0f;
@@ -3013,7 +3013,7 @@ void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int t
glGetFloatv(GL_LINE_WIDTH, &linew);
/* we can reuse the dist variable here to increment the GL curve eval amount*/
- dist = 1.0f/(float)LINK_RESOL;
+ dist = 1.0f / (float)LINK_RESOL;
glEnable(GL_LINE_SMOOTH);
@@ -3022,7 +3022,7 @@ void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int t
glLineWidth(4.0f);
glBegin(GL_LINE_STRIP);
- for (i=0; i<=LINK_RESOL; i++) {
+ for (i = 0; i <= LINK_RESOL; i++) {
glVertex2fv(coord_array[i]);
}
glEnd();
@@ -3035,12 +3035,12 @@ void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int t
glLineWidth(1.5f);
if (do_shaded) {
glBegin(GL_LINES);
- for (i=0; i<LINK_RESOL; i++) {
+ for (i = 0; i < LINK_RESOL; i++) {
UI_ThemeColorBlend(th_col1, th_col2, spline_step);
glVertex2fv(coord_array[i]);
- UI_ThemeColorBlend(th_col1, th_col2, spline_step+dist);
- glVertex2fv(coord_array[i+1]);
+ UI_ThemeColorBlend(th_col1, th_col2, spline_step + dist);
+ glVertex2fv(coord_array[i + 1]);
spline_step += dist;
}
@@ -3049,7 +3049,7 @@ void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int t
else {
UI_ThemeColor(th_col1);
glBegin(GL_LINE_STRIP);
- for (i=0; i<=LINK_RESOL; i++) {
+ for (i = 0; i <= LINK_RESOL; i++) {
glVertex2fv(coord_array[i]);
}
glEnd();
@@ -3065,26 +3065,26 @@ void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int t
static void node_link_straight_points(View2D *UNUSED(v2d), SpaceNode *snode, bNodeLink *link, float coord_array[][2])
{
if (link->fromsock) {
- coord_array[0][0]= link->fromsock->locx;
- coord_array[0][1]= link->fromsock->locy;
+ coord_array[0][0] = link->fromsock->locx;
+ coord_array[0][1] = link->fromsock->locy;
}
else {
- if (snode==NULL) return;
- coord_array[0][0]= snode->mx;
- coord_array[0][1]= snode->my;
+ if (snode == NULL) return;
+ coord_array[0][0] = snode->mx;
+ coord_array[0][1] = snode->my;
}
if (link->tosock) {
- coord_array[1][0]= link->tosock->locx;
- coord_array[1][1]= link->tosock->locy;
+ coord_array[1][0] = link->tosock->locx;
+ coord_array[1][1] = link->tosock->locy;
}
else {
- if (snode==NULL) return;
- coord_array[1][0]= snode->mx;
- coord_array[1][1]= snode->my;
+ if (snode == NULL) return;
+ coord_array[1][0] = snode->mx;
+ coord_array[1][1] = snode->my;
}
}
-void node_draw_link_straight(View2D *v2d, SpaceNode *snode, bNodeLink *link, int th_col1, int do_shaded, int th_col2, int do_triple, int th_col3 )
+void node_draw_link_straight(View2D *v2d, SpaceNode *snode, bNodeLink *link, int th_col1, int do_shaded, int th_col2, int do_triple, int th_col3)
{
float coord_array[2][2];
float linew;
@@ -3116,22 +3116,22 @@ void node_draw_link_straight(View2D *v2d, SpaceNode *snode, bNodeLink *link, int
*/
if (do_shaded) {
glBegin(GL_LINES);
- for (i=0; i < LINK_RESOL-1; ++i) {
- float t= (float)i/(float)(LINK_RESOL-1);
+ for (i = 0; i < LINK_RESOL - 1; ++i) {
+ float t = (float)i / (float)(LINK_RESOL - 1);
UI_ThemeColorBlend(th_col1, th_col2, t);
- glVertex2f((1.0f-t)*coord_array[0][0]+t*coord_array[1][0], (1.0f-t)*coord_array[0][1]+t*coord_array[1][1]);
+ glVertex2f((1.0f - t) * coord_array[0][0] + t * coord_array[1][0], (1.0f - t) * coord_array[0][1] + t * coord_array[1][1]);
- t= (float)(i+1)/(float)(LINK_RESOL-1);
+ t = (float)(i + 1) / (float)(LINK_RESOL - 1);
UI_ThemeColorBlend(th_col1, th_col2, t);
- glVertex2f((1.0f-t)*coord_array[0][0]+t*coord_array[1][0], (1.0f-t)*coord_array[0][1]+t*coord_array[1][1]);
+ glVertex2f((1.0f - t) * coord_array[0][0] + t * coord_array[1][0], (1.0f - t) * coord_array[0][1] + t * coord_array[1][1]);
}
glEnd();
}
else {
glBegin(GL_LINE_STRIP);
- for (i=0; i < LINK_RESOL; ++i) {
- float t= (float)i/(float)(LINK_RESOL-1);
- glVertex2f((1.0f-t)*coord_array[0][0]+t*coord_array[1][0], (1.0f-t)*coord_array[0][1]+t*coord_array[1][1]);
+ for (i = 0; i < LINK_RESOL; ++i) {
+ float t = (float)i / (float)(LINK_RESOL - 1);
+ glVertex2f((1.0f - t) * coord_array[0][0] + t * coord_array[1][0], (1.0f - t) * coord_array[0][1] + t * coord_array[1][1]);
}
glEnd();
}
@@ -3145,10 +3145,10 @@ void node_draw_link_straight(View2D *v2d, SpaceNode *snode, bNodeLink *link, int
/* note; this is used for fake links in groups too */
void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link)
{
- int do_shaded= FALSE, th_col1= TH_HEADER, th_col2= TH_HEADER;
- int do_triple= FALSE, th_col3= TH_WIRE;
+ int do_shaded = FALSE, th_col1 = TH_HEADER, th_col2 = TH_HEADER;
+ int do_triple = FALSE, th_col3 = TH_WIRE;
- if (link->fromsock==NULL && link->tosock==NULL)
+ if (link->fromsock == NULL && link->tosock == NULL)
return;
/* new connection */
@@ -3170,17 +3170,17 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link)
}
else {
/* check cyclic */
- if ((link->fromnode->level >= link->tonode->level && link->tonode->level!=0xFFF) && (link->flag & NODE_LINK_VALID)) {
+ if ((link->fromnode->level >= link->tonode->level && link->tonode->level != 0xFFF) && (link->flag & NODE_LINK_VALID)) {
/* special indicated link, on drop-node */
if (link->flag & NODE_LINKFLAG_HILITE) {
- th_col1= th_col2= TH_ACTIVE;
+ th_col1 = th_col2 = TH_ACTIVE;
}
else {
/* regular link */
if (link->fromnode->flag & SELECT)
- th_col1= TH_EDGE_SELECT;
+ th_col1 = TH_EDGE_SELECT;
if (link->tonode->flag & SELECT)
- th_col2= TH_EDGE_SELECT;
+ th_col2 = TH_EDGE_SELECT;
}
do_shaded = TRUE;
do_triple = TRUE;
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index d8d10519bd6..f73c031dc7f 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -110,7 +110,7 @@ typedef struct TreeElement {
/* get TreeStoreElem associated with a TreeElement
* < a: (TreeElement) tree element to find stored element for
*/
-#define TREESTORE(a) ((a) ? soops->treestore->data + (a)->store_index : NULL)
+#define TREESTORE(a) (soops->treestore->data + (a)->store_index)
/* size constants */
#define OL_Y_OFFSET 2
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 8a31305d65e..097823135f3 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -132,6 +132,14 @@ static void outliner_storage_cleanup(SpaceOops *soops)
}
}
+/* XXX - THIS FUNCTION IS INCREDIBLY SLOW
+ * ... it can bring blenders tools and viewport to a grinding halt becuase of searching
+ * for duplicate items every times they are added.
+ *
+ * TODO (possible speedups)
+ * - use a hash for duplicate (could even store a hash per type)
+ * - use mempool for TreeElements
+ * */
static void check_persistent(SpaceOops *soops, TreeElement *te, ID *id, short type, short nr)
{
TreeStore *ts;
@@ -147,8 +155,8 @@ static void check_persistent(SpaceOops *soops, TreeElement *te, ID *id, short ty
/* check if 'te' is in treestore */
tselem = ts->data;
for (a = 0; a < ts->usedelem; a++, tselem++) {
- if (tselem->id == id && tselem->used == 0) {
- if ((type == 0 && tselem->type == 0) || (tselem->type == type && tselem->nr == nr)) {
+ if ((tselem->used == 0) && (tselem->type == type) && (tselem->id == id)) {
+ if ((type == 0) || (tselem->nr == nr)) {
te->store_index = a;
tselem->used = 1;
return;
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 43de6126ffb..d22b3125987 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -2953,7 +2953,7 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, BMEditMesh *em, UnitS
else \
BLI_snprintf(numstr, sizeof(numstr), conv_float, area); \
view3d_cached_text_draw_add(vmid, numstr, 0, txt_flag, col); \
- }
+ } (void)0
UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEAREA, col);
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index f09310e53c7..4c6ead3d3f4 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -1660,7 +1660,7 @@ static int gpu_count_grid_quads(BLI_bitmap *grid_hidden,
glDeleteBuffersARB(1, &(buffer_)); \
(buffer_) = 0; \
} \
- }
+ } (void)0
/* end FILL_QUAD_BUFFER */
static GLuint gpu_get_grid_buffer(int gridsize, GLenum *index_type, unsigned *totquad)
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index 45d2d16d794..2370dbeebc5 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -49,7 +49,7 @@
{ \
if (fcc == 0) { fcc = mmioFOURCC('N', 'o', 'n', 'e'); } \
if (fcc == BI_RLE8) { fcc = mmioFOURCC('R', 'l', 'e', '8'); } \
- }
+ } (void)0
#endif
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index 3af853ba150..7d1d5906dd8 100644
--- a/source/blender/imbuf/intern/jp2.c
+++ b/source/blender/imbuf/intern/jp2.c
@@ -345,7 +345,7 @@ static void cinema_parameters(opj_cparameters_t *parameters)
parameters->image_offset_x0 = 0;
parameters->image_offset_y0 = 0;
- /*Codeblock size= 32*32*/
+ /*Codeblock size = 32 * 32*/
parameters->cblockw_init = 32;
parameters->cblockh_init = 32;
parameters->csty |= 0x01;
diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c
index 1a96e55e3d1..47555302a59 100644
--- a/source/blender/imbuf/intern/jpeg.c
+++ b/source/blender/imbuf/intern/jpeg.c
@@ -223,7 +223,7 @@ static void memory_source(j_decompress_ptr cinfo, unsigned char *buffer, size_t
if (! (*datasrc->fill_input_buffer) (cinfo)) \
{ action; } \
INPUT_RELOAD(cinfo); \
- }
+ } (void)0
/* Read a byte into variable V.
diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c
index bf75995fd9c..0260ed46b00 100644
--- a/source/blender/imbuf/intern/targa.c
+++ b/source/blender/imbuf/intern/targa.c
@@ -549,7 +549,7 @@ ImBuf *imb_loadtarga(unsigned char *mem, size_t mem_size, int flags)
TARGA tga;
struct ImBuf *ibuf;
int col, count, size;
- unsigned int *rect, *cmap = NULL /*, mincol= 0*/, maxcol = 0;
+ unsigned int *rect, *cmap = NULL /*, mincol = 0*/, maxcol = 0;
uchar *cp = (uchar *) &col;
if (checktarga(&tga, mem) == 0) return(NULL);
diff --git a/source/blender/makesdna/intern/CMakeLists.txt b/source/blender/makesdna/intern/CMakeLists.txt
index f8169d5038a..1dd1d7e8f87 100644
--- a/source/blender/makesdna/intern/CMakeLists.txt
+++ b/source/blender/makesdna/intern/CMakeLists.txt
@@ -1,4 +1,3 @@
-# -*- mode: cmake; indent-tabs-mode: t; -*-
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c
index 231dd521f07..2498cba42ef 100644
--- a/source/blender/makesdna/intern/dna_genfile.c
+++ b/source/blender/makesdna/intern/dna_genfile.c
@@ -93,7 +93,7 @@ typedef long long __int64;
* !!Remember to read/write integer and short aligned!!
*
* While writing a file, the names of a struct is indicated with a type number,
- * to be found with: type= findstruct_nr(SDNA *, char *)
+ * to be found with: type = findstruct_nr(SDNA *, char *)
* The value of 'type' corresponds with the the index within the structs array
*
* For the moment: the complete DNA file is included in a .blend file. For
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index bce8f9bb2bc..b0f8f02ae9f 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -146,7 +146,7 @@ static char **names, *namedata; /* at address names[a] is string a */
static char **types, *typedata; /* at address types[a] is string a */
static short *typelens; /* at typelens[a] is de length of type a */
static short *alphalens; /* contains sizes as they are calculated on the DEC Alpha (64 bits), in fact any 64bit system */
-static short **structs, *structdata; /* at sp= structs[a] is the first address of a struct definition
+static short **structs, *structdata; /* at sp = structs[a] is the first address of a struct definition
* sp[0] is type number
* sp[1] is amount of elements
* sp[2] sp[3] is typenr, namenr (etc) */
@@ -910,7 +910,7 @@ void printStructLengths(void)
printf("\n\n*** All detected structs:\n");
while (unknown) {
- /*lastunknown= unknown;*/ /*UNUSED*/
+ /*lastunknown = unknown;*/ /*UNUSED*/
unknown = 0;
/* check all structs... */
@@ -1171,7 +1171,7 @@ int main(int argc, char **argv)
}
else {
fprintf(file, "};\n");
- fprintf(file, "int DNAlen= sizeof(DNAstr);\n");
+ fprintf(file, "int DNAlen = sizeof(DNAstr);\n");
fclose(file);
}
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index 71c03858d00..e7f9977d040 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -1,4 +1,3 @@
-# -*- mode: cmake; indent-tabs-mode: t; -*-
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 3d92f6b0ec1..7ee89028c94 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -627,31 +627,31 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr
if (dp->dnaarraylength == 1) {
if (prop->type == PROP_BOOLEAN && dp->booleanbit) {
- fprintf(f, " values[i]= %s((data->%s & (%d<<i)) != 0);\n",
+ fprintf(f, " values[i] = %s((data->%s & (%d<<i)) != 0);\n",
(dp->booleannegative) ? "!" : "", dp->dnaname, dp->booleanbit);
}
else {
- fprintf(f, " values[i]= (%s)%s((&data->%s)[i]);\n",
+ fprintf(f, " values[i] = (%s)%s((&data->%s)[i]);\n",
rna_type_type(prop), (dp->booleannegative) ? "!" : "", dp->dnaname);
}
}
else {
if (prop->type == PROP_BOOLEAN && dp->booleanbit) {
- fprintf(f, " values[i]= %s((data->%s[i] & ", (dp->booleannegative) ? "!" : "",
+ fprintf(f, " values[i] = %s((data->%s[i] & ", (dp->booleannegative) ? "!" : "",
dp->dnaname);
rna_int_print(f, dp->booleanbit);
fprintf(f, ") != 0);\n");
}
else if (rna_color_quantize(prop, dp)) {
- fprintf(f, " values[i]= (%s)(data->%s[i]*(1.0f/255.0f));\n",
+ fprintf(f, " values[i] = (%s)(data->%s[i]*(1.0f/255.0f));\n",
rna_type_type(prop), dp->dnaname);
}
else if (dp->dnatype) {
- fprintf(f, " values[i]= (%s)%s(((%s*)data->%s)[i]);\n",
+ fprintf(f, " values[i] = (%s)%s(((%s*)data->%s)[i]);\n",
rna_type_type(prop), (dp->booleannegative) ? "!" : "", dp->dnatype, dp->dnaname);
}
else {
- fprintf(f, " values[i]= (%s)%s((data->%s)[i]);\n",
+ fprintf(f, " values[i] = (%s)%s((data->%s)[i]);\n",
rna_type_type(prop), (dp->booleannegative) ? "!" : "", dp->dnaname);
}
}
@@ -839,7 +839,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
}
}
- fprintf(f, " data->%s= value.data;\n", dp->dnaname);
+ fprintf(f, " data->%s = value.data;\n", dp->dnaname);
}
fprintf(f, "}\n\n");
@@ -882,7 +882,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
fprintf(f, " else data->%s &= ~(%d<<i);\n", dp->dnaname, dp->booleanbit);
}
else {
- fprintf(f, " (&data->%s)[i]= %s", dp->dnaname, (dp->booleannegative) ? "!" : "");
+ fprintf(f, " (&data->%s)[i] = %s", dp->dnaname, (dp->booleannegative) ? "!" : "");
rna_clamp_value(f, prop, 1);
}
}
@@ -897,14 +897,14 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
fprintf(f, ";\n");
}
else if (rna_color_quantize(prop, dp)) {
- fprintf(f, " data->%s[i]= FTOCHAR(values[i]);\n", dp->dnaname);
+ fprintf(f, " data->%s[i] = FTOCHAR(values[i]);\n", dp->dnaname);
}
else {
if (dp->dnatype)
- fprintf(f, " ((%s*)data->%s)[i]= %s", dp->dnatype, dp->dnaname,
+ fprintf(f, " ((%s*)data->%s)[i] = %s", dp->dnatype, dp->dnaname,
(dp->booleannegative) ? "!" : "");
else
- fprintf(f, " (data->%s)[i]= %s", dp->dnaname, (dp->booleannegative) ? "!" : "");
+ fprintf(f, " (data->%s)[i] = %s", dp->dnaname, (dp->booleannegative) ? "!" : "");
rna_clamp_value(f, prop, 1);
}
}
@@ -937,7 +937,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr
}
else {
rna_clamp_value_range(f, prop);
- fprintf(f, " data->%s= %s", dp->dnaname, (dp->booleannegative) ? "!" : "");
+ fprintf(f, " data->%s = %s", dp->dnaname, (dp->booleannegative) ? "!" : "");
rna_clamp_value(f, prop, 0);
}
}
@@ -1775,7 +1775,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
else {
data_str = "_data";
}
- fprintf(f, "\t%s= ", dparm->prop->identifier);
+ fprintf(f, "\t%s = ", dparm->prop->identifier);
if (!pout)
fprintf(f, "%s", valstr);
@@ -1785,13 +1785,13 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
}
if (dparm->next)
- fprintf(f, "\t_data+= %d;\n", rna_parameter_size_alloc(dparm->prop));
+ fprintf(f, "\t_data += %d;\n", rna_parameter_size_alloc(dparm->prop));
}
if (dfunc->call) {
fprintf(f, "\t\n");
fprintf(f, "\t");
- if (func->c_ret) fprintf(f, "%s= ", func->c_ret->identifier);
+ if (func->c_ret) fprintf(f, "%s = ", func->c_ret->identifier);
fprintf(f, "%s(", dfunc->call);
first = 1;
@@ -1845,7 +1845,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
dparm = rna_find_parameter_def(func->c_ret);
ptrstr = (((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR)) ||
(dparm->prop->arraydimension)) ? "*" : "";
- fprintf(f, "\t*((%s%s%s*)_retdata)= %s;\n", rna_type_struct(dparm->prop),
+ fprintf(f, "\t*((%s%s%s*)_retdata) = %s;\n", rna_type_struct(dparm->prop),
rna_parameter_type_name(dparm->prop), ptrstr, func->c_ret->identifier);
}
}
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 7676f4a5866..6f26763fc0e 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -642,7 +642,7 @@ int RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test)
RNA_PROP_BEGIN(ptr, itemptr, iterprop)
{
- /* PropertyRNA *prop= itemptr.data; */
+ /* PropertyRNA *prop = itemptr.data; */
if (prop_test == (PropertyRNA *)itemptr.data) {
found = TRUE;
break;
@@ -2561,7 +2561,7 @@ void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr
BLI_assert(RNA_property_type(prop) == PROP_POINTER);
- if ((/*idprop=*/ rna_idproperty_check(&prop, ptr))) {
+ if ((/*idprop = */ rna_idproperty_check(&prop, ptr))) {
/* not supported */
/* rna_idproperty_touch(idprop); */
}
@@ -2579,7 +2579,7 @@ void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr
PointerRNA RNA_property_pointer_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop))
{
- /*PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop; */
+ /*PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop; */
/* BLI_assert(RNA_property_type(prop) == PROP_POINTER); */
@@ -2718,7 +2718,7 @@ int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr)
{
IDProperty *idprop;
-/* CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; */
+/* CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop; */
BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
@@ -2777,7 +2777,7 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA
int RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key)
{
IDProperty *idprop;
-/* CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; */
+/* CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop; */
BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
@@ -3031,7 +3031,7 @@ int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, Proper
case PROP_RAW_DOUBLE: var = (dtype)((double*)raw.array)[a]; break; \
default: var = (dtype)0; \
} \
-}
+} (void)0
#define RAW_SET(dtype, raw, a, var) \
{ \
@@ -3043,7 +3043,7 @@ int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, Proper
case PROP_RAW_DOUBLE: ((double*)raw.array)[a] = (double)var; break; \
default: break; \
} \
-}
+} (void)0
int RNA_raw_type_sizeof(RawPropertyType type)
{
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index 381d0f46c28..9a69cfc7f15 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -179,7 +179,7 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
MEM_freeN(texture_path); \
} \
} \
-}
+} (void)0
/* determine the path from the ID-block to the ramp */
/* FIXME: this is a very slow way to do it, but it will have to suffice... */
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 09cbf8bd90a..7d73de00b49 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -64,7 +64,7 @@ BlenderDefRNA DefRNA = {NULL, {NULL, NULL}, {NULL, NULL}, NULL, 0, 0, 0, 1};
fprintf(stderr, "%s: '%s' '%s' description ends with a '.' !\n", \
__func__, id1 ? id1 : "", id2 ? id2 : ""); \
} \
- } \
+ } (void)0
#else
# define DESCR_CHECK(description, id1, id2)
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index d827799926e..955aac83a5c 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -4005,6 +4005,8 @@ static void rna_def_composite_nodetree(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Node");
RNA_def_property_ui_text(prop, "Nodes", "");
+ rna_def_composite_nodetree_api(brna, prop);
+
prop = RNA_def_property(srna, "render_quality", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "render_quality");
RNA_def_property_enum_items(prop, node_quality_items);
@@ -4023,8 +4025,6 @@ static void rna_def_composite_nodetree(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_opencl", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NTREE_COM_OPENCL);
RNA_def_property_ui_text(prop, "OpenCL", "Enable GPU calculations");
-
- rna_def_composite_nodetree_api(brna, prop);
}
static void rna_def_shader_nodetree(BlenderRNA *brna)
diff --git a/source/blender/nodes/composite/node_composite_util.c b/source/blender/nodes/composite/node_composite_util.c
index 0d1840a7a7d..3806cf4543a 100644
--- a/source/blender/nodes/composite/node_composite_util.c
+++ b/source/blender/nodes/composite/node_composite_util.c
@@ -1349,7 +1349,7 @@ void IIR_gauss(CompBuf* src, float sigma, int chan, int xy)
Y[L-3] = cf[0]*W[L-3] + cf[1]*Y[L-2] + cf[2]*Y[L-1] + cf[3]*tsv[0]; \
for (i=L-4; i>=0; i--) \
Y[i] = cf[0]*W[i] + cf[1]*Y[i+1] + cf[2]*Y[i+2] + cf[3]*Y[i+3]; \
-}
+} (void)0
// intermediate buffers
sz = MAX2(src->x, src->y);
diff --git a/source/blender/nodes/intern/node_common.c b/source/blender/nodes/intern/node_common.c
index fa1af821a2d..48ffed80e41 100644
--- a/source/blender/nodes/intern/node_common.c
+++ b/source/blender/nodes/intern/node_common.c
@@ -293,8 +293,8 @@ int node_group_ungroup(bNodeTree *ntree, bNode *gnode)
BLI_remlink(&wgroup->nodes, node);
BLI_addtail(&ntree->nodes, node);
- node->locx+= gnode->locx;
- node->locy+= gnode->locy;
+ node->locx += gnode->locx;
+ node->locy += gnode->locy;
node->flag |= NODE_SELECT;
}
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index 77ccf802663..f8609859251 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -304,7 +304,7 @@ static int py_long_as_int(PyObject *py_long, int *r_int)
if (PyErr_Occurred()) \
return NULL; \
return bpy_prop_deferred_return(pymeth_##_func, kw); \
- } \
+ } (void)0
/* terse macros for error checks shared between all funcs cant use function
* calls because of static strins passed to pyrna_set_to_enum_bitfield */
@@ -327,10 +327,10 @@ static int py_long_as_int(PyObject *py_long, int *r_int)
#_func"(options={ ...}):")) \
{ \
return NULL; \
- } \
+ } (void)0
#define BPY_PROPDEF_SUBTYPE_CHECK(_func, _property_flag_items, _subtype) \
- BPY_PROPDEF_CHECK(_func, _property_flag_items) \
+ BPY_PROPDEF_CHECK(_func, _property_flag_items); \
if (pysubtype && RNA_enum_value_from_id(_subtype, \
pysubtype, \
&subtype) == 0) \
@@ -339,7 +339,7 @@ static int py_long_as_int(PyObject *py_long, int *r_int)
#_func"(subtype='%s'): invalid subtype", \
pysubtype); \
return NULL; \
- } \
+ } (void)0
#define BPY_PROPDEF_NAME_DOC \
@@ -397,7 +397,7 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
- BPY_PROPDEF_HEAD(BoolProperty)
+ BPY_PROPDEF_HEAD(BoolProperty);
if (srna) {
static const char *kwlist[] = {"attr", "name", "description", "default",
@@ -422,7 +422,7 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
return NULL;
}
- BPY_PROPDEF_SUBTYPE_CHECK(BoolProperty, property_flag_items, property_subtype_number_items)
+ BPY_PROPDEF_SUBTYPE_CHECK(BoolProperty, property_flag_items, property_subtype_number_items);
if (bpy_prop_callback_check(update_cb, 2) == -1) {
return NULL;
@@ -474,7 +474,7 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject
{
StructRNA *srna;
- BPY_PROPDEF_HEAD(BoolVectorProperty)
+ BPY_PROPDEF_HEAD(BoolVectorProperty);
if (srna) {
static const char *kwlist[] = {"attr", "name", "description", "default",
@@ -501,7 +501,7 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject
return NULL;
}
- BPY_PROPDEF_SUBTYPE_CHECK(BoolVectorProperty, property_flag_items, property_subtype_array_items)
+ BPY_PROPDEF_SUBTYPE_CHECK(BoolVectorProperty, property_flag_items, property_subtype_array_items);
if (size < 1 || size > PYRNA_STACK_ARRAY) {
PyErr_Format(PyExc_TypeError,
@@ -561,7 +561,7 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
- BPY_PROPDEF_HEAD(IntProperty)
+ BPY_PROPDEF_HEAD(IntProperty);
if (srna) {
static const char *kwlist[] = {"attr", "name", "description", "default",
@@ -588,7 +588,7 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
return NULL;
}
- BPY_PROPDEF_SUBTYPE_CHECK(IntProperty, property_flag_items, property_subtype_number_items)
+ BPY_PROPDEF_SUBTYPE_CHECK(IntProperty, property_flag_items, property_subtype_number_items);
if (bpy_prop_callback_check(update_cb, 2) == -1) {
return NULL;
@@ -643,7 +643,7 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject
{
StructRNA *srna;
- BPY_PROPDEF_HEAD(IntVectorProperty)
+ BPY_PROPDEF_HEAD(IntVectorProperty);
if (srna) {
static const char *kwlist[] = {"attr", "name", "description", "default",
@@ -674,7 +674,7 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject
return NULL;
}
- BPY_PROPDEF_SUBTYPE_CHECK(IntVectorProperty, property_flag_items, property_subtype_array_items)
+ BPY_PROPDEF_SUBTYPE_CHECK(IntVectorProperty, property_flag_items, property_subtype_array_items);
if (size < 1 || size > PYRNA_STACK_ARRAY) {
PyErr_Format(PyExc_TypeError,
@@ -738,7 +738,7 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
- BPY_PROPDEF_HEAD(FloatProperty)
+ BPY_PROPDEF_HEAD(FloatProperty);
if (srna) {
static const char *kwlist[] = {"attr", "name", "description", "default",
@@ -769,7 +769,7 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
return NULL;
}
- BPY_PROPDEF_SUBTYPE_CHECK(FloatProperty, property_flag_items, property_subtype_number_items)
+ BPY_PROPDEF_SUBTYPE_CHECK(FloatProperty, property_flag_items, property_subtype_number_items);
if (pyunit && RNA_enum_value_from_id(property_unit_items, pyunit, &unit) == 0) {
PyErr_Format(PyExc_TypeError, "FloatProperty(unit='%s'): invalid unit", pyunit);
@@ -832,7 +832,7 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec
{
StructRNA *srna;
- BPY_PROPDEF_HEAD(FloatVectorProperty)
+ BPY_PROPDEF_HEAD(FloatVectorProperty);
if (srna) {
static const char *kwlist[] = {"attr", "name", "description", "default",
@@ -865,7 +865,7 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec
return NULL;
}
- BPY_PROPDEF_SUBTYPE_CHECK(FloatVectorProperty, property_flag_items, property_subtype_array_items)
+ BPY_PROPDEF_SUBTYPE_CHECK(FloatVectorProperty, property_flag_items, property_subtype_array_items);
if (pyunit && RNA_enum_value_from_id(property_unit_items, pyunit, &unit) == 0) {
PyErr_Format(PyExc_TypeError, "FloatVectorProperty(unit='%s'): invalid unit", pyunit);
@@ -928,7 +928,7 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw
{
StructRNA *srna;
- BPY_PROPDEF_HEAD(StringProperty)
+ BPY_PROPDEF_HEAD(StringProperty);
if (srna) {
static const char *kwlist[] = {"attr", "name", "description", "default",
@@ -953,7 +953,7 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw
return NULL;
}
- BPY_PROPDEF_SUBTYPE_CHECK(StringProperty, property_flag_items, property_subtype_string_items)
+ BPY_PROPDEF_SUBTYPE_CHECK(StringProperty, property_flag_items, property_subtype_string_items);
if (bpy_prop_callback_check(update_cb, 2) == -1) {
return NULL;
@@ -1235,7 +1235,7 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
- BPY_PROPDEF_HEAD(EnumProperty)
+ BPY_PROPDEF_HEAD(EnumProperty);
if (srna) {
static const char *kwlist[] = {"attr", "items", "name", "description", "default",
@@ -1262,7 +1262,7 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
return NULL;
}
- BPY_PROPDEF_CHECK(EnumProperty, property_flag_enum_items)
+ BPY_PROPDEF_CHECK(EnumProperty, property_flag_enum_items);
if (bpy_prop_callback_check(update_cb, 2) == -1) {
return NULL;
@@ -1385,7 +1385,7 @@ static PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *k
{
StructRNA *srna;
- BPY_PROPDEF_HEAD(PointerProperty)
+ BPY_PROPDEF_HEAD(PointerProperty);
if (srna) {
static const char *kwlist[] = {"attr", "type", "name", "description", "options", "update", NULL};
@@ -1408,7 +1408,7 @@ static PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *k
return NULL;
}
- BPY_PROPDEF_CHECK(PointerProperty, property_flag_items)
+ BPY_PROPDEF_CHECK(PointerProperty, property_flag_items);
ptype = pointer_type_from_py(type, "PointerProperty(...):");
if (!ptype)
@@ -1450,7 +1450,7 @@ static PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject
{
StructRNA *srna;
- BPY_PROPDEF_HEAD(CollectionProperty)
+ BPY_PROPDEF_HEAD(CollectionProperty);
if (srna) {
static const char *kwlist[] = {"attr", "type", "name", "description", "options", NULL};
@@ -1471,7 +1471,7 @@ static PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject
return NULL;
}
- BPY_PROPDEF_CHECK(CollectionProperty, property_flag_items)
+ BPY_PROPDEF_CHECK(CollectionProperty, property_flag_items);
ptype = pointer_type_from_py(type, "CollectionProperty(...):");
if (!ptype)
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index fe18fd040eb..6ad1874297f 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -2046,7 +2046,7 @@ static int pyrna_prop_collection_bool(BPy_PropertyRNA *self)
"bpy_prop_collection[%d]: out of range.", keynum); \
return ret_err; \
} \
- } \
+ } (void)0
/* internal use only */
@@ -6856,7 +6856,7 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun
} \
} \
Py_XDECREF(item); \
- } \
+ } (void)0
BPY_REPLACEMENT_STRING("bl_idname", "__name__");
diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c
index 02d342754ea..7e0744096b3 100644
--- a/source/blender/render/intern/source/strand.c
+++ b/source/blender/render/intern/source/strand.c
@@ -569,10 +569,10 @@ static void do_strand_fillac(void *handle, int x, int y, float u, float v, float
#define CHECK_ADD(n) \
if (apn->p[n]==strnr && apn->obi[n]==obi && apn->seg[n]==seg) \
- { if (!(apn->mask[n] & mask)) { apn->mask[n] |= mask; apn->v[n] += t; apn->u[n] += s; } break; }
+ { if (!(apn->mask[n] & mask)) { apn->mask[n] |= mask; apn->v[n] += t; apn->u[n] += s; } break; } (void)0
#define CHECK_ASSIGN(n) \
if (apn->p[n]==0) \
- {apn->obi[n]= obi; apn->p[n]= strnr; apn->z[n]= zverg; apn->mask[n]= mask; apn->v[n]= t; apn->u[n]= s; apn->seg[n]= seg; break; }
+ {apn->obi[n]= obi; apn->p[n]= strnr; apn->z[n]= zverg; apn->mask[n]= mask; apn->v[n]= t; apn->u[n]= s; apn->seg[n]= seg; break; } (void)0
/* add to pixel list */
if (zverg < bufferz && (spart->totapixbuf[offset] < MAX_ZROW)) {
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index f97391c0d6e..039f3bff4d1 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -300,7 +300,7 @@ void WM_timecursor(wmWindow *win, int nr)
* (3 bytes = 17 bits rounded up to nearest whole byte). Pad extra bits
* in mask with 0's.
*
- * Setting big_bm=NULL disables the large version of the cursor.
+ * Setting big_bm = NULL disables the large version of the cursor.
*
* *******************************************************************
*
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index fccd3b387f9..5f2d9c6fb54 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -831,7 +831,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P
return WM_operator_poll(C, ot);
if (WM_operator_poll(C, ot)) {
- wmOperator *op = wm_operator_create(wm, ot, properties, reports); /* if reports==NULL, theyll be initialized */
+ wmOperator *op = wm_operator_create(wm, ot, properties, reports); /* if reports == NULL, they'll be initialized */
const short is_nested_call = (wm->op_undo_depth != 0);
/* initialize setting from previous run */
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index 14a25cc13e0..e4b7d1c5d5f 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -331,7 +331,7 @@ void wm_gesture_draw(wmWindow *win)
if (gt->type == WM_GESTURE_RECT)
wm_gesture_draw_rect(gt);
-// else if (gt->type==WM_GESTURE_TWEAK)
+// else if (gt->type == WM_GESTURE_TWEAK)
// wm_gesture_draw_line(gt);
else if (gt->type == WM_GESTURE_CIRCLE)
wm_gesture_draw_circle(gt);
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 8ce882e887e..2cd955e9ee9 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1015,8 +1015,8 @@ static void dialog_exec_cb(bContext *C, void *arg1, void *arg2)
WM_operator_call(C, data->op);
/* let execute handle freeing it */
- //data->free_op= FALSE;
- //data->op= NULL;
+ //data->free_op = FALSE;
+ //data->op = NULL;
/* in this case, wm_operator_ui_popup_cancel wont run */
MEM_freeN(data);
@@ -1314,7 +1314,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
menu.type = mt;
mt->draw(C, &menu);
-// wmWindowManager *wm= CTX_wm_manager(C);
+// wmWindowManager *wm = CTX_wm_manager(C);
// uiItemM(layout, C, "USERPREF_MT_keyconfigs", U.keyconfigstr, ICON_NONE);
}
diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c
index 563eef8304c..cf983f7795f 100644
--- a/source/blender/windowmanager/intern/wm_subwindow.c
+++ b/source/blender/windowmanager/intern/wm_subwindow.c
@@ -149,7 +149,7 @@ void wm_subwindow_getmatrix(wmWindow *win, int swinid, float mat[][4])
}
/* always sets pixel-precise 2D window/view matrices */
-/* coords is in whole pixels. xmin = 15, xmax= 16: means window is 2 pix big */
+/* coords is in whole pixels. xmin = 15, xmax = 16: means window is 2 pix big */
int wm_subwindow_open(wmWindow *win, rcti *winrct)
{
wmSubWindow *swin;
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index e6eff908e33..7361e74755e 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -622,7 +622,7 @@ void wm_window_make_drawable(bContext *C, wmWindow *win)
wmWindowManager *wm = CTX_wm_manager(C);
if (win != wm->windrawable && win->ghostwin) {
-// win->lmbut= 0; /* keeps hanging when mousepressed while other window opened */
+// win->lmbut = 0; /* keeps hanging when mousepressed while other window opened */
wm->windrawable = win;
if (G.debug & G_DEBUG_EVENTS) {
diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt
index dcd4d78d19a..a352c69144f 100644
--- a/source/blenderplayer/CMakeLists.txt
+++ b/source/blenderplayer/CMakeLists.txt
@@ -1,4 +1,3 @@
-# -*- mode: cmake; indent-tabs-mode: t; -*-
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 49a80bcaccb..0374db538b6 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1,4 +1,3 @@
-# -*- mode: cmake; indent-tabs-mode: t; -*-
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
diff --git a/source/gameengine/CMakeLists.txt b/source/gameengine/CMakeLists.txt
index 5a3d42f33e3..a205ccbdc12 100644
--- a/source/gameengine/CMakeLists.txt
+++ b/source/gameengine/CMakeLists.txt
@@ -1,4 +1,3 @@
-# -*- mode: cmake; indent-tabs-mode: t; -*-
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt
index 74a0ad1c628..2bad58699a8 100644
--- a/source/tests/CMakeLists.txt
+++ b/source/tests/CMakeLists.txt
@@ -1,4 +1,3 @@
-# -*- mode: cmake; indent-tabs-mode: t; -*-
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or