[Bf-blender-cvs] [4eb3b3ce905] greasepencil-object: Fix Paint mode icons
Commit: 4eb3b3ce905f723a8b4c55a7011a7c3d52ecea43 Author: Antonio Vazquez Date: Thu Jul 19 21:21:00 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB4eb3b3ce905f723a8b4c55a7011a7c3d52ecea43 Fix Paint mode icons === R100release/datafiles/icons/brush.gpencil.draw.eraser_line.dat release/datafiles/icons/brush.gpencil.draw.eraser_stroke.dat M release/scripts/startup/bl_ui/space_toolsystem_toolbar.py M source/blender/editors/datafiles/CMakeLists.txt === diff --git a/release/datafiles/icons/brush.gpencil.draw.eraser_line.dat b/release/datafiles/icons/brush.gpencil.draw.eraser_stroke.dat similarity index 100% rename from release/datafiles/icons/brush.gpencil.draw.eraser_line.dat rename to release/datafiles/icons/brush.gpencil.draw.eraser_stroke.dat diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index 10d821eb0dc..ca276d978ed 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -65,18 +65,22 @@ def generate_from_brushes_ex( name = brush.name if name.startswith("Draw "): text = name.replace("Draw ", "") +icon_name = brush.name.lower().replace(" ", "_") elif name.startswith("Eraser "): text = name.replace("Eraser ", "") +icon_name = "draw." + brush.name.lower().replace(" ", "_") elif name.startswith("Fill "): text = name.replace(" Area", "") +icon_name = "draw_fill" else: text = name +icon_name = "draw_pencil" brush_categories.setdefault(category, []).append( ToolDef.from_dict( dict( text=text, -icon=icon_prefix + category.lower().replace(" ", "_"), +icon=icon_prefix + icon_name, data_block=name, widget=None, operator="gpencil.draw", @@ -1038,8 +1042,8 @@ class _defs_gpencil_paint: brush_test_attr="use_paint_grease_pencil", brush_category_attr="grease_pencil_tool", brush_category_layout=( -('Draw Pencil',), -('Draw Pen',), +('Draw Pencil', ), +('Draw Pen', ), ('Draw Ink',), ('Draw Noise',), ('Draw Block',), diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt index 89703f8ba7f..03cd74e3540 100644 --- a/source/blender/editors/datafiles/CMakeLists.txt +++ b/source/blender/editors/datafiles/CMakeLists.txt @@ -537,8 +537,8 @@ set(ICON_NAMES set_property(GLOBAL PROPERTY ICON_GEOM_NAMES # BEGIN ICON_GEOM_NAMES brush.gpencil.draw.eraser_hard - brush.gpencil.draw.eraser_line brush.gpencil.draw.eraser_soft + brush.gpencil.draw.eraser_stroke brush.gpencil.draw_block brush.gpencil.draw_fill brush.gpencil.draw_ink ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c656a6dd6af] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object
Commit: c656a6dd6aff584fb0e6c5547a3235d7dc05c68c Author: Antonio Vazquez Date: Thu Jul 19 20:54:39 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rBc656a6dd6aff584fb0e6c5547a3235d7dc05c68c Merge branch 'blender2.8' into greasepencil-object === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9bacd9e3c94] greasepencil-object: Fisrt try of new Toolbar icons (WIP)
Commit: 9bacd9e3c94a618a57a4e91bf968c8da41d930a0 Author: Antonio Vazquez Date: Thu Jul 19 20:53:42 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB9bacd9e3c94a618a57a4e91bf968c8da41d930a0 Fisrt try of new Toolbar icons (WIP) Designed by Matias Mendiola Still problems with Paint Toolbar === A release/datafiles/icons/brush.gpencil.draw.eraser_hard.dat A release/datafiles/icons/brush.gpencil.draw.eraser_line.dat A release/datafiles/icons/brush.gpencil.draw.eraser_soft.dat A release/datafiles/icons/brush.gpencil.draw_block.dat A release/datafiles/icons/brush.gpencil.draw_fill.dat A release/datafiles/icons/brush.gpencil.draw_ink.dat A release/datafiles/icons/brush.gpencil.draw_marker.dat A release/datafiles/icons/brush.gpencil.draw_noise.dat A release/datafiles/icons/brush.gpencil.draw_pen.dat A release/datafiles/icons/brush.gpencil.draw_pencil.dat A release/datafiles/icons/ops.gpencil.sculpt_clone.dat A release/datafiles/icons/ops.gpencil.sculpt_grab.dat A release/datafiles/icons/ops.gpencil.sculpt_pinch.dat A release/datafiles/icons/ops.gpencil.sculpt_push.dat A release/datafiles/icons/ops.gpencil.sculpt_randomize.dat A release/datafiles/icons/ops.gpencil.sculpt_smooth.dat A release/datafiles/icons/ops.gpencil.sculpt_strength.dat A release/datafiles/icons/ops.gpencil.sculpt_thickness.dat A release/datafiles/icons/ops.gpencil.sculpt_twist.dat A release/datafiles/icons/ops.gpencil.sculpt_weight.dat M source/blender/editors/datafiles/CMakeLists.txt === diff --git a/release/datafiles/icons/brush.gpencil.draw.eraser_hard.dat b/release/datafiles/icons/brush.gpencil.draw.eraser_hard.dat new file mode 100644 index 000..4d740e31775 Binary files /dev/null and b/release/datafiles/icons/brush.gpencil.draw.eraser_hard.dat differ diff --git a/release/datafiles/icons/brush.gpencil.draw.eraser_line.dat b/release/datafiles/icons/brush.gpencil.draw.eraser_line.dat new file mode 100644 index 000..8e0f4a33b8d Binary files /dev/null and b/release/datafiles/icons/brush.gpencil.draw.eraser_line.dat differ diff --git a/release/datafiles/icons/brush.gpencil.draw.eraser_soft.dat b/release/datafiles/icons/brush.gpencil.draw.eraser_soft.dat new file mode 100644 index 000..8e171e3bd42 Binary files /dev/null and b/release/datafiles/icons/brush.gpencil.draw.eraser_soft.dat differ diff --git a/release/datafiles/icons/brush.gpencil.draw_block.dat b/release/datafiles/icons/brush.gpencil.draw_block.dat new file mode 100644 index 000..507bd006fbf Binary files /dev/null and b/release/datafiles/icons/brush.gpencil.draw_block.dat differ diff --git a/release/datafiles/icons/brush.gpencil.draw_fill.dat b/release/datafiles/icons/brush.gpencil.draw_fill.dat new file mode 100644 index 000..14f2b93eb18 Binary files /dev/null and b/release/datafiles/icons/brush.gpencil.draw_fill.dat differ diff --git a/release/datafiles/icons/brush.gpencil.draw_ink.dat b/release/datafiles/icons/brush.gpencil.draw_ink.dat new file mode 100644 index 000..a9c2390e9ad Binary files /dev/null and b/release/datafiles/icons/brush.gpencil.draw_ink.dat differ diff --git a/release/datafiles/icons/brush.gpencil.draw_marker.dat b/release/datafiles/icons/brush.gpencil.draw_marker.dat new file mode 100644 index 000..9afc0ff7250 Binary files /dev/null and b/release/datafiles/icons/brush.gpencil.draw_marker.dat differ diff --git a/release/datafiles/icons/brush.gpencil.draw_noise.dat b/release/datafiles/icons/brush.gpencil.draw_noise.dat new file mode 100644 index 000..b3e1d833dca Binary files /dev/null and b/release/datafiles/icons/brush.gpencil.draw_noise.dat differ diff --git a/release/datafiles/icons/brush.gpencil.draw_pen.dat b/release/datafiles/icons/brush.gpencil.draw_pen.dat new file mode 100644 index 000..3014f1f21ec Binary files /dev/null and b/release/datafiles/icons/brush.gpencil.draw_pen.dat differ diff --git a/release/datafiles/icons/brush.gpencil.draw_pencil.dat b/release/datafiles/icons/brush.gpencil.draw_pencil.dat new file mode 100644 index 000..52635745d59 Binary files /dev/null and b/release/datafiles/icons/brush.gpencil.draw_pencil.dat differ diff --git a/release/datafiles/icons/ops.gpencil.sculpt_clone.dat b/release/datafiles/icons/ops.gpencil.sculpt_clone.dat new file mode 100644 index 000..7ef96019670 Binary files /dev/null and b/release/datafiles/icons/ops.gpencil.sculpt_clone.dat differ diff --git a/release/datafiles/icons/ops.gpencil.sculpt_grab.dat b/release/datafiles/icons/ops.gpencil.sculpt_grab.dat new file mode 100644 index 000..0af1667c849 Binary files /dev/null and b/release/datafiles/icons/ops.gpencil.sculpt_grab.dat differ diff --git a/release/datafiles
[Bf-blender-cvs] [0bf8096501a] master: Resolve the opposite vector ambiguity in Damped Track constraint.
Commit: 0bf8096501a8e7883f4061ba3e425966ba7517cd Author: Alexander Gavrilov Date: Sat Jul 7 23:21:20 2018 +0300 Branches: master https://developer.blender.org/rB0bf8096501a8e7883f4061ba3e425966ba7517cd Resolve the opposite vector ambiguity in Damped Track constraint. Damped Track by specification attempts to arrive at the desired direction via the shortest rotation. However with opposite vectors there are infinitely many valid 180 degree rotations. Currently it gives up and does nothing. I think that it would be more reasonable to resolve the ambiguity arbitrarily, so that Damped Track won't have a weird dead zone. To make it more predictable I use a local axis. In addition, the singularity area vicinity has some floating point precision problems that result in significant jitter. This applies workarounds for two causes of instability. Differential Revision: https://developer.blender.org/D3530 === M source/blender/blenkernel/intern/constraint.c M source/blender/blenlib/BLI_math_vector.h M source/blender/blenlib/intern/math_vector_inline.c === diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 2a5a0cf9ae7..7d861658993 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -3709,7 +3709,7 @@ static void damptrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t * - the min/max wrappers around (obvec . tarvec) result (stored temporarily in rangle) *are used to ensure that the smallest angle is chosen */ - cross_v3_v3v3(raxis, obvec, tarvec); + cross_v3_v3v3_hi_prec(raxis, obvec, tarvec); rangle = dot_v3v3(obvec, tarvec); rangle = acosf(max_ff(-1.0f, min_ff(1.0f, rangle))); @@ -3717,7 +3717,35 @@ static void damptrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t /* construct rotation matrix from the axis-angle rotation found above * - this call takes care to make sure that the axis provided is a unit vector first */ - axis_angle_to_mat3(rmat, raxis, rangle); + float norm = normalize_v3(raxis); + + if (norm < FLT_EPSILON) { + /* if dot product is nonzero, while cross is zero, we have two opposite vectors! +* - this is an ambiguity in the math that needs to be resolved arbitrarily, +*or there will be a case where damped track strangely does nothing +* - to do that, rotate around a different local axis +*/ + float tmpvec[3]; + + if (fabsf(rangle) < M_PI - 0.01f) { + return; + } + + rangle = M_PI; + copy_v3_v3(tmpvec, track_dir_vecs[(data->trackflag + 1) % 6]); + mul_mat3_m4_v3(cob->matrix, tmpvec); + cross_v3_v3v3(raxis, obvec, tmpvec); + + if (normalize_v3(raxis) == 0.0f) { + return; + } + } + else if (norm < 0.1f) { + /* near 0 and Pi arcsin has way better precision than arccos */ + rangle = (rangle > M_PI_2) ? M_PI - asinf(norm) : asinf(norm); + } + + axis_angle_normalized_to_mat3(rmat, raxis, rangle); /* rotate the owner in the way defined by this rotation matrix, then reapply the location since * we may have destroyed that in the process of multiplying the matrix diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index 3f603311530..39625346756 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -169,6 +169,7 @@ MINLINE double dot_v3db_v3fl(const double a[3], const float b[3]) ATTR_WARN_UNUS MINLINE float cross_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT; MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3]); +MINLINE void cross_v3_v3v3_hi_prec(float r[3], const float a[3], const float b[3]); MINLINE void add_newell_cross_v3_v3v3(float n[3], const float v_prev[3], const float v_curr[3]); diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index 08687a1ab47..715e2e65c96 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -753,6 +753,16 @@ MINLINE void cross_v3_v3v3(float r[3], const float
[Bf-blender-cvs] [13818c47cfb] cloth-improvements: Merge branch 'master' into cloth-improvements
Commit: 13818c47cfb946950c8f3e97209076a9e43db4a7 Author: Luca Rood Date: Thu Jul 19 16:02:49 2018 +0200 Branches: cloth-improvements https://developer.blender.org/rB13818c47cfb946950c8f3e97209076a9e43db4a7 Merge branch 'master' into cloth-improvements === === diff --cc release/datafiles/locale index c93ed11a47b,d3349b42856..2b3c19f5f61 --- a/release/datafiles/locale +++ b/release/datafiles/locale @@@ -1,1 -1,1 +1,1 @@@ - Subproject commit c93ed11a47b3016cf59711ec16de2e2e94c30e99 -Subproject commit d3349b42856d00c278f72f2a5909a6c96b9cdb5e ++Subproject commit 2b3c19f5f61fc72dba56a7edfdc4e55e2327dc1f diff --cc release/scripts/addons index 371960484a3,9ae033c49c1..51e18ead5d6 --- a/release/scripts/addons +++ b/release/scripts/addons @@@ -1,1 -1,1 +1,1 @@@ - Subproject commit 371960484a38fc64e0a2635170a41a0d8ab2f6bd -Subproject commit 9ae033c49c1b16718eac6306bdc271a5e6e6bf38 ++Subproject commit 51e18ead5d66e91ad161b971eeacc93e7cd91942 diff --cc release/scripts/addons_contrib index a8515cfdfe9,f178e6c933a..a52733b58d9 --- a/release/scripts/addons_contrib +++ b/release/scripts/addons_contrib @@@ -1,1 -1,1 +1,1 @@@ - Subproject commit a8515cfdfe9a98127b592f36fcbe51b7e23b969a -Subproject commit f178e6c933a25c621a5cc7d92935b66cd2ec2f5d ++Subproject commit a52733b58d95ce60ecde95a9eca242e7319c285a diff --cc source/blender/blenkernel/BKE_cloth.h index e9f629847fa,6b76ec33c06..fdc06d76706 --- a/source/blender/blenkernel/BKE_cloth.h +++ b/source/blender/blenkernel/BKE_cloth.h @@@ -137,24 -132,17 +137,24 @@@ ClothVertex typedef struct ClothSpring { int ij; /* Pij from the paper, one end of the spring. */ int kl; /* Pkl from the paper, one end of the spring. */ - int mn; - float restlen;/* The original length of the spring. */ + int mn; /* For hair springs: third vertex index; For bending springs: edge index */ + int *pa;/* array of vert indices for poly a (for bending springs) */ + int *pb;/* array of vert indices for poly b (for bending springs) */ + int la; /* length of *pa */ + int lb; /* length of *pb */ + float restlen; /* The original length of the spring */ + float restang; /* The original angle of the bending springs */ + float lenfact; /* Factor of restlen used for plasticity */ + float angoffset;/* Offset of restang used for plasticity */ int type; /* types defined in BKE_cloth.h ("springType") */ int flags; /* defined in BKE_cloth.h, e.g. deactivated due to tearing */ - float stiffness; /* stiffness factor from the vertex groups */ - float editrestlen; + float lin_stiffness;/* linear stiffness factor from the vertex groups */ + float ang_stiffness;/* angular stiffness factor from the vertex groups */ + float planarity; - + /* angular bending spring target and derivatives */ float target[3]; -} -ClothSpring; +} ClothSpring; // some macro enhancements for vector treatment #define VECADDADD(v1,v2,v3) {*(v1)+= *(v2) + *(v3); *(v1+1)+= *(v2+1) + *(v3+1); *(v1+2)+= *(v2+2) + *(v3+2);} diff --cc source/blender/blenkernel/intern/cloth.c index e98f873fd60,26f998b3cb4..8f460e12bb8 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@@ -513,7 -549,11 +514,7 @@@ void cloth_free_modifier(ClothModifierD // we save our faces for collision objects if (cloth->tri) MEM_freeN(cloth->tri); - + - if (cloth->edgeset) - BLI_edgeset_free(cloth->edgeset); - - /* if (clmd->clothObject->facemarks) MEM_freeN(clmd->clothObject->facemarks); @@@ -719,21 -723,16 +720,21 @@@ static void cloth_apply_vgroup(ClothMod if ( verts->goal >= SOFTGOALSNAP ) verts->flags |= CLOTH_VERT_FLAG_PINNED; } - + - if (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SCALING ) { - if ( dvert->dw[j].def_nr == (clmd->sim_parms->vgroup_struct-1)) { - verts->struct_stiff = dvert->dw [j].weight; - verts->shear_stiff = dvert->dw [j].weight; - } + if ( dvert->dw[j].def_nr == (clmd->sim_parms->vgroup_struct-1)) { + verts->st
[Bf-blender-cvs] [aceecd17499] soc-2018-npr: Intersection chain now ok. (occlude level debug wait until tomorrow)
Commit: aceecd17499c854f34689e65ccd322e19e54055e Author: Nick Wu Date: Thu Jul 19 23:44:30 2018 +0800 Branches: soc-2018-npr https://developer.blender.org/rBaceecd17499c854f34689e65ccd322e19e54055e Intersection chain now ok. (occlude level debug wait until tomorrow) === M source/blender/draw/engines/lanpr/lanpr_chain.c M source/blender/draw/engines/lanpr/lanpr_engine.c M source/blender/draw/engines/lanpr/lanpr_ops.c === diff --git a/source/blender/draw/engines/lanpr/lanpr_chain.c b/source/blender/draw/engines/lanpr/lanpr_chain.c index dd19ee80204..c592c373cc1 100644 --- a/source/blender/draw/engines/lanpr/lanpr_chain.c +++ b/source/blender/draw/engines/lanpr/lanpr_chain.c @@ -26,25 +26,39 @@ #include -int lanpr_GetLineBoundingAreas(LANPR_RenderBuffer *rb, LANPR_RenderLine *rl, int *RowBegin, int *RowEnd, int *ColBegin, int *ColEnd) ; -LANPR_BoundingArea* lanpr_GetPointBoundingArea(LANPR_RenderBuffer *rb, real x, real y) ; +int lanpr_GetLineBoundingAreas(LANPR_RenderBuffer *rb, LANPR_RenderLine *rl, int *RowBegin, int *RowEnd, int *ColBegin, int *ColEnd); +LANPR_BoundingArea* lanpr_GetPointBoundingArea(LANPR_RenderBuffer *rb, real x, real y); -LANPR_RenderLine* lanpr_GetConnectedRenderLine(LANPR_BoundingArea* ba, LANPR_RenderVert* rv){ -nListItemPointer* lip; -LANPR_RenderLine* nrl; -real cosine; +#define LANPR_OTHER_RV(rl,rv) ((rv) == (rl)->L?(rl)->R:(rl)->L) + +LANPR_RenderLine* lanpr_GetConnectedRenderLine(LANPR_BoundingArea* ba, LANPR_RenderVert* rv, LANPR_RenderVert** new_rv) { + nListItemPointer* lip; + LANPR_RenderLine* nrl; + real cosine; -for(lip = ba->LinkedLines.pFirst; lip; lip=lip->pNext){ -nrl = lip->p; + for (lip = ba->LinkedLines.pFirst; lip; lip = lip->pNext) { + nrl = lip->p; -if((!(nrl->Flags&LANPR_EDGE_FLAG_ALL_TYPE)) || (nrl->Flags & LANPR_EDGE_FLAG_CHAIN_PICKED)) continue; + if ((!(nrl->Flags&LANPR_EDGE_FLAG_ALL_TYPE)) || (nrl->Flags & LANPR_EDGE_FLAG_CHAIN_PICKED)) continue; -// always chain connected lines for now. -// simplification will take care of the sharp points. -// if(cosine whatever) continue; + // always chain connected lines for now. + // simplification will take care of the sharp points. + // if(cosine whatever) continue; -if(rv != nrl->L && rv != nrl->R) continue; + if (rv != nrl->L && rv != nrl->R) { + if (nrl->Flags&LANPR_EDGE_FLAG_INTERSECTION) { + if (rv->FrameBufferCoord[0] == nrl->L->FrameBufferCoord[0] && rv->FrameBufferCoord[1] == nrl->L->FrameBufferCoord[1]) { + *new_rv = LANPR_OTHER_RV(nrl, nrl->L); + return nrl; + }elif(rv->FrameBufferCoord[0] == nrl->R->FrameBufferCoord[0] && rv->FrameBufferCoord[1] == nrl->R->FrameBufferCoord[1]){ + *new_rv = LANPR_OTHER_RV(nrl, nrl->R); + return nrl; + } + } + continue; + } + *new_rv = LANPR_OTHER_RV(nrl, rv); return nrl; } @@ -119,9 +133,6 @@ void lanpr_reduce_render_line_chain_recursive(LANPR_RenderLineChain* rlc, LANPR_ } -#define LANPR_OTHER_RV(rl,rv) ((rv) == (rl)->L?(rl)->R:(rl)->L) - - void lanpr_ChainFeatureLines_NO_THREAD(LANPR_RenderBuffer *rb, float dist_threshold){ LANPR_RenderLineChain* rlc; LANPR_RenderLine* rl; @@ -144,9 +155,8 @@ void lanpr_ChainFeatureLines_NO_THREAD(LANPR_RenderBuffer *rb, float dist_thresh ba = lanpr_GetPointBoundingArea(rb,rl->L->FrameBufferCoord[0], rl->L->FrameBufferCoord[1]); new_rv = rl->L; lanpr_push_render_line_chain_point(rb,rlc,new_rv->FrameBufferCoord[0],new_rv->FrameBufferCoord[1],rl->Flags,0); -while(new_rl = lanpr_GetConnectedRenderLine(ba,new_rv)){ +while(new_rl = lanpr_GetConnectedRenderLine(ba,new_rv,&new_rv)){ new_rl->Flags |= LANPR_EDGE_FLAG_CHAIN_PICKED; -new_rv = LANPR_OTHER_RV(new_rl,new_rv); int last_occlude; @@ -188,9 +198,8 @@ void lanpr_ChainFeatureLines_NO_THREAD(LANPR_RenderBuffer *rb, float dist_thresh new_rv = rl->R; // below already done in step 2 // lanpr_push_render_line_chain_point(rb,rlc,new_rv->FrameBufferCoord[0],new_rv->FrameBufferCoord[1],rl->Flags,0); -while(new_rl = lanpr_GetConnectedRenderLine(ba,new_rv)){ +while(new_rl = lanpr_GetConnectedRenderLine(ba,new_rv,&new_rv)){ new_rl->Flags |= LANPR_EDGE_FLAG_CHAIN_PICKED; -new_rv = LANPR_OTHER_RV(new_rl,new_rv);
[Bf-blender-cvs] [8bb97b6318f] soc-2018-npr: Fixed not updating normal error. now all lines properly calculated.
Commit: 8bb97b6318f86da86a6e0f99d9356cdb24bf1db8 Author: Nick Wu Date: Thu Jul 19 15:50:50 2018 +0800 Branches: soc-2018-npr https://developer.blender.org/rB8bb97b6318f86da86a6e0f99d9356cdb24bf1db8 Fixed not updating normal error. now all lines properly calculated. === M source/blender/draw/engines/lanpr/lanpr_ops.c === diff --git a/source/blender/draw/engines/lanpr/lanpr_ops.c b/source/blender/draw/engines/lanpr/lanpr_ops.c index 6c92a610304..1d7c1b9e1ac 100644 --- a/source/blender/draw/engines/lanpr/lanpr_ops.c +++ b/source/blender/draw/engines/lanpr/lanpr_ops.c @@ -618,6 +618,9 @@ void lanpr_CutLineIntegrated(LANPR_RenderBuffer *rb, LANPR_RenderLine *rl, real break; } } + if (!BeginSegment && TNS_DOUBLE_CLOSE_ENOUGH(1, End)) { + untouched = 1; + } for (rls = BeginSegment; rls; rls = rls->Item.pNext) { if (TNS_DOUBLE_CLOSE_ENOUGH(rls->at, End)) { EndSegment = rls; @@ -639,7 +642,10 @@ void lanpr_CutLineIntegrated(LANPR_RenderBuffer *rb, LANPR_RenderLine *rl, real } if (!ns) ns = memStaticAquireThread(&rb->RenderDataPool, sizeof(LANPR_RenderLineSegment)); - if (!ns2) ns2 = memStaticAquireThread(&rb->RenderDataPool, sizeof(LANPR_RenderLineSegment)); + if (!ns2) { + if (untouched) { ns2 = ns; EndSegment = ns2; } + else ns2 = memStaticAquireThread(&rb->RenderDataPool, sizeof(LANPR_RenderLineSegment)); + } if (BeginSegment) { if (BeginSegment != ns) { @@ -1590,7 +1596,9 @@ void lanpr_MakeRenderGeometryBuffersObject(Object *o, real *MVMat, real *MVPMat, bm = BM_mesh_create(&allocsize, &((struct BMeshCreateParams) {.use_toolflags = true, })); BM_mesh_bm_from_me(bm, o->data, &((struct BMeshFromMeshParams) {.calc_face_normal = true, })); + BM_mesh_elem_hflag_disable_all(bm, BM_FACE | BM_EDGE, BM_ELEM_TAG, false); BM_mesh_triangulate(bm, MOD_TRIANGULATE_QUAD_BEAUTY, MOD_TRIANGULATE_NGON_BEAUTY, false, NULL, NULL, NULL); + BM_mesh_normals_update(bm); BM_mesh_elem_table_ensure(bm, BM_VERT | BM_EDGE | BM_FACE); BM_mesh_elem_index_ensure(bm, BM_VERT | BM_EDGE | BM_FACE); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4719b8f5613] soc-2018-npr: Fix occlusion error
Commit: 4719b8f561357d91b33a29f38a8d2a78048cd99b Author: Nick Wu Date: Thu Jul 19 13:51:01 2018 +0800 Branches: soc-2018-npr https://developer.blender.org/rB4719b8f561357d91b33a29f38a8d2a78048cd99b Fix occlusion error === M source/blender/draw/engines/lanpr/lanpr_ops.c === diff --git a/source/blender/draw/engines/lanpr/lanpr_ops.c b/source/blender/draw/engines/lanpr/lanpr_ops.c index 653b41205b2..6c92a610304 100644 --- a/source/blender/draw/engines/lanpr/lanpr_ops.c +++ b/source/blender/draw/engines/lanpr/lanpr_ops.c @@ -587,6 +587,7 @@ void lanpr_CutLineIntegrated(LANPR_RenderBuffer *rb, LANPR_RenderLine *rl, real LANPR_RenderLineSegment *rls = rl->Segments.pFirst, *irls; LANPR_RenderLineSegment *BeginSegment = 0, *EndSegment = 0; LANPR_RenderLineSegment *ns = 0, *ns2 = 0; + int untouched=0; if (TNS_DOUBLE_CLOSE_ENOUGH(Begin, End)) return; @@ -628,6 +629,7 @@ void lanpr_CutLineIntegrated(LANPR_RenderBuffer *rb, LANPR_RenderLine *rl, real if (!rls->Item.pNext && TNS_DOUBLE_CLOSE_ENOUGH(1, End)) { EndSegment = rls; ns2 = EndSegment; + untouched = 1; break; }elif (rls->at > End) { EndSegment = rls; @@ -661,7 +663,8 @@ void lanpr_CutLineIntegrated(LANPR_RenderBuffer *rb, LANPR_RenderLine *rl, real } ns->at = Begin; - if(!TNS_DOUBLE_CLOSE_ENOUGH(1, End)) ns2->at = End; + if(!untouched) ns2->at = End; + else ns2 = ns2->Item.pNext; for (rls = ns; rls && rls != ns2; rls = rls->Item.pNext) { rls->OccludeLevel++; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [94722121e57] blender2.8: Fix MSVC compilation error in a less hacky way
Commit: 94722121e572bc8ac4863ae7cdaf26386695202d Author: Clément Foucault Date: Thu Jul 19 17:20:48 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB94722121e572bc8ac4863ae7cdaf26386695202d Fix MSVC compilation error in a less hacky way === M source/blender/windowmanager/intern/wm_init_exit.c === diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 7643086e30a..c51d4c5534a 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -35,8 +35,8 @@ #include #ifdef _WIN32 +# define WIN32_LEAN_AND_MEAN # include -# undef interface /* fix conflict with GPU_batch.h */ #endif #include "MEM_guardedalloc.h" ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [44c7a7cf8bb] blender2.8: Fix compilation error with MSVC
Commit: 44c7a7cf8bb64f58739b808ef6e80a224bfa9015 Author: Clément Foucault Date: Thu Jul 19 17:18:08 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB44c7a7cf8bb64f58739b808ef6e80a224bfa9015 Fix compilation error with MSVC === M source/blender/windowmanager/intern/wm_init_exit.c === diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index f7d6561e17f..7643086e30a 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -36,6 +36,7 @@ #ifdef _WIN32 # include +# undef interface /* fix conflict with GPU_batch.h */ #endif #include "MEM_guardedalloc.h" ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ca0ecf4c086] blender2.8: Fix crash with previews of non-IDs, like pose library thumbnails.
Commit: ca0ecf4c08681753b640482c03dfb3239a37157e Author: Brecht Van Lommel Date: Thu Jul 19 16:27:44 2018 +0200 Branches: blender2.8 https://developer.blender.org/rBca0ecf4c08681753b640482c03dfb3239a37157e Fix crash with previews of non-IDs, like pose library thumbnails. === M source/blender/editors/render/render_preview.c === diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 450897382dd..884e8d6625b 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -314,6 +314,11 @@ static World *preview_get_localized_world(ShaderPreview *sp, World *world) static ID *duplicate_ids(ID *id, Depsgraph *depsgraph) { + if (id == NULL) { + /* Non-ID preview render. */ + return NULL; + } + ID *id_eval = id; if (depsgraph) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5037dd8abdf] blender2.8: GPU: Add GC to FBOs and UBOs and centralize all GCs
Commit: 5037dd8abdf9335e998141336d4e15f81580c491 Author: Clément Foucault Date: Thu Jul 19 15:48:13 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB5037dd8abdf9335e998141336d4e15f81580c491 GPU: Add GC to FBOs and UBOs and centralize all GCs GPUFrameBuffers were being free when no context was attached or in the wrong gl context. This make sure this does not happen again. You can now safely free any gl resource from any thread (well as long as it's not used anymore!). === M source/blender/draw/DRW_engine.h M source/blender/draw/intern/draw_manager.c M source/blender/gpu/CMakeLists.txt D source/blender/gpu/GPU_buffer_id.h M source/blender/gpu/GPU_material.h M source/blender/gpu/GPU_texture.h M source/blender/gpu/intern/gpu_batch.c M source/blender/gpu/intern/gpu_batch_private.h D source/blender/gpu/intern/gpu_buffer_id.cpp R052source/blender/gpu/intern/gpu_vertex_array_id.cpp source/blender/gpu/intern/gpu_context.cpp R053source/blender/gpu/GPU_vertex_array_id.h source/blender/gpu/intern/gpu_context_private.h M source/blender/gpu/intern/gpu_element.c M source/blender/gpu/intern/gpu_framebuffer.c M source/blender/gpu/intern/gpu_immediate.c M source/blender/gpu/intern/gpu_init_exit.c M source/blender/gpu/intern/gpu_material.c M source/blender/gpu/intern/gpu_private.h M source/blender/gpu/intern/gpu_shader.c M source/blender/gpu/intern/gpu_shader_interface.c M source/blender/gpu/intern/gpu_texture.c M source/blender/gpu/intern/gpu_uniformbuffer.c M source/blender/gpu/intern/gpu_vertex_buffer.c M source/blender/windowmanager/intern/wm_init_exit.c M source/blender/windowmanager/intern/wm_window.c === diff --git a/source/blender/draw/DRW_engine.h b/source/blender/draw/DRW_engine.h index eb037d081e1..4d4b486d247 100644 --- a/source/blender/draw/DRW_engine.h +++ b/source/blender/draw/DRW_engine.h @@ -136,6 +136,10 @@ void DRW_opengl_context_destroy(void); void DRW_opengl_context_enable(void); void DRW_opengl_context_disable(void); +/* Never use this. Only for closing blender. */ +void DRW_opengl_context_enable_ex(bool restore); +void DRW_opengl_context_disable_ex(bool restore); + void DRW_opengl_render_context_enable(void *re_gl_context); void DRW_opengl_render_context_disable(void *re_gl_context); void DRW_gawain_render_context_enable(void *re_gpu_context); diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 2793410cd8e..cc4f8ec7947 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -2374,21 +2374,21 @@ void DRW_opengl_context_destroy(void) } } -void DRW_opengl_context_enable(void) +void DRW_opengl_context_enable_ex(bool restore) { if (DST.gl_context != NULL) { /* IMPORTANT: We dont support immediate mode in render mode! * This shall remain in effect until immediate mode supports * multiple threads. */ BLI_ticket_mutex_lock(DST.gl_context_mutex); - if (BLI_thread_is_main()) { + if (BLI_thread_is_main() && restore) { if (!G.background) { immDeactivate(); } } WM_opengl_context_activate(DST.gl_context); GPU_context_active_set(DST.gpu_context); - if (BLI_thread_is_main()) { + if (BLI_thread_is_main() && restore) { if (!G.background) { immActivate(); } @@ -2397,7 +2397,7 @@ void DRW_opengl_context_enable(void) } } -void DRW_opengl_context_disable(void) +void DRW_opengl_context_disable_ex(bool restore) { if (DST.gl_context != NULL) { #ifdef __APPLE__ @@ -2406,7 +2406,7 @@ void DRW_opengl_context_disable(void) glFlush(); #endif - if (BLI_thread_is_main()) { + if (BLI_thread_is_main() && restore) { wm_window_reset_drawable(); } else { @@ -2418,6 +2418,16 @@ void DRW_opengl_context_disable(void) } } +void DRW_opengl_context_enable(void) +{ + DRW_opengl_context_enable_ex(true); +} + +void DRW_opengl_context_disable(void) +{ + DRW_opengl_context_disable_ex(true); +} + void DRW_opengl_render_context_enable(void *re_gl_context) { /* If thread is main you should use DRW_opengl_context_enable(). */ diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index 58295ae9329..8273f3f1992 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -62,9 +62,9 @@ set(
[Bf-blender-cvs] [64bbfaf4214] blender2.8: Subsurf: Set original index for high-poly vertices
Commit: 64bbfaf42144e26718bfb789cba81a409536cf73 Author: Sergey Sharybin Date: Wed Jul 18 17:34:44 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB64bbfaf42144e26718bfb789cba81a409536cf73 Subsurf: Set original index for high-poly vertices === M source/blender/blenkernel/BKE_subdiv.h M source/blender/blenkernel/intern/subdiv_mesh.c === diff --git a/source/blender/blenkernel/BKE_subdiv.h b/source/blender/blenkernel/BKE_subdiv.h index 92fb1167f55..45316e3cc91 100644 --- a/source/blender/blenkernel/BKE_subdiv.h +++ b/source/blender/blenkernel/BKE_subdiv.h @@ -22,6 +22,7 @@ * * * END GPL LICENSE BLOCK * */ + #ifndef __BKE_SUBDIV_H__ #define __BKE_SUBDIV_H__ diff --git a/source/blender/blenkernel/intern/subdiv_mesh.c b/source/blender/blenkernel/intern/subdiv_mesh.c index c2a10483e26..9090ebe9f0f 100644 --- a/source/blender/blenkernel/intern/subdiv_mesh.c +++ b/source/blender/blenkernel/intern/subdiv_mesh.c @@ -416,7 +416,10 @@ static void loop_interpolation_end(LoopsForInterpolation *loop_interpolation) static void subdiv_copy_vertex_data( const SubdivMeshContext *ctx, MVert *subdiv_vertex, +const Mesh *coarse_mesh, +const MPoly *coarse_poly, const VerticesForInterpolation *vertex_interpolation, +const int ptex_of_poly_index, const float u, const float v) { const int subdiv_vertex_index = subdiv_vertex - ctx->subdiv_mesh->mvert; @@ -430,7 +433,34 @@ static void subdiv_copy_vertex_data( weights, NULL, 4, subdiv_vertex_index); - /* TODO(sergey): Set ORIGINDEX. */ + if (ctx->vert_origindex != NULL) { + ctx->vert_origindex[subdiv_vertex_index] = ORIGINDEX_NONE; + if (coarse_poly->totloop == 4) { + if (u == 0.0f && v == 0.0f) { + ctx->vert_origindex[subdiv_vertex_index] = + vertex_interpolation->vertex_indices[0]; + } + else if (u == 1.0f && v == 0.0f) { + ctx->vert_origindex[subdiv_vertex_index] = + vertex_interpolation->vertex_indices[1]; + } + else if (u == 1.0f && v == 1.0f) { + ctx->vert_origindex[subdiv_vertex_index] = + vertex_interpolation->vertex_indices[2]; + } + else if (u == 0.0f && v == 1.0f) { + ctx->vert_origindex[subdiv_vertex_index] = + vertex_interpolation->vertex_indices[3]; + } + } else { + if (u == 0.0f && v == 0.0f) { + const MLoop *coarse_mloop = coarse_mesh->mloop; + ctx->vert_origindex[subdiv_vertex_index] = + coarse_mloop[coarse_poly->loopstart + + ptex_of_poly_index].v; + } + } + } } static void subdiv_evaluate_vertices(SubdivMeshContext *ctx, @@ -447,12 +477,12 @@ static void subdiv_evaluate_vertices(SubdivMeshContext *ctx, const int num_poly_ptex_faces = mpoly_ptex_faces_count_get(coarse_poly); /* Hi-poly subdivided mesh. */ Mesh *subdiv_mesh = ctx->subdiv_mesh; - MVert *subdiv_vertert = subdiv_mesh->mvert; + MVert *subdiv_vertex = subdiv_mesh->mvert; const int ptex_face_index = subdiv->face_ptex_offset[poly_index]; /* Actual evaluation. */ VerticesForInterpolation vertex_interpolation; vertex_interpolation_init(ctx, &vertex_interpolation, coarse_poly); - MVert *subdiv_vert = &subdiv_vertert[ptex_face_index * resolution2]; + MVert *subdiv_vert = &subdiv_vertex[ptex_face_index * resolution2]; for (int ptex_of_poly_index = 0; ptex_of_poly_index < num_poly_ptex_faces; ptex_of_poly_index++) @@ -475,7 +505,10 @@ static void subdiv_evaluate_vertices(SubdivMeshContext *ctx, const float u = x * inv_resolution_1; subdiv_copy_vertex_data(ctx, subdiv_vert, + coarse_mesh, + coarse_poly, &vertex_interpolation, + ptex_of_poly_index, u, v);
[Bf-blender-cvs] [3882d0943b3] blender2.8: Subsurf: Fix wrong edge original index
Commit: 3882d0943b33c42d1dbe67d10d2432c0e7191959 Author: Sergey Sharybin Date: Wed Jul 18 17:49:12 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB3882d0943b33c42d1dbe67d10d2432c0e7191959 Subsurf: Fix wrong edge original index === M source/blender/blenkernel/intern/subdiv_mesh.c === diff --git a/source/blender/blenkernel/intern/subdiv_mesh.c b/source/blender/blenkernel/intern/subdiv_mesh.c index 9090ebe9f0f..7baf03e7265 100644 --- a/source/blender/blenkernel/intern/subdiv_mesh.c +++ b/source/blender/blenkernel/intern/subdiv_mesh.c @@ -521,14 +521,17 @@ static void subdiv_copy_edge_data( MEdge *subdiv_edge, const MEdge *coarse_edge) { + const int subdiv_edge_index = subdiv_edge - ctx->subdiv_mesh->medge; if (coarse_edge == NULL) { subdiv_edge->crease = 0; subdiv_edge->bweight = 0; subdiv_edge->flag = 0; + if (ctx->edge_origindex != NULL) { + ctx->edge_origindex[subdiv_edge_index] = ORIGINDEX_NONE; + } return; } const int coarse_edge_index = coarse_edge - ctx->coarse_mesh->medge; - const int subdiv_edge_index = subdiv_edge - ctx->subdiv_mesh->medge; CustomData_copy_data(&ctx->coarse_mesh->edata, &ctx->subdiv_mesh->edata, coarse_edge_index, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [371b1270434] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object
Commit: 371b12704344fc66342fc1f2277b2a7f3770206e Author: Antonio Vazquez Date: Thu Jul 19 10:09:33 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB371b12704344fc66342fc1f2277b2a7f3770206e Merge branch 'blender2.8' into greasepencil-object === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs