svn merge ^/trunk/blender -r43294:43338

This commit is contained in:
Campbell Barton 2012-01-13 01:39:57 +00:00
commit 705f23064e
110 changed files with 975 additions and 1890 deletions

@ -461,7 +461,8 @@ if(UNIX AND NOT APPLE)
# use lib dir if available and nothing else specified
if(LIBDIR AND NOT FFMPEG)
set(FFMPEG ${LIBDIR}/ffmpeg CACHE PATH "FFMPEG Directory")
set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale dirac_encoder mp3lame ogg orc-0.4 schroedinger-1.0 theora theoraenc theoradec vorbis vorbisenc vpx x264 xvidcore faad asound CACHE STRING "FFMPEG Libraries")
# XXX, some distros might need 'theoraenc theoradec' too
set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale dirac_encoder mp3lame ogg orc-0.4 schroedinger-1.0 theora vorbis vorbisenc vpx x264 xvidcore faad asound CACHE STRING "FFMPEG Libraries")
else()
set(FFMPEG /usr CACHE PATH "FFMPEG Directory")
set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
@ -619,6 +620,10 @@ if(UNIX AND NOT APPLE)
# CLang is the same as GCC for now.
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
# Solaris CC
elseif(CMAKE_CXX_COMPILER_ID MATCHES "SunPro")
set(PLATFORM_CFLAGS "-pipe -features=extensions -fPIC -D__FUNCTION__=__func__")
# Intel C++ Compiler
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
# think these next two are broken

@ -10,7 +10,7 @@ For your own work this is of course fine, but if you want to collaborate with ot
Style Conventions
=================
For Blender 2.5 we have chosen to follow python suggested style guide to avoid mixing styles amongst our own scripts and make it easier to use python scripts from other projects.
For Blender/Python development we have chosen to follow python suggested style guide to avoid mixing styles amongst our own scripts and make it easier to use python scripts from other projects.
Using our style guide for your own scripts makes it easier if you eventually want to contribute them to blender.

@ -27,7 +27,7 @@ The Default Environment
When developing your own scripts it may help to understand how blender sets up its python environment. Many python scripts come bundled with blender and can be used as a reference because they use the same API that script authors write tools in. Typical usage for scripts include: user interface, import/export, scene manipulation, automation, defining your own toolset and customization.
On startup blender scans the ``scripts/startup/`` directory for python modules and imports them. The exact location of this directory depends on your installation. `See the directory layout docs <http://wiki.blender.org/index.php/Doc:2.5/Manual/Introduction/Installing_Blender/DirectoryLayout>`_
On startup blender scans the ``scripts/startup/`` directory for python modules and imports them. The exact location of this directory depends on your installation. `See the directory layout docs <http://wiki.blender.org/index.php/Doc:2.6/Manual/Introduction/Installing_Blender/DirectoryLayout>`_
Script Loading
@ -71,7 +71,7 @@ The only difference between addons and built-in python modules is that addons mu
The user preferences addon listing uses **bl_info** to display information about each addon.
`See Addons <http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons>`_ for details on the **bl_info** dictionary.
`See Addons <http://wiki.blender.org/index.php/Dev:2.6/Py/Scripts/Guidelines/Addons>`_ for details on the **bl_info** dictionary.
Integration through Classes

@ -40,14 +40,14 @@ The Blender/Python API **can't** (yet)...
Before Starting
===============
This document isn't intended to fully cover each topic. Rather, its purpose is to familiarize you with Blender 2.5's new Python API.
This document isn't intended to fully cover each topic. Rather, its purpose is to familiarize you with Blender Python API.
A quick list of helpful things to know before starting:
* Blender uses Python 3.x; some 3rd party extensions are not available yet.
* The interactive console in Blender 2.5 has been improved; testing one-liners in the console is a good way to learn.
* The interactive console is great for testing one-liners, It also has autocompleation so you can inspect the api quickly.
* Button tool tips show Python attributes and operator names.
@ -113,7 +113,7 @@ Once you have a data block, such as a material, object, groups etc., its attribu
bpy.data.materials['MyMaterial']
For testing what data to access it's useful to use the "Console", which is its own space type in Blender 2.5. This supports auto-complete, giving you a fast way to dig into different data in your file.
For testing what data to access it's useful to use the "Console", which is its own space type. This supports auto-complete, giving you a fast way to dig into different data in your file.
Example of a data path that can be quickly found via the console:

@ -33,6 +33,10 @@
extern "C" {
#include <stdlib.h> // for NULL
#if defined(__FreeBSD__)
/* devel/libunwind only includes _Unwind_Backtrace if this is set */
#define _GNU_SOURCE 1
#endif
#include <unwind.h> // ABI defined unwinder
}
#include "stacktrace.h"

@ -223,7 +223,7 @@ int32 GetMainThreadPid() {
pid_t GetTID() {
// On Linux and FreeBSD, we try to use gettid().
#if defined OS_LINUX || defined OS_FREEBSD || defined OS_MACOSX
#if defined OS_LINUX || defined OS_MACOSX
#ifndef __NR_gettid
#ifdef OS_MACOSX
#define __NR_gettid SYS_gettid

@ -213,7 +213,7 @@ __device void svm_node_tex_musgrave(KernelGlobals *kg, ShaderData *sd, float *st
decode_node_uchar4(node.y, &type, &co_offset, &color_offset, &fac_offset);
decode_node_uchar4(node.z, &dimension_offset, &lacunarity_offset, &detail_offset, &offset_offset);
decode_node_uchar4(node.z, &gain_offset, &scale_offset, NULL, NULL);
decode_node_uchar4(node.w, &gain_offset, &scale_offset, NULL, NULL);
float3 co = stack_load_float3(stack, co_offset);
float dimension = stack_load_float_default(stack, dimension_offset, node2.x);

@ -255,7 +255,7 @@ public:
* @return Indication of success.
*/
virtual GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window,
const bool stereoVisual) = 0;
const bool stereoVisual, const GHOST_TUns16 numOfAASamples=0) = 0;
/**
* Ends full screen mode.

@ -139,7 +139,7 @@ bool GHOST_System::validWindow(GHOST_IWindow* window)
GHOST_TSuccess GHOST_System::beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window,
const bool stereoVisual)
const bool stereoVisual, const GHOST_TUns16 numOfAASamples)
{
GHOST_TSuccess success = GHOST_kFailure;
GHOST_ASSERT(m_windowManager, "GHOST_System::beginFullScreen(): invalid window manager")
@ -151,7 +151,7 @@ GHOST_TSuccess GHOST_System::beginFullScreen(const GHOST_DisplaySetting& setting
success = m_displayManager->setCurrentDisplaySetting(GHOST_DisplayManager::kMainDisplay, setting);
if (success == GHOST_kSuccess) {
//GHOST_PRINT("GHOST_System::beginFullScreen(): creating full-screen window\n");
success = createFullScreenWindow((GHOST_Window**)window, stereoVisual);
success = createFullScreenWindow((GHOST_Window**)window, stereoVisual, numOfAASamples);
if (success == GHOST_kSuccess) {
m_windowManager->beginFullScreen(*window, stereoVisual);
}
@ -333,7 +333,7 @@ GHOST_TSuccess GHOST_System::exit()
}
GHOST_TSuccess GHOST_System::createFullScreenWindow(GHOST_Window** window, const bool stereoVisual)
GHOST_TSuccess GHOST_System::createFullScreenWindow(GHOST_Window** window, const bool stereoVisual, const GHOST_TUns16 numOfAASamples)
{
GHOST_TSuccess success;
GHOST_ASSERT(m_displayManager, "GHOST_System::createFullScreenWindow(): invalid display manager")
@ -347,7 +347,8 @@ GHOST_TSuccess GHOST_System::createFullScreenWindow(GHOST_Window** window, const
0, 0, settings.xPixels, settings.yPixels,
GHOST_kWindowStateFullScreen,
GHOST_kDrawingContextTypeOpenGL,
stereoVisual);
stereoVisual,
numOfAASamples);
success = *window == 0 ? GHOST_kFailure : GHOST_kSuccess;
}
return success;

@ -144,7 +144,7 @@ public:
* @return Indication of success.
*/
virtual GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window,
const bool stereoVisual);
const bool stereoVisual, const GHOST_TUns16 numOfAASamples=0);
/**
* Ends full screen mode.
@ -308,7 +308,7 @@ protected:
* @return Indication of success.
*/
virtual GHOST_TSuccess createFullScreenWindow(GHOST_Window** window,
const bool stereoVisual);
const bool stereoVisual, const GHOST_TUns16 numOfAASamples=0);
/** The display manager (platform dependant). */
GHOST_DisplayManager* m_displayManager;

@ -274,16 +274,23 @@ class RENDER_PT_game_player(RenderButtonsPanel, Panel):
row = layout.row()
row.operator("wm.blenderplayer_start", text="Start")
row.prop(gs, "show_fullscreen")
row.label()
row = layout.row()
row.label(text="Resolution:")
row = layout.row(align=True)
row.prop(gs, "resolution_x", slider=False, text="X")
row.prop(gs, "resolution_y", slider=False, text="Y")
row = layout.row()
col = row.column()
col.prop(gs, "show_fullscreen")
col = row.column()
col.prop(gs, "use_desktop")
col.active = gs.show_fullscreen
col = layout.column()
col.label(text="Quality:")
col.prop(gs, "samples")
col = layout.column(align=True)
col.prop(gs, "depth", text="Bit Depth", slider=False)
col.prop(gs, "frequency", text="Refresh Rate", slider=False)

@ -468,6 +468,24 @@ class PaintPanel():
return None
@staticmethod
def unified_paint_settings(parent, context):
ups = context.tool_settings.unified_paint_settings
parent.label(text="Unified Settings:")
parent.prop(ups, "use_unified_size", text="Size")
parent.prop(ups, "use_unified_strength", text="Strength")
@staticmethod
def prop_unified_size(parent, context, brush, prop_name, icon='NONE', text=""):
ups = context.tool_settings.unified_paint_settings
ptr = ups if ups.use_unified_size else brush
parent.prop(ptr, prop_name, icon=icon, text=text)
@staticmethod
def prop_unified_strength(parent, context, brush, prop_name, icon='NONE', text=""):
ups = context.tool_settings.unified_paint_settings
ptr = ups if ups.use_unified_strength else brush
parent.prop(ptr, prop_name, icon=icon, text=text)
class VIEW3D_PT_tools_brush(PaintPanel, Panel):
bl_label = "Brush"
@ -523,14 +541,16 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row = col.row(align=True)
if brush.use_locked_size:
row.prop(brush, "use_locked_size", toggle=True, text="", icon='LOCKED')
ups = context.tool_settings.unified_paint_settings
if ((ups.use_unified_size and ups.use_locked_size) or
((not ups.use_unified_size) and brush.use_locked_size)):
self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
row.prop(brush, "unprojected_radius", text="Radius", slider=True)
else:
row.prop(brush, "use_locked_size", toggle=True, text="", icon='UNLOCKED')
self.prop_unified_size(row, context, brush, "use_locked_size", icon='UNLOCKED')
row.prop(brush, "size", slider=True)
row.prop(brush, "use_pressure_size", toggle=True, text="")
self.prop_unified_size(row, context, brush, "use_pressure_size")
if tool not in {'SNAKE_HOOK', 'GRAB', 'ROTATE'}:
col.separator()
@ -544,12 +564,12 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row.prop(brush, "use_space_atten", toggle=True, text="", icon='UNLOCKED')
row.prop(brush, "strength", text="Strength", slider=True)
row.prop(brush, "use_pressure_strength", text="")
self.prop_unified_strength(row, context, brush, "use_pressure_strength")
if tool == 'ROTATE':
row = col.row(align=True)
row.prop(brush, "strength", text="Strength", slider=True)
row.prop(brush, "use_pressure_strength", text="")
self.prop_unified_strength(row, context, brush, "use_pressure_strength")
if tool != 'SMOOTH':
col.separator()
@ -637,11 +657,11 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row = col.row(align=True)
row.prop(brush, "size", slider=True)
row.prop(brush, "use_pressure_size", toggle=True, text="")
self.prop_unified_size(row, context, brush, "use_pressure_size")
row = col.row(align=True)
row.prop(brush, "strength", text="Strength", slider=True)
row.prop(brush, "use_pressure_strength", toggle=True, text="")
self.prop_unified_strength(row, context, brush, "use_pressure_strength")
row = col.row(align=True)
row.prop(brush, "jitter", slider=True)
@ -663,11 +683,11 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row = col.row(align=True)
row.prop(brush, "size", slider=True)
row.prop(brush, "use_pressure_size", toggle=True, text="")
self.prop_unified_size(row, context, brush, "use_pressure_size")
row = col.row(align=True)
row.prop(brush, "strength", text="Strength", slider=True)
row.prop(brush, "use_pressure_strength", toggle=True, text="")
self.prop_unified_strength(row, context, brush, "use_pressure_strength")
row = col.row(align=True)
row.prop(brush, "jitter", slider=True)
@ -681,11 +701,11 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
row = col.row(align=True)
row.prop(brush, "size", slider=True)
row.prop(brush, "use_pressure_size", toggle=True, text="")
self.prop_unified_size(row, context, brush, "use_pressure_size")
row = col.row(align=True)
row.prop(brush, "strength", text="Strength", slider=True)
row.prop(brush, "use_pressure_strength", toggle=True, text="")
self.prop_unified_strength(row, context, brush, "use_pressure_strength")
# XXX - TODO
#row = col.row(align=True)
@ -950,9 +970,7 @@ class VIEW3D_PT_sculpt_options(PaintPanel, Panel):
layout.prop(sculpt, "show_brush")
layout.prop(sculpt, "use_deform_only")
layout.label(text="Unified Settings:")
layout.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
layout.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
self.unified_paint_settings(layout, context)
class VIEW3D_PT_sculpt_symmetry(PaintPanel, Panel):
@ -1041,7 +1059,7 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
col.operator("object.vertex_group_fix", text="Fix Deforms")
class VIEW3D_PT_tools_weightpaint_options(View3DPanel, Panel):
class VIEW3D_PT_tools_weightpaint_options(PaintPanel, Panel):
bl_context = "weightpaint"
bl_label = "Options"
@ -1062,9 +1080,7 @@ class VIEW3D_PT_tools_weightpaint_options(View3DPanel, Panel):
col.prop(mesh, "use_mirror_x")
col.prop(mesh, "use_mirror_topology")
col.label(text="Unified Settings:")
col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
self.unified_paint_settings(col, context)
# Commented out because the Apply button isn't an operator yet, making these settings useless
# col.label(text="Gamma:")
@ -1078,7 +1094,7 @@ class VIEW3D_PT_tools_weightpaint_options(View3DPanel, Panel):
# ********** default tools for vertex-paint ****************
class VIEW3D_PT_tools_vertexpaint(View3DPanel, Panel):
class VIEW3D_PT_tools_vertexpaint(PaintPanel, Panel):
bl_context = "vertexpaint"
bl_label = "Options"
@ -1094,9 +1110,7 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel, Panel):
col.prop(vpaint, "use_normal")
col.prop(vpaint, "use_spray")
col.label(text="Unified Settings:")
col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
self.unified_paint_settings(col, context)
# Commented out because the Apply button isn't an operator yet, making these settings useless
# col.label(text="Gamma:")
@ -1187,9 +1201,7 @@ class VIEW3D_PT_imagepaint_options(PaintPanel):
tool_settings = context.tool_settings
col = layout.column()
col.label(text="Unified Settings:")
col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
self.unified_paint_settings(col, context)
class VIEW3D_MT_tools_projectpaint_clone(Menu):

@ -42,7 +42,7 @@ extern "C" {
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 261
#define BLENDER_SUBVERSION 1
#define BLENDER_SUBVERSION 2
#define BLENDER_MINVERSION 250
#define BLENDER_MINSUBVERSION 0

@ -76,7 +76,7 @@ struct BrushPainter;
typedef struct BrushPainter BrushPainter;
typedef int (*BrushFunc)(void *user, struct ImBuf *ibuf, float *lastpos, float *pos);
BrushPainter *brush_painter_new(struct Brush *brush);
BrushPainter *brush_painter_new(struct Scene *scene, struct Brush *brush);
void brush_painter_require_imbuf(BrushPainter *painter, short flt,
short texonly, int size);
int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos,
@ -95,14 +95,9 @@ struct ImBuf *brush_gen_radial_control_imbuf(struct Brush *br);
int brush_size(struct Brush *brush);
void brush_set_size(struct Brush *brush, int value);
int brush_use_locked_size(struct Brush *brush);
void brush_set_use_locked_size(struct Brush *brush, int value);
int brush_use_alpha_pressure(struct Brush *brush);
void brush_set_use_alpha_pressure(struct Brush *brush, int value);
int brush_use_size_pressure(struct Brush *brush);
void brush_set_use_size_pressure(struct Brush *brush, int value);
int brush_use_locked_size(const struct Scene *scene, struct Brush *brush);
int brush_use_alpha_pressure(const struct Scene *scene, struct Brush *brush);
int brush_use_size_pressure(const struct Scene *scene, struct Brush *brush);
float brush_unprojected_radius(struct Brush *brush);
void brush_set_unprojected_radius(struct Brush *brush, float value);

@ -642,6 +642,7 @@ typedef struct BrushPainterCache {
} BrushPainterCache;
struct BrushPainter {
Scene *scene;
Brush *brush;
float lastmousepos[2]; /* mouse position of last paint call */
@ -665,11 +666,12 @@ struct BrushPainter {
BrushPainterCache cache;
};
BrushPainter *brush_painter_new(Brush *brush)
BrushPainter *brush_painter_new(Scene *scene, Brush *brush)
{
BrushPainter *painter= MEM_callocN(sizeof(BrushPainter), "BrushPainter");
painter->brush= brush;
painter->scene= scene;
painter->firsttouch= 1;
painter->cache.lastsize= -1; /* force ibuf create in refresh */
@ -917,9 +919,9 @@ void brush_painter_break_stroke(BrushPainter *painter)
static void brush_apply_pressure(BrushPainter *painter, Brush *brush, float pressure)
{
if (brush_use_alpha_pressure(brush))
if (brush_use_alpha_pressure(painter->scene, brush))
brush_set_alpha(brush, MAX2(0.0f, painter->startalpha*pressure));
if (brush_use_size_pressure(brush))
if (brush_use_size_pressure(painter->scene, brush))
brush_set_size(brush, MAX2(1.0f, painter->startsize*pressure));
if (brush->flag & BRUSH_JITTER_PRESSURE)
brush->jitter = MAX2(0.0f, painter->startjitter*pressure);
@ -1219,25 +1221,6 @@ struct ImBuf *brush_gen_radial_control_imbuf(Brush *br)
/* XXX, wouldnt it be better to only pass the active scene?
* this can return any old scene! - campbell*/
static void set_unified_settings(Brush *brush, short flag, int value)
{
Scene *sce;
for (sce= G.main->scene.first; sce; sce= sce->id.next) {
if (sce->toolsettings &&
ELEM4(brush,
paint_brush(&(sce->toolsettings->imapaint.paint)),
paint_brush(&(sce->toolsettings->vpaint->paint)),
paint_brush(&(sce->toolsettings->wpaint->paint)),
paint_brush(&(sce->toolsettings->sculpt->paint))))
{
if (value)
sce->toolsettings->sculpt_paint_settings |= flag;
else
sce->toolsettings->sculpt_paint_settings &= ~flag;
}
}
}
static short unified_settings(Brush *brush)
{
Scene *sce;
@ -1249,7 +1232,7 @@ static short unified_settings(Brush *brush)
paint_brush(&(sce->toolsettings->wpaint->paint)),
paint_brush(&(sce->toolsettings->sculpt->paint))))
{
return sce->toolsettings->sculpt_paint_settings;
return sce->toolsettings->unified_paint_settings.flag;
}
}
@ -1280,7 +1263,7 @@ static void set_unified_size(Brush *brush, int value)
paint_brush(&(sce->toolsettings->wpaint->paint)),
paint_brush(&(sce->toolsettings->sculpt->paint))))
{
sce->toolsettings->sculpt_paint_unified_size= value;
sce->toolsettings->unified_paint_settings.size= value;
}
}
}
@ -1296,7 +1279,7 @@ static int unified_size(Brush *brush)
paint_brush(&(sce->toolsettings->wpaint->paint)),
paint_brush(&(sce->toolsettings->sculpt->paint))))
{
return sce->toolsettings->sculpt_paint_unified_size;
return sce->toolsettings->unified_paint_settings.size;
}
}
@ -1314,7 +1297,7 @@ static void set_unified_alpha(Brush *brush, float value)
paint_brush(&(sce->toolsettings->wpaint->paint)),
paint_brush(&(sce->toolsettings->sculpt->paint))))
{
sce->toolsettings->sculpt_paint_unified_alpha= value;
sce->toolsettings->unified_paint_settings.alpha= value;
}
}
}
@ -1330,7 +1313,7 @@ static float unified_alpha(Brush *brush)
paint_brush(&(sce->toolsettings->wpaint->paint)),
paint_brush(&(sce->toolsettings->sculpt->paint))))
{
return sce->toolsettings->sculpt_paint_unified_alpha;
return sce->toolsettings->unified_paint_settings.alpha;
}
}
@ -1348,7 +1331,7 @@ static void set_unified_unprojected_radius(Brush *brush, float value)
paint_brush(&(sce->toolsettings->wpaint->paint)),
paint_brush(&(sce->toolsettings->sculpt->paint))))
{
sce->toolsettings->sculpt_paint_unified_unprojected_radius= value;
sce->toolsettings->unified_paint_settings.unprojected_radius= value;
}
}
}
@ -1364,7 +1347,7 @@ static float unified_unprojected_radius(Brush *brush)
paint_brush(&(sce->toolsettings->wpaint->paint)),
paint_brush(&(sce->toolsettings->sculpt->paint))))
{
return sce->toolsettings->sculpt_paint_unified_unprojected_radius;
return sce->toolsettings->unified_paint_settings.unprojected_radius;
}
}
@ -1374,7 +1357,7 @@ void brush_set_size(Brush *brush, int size)
{
const short us_flag = unified_settings(brush);
if (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE)
if (us_flag & UNIFIED_PAINT_SIZE)
set_unified_size(brush, size);
else
brush->size= size;
@ -1386,84 +1369,33 @@ int brush_size(Brush *brush)
{
const short us_flag = unified_settings(brush);
return (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) ? unified_size(brush) : brush->size;
return (us_flag & UNIFIED_PAINT_SIZE) ? unified_size(brush) : brush->size;
}
void brush_set_use_locked_size(Brush *brush, int value)
int brush_use_locked_size(const Scene *scene, Brush *brush)
{
const short us_flag = unified_settings(brush);
const short us_flag = scene->toolsettings->unified_paint_settings.flag;
if (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) {
set_unified_settings(brush, SCULPT_PAINT_UNIFIED_LOCK_BRUSH_SIZE, value);
}
else {
if (value)
brush->flag |= BRUSH_LOCK_SIZE;
else
brush->flag &= ~BRUSH_LOCK_SIZE;
}
//WM_main_add_notifier(NC_BRUSH|NA_EDITED, brush);
}
int brush_use_locked_size(Brush *brush)
{
const short us_flag = unified_settings(brush);
return (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) ?
(us_flag & SCULPT_PAINT_UNIFIED_LOCK_BRUSH_SIZE) :
return (us_flag & UNIFIED_PAINT_SIZE) ?
(us_flag & UNIFIED_PAINT_BRUSH_LOCK_SIZE) :
(brush->flag & BRUSH_LOCK_SIZE);
}
void brush_set_use_size_pressure(Brush *brush, int value)
int brush_use_size_pressure(const Scene *scene, Brush *brush)
{
const short us_flag = unified_settings(brush);
const short us_flag = scene->toolsettings->unified_paint_settings.flag;
if (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) {
set_unified_settings(brush, SCULPT_PAINT_UNIFIED_SIZE_PRESSURE, value);
}
else {
if (value)
brush->flag |= BRUSH_SIZE_PRESSURE;
else
brush->flag &= ~BRUSH_SIZE_PRESSURE;
}
//WM_main_add_notifier(NC_BRUSH|NA_EDITED, brush);
}
int brush_use_size_pressure(Brush *brush)
{
const short us_flag = unified_settings(brush);
return (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) ?
(us_flag & SCULPT_PAINT_UNIFIED_SIZE_PRESSURE) :
return (us_flag & UNIFIED_PAINT_SIZE) ?
(us_flag & UNIFIED_PAINT_BRUSH_SIZE_PRESSURE) :
(brush->flag & BRUSH_SIZE_PRESSURE);
}
void brush_set_use_alpha_pressure(Brush *brush, int value)
int brush_use_alpha_pressure(const Scene *scene, Brush *brush)
{
const short us_flag = unified_settings(brush);
const short us_flag = scene->toolsettings->unified_paint_settings.flag;
if (us_flag & SCULPT_PAINT_USE_UNIFIED_ALPHA) {
set_unified_settings(brush, SCULPT_PAINT_UNIFIED_ALPHA_PRESSURE, value);
}
else {
if (value)
brush->flag |= BRUSH_ALPHA_PRESSURE;
else
brush->flag &= ~BRUSH_ALPHA_PRESSURE;
}
//WM_main_add_notifier(NC_BRUSH|NA_EDITED, brush);
}
int brush_use_alpha_pressure(Brush *brush)
{
const short us_flag = unified_settings(brush);
return (us_flag & SCULPT_PAINT_USE_UNIFIED_ALPHA) ?
(us_flag & SCULPT_PAINT_UNIFIED_ALPHA_PRESSURE) :
return (us_flag & UNIFIED_PAINT_ALPHA) ?
(us_flag & UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE) :
(brush->flag & BRUSH_ALPHA_PRESSURE);
}
@ -1471,7 +1403,7 @@ void brush_set_unprojected_radius(Brush *brush, float unprojected_radius)
{
const short us_flag = unified_settings(brush);
if (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE)
if (us_flag & UNIFIED_PAINT_SIZE)
set_unified_unprojected_radius(brush, unprojected_radius);
else
brush->unprojected_radius= unprojected_radius;
@ -1483,7 +1415,7 @@ float brush_unprojected_radius(Brush *brush)
{
const short us_flag = unified_settings(brush);
return (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) ?
return (us_flag & UNIFIED_PAINT_SIZE) ?
unified_unprojected_radius(brush) :
brush->unprojected_radius;
}
@ -1492,7 +1424,7 @@ void brush_set_alpha(Brush *brush, float alpha)
{
const short us_flag = unified_settings(brush);
if (us_flag & SCULPT_PAINT_USE_UNIFIED_ALPHA)
if (us_flag & UNIFIED_PAINT_ALPHA)
set_unified_alpha(brush, alpha);
else
brush->alpha= alpha;
@ -1504,7 +1436,7 @@ float brush_alpha(Brush *brush)
{
const short us_flag = unified_settings(brush);
return (us_flag & SCULPT_PAINT_USE_UNIFIED_ALPHA) ?
return (us_flag & UNIFIED_PAINT_ALPHA) ?
unified_alpha(brush) :
brush->alpha;
}

@ -269,9 +269,9 @@ int surfindex_displist(DispList *dl, int a, int *b, int *p1, int *p2, int *p3, i
(*b)= 1;
}
if( (dl->flag & DL_CYCL_V) && a==dl->parts-1) { \
(*p3)-= dl->nr*dl->parts; \
(*p4)-= dl->nr*dl->parts; \
if( (dl->flag & DL_CYCL_V) && a==dl->parts-1) {
(*p3)-= dl->nr*dl->parts;
(*p4)-= dl->nr*dl->parts;
}
return 1;

@ -271,8 +271,6 @@ void BMEdit_Free(BMEditMesh *em)
em->derivedCage= NULL;
}
em->retopo_paint_data= NULL;
if (em->looptris) MEM_freeN(em->looptris);
if (em->vert_index) MEM_freeN(em->vert_index);

@ -950,6 +950,7 @@ char BKE_imtype_valid_channels(const char imtype)
case R_IMF_IMTYPE_MULTILAYER:
case R_IMF_IMTYPE_DDS:
case R_IMF_IMTYPE_JP2:
case R_IMF_IMTYPE_QUICKTIME:
chan_flag |= IMA_CHAN_FLAG_ALPHA;
}

@ -310,7 +310,7 @@ int frameserver_loop(RenderData *rd, ReportList *UNUSED(reports))
}
}
len = recv(connsock, buf, 4095, 0);
len = recv(connsock, buf, sizeof(buf) - 1, 0);
if (len < 0) {
return -1;

@ -42,7 +42,6 @@
#include "BLO_sys_types.h" // for intptr_t support
struct DerivedMesh;
struct RetopoPaintData;
struct BLI_mempool;
/* note; changing this also might affect the undo copy in editmesh.c */
@ -187,8 +186,6 @@ typedef struct EditMesh
*/
int lastDataMask;
struct RetopoPaintData *retopo_paint_data;
CustomData vdata, edata, fdata;
} EditMesh;

@ -51,7 +51,7 @@ extern "C" {
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) || defined( __SUNPRO_C)
#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */

