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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-05-19 16:26:20 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-05-19 16:26:20 +0400
commit9711a0034fc1d508e4e49b7cc991c377789a4499 (patch)
tree8a6ea11b1ee9b5efd26d00eb7318820253a9a5a1
parent9da1a400fabccaa0dd3063eac39c181e1499bb4b (diff)
svn merge ^/trunk/blender -c56892 -c56894 -c56896 -c56897 -c56898 -c56901 -c56902 -c56905 -c56906 -c56912
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp4
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp2
-rw-r--r--source/blender/editors/animation/anim_draw.c6
-rw-r--r--source/blender/editors/include/ED_anim_api.h2
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c54
-rw-r--r--source/blender/editors/space_action/space_action.c2
-rw-r--r--source/blender/editors/space_graph/space_graph.c2
-rw-r--r--source/blender/editors/space_nla/space_nla.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c4
-rw-r--r--source/blender/freestyle/intern/system/RenderMonitor.h15
-rw-r--r--source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp7
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp22
-rw-r--r--source/gameengine/Converter/BL_ActionActuator.cpp2
14 files changed, 90 insertions, 36 deletions
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index e5e734e4e57..bf1e327c52e 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -700,7 +700,9 @@ GHOST_TSuccess GHOST_WindowWin32::initMultisample(PIXELFORMATDESCRIPTOR pfd)
WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB,
WGL_COLOR_BITS_ARB, pfd.cColorBits,
WGL_DEPTH_BITS_ARB, pfd.cDepthBits,
+#ifdef GHOST_OPENGL_ALPHA
WGL_ALPHA_BITS_ARB, pfd.cAlphaBits,
+#endif
WGL_STENCIL_BITS_ARB, pfd.cStencilBits,
WGL_DOUBLE_BUFFER_ARB, GL_TRUE,
WGL_SAMPLE_BUFFERS_ARB, GL_TRUE,
@@ -1310,8 +1312,10 @@ static int WeightPixelFormat(PIXELFORMATDESCRIPTOR& pfd)
weight += pfd.cColorBits - 8;
+#ifdef GHOST_OPENGL_ALPHA
if (pfd.cAlphaBits > 0)
weight ++;
+#endif
/* want swap copy capability -- it matters a lot */
if (pfd.dwFlags & PFD_SWAP_COPY) weight += 16;
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 20855a126a8..25d7c181b68 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -211,7 +211,9 @@ GHOST_WindowX11(
attributes[i++] = GLX_BLUE_SIZE; attributes[i++] = 1;
attributes[i++] = GLX_GREEN_SIZE; attributes[i++] = 1;
attributes[i++] = GLX_DEPTH_SIZE; attributes[i++] = 1;
+#ifdef GHOST_OPENGL_ALPHA
attributes[i++] = GLX_ALPHA_SIZE; attributes[i++] = 1;
+#endif
/* GLX >= 1.4 required for multi-sample */
if (samples && (glxVersionMajor >= 1) && (glxVersionMinor >= 4)) {
attributes[i++] = GLX_SAMPLE_BUFFERS; attributes[i++] = 1;
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index bd4c2347815..8299446bfda 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -251,7 +251,7 @@ void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag)
/* Note: 'Preview Range' tools are defined in anim_ops.c */
/* Draw preview range 'curtains' for highlighting where the animation data is */
-void ANIM_draw_previewrange(const bContext *C, View2D *v2d)
+void ANIM_draw_previewrange(const bContext *C, View2D *v2d, int end_frame_width)
{
Scene *scene = CTX_data_scene(C);
@@ -262,9 +262,9 @@ void ANIM_draw_previewrange(const bContext *C, View2D *v2d)
glColor4f(0.0f, 0.0f, 0.0f, 0.4f);
/* only draw two separate 'curtains' if there's no overlap between them */
- if (PSFRA < PEFRA) {
+ if (PSFRA < PEFRA + end_frame_width) {
glRectf(v2d->cur.xmin, v2d->cur.ymin, (float)PSFRA, v2d->cur.ymax);
- glRectf((float)PEFRA, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
+ glRectf((float)(PEFRA + end_frame_width), v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
}
else {
glRectf(v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index f698f9b0b11..1de1731b515 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -491,7 +491,7 @@ void ANIM_draw_cfra(const struct bContext *C, struct View2D *v2d, short flag);
/* ------------- Preview Range Drawing -------------- */
/* main call to draw preview range curtains */
-void ANIM_draw_previewrange(const struct bContext *C, struct View2D *v2d);
+void ANIM_draw_previewrange(const struct bContext *C, struct View2D *v2d, int end_frame_width);
/* ************************************************* */
/* F-MODIFIER TOOLS */
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 107ff9668f0..79b8cd5e695 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -809,7 +809,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
/* TODO: as sculpt and other paint modes are unified, this
* special mode of drawing will go away */
- if (vc.obact && vc.obact->sculpt) {
+ if ((mode == PAINT_SCULPT) && vc.obact->sculpt) {
float location[3];
int pixel_radius, hit;
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index ea5175df39a..9d727dc689f 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -90,7 +90,9 @@ typedef struct PaintStroke {
int stroke_started;
/* event that started stroke, for modal() return */
int event_type;
-
+ /* check if stroke variables have been initialized */
+ bool stroke_init;
+ /* check if various brush mapping variables have been initialized */
bool brush_init;
float initial_mouse[2];
/* cached_pressure stores initial pressure for size pressure influence mainly */
@@ -389,17 +391,17 @@ static float paint_space_stroke_spacing_variable(const Scene *scene, PaintStroke
* are aligned nicely with no overlap. for this the spacing needs to be
* the average of the previous and next size. */
float s = paint_space_stroke_spacing(scene, stroke, 1.0f, pressure);
- float q = s*dpressure/(2.0f*length);
- float pressure_fac = (1.0f + q)/(1.0f - q);
+ float q = s * dpressure / (2.0f * length);
+ float pressure_fac = (1.0f + q) / (1.0f - q);
float last_size_pressure = stroke->last_pressure;
- float new_size_pressure = stroke->last_pressure*pressure_fac;
+ float new_size_pressure = stroke->last_pressure * pressure_fac;
/* average spacing */
float last_spacing = paint_space_stroke_spacing(scene, stroke, last_size_pressure, pressure);
float new_spacing = paint_space_stroke_spacing(scene, stroke, new_size_pressure, pressure);
- return 0.5f*(last_spacing + new_spacing);
+ return 0.5f * (last_spacing + new_spacing);
}
else {
/* no size pressure */
@@ -432,9 +434,9 @@ static int paint_space_stroke(bContext *C, wmOperator *op, const float final_mou
float spacing = paint_space_stroke_spacing_variable(scene, stroke, pressure, dpressure, length);
if (length >= spacing) {
- mouse[0] = stroke->last_mouse_position[0] + dmouse[0]*spacing;
- mouse[1] = stroke->last_mouse_position[1] + dmouse[1]*spacing;
- pressure = stroke->last_pressure + (spacing/length)*dpressure;
+ mouse[0] = stroke->last_mouse_position[0] + dmouse[0] * spacing;
+ mouse[1] = stroke->last_mouse_position[1] + dmouse[1] * spacing;
+ pressure = stroke->last_pressure + (spacing / length) * dpressure;
paint_brush_stroke_add_step(C, op, mouse, pressure);
@@ -654,7 +656,8 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event)
PaintStroke *stroke = op->customdata;
PaintSample sample_average;
float mouse[2];
- int first = 0;
+ bool first_dab = false;
+ bool first_modal = false;
float zoomx, zoomy;
bool redraw = false;
float pressure;
@@ -675,23 +678,28 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event)
if (event->type == NDOF_MOTION)
return OPERATOR_PASS_THROUGH;
+ /* one time initialization */
+ if(!stroke->stroke_init) {
+ stroke->smooth_stroke_cursor =
+ WM_paint_cursor_activate(CTX_wm_manager(C), paint_poll, paint_draw_smooth_stroke, stroke);
+
+ stroke->stroke_init = true;
+ first_modal = true;
+ }
+
+ /* one time stroke initialization */
if (!stroke->stroke_started) {
- copy_v2_v2(stroke->last_mouse_position, sample_average.mouse);
stroke->last_pressure = sample_average.pressure;
+ copy_v2_v2(stroke->last_mouse_position, sample_average.mouse);
stroke->stroke_started = stroke->test_start(C, op, sample_average.mouse);
BLI_assert((stroke->stroke_started & ~1) == 0); /* 0/1 */
- stroke->last_pressure = pressure;
if (stroke->stroke_started) {
- stroke->smooth_stroke_cursor =
- WM_paint_cursor_activate(CTX_wm_manager(C), paint_poll, paint_draw_smooth_stroke, stroke);
-
if (stroke->brush->flag & BRUSH_AIRBRUSH)
stroke->timer = WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, stroke->brush->rate);
- }
- first = 1;
- //ED_region_tag_redraw(ar);
+ first_dab = true;
+ }
}
/* Cancel */
@@ -702,16 +710,15 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event)
return paint_stroke_cancel(C, op);
}
- if (event->type == stroke->event_type && event->val == KM_RELEASE) {
+ if (event->type == stroke->event_type && event->val == KM_RELEASE && !first_modal) {
stroke_done(C, op);
return OPERATOR_FINISHED;
}
- else if ((first) ||
- (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) ||
+ else if (first_modal || (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) ||
(event->type == TIMER && (event->customdata == stroke->timer)) )
{
- if (stroke->stroke_started) {
- if (paint_smooth_stroke(stroke, mouse, &pressure, &sample_average, mode)) {
+ if (paint_smooth_stroke(stroke, mouse, &pressure, &sample_average, mode)) {
+ if (stroke->stroke_started) {
if (paint_space_stroke_enabled(stroke->brush, mode)) {
if (paint_space_stroke(C, op, mouse, pressure))
redraw = true;
@@ -726,8 +733,7 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* we want the stroke to have the first daub at the start location
* instead of waiting till we have moved the space distance */
- if (first &&
- stroke->stroke_started &&
+ if (first_dab &&
paint_space_stroke_enabled(stroke->brush, mode) &&
!(stroke->brush->flag & BRUSH_ANCHORED) &&
!(stroke->brush->flag & BRUSH_SMOOTH_STROKE))
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index 137ac367815..4aa19dca9fe 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -205,7 +205,7 @@ static void action_main_area_draw(const bContext *C, ARegion *ar)
/* preview range */
UI_view2d_view_ortho(v2d);
- ANIM_draw_previewrange(C, v2d);
+ ANIM_draw_previewrange(C, v2d, 0);
/* callback */
UI_view2d_view_ortho(v2d);
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 98c26a447b7..1ec31368217 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -295,7 +295,7 @@ static void graph_main_area_draw(const bContext *C, ARegion *ar)
/* preview range */
UI_view2d_view_ortho(v2d);
- ANIM_draw_previewrange(C, v2d);
+ ANIM_draw_previewrange(C, v2d, 0);
/* callback */
UI_view2d_view_ortho(v2d);
diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c
index d0773bfe818..5c01a982e26 100644
--- a/source/blender/editors/space_nla/space_nla.c
+++ b/source/blender/editors/space_nla/space_nla.c
@@ -311,7 +311,7 @@ static void nla_main_area_draw(const bContext *C, ARegion *ar)
/* preview range */
UI_view2d_view_ortho(v2d);
- ANIM_draw_previewrange(C, v2d);
+ ANIM_draw_previewrange(C, v2d, 0);
/* callback */
UI_view2d_view_ortho(v2d);
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index bb4910413f6..2d3b5165ea3 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1381,7 +1381,7 @@ static void seq_draw_sfra_efra(Scene *scene, View2D *v2d)
* frame range used is preview range or scene range */
UI_ThemeColorShadeAlpha(TH_BACK, -25, -100);
- if (PSFRA < PEFRA+1) {
+ if (PSFRA < PEFRA + 1) {
glRectf(v2d->cur.xmin, v2d->cur.ymin, (float)PSFRA, v2d->cur.ymax);
glRectf((float)(PEFRA+1), v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
}
@@ -1457,7 +1457,7 @@ void draw_timeline_seq(const bContext *C, ARegion *ar)
/* preview range */
UI_view2d_view_ortho(v2d);
- ANIM_draw_previewrange(C, v2d);
+ ANIM_draw_previewrange(C, v2d, 1);
/* overlap playhead */
if (scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW) {
diff --git a/source/blender/freestyle/intern/system/RenderMonitor.h b/source/blender/freestyle/intern/system/RenderMonitor.h
index 614513b3c56..3bb872cbdfb 100644
--- a/source/blender/freestyle/intern/system/RenderMonitor.h
+++ b/source/blender/freestyle/intern/system/RenderMonitor.h
@@ -44,6 +44,21 @@ public:
virtual ~RenderMonitor() {}
+ inline void setInfo(string info)
+ {
+ if (_re && !info.empty()) {
+ _re->i.infostr = info.c_str();
+ _re->stats_draw(_re->sdh, &_re->i);
+ _re->i.infostr = NULL;
+ }
+ }
+
+ inline void progress(float i)
+ {
+ if (_re)
+ _re->progress(_re->prh, i);
+ }
+
inline bool testBreak()
{
return _re && _re->test_break(_re->tbh);
diff --git a/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp b/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp
index 2d8d3b30f84..61ad78a8567 100644
--- a/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp
+++ b/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp
@@ -83,6 +83,13 @@ void AverageAreaGridDensityProvider::initialize(const real proscenium[4], real s
}
_cellSize = sqrt(cellArea);
+ unsigned maxCells = 931; // * 1.1 = 1024
+ if (std::max(prosceniumWidth, prosceniumHeight) / _cellSize > maxCells) {
+ if (G.debug & G_DEBUG_FREESTYLE) {
+ cout << "Scene-dependent cell size (" << _cellSize << " square) is too small." << endl;
+ }
+ _cellSize = std::max(prosceniumWidth, prosceniumHeight) / maxCells;
+ }
// Now we know how many cells make each side of our grid
_cellsX = ceil(prosceniumWidth / _cellSize);
_cellsY = ceil(prosceniumHeight / _cellSize);
diff --git a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
index bbbf997b463..20b0f6576bb 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
@@ -28,6 +28,7 @@
#include <algorithm>
#include <memory>
#include <stdexcept>
+#include <sstream>
#include "FRS_freestyle.h"
@@ -412,13 +413,24 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap, G& grid, real epsilo
int nSamples = 0;
vector<WFace*> wFaces;
WFace *wFace = NULL;
+ unsigned cnt = 0;
+ unsigned cntStep = (unsigned)ceil(0.01f * vedges.size());
unsigned tmpQI = 0;
unsigned qiClasses[256];
unsigned maxIndex, maxCard;
unsigned qiMajority;
for (vector<ViewEdge*>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) {
- if (iRenderMonitor && iRenderMonitor->testBreak())
- break;
+ if (iRenderMonitor) {
+ if (iRenderMonitor->testBreak())
+ break;
+ if (cnt % cntStep == 0) {
+ stringstream ss;
+ ss << "Freestyle: Visibility computations " << (100 * cnt / vedges.size()) << "%";
+ iRenderMonitor->setInfo(ss.str());
+ iRenderMonitor->progress((float)cnt / vedges.size());
+ }
+ cnt++;
+ }
#if LOGGING
if (_global.debug & G_DEBUG_FREESTYLE) {
cout << "Processing ViewEdge " << (*ve)->getId() << endl;
@@ -583,6 +595,12 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap, G& grid, real epsilo
wFaces.clear();
}
+ if (iRenderMonitor) {
+ stringstream ss;
+ ss << "Freestyle: Visibility computations " << (100 * cnt / vedges.size()) << "%";
+ iRenderMonitor->setInfo(ss.str());
+ iRenderMonitor->progress((float)cnt / vedges.size());
+ }
}
template <typename G, typename I>
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp
index af537db0203..90383021c90 100644
--- a/source/gameengine/Converter/BL_ActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ActionActuator.cpp
@@ -543,6 +543,8 @@ PyAttributeDef BL_ActionActuator::Attributes[] = {
KX_PYATTRIBUTE_RW_FUNCTION("action", BL_ActionActuator, pyattr_get_action, pyattr_set_action),
KX_PYATTRIBUTE_RO_FUNCTION("channelNames", BL_ActionActuator, pyattr_get_channel_names),
KX_PYATTRIBUTE_SHORT_RW("priority", 0, 100, false, BL_ActionActuator, m_priority),
+ KX_PYATTRIBUTE_SHORT_RW("layer", 0, 7, true, BL_ActionActuator, m_layer),
+ KX_PYATTRIBUTE_FLOAT_RW("layerWeight", 0, 1.0, BL_ActionActuator, m_layer_weight),
KX_PYATTRIBUTE_RW_FUNCTION("frame", BL_ActionActuator, pyattr_get_frame, pyattr_set_frame),
KX_PYATTRIBUTE_STRING_RW("propName", 0, MAX_PROP_NAME, false, BL_ActionActuator, m_propname),
KX_PYATTRIBUTE_STRING_RW("framePropName", 0, MAX_PROP_NAME, false, BL_ActionActuator, m_framepropname),