svn merge ^/trunk/blender -r48604:48638

This commit is contained in:
Campbell Barton
2012-07-05 11:40:48 +00:00
55 changed files with 322 additions and 253 deletions

View File

@@ -244,7 +244,7 @@ PyObject* AUD_initPython()
return module;
}
PyObject* AUD_getPythonFactory(AUD_Sound* sound)
void* AUD_getPythonFactory(AUD_Sound* sound)
{
if(sound)
{
@@ -259,9 +259,9 @@ PyObject* AUD_getPythonFactory(AUD_Sound* sound)
return NULL;
}
AUD_Sound* AUD_getPythonSound(PyObject* sound)
AUD_Sound* AUD_getPythonSound(void* sound)
{
Factory* factory = checkFactory(sound);
Factory* factory = checkFactory((PyObject *)sound);
if(!factory)
return NULL;

View File

@@ -29,10 +29,6 @@
#ifndef __AUD_C_API_H__
#define __AUD_C_API_H__
#ifdef WITH_PYTHON
#include "Python.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
@@ -740,14 +736,14 @@ extern AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* seque
* \param sound The sound factory.
* \return The python factory.
*/
extern PyObject* AUD_getPythonFactory(AUD_Sound* sound);
extern void* AUD_getPythonFactory(AUD_Sound* sound);
/**
* Retrieves the sound factory of a python factory.
* \param sound The python factory.
* \return The sound factory.
*/
extern AUD_Sound* AUD_getPythonSound(PyObject* sound);
extern AUD_Sound* AUD_getPythonSound(void* sound);
#endif
#ifdef __cplusplus

View File

@@ -328,7 +328,8 @@ extern GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle
* @param windowhandle The handle to the window
* @param bitmap The bitmap data for the cursor.
* @param mask The mask data for the cursor.
* @parm sizex, sizey The size of the cursor
* @param sizex The width of the cursor
* @param sizey The height of the cursor
* @param hotX The X coordinate of the cursor hotspot.
* @param hotY The Y coordinate of the cursor hotspot.
* @param fg_color, bg_color Colors of the cursor

View File

@@ -34,8 +34,8 @@
#define __PLX__FAKE_AA__
/* from BLI_utildefines.h */
#define MIN2(x, y) ( (x) < (y) ? (x) : (y) )
#define MAX2(x, y) ( (x) > (y) ? (x) : (y) )
#define MIN2(x, y) ( (x) < (y) ? (x) : (y) )
#define MAX2(x, y) ( (x) > (y) ? (x) : (y) )
#define ABS(a) ( (a) < 0 ? (-(a)) : (a) )
struct e_status {
@@ -96,7 +96,8 @@ static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *v
/* we're not at the last vert, so end of the edge is the previous vertex */
xend = v[i - 1].x;
yend = v[i - 1].y;
} else {
}
else {
/* we're at the first vertex, so the "end" of this edge is the last vertex */
xend = v[num_verts - 1].x;
yend = v[num_verts - 1].y;
@@ -125,7 +126,8 @@ static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *v
if (dx > 0) {
e_new->xdir = 1;
xdist = dx;
} else {
}
else {
e_new->xdir = -1;
xdist = -dx;
}
@@ -138,13 +140,15 @@ static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *v
/* calculate deltas for incremental drawing */
if (dx >= 0) {
e_new->drift = 0;
} else {
}
else {
e_new->drift = -dy + 1;
}
if (dy >= xdist) {
e_new->drift_inc = xdist;
e_new->xshift = 0;
} else {
}
else {
e_new->drift_inc = xdist % dy;
e_new->xshift = (xdist / dy) * e_new->xdir;
}
@@ -187,7 +191,7 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
* If the number of verts specified to render as a polygon is less than 3,
* return immediately. Obviously we cant render a poly with sides < 3. The
* return for this we set to 1, simply so it can be distinguished from the
* next place we could return, /home/guest/blender-svn/soc-2011-tomato/intern/raskter/raskter.
* next place we could return.
* which is a failure to allocate memory.
*/
if (num_verts < 3) {
@@ -211,6 +215,12 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
*/
preprocess_all_edges(ctx, verts, num_verts, edgbuf);
/* can happen with a zero area mask */
if (ctx->all_edges == NULL) {
free(edgbuf);
return(0);
}
/*
* Set the pointer for tracking the edges currently in processing to NULL to make sure
* we don't get some crazy value after initialization.
@@ -258,7 +268,8 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
edgec = &ctx->all_edges->e_next; /* Set our list to the next edge's location in memory. */
ctx->all_edges = e_temp; /* Skip the NULL or bad X edge, set pointer to next edge. */
break; /* Stop looping edges (since we ran out or hit empty X span. */
} else {
}
else {
edgec = &e_curr->e_next; /* Set the pointer to the edge list the "next" edge. */
}
}
@@ -320,7 +331,8 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
for (edgec = &ctx->possible_edges; (e_curr = *edgec); ) {
if (!(--(e_curr->num))) {
*edgec = e_curr->e_next;
} else {
}
else {
e_curr->x += e_curr->xshift;
if ((e_curr->drift += e_curr->drift_inc) > 0) {
e_curr->x += e_curr->xdir;
@@ -379,8 +391,9 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
}
int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
float *buf, int buf_x, int buf_y, int do_mask_AA) {
int subdiv_AA = (do_mask_AA != 0)? 8:0;
float *buf, int buf_x, int buf_y, int do_mask_AA)
{
int subdiv_AA = (do_mask_AA != 0) ? 8 : 0;
int i; /* i: Loop counter. */
int sAx;
int sAy;
@@ -388,7 +401,7 @@ int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
struct r_fill_context ctx = {0};
const float buf_x_f = (float)(buf_x);
const float buf_y_f = (float)(buf_y);
float div_offset=(1.0f / (float)(subdiv_AA));
float div_offset = (1.0f / (float)(subdiv_AA));
float div_offset_static = 0.5f * (float)(subdiv_AA) * div_offset;
/*
* Allocate enough memory for our poly_vert list. It'll be the size of the poly_vert
@@ -413,21 +426,22 @@ int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
* drawn will be 1.0f in value, there is no anti-aliasing.
*/
if(!subdiv_AA) {
for (i = 0; i < num_base_verts; i++) { /* Loop over all base_verts. */
ply[i].x = (int)((base_verts[i][0] * buf_x_f) + 0.5f); /* Range expand normalized X to integer buffer-space X. */
if (!subdiv_AA) {
for (i = 0; i < num_base_verts; i++) { /* Loop over all base_verts. */
ply[i].x = (int)((base_verts[i][0] * buf_x_f) + 0.5f); /* Range expand normalized X to integer buffer-space X. */
ply[i].y = (int)((base_verts[i][1] * buf_y_f) + 0.5f); /* Range expand normalized Y to integer buffer-space Y. */
}
}
i = rast_scan_fill(&ctx, ply, num_base_verts,1.0f); /* Call our rasterizer, passing in the integer coords for each vert. */
} else {
for(sAx=0; sAx < subdiv_AA; sAx++) {
for(sAy=0; sAy < subdiv_AA; sAy++) {
for(i=0; i < num_base_verts; i++) {
ply[i].x = (int)((base_verts[i][0]*buf_x_f)+0.5f - div_offset_static + (div_offset*(float)(sAx)));
ply[i].y = (int)((base_verts[i][1]*buf_y_f)+0.5f - div_offset_static + (div_offset*(float)(sAy)));
i = rast_scan_fill(&ctx, ply, num_base_verts, 1.0f); /* Call our rasterizer, passing in the integer coords for each vert. */
}
else {
for (sAx = 0; sAx < subdiv_AA; sAx++) {
for (sAy = 0; sAy < subdiv_AA; sAy++) {
for (i = 0; i < num_base_verts; i++) {
ply[i].x = (int)((base_verts[i][0] * buf_x_f) + 0.5f - div_offset_static + (div_offset * (float)(sAx)));
ply[i].y = (int)((base_verts[i][1] * buf_y_f) + 0.5f - div_offset_static + (div_offset * (float)(sAy)));
}
i = rast_scan_fill(&ctx, ply, num_base_verts,(1.0f / (float)(subdiv_AA*subdiv_AA)));
i = rast_scan_fill(&ctx, ply, num_base_verts, (1.0f / (float)(subdiv_AA * subdiv_AA)));
}
}
}
@@ -442,7 +456,8 @@ int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
*/
static int rast_scan_feather(struct r_fill_context *ctx,
float (*base_verts_f)[2], int num_base_verts,
struct poly_vert *feather_verts, float(*feather_verts_f)[2], int num_feather_verts) {
struct poly_vert *feather_verts, float(*feather_verts_f)[2], int num_feather_verts)
{
int x_curr; /* current pixel position in X */
int y_curr; /* current scan line being drawn */
int yp; /* y-pixel's position in frame buffer */
@@ -495,6 +510,12 @@ static int rast_scan_feather(struct r_fill_context *ctx,
return(0);
}
/* can happen with a zero area mask */
if (ctx->all_edges == NULL) {
free(edgbuf);
return(0);
}
/*
* Do some preprocessing on all edges. This constructs a table structure in memory of all
* the edge properties and can "flip" some edges so sorting works correctly.
@@ -548,7 +569,8 @@ static int rast_scan_feather(struct r_fill_context *ctx,
edgec = &ctx->all_edges->e_next; /* Set our list to the next edge's location in memory. */
ctx->all_edges = e_temp; /* Skip the NULL or bad X edge, set pointer to next edge. */
break; /* Stop looping edges (since we ran out or hit empty X span. */
} else {
}
else {
edgec = &e_curr->e_next; /* Set the pointer to the edge list the "next" edge. */
}
}
@@ -658,7 +680,8 @@ static int rast_scan_feather(struct r_fill_context *ctx,
for (edgec = &ctx->possible_edges; (e_curr = *edgec); ) {
if (!(--(e_curr->num))) {
*edgec = e_curr->e_next;
} else {
}
else {
e_curr->x += e_curr->xshift;
if ((e_curr->drift += e_curr->drift_inc) > 0) {
e_curr->x += e_curr->xdir;
@@ -992,7 +1015,8 @@ int PLX_antialias_buffer(float *buf, int buf_x, int buf_y)
if(!horzSpan) {
lumaN = lumaW;
lumaS = lumaE;
} else {
}
else {
lengthSign = 1.0f / (float)(buf_y);
}
subpixB = (subpixA * (1.0f/12.0f)) - lumaM;
@@ -1014,7 +1038,8 @@ int PLX_antialias_buffer(float *buf, int buf_x, int buf_y)
offNP_y = (horzSpan) ? 0.0f:(1.0f / (float)(buf_y));
if(!horzSpan) {
posB_x += lengthSign * 0.5f;
} else {
}
else {
posB_y += lengthSign * 0.5f;
}
@@ -1324,7 +1349,8 @@ int PLX_antialias_buffer(float *buf, int buf_x, int buf_y)
pixelOffsetSubpix = MAX2(pixelOffsetGood, subpixH);
if(!horzSpan) {
posM_x += pixelOffsetSubpix * lengthSign;
} else {
}
else {
posM_y += pixelOffsetSubpix * lengthSign;
}
//may need bilinear filtered get_pixel_intensity() here...

View File

@@ -275,7 +275,7 @@ SPELL_CACHE = os.path.join("/tmp", ".spell_cache")
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
try:
from i18n_override_settings import *
from bl_i18n_override_settings import *
except ImportError: # If no i18n_override_settings available, its no error!
pass

View File

@@ -24,8 +24,8 @@ language_id = "shell"
def add_scrollback(text, text_type):
for l in text.split('\n'):
bpy.ops.console.scrollback_append(text=l.replace('\t', ' '),
for l in text.split("\n"):
bpy.ops.console.scrollback_append(text=l.replace("\t", " "),
type=text_type)
@@ -40,7 +40,7 @@ def shell_run(text):
add_scrollback(output, style)
PROMPT = '$ '
PROMPT = "$ "
def execute(context):

View File

@@ -1,8 +1,6 @@
import bpy
settings = bpy.context.edit_movieclip.tracking.settings
settings.default_tracker = 'Hybrid'
settings.default_pyramid_levels = 2
settings.default_correlation_min = 0.75
settings.default_pattern_size = 21
settings.default_search_size = 100

View File

@@ -1,8 +1,6 @@
import bpy
settings = bpy.context.edit_movieclip.tracking.settings
settings.default_tracker = 'KLT'
settings.default_pyramid_levels = 4
settings.default_correlation_min = 0.75
settings.default_pattern_size = 11
settings.default_search_size = 202

View File

@@ -1,8 +1,6 @@
import bpy
settings = bpy.context.edit_movieclip.tracking.settings
settings.default_tracker = 'Hybrid'
settings.default_pyramid_levels = 2
settings.default_correlation_min = 0.75
settings.default_pattern_size = 11
settings.default_search_size = 61

View File

@@ -1,8 +1,6 @@
import bpy
settings = bpy.context.edit_movieclip.tracking.settings
settings.default_tracker = 'Hybrid'
settings.default_pyramid_levels = 2
settings.default_correlation_min = 0.7
settings.default_pattern_size = 31
settings.default_search_size = 300

View File

@@ -105,8 +105,6 @@ def CLIP_default_settings_from_track(clip, track):
search[0] = search[0] * width
search[1] = search[1] * height
settings.default_tracker = track.tracker
settings.default_pyramid_levels = track.pyramid_levels
settings.default_correlation_min = track.correlation_min
settings.default_pattern_size = max(pattern[0], pattern[1])
settings.default_search_size = max(search[0], search[1])
@@ -497,7 +495,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
fg = rlayers[0]
fg.name = 'Foreground'
else:
fg = scene.render.layers.new('Foreground')
fg = scene.render.layers.new("Foreground")
fg.use_sky = False
fg.layers = [True] + [False] * 19
@@ -505,7 +503,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
fg.use_pass_vector = True
if not scene.render.layers.get("Background"):
bg = scene.render.layers.new('Background')
bg = scene.render.layers.new("Background")
bg.use_pass_shadow = True
bg.use_pass_ambient_occlusion = True
bg.layers = [False] * 10 + [True] + [False] * 9
@@ -560,7 +558,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
space.show_backdrop = True
CLIP_spaces_walk(context, True, 'NODE_EDITOR', 'NODE_EDITOR',
setup_space)
setup_space)
sc = context.space_data
scene = context.scene
@@ -612,46 +610,46 @@ class CLIP_OT_setup_tracking_scene(Operator):
add_shadow.blend_type = 'ADD'
mul_shadow.blend_type = 'MULTIPLY'
mul_shadow.inputs['Fac'].default_value = 0.8
mul_shadow.inputs["Fac"].default_value = 0.8
mul_image.blend_type = 'MULTIPLY'
mul_image.inputs['Fac'].default_value = 0.8
mul_image.inputs["Fac"].default_value = 0.8
vector_blur.factor = 0.75
# create links
tree.links.new(movieclip.outputs['Image'], distortion.inputs['Image'])
tree.links.new(movieclip.outputs["Image"], distortion.inputs["Image"])
if need_stabilization:
tree.links.new(distortion.outputs['Image'],
stabilize.inputs['Image'])
tree.links.new(stabilize.outputs['Image'], scale.inputs['Image'])
tree.links.new(distortion.outputs["Image"],
stabilize.inputs["Image"])
tree.links.new(stabilize.outputs["Image"], scale.inputs["Image"])
else:
tree.links.new(distortion.outputs['Image'], scale.inputs['Image'])
tree.links.new(distortion.outputs["Image"], scale.inputs["Image"])
tree.links.new(rlayer_bg.outputs['Alpha'], invert.inputs['Color'])
tree.links.new(rlayer_bg.outputs["Alpha"], invert.inputs["Color"])
tree.links.new(invert.outputs['Color'], add_shadow.inputs[1])
tree.links.new(rlayer_bg.outputs['Shadow'], add_shadow.inputs[2])
tree.links.new(invert.outputs["Color"], add_shadow.inputs[1])
tree.links.new(rlayer_bg.outputs["Shadow"], add_shadow.inputs[2])
tree.links.new(invert.outputs['Color'], add_ao.inputs[1])
tree.links.new(rlayer_bg.outputs['AO'], add_ao.inputs[2])
tree.links.new(invert.outputs["Color"], add_ao.inputs[1])
tree.links.new(rlayer_bg.outputs["AO"], add_ao.inputs[2])
tree.links.new(add_ao.outputs['Image'], mul_shadow.inputs[1])
tree.links.new(add_shadow.outputs['Image'], mul_shadow.inputs[2])
tree.links.new(add_ao.outputs["Image"], mul_shadow.inputs[1])
tree.links.new(add_shadow.outputs["Image"], mul_shadow.inputs[2])
tree.links.new(scale.outputs['Image'], mul_image.inputs[1])
tree.links.new(mul_shadow.outputs['Image'], mul_image.inputs[2])
tree.links.new(scale.outputs["Image"], mul_image.inputs[1])
tree.links.new(mul_shadow.outputs["Image"], mul_image.inputs[2])
tree.links.new(rlayer_fg.outputs['Image'], vector_blur.inputs['Image'])
tree.links.new(rlayer_fg.outputs['Z'], vector_blur.inputs['Z'])
tree.links.new(rlayer_fg.outputs['Speed'], vector_blur.inputs['Speed'])
tree.links.new(rlayer_fg.outputs["Image"], vector_blur.inputs["Image"])
tree.links.new(rlayer_fg.outputs["Z"], vector_blur.inputs["Z"])
tree.links.new(rlayer_fg.outputs["Speed"], vector_blur.inputs["Speed"])
tree.links.new(mul_image.outputs['Image'], alphaover.inputs[1])
tree.links.new(vector_blur.outputs['Image'], alphaover.inputs[2])
tree.links.new(mul_image.outputs["Image"], alphaover.inputs[1])
tree.links.new(vector_blur.outputs["Image"], alphaover.inputs[2])
tree.links.new(alphaover.outputs['Image'], composite.inputs['Image'])
tree.links.new(alphaover.outputs['Image'], viewer.inputs['Image'])
tree.links.new(alphaover.outputs["Image"], composite.inputs["Image"])
tree.links.new(alphaover.outputs["Image"], viewer.inputs["Image"])
# place nodes
movieclip.location = Vector((-300.0, 350.0))

View File

@@ -436,8 +436,6 @@ class AddPresetTrackingSettings(AddPresetBase, Operator):
]
preset_values = [
"settings.default_tracker",
"settings.default_pyramid_levels",
"settings.default_correlation_min",
"settings.default_pattern_size",
"settings.default_search_size",

View File

@@ -709,7 +709,7 @@ def packIslands(islandList):
# with the islands.
#print '\tPacking UV Islands...'
#XXX Window.DrawProgressBar(0.7, 'Packing %i UV Islands...' % len(packBoxes) )
#XXX Window.DrawProgressBar(0.7, "Packing %i UV Islands..." % len(packBoxes) )
# time1 = time.time()
packWidth, packHeight = geometry.box_pack_2d(packBoxes)
@@ -720,7 +720,7 @@ def packIslands(islandList):
# raise "Error packed boxes differs from original length"
#print '\tWriting Packed Data to faces'
#XXX Window.DrawProgressBar(0.8, 'Writing Packed Data to faces')
#XXX Window.DrawProgressBar(0.8, "Writing Packed Data to faces")
# Sort by ID, so there in sync again
islandIdx = len(islandList)

View File

@@ -1395,8 +1395,8 @@ class WM_OT_keyconfig_export(Operator):
if not self.filepath:
raise Exception("Filepath not set")
if not self.filepath.endswith('.py'):
self.filepath += '.py'
if not self.filepath.endswith(".py"):
self.filepath += ".py"
wm = context.window_manager

View File

@@ -971,8 +971,8 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
split = layout.split()
col = split.column(align=True)
col.operator("object.skin_loose_mark_clear", text="Mark Loose").action = "MARK"
col.operator("object.skin_loose_mark_clear", text="Clear Loose").action = "CLEAR"
col.operator("object.skin_loose_mark_clear", text="Mark Loose").action = 'MARK'
col.operator("object.skin_loose_mark_clear", text="Clear Loose").action = 'CLEAR'
col = split.column()
col.operator("object.skin_root_mark", text="Mark Root")

View File

@@ -454,7 +454,7 @@ class SCENE_PT_game_navmesh(SceneButtonsPanel, Panel):
rd = context.scene.game_settings.recast_data
layout.operator("mesh.navmesh_make", text='Build navigation mesh')
layout.operator("mesh.navmesh_make", text="Build navigation mesh")
col = layout.column()
col.label(text="Rasterization:")

View File

@@ -219,7 +219,7 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
col = split.column()
col.prop(ob, "show_name", text="Name")
col.prop(ob, "show_axis", text="Axis")
if ob.type in {"MESH", "CURVE", "SURFACE", "META", "FONT"}:
if ob.type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT'}:
# Makes no sense for cameras, armtures, etc.!
col.prop(ob, "show_wire", text="Wire")
# Only useful with object having faces/materials...

View File

@@ -86,7 +86,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
if context.scene.render.engine == "BLENDER_GAME":
if context.scene.render.engine == 'BLENDER_GAME':
layout.label("Not available in the Game Engine")
return

View File

@@ -74,7 +74,7 @@ class CONSOLE_MT_language(Menu):
languages = []
for modname, mod in sys.modules.items():
if modname.startswith("console_") and hasattr(mod, "execute"):
languages.append(modname.split('_', 1)[-1])
languages.append(modname.split("_", 1)[-1])
languages.sort()
@@ -83,7 +83,7 @@ class CONSOLE_MT_language(Menu):
def add_scrollback(text, text_type):
for l in text.split('\n'):
for l in text.split("\n"):
bpy.ops.console.scrollback_append(text=l.replace('\t', ' '),
type=text_type)

View File

@@ -804,12 +804,12 @@ class IMAGE_UV_sculpt_curve(Panel):
layout.template_curve_mapping(brush, "curve")
row = layout.row(align=True)
row.operator("brush.curve_preset", icon="SMOOTHCURVE", text="").shape = 'SMOOTH'
row.operator("brush.curve_preset", icon="SPHERECURVE", text="").shape = 'ROUND'
row.operator("brush.curve_preset", icon="ROOTCURVE", text="").shape = 'ROOT'
row.operator("brush.curve_preset", icon="SHARPCURVE", text="").shape = 'SHARP'
row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LINE'
row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX'
row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH'
row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND'
row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT'
row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP'
row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE'
row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX'
class IMAGE_UV_sculpt(Panel, ImagePaintPanel):

View File

@@ -117,7 +117,7 @@ class SEQUENCER_MT_view(Menu):
layout.operator_context = 'INVOKE_DEFAULT'
# # XXX, invokes in the header view
# layout.operator("sequencer.view_ghost_border", text='Overlay Border')
# layout.operator("sequencer.view_ghost_border", text="Overlay Border")
layout.operator("sequencer.view_selected")
@@ -820,7 +820,7 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
col.label(text="Build JPEG quality")
col.prop(strip.proxy, "quality")
if strip.type == "MOVIE":
if strip.type == 'MOVIE':
col = layout.column()
col.label(text="Use timecode index:")

View File

@@ -1121,7 +1121,7 @@ class VIEW3D_MT_brush(Menu):
sculpt_tool = brush.sculpt_tool
layout.separator()
layout.operator_menu_enum("brush.curve_preset", "shape", text='Curve Preset')
layout.operator_menu_enum("brush.curve_preset", "shape", text="Curve Preset")
layout.separator()
if sculpt_tool != 'GRAB':
@@ -1772,7 +1772,7 @@ class VIEW3D_MT_edit_mesh_vertices(Menu):
layout.operator("mesh.vertices_smooth")
layout.operator("mesh.remove_doubles")
layout.operator("mesh.sort_elements", text="Sort Vertices").elements = {"VERT"}
layout.operator("mesh.sort_elements", text="Sort Vertices").elements = {'VERT'}
layout.operator("mesh.select_vertex_path")
@@ -1822,7 +1822,7 @@ class VIEW3D_MT_edit_mesh_edges(Menu):
layout.operator("mesh.bevel")
layout.operator("mesh.edge_split")
layout.operator("mesh.bridge_edge_loops")
layout.operator("mesh.sort_elements", text="Sort Edges").elements = {"EDGE"}
layout.operator("mesh.sort_elements", text="Sort Edges").elements = {'EDGE'}
layout.separator()
@@ -1855,7 +1855,7 @@ class VIEW3D_MT_edit_mesh_faces(Menu):
layout.operator("mesh.bevel")
layout.operator("mesh.solidify")
layout.operator("mesh.wireframe")
layout.operator("mesh.sort_elements", text="Sort Faces").elements = {"FACE"}
layout.operator("mesh.sort_elements", text="Sort Faces").elements = {'FACE'}
layout.separator()

View File

@@ -65,7 +65,7 @@ def add_object_button(self, context):
self.layout.operator(
OBJECT_OT_add_object.bl_idname,
text="Add Object",
icon="PLUGIN")
icon='PLUGIN')
def register():

View File

@@ -21,23 +21,23 @@ def main():
# Some example functions, remove to write your own script.
# check for a positive sensor, will run on any object without errors.
print('Logic info for KX_GameObject', own.name)
print("Logic info for KX_GameObject", own.name)
input = False
for sens in cont.sensors:
# The sensor can be on another object, we may want to use it
own_sens = sens.owner
print(' sensor:', sens.name, end=' ')
print(" sensor:", sens.name, end=" ")
if sens.positive:
print('(true)')
print("(true)")
input = True
else:
print('(false)')
print("(false)")
for actu in cont.actuators:
# The actuator can be on another object, we may want to use it
own_actu = actu.owner
print(' actuator:', actu.name)
print(" actuator:", actu.name)
# This runs the actuator or turns it off
# note that actuators will continue to run unless explicitly turned off.
@@ -49,25 +49,25 @@ def main():
# Its also good practice to get sensors and actuators by name
# rather then index so any changes to their order wont break the script.
# sens_key = cont.sensors['key_sensor']
# actu_motion = cont.actuators['motion']
# sens_key = cont.sensors["key_sensor"]
# actu_motion = cont.actuators["motion"]
# Loop through all other objects in the scene
sce = bge.logic.getCurrentScene()
print('Scene Objects:', sce.name)
print("Scene Objects:", sce.name)
for ob in sce.objects:
print(' ', ob.name, ob.worldPosition)
print(" ", ob.name, ob.worldPosition)
# Example where collision objects are checked for their properties
# adding to our objects "life" property
"""
actu_collide = cont.sensors['collision_sens']
actu_collide = cont.sensors["collision_sens"]
for ob in actu_collide.objectHitList:
# Check to see the object has this property
if ob.has_key('life'):
own['life'] += ob['life']
ob['life'] = 0
print(own['life'])
if "life" in ob:
own["life"] += ob["life"]
ob["life"] = 0
print(own["life"])
"""
main()

View File

@@ -5,8 +5,8 @@ class HelloWorldPanel(bpy.types.Panel):
"""Creates a Panel in the Object properties window"""
bl_label = "Hello World Panel"
bl_idname = "OBJECT_PT_hello"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "object"
def draw(self, context):

View File

@@ -317,9 +317,6 @@ if(WITH_PYTHON)
list(APPEND INC
../python
)
list(APPEND INC_SYS
${PYTHON_INCLUDE_DIRS}
)
add_definitions(-DWITH_PYTHON)
if(WITH_PYTHON_SECURITY)

View File

@@ -32,7 +32,6 @@ if env['WITH_BF_FRAMESERVER']:
if env['WITH_BF_PYTHON']:
incs += ' ../python'
incs += ' ' + env['BF_PYTHON_INC']
defs.append('WITH_PYTHON')
if env['BF_DEBUG']:
defs.append('DEBUG')

View File

@@ -36,18 +36,31 @@
struct bArgs;
typedef struct bArgs bArgs;
/* returns the number of extra arguments consumed by the function. 0 is normal value, -1 stops parsing arguments, other negative indicates skip */
/**
* Returns the number of extra arguments consumed by the function.
* - 0 is normal value,
* - -1 stops parsing arguments, other negative indicates skip
*/
typedef int (*BA_ArgCallback)(int argc, const char **argv, void *data);
struct bArgs *BLI_argsInit(int argc, const char **argv);
void BLI_argsFree(struct bArgs *ba);
/* pass starts at 1, -1 means valid all the time
/**
* Pass starts at 1, -1 means valid all the time
* short_arg or long_arg can be null to specify no short or long versions
* */
void BLI_argsAdd(struct bArgs *ba, int pass, const char *short_arg, const char *long_arg, const char *doc, BA_ArgCallback cb, void *data);
/* short_case and long_case specify if those arguments are case specific */
void BLI_argsAddCase(struct bArgs *ba, int pass, const char *short_arg, int short_case, const char *long_arg, int long_case, const char *doc, BA_ArgCallback cb, void *data);
*/
void BLI_argsAdd(struct bArgs *ba, int pass,
const char *short_arg, const char *long_arg,
const char *doc, BA_ArgCallback cb, void *data);
/**
* Short_case and long_case specify if those arguments are case specific
*/
void BLI_argsAddCase(struct bArgs *ba, int pass,
const char *short_arg, int short_case,
const char *long_arg, int long_case,
const char *doc, BA_ArgCallback cb, void *data);
void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *data);

View File

@@ -159,6 +159,18 @@ void isect_point_quad_uv_v2(const float v0[2], const float v1[2], const float v2
void isect_point_face_uv_v2(const int isquad, const float v0[2], const float v1[2], const float v2[2],
const float v3[2], const float pt[2], float r_uv[2]);
/* axis-aligned bounding box */
int isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min2[3], const float max2[3]);
typedef struct {
float ray_start[3];
float ray_inv_dir[3];
int sign[3];
} IsectRayAABBData;
void isect_ray_aabb_initialize(IsectRayAABBData *data, const float ray_start[3], const float ray_direction[3]);
int isect_ray_aabb(const IsectRayAABBData *data, const float bb_min[3], const float bb_max[3], float *tmin);
/* other */
int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const float radius,
const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float ipoint[3]);
@@ -166,8 +178,6 @@ int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const flo
int isect_axial_line_tri_v3(const int axis, const float co1[3], const float co2[3],
const float v0[3], const float v1[3], const float v2[3], float *r_lambda);
int isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min2[3], const float max2[3]);
int clip_line_plane(float p1[3], float p2[3], const float plane[4]);
void plot_line_v2v2i(const int p1[2], const int p2[2], int (*callback)(int, int, void *), void *userData);

View File

@@ -173,7 +173,8 @@ static bArgDoc *internalDocs(struct bArgs *ba, const char *short_arg, const char
return d;
}
static void internalAdd(struct bArgs *ba, const char *arg, int pass, int case_str, BA_ArgCallback cb, void *data, bArgDoc *d)
static void internalAdd(struct bArgs *ba, const char *arg, int pass,
int case_str, BA_ArgCallback cb, void *data, bArgDoc *d)
{
bArgument *a;
bAKey *key;
@@ -182,8 +183,10 @@ static void internalAdd(struct bArgs *ba, const char *arg, int pass, int case_st
if (a) {
printf("WARNING: conflicting argument\n");
printf("\ttrying to add '%s' on pass %i, %scase sensitive\n", arg, pass, case_str == 1 ? "not " : "");
printf("\tconflict with '%s' on pass %i, %scase sensitive\n\n", a->key->arg, (int)a->key->pass, a->key->case_str == 1 ? "not " : "");
printf("\ttrying to add '%s' on pass %i, %scase sensitive\n",
arg, pass, case_str == 1 ? "not " : "");
printf("\tconflict with '%s' on pass %i, %scase sensitive\n\n",
a->key->arg, (int)a->key->pass, a->key->case_str == 1 ? "not " : "");
}
a = MEM_callocN(sizeof(bArgument), "bArgument");
@@ -201,7 +204,10 @@ static void internalAdd(struct bArgs *ba, const char *arg, int pass, int case_st
BLI_ghash_insert(ba->items, key, a);
}
void BLI_argsAddCase(struct bArgs *ba, int pass, const char *short_arg, int short_case, const char *long_arg, int long_case, const char *doc, BA_ArgCallback cb, void *data)
void BLI_argsAddCase(struct bArgs *ba, int pass,
const char *short_arg, int short_case,
const char *long_arg, int long_case,
const char *doc, BA_ArgCallback cb, void *data)
{
bArgDoc *d = internalDocs(ba, short_arg, long_arg, doc);
@@ -214,7 +220,9 @@ void BLI_argsAddCase(struct bArgs *ba, int pass, const char *short_arg, int shor
}
void BLI_argsAdd(struct bArgs *ba, int pass, const char *short_arg, const char *long_arg, const char *doc, BA_ArgCallback cb, void *data)
void BLI_argsAdd(struct bArgs *ba, int pass,
const char *short_arg, const char *long_arg,
const char *doc, BA_ArgCallback cb, void *data)
{
BLI_argsAddCase(ba, pass, short_arg, 0, long_arg, 0, doc, cb, data);
}

View File

@@ -1284,6 +1284,63 @@ int isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min
min2[0] < max1[0] && min2[1] < max1[1] && min2[2] < max1[2]);
}
void isect_ray_aabb_initialize(IsectRayAABBData *data, const float ray_start[3], const float ray_direction[3])
{
copy_v3_v3(data->ray_start, ray_start);
data->ray_inv_dir[0] = 1.0f / ray_direction[0];
data->ray_inv_dir[1] = 1.0f / ray_direction[1];
data->ray_inv_dir[2] = 1.0f / ray_direction[2];
data->sign[0] = data->ray_inv_dir[0] < 0;
data->sign[1] = data->ray_inv_dir[1] < 0;
data->sign[2] = data->ray_inv_dir[2] < 0;
}
/* Adapted from http://www.gamedev.net/community/forums/topic.asp?topic_id=459973 */
int isect_ray_aabb(const IsectRayAABBData *data, const float bb_min[3],
const float bb_max[3], float *tmin_out)
{
float bbox[2][3];
float tmin, tmax, tymin, tymax, tzmin, tzmax;
copy_v3_v3(bbox[0], bb_min);
copy_v3_v3(bbox[1], bb_max);
tmin = (bbox[data->sign[0]][0] - data->ray_start[0]) * data->ray_inv_dir[0];
tmax = (bbox[1 - data->sign[0]][0] - data->ray_start[0]) * data->ray_inv_dir[0];
tymin = (bbox[data->sign[1]][1] - data->ray_start[1]) * data->ray_inv_dir[1];
tymax = (bbox[1 - data->sign[1]][1] - data->ray_start[1]) * data->ray_inv_dir[1];
if ((tmin > tymax) || (tymin > tmax))
return FALSE;
if (tymin > tmin)
tmin = tymin;
if (tymax < tmax)
tmax = tymax;
tzmin = (bbox[data->sign[2]][2] - data->ray_start[2]) * data->ray_inv_dir[2];
tzmax = (bbox[1 - data->sign[2]][2] - data->ray_start[2]) * data->ray_inv_dir[2];
if ((tmin > tzmax) || (tzmin > tmax))
return FALSE;
if (tzmin > tmin)
tmin = tzmin;
// XXX jwilkins: tmax does not need to be updated since we don't use it
// keeping this here for future reference
//if (tzmax < tmax) tmax = tzmax;
if (tmin_out)
(*tmin_out) = tmin;
return TRUE;
}
/* find closest point to p on line through l1,l2 and return lambda,
* where (0 <= lambda <= 1) when cp is in the line segement l1,l2
*/

View File

@@ -1424,56 +1424,21 @@ void BLI_pbvh_node_get_proxies(PBVHNode *node, PBVHProxyNode **proxies, int *pro
/********************************* Raycast ***********************************/
typedef struct {
/* Ray */
float start[3];
int sign[3];
float inv_dir[3];
IsectRayAABBData ray;
int original;
} RaycastData;
/* Adapted from here: http://www.gamedev.net/community/forums/topic.asp?topic_id=459973 */
static int ray_aabb_intersect(PBVHNode *node, void *data_v)
{
RaycastData *ray = data_v;
float bbox[2][3];
float tmin, tmax, tymin, tymax, tzmin, tzmax;
RaycastData *rcd = data_v;
float bb_min[3], bb_max[3];
if (ray->original)
BLI_pbvh_node_get_original_BB(node, bbox[0], bbox[1]);
if (rcd->original)
BLI_pbvh_node_get_original_BB(node, bb_min, bb_max);
else
BLI_pbvh_node_get_BB(node, bbox[0], bbox[1]);
BLI_pbvh_node_get_BB(node, bb_min, bb_max);
tmin = (bbox[ray->sign[0]][0] - ray->start[0]) * ray->inv_dir[0];
tmax = (bbox[1 - ray->sign[0]][0] - ray->start[0]) * ray->inv_dir[0];
tymin = (bbox[ray->sign[1]][1] - ray->start[1]) * ray->inv_dir[1];
tymax = (bbox[1 - ray->sign[1]][1] - ray->start[1]) * ray->inv_dir[1];
if ((tmin > tymax) || (tymin > tmax))
return 0;
if (tymin > tmin)
tmin = tymin;
if (tymax < tmax)
tmax = tymax;
tzmin = (bbox[ray->sign[2]][2] - ray->start[2]) * ray->inv_dir[2];
tzmax = (bbox[1 - ray->sign[2]][2] - ray->start[2]) * ray->inv_dir[2];
if ((tmin > tzmax) || (tzmin > tmax))
return 0;
if (tzmin > tmin)
tmin = tzmin;
// XXX jwilkins: tmax does not need to be updated since we don't use it
// keeping this here for future reference
//if (tzmax < tmax) tmax = tzmax;
node->tmin = tmin;
return 1;
return isect_ray_aabb(&rcd->ray, bb_min, bb_max, &node->tmin);
}
void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data,
@@ -1482,13 +1447,7 @@ void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data,
{
RaycastData rcd;
copy_v3_v3(rcd.start, ray_start);
rcd.inv_dir[0] = 1.0f / ray_normal[0];
rcd.inv_dir[1] = 1.0f / ray_normal[1];
rcd.inv_dir[2] = 1.0f / ray_normal[2];
rcd.sign[0] = rcd.inv_dir[0] < 0;
rcd.sign[1] = rcd.inv_dir[1] < 0;
rcd.sign[2] = rcd.inv_dir[2] < 0;
isect_ray_aabb_initialize(&rcd.ray, ray_start, ray_normal);
rcd.original = original;
BLI_pbvh_search_callback_occluded(bvh, ray_aabb_intersect, &rcd, cb, data);

View File

@@ -119,8 +119,7 @@ struct GeometryFunctor {
LinkNode *node;
for (node=export_set; node; node = node->next) {
Object *ob = (Object *)node->link;
if (ob->type == OB_MESH)
{
if (ob->type == OB_MESH) {
f(ob);
}
}

View File

@@ -135,7 +135,7 @@ void ImagesExporter::export_UV_Image(Image *image, bool use_copies)
COLLADASW::Image img(COLLADABU::URI(COLLADABU::URI::nativePathToUri(export_path)), translated_name, translated_name); /* set name also to mNameNC. This helps other viewers import files exported from Blender better */
img.add(mSW);
fprintf(stdout, "Collada export: Added image: %s\n",export_file);
fprintf(stdout, "Collada export: Added image: %s\n", export_file);
mImages.push_back(translated_name);
}
}
@@ -145,7 +145,7 @@ void ImagesExporter::export_UV_Images()
std::set<Image *> uv_textures;
LinkNode *node;
bool use_copies = this->export_settings->use_texture_copies;
for (node=this->export_settings->export_set; node; node=node->next) {
for (node = this->export_settings->export_set; node; node = node->next) {
Object *ob = (Object *)node->link;
if (ob->type == OB_MESH && ob->totcol) {
Mesh *me = (Mesh *) ob->data;
@@ -160,7 +160,7 @@ void ImagesExporter::export_UV_Images()
if (ima == NULL)
continue;
bool not_in_list = uv_textures.find(ima)==uv_textures.end();
bool not_in_list = uv_textures.find(ima) == uv_textures.end();
if (not_in_list) {
uv_textures.insert(ima);
export_UV_Image(ima, use_copies);
@@ -177,7 +177,7 @@ bool ImagesExporter::hasImages(Scene *sce)
{
LinkNode *node;
for (node=this->export_settings->export_set; node; node=node->next) {
for (node = this->export_settings->export_set; node; node = node->next) {
Object *ob = (Object *)node->link;
int a;
for (a = 0; a < ob->totcol; a++) {

View File

@@ -25,11 +25,6 @@
#include <sstream>
#include <stdlib.h>
#include "BLI_math.h"
#include "PIL_time.h"
#include "WM_api.h"
#include "WM_types.h"
#include "COM_ExecutionGroup.h"
#include "COM_InputSocket.h"
#include "COM_SocketConnection.h"
@@ -43,6 +38,11 @@
#include "COM_ChunkOrder.h"
#include "COM_ExecutionSystemHelper.h"
#include "BLI_math.h"
#include "PIL_time.h"
#include "WM_api.h"
#include "WM_types.h"
ExecutionGroup::ExecutionGroup()
{
this->m_isOutput = false;

View File

@@ -30,6 +30,7 @@
#include "COM_OpenCLDevice.h"
#include "COM_OpenCLKernels.cl.h"
#include "OCL_opencl.h"
#include "COM_WriteBufferOperation.h"
#include "PIL_time.h"
#include "BLI_threads.h"
@@ -65,6 +66,25 @@ static bool g_openclActive = false;
#endif
#endif
#define HIGHLIGHT(wp) \
{ \
ExecutionGroup* group = wp->getExecutionGroup(); \
if (group->isComplex()) { \
NodeOperation* operation = group->getOutputNodeOperation(); \
if (operation->isWriteBufferOperation()) {\
WriteBufferOperation *writeOperation = (WriteBufferOperation*)operation;\
NodeOperation *complexOperation = writeOperation->getInput(); \
bNode *node = complexOperation->getbNode(); \
if (node) { \
if (node->original) { \
node->original->highlight = 1;\
} else {\
node->highlight = 1; \
}\
} \
} \
} \
}
#if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE
void *WorkScheduler::thread_execute_cpu(void *data)
@@ -73,6 +93,7 @@ void *WorkScheduler::thread_execute_cpu(void *data)
WorkPackage *work;
while ((work = (WorkPackage *)BLI_thread_queue_pop(g_cpuqueue))) {
HIGHLIGHT(work);
device->execute(work);
delete work;
}
@@ -86,6 +107,7 @@ void *WorkScheduler::thread_execute_gpu(void *data)
WorkPackage *work;
while ((work = (WorkPackage *)BLI_thread_queue_pop(g_gpuqueue))) {
HIGHLIGHT(work);
device->execute(work);
delete work;
}

View File

@@ -50,8 +50,7 @@ void LensDistortionNode::convertToOperations(ExecutionSystem *graph, CompositorC
ScreenLensDistortionOperation *operation = new ScreenLensDistortionOperation();
operation->setbNode(editorNode);
operation->setData(data);
if (!(this->getInputSocket(1)->isConnected() || this->getInputSocket(2)->isConnected()))
{
if (!(this->getInputSocket(1)->isConnected() || this->getInputSocket(2)->isConnected())) {
// no nodes connected to the distortion and dispersion. We can precalculate some values
float distortion = ((const bNodeSocketValueFloat *)this->getInputSocket(1)->getbNodeSocket()->default_value)->value;
float dispersion = ((const bNodeSocketValueFloat *)this->getInputSocket(2)->getbNodeSocket()->default_value)->value;

View File

@@ -79,10 +79,10 @@ bool ProjectorLensDistortionOperation::determineDependingAreaOfInterest(rcti *in
newInput.xmin = input->xmin - this->m_kr2 - 2;
newInput.xmax = input->xmax + this->m_kr2 + 2;
} else {
newInput.xmin = input->xmin-7; //(0.25f*20*1)+2 == worse case dispersion
newInput.xmin = input->xmin - 7; //(0.25f*20*1)+2 == worse case dispersion
newInput.ymin = input->ymin;
newInput.ymax = input->ymax;
newInput.xmax = input->xmax+7; //(0.25f*20*1)+2 == worse case dispersion
newInput.xmax = input->xmax + 7; //(0.25f*20*1)+2 == worse case dispersion
}
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}

View File

@@ -232,7 +232,7 @@ bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti *input
return true;
}
#define MARGIN 64
#define MARGIN 96
#define UPDATE_INPUT \
newInput.xmin = MIN3(newInput.xmin, coords[0], coords[2]); \
@@ -256,7 +256,7 @@ bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti *input
UPDATE_INPUT;
determineUV(coords, input->xmax, input->ymin);
UPDATE_INPUT;
margin = (ABS(this->m_distortion)+this->m_dispersion)*MARGIN;
margin = (ABS(this->m_distortion) + this->m_dispersion) * MARGIN + 2.0f;
}
else
{
@@ -283,7 +283,7 @@ bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti *input
UPDATE_INPUT;
determineUV(coords, input->xmax, input->ymin, 1.0f, 1.0f);
UPDATE_INPUT;
margin=MARGIN;
margin = MARGIN;
}
#undef UPDATE_INPUT

View File

@@ -74,7 +74,7 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, Me
#ifdef COM_DEFOCUS_SEARCH
float search[4];
this->inputSearchProgram->read(search, x/InverseSearchRadiusOperation::DIVIDER, y/InverseSearchRadiusOperation::DIVIDER, inputBuffers, NULL);
this->inputSearchProgram->read(search, x/InverseSearchRadiusOperation::DIVIDER, y / InverseSearchRadiusOperation::DIVIDER, inputBuffers, NULL);
int minx = search[0];
int miny = search[1];
int maxx = search[2];
@@ -168,10 +168,10 @@ bool VariableSizeBokehBlurOperation::determineDependingAreaOfInterest(rcti *inpu
}
#ifdef COM_DEFOCUS_SEARCH
rcti searchInput;
searchInput.xmax = (input->xmax/InverseSearchRadiusOperation::DIVIDER)+1;
searchInput.xmin = (input->xmin/InverseSearchRadiusOperation::DIVIDER)-1;
searchInput.ymax = (input->ymax/InverseSearchRadiusOperation::DIVIDER)+1;
searchInput.ymin = (input->ymin/InverseSearchRadiusOperation::DIVIDER)-1;
searchInput.xmax = (input->xmax / InverseSearchRadiusOperation::DIVIDER) + 1;
searchInput.xmin = (input->xmin / InverseSearchRadiusOperation::DIVIDER) - 1;
searchInput.ymax = (input->ymax / InverseSearchRadiusOperation::DIVIDER) + 1;
searchInput.ymin = (input->ymin / InverseSearchRadiusOperation::DIVIDER) - 1;
operation = getInputOperation(4);
if (operation->determineDependingAreaOfInterest(&searchInput, readOperation, output) ) {
return true;

View File

@@ -63,9 +63,6 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int tileNumber, Me
MemoryBuffer *memoryBuffer = this->m_memoryProxy->getBuffer();
float *buffer = memoryBuffer->getBuffer();
if (this->m_input->isComplex()) {
bNode* bnode = this->m_input->getbNode();
if (bnode&& bnode->original) bnode->original->highlight++;
void *data = this->m_input->initializeTileData(rect, memoryBuffers);
int x1 = rect->xmin;
int y1 = rect->ymin;
@@ -90,7 +87,6 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int tileNumber, Me
this->m_input->deinitializeTileData(rect, memoryBuffers, data);
data = NULL;
}
if (bnode&& bnode->original) bnode->original->highlight++;
}
else {
int x1 = rect->xmin;
@@ -143,8 +139,6 @@ void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice* device, rcti *rect,
list<cl_mem> *clMemToCleanUp = new list<cl_mem>();
clMemToCleanUp->push_back(clOutputBuffer);
list<cl_kernel> *clKernelsToCleanUp = new list<cl_kernel>();
bNode* bnode = this->m_input->getbNode();
if (bnode&& bnode->original) bnode->original->highlight++;
this->m_input->executeOpenCL(device, outputBuffer, clOutputBuffer, inputMemoryBuffers, clMemToCleanUp, clKernelsToCleanUp);
@@ -163,10 +157,7 @@ void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice* device, rcti *rect,
this->getMemoryProxy()->getBuffer()->copyContentFrom(outputBuffer);
if (bnode&& bnode->original) bnode->original->highlight++;
// STEP 4
while (clMemToCleanUp->size() > 0) {
cl_mem mem = clMemToCleanUp->front();
error = clReleaseMemObject(mem);

View File

@@ -46,6 +46,9 @@ public:
void deinitExecution();
void executeOpenCLRegion(OpenCLDevice* device, rcti *rect, unsigned int chunkNumber, MemoryBuffer **memoryBuffers, MemoryBuffer *outputBuffer);
void readResolutionFromInputSocket();
inline NodeOperation *getInput() {
return m_input;
}
};
#endif

View File

@@ -1742,7 +1742,7 @@ static int make_local_exec(bContext *C, wmOperator *op)
ID *id;
int a, b, mode = RNA_enum_get(op->ptr, "type");
if (mode == 3) {
if (mode == 4) {
BKE_library_make_local(bmain, NULL, 0); /* NULL is all libs */
WM_event_add_notifier(C, NC_WINDOW, NULL);
return OPERATOR_FINISHED;
@@ -1770,7 +1770,7 @@ static int make_local_exec(bContext *C, wmOperator *op)
{
id = ob->data;
if (id && mode > 1) {
if (id && (mode == 2 || mode == 3)) {
id_make_local(id, 0);
adt = BKE_animdata_from_id(id);
if (adt) BKE_animdata_make_local(adt);
@@ -1794,7 +1794,7 @@ static int make_local_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
if (mode > 1) {
if (mode == 3) {
CTX_DATA_BEGIN (C, Object *, ob, selected_objects)
{
if (ob->type == OB_LAMP) {
@@ -1834,7 +1834,8 @@ void OBJECT_OT_make_local(wmOperatorType *ot)
static EnumPropertyItem type_items[] = {
{1, "SELECTED_OBJECTS", 0, "Selected Objects", ""},
{2, "SELECTED_OBJECTS_DATA", 0, "Selected Objects and Data", ""},
{3, "ALL", 0, "All", ""},
{3, "SELECTED_OBJECTS_DATA_MAT", 0, "Selected Objects, Data and Materials", ""},
{4, "ALL", 0, "All", ""},
{0, NULL, 0, NULL, NULL}};
/* identifiers */

View File

@@ -208,6 +208,9 @@ static void time_draw_cache(SpaceTime *stime, Object *ob)
if (pid->cache->flag & PTCACHE_BAKED) {
col[0] -= 0.4f; col[1] -= 0.4f; col[2] -= 0.4f;
}
else if (pid->cache->flag & PTCACHE_OUTDATED) {
col[0] += 0.4f; col[1] += 0.4f; col[2] += 0.4f;
}
glColor4fv(col);
glEnableClientState(GL_VERTEX_ARRAY);
@@ -699,4 +702,3 @@ void ED_spacetype_time(void)
BKE_spacetype_register(st);
}

View File

@@ -709,9 +709,9 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
glBegin(GL_QUAD_STRIP);
for (a = 0; a < 16; a++) {
vec[0] = -*(si + a) * dirvec[0] + *(co + a) * norvec[0];
vec[1] = -*(si + a) * dirvec[1] + *(co + a) * norvec[1];
vec[2] = -*(si + a) * dirvec[2] + *(co + a) * norvec[2];
vec[0] = -si[a] * dirvec[0] + co[a] * norvec[0];
vec[1] = -si[a] * dirvec[1] + co[a] * norvec[1];
vec[2] = -si[a] * dirvec[2] + co[a] * norvec[2];
madd_v3_v3v3fl(vec1, headvec, vec, head);
madd_v3_v3v3fl(vec2, headvec, vec, head + dist);
@@ -723,9 +723,9 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
}
for (a = 15; a >= 0; a--) {
vec[0] = *(si + a) * dirvec[0] + *(co + a) * norvec[0];
vec[1] = *(si + a) * dirvec[1] + *(co + a) * norvec[1];
vec[2] = *(si + a) * dirvec[2] + *(co + a) * norvec[2];
vec[0] = si[a] * dirvec[0] + co[a] * norvec[0];
vec[1] = si[a] * dirvec[1] + co[a] * norvec[1];
vec[2] = si[a] * dirvec[2] + co[a] * norvec[2];
madd_v3_v3v3fl(vec1, tailvec, vec, tail);
madd_v3_v3v3fl(vec2, tailvec, vec, tail + dist);
@@ -737,9 +737,9 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
}
/* make it cyclic... */
vec[0] = -*(si) * dirvec[0] + *(co) * norvec[0];
vec[1] = -*(si) * dirvec[1] + *(co) * norvec[1];
vec[2] = -*(si) * dirvec[2] + *(co) * norvec[2];
vec[0] = -si[0] * dirvec[0] + co[0] * norvec[0];
vec[1] = -si[0] * dirvec[1] + co[0] * norvec[1];
vec[2] = -si[0] * dirvec[2] + co[0] * norvec[2];
madd_v3_v3v3fl(vec1, headvec, vec, head);
madd_v3_v3v3fl(vec2, headvec, vec, head + dist);

View File

@@ -373,7 +373,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float min[3], float max[3], int r
/* d0 = (viewnormal[0]*cv[i][0] + viewnormal[1]*cv[i][1] + viewnormal[2]*cv[i][2]); */ /* UNUSED */
ds = (ABS(viewnormal[0]) * size[0] + ABS(viewnormal[1]) * size[1] + ABS(viewnormal[2]) * size[2]);
dd = ds/96.f;
dd = ds / 96.f;
n = 0;
good_index = i;

View File

@@ -2873,7 +2873,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
break;
case RV3D_VIEW_BACK:
axis_set_view(C, v3d, ar, 0.0, 0.0, (float)-cos(M_PI / 4.0), (float)-cos(M_PI / 4.0),
axis_set_view(C, v3d, ar, 0.0, 0.0, -cosf(M_PI / 4.0), -cosf(M_PI / 4.0),
viewnum, nextperspo, align_active);
break;
@@ -2888,7 +2888,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
break;
case RV3D_VIEW_FRONT:
axis_set_view(C, v3d, ar, (float)cos(M_PI / 4.0), (float)-sin(M_PI / 4.0), 0.0, 0.0,
axis_set_view(C, v3d, ar, cosf(M_PI / 4.0), -sinf(M_PI / 4.0), 0.0, 0.0,
viewnum, nextperspo, align_active);
break;

View File

@@ -1125,7 +1125,7 @@ int ED_view3d_lock(RegionView3D *rv3d)
break;
case RV3D_VIEW_BACK:
QUATSET(rv3d->viewquat, 0.0, 0.0, (float)-cos(M_PI / 4.0), (float)-cos(M_PI / 4.0));
QUATSET(rv3d->viewquat, 0.0, 0.0, -cosf(M_PI / 4.0), -cosf(M_PI / 4.0));
break;
case RV3D_VIEW_LEFT:
@@ -1137,7 +1137,7 @@ int ED_view3d_lock(RegionView3D *rv3d)
break;
case RV3D_VIEW_FRONT:
QUATSET(rv3d->viewquat, (float)cos(M_PI / 4.0), (float)-sin(M_PI / 4.0), 0.0, 0.0);
QUATSET(rv3d->viewquat, (float)cos(M_PI / 4.0), -sinf(M_PI / 4.0), 0.0, 0.0);
break;
case RV3D_VIEW_RIGHT:

View File

@@ -5114,7 +5114,7 @@ void projectSVData(TransInfo *t, int final)
}
if(!affected)
if (!affected)
continue;
/* only loop data, no vertex data since that contains shape keys,

View File

@@ -463,12 +463,10 @@ static void initSnappingMode(TransInfo *t)
t->tsnap.mode = SCE_SNAP_MODE_INCREMENT;
}
}
else if (t->spacetype == SPACE_NODE)
{
else if (t->spacetype == SPACE_NODE) {
setSnappingCallback(t);
if (t->tsnap.applySnap != NULL)
{
if (t->tsnap.applySnap != NULL) {
t->tsnap.modeSelect = SNAP_NOT_SELECTED;
}
else {

View File

@@ -90,7 +90,7 @@ ImBuf *IMB_loadifffile(int file, int flags, const char *descr)
size = BLI_file_descriptor_size(file);
mem = mmap(NULL, size, PROT_READ, MAP_SHARED, file, 0);
if (mem == (unsigned char *)-1) {
if (mem == (unsigned char *) -1) {
fprintf(stderr, "%s: couldn't get mapping %s\n", __func__, descr);
return NULL;
}
@@ -178,7 +178,7 @@ static void imb_loadtilefile(ImBuf *ibuf, int file, int tx, int ty, unsigned int
size = BLI_file_descriptor_size(file);
mem = mmap(NULL, size, PROT_READ, MAP_SHARED, file, 0);
if (mem == (unsigned char *)-1) {
if (mem == (unsigned char *) -1) {
fprintf(stderr, "Couldn't get memory mapping for %s\n", ibuf->cachename);
return;
}

View File

@@ -2979,10 +2979,12 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{ 1, "ENGLISH", 0, "English (English)", "en_US"},
{ 8, "FRENCH", 0, "French (Français)", "fr_FR"},
{ 4, "ITALIAN", 0, "Italian (Italiano)", "it_IT"},
{ 2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"},
{15, "RUSSIAN", 0, "Russian (Русский)", "ru_RU"},
{13, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese (简体中文)", "zh_CN"},
{ 9, "SPANISH", 0, "Spanish (Español)", "es"},
{14, "TRADITIONAL_CHINESE", 0, "Traditional Chinese (繁體中文)", "zh_TW"},
{18, "UKRAINIAN", 0, "Ukrainian (Український)", "uk_UA"},
{ 0, "", 0, N_("In progress"), ""},
/* using the utf8 flipped form of Arabic (العربية) */
{21, "ARABIC", 0, "Arabic (ﺔﻴﺑﺮﻌﻟﺍ)", "ar_EG"},
@@ -2996,7 +2998,6 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{23, "GREEK", 0, "Greek (Ελληνικά)", "el_GR"},
{31, "HUNGARIAN", 0, "Hungarian (magyar)", "hu_HU"},
{27, "INDONESIAN", 0, "Indonesian (Bahasa indonesia)", "id_ID"},
{ 2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"},
{29, "KYRGYZ", 0, "Kyrgyz (Кыргыз тили)", "ky_KG"},
/* {24, "KOREAN", 0, "Korean (한국 언어)", "ko_KR"}, */ /* XXX No po's yet. */
{25, "NEPALI", 0, "Nepali (नेपाली)", "ne_NP"},
@@ -3009,7 +3010,6 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{28, "SERBIAN_LATIN", 0, "Serbian latin (Srpski latinica)", "sr_RS@latin"},
{ 7, "SWEDISH", 0, "Swedish (Svenska)", "sv_SE"},
{30, "TURKISH", 0, "Turkish (Türkçe)", "tr_TR"},
{18, "UKRAINIAN", 0, "Ukrainian (Український)", "uk_UA"},
{ 0, NULL, 0, NULL, NULL}
};

View File

@@ -34,11 +34,11 @@
#include "NOD_texture.h"
#include <math.h>
static bNodeSocketTemplate inputs[]= {
static bNodeSocketTemplate inputs[] = {
{ SOCK_RGBA, 1, N_("Color"), 1.0f, 0.0f, 0.0f, 1.0f },
{ -1, 0, "" }
};
static bNodeSocketTemplate outputs[]= {
static bNodeSocketTemplate outputs[] = {
{ -1, 0, "" }
};

View File

@@ -224,7 +224,7 @@ static void wm_gesture_draw_circle(wmGesture *gt)
glutil_draw_lined_arc(0.0, M_PI * 2.0, rect->xmax, 40);
glDisable(GL_LINE_STIPPLE);
glTranslatef((float)-rect->xmin, (float)-rect->ymin, 0.0f);
glTranslatef(-rect->xmin, -rect->ymin, 0.0f);
}

View File

@@ -433,7 +433,7 @@ PyObject* KX_SoundActuator::pyattr_get_sound(void *self, const struct KX_PYATTRI
{
KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
if (!actuator->m_sound.isNull())
return AUD_getPythonFactory(&actuator->m_sound);
return (PyObject *)AUD_getPythonFactory(&actuator->m_sound);
else
Py_RETURN_NONE;
}
@@ -547,7 +547,7 @@ int KX_SoundActuator::pyattr_set_sound(void *self, const struct KX_PYATTRIBUTE_D
if (!PyArg_Parse(value, "O", &sound))
return PY_SET_ATTR_FAIL;
AUD_Reference<AUD_IFactory>* snd = reinterpret_cast<AUD_Reference<AUD_IFactory>*>(AUD_getPythonSound(sound));
AUD_Reference<AUD_IFactory>* snd = reinterpret_cast<AUD_Reference<AUD_IFactory>*>(AUD_getPythonSound((void *)sound));
if (snd)
{
actuator->m_sound = *snd;