@ -174,33 +174,33 @@ void boxPack2D(boxPack *boxarray, const int len, float *tot_width, float *tot_he
for (box=boxarray, box_index=0, i=0; box_index < len; box_index++, box++) {
vert->blb = vert->brb = vert->tlb =\
vert->isect_cache[0] = vert->isect_cache[1] =\
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
vert->blb = vert->brb = vert->tlb =
vert->isect_cache[0] = vert->isect_cache[1] =
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
vert->free = CORNERFLAGS &~ TRF;
vert->trb = box;
vert->index = i; i++;
box->v[BL] = vert; vert++;
vert->trb= vert->brb = vert->tlb =\
vert->isect_cache[0] = vert->isect_cache[1] =\
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
vert->trb= vert->brb = vert->tlb =
vert->isect_cache[0] = vert->isect_cache[1] =
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
vert->free = CORNERFLAGS &~ BLF;
vert->blb = box;
vert->index = i; i++;
box->v[TR] = vert; vert++;
vert->trb = vert->blb = vert->tlb =\
vert->isect_cache[0] = vert->isect_cache[1] =\
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
vert->trb = vert->blb = vert->tlb =
vert->isect_cache[0] = vert->isect_cache[1] =
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
vert->free = CORNERFLAGS &~ BRF;
vert->brb = box;
vert->index = i; i++;
box->v[TL] = vert; vert++;
vert->trb = vert->blb = vert->brb =\
vert->isect_cache[0] = vert->isect_cache[1] =\
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
vert->trb = vert->blb = vert->brb =
vert->isect_cache[0] = vert->isect_cache[1] =
vert->isect_cache[2] = vert->isect_cache[3] = NULL;
vert->free = CORNERFLAGS &~ TLF;
vert->tlb = box;
vert->index = i; i++;

@ -82,7 +82,7 @@ int BLI_file_gzip(const char *from, const char *to)
return -2;
while(1) {
readsize = read(file, buffer, 10240);
readsize = read(file, buffer, sizeof(buffer));
if(readsize < 0) {
rval= -2; /* error happened in reading */

@ -52,7 +52,7 @@
#include "GHOST_Path-api.h"
#if defined WIN32 && !defined _LIBC
#if defined WIN32 && !defined _LIBC || defined __sun
# include "BLI_fnmatch.h" /* use fnmatch included in blenlib */
#else
# ifndef _GNU_SOURCE

@ -10983,7 +10983,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
sce->gm.dome.warptext = sce->r.dometext;
//Stand Alone
sce->gm.fullscreen = sce->r.fullscreen;
sce->gm.playerflag |= (sce->r.fullscreen?GAME_PLAYER_FULLSCREEN:0);
sce->gm.xplay = sce->r.xplay;
sce->gm.yplay = sce->r.yplay;
sce->gm.freqplay = sce->r.freqplay;
@ -13019,7 +13019,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
/* put compatibility code here until next subversion bump */
if (main->versionfile < 261 || (main->versionfile == 261 && main->subversionfile < 2))
{
{
/* convert Camera Actuator values to defines */
@ -13038,6 +13038,24 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
{
/* convert deprecated sculpt_paint_unified_* fields to
UnifiedPaintSettings */
Scene *scene;
for(scene= main->scene.first; scene; scene= scene->id.next) {
ToolSettings *ts= scene->toolsettings;
UnifiedPaintSettings *ups= &ts->unified_paint_settings;
ups->size= ts->sculpt_paint_unified_size;
ups->unprojected_radius= ts->sculpt_paint_unified_unprojected_radius;
ups->alpha= ts->sculpt_paint_unified_alpha;
ups->flag= ts->sculpt_paint_settings;
}
}
}
/* put compatibility code here until next subversion bump */
{
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */

@ -4654,831 +4654,6 @@ void bevel_menu_old()
}
}
/* *********** END BEVEL *********/
typedef struct SlideUv {
float origuv[2];
float *uv_up, *uv_down;
//float *fuv[4];
LinkNode *fuv_list;
} SlideUv;
typedef struct SlideVert {
EditEdge *up,*down;
EditVert origvert;
} SlideVert;
int EdgeLoopDelete(void)
{
/* temporal flag setting so we keep UVs when deleting edge loops,
* this is a bit of a hack but it works how you would want in almost all cases */
short uvcalc_flag_orig = G.scene->toolsettings->uvcalc_flag;
G.scene->toolsettings->uvcalc_flag |= UVCALC_TRANSFORM_CORRECT;
if(!EdgeSlide(1, 1)) {
return 0;
}
/* restore uvcalc flag */
G.scene->toolsettings->uvcalc_flag = uvcalc_flag_orig;
EM_select_more();
removedoublesflag(1,0, 0.001);
EM_select_flush();
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
return 1;
}
int EdgeSlide(short immediate, float imperc)
{
NumInput num;
EditMesh *em = G.editMesh;
EditFace *efa;
EditEdge *eed,*first=NULL,*last=NULL, *temp = NULL;
EditVert *ev, *nearest;
LinkNode *edgelist = NULL, *vertlist=NULL, *look;
GHash *vertgh;
SlideVert *tempsv;
float perc = 0, percp = 0,vertdist, projectMat[4][4], viewMat[4][4];
float shiftlabda= 0.0f,len = 0.0f;
int i = 0,j, numsel, numadded=0, timesthrough = 0, vertsel=0, prop=1, cancel = 0,flip=0;
int wasshift = 0;
/* UV correction vars */
GHash **uvarray= NULL;
int uvlay_tot= CustomData_number_of_layers(&G.editMesh->fdata, CD_MTFACE);
int uvlay_idx;
SlideUv *slideuvs=NULL, *suv=NULL, *suv_last=NULL;
float uv_tmp[2];
LinkNode *fuv_link;
short event, draw=1;
short mval[2], mvalo[2];
char str[128];
float labda = 0.0f;
initNumInput(&num);
view3d_get_object_project_mat(curarea, G.obedit, projectMat, viewMat);
mvalo[0] = -1; mvalo[1] = -1;
numsel =0;
// Get number of selected edges and clear some flags
for(eed=em->edges.first;eed;eed=eed->next) {
eed->f1 = 0;
eed->f2 = 0;
if(eed->f & SELECT) numsel++;
}
for(ev=em->verts.first;ev;ev=ev->next) {
ev->f1 = 0;
}
//Make sure each edge only has 2 faces
// make sure loop doesn't cross face
for(efa=em->faces.first;efa;efa=efa->next) {
int ct = 0;
if(efa->e1->f & SELECT) {
ct++;
efa->e1->f1++;
if(efa->e1->f1 > 2) {
error("3+ face edge");
return 0;
}
}
if(efa->e2->f & SELECT) {
ct++;
efa->e2->f1++;
if(efa->e2->f1 > 2) {
error("3+ face edge");
return 0;
}
}
if(efa->e3->f & SELECT) {
ct++;
efa->e3->f1++;
if(efa->e3->f1 > 2) {
error("3+ face edge");
return 0;
}
}
if(efa->e4 && efa->e4->f & SELECT) {
ct++;
efa->e4->f1++;
if(efa->e4->f1 > 2) {
error("3+ face edge");
return 0;
}
}
// Make sure loop is not 2 edges of same face
if(ct > 1) {
error("loop crosses itself");
return 0;
}
}
// Get # of selected verts
for(ev=em->verts.first;ev;ev=ev->next) {
if(ev->f & SELECT) vertsel++;
}
// Test for multiple segments
if(vertsel > numsel+1) {
error("Was not a single edge loop");
return 0;
}
// Get the edgeloop in order - mark f1 with SELECT once added
for(eed=em->edges.first;eed;eed=eed->next) {
if((eed->f & SELECT) && !(eed->f1 & SELECT)) {
// If this is the first edge added, just put it in
if(!edgelist) {
BLI_linklist_prepend(&edgelist,eed);
numadded++;
first = eed;
last = eed;
eed->f1 = SELECT;
} else {
if(editedge_getSharedVert(eed, last)) {
BLI_linklist_append(&edgelist,eed);
eed->f1 = SELECT;
numadded++;
last = eed;
} else if(editedge_getSharedVert(eed, first)) {
BLI_linklist_prepend(&edgelist,eed);
eed->f1 = SELECT;
numadded++;
first = eed;
}
}
}
if(eed->next == NULL && numadded != numsel) {
eed=em->edges.first;
timesthrough++;
}
// It looks like there was an unexpected case - Hopefully should not happen
if(timesthrough >= numsel*2) {
BLI_linklist_free(edgelist,NULL);
error("could not order loop");
return 0;
}
}
// Put the verts in order in a linklist
look = edgelist;
while(look) {
eed = look->link;
if(!vertlist) {
if(look->next) {
temp = look->next->link;
//This is the first entry takes care of extra vert
if(eed->v1 != temp->v1 && eed->v1 != temp->v2) {
BLI_linklist_append(&vertlist,eed->v1);
eed->v1->f1 = 1;
} else {
BLI_linklist_append(&vertlist,eed->v2);
eed->v2->f1 = 1;
}
} else {
//This is the case that we only have 1 edge
BLI_linklist_append(&vertlist,eed->v1);
eed->v1->f1 = 1;
}
}
// for all the entries
if(eed->v1->f1 != 1) {
BLI_linklist_append(&vertlist,eed->v1);
eed->v1->f1 = 1;
} else if(eed->v2->f1 != 1) {
BLI_linklist_append(&vertlist,eed->v2);
eed->v2->f1 = 1;
}
look = look->next;
}
// populate the SlideVerts
vertgh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp);
look = vertlist;
while(look) {
i=0;
j=0;
ev = look->link;
tempsv = (struct SlideVert*)MEM_mallocN(sizeof(struct SlideVert),"SlideVert");
tempsv->up = NULL;
tempsv->down = NULL;
tempsv->origvert.co[0] = ev->co[0];
tempsv->origvert.co[1] = ev->co[1];
tempsv->origvert.co[2] = ev->co[2];
tempsv->origvert.no[0] = ev->no[0];
tempsv->origvert.no[1] = ev->no[1];
tempsv->origvert.no[2] = ev->no[2];
// i is total edges that vert is on
// j is total selected edges that vert is on
for(eed=em->edges.first;eed;eed=eed->next) {
if(eed->v1 == ev || eed->v2 == ev) {
i++;
if(eed->f & SELECT) {
j++;
}
}
}
// If the vert is in the middle of an edge loop, it touches 2 selected edges and 2 unselected edges
if(i == 4 && j == 2) {
for(eed=em->edges.first;eed;eed=eed->next) {
if(editedge_containsVert(eed, ev)) {
if(!(eed->f & SELECT)) {
if(!tempsv->up) {
tempsv->up = eed;
} else if (!(tempsv->down)) {
tempsv->down = eed;
}
}
}
}
}
// If it is on the end of the loop, it touches 1 selected and as least 2 more unselected
if(i >= 3 && j == 1) {
for(eed=em->edges.first;eed;eed=eed->next) {
if(editedge_containsVert(eed, ev) && eed->f & SELECT) {
for(efa = em->faces.first;efa;efa=efa->next) {
if(editface_containsEdge(efa, eed)) {
if(editedge_containsVert(efa->e1, ev) && efa->e1 != eed) {
if(!tempsv->up) {
tempsv->up = efa->e1;
} else if (!(tempsv->down)) {
tempsv->down = efa->e1;
}
}
if(editedge_containsVert(efa->e2, ev) && efa->e2 != eed) {
if(!tempsv->up) {
tempsv->up = efa->e2;
} else if (!(tempsv->down)) {
tempsv->down = efa->e2;
}
}
if(editedge_containsVert(efa->e3, ev) && efa->e3 != eed) {
if(!tempsv->up) {
tempsv->up = efa->e3;
} else if (!(tempsv->down)) {
tempsv->down = efa->e3;
}
}
if(efa->e4) {
if(editedge_containsVert(efa->e4, ev) && efa->e4 != eed) {
if(!tempsv->up) {
tempsv->up = efa->e4;
} else if (!(tempsv->down)) {
tempsv->down = efa->e4;
}
}
}
}
}
}
}
}
if(i > 4 && j == 2) {
BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN);
BLI_linklist_free(vertlist,NULL);
BLI_linklist_free(edgelist,NULL);
return 0;
}
BLI_ghash_insert(vertgh,ev,tempsv);
look = look->next;
}
// make sure the UPs nad DOWNs are 'faceloops'
// Also find the nearest slidevert to the cursor
getmouseco_areawin(mval);
look = vertlist;
nearest = NULL;
vertdist = -1;
while(look) {
tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link);
if(!tempsv->up || !tempsv->down) {
error("Missing rails");
BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN);
BLI_linklist_free(vertlist,NULL);
BLI_linklist_free(edgelist,NULL);
return 0;
}
if(G.f & G_DRAW_EDGELEN) {
if(!(tempsv->up->f & SELECT)) {
tempsv->up->f |= SELECT;
tempsv->up->f2 |= 16;
} else {
tempsv->up->f2 |= ~16;
}
if(!(tempsv->down->f & SELECT)) {
tempsv->down->f |= SELECT;
tempsv->down->f2 |= 16;
} else {
tempsv->down->f2 |= ~16;
}
}
if(look->next != NULL) {
SlideVert *sv;
sv = BLI_ghash_lookup(vertgh,(EditVert*)look->next->link);
if(sv) {
float tempdist, co[2];
if(!sharesFace(tempsv->up,sv->up)) {
EditEdge *swap;
swap = sv->up;
sv->up = sv->down;
sv->down = swap;
}
view3d_project_float(curarea, tempsv->origvert.co, co, projectMat);
tempdist = sqrt(pow(co[0] - mval[0],2)+pow(co[1] - mval[1],2));
if(vertdist < 0) {
vertdist = tempdist;
nearest = (EditVert*)look->link;
} else if ( tempdist < vertdist ) {
vertdist = tempdist;
nearest = (EditVert*)look->link;
}
}
}
look = look->next;
}
if (uvlay_tot && (G.scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) {
int maxnum = 0;
uvarray = MEM_callocN( uvlay_tot * sizeof(GHash *), "SlideUVs Array");
suv_last = slideuvs = MEM_callocN( uvlay_tot * (numadded+1) * sizeof(SlideUv), "SlideUVs"); /* uvLayers * verts */
suv = NULL;
for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
uvarray[uvlay_idx] = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp);
for(ev=em->verts.first;ev;ev=ev->next) {
ev->tmp.l = 0;
}
look = vertlist;
while(look) {
float *uv_new;
tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link);
ev = look->link;
suv = NULL;
for(efa = em->faces.first;efa;efa=efa->next) {
if (ev->tmp.l != -1) { /* test for self, in this case its invalid */
int k=-1; /* face corner */
/* Is this vert in the faces corner? */
if (efa->v1==ev) k=0;
else if (efa->v2==ev) k=1;
else if (efa->v3==ev) k=2;
else if (efa->v4 && efa->v4==ev) k=3;
if (k != -1) {
MTFace *tf = CustomData_em_get_n(&em->fdata, efa->data, CD_MTFACE, uvlay_idx);
EditVert *ev_up, *ev_down;
uv_new = tf->uv[k];
if (ev->tmp.l) {
if (fabs(suv->origuv[0]-uv_new[0]) > 0.0001 || fabs(suv->origuv[1]-uv_new[1])) {
ev->tmp.l = -1; /* Tag as invalid */
BLI_linklist_free(suv->fuv_list,NULL);
suv->fuv_list = NULL;
BLI_ghash_remove(uvarray[uvlay_idx],ev, NULL, NULL);
suv = NULL;
break;
}
} else {
ev->tmp.l = 1;
suv = suv_last;
suv->fuv_list = NULL;
suv->uv_up = suv->uv_down = NULL;
suv->origuv[0] = uv_new[0];
suv->origuv[1] = uv_new[1];
BLI_linklist_prepend(&suv->fuv_list, uv_new);
BLI_ghash_insert(uvarray[uvlay_idx],ev,suv);
suv_last++; /* advance to next slide UV */
maxnum++;
}
/* Now get the uvs along the up or down edge if we can */
if (suv) {
if (!suv->uv_up) {
ev_up = editedge_getOtherVert(tempsv->up,ev);
if (efa->v1==ev_up) suv->uv_up = tf->uv[0];
else if (efa->v2==ev_up) suv->uv_up = tf->uv[1];
else if (efa->v3==ev_up) suv->uv_up = tf->uv[2];
else if (efa->v4 && efa->v4==ev_up) suv->uv_up = tf->uv[3];
}
if (!suv->uv_down) { /* if the first face was apart of the up edge, it cant be apart of the down edge */
ev_down = editedge_getOtherVert(tempsv->down,ev);
if (efa->v1==ev_down) suv->uv_down = tf->uv[0];
else if (efa->v2==ev_down) suv->uv_down = tf->uv[1];
else if (efa->v3==ev_down) suv->uv_down = tf->uv[2];
else if (efa->v4 && efa->v4==ev_down) suv->uv_down = tf->uv[3];
}
/* Copy the pointers to the face UV's */
BLI_linklist_prepend(&suv->fuv_list, uv_new);
}
}
}
}
look = look->next;
}
} /* end uv layer loop */
} /* end uvlay_tot */
// we should have enough info now to slide
len = 0.0f;
percp = -1;
while(draw) {
/* For the % calculation */
short mval[2];
float rc[2];
float v2[2], v3[2];
EditVert *centerVert, *upVert, *downVert;
getmouseco_areawin(mval);
if (!immediate && (mval[0] == mvalo[0] && mval[1] == mvalo[1])) {
PIL_sleep_ms(10);
} else {
char *p = str;;
mvalo[0] = mval[0];
mvalo[1] = mval[1];
tempsv = BLI_ghash_lookup(vertgh,nearest);
centerVert = editedge_getSharedVert(tempsv->up, tempsv->down);
upVert = editedge_getOtherVert(tempsv->up, centerVert);
downVert = editedge_getOtherVert(tempsv->down, centerVert);
view3d_project_float(curarea, upVert->co, v2, projectMat);
view3d_project_float(curarea, downVert->co, v3, projectMat);
/* Determine the % on which the loop should be cut */
rc[0]= v3[0]-v2[0];
rc[1]= v3[1]-v2[1];
len= rc[0]*rc[0]+ rc[1]*rc[1];
if (len==0) {len = 0.0001;}
if ((G.qual & LR_SHIFTKEY)==0) {
wasshift = 0;
labda= ( rc[0]*((mval[0]-v2[0])) + rc[1]*((mval[1]-v2[1])) )/len;
}
else {
if (wasshift==0) {
wasshift = 1;
shiftlabda = labda;
}
labda= ( rc[0]*((mval[0]-v2[0])) + rc[1]*((mval[1]-v2[1])) )/len / 10.0 + shiftlabda;
}
if(labda<=0.0) labda=0.0;
else if(labda>=1.0)labda=1.0;
perc=((1-labda)*2)-1;
if(G.qual == 0) {
perc *= 100;
perc = floor(perc);
perc /= 100;
} else if (G.qual == LR_CTRLKEY) {
perc *= 10;
perc = floor(perc);
perc /= 10;
}
if(prop == 0) {
len = len_v3v3(upVert->co,downVert->co)*((perc+1)/2);
if(flip == 1) {
len = len_v3v3(upVert->co,downVert->co) - len;
}
}
if (hasNumInput(&num))
{
applyNumInput(&num, &perc);
if (prop)
{
perc = MIN2(perc, 1);
perc = MAX2(perc, -1);
}
else
{
len = MIN2(perc, len_v3v3(upVert->co,downVert->co));
len = MAX2(len, 0);
}
}
//Adjust Edgeloop
if(immediate) {
perc = imperc;
}
percp = perc;
if(prop) {
look = vertlist;
while(look) {
EditVert *tempev;
ev = look->link;
tempsv = BLI_ghash_lookup(vertgh,ev);
tempev = editedge_getOtherVert((perc>=0)?tempsv->up:tempsv->down, ev);
interp_v3_v3v3(ev->co, tempsv->origvert.co, tempev->co, fabs(perc));
if (G.scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) {
for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) {
interp_v2_v2v2(uv_tmp, suv->origuv, (perc>=0)?suv->uv_up:suv->uv_down, fabs(perc));
fuv_link = suv->fuv_list;
while (fuv_link) {
copy_v2_v2(((float *)fuv_link->link), uv_tmp);
fuv_link = fuv_link->next;
}
}
}
}
look = look->next;
}
}
else {
//Non prop code
look = vertlist;
while(look) {
float newlen;
ev = look->link;
tempsv = BLI_ghash_lookup(vertgh,ev);
newlen = (len / len_v3v3(editedge_getOtherVert(tempsv->up,ev)->co,editedge_getOtherVert(tempsv->down,ev)->co));
if(newlen > 1.0) {newlen = 1.0;}
if(newlen < 0.0) {newlen = 0.0;}
if(flip == 0) {
interp_v3_v3v3(ev->co, editedge_getOtherVert(tempsv->down,ev)->co, editedge_getOtherVert(tempsv->up,ev)->co, fabs(newlen));
if (G.scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) {
/* dont do anything if no UVs */
for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) {
interp_v2_v2v2(uv_tmp, suv->uv_down, suv->uv_up, fabs(newlen));
fuv_link = suv->fuv_list;
while (fuv_link) {
copy_v2_v2(((float *)fuv_link->link), uv_tmp);
fuv_link = fuv_link->next;
}
}
}
}
} else{
interp_v3_v3v3(ev->co, editedge_getOtherVert(tempsv->up,ev)->co, editedge_getOtherVert(tempsv->down,ev)->co, fabs(newlen));
if (G.scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) {
/* dont do anything if no UVs */
for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
suv = BLI_ghash_lookup( uvarray[uvlay_idx], ev );
if (suv && suv->fuv_list && suv->uv_up && suv->uv_down) {
interp_v2_v2v2(uv_tmp, suv->uv_up, suv->uv_down, fabs(newlen));
fuv_link = suv->fuv_list;
while (fuv_link) {
copy_v2_v2(((float *)fuv_link->link), uv_tmp);
fuv_link = fuv_link->next;
}
}
}
}
}
look = look->next;
}
}
// Highlight the Control Edges
scrarea_do_windraw(curarea);
persp(PERSP_VIEW);
glPushMatrix();
mymultmatrix(G.obedit->obmat);
glColor3ub(0, 255, 0);
glBegin(GL_LINES);
glVertex3fv(upVert->co);
glVertex3fv(downVert->co);
glEnd();
if(prop == 0) {
// draw start edge for non-prop
glPointSize(5);
glBegin(GL_POINTS);
glColor3ub(255,0,255);
if(flip) {
glVertex3fv(upVert->co);
} else {
glVertex3fv(downVert->co);
}
glEnd();
}
glPopMatrix();
if(prop) {
p += sprintf(str, "(P)ercentage: ");
} else {
p += sprintf(str, "Non (P)rop Length: ");
}
if (hasNumInput(&num))
{
char num_str[20];
outputNumInput(&num, num_str);
p += sprintf(p, "%s", num_str);
}
else
{
if (prop)
{
p += sprintf(p, "%f", perc);
}
else
{
p += sprintf(p, "%f", len);
}
}
if (prop == 0) {
p += sprintf(p, ", Press (F) to flip control side");
}
headerprint(str);
screen_swapbuffers();
}
if(!immediate) {
while(qtest()) {
short val=0;
event= extern_qread(&val); // extern_qread stores important events for the mainloop to handle
/* val==0 on key-release event */
if (val) {
if(ELEM(event, ESCKEY, RIGHTMOUSE)) {
prop = 1; // Go back to prop mode
imperc = 0; // This is the % that gets set for immediate
immediate = 1; //Run through eval code 1 more time
cancel = 1; // Return -1
mvalo[0] = -1;
} else if(ELEM3(event, PADENTER, LEFTMOUSE, RETKEY)) {
draw = 0; // End looping now
} else if(event==MIDDLEMOUSE) {
perc = 0;
immediate = 1;
} else if(event==PKEY) {
initNumInput(&num); /* reset num input */
if (prop) {
prop = 0;
num.flag |= NUM_NO_NEGATIVE;
}
else {
prop = 1;
}
mvalo[0] = -1;
} else if(event==FKEY) {
(flip == 1) ? (flip = 0):(flip = 1);
mvalo[0] = -1;
} else if(ELEM(event, RIGHTARROWKEY, WHEELUPMOUSE)) { // Scroll through Control Edges
look = vertlist;
while(look) {
if(nearest == (EditVert*)look->link) {
if(look->next == NULL) {
nearest = (EditVert*)vertlist->link;
} else {
nearest = (EditVert*)look->next->link;
}
mvalo[0] = -1;
break;
}
look = look->next;
}
} else if(ELEM(event, LEFTARROWKEY, WHEELDOWNMOUSE)) { // Scroll through Control Edges
look = vertlist;
while(look) {
if(look->next) {
if(look->next->link == nearest) {
nearest = (EditVert*)look->link;
mvalo[0] = -1;
break;
}
} else {
if((EditVert*)vertlist->link == nearest) {
nearest = look->link;
mvalo[0] = -1;
break;
}
}
look = look->next;
}
}
if (handleNumInput(&num, event))
{
mvalo[0] = -1; /* NEED A BETTER WAY TO TRIGGER REDRAW */
}
}
}
} else {
draw = 0;
}
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
}
if(G.f & G_DRAW_EDGELEN) {
look = vertlist;
while(look) {
tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link);
if(tempsv != NULL) {
tempsv->up->f &= !SELECT;
tempsv->down->f &= !SELECT;
}
look = look->next;
}
}
force_draw(0);
if(!immediate)
EM_automerge(0);
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
scrarea_queue_winredraw(curarea);
//BLI_ghash_free(edgesgh, freeGHash, NULL);
BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN);
BLI_linklist_free(vertlist,NULL);
BLI_linklist_free(edgelist,NULL);
if (uvlay_tot && (G.scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) {
for (uvlay_idx=0; uvlay_idx<uvlay_tot; uvlay_idx++) {
BLI_ghash_free(uvarray[uvlay_idx], NULL, NULL);
}
MEM_freeN(uvarray);
MEM_freeN(slideuvs);
suv = suv_last-1;
while (suv >= slideuvs) {
if (suv->fuv_list) {
BLI_linklist_free(suv->fuv_list,NULL);
}
suv--;
}
allqueue(REDRAWIMAGE, 0);
}
if(cancel == 1) {
return -1;
}
else {
#ifdef WITH_VERSE
if(G.editMesh->vnode) {
sync_all_verseverts_with_editverts((VNode*)G.editMesh->vnode);
sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode);
}
#endif
}
return 1;
}
/* -------------------- More tools ------------------ */
void mesh_set_face_flags(short mode)

@ -4607,8 +4607,6 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
}
}
// XXX retopo_do_all();
if(ok) {
test2DNurb(nu);
@ -4636,7 +4634,7 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
RegionView3D *rv3d= CTX_wm_region_view3d(C);
if(rv3d && !RNA_property_is_set(op->ptr, "location")) {
if(rv3d && !RNA_struct_property_is_set(op->ptr, "location")) {
Curve *cu;
ViewContext vc;
float location[3];

@ -398,7 +398,7 @@ static int paste_file_exec(bContext *C, wmOperator *op)
static int paste_file_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
if(RNA_property_is_set(op->ptr, "filepath"))
if(RNA_struct_property_is_set(op->ptr, "filepath"))
return paste_file_exec(C, op);
WM_event_add_fileselect(C, op);
@ -1190,7 +1190,7 @@ static int insert_text_exec(bContext *C, wmOperator *op)
wchar_t *inserted_text;
int a, len;
if(!RNA_property_is_set(op->ptr, "text"))
if(!RNA_struct_property_is_set(op->ptr, "text"))
return OPERATOR_CANCELLED;
inserted_utf8= RNA_string_get_alloc(op->ptr, "text", NULL, 0);
@ -1223,10 +1223,10 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt)
int event= evt->type, val= evt->val;
wchar_t inserted_text[2]= {0};
if(RNA_property_is_set(op->ptr, "text"))
if(RNA_struct_property_is_set(op->ptr, "text"))
return insert_text_exec(C, op);
if(RNA_property_is_set(op->ptr, "accent")) {
if(RNA_struct_property_is_set(op->ptr, "accent")) {
if(cu->len!=0 && cu->pos>0)
accentcode= 1;
return OPERATOR_FINISHED;
@ -1673,7 +1673,7 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
path = (font && strcmp(font->name, FO_BUILTIN_NAME) != 0)? font->name: U.fontdir;
if(RNA_property_is_set(op->ptr, "filepath"))
if(RNA_struct_property_is_set(op->ptr, "filepath"))
return font_open_exec(C, op);
RNA_string_set(op->ptr, "filepath", path);

@ -66,5 +66,8 @@ int ED_space_image_show_uvshadow(struct SpaceImage *sima, struct Object *obedit)
/* UI level image (texture) updating... render calls own stuff (too) */
void ED_image_update_frame(const struct Main *mainp, int cfra);
void ED_image_draw_info(struct ARegion *ar, int color_manage, int channels,
int x, int y, const char cp[4], const float fp[4], int *zp, float *zpf);
#endif /* ED_IMAGE_H */

@ -831,7 +831,9 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block)
if(but->optype) {
IDProperty *prop= (but->opptr)? but->opptr->data: NULL;
if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE, buf, sizeof(buf))) {
if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE,
buf, sizeof(buf)))
{
UI_MENU_KEY_STR_CAT
}
}
@ -846,7 +848,9 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block)
IDP_AssignString(prop_menu_name, mt->idname, sizeof(mt->idname));
if(WM_key_event_operator_string(C, "WM_OT_call_menu", WM_OP_INVOKE_REGION_WIN, prop_menu, FALSE, buf, sizeof(buf))) {
if(WM_key_event_operator_string(C, "WM_OT_call_menu", WM_OP_INVOKE_REGION_WIN, prop_menu, FALSE,
buf, sizeof(buf)))
{
UI_MENU_KEY_STR_CAT
}
}

@ -4388,7 +4388,9 @@ static void but_shortcut_name_func(bContext *C, void *arg1, int UNUSED(event))
IDProperty *prop= (but->opptr)? but->opptr->data: NULL;
/* complex code to change name of button */
if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE, buf, sizeof(buf))) {
if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE,
buf, sizeof(buf)))
{
char *butstr_orig;
// XXX but->str changed... should not, remove the hotkey from it

@ -2742,6 +2742,11 @@ const char *uiLayoutIntrospect(uiLayout *layout)
return str;
}
static void ui_layout_operator_buts__reset_cb(bContext *UNUSED(C), void *op_pt, void *UNUSED(arg_dummy2))
{
WM_operator_properties_reset((wmOperator *)op_pt);
}
/* this function does not initialize the layout, functions can be called on the layout before and after */
void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,int (*check_prop)(struct PointerRNA *, struct PropertyRNA *), const char label_align, const short flag)
{
@ -2803,7 +2808,22 @@ void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,in
uiItemL(layout, IFACE_("No Properties"), ICON_NONE);
}
}
/* its possible that reset can do nothing if all have PROP_SKIP_SAVE enabled
* but this is not so important if this button is drawn in those cases
* (which isn't all that likely anyway) - campbell */
if (op->properties->len) {
uiBlock *block;
uiBut *but;
uiLayout *col; /* needed to avoid alignment errors with previous buttons */
col= uiLayoutColumn(layout, 0);
block= uiLayoutGetBlock(col);
but = uiDefIconTextBut(block , BUT, 0, ICON_FILE_REFRESH, "Reset", 0, 0, 18, 20, NULL, 0.0, 0.0, 0.0, 0.0,
"Reset operator defaults");
uiButSetFunc(but, ui_layout_operator_buts__reset_cb, op, NULL);
}
/* set various special settings for buttons */
{
uiBut *but;

@ -409,7 +409,9 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
/* operator keymap (not menus, they already have it) */
prop= (but->opptr)? but->opptr->data: NULL;
if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE, buf, sizeof(buf))) {
if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE,
buf, sizeof(buf)))
{
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Shortcut: %s"), buf);
data->color[data->totline]= 0x888888;
data->totline++;

@ -181,7 +181,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem)
/* fake button, it holds space for search items */
uiDefBut(block, LABEL, 0, "", 10, 15, w, h, NULL, 0, 0, 0, 0, NULL);
but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 0, w, 19, template.prv_rows, template.prv_cols, "");
but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, w, 19, template.prv_rows, template.prv_cols, "");
uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb, idptr.data);
}
/* list view */
@ -189,7 +189,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem)
/* fake button, it holds space for search items */
uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 0, 150, 19, 0, 0, "");
but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, "");
uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb, idptr.data);
}

@ -165,14 +165,14 @@ static unsigned int check_tria_face[4][3]= {
GLubyte checker_stipple_sml[32*32/8] =
{
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, \
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, \
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
};
/* ************************************************* */

@ -4827,7 +4827,7 @@ static int export_obj_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
BLI_strncpy(filename, "//untitled.obj", FILE_MAX);
if(RNA_property_is_set(op->ptr, "filepath"))
if(RNA_struct_property_is_set(op->ptr, "filepath"))
return mesh_export_obj_exec(C, op);
export_obj_filesel(C, op, filename);

@ -533,7 +533,7 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
/* check input variables */
if(RNA_property_is_set(op->ptr, "filepath")) {
if(RNA_struct_property_is_set(op->ptr, "filepath")) {
char path[FILE_MAX];
RNA_string_get(op->ptr, "filepath", path);

@ -189,35 +189,40 @@ void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode)
PropertyRNA *prop;
/* note: this property gets hidden for add-camera operator */
prop= RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view");
prop = RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view");
RNA_def_property_update_runtime(prop, view_align_update);
if(do_editmode) {
prop= RNA_def_boolean(ot->srna, "enter_editmode", 0, "Enter Editmode", "Enter editmode when adding this object");
RNA_def_property_flag(prop, PROP_HIDDEN);
prop = RNA_def_boolean(ot->srna, "enter_editmode", 0, "Enter Editmode",
"Enter editmode when adding this object");
RNA_def_property_flag(prop, PROP_HIDDEN|PROP_SKIP_SAVE);
}
RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location for the newly added object", -FLT_MAX, FLT_MAX);
RNA_def_float_rotation(ot->srna, "rotation", 3, NULL, -FLT_MAX, FLT_MAX, "Rotation", "Rotation for the newly added object", (float)-M_PI * 2.0f, (float)M_PI * 2.0f);
prop = RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location",
"Location for the newly added object", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_float_rotation(ot->srna, "rotation", 3, NULL, -FLT_MAX, FLT_MAX, "Rotation",
"Rotation for the newly added object", (float)-M_PI * 2.0f, (float)M_PI * 2.0f);
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_boolean_layer_member(ot->srna, "layers", 20, NULL, "Layer", "");
RNA_def_property_flag(prop, PROP_HIDDEN);
RNA_def_property_flag(prop, PROP_HIDDEN|PROP_SKIP_SAVE);
}
static void object_add_generic_invoke_options(bContext *C, wmOperator *op)
{
if(RNA_struct_find_property(op->ptr, "enter_editmode")) /* optional */
if (!RNA_property_is_set(op->ptr, "enter_editmode"))
if (!RNA_struct_property_is_set(op->ptr, "enter_editmode"))
RNA_boolean_set(op->ptr, "enter_editmode", U.flag & USER_ADD_EDITMODE);
if(!RNA_property_is_set(op->ptr, "location")) {
if(!RNA_struct_property_is_set(op->ptr, "location")) {
float loc[3];
ED_object_location_from_view(C, loc);
RNA_float_set_array(op->ptr, "location", loc);
}
if(!RNA_property_is_set(op->ptr, "layers")) {
if(!RNA_struct_property_is_set(op->ptr, "layers")) {
View3D *v3d = CTX_wm_view3d(C);
Scene *scene = CTX_data_scene(C);
int a, values[20], layer;
@ -257,7 +262,7 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc,
*enter_editmode = TRUE;
}
if(RNA_property_is_set(op->ptr, "layers")) {
if(RNA_struct_property_is_set(op->ptr, "layers")) {
RNA_boolean_get_array(op->ptr, "layers", layer_values);
*layer= 0;
for(a=0; a<20; a++) {
@ -278,9 +283,9 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc,
if(v3d && v3d->localvd)
*layer |= v3d->lay;
if(RNA_property_is_set(op->ptr, "rotation"))
if(RNA_struct_property_is_set(op->ptr, "rotation"))
view_align = FALSE;
else if (RNA_property_is_set(op->ptr, "view_align"))
else if (RNA_struct_property_is_set(op->ptr, "view_align"))
view_align = RNA_boolean_get(op->ptr, "view_align");
else {
view_align = U.flag & USER_ADD_VIEWALIGNED;

@ -553,7 +553,7 @@ static int edit_constraint_invoke_properties(bContext *C, wmOperator *op)
bConstraint *con;
ListBase *list;
if (RNA_property_is_set(op->ptr, "constraint") && RNA_property_is_set(op->ptr, "owner"))
if (RNA_struct_property_is_set(op->ptr, "constraint") && RNA_struct_property_is_set(op->ptr, "owner"))
return 1;
if (ptr.data) {

@ -322,9 +322,6 @@ void ED_object_exit_editmode(bContext *C, int flag)
// if(EM_texFaceCheck())
// if(retopo_mesh_paint_check())
// retopo_end_okee();
if(me->edit_btmesh->bm->totvert>MESH_MAX_VERTS) {
error("Too many vertices");
return;

@ -748,7 +748,7 @@ static int edit_modifier_invoke_properties(bContext *C, wmOperator *op)
PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier);
ModifierData *md;
if (RNA_property_is_set(op->ptr, "modifier"))
if (RNA_struct_property_is_set(op->ptr, "modifier"))
return 1;
if (ptr.data) {
@ -1281,7 +1281,7 @@ static int multires_external_save_invoke(bContext *C, wmOperator *op, wmEvent *U
if(CustomData_external_test(&me->ldata, CD_MDISPS))
return OPERATOR_CANCELLED;
if(RNA_property_is_set(op->ptr, "filepath"))
if(RNA_struct_property_is_set(op->ptr, "filepath"))
return multires_external_save_exec(C, op);
op->customdata= me;

@ -1054,7 +1054,7 @@ static unsigned int move_to_layer_init(bContext *C, wmOperator *op)
int values[20], a;
unsigned int lay= 0;
if(!RNA_property_is_set(op->ptr, "layers")) {
if(!RNA_struct_property_is_set(op->ptr, "layers")) {
/* note: layers are set in bases, library objects work for this */
CTX_DATA_BEGIN(C, Base*, base, selected_bases) {
lay |= base->lay;

@ -646,7 +646,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
/* get the view settings if 'around' isnt set and the view is available */
View3D *v3d= CTX_wm_view3d(C);
copy_v3_v3(cursor, give_cursor(scene, v3d));
if(v3d && !RNA_property_is_set(op->ptr, "center"))
if(v3d && !RNA_struct_property_is_set(op->ptr, "center"))
around= v3d->around;
}

@ -884,7 +884,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
if(getenv(strEnvName)) {
int dlevel = atoi(getenv(strEnvName));
elbeemSetDebugLevel(dlevel);
BLI_snprintf(debugStrBuffer,256,"fluidsimBake::msg: Debug messages activated due to envvar '%s'\n",strEnvName);
BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer),"fluidsimBake::msg: Debug messages activated due to envvar '%s'\n",strEnvName);
elbeemDebugOut(debugStrBuffer);
}
@ -921,7 +921,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
/* rough check of settings... */
if(domainSettings->previewresxyz > domainSettings->resolutionxyz) {
BLI_snprintf(debugStrBuffer,256,"fluidsimBake::warning - Preview (%d) >= Resolution (%d)... setting equal.\n", domainSettings->previewresxyz , domainSettings->resolutionxyz);
BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"fluidsimBake::warning - Preview (%d) >= Resolution (%d)... setting equal.\n", domainSettings->previewresxyz , domainSettings->resolutionxyz);
elbeemDebugOut(debugStrBuffer);
domainSettings->previewresxyz = domainSettings->resolutionxyz;
}
@ -941,7 +941,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
} else {
gridlevels = domainSettings->maxRefine;
}
BLI_snprintf(debugStrBuffer,256,"fluidsimBake::msg: Baking %s, refine: %d\n", fsDomain->id.name , gridlevels );
BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"fluidsimBake::msg: Baking %s, refine: %d\n", fsDomain->id.name , gridlevels );
elbeemDebugOut(debugStrBuffer);
@ -993,7 +993,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
/* ******** init domain object's matrix ******** */
copy_m4_m4(domainMat, fsDomain->obmat);
if(!invert_m4_m4(invDomMat, domainMat)) {
BLI_snprintf(debugStrBuffer,256,"fluidsimBake::error - Invalid obj matrix?\n");
BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"fluidsimBake::error - Invalid obj matrix?\n");
elbeemDebugOut(debugStrBuffer);
BKE_report(reports, RPT_ERROR, "Invalid object matrix");

@ -160,7 +160,7 @@ void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volat
static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **scene, SceneRenderLayer **srl)
{
/* single layer re-render */
if(RNA_property_is_set(op->ptr, "scene")) {
if(RNA_struct_property_is_set(op->ptr, "scene")) {
Scene *scn;
char scene_name[MAX_ID_NAME-2];
@ -176,7 +176,7 @@ static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **s
}
}
if(RNA_property_is_set(op->ptr, "layer")) {
if(RNA_struct_property_is_set(op->ptr, "layer")) {
SceneRenderLayer *rl;
char rl_name[RE_MAXNAME];
@ -537,7 +537,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* custom scene and single layer re-render */
screen_render_scene_layer_set(op, mainp, &scene, &srl);
if(RNA_property_is_set(op->ptr, "layer"))
if(RNA_struct_property_is_set(op->ptr, "layer"))
jobflag |= WM_JOB_SUSPEND;
/* job custom data */

@ -40,6 +40,7 @@
#include "BLI_editVert.h"
#include "BLI_dlrbTree.h"
#include "BLI_utildefines.h"
#include "BLI_jitter.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
@ -150,28 +151,31 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
}
else {
/* simple accumulation, less hassle then FSAA FBO's */
# define SAMPLES 5 /* fixed, easy to have more but for now this is ok */
const float jit_ofs[SAMPLES][2] = {{0, 0}, {0.5f, 0.5f}, {-0.5f,-0.5f}, {-0.5f, 0.5f}, {0.5f, -0.5f}};
static float jit_ofs[32][2];
float winmat_jitter[4][4];
float *accum_buffer= MEM_mallocN(sizex * sizey * sizeof(float) * 4, "accum1");
float *accum_tmp= MEM_mallocN(sizex * sizey * sizeof(float) * 4, "accum2");
int j;
BLI_initjit(jit_ofs[0], scene->r.osa);
/* first sample buffer, also initializes 'rv3d->persmat' */
ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat);
GPU_offscreen_read_pixels(oglrender->ofs, GL_FLOAT, accum_buffer);
/* skip the first sample */
for(j=1; j < SAMPLES; j++) {
for(j=1; j < scene->r.osa; j++) {
copy_m4_m4(winmat_jitter, winmat);
window_translate_m4(winmat_jitter, rv3d->persmat, jit_ofs[j][0] / sizex, jit_ofs[j][1] / sizey);
window_translate_m4(winmat_jitter, rv3d->persmat,
(jit_ofs[j][0] * 2.0f) / sizex,
(jit_ofs[j][1] * 2.0f) / sizey);
ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat_jitter);
GPU_offscreen_read_pixels(oglrender->ofs, GL_FLOAT, accum_tmp);
add_vn_vn(accum_buffer, accum_tmp, sizex*sizey*sizeof(float));
}
mul_vn_vn_fl(rr->rectf, accum_buffer, sizex*sizey*sizeof(float), 1.0/SAMPLES);
mul_vn_vn_fl(rr->rectf, accum_buffer, sizex*sizey*sizeof(float), 1.0f / scene->r.osa);
MEM_freeN(accum_buffer);
MEM_freeN(accum_tmp);

@ -104,7 +104,7 @@ ImBuf* get_brush_icon(Brush *brush)
{
static const int flags = IB_rect|IB_multilayer|IB_metadata;
char path[240];
char path[FILE_MAX];
char *folder;
if (!(brush->icon_imbuf)) {

@ -705,7 +705,7 @@ static int envmap_save_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event
{
//Scene *scene= CTX_data_scene(C);
if(RNA_property_is_set(op->ptr, "filepath"))
if(RNA_struct_property_is_set(op->ptr, "filepath"))
return envmap_save_exec(C, op);
//RNA_enum_set(op->ptr, "file_type", scene->r.im_format.imtype);

@ -1689,8 +1689,6 @@ ScrArea *ED_screen_full_toggle(bContext *C, wmWindow *win, ScrArea *sa)
/* XXX bad code: setscreen() ends with first area active. fullscreen render assumes this too */
CTX_wm_area_set(C, sc->areabase.first);
/* XXX retopo_force_update(); */
return sc->areabase.first;
}

@ -1346,12 +1346,12 @@ static int area_split_invoke(bContext *C, wmOperator *op, wmEvent *event)
int x, y;
/* retrieve initial mouse coord, so we can find the active edge */
if(RNA_property_is_set(op->ptr, "mouse_x"))
if(RNA_struct_property_is_set(op->ptr, "mouse_x"))
x= RNA_int_get(op->ptr, "mouse_x");
else
x= event->x;
if(RNA_property_is_set(op->ptr, "mouse_y"))
if(RNA_struct_property_is_set(op->ptr, "mouse_y"))
y= RNA_int_get(op->ptr, "mouse_y");
else
y= event->x;
@ -3060,7 +3060,7 @@ static int screen_animation_play_exec(bContext *C, wmOperator *op)
int mode= (RNA_boolean_get(op->ptr, "reverse")) ? -1 : 1;
int sync= -1;
if (RNA_property_is_set(op->ptr, "sync"))
if (RNA_struct_property_is_set(op->ptr, "sync"))
sync= (RNA_boolean_get(op->ptr, "sync"));
return ED_screen_animation_play(C, sync, mode);

@ -198,7 +198,7 @@ static int screenshot_exec(bContext *C, wmOperator *op)
static int screenshot_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
if(screenshot_data_create(C, op)) {
if(RNA_property_is_set(op->ptr, "filepath"))
if(RNA_struct_property_is_set(op->ptr, "filepath"))
return screenshot_exec(C, op);
RNA_string_set(op->ptr, "filepath", G.ima);

@ -4862,7 +4862,7 @@ static int texture_paint_init(bContext *C, wmOperator *op)
image_undo_restore, image_undo_free);
/* create painter */
pop->painter= brush_painter_new(pop->s.brush);
pop->painter= brush_painter_new(scene, pop->s.brush);
return 1;
}
@ -4968,6 +4968,7 @@ static int paint_exec(bContext *C, wmOperator *op)
static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event)
{
const Scene *scene = CTX_data_scene(C);
PaintOperation *pop= op->customdata;
wmTabletData *wmtab;
PointerRNA itemptr;
@ -4999,13 +5000,13 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event)
/* special exception here for too high pressure values on first touch in
windows for some tablets, then we just skip first touch .. */
if (tablet && (pressure >= 0.99f) && ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || brush_use_alpha_pressure(pop->s.brush) || brush_use_size_pressure(pop->s.brush)))
if (tablet && (pressure >= 0.99f) && ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || brush_use_alpha_pressure(scene, pop->s.brush) || brush_use_size_pressure(scene, pop->s.brush)))
return;
/* This can be removed once fixed properly in
brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, double time, float pressure, void *user)
at zero pressure we should do nothing 1/2^12 is .0002 which is the sensitivity of the most sensitive pen tablet available*/
if (tablet && (pressure < .0002f) && ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || brush_use_alpha_pressure(pop->s.brush) || brush_use_size_pressure(pop->s.brush)))
if (tablet && (pressure < .0002f) && ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || brush_use_alpha_pressure(scene, pop->s.brush) || brush_use_size_pressure(scene, pop->s.brush)))
return;
}

@ -453,7 +453,7 @@ static void paint_draw_alpha_overlay(Sculpt *sd, Brush *brush,
glTranslatef(-0.5f, -0.5f, 0);
/* scale based on tablet pressure */
if(sd->draw_pressure && brush_use_size_pressure(brush)) {
if(sd->draw_pressure && brush_use_size_pressure(vc->scene, brush)) {
glTranslatef(0.5f, 0.5f, 0);
glScalef(1.0f/sd->pressure_value, 1.0f/sd->pressure_value, 1);
glTranslatef(-0.5f, -0.5f, 0);
@ -515,7 +515,7 @@ static void paint_cursor_on_hit(Sculpt *sd, Brush *brush, ViewContext *vc,
/* TODO: check whether this should really only be done when
brush is over mesh? */
if(sd->draw_pressure && brush_use_alpha_pressure(brush))
if(sd->draw_pressure && brush_use_alpha_pressure(vc->scene, brush))
(*visual_strength) *= sd->pressure_value;
if(sd->draw_anchored)
@ -529,16 +529,17 @@ static void paint_cursor_on_hit(Sculpt *sd, Brush *brush, ViewContext *vc,
unprojected_radius = paint_calc_object_space_radius(vc, location,
projected_radius);
if(sd->draw_pressure && brush_use_size_pressure(brush))
if(sd->draw_pressure && brush_use_size_pressure(vc->scene, brush))
unprojected_radius *= sd->pressure_value;
if(!brush_use_locked_size(brush))
if(!brush_use_locked_size(vc->scene, brush))
brush_set_unprojected_radius(brush, unprojected_radius);
}
static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
{
Paint *paint = paint_get_active(CTX_data_scene(C));
Scene *scene = CTX_data_scene(C);
Paint *paint = paint_get_active(scene);
Brush *brush = paint_brush(paint);
ViewContext vc;
float final_radius;
@ -597,7 +598,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
/* draw overlay */
paint_draw_alpha_overlay(sd, brush, &vc, x, y);
if(brush_use_locked_size(brush))
if(brush_use_locked_size(scene, brush))
brush_set_size(brush, pixel_radius);
/* check if brush is subtracting, use different color then */
@ -764,12 +765,13 @@ static int paint_space_stroke(bContext *C, wmOperator *op, wmEvent *event, const
length = len_v2(vec);
if(length > FLT_EPSILON) {
const Scene *scene = CTX_data_scene(C);
int steps;
int i;
float pressure= 1.0f;
/* XXX mysterious :) what has 'use size' do with this here... if you don't check for it, pressure fails */
if(brush_use_size_pressure(stroke->brush))
if(brush_use_size_pressure(scene, stroke->brush))
pressure = event_tablet_data(event, NULL);
if(pressure > FLT_EPSILON) {

@ -2055,6 +2055,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED
static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr)
{
const Scene *scene= CTX_data_scene(C);
ToolSettings *ts= CTX_data_tool_settings(C);
VPaint *wp= ts->wpaint;
Brush *brush = paint_brush(&wp->paint);
@ -2073,8 +2074,8 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
char *defbase_sel;
const float pressure = RNA_float_get(itemptr, "pressure");
const float brush_size_final = brush_size(brush) * (brush_use_size_pressure(brush) ? pressure : 1.0f);
const float brush_alpha_final = brush_alpha(brush) * (brush_use_alpha_pressure(brush) ? pressure : 1.0f);
const float brush_size_final = brush_size(brush) * (brush_use_size_pressure(scene, brush) ? pressure : 1.0f);
const float brush_alpha_final = brush_alpha(brush) * (brush_use_alpha_pressure(scene, brush) ? pressure : 1.0f);
/* intentionally dont initialize as NULL, make sure we initialize all members below */
WeightPaintInfo wpi;
@ -2567,6 +2568,7 @@ static void vpaint_paint_face(VPaint *vp, VPaintData *vpd, Object *ob,
static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr)
{
const Scene *scene= CTX_data_scene(C);
ToolSettings *ts= CTX_data_tool_settings(C);
struct VPaintData *vpd = paint_stroke_mode_data(stroke);
VPaint *vp= ts->vpaint;
@ -2581,8 +2583,8 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
float mval[2];
const float pressure = RNA_float_get(itemptr, "pressure");
const float brush_size_final = brush_size(brush) * (brush_use_size_pressure(brush) ? pressure : 1.0f);
const float brush_alpha_final = brush_alpha(brush) * (brush_use_alpha_pressure(brush) ? pressure : 1.0f);
const float brush_size_final = brush_size(brush) * (brush_use_size_pressure(scene, brush) ? pressure : 1.0f);
const float brush_alpha_final = brush_alpha(brush) * (brush_use_alpha_pressure(scene, brush) ? pressure : 1.0f);
RNA_float_get_array(itemptr, "mouse", mval);
flip = RNA_boolean_get(itemptr, "pen_flip");

@ -549,7 +549,7 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache, float feather)
const float root_alpha = brush_alpha(brush);
float alpha = root_alpha*root_alpha;
float dir = brush->flag & BRUSH_DIR_IN ? -1 : 1;
float pressure = brush_use_alpha_pressure(brush) ? cache->pressure : 1;
float pressure = brush_use_alpha_pressure(cache->vc->scene, brush) ? cache->pressure : 1;
float pen_flip = cache->pen_flip ? -1 : 1;
float invert = cache->invert ? -1 : 1;
float accum = integrate_overlap(brush);
@ -3017,6 +3017,7 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
struct PaintStroke *stroke,
PointerRNA *ptr)
{
const Scene *scene = CTX_data_scene(C);
SculptSession *ss = ob->sculpt;
StrokeCache *cache = ss->cache;
Brush *brush = paint_brush(&sd->paint);
@ -3054,7 +3055,7 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
cache->pixel_radius = brush_size(brush);
if(cache->first_time) {
if (!brush_use_locked_size(brush)) {
if (!brush_use_locked_size(scene, brush)) {
cache->initial_radius= paint_calc_object_space_radius(cache->vc, cache->true_location, brush_size(brush));
brush_set_unprojected_radius(brush, cache->initial_radius);
}
@ -3063,7 +3064,7 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
}
}
if(brush_use_size_pressure(brush)) {
if(brush_use_size_pressure(scene, brush)) {
cache->pixel_radius *= cache->pressure;
cache->radius= cache->initial_radius * cache->pressure;
}
@ -3287,7 +3288,8 @@ static void sculpt_restore_mesh(Sculpt *sd, SculptSession *ss)
/* Restore the mesh before continuing with anchored stroke */
if((brush->flag & BRUSH_ANCHORED) ||
(brush->sculpt_tool == SCULPT_TOOL_GRAB && brush_use_size_pressure(brush)) ||
(brush->sculpt_tool == SCULPT_TOOL_GRAB &&
brush_use_size_pressure(ss->cache->vc->scene, brush)) ||
(brush->flag & BRUSH_RESTORE_MESH))
{
StrokeCache *cache = ss->cache;

@ -162,7 +162,7 @@ static int sound_open_exec(bContext *UNUSED(C), wmOperator *op)
static int sound_open_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
if(RNA_property_is_set(op->ptr, "filepath"))
if(RNA_struct_property_is_set(op->ptr, "filepath"))
return sound_open_exec(C, op);
sound_open_init(C, op);
@ -359,7 +359,7 @@ static int sound_mixdown_exec(bContext *C, wmOperator *op)
static int sound_mixdown_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
if(RNA_property_is_set(op->ptr, "filepath"))
if(RNA_struct_property_is_set(op->ptr, "filepath"))
return sound_mixdown_exec(C, op);
return WM_operator_filesel(C, op, event);
@ -653,7 +653,7 @@ static int sound_unpack_exec(bContext *C, wmOperator *op)
bSound* sound= NULL;
/* find the suppplied image by name */
if (RNA_property_is_set(op->ptr, "id")) {
if (RNA_struct_property_is_set(op->ptr, "id")) {
char sndname[MAX_ID_NAME-2];
RNA_string_get(op->ptr, "id", sndname);
sound = BLI_findstring(&CTX_data_main(C)->sound, sndname, offsetof(ID, name) + 2);
@ -675,7 +675,7 @@ static int sound_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
Editing* ed = CTX_data_scene(C)->ed;
bSound* sound;
if(RNA_property_is_set(op->ptr, "id"))
if(RNA_struct_property_is_set(op->ptr, "id"))
return sound_unpack_exec(C, op);
if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND)

@ -103,7 +103,7 @@ static int file_browse_exec(bContext *C, wmOperator *op)
char *str, path[FILE_MAX];
const char *path_prop= RNA_struct_find_property(op->ptr, "directory") ? "directory" : "filepath";
if (RNA_property_is_set(op->ptr, path_prop)==0 || fbo==NULL)
if (RNA_struct_property_is_set(op->ptr, path_prop)==0 || fbo==NULL)
return OPERATOR_CANCELLED;
str= RNA_string_get_alloc(op->ptr, path_prop, NULL, 0);
@ -200,7 +200,7 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* normally ED_fileselect_get_params would handle this but we need to because of stupid
* user-prefs exception - campbell */
if(RNA_struct_find_property(op->ptr, "relative_path")) {
if(!RNA_property_is_set(op->ptr, "relative_path")) {
if(!RNA_struct_property_is_set(op->ptr, "relative_path")) {
/* annoying exception!, if were dealign with the user prefs, default relative to be off */
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS && (ptr.data != &U));
}

@ -184,10 +184,10 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
if(clip)
path= clip->name;
if(!RNA_property_is_set(op->ptr, "relative_path"))
if(!RNA_struct_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
if(RNA_property_is_set(op->ptr, "filepath"))
if(RNA_struct_property_is_set(op->ptr, "filepath"))
return open_exec(C, op);
open_init(C, op);

@ -410,7 +410,7 @@ static int console_insert_exec(bContext *C, wmOperator *op)
static int console_insert_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
// if(!RNA_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */
// if(!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */
if(!RNA_string_length(op->ptr, "text")) {
/* if alt/ctrl/super are pressed pass through */
if(event->ctrl || event->oskey) {

@ -130,7 +130,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
else
params->type = FILE_SPECIAL;
if (is_filepath && RNA_property_is_set(op->ptr, "filepath")) {
if (is_filepath && RNA_struct_property_is_set(op->ptr, "filepath")) {
char name[FILE_MAX];
RNA_string_get(op->ptr, "filepath", name);
if (params->type == FILE_LOADLIB) {
@ -142,12 +142,12 @@ short ED_fileselect_set_params(SpaceFile *sfile)
}
}
else {
if (is_directory && RNA_property_is_set(op->ptr, "directory")) {
if (is_directory && RNA_struct_property_is_set(op->ptr, "directory")) {
RNA_string_get(op->ptr, "directory", params->dir);
sfile->params->file[0]= '\0';
}
if (is_filename && RNA_property_is_set(op->ptr, "filename")) {
if (is_filename && RNA_struct_property_is_set(op->ptr, "filename")) {
RNA_string_get(op->ptr, "filename", params->file);
}
}
@ -226,7 +226,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
}
if (is_relative_path) {
if (!RNA_property_is_set(op->ptr, "relative_path")) {
if (!RNA_struct_property_is_set(op->ptr, "relative_path")) {
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
}
}

@ -110,7 +110,8 @@ static void draw_render_info(Scene *scene, Image *ima, ARegion *ar)
BKE_image_release_renderresult(scene, ima);
}
void draw_image_info(ARegion *ar, int color_manage, int channels, int x, int y, const char cp[4], const float fp[4], int *zp, float *zpf)
/* used by node view too */
void ED_image_draw_info(ARegion *ar, int color_manage, int channels, int x, int y, const char cp[4], const float fp[4], int *zp, float *zpf)
{
char str[256];
float dx= 6;
@ -378,14 +379,14 @@ static void sima_draw_alpha_backdrop(float x1, float y1, float xsize, float ysiz
{
GLubyte checker_stipple[32*32/8] =
{
255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \
255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \
255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \
255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \
0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, \
0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, \
0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, \
0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, \
255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0,
255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0,
255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0,
255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0,
0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255,
0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255,
0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255,
0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255,
};
glColor3ubv(col1);

@ -55,7 +55,6 @@ void IMAGE_OT_toolbox(struct wmOperatorType *ot);
/* image_draw.c */
void draw_image_main(struct SpaceImage *sima, struct ARegion *ar, struct Scene *scene);
void draw_image_info(struct ARegion *ar, int color_manage, int channels, int x, int y, const char cp[4], const float fp[4], int *zp, float *zpf);
void draw_image_grease_pencil(struct bContext *C, short onlyv2d);
/* image_ops.c */

@ -817,7 +817,7 @@ static int image_open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
if(ima)
path= ima->name;
if(RNA_property_is_set(op->ptr, "filepath"))
if(RNA_struct_property_is_set(op->ptr, "filepath"))
return image_open_exec(C, op);
image_open_init(C, op);
@ -876,10 +876,10 @@ static int image_replace_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
if(!sima->image)
return OPERATOR_CANCELLED;
if(RNA_property_is_set(op->ptr, "filepath"))
if(RNA_struct_property_is_set(op->ptr, "filepath"))
return image_replace_exec(C, op);
if(!RNA_property_is_set(op->ptr, "relative_path"))
if(!RNA_struct_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", (strncmp(sima->image->name, "//", 2))==0);
image_filesel(C, op, sima->image->name);
@ -1011,7 +1011,7 @@ static void save_image_options_from_op(SaveImageOptions *simopts, wmOperator *op
simopts->im_format= *(ImageFormatData *)op->customdata;
}
if (RNA_property_is_set(op->ptr, "filepath")) {
if (RNA_struct_property_is_set(op->ptr, "filepath")) {
RNA_string_get(op->ptr, "filepath", simopts->filepath);
BLI_path_abs(simopts->filepath, G.main->name);
}
@ -1176,7 +1176,7 @@ static int image_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
Scene *scene= CTX_data_scene(C);
SaveImageOptions simopts;
if(RNA_property_is_set(op->ptr, "filepath"))
if(RNA_struct_property_is_set(op->ptr, "filepath"))
return image_save_as_exec(C, op);
if (save_image_options_init(&simopts, sima, scene, TRUE) == 0)
@ -1184,7 +1184,7 @@ static int image_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
save_image_options_to_op(&simopts, op);
/* enable save_copy by default for render results */
if(ELEM(ima->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE) && !RNA_property_is_set(op->ptr, "copy")) {
if(ELEM(ima->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE) && !RNA_struct_property_is_set(op->ptr, "copy")) {
RNA_boolean_set(op->ptr, "copy", TRUE);
}
@ -1676,7 +1676,7 @@ static int image_unpack_exec(bContext *C, wmOperator *op)
int method= RNA_enum_get(op->ptr, "method");
/* find the suppplied image by name */
if (RNA_property_is_set(op->ptr, "id")) {
if (RNA_struct_property_is_set(op->ptr, "id")) {
char imaname[MAX_ID_NAME-2];
RNA_string_get(op->ptr, "id", imaname);
ima = BLI_findstring(&CTX_data_main(C)->image, imaname, offsetof(ID, name) + 2);
@ -1708,7 +1708,7 @@ static int image_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
{
Image *ima= CTX_data_edit_image(C);
if(RNA_property_is_set(op->ptr, "id"))
if(RNA_struct_property_is_set(op->ptr, "id"))
return image_unpack_exec(C, op);
if(!ima || !ima->packedfile)
@ -1772,7 +1772,7 @@ static void image_sample_draw(const bContext *UNUSED(C), ARegion *ar, void *arg_
ImageSampleInfo *info= arg_info;
if(info->draw) {
/* no color management needed for images (color_manage=0) */
draw_image_info(ar, 0, info->channels, info->x, info->y, info->colp, info->colfp, info->zp, info->zfp);
ED_image_draw_info(ar, 0, info->channels, info->x, info->y, info->colp, info->colfp, info->zp, info->zfp);
}
}

@ -593,8 +593,13 @@ static void image_refresh(const bContext *C, ScrArea *UNUSED(sa))
/* new shading system, get image from material */
BMFace *efa = BM_get_actFace(em->bm, sloppy);
if(efa)
ED_object_get_active_image(obedit, efa->mat_nr, &sima->image, NULL, NULL);
if(efa) {
Image *node_ima;
ED_object_get_active_image(obedit, efa->mat_nr, &node_ima, NULL, NULL);
if(node_ima)
sima->image= node_ima;
}
}
else {
/* old shading system, we set texface */

@ -96,7 +96,7 @@ static int edit_sensor_invoke_properties(bContext *C, wmOperator *op)
{
PointerRNA ptr= CTX_data_pointer_get_type(C, "sensor", &RNA_Sensor);
if (RNA_property_is_set(op->ptr, "sensor") && RNA_property_is_set(op->ptr, "object") )
if (RNA_struct_property_is_set(op->ptr, "sensor") && RNA_struct_property_is_set(op->ptr, "object") )
return 1;
if (ptr.data) {
@ -152,7 +152,7 @@ static int edit_controller_invoke_properties(bContext *C, wmOperator *op)
{
PointerRNA ptr= CTX_data_pointer_get_type(C, "controller", &RNA_Controller);
if (RNA_property_is_set(op->ptr, "controller") && RNA_property_is_set(op->ptr, "object") )
if (RNA_struct_property_is_set(op->ptr, "controller") && RNA_struct_property_is_set(op->ptr, "object") )
return 1;
if (ptr.data) {
@ -191,7 +191,7 @@ static int edit_actuator_invoke_properties(bContext *C, wmOperator *op)
{
PointerRNA ptr= CTX_data_pointer_get_type(C, "actuator", &RNA_Actuator);
if (RNA_property_is_set(op->ptr, "actuator") && RNA_property_is_set(op->ptr, "object") )
if (RNA_struct_property_is_set(op->ptr, "actuator") && RNA_struct_property_is_set(op->ptr, "object") )
return 1;
if (ptr.data) {

@ -2279,211 +2279,6 @@ void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage)
}
}
void draw_nodespace_color_info(ARegion *ar, int color_manage, int channels, int x, int y, const char cp[4], const float fp[4])
{
char str[256];
float dx= 6;
/* text colors */
/* XXX colored text not allowed in Blender UI */
#if 0
unsigned char red[3] = {255, 50, 50};
unsigned char green[3] = {0, 255, 0};
unsigned char blue[3] = {100, 100, 255};
#else
unsigned char red[3] = {255, 255, 255};
unsigned char green[3] = {255, 255, 255};
unsigned char blue[3] = {255, 255, 255};
#endif
float hue=0, sat=0, val=0, lum=0, u=0, v=0;
float col[4], finalcol[4];
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
/* noisy, high contrast make impossible to read if lower alpha is used. */
glColor4ub(0, 0, 0, 190);
glRecti(0.0, 0.0, ar->winrct.xmax - ar->winrct.xmin + 1, 20);
glDisable(GL_BLEND);
BLF_size(blf_mono_font, 11, 72);
glColor3ub(255, 255, 255);
BLI_snprintf(str, sizeof(str), "X:%-4d Y:%-4d |", x, y);
// UI_DrawString(6, 6, str); // works ok but fixed width is nicer.
BLF_position(blf_mono_font, dx, 6, 0);
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
#if 0 /* XXX no Z value in compo backdrop atm */
if(zp) {
glColor3ub(255, 255, 255);
BLI_snprintf(str, sizeof(str), " Z:%-.4f |", 0.5f+0.5f*(((float)*zp)/(float)0x7fffffff));
BLF_position(blf_mono_font, dx, 6, 0);
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
}
if(zpf) {
glColor3ub(255, 255, 255);
BLI_snprintf(str, sizeof(str), " Z:%-.3f |", *zpf);
BLF_position(blf_mono_font, dx, 6, 0);
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
}
#endif
if(channels >= 3) {
glColor3ubv(red);
if (fp)
BLI_snprintf(str, sizeof(str), " R:%-.4f", fp[0]);
else if (cp)
BLI_snprintf(str, sizeof(str), " R:%-3d", cp[0]);
else
BLI_snprintf(str, sizeof(str), " R:-");
BLF_position(blf_mono_font, dx, 6, 0);
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
glColor3ubv(green);
if (fp)
BLI_snprintf(str, sizeof(str), " G:%-.4f", fp[1]);
else if (cp)
BLI_snprintf(str, sizeof(str), " G:%-3d", cp[1]);
else
BLI_snprintf(str, sizeof(str), " G:-");
BLF_position(blf_mono_font, dx, 6, 0);
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
glColor3ubv(blue);
if (fp)
BLI_snprintf(str, sizeof(str), " B:%-.4f", fp[2]);
else if (cp)
BLI_snprintf(str, sizeof(str), " B:%-3d", cp[2]);
else
BLI_snprintf(str, sizeof(str), " B:-");
BLF_position(blf_mono_font, dx, 6, 0);
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
if(channels == 4) {
glColor3ub(255, 255, 255);
if (fp)
BLI_snprintf(str, sizeof(str), " A:%-.4f", fp[3]);
else if (cp)
BLI_snprintf(str, sizeof(str), " A:%-3d", cp[3]);
else
BLI_snprintf(str, sizeof(str), "- ");
BLF_position(blf_mono_font, dx, 6, 0);
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
}
}
/* color rectangle */
if (channels==1) {
if (fp)
col[0] = col[1] = col[2] = fp[0];
else if (cp)
col[0] = col[1] = col[2] = (float)cp[0]/255.0f;
else
col[0] = col[1] = col[2] = 0.0f;
}
else if (channels==3) {
if (fp)
copy_v3_v3(col, fp);
else if (cp) {
col[0] = (float)cp[0]/255.0f;
col[1] = (float)cp[1]/255.0f;
col[2] = (float)cp[2]/255.0f;
}
else
zero_v3(col);
}
else if (channels==4) {
if (fp)
copy_v4_v4(col, fp);
else if (cp) {
col[0] = (float)cp[0]/255.0f;
col[1] = (float)cp[1]/255.0f;
col[2] = (float)cp[2]/255.0f;
col[3] = (float)cp[3]/255.0f;
}
else
zero_v4(col);
}
if (color_manage) {
linearrgb_to_srgb_v3_v3(finalcol, col);
finalcol[3] = col[3];
}
else {
copy_v4_v4(finalcol, col);
}
glDisable(GL_BLEND);
glColor3fv(finalcol);
dx += 5;
glBegin(GL_QUADS);
glVertex2f(dx, 3);
glVertex2f(dx, 17);
glVertex2f(dx+30, 17);
glVertex2f(dx+30, 3);
glEnd();
dx += 35;
glColor3ub(255, 255, 255);
if(channels == 1) {
if (fp) {
rgb_to_hsv(fp[0], fp[0], fp[0], &hue, &sat, &val);
rgb_to_yuv(fp[0], fp[0], fp[0], &lum, &u, &v);
}
else if (cp) {
rgb_to_hsv((float)cp[0]/255.0f, (float)cp[0]/255.0f, (float)cp[0]/255.0f, &hue, &sat, &val);
rgb_to_yuv((float)cp[0]/255.0f, (float)cp[0]/255.0f, (float)cp[0]/255.0f, &lum, &u, &v);
}
BLI_snprintf(str, sizeof(str), "V:%-.4f", val);
BLF_position(blf_mono_font, dx, 6, 0);
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
BLI_snprintf(str, sizeof(str), " L:%-.4f", lum);
BLF_position(blf_mono_font, dx, 6, 0);
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
}
else if(channels >= 3) {
if (fp) {
rgb_to_hsv(fp[0], fp[1], fp[2], &hue, &sat, &val);
rgb_to_yuv(fp[0], fp[1], fp[2], &lum, &u, &v);
}
else if (cp) {
rgb_to_hsv((float)cp[0]/255.0f, (float)cp[1]/255.0f, (float)cp[2]/255.0f, &hue, &sat, &val);
rgb_to_yuv((float)cp[0]/255.0f, (float)cp[1]/255.0f, (float)cp[2]/255.0f, &lum, &u, &v);
}
BLI_snprintf(str, sizeof(str), "H:%-.4f", hue);
BLF_position(blf_mono_font, dx, 6, 0);
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
BLI_snprintf(str, sizeof(str), " S:%-.4f", sat);
BLF_position(blf_mono_font, dx, 6, 0);
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
BLI_snprintf(str, sizeof(str), " V:%-.4f", val);
BLF_position(blf_mono_font, dx, 6, 0);
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
BLI_snprintf(str, sizeof(str), " L:%-.4f", lum);
BLF_position(blf_mono_font, dx, 6, 0);
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
}
(void)dx;
}
#if 0
/* note: needs to be userpref or opengl profile option */
static void draw_nodespace_back_tex(ScrArea *sa, SpaceNode *snode)

@ -71,6 +71,7 @@
#include "IMB_imbuf_types.h"
#include "ED_node.h"
#include "ED_image.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_render.h"
@ -758,7 +759,7 @@ static void edit_node_properties(wmOperatorType *ot)
static int edit_node_invoke_properties(bContext *C, wmOperator *op)
{
if (!RNA_property_is_set(op->ptr, "node")) {
if (!RNA_struct_property_is_set(op->ptr, "node")) {
bNode *node= CTX_data_pointer_get_type(C, "node", &RNA_Node).data;
if (!node)
return 0;
@ -766,10 +767,10 @@ static int edit_node_invoke_properties(bContext *C, wmOperator *op)
RNA_string_set(op->ptr, "node", node->name);
}
if (!RNA_property_is_set(op->ptr, "in_out"))
if (!RNA_struct_property_is_set(op->ptr, "in_out"))
RNA_enum_set(op->ptr, "in_out", SOCK_IN);
if (!RNA_property_is_set(op->ptr, "socket"))
if (!RNA_struct_property_is_set(op->ptr, "socket"))
RNA_int_set(op->ptr, "socket", 0);
return 1;
@ -896,13 +897,13 @@ static int node_group_socket_add_exec(bContext *C, wmOperator *op)
ED_preview_kill_jobs(C);
if (RNA_property_is_set(op->ptr, "name"))
if (RNA_struct_property_is_set(op->ptr, "name"))
RNA_string_get(op->ptr, "name", name);
if (RNA_property_is_set(op->ptr, "type"))
if (RNA_struct_property_is_set(op->ptr, "type"))
type = RNA_enum_get(op->ptr, "type");
if (RNA_property_is_set(op->ptr, "in_out"))
if (RNA_struct_property_is_set(op->ptr, "in_out"))
in_out = RNA_enum_get(op->ptr, "in_out");
else
return OPERATOR_CANCELLED;
@ -948,12 +949,12 @@ static int node_group_socket_remove_exec(bContext *C, wmOperator *op)
ED_preview_kill_jobs(C);
if (RNA_property_is_set(op->ptr, "index"))
if (RNA_struct_property_is_set(op->ptr, "index"))
index = RNA_int_get(op->ptr, "index");
else
return OPERATOR_CANCELLED;
if (RNA_property_is_set(op->ptr, "in_out"))
if (RNA_struct_property_is_set(op->ptr, "in_out"))
in_out = RNA_enum_get(op->ptr, "in_out");
else
return OPERATOR_CANCELLED;
@ -999,12 +1000,12 @@ static int node_group_socket_move_up_exec(bContext *C, wmOperator *op)
ED_preview_kill_jobs(C);
if (RNA_property_is_set(op->ptr, "index"))
if (RNA_struct_property_is_set(op->ptr, "index"))
index = RNA_int_get(op->ptr, "index");
else
return OPERATOR_CANCELLED;
if (RNA_property_is_set(op->ptr, "in_out"))
if (RNA_struct_property_is_set(op->ptr, "in_out"))
in_out = RNA_enum_get(op->ptr, "in_out");
else
return OPERATOR_CANCELLED;
@ -1069,12 +1070,12 @@ static int node_group_socket_move_down_exec(bContext *C, wmOperator *op)
ED_preview_kill_jobs(C);
if (RNA_property_is_set(op->ptr, "index"))
if (RNA_struct_property_is_set(op->ptr, "index"))
index = RNA_int_get(op->ptr, "index");
else
return OPERATOR_CANCELLED;
if (RNA_property_is_set(op->ptr, "in_out"))
if (RNA_struct_property_is_set(op->ptr, "in_out"))
in_out = RNA_enum_get(op->ptr, "in_out");
else
return OPERATOR_CANCELLED;
@ -1343,8 +1344,10 @@ static void sample_draw(const bContext *C, ARegion *ar, void *arg_info)
{
ImageSampleInfo *info= arg_info;
draw_nodespace_color_info(ar, (CTX_data_scene(C)->r.color_mgt_flag & R_COLOR_MANAGEMENT), info->channels,
info->x, info->y, info->col, info->colf);
ED_image_draw_info(ar, (CTX_data_scene(C)->r.color_mgt_flag & R_COLOR_MANAGEMENT), info->channels,
info->x, info->y, info->col, info->colf,
NULL, NULL /* zbuf - unused for nodes */
);
}
static void sample_apply(bContext *C, wmOperator *op, wmEvent *event)
@ -3435,7 +3438,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
ntemp.type = -1;
/* check input variables */
if (RNA_property_is_set(op->ptr, "filepath"))
if (RNA_struct_property_is_set(op->ptr, "filepath"))
{
char path[FILE_MAX];
RNA_string_get(op->ptr, "filepath", path);
@ -3449,7 +3452,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
}
else if(RNA_property_is_set(op->ptr, "name"))
else if(RNA_struct_property_is_set(op->ptr, "name"))
{
char name[MAX_ID_NAME-2];
RNA_string_get(op->ptr, "name", name);
@ -3495,7 +3498,7 @@ static int node_add_file_invoke(bContext *C, wmOperator *op, wmEvent *event)
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1],
&snode->mx, &snode->my);
if (RNA_property_is_set(op->ptr, "filepath") || RNA_property_is_set(op->ptr, "name"))
if (RNA_struct_property_is_set(op->ptr, "filepath") || RNA_struct_property_is_set(op->ptr, "name"))
return node_add_file_exec(C, op);
else
return WM_operator_filesel(C, op, event);
@ -3534,12 +3537,12 @@ static int new_node_tree_exec(bContext *C, wmOperator *op)
/* retrieve state */
snode= CTX_wm_space_node(C);
if (RNA_property_is_set(op->ptr, "type"))
if (RNA_struct_property_is_set(op->ptr, "type"))
treetype = RNA_enum_get(op->ptr, "type");
else
treetype = snode->treetype;
if (RNA_property_is_set(op->ptr, "name"))
if (RNA_struct_property_is_set(op->ptr, "name"))
RNA_string_get(op->ptr, "name", treename);
ntree = ntreeAddTree(treename, treetype, 0);

@ -628,7 +628,7 @@ static uiBlock *operator_search_menu(bContext *C, ARegion *ar, void *arg_kmi)
/* fake button, it holds space for search items */
uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 0, 150, UI_UNIT_Y, 0, 0, "");
but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, UI_UNIT_Y, 0, 0, "");
uiButSetSearchFunc(but, operator_search_cb, arg_kmi, operator_call_cb, ot);
uiBoundsBlock(block, 6);

@ -57,7 +57,7 @@
#include "BLI_utildefines.h"
#include "BLI_math_base.h"
#if defined WIN32 && !defined _LIBC
#if defined WIN32 && !defined _LIBC || defined __sun
# include "BLI_fnmatch.h" /* use fnmatch included in blenlib */
#else
# ifndef _GNU_SOURCE

@ -130,7 +130,7 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, w
RNA_int_set(op->ptr, "frame_start", (int)mval_v2d[0]);
if ((flag & SEQPROP_ENDFRAME) && RNA_property_is_set(op->ptr, "frame_end")==0)
if ((flag & SEQPROP_ENDFRAME) && RNA_struct_property_is_set(op->ptr, "frame_end")==0)
RNA_int_set(op->ptr, "frame_end", (int)mval_v2d[0] + 25); // XXX arbitary but ok for now.
if (!(flag & SEQPROP_NOPATHS)) {
@ -264,7 +264,7 @@ static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, wmEvent
return OPERATOR_CANCELLED;
}
if(!RNA_property_is_set(op->ptr, "scene"))
if(!RNA_struct_property_is_set(op->ptr, "scene"))
return WM_enum_search_invoke(C, op, event);
sequencer_generic_invoke_xy__internal(C, op, event, 0);
@ -371,7 +371,7 @@ static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, wmEvent
}
/* This is for drag and drop */
if(RNA_collection_length(op->ptr, "files") || RNA_property_is_set(op->ptr, "filepath")) {
if(RNA_collection_length(op->ptr, "files") || RNA_struct_property_is_set(op->ptr, "filepath")) {
sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_NOPATHS);
return sequencer_add_movie_strip_exec(C, op);
}
@ -423,7 +423,7 @@ static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, wmEvent
}
/* This is for drag and drop */
if(RNA_collection_length(op->ptr, "files") || RNA_property_is_set(op->ptr, "filepath")) {
if(RNA_collection_length(op->ptr, "files") || RNA_struct_property_is_set(op->ptr, "filepath")) {
sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_NOPATHS);
return sequencer_add_sound_strip_exec(C, op);
}
@ -650,7 +650,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
/* an unset channel is a special case where we automatically go above
* the other strips. */
if(!RNA_property_is_set(op->ptr, "channel")) {
if(!RNA_struct_property_is_set(op->ptr, "channel")) {
if(seq->seq1) {
int chan= MAX3( seq->seq1 ? seq->seq1->machine : 0,
seq->seq2 ? seq->seq2->machine : 0,
@ -686,7 +686,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
/* add color */
static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
short is_type_set= RNA_property_is_set(op->ptr, "type");
short is_type_set= RNA_struct_property_is_set(op->ptr, "type");
int type= -1;
int prop_flag= SEQPROP_ENDFRAME;

@ -276,7 +276,7 @@ static int text_open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
Text *text= CTX_data_edit_text(C);
char *path= (text && text->name)? text->name: G.main->name;
if(RNA_property_is_set(op->ptr, "filepath"))
if(RNA_struct_property_is_set(op->ptr, "filepath"))
return text_open_exec(C, op);
text_open_init(C, op);
@ -534,7 +534,7 @@ static int text_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
Text *text= CTX_data_edit_text(C);
char *str;
if(RNA_property_is_set(op->ptr, "filepath"))
if(RNA_struct_property_is_set(op->ptr, "filepath"))
return text_save_as_exec(C, op);
if(text->name)
@ -2209,7 +2209,7 @@ static int text_scroll_invoke(bContext *C, wmOperator *op, wmEvent *event)
SpaceText *st= CTX_wm_space_text(C);
TextScroll *tsc;
if(RNA_property_is_set(op->ptr, "lines"))
if(RNA_struct_property_is_set(op->ptr, "lines"))
return text_scroll_exec(C, op);
tsc= MEM_callocN(sizeof(TextScroll), "TextScroll");
@ -2289,7 +2289,7 @@ static int text_scroll_bar_invoke(bContext *C, wmOperator *op, wmEvent *event)
const int *mval= event->mval;
int zone= -1;
if(RNA_property_is_set(op->ptr, "lines"))
if(RNA_struct_property_is_set(op->ptr, "lines"))
return text_scroll_exec(C, op);
/* verify we are in the right zone */
@ -2784,7 +2784,7 @@ static int text_insert_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
int ret;
// if(!RNA_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */
// if(!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */
if(!RNA_string_length(op->ptr, "text")) {
/* if alt/ctrl/super are pressed pass through */
if(event->ctrl || event->oskey) {

@ -3074,8 +3074,6 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
draw_em_fancy_edges(em, scene, v3d, me, cageDM, 0, eed_act);
}
if(em) {
// XXX retopo_matrix_update(v3d);
draw_em_fancy_verts(scene, v3d, ob, em, cageDM, eve_act);
if(me->drawflag & ME_DRAWNORMALS) {
@ -5401,8 +5399,6 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
short hide_handles = (cu->drawflag & CU_HIDE_HANDLES);
int index;
// XXX retopo_matrix_update(v3d);
/* DispList */
UI_ThemeColor(TH_WIRE);
drawDispList(scene, v3d, rv3d, base, dt);

@ -553,7 +553,6 @@ static void view3d_main_area_free(ARegion *ar)
if(rv3d->localvd) MEM_freeN(rv3d->localvd);
if(rv3d->clipbb) MEM_freeN(rv3d->clipbb);
// XXX retopo_free_view_data(rv3d);
if(rv3d->ri) {
// XXX BIF_view3d_previewrender_free(rv3d);
}

@ -193,7 +193,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
dg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr);
if(dg) {
max+= BLI_snprintf(str, sizeof(str), "%s %%x%d|", dg->name, dvert->dw[i].def_nr);
if(max<320) strcat(defstr, str);
if (max < sizeof(str)) strcat(defstr, str);
}
if(tfp->curdef==dvert->dw[i].def_nr) {

@ -1585,8 +1585,8 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
v3d= sa->spacedata.first;
rv3d= ar->regiondata;
mx= RNA_property_is_set(op->ptr, "mx") ? RNA_int_get(op->ptr, "mx") : ar->winx / 2;
my= RNA_property_is_set(op->ptr, "my") ? RNA_int_get(op->ptr, "my") : ar->winy / 2;
mx= RNA_struct_property_is_set(op->ptr, "mx") ? RNA_int_get(op->ptr, "mx") : ar->winx / 2;
my= RNA_struct_property_is_set(op->ptr, "my") ? RNA_int_get(op->ptr, "my") : ar->winy / 2;
use_cam_zoom= (rv3d->persp==RV3D_CAMOB) && !(rv3d->is_persp && ED_view3d_camera_lock_check(v3d, rv3d));
@ -1667,12 +1667,12 @@ static int viewzoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
vod= op->customdata;
/* if one or the other zoom position aren't set, set from event */
if (!RNA_property_is_set(op->ptr, "mx") || !RNA_property_is_set(op->ptr, "my")) {
if (!RNA_struct_property_is_set(op->ptr, "mx") || !RNA_struct_property_is_set(op->ptr, "my")) {
RNA_int_set(op->ptr, "mx", event->x);
RNA_int_set(op->ptr, "my", event->y);
}
if(RNA_property_is_set(op->ptr, "delta")) {
if(RNA_struct_property_is_set(op->ptr, "delta")) {
viewzoom_exec(C, op);
}
else {
@ -1880,12 +1880,12 @@ static int viewdolly_invoke(bContext *C, wmOperator *op, wmEvent *event)
vod= op->customdata;
/* if one or the other zoom position aren't set, set from event */
if (!RNA_property_is_set(op->ptr, "mx") || !RNA_property_is_set(op->ptr, "my")) {
if (!RNA_struct_property_is_set(op->ptr, "mx") || !RNA_struct_property_is_set(op->ptr, "my")) {
RNA_int_set(op->ptr, "mx", event->x);
RNA_int_set(op->ptr, "my", event->y);
}
if(RNA_property_is_set(op->ptr, "delta")) {
if(RNA_struct_property_is_set(op->ptr, "delta")) {
viewdolly_exec(C, op);
}
else {
@ -2963,13 +2963,13 @@ static int background_image_add_invoke(bContext *C, wmOperator *op, wmEvent *UNU
char name[MAX_ID_NAME-2];
/* check input variables */
if(RNA_property_is_set(op->ptr, "filepath")) {
if(RNA_struct_property_is_set(op->ptr, "filepath")) {
char path[FILE_MAX];
RNA_string_get(op->ptr, "filepath", path);
ima= BKE_add_image_file(path);
}
else if(RNA_property_is_set(op->ptr, "name")) {
else if(RNA_struct_property_is_set(op->ptr, "name")) {
RNA_string_get(op->ptr, "name", name);
ima= (Image *)find_id("IM", name);
}

@ -177,7 +177,7 @@ static uiBlock *tool_search_menu(bContext *C, ARegion *ar, void *arg_listbase)
/* fake button, it holds space for search items */
uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, OP_MAX_TYPENAME, 10, 0, 150, 19, 0, 0, "");
but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, "");
uiButSetSearchFunc(but, operator_search_cb, arg_listbase, operator_call_cb, NULL);
uiBoundsBlock(block, 6);

@ -1410,18 +1410,18 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
if (t->flag & T_MODAL) {
/* save settings if not set in operator */
if (RNA_struct_find_property(op->ptr, "proportional") && !RNA_property_is_set(op->ptr, "proportional")) {
if (RNA_struct_find_property(op->ptr, "proportional") && !RNA_struct_property_is_set(op->ptr, "proportional")) {
if (t->obedit)
ts->proportional = proportional;
else
ts->proportional_objects = (proportional != PROP_EDIT_OFF);
}
if (RNA_struct_find_property(op->ptr, "proportional_size") && !RNA_property_is_set(op->ptr, "proportional_size")) {
if (RNA_struct_find_property(op->ptr, "proportional_size") && !RNA_struct_property_is_set(op->ptr, "proportional_size")) {
ts->proportional_size = t->prop_size;
}
if (RNA_struct_find_property(op->ptr, "proportional_edit_falloff") && !RNA_property_is_set(op->ptr, "proportional_edit_falloff")) {
if (RNA_struct_find_property(op->ptr, "proportional_edit_falloff") && !RNA_struct_property_is_set(op->ptr, "proportional_edit_falloff")) {
ts->prop_mode = t->prop_mode;
}
@ -1433,7 +1433,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
}
if(t->spacetype == SPACE_VIEW3D) {
if (RNA_struct_find_property(op->ptr, "constraint_orientation") && !RNA_property_is_set(op->ptr, "constraint_orientation")) {
if (RNA_struct_find_property(op->ptr, "constraint_orientation") && !RNA_struct_property_is_set(op->ptr, "constraint_orientation")) {
View3D *v3d = t->view;
v3d->twmode = t->current_orientation;
@ -1706,7 +1706,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
/* overwrite initial values if operator supplied a non-null vector */
if (RNA_property_is_set(op->ptr, "value"))
if (RNA_struct_property_is_set(op->ptr, "value"))
{
float values[4]= {0}; /* incase value isn't length 4, avoid uninitialized memory */
PropertyRNA *prop= RNA_struct_find_property(op->ptr, "value");
@ -1723,7 +1723,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
}
/* Transformation axis from operator */
if (RNA_struct_find_property(op->ptr, "axis") && RNA_property_is_set(op->ptr, "axis"))
if (RNA_struct_find_property(op->ptr, "axis") && RNA_struct_property_is_set(op->ptr, "axis"))
{
RNA_float_get_array(op->ptr, "axis", t->axis);
normalize_v3(t->axis);
@ -1731,7 +1731,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
}
/* Constraint init from operator */
if (RNA_struct_find_property(op->ptr, "constraint_axis") && RNA_property_is_set(op->ptr, "constraint_axis"))
if (RNA_struct_find_property(op->ptr, "constraint_axis") && RNA_struct_property_is_set(op->ptr, "constraint_axis"))
{
int constraint_axis[3];

@ -1078,7 +1078,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
if(v3d->flag & V3D_ALIGN) t->flag |= T_V3D_ALIGN;
t->around = v3d->around;
if (op && RNA_struct_find_property(op->ptr, "constraint_orientation") && RNA_property_is_set(op->ptr, "constraint_orientation"))
if (op && RNA_struct_find_property(op->ptr, "constraint_orientation") && RNA_struct_property_is_set(op->ptr, "constraint_orientation"))
{
t->current_orientation = RNA_enum_get(op->ptr, "constraint_orientation");
@ -1101,7 +1101,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
/* initialize UV transform from */
if (op && RNA_struct_find_property(op->ptr, "correct_uv")) {
if(RNA_property_is_set(op->ptr, "correct_uv")) {
if(RNA_struct_property_is_set(op->ptr, "correct_uv")) {
if(RNA_boolean_get(op->ptr, "correct_uv")) {
t->settings->uvcalc_flag |= UVCALC_TRANSFORM_CORRECT;
}
@ -1147,7 +1147,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
t->around = V3D_CENTER;
}
if (op && RNA_property_is_set(op->ptr, "release_confirm"))
if (op && RNA_struct_property_is_set(op->ptr, "release_confirm"))
{
if (RNA_boolean_get(op->ptr, "release_confirm"))
{
@ -1162,7 +1162,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
}
}
if (op && RNA_struct_find_property(op->ptr, "mirror") && RNA_property_is_set(op->ptr, "mirror"))
if (op && RNA_struct_find_property(op->ptr, "mirror") && RNA_struct_property_is_set(op->ptr, "mirror"))
{
if (RNA_boolean_get(op->ptr, "mirror"))
{
@ -1183,7 +1183,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
/* setting PET flag only if property exist in operator. Otherwise, assume it's not supported */
if (op && RNA_struct_find_property(op->ptr, "proportional"))
{
if (RNA_property_is_set(op->ptr, "proportional"))
if (RNA_struct_property_is_set(op->ptr, "proportional"))
{
switch(RNA_enum_get(op->ptr, "proportional"))
{
@ -1216,7 +1216,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
}
}
if (op && RNA_struct_find_property(op->ptr, "proportional_size") && RNA_property_is_set(op->ptr, "proportional_size"))
if (op && RNA_struct_find_property(op->ptr, "proportional_size") && RNA_struct_property_is_set(op->ptr, "proportional_size"))
{
t->prop_size = RNA_float_get(op->ptr, "proportional_size");
}
@ -1233,7 +1233,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
t->prop_size = 1.0f;
}
if (op && RNA_struct_find_property(op->ptr, "proportional_edit_falloff") && RNA_property_is_set(op->ptr, "proportional_edit_falloff"))
if (op && RNA_struct_find_property(op->ptr, "proportional_edit_falloff") && RNA_struct_property_is_set(op->ptr, "proportional_edit_falloff"))
{
t->prop_mode = RNA_enum_get(op->ptr, "proportional_edit_falloff");
}

@ -429,7 +429,7 @@ static int transform_invoke(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_CANCELLED;
}
if(RNA_property_is_set(op->ptr, "value")) {
if(RNA_struct_property_is_set(op->ptr, "value")) {
return transform_exec(C, op);
}
else {

@ -447,18 +447,18 @@ void initSnapping(TransInfo *t, wmOperator *op)
resetSnapping(t);
/* if snap property exists */
if (op && RNA_struct_find_property(op->ptr, "snap") && RNA_property_is_set(op->ptr, "snap"))
if (op && RNA_struct_find_property(op->ptr, "snap") && RNA_struct_property_is_set(op->ptr, "snap"))
{
if (RNA_boolean_get(op->ptr, "snap"))
{
t->modifiers |= MOD_SNAP;
if (RNA_property_is_set(op->ptr, "snap_target"))
if (RNA_struct_property_is_set(op->ptr, "snap_target"))
{
snap_target = RNA_enum_get(op->ptr, "snap_target");
}
if (RNA_property_is_set(op->ptr, "snap_point"))
if (RNA_struct_property_is_set(op->ptr, "snap_point"))
{
RNA_float_get_array(op->ptr, "snap_point", t->tsnap.snapPoint);
t->tsnap.status |= SNAP_FORCED|POINT_INIT;

@ -524,7 +524,7 @@ static int undo_history_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
/* note: also check ed_undo_step() in top if you change notifiers */
static int undo_history_exec(bContext *C, wmOperator *op)
{
if(RNA_property_is_set(op->ptr, "item")) {
if(RNA_struct_property_is_set(op->ptr, "item")) {
int undosys= get_undo_system(C);
int item= RNA_int_get(op->ptr, "item");

@ -540,7 +540,7 @@ static int pack_islands_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
if(RNA_property_is_set(op->ptr, "margin")) {
if(RNA_struct_property_is_set(op->ptr, "margin")) {
scene->toolsettings->uvcalc_margin= RNA_float_get(op->ptr, "margin");
}
else {

@ -703,11 +703,11 @@ void DDSHeader::setSwizzleCode(uint8 c0, uint8 c1, uint8 c2, uint8 c3)
void DDSHeader::setPixelFormat(uint bitcount, uint rmask, uint gmask, uint bmask, uint amask)
{
// Make sure the masks are correct.
if ((rmask & gmask) || \
(rmask & bmask) || \
(rmask & amask) || \
(gmask & bmask) || \
(gmask & amask) || \
if ((rmask & gmask) ||
(rmask & bmask) ||
(rmask & amask) ||
(gmask & bmask) ||
(gmask & amask) ||
(bmask & amask)) {
printf("DDS: bad RGBA masks, pixel format not set\n");
return;

@ -386,12 +386,12 @@ static void get_proxy_filename(struct anim * anim, IMB_Proxy_Size preview_size,
stream_suffix[0] = 0;
if (anim->streamindex > 0) {
BLI_snprintf(stream_suffix, 20, "_st%d", anim->streamindex);
BLI_snprintf(stream_suffix, sizeof(stream_suffix), "_st%d", anim->streamindex);
}
BLI_snprintf(proxy_name, 256, "proxy_%d%s.avi",
BLI_snprintf(proxy_name, sizeof(proxy_name), "proxy_%d%s.avi",
(int) (proxy_fac[i] * 100), stream_suffix);
BLI_snprintf(proxy_temp_name, 256, "proxy_%d%s_part.avi",
BLI_snprintf(proxy_temp_name, sizeof(proxy_temp_name), "proxy_%d%s_part.avi",
(int) (proxy_fac[i] * 100), stream_suffix);
get_index_dir(anim, index_dir);

@ -541,7 +541,7 @@ ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags)
}
else {
fprintf(stderr,
"imb_loadtiff: could not allocate memory for TIFF " \
"imb_loadtiff: could not allocate memory for TIFF "
"image.\n");
TIFFClose(image);
return NULL;

@ -86,6 +86,10 @@ typedef struct IDProperty {
/* IDP_STRING */
#define IDP_STRING_SUB_UTF8 0 /* default */
#define IDP_STRING_SUB_BYTE 1 /* arbitrary byte array, _not_ null terminated */
/*->flag*/
#define IDP_FLAG_GHOST (1<<7) /* this means the propery is set but RNA will return
* false when checking 'RNA_property_is_set',
* currently this is a runtime flag */
/* add any future new id property types here.*/

@ -184,7 +184,7 @@ typedef struct bPoseChannel {
IDProperty *prop; /* User-Defined Properties on this PoseChannel */
ListBase constraints;/* Constraints that act on this PoseChannel */
char name[72]; /* Channels need longer names than normal blender objects */
char name[64]; /* need to match bone name length: MAXBONENAME */
short flag; /* dynamic, for detecting transform changes */
short ikflag; /* settings for IK bones */

@ -583,8 +583,9 @@ typedef struct GameData {
/* standalone player */
struct GameFraming framing;
short fullscreen, xplay, yplay, freqplay;
short playerflag, xplay, yplay, freqplay;
short depth, attrib, rt1, rt2;
short aasamples, pad4[3];
/* stereo/dome mode */
struct GameDome dome;
@ -661,6 +662,10 @@ typedef struct GameData {
#define GAME_SHOW_OBSTACLE_SIMULATION (1 << 16)
/* Note: GameData.flag is now an int (max 32 flags). A short could only take 16 flags */
/* GameData.playerflag */
#define GAME_PLAYER_FULLSCREEN (1 << 0)
#define GAME_PLAYER_DESKTOP_RESOLUTION (1 << 1)
/* GameData.matmode */
#define GAME_MAT_TEXFACE 0
#define GAME_MAT_MULTITEX 1
@ -809,6 +814,40 @@ typedef struct TransformOrientation {
int pad;
} TransformOrientation;
/* *************************************************************** */
/* Unified Paint Settings */
/* These settings can override the equivalent fields in the active
Brush for any paint mode; the flag field controls whether these
values are used */
typedef struct UnifiedPaintSettings {
/* unified radius of brush in pixels */
int size;
/* unified radius of brush in Blender units */
float unprojected_radius;
/* unified strength of brush */
float alpha;
/* user preferences for sculpt and paint */
int flag;
} UnifiedPaintSettings;
typedef enum {
UNIFIED_PAINT_SIZE = (1<<0),
UNIFIED_PAINT_ALPHA = (1<<1),
/* only used if unified size is enabled, mirros the brush flags
BRUSH_LOCK_SIZE and BRUSH_SIZE_PRESSURE */
UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1<<2),
UNIFIED_PAINT_BRUSH_SIZE_PRESSURE = (1<<3),
/* only used if unified alpha is enabled, mirrors the brush flag
BRUSH_ALPHA_PRESSURE */
UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE = (1<<4)
} UnifiedPaintSettingsFlags;
/* *************************************************************** */
/* Tool Settings */
@ -881,13 +920,9 @@ typedef struct ToolSettings {
/* Auto-Keying Mode */
short autokey_mode, autokey_flag; /* defines in DNA_userdef_types.h */
/* Retopo */
char retopo_mode;
char retopo_paint_tool;
char line_div, ellipse_div, retopo_hotspot;
/* Multires */
char multires_subdiv_type;
char pad2[5];
/* Skeleton generation */
short skgen_resolution;
@ -931,11 +966,16 @@ typedef struct ToolSettings {
char auto_normalize; /*auto normalizing mode in wpaint*/
char multipaint; /* paint multiple bones in wpaint */
short sculpt_paint_settings; /* user preferences for sculpt and paint */
/* XXX: these sculpt_paint_* fields are deprecated, use the
unified_paint_settings field instead! */
short sculpt_paint_settings DNA_DEPRECATED;
short pad1;
int sculpt_paint_unified_size; /* unified radius of brush in pixels */
float sculpt_paint_unified_unprojected_radius;/* unified radius of brush in Blender units */
float sculpt_paint_unified_alpha; /* unified strength of brush */
int sculpt_paint_unified_size DNA_DEPRECATED;
float sculpt_paint_unified_unprojected_radius DNA_DEPRECATED;
float sculpt_paint_unified_alpha DNA_DEPRECATED;
/* Unified Paint Settings */
struct UnifiedPaintSettings unified_paint_settings;
} ToolSettings;
/* *************************************************************** */
@ -1362,13 +1402,6 @@ typedef enum SculptFlags {
SCULPT_ONLY_DEFORM = (1<<8),
} SculptFlags;
/* sculpt_paint_settings */
#define SCULPT_PAINT_USE_UNIFIED_SIZE (1<<0)
#define SCULPT_PAINT_USE_UNIFIED_ALPHA (1<<1)
#define SCULPT_PAINT_UNIFIED_LOCK_BRUSH_SIZE (1<<2)
#define SCULPT_PAINT_UNIFIED_SIZE_PRESSURE (1<<3)
#define SCULPT_PAINT_UNIFIED_ALPHA_PRESSURE (1<<4)
/* ImagePaintSettings.flag */
#define IMAGEPAINT_DRAWING 1
// #define IMAGEPAINT_DRAW_TOOL 2 // deprecated
@ -1439,15 +1472,6 @@ typedef enum SculptFlags {
#define PE_TYPE_SOFTBODY 1
#define PE_TYPE_CLOTH 2
/* toolsettings->retopo_mode */
#define RETOPO 1
#define RETOPO_PAINT 2
/* toolsettings->retopo_paint_tool */ /*UNUSED*/
/* #define RETOPO_PEN 1 */
/* #define RETOPO_LINE 2 */
/* #define RETOPO_ELLIPSE 4 */
/* toolsettings->skgen_options */
#define SKGEN_FILTER_INTERNAL (1 << 0)
#define SKGEN_FILTER_EXTERNAL (1 << 1)

@ -938,7 +938,8 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name);
}
/* check if the idproperty exists, for operators */
int RNA_property_is_set(PointerRNA *ptr, const char *name);
int RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop);
int RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier);
int RNA_property_is_idprop(PropertyRNA *prop);
/* python compatible string representation of this property, (must be freed!) */
@ -1000,7 +1001,7 @@ StructRNA *ID_code_to_RNA_type(short idcode);
/* macro which inserts the function name */
#ifdef __GNUC__
#if defined __GNUC__ || defined __sun
# define RNA_warning(format, args...) _RNA_warning("%s: " format "\n", __func__, ##args)
#else
# define RNA_warning(format, ...) _RNA_warning("%s: " format "\n", __FUNCTION__, __VA_ARGS__)

@ -226,6 +226,12 @@ void RNA_pointer_recast(PointerRNA *ptr, PointerRNA *r_ptr)
/* ID Properties */
static void rna_idproperty_touch(IDProperty *idprop)
{
/* so the property is seen as 'set' by rna */
idprop->flag &= ~IDP_FLAG_GHOST;
}
/* return a UI local ID prop definition for this prop */
IDProperty *rna_idproperty_ui(PropertyRNA *prop)
{
@ -1621,8 +1627,10 @@ void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value)
/* just incase other values are passed */
if(value) value= 1;
if((idprop=rna_idproperty_check(&prop, ptr)))
if((idprop=rna_idproperty_check(&prop, ptr))) {
IDP_Int(idprop)= value;
rna_idproperty_touch(idprop);
}
else if(bprop->set)
bprop->set(ptr, value);
else if(prop->flag & PROP_EDITABLE) {
@ -1698,6 +1706,8 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const in
IDP_Int(idprop)= values[0];
else
memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len);
rna_idproperty_touch(idprop);
}
else if(prop->arraydimension == 0)
RNA_property_boolean_set(ptr, prop, values[0]);
@ -1818,8 +1828,10 @@ void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
/* useful to check on bad values but set function should clamp */
/* BLI_assert(RNA_property_int_clamp(ptr, prop, &value) == 0); */
if((idprop=rna_idproperty_check(&prop, ptr)))
if((idprop=rna_idproperty_check(&prop, ptr))) {
IDP_Int(idprop)= value;
rna_idproperty_touch(idprop);
}
else if(iprop->set)
iprop->set(ptr, value);
else if(prop->flag & PROP_EDITABLE) {
@ -1931,7 +1943,9 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v
if(prop->arraydimension == 0)
IDP_Int(idprop)= values[0];
else
memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len);\
memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len);
rna_idproperty_touch(idprop);
}
else if(prop->arraydimension == 0)
RNA_property_int_set(ptr, prop, values[0]);
@ -2054,6 +2068,8 @@ void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
IDP_Float(idprop)= value;
else
IDP_Double(idprop)= value;
rna_idproperty_touch(idprop);
}
else if(fprop->set) {
fprop->set(ptr, value);
@ -2185,6 +2201,8 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa
for(i=0; i<idprop->len; i++)
((double*)IDP_Array(idprop))[i]= values[i];
}
rna_idproperty_touch(idprop);
}
else if(prop->arraydimension == 0)
RNA_property_float_set(ptr, prop, values[0]);
@ -2372,9 +2390,11 @@ void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *val
BLI_assert(RNA_property_type(prop) == PROP_STRING);
if((idprop=rna_idproperty_check(&prop, ptr)))
if((idprop=rna_idproperty_check(&prop, ptr))) {
/* both IDP_STRING_SUB_BYTE / IDP_STRING_SUB_UTF8 */
IDP_AssignString(idprop, value, RNA_property_string_maxlength(prop) - 1);
rna_idproperty_touch(idprop);
}
else if(sprop->set)
sprop->set(ptr, value); /* set function needs to clamp its self */
else if(prop->flag & PROP_EDITABLE) {
@ -2446,8 +2466,10 @@ void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
BLI_assert(RNA_property_type(prop) == PROP_ENUM);
if((idprop=rna_idproperty_check(&prop, ptr)))
if((idprop=rna_idproperty_check(&prop, ptr))) {
IDP_Int(idprop)= value;
rna_idproperty_touch(idprop);
}
else if(eprop->set) {
eprop->set(ptr, value);
}
@ -2516,6 +2538,7 @@ void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr
if((/*idprop=*/ rna_idproperty_check(&prop, ptr))) {
/* not supported */
/* rna_idproperty_touch(idprop); */
}
else {
PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
@ -4412,15 +4435,23 @@ int RNA_collection_length(PointerRNA *ptr, const char *name)
}
}
int RNA_property_is_set(PointerRNA *ptr, const char *name)
int RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, name);
if(prop->flag & PROP_IDPROPERTY) {
IDProperty *idprop = rna_idproperty_find(ptr, prop->identifier);
return ((idprop != NULL) && !(idprop->flag & IDP_FLAG_GHOST));
}
else {
return 1;
}
}
int RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, identifier);
if(prop) {
if(prop->flag & PROP_IDPROPERTY)
return (rna_idproperty_find(ptr, name) != NULL);
else
return 1;
return RNA_property_is_set(ptr, prop);
}
else {
/* python raises an error */

@ -185,42 +185,6 @@ static int rna_Brush_get_size(PointerRNA *ptr)
return brush_size(me);
}
static void rna_Brush_set_use_locked_size(PointerRNA *ptr, int value)
{
Brush* me = (Brush*)(ptr->data);
brush_set_use_locked_size(me, value);
}
static int rna_Brush_get_use_locked_size(PointerRNA *ptr)
{
Brush* me = (Brush*)(ptr->data);
return brush_use_locked_size(me);
}
static void rna_Brush_set_use_size_pressure(PointerRNA *ptr, int value)
{
Brush* me = (Brush*)(ptr->data);
brush_set_use_size_pressure(me, value);
}
static int rna_Brush_get_use_size_pressure(PointerRNA *ptr)
{
Brush* me = (Brush*)(ptr->data);
return brush_use_size_pressure(me);
}
static void rna_Brush_set_use_alpha_pressure(PointerRNA *ptr, int value)
{
Brush* me = (Brush*)(ptr->data);
brush_set_use_alpha_pressure(me, value);
}
static int rna_Brush_get_use_alpha_pressure(PointerRNA *ptr)
{
Brush* me = (Brush*)(ptr->data);
return brush_use_alpha_pressure(me);
}
static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value)
{
Brush* me = (Brush*)(ptr->data);
@ -575,7 +539,6 @@ static void rna_def_brush(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE);
RNA_def_property_boolean_funcs(prop, "rna_Brush_get_use_alpha_pressure", "rna_Brush_set_use_alpha_pressure");
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength");
RNA_def_property_update(prop, 0, "rna_Brush_update");
@ -588,7 +551,6 @@ static void rna_def_brush(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE);
RNA_def_property_boolean_funcs(prop, "rna_Brush_get_use_size_pressure", "rna_Brush_set_use_size_pressure");
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size");
RNA_def_property_update(prop, 0, "rna_Brush_update");
@ -668,7 +630,6 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_locked_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_Brush_get_use_locked_size", "rna_Brush_set_use_locked_size");
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_LOCK_SIZE);
RNA_def_property_ui_text(prop, "Use Blender Units", "When locked brush stays same size relative to object; when unlocked brush size is given in pixels");
RNA_def_property_update(prop, 0, "rna_Brush_update");

@ -369,6 +369,15 @@ static void rna_Node_update(Main *bmain, Scene *scene, PointerRNA *ptr)
node_update(bmain, scene, ntree, node);
}
static void rna_Node_image_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
bNodeTree *ntree= (bNodeTree*)ptr->id.data;
bNode *node= (bNode*)ptr->data;
node_update(bmain, scene, ntree, node);
WM_main_add_notifier(NC_IMAGE, NULL);
}
static void rna_Node_material_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
bNodeTree *ntree= (bNodeTree*)ptr->id.data;
@ -1268,7 +1277,7 @@ static void def_sh_tex_environment(StructRNA *srna)
RNA_def_property_struct_type(prop, "Image");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Image", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_image_update");
RNA_def_struct_sdna_from(srna, "NodeTexImage", "storage");
def_sh_tex(srna);
@ -1293,7 +1302,7 @@ static void def_sh_tex_image(StructRNA *srna)
RNA_def_property_struct_type(prop, "Image");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Image", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_image_update");
RNA_def_struct_sdna_from(srna, "NodeTexImage", "storage");
def_sh_tex(srna);

@ -32,6 +32,7 @@
#include "rna_internal.h"
#include "DNA_brush_types.h"
#include "DNA_group_types.h"
#include "DNA_modifier_types.h"
#include "DNA_particle_types.h"
@ -1276,8 +1277,6 @@ static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, cons
}
}
/* note: without this, when Multi-Paint is activated/deactivated, the colors
* will not change right away when multiple bones are selected, this function
* is not for general use and only for the few cases where changing scene
@ -1615,19 +1614,65 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Stroke conversion method", "Method used to convert stroke to bones");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
/* Sculpt/Paint Unified Size and Strength */
prop= RNA_def_property(srna, "sculpt_paint_use_unified_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_SIZE);
RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Radius",
"Instead of per brush radius, the radius is shared across brushes");
prop= RNA_def_property(srna, "sculpt_paint_use_unified_strength", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_ALPHA);
RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Strength",
"Instead of per brush strength, the strength is shared across brushes");
/* Unified Paint Settings */
prop= RNA_def_property(srna, "unified_paint_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "UnifiedPaintSettings");
RNA_def_property_ui_text(prop, "Unified Paint Settings", NULL);
}
static void rna_def_unified_paint_settings(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "UnifiedPaintSettings", NULL);
RNA_def_struct_ui_text(srna, "Unified Paint Settings", "Overrides for some of the active brush's settings");
/* high-level flags to enable or disable unified paint settings */
prop= RNA_def_property(srna, "use_unified_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_SIZE);
RNA_def_property_ui_text(prop, "Use Unified Radius",
"Instead of per-brush radius, the radius is shared across brushes");
prop= RNA_def_property(srna, "use_unified_strength", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_ALPHA);
RNA_def_property_ui_text(prop, "Use Unified Strength",
"Instead of per-brush strength, the strength is shared across brushes");
/* unified paint settings that override the equivalent settings
from the active brush */
prop= RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE);
RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS*10);
RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, 0);
RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
prop= RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, 0.001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.001, 1, 0, 0);
RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units");
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "alpha");
RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 0.001);
RNA_def_property_ui_text(prop, "Strength", "How powerful the effect of the brush is when applied");
prop= RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_BRUSH_SIZE_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size");
prop= RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength");
prop= RNA_def_property(srna, "use_locked_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_BRUSH_LOCK_SIZE);
RNA_def_property_ui_text(prop, "Use Blender Units", "When locked brush stays same size relative to object; when unlocked brush size is given in pixels");
}
static void rna_def_unit_settings(BlenderRNA *brna)
{
@ -2038,6 +2083,14 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem aasamples_items[] ={
{0, "SAMPLES_0", 0, "Off", ""},
{2, "SAMPLES_2", 0, "2x", ""},
{4, "SAMPLES_4", 0, "4x", ""},
{8, "SAMPLES_8", 0, "8x", ""},
{16, "SAMPLES_16", 0, "16x", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem framing_types_items[] ={
{SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox",
"Show the entire viewport in the display window, using bar horizontally or vertically"},
@ -2107,6 +2160,11 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "samples", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "aasamples");
RNA_def_property_enum_items(prop, aasamples_items);
RNA_def_property_ui_text(prop, "AA Samples", "The number of AA Samples to use for MSAA");
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "depth");
RNA_def_property_range(prop, 8, 32);
@ -2128,10 +2186,15 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0);
RNA_def_property_boolean_sdna(prop, NULL, "playerflag", GAME_PLAYER_FULLSCREEN);
RNA_def_property_ui_text(prop, "Fullscreen", "Start player in a new fullscreen display");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "use_desktop", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "playerflag", GAME_PLAYER_DESKTOP_RESOLUTION);
RNA_def_property_ui_text(prop, "Desktop", "Uses the current desktop resultion in fullscreen mode");
RNA_def_property_update(prop, NC_SCENE, NULL);
/* Framing */
prop= RNA_def_property(srna, "frame_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "framing.type");
@ -4032,6 +4095,7 @@ void RNA_def_scene(BlenderRNA *brna)
/* Nestled Data */
rna_def_tool_settings(brna);
rna_def_unified_paint_settings(brna);
rna_def_unit_settings(brna);
rna_def_scene_image_format_data(brna);
rna_def_scene_render_data(brna);

@ -371,7 +371,7 @@ EnumPropertyItem wm_report_items[] = {
{RPT_OPERATOR, "OPERATOR", 0, "Operator", ""},
{RPT_WARNING, "WARNING", 0, "Warning", ""},
{RPT_ERROR, "ERROR", 0, "Error", ""},
{RPT_ERROR_INVALID_INPUT, "ERROR_INVALID_INPUT", 0, "Invalid Input", ""},\
{RPT_ERROR_INVALID_INPUT, "ERROR_INVALID_INPUT", 0, "Invalid Input", ""},
{RPT_ERROR_INVALID_CONTEXT, "ERROR_INVALID_CONTEXT", 0, "Invalid Context", ""},
{RPT_ERROR_OUT_OF_MEMORY, "ERROR_OUT_OF_MEMORY", 0, "Out of Memory", ""},
{0, NULL, 0, NULL, NULL}};

@ -716,10 +716,11 @@ static void do_allEdgeDetection(unsigned int t, unsigned int rw, unsigned int *l
is also empty. If both conditions are true for any one of the 4 adjacent pixels
then the current pixel is counted as being a true outer edge pixel.
*/
if((!lomask[pix_nextCol] && !limask[pix_nextCol]) || \
(!lomask[pix_prevCol] && !limask[pix_prevCol]) || \
(!lomask[pix_nextRow] && !limask[pix_nextRow]) || \
(!lomask[pix_prevRow] && !limask[pix_prevRow])) {
if((!lomask[pix_nextCol] && !limask[pix_nextCol]) ||
(!lomask[pix_prevCol] && !limask[pix_prevCol]) ||
(!lomask[pix_nextRow] && !limask[pix_nextRow]) ||
(!lomask[pix_prevRow] && !limask[pix_prevRow]))
{
in_osz++; // increment the outer boundary pixel count
lres[a]=3; // flag pixel as part of outer edge
} else { // it's not a boundary pixel, but it is a gradient pixel
@ -773,10 +774,11 @@ static void do_adjacentEdgeDetection(unsigned int t, unsigned int rw, unsigned i
is also empty. If both conditions are true for any one of the 4 adjacent pixels
then the current pixel is counted as being a true outer edge pixel.
*/
if((!lomask[pix_nextCol] && !limask[pix_nextCol]) || \
(!lomask[pix_prevCol] && !limask[pix_prevCol]) || \
(!lomask[pix_nextRow] && !limask[pix_nextRow]) || \
(!lomask[pix_prevRow] && !limask[pix_prevRow])) {
if((!lomask[pix_nextCol] && !limask[pix_nextCol]) ||
(!lomask[pix_prevCol] && !limask[pix_prevCol]) ||
(!lomask[pix_nextRow] && !limask[pix_nextRow]) ||
(!lomask[pix_prevRow] && !limask[pix_prevRow]))
{
in_osz++; // increment the outer boundary pixel count
lres[a]=3; // flag pixel as part of outer edge
} else { // it's not a boundary pixel, but it is a gradient pixel
@ -786,10 +788,11 @@ static void do_adjacentEdgeDetection(unsigned int t, unsigned int rw, unsigned i
}
} else {
if((!limask[pix_nextCol] && lomask[pix_nextCol]) || \
(!limask[pix_prevCol] && lomask[pix_prevCol]) || \
(!limask[pix_nextRow] && lomask[pix_nextRow]) || \
(!limask[pix_prevRow] && lomask[pix_prevRow])) {
if((!limask[pix_nextCol] && lomask[pix_nextCol]) ||
(!limask[pix_prevCol] && lomask[pix_prevCol]) ||
(!limask[pix_nextRow] && lomask[pix_nextRow]) ||
(!limask[pix_prevRow] && lomask[pix_prevRow]))
{
in_isz++; // increment the inner boundary pixel count
lres[a]=4; // flag pixel as part of inner edge
} else {
@ -1172,7 +1175,7 @@ static void node_composit_exec_doubleedgemask(void *UNUSED(data), bNode *node, b
void register_node_type_cmp_doubleedgemask(bNodeTreeType *ttype) {
static bNodeType ntype; // allocate a node type data structure
node_type_base(ttype, &ntype, CMP_NODE_DOUBLEEDGEMASK, "Double Edge Mask", NODE_CLASS_OP_FILTER, NODE_OPTIONS);
node_type_base(ttype, &ntype, CMP_NODE_DOUBLEEDGEMASK, "Double Edge Mask", NODE_CLASS_MATTE, NODE_OPTIONS);
node_type_socket_templates(&ntype, cmp_node_doubleedgemask_in, cmp_node_doubleedgemask_out);
node_type_size(&ntype, 210, 210, 210);
node_type_exec(&ntype, node_composit_exec_doubleedgemask);

@ -1423,7 +1423,7 @@ static PyObject *BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw
return ret;
}
else if (PyTuple_GET_SIZE(args) > 1) {
PyErr_SetString(PyExc_ValueError, "all args must be keywords"); \
PyErr_SetString(PyExc_ValueError, "all args must be keywords");
return NULL;
}

@ -3055,7 +3055,6 @@ static PyObject *pyrna_struct_is_property_set(BPy_StructRNA *self, PyObject *arg
{
PropertyRNA *prop;
const char *name;
int ret;
PYRNA_STRUCT_CHECK_OBJ(self);
@ -3069,22 +3068,7 @@ static PyObject *pyrna_struct_is_property_set(BPy_StructRNA *self, PyObject *arg
return NULL;
}
/* double property lookup, could speed up */
/* return PyBool_FromLong(RNA_property_is_set(&self->ptr, name)); */
if (RNA_property_flag(prop) & PROP_IDPROPERTY) {
IDProperty *group = RNA_struct_idprops(&self->ptr, 0);
if (group) {
ret = IDP_GetPropertyFromGroup(group, name) ? 1:0;
}
else {
ret = 0;
}
}
else {
ret = 1;
}
return PyBool_FromLong(ret);
return PyBool_FromLong(RNA_property_is_set(&self->ptr, prop));
}
PyDoc_STRVAR(pyrna_struct_is_property_hidden_doc,

@ -604,13 +604,14 @@ int append_qt(struct RenderData *rd, int frame, int *pixels, int rectx, int rect
OSStatus err = noErr;
unsigned char *from_Ptr,*to_Ptr;
int y,from_i,to_i;
BOOL alpha = (rd->im_format.planes == R_IMF_PLANES_RGBA)? YES: NO;
/* Create bitmap image rep in blender format (32bit RGBA) */
blBitmapFormatImage = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
pixelsWide:rectx
pixelsHigh:recty
bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO
bitsPerSample:8 samplesPerPixel:4 hasAlpha:alpha isPlanar:NO
colorSpaceName:NSCalibratedRGBColorSpace
bitmapFormat:NSAlphaNonpremultipliedBitmapFormat
bytesPerRow:rectx*4

@ -2283,7 +2283,18 @@ static void displace_render_vert(Render *re, ObjectRen *obr, ShadeInput *shi, Ve
if(texco & TEXCO_REFL) {
/* not (yet?) */
}
if(texco & TEXCO_STRESS) {
float *s= RE_vertren_get_stress(obr, vr, 0);
if(s) {
shi->stress= *s;
if(shi->stress<1.0f) shi->stress-= 1.0f;
else shi->stress= (shi->stress-1.0f)/shi->stress;
}
else
shi->stress= 0.0f;
}
shi->displace[0]= shi->displace[1]= shi->displace[2]= 0.0;
do_material_tex(shi, re);
@ -3536,6 +3547,9 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
}
if(!timeoffset) {
if(need_stress)
calc_edge_stress(re, obr, me);
if (test_for_displace(re, ob ) ) {
recalc_normals= 1;
calc_vertexnormals(re, obr, 0, 0);
@ -3552,9 +3566,6 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
if(recalc_normals!=0 || need_tangent!=0)
calc_vertexnormals(re, obr, need_tangent, need_nmap_tangent);
if(need_stress)
calc_edge_stress(re, obr, me);
}
dm->release(dm);

@ -1036,6 +1036,9 @@ void zbufsinglewire(ZSpan *zspan, int obi, int zvlnr, const float ho1[4], const
* @param v2 [4 floats, world coordinates] second vertex
* @param v3 [4 floats, world coordinates] third vertex
*/
/* WATCH IT: zbuffillGLinv4 and zbuffillGL4 are identical except for a 2 lines,
* commented below */
static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, float *v3, float *v4)
{
double zxd, zyd, zy0, zverg;
@ -1047,10 +1050,10 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v
int *rectmaskofs, *rm;
int *rz, x, y;
int sn1, sn2, rectx, *rectzofs, my0, my2;
/* init */
zbuf_init_span(zspan);
/* set spans */
zbuf_add_to_span(zspan, v1, v2);
zbuf_add_to_span(zspan, v2, v3);
@ -1058,19 +1061,19 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v
zbuf_add_to_span(zspan, v3, v4);
zbuf_add_to_span(zspan, v4, v1);
}
else
else
zbuf_add_to_span(zspan, v3, v1);
/* clipped */
if(zspan->minp2==NULL || zspan->maxp2==NULL) return;
if(zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
if(zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
// printf("my %d %d\n", my0, my2);
if(my2<my0) return;
/* ZBUF DX DY, in floats still */
x1= v1[0]- v2[0];
x2= v2[0]- v3[0];
@ -1081,22 +1084,22 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v
x0= y1*z2-z1*y2;
y0= z1*x2-x1*z2;
z0= x1*y2-y1*x2;
if(z0==0.0f) return;
xx1= (x0*v1[0] + y0*v1[1])/z0 + v1[2];
zxd= -(double)x0/(double)z0;
zyd= -(double)y0/(double)z0;
zy0= ((double)my2)*zyd + (double)xx1;
/* start-offset in rect */
rectx= zspan->rectx;
rectzofs= (zspan->rectz+rectx*my2);
rectpofs= (zspan->rectp+rectx*my2);
rectoofs= (zspan->recto+rectx*my2);
rectmaskofs= (zspan->rectmask+rectx*my2);
/* correct span */
sn1= (my0 + my2)/2;
if(zspan->span1[sn1] < zspan->span2[sn1]) {
@ -1107,45 +1110,45 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v
span1= zspan->span2+my2;
span2= zspan->span1+my2;
}
for(y=my2; y>=my0; y--, span1--, span2--) {
sn1= floor(*span1);
sn2= floor(*span2);
sn1++;
sn1++;
if(sn2>=rectx) sn2= rectx-1;
if(sn1<0) sn1= 0;
if(sn2>=sn1) {
int intzverg;
zverg= (double)sn1*zxd + zy0;
rz= rectzofs+sn1;
rp= rectpofs+sn1;
ro= rectoofs+sn1;
rm= rectmaskofs+sn1;
x= sn2-sn1;
while(x>=0) {
intzverg= (int)CLAMPIS(zverg, INT_MIN, INT_MAX);
if( intzverg > *rz || *rz==0x7FFFFFFF) {
if( intzverg > *rz || *rz==0x7FFFFFFF) { /* UNIQUE LINE: see comment above */
if(!zspan->rectmask || intzverg > *rm) {
*ro= obi;
*ro= obi; /* UNIQUE LINE: see comment above (order differs) */
*rz= intzverg;
*rp= zvlnr;
}
}
zverg+= zxd;
rz++;
rp++;
rz++;
rp++;
ro++;
rm++;
x--;
}
}
zy0-=zyd;
rectzofs-= rectx;
rectpofs-= rectx;
@ -1156,6 +1159,8 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v
/* uses spanbuffers */
/* WATCH IT: zbuffillGLinv4 and zbuffillGL4 are identical except for a 2 lines,
* commented below */
static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, float *v3, float *v4)
{
double zxd, zyd, zy0, zverg;
@ -1167,10 +1172,10 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
int *rectmaskofs, *rm;
int *rz, x, y;
int sn1, sn2, rectx, *rectzofs, my0, my2;
/* init */
zbuf_init_span(zspan);
/* set spans */
zbuf_add_to_span(zspan, v1, v2);
zbuf_add_to_span(zspan, v2, v3);
@ -1178,19 +1183,19 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
zbuf_add_to_span(zspan, v3, v4);
zbuf_add_to_span(zspan, v4, v1);
}
else
else
zbuf_add_to_span(zspan, v3, v1);
/* clipped */
if(zspan->minp2==NULL || zspan->maxp2==NULL) return;
if(zspan->miny1 < zspan->miny2) my0= zspan->miny2; else my0= zspan->miny1;
if(zspan->maxy1 > zspan->maxy2) my2= zspan->maxy2; else my2= zspan->maxy1;
// printf("my %d %d\n", my0, my2);
// printf("my %d %d\n", my0, my2);
if(my2<my0) return;
/* ZBUF DX DY, in floats still */
x1= v1[0]- v2[0];
x2= v2[0]- v3[0];
@ -1201,7 +1206,7 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
x0= y1*z2-z1*y2;
y0= z1*x2-x1*z2;
z0= x1*y2-y1*x2;
if(z0==0.0f) return;
xx1= (x0*v1[0] + y0*v1[1])/z0 + v1[2];
@ -1227,45 +1232,45 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2,
span1= zspan->span2+my2;
span2= zspan->span1+my2;
}
for(y=my2; y>=my0; y--, span1--, span2--) {
sn1= floor(*span1);
sn2= floor(*span2);
sn1++;
sn1++;
if(sn2>=rectx) sn2= rectx-1;
if(sn1<0) sn1= 0;
if(sn2>=sn1) {
int intzverg;
zverg= (double)sn1*zxd + zy0;
rz= rectzofs+sn1;
rp= rectpofs+sn1;
ro= rectoofs+sn1;
rm= rectmaskofs+sn1;
x= sn2-sn1;
while(x>=0) {
intzverg= (int)CLAMPIS(zverg, INT_MIN, INT_MAX);
if(intzverg < *rz) {
if(intzverg < *rz) { /* ONLY UNIQUE LINE: see comment above */
if(!zspan->rectmask || intzverg > *rm) {
*rz= intzverg;
*rp= zvlnr;
*ro= obi;
*ro= obi; /* UNIQUE LINE: see comment above (order differs) */
}
}
zverg+= zxd;
rz++;
rp++;
ro++;
rz++;
rp++;
ro++;
rm++;
x--;
}
}
zy0-=zyd;
rectzofs-= rectx;
rectpofs-= rectx;

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