Merge branch 'master' into sculpt-dev

This commit is contained in:
Pablo Dobarro 2021-01-24 20:23:54 +01:00
commit 0a2b19e96d
28 changed files with 57 additions and 80 deletions

View File

@ -18,7 +18,7 @@
/* Data type to replace `double` used in the NanoVDB headers. Cycles don't need doubles, and is
* safer and more portable to never use double datatype on GPU.
* Use a special structure, so that the following is true:
* - No unnoticed implicit cast or mathermatical operations used on scalar 64bit type
* - No unnoticed implicit cast or mathematical operations used on scalar 64bit type
* (which rules out trick like using `uint64_t` as a drop-in replacement for double).
* - Padding rules are matching exactly `double`
* (which rules out array of `uint8_t`). */

View File

@ -1275,8 +1275,8 @@ void GeometryManager::device_update_bvh(Device *device,
dscene->prim_tri_verts.give_data(pack.prim_tri_verts);
}
else {
/* it is not stricly necessary to skip those resizes we if do not have to repack, as the OS
* will not allocate pages if we do not touch them, however it does help catching bugs */
/* It is not strictly necessary to skip those resizes we if do not have to repack, as the OS
* will not allocate pages if we do not touch them, however it does help catching bugs. */
pack.prim_tri_index.resize(num_prims);
pack.prim_tri_verts.resize(num_tri_verts);
pack.prim_type.resize(num_prims);

View File

@ -109,7 +109,7 @@ class GHOST_DropTargetX11 {
/* class holding internal stiff of xdnd library */
static DndClass m_dndClass;
/* list of supported types to eb draggeg into */
/* list of supported types to be dragged into */
static Atom *m_dndTypes;
/* list of supported dran'n'drop actions */

View File

@ -119,6 +119,7 @@ const UserDef U_default = {
.gizmo_flag = USER_GIZMO_DRAW,
.gizmo_size = 75,
.gizmo_size_navigate_v3d = 80,
.edit_studio_light = 0,
.lookdev_sphere_size = 150,
.vbotimeout = 120,
@ -131,7 +132,6 @@ const UserDef U_default = {
.prefetchframes = 0,
.pad_rot_angle = 15,
.gizmo_size_navigate_v3d = 80,
.rvisize = 25,
.rvibright = 8,
.recent_files = 10,

View File

@ -74,8 +74,6 @@ def generate(context, space_type, use_fallback_keys=True, use_reset=True):
if tap_reset_tool not in items_all_id:
use_tap_reset = False
from bl_operators.wm import use_toolbar_release_hack
# Pie-menu style release to activate.
use_release_confirm = use_reset
@ -437,7 +435,7 @@ def generate(context, space_type, use_fallback_keys=True, use_reset=True):
kmi = keymap.keymap_items.new(
"wm.tool_set_by_id",
value='PRESS' if use_toolbar_release_hack else 'DOUBLE_CLICK',
value='DOUBLE_CLICK',
**kmi_toolbar_args_available,
)
kmi.properties.name = tap_reset_tool
@ -451,15 +449,6 @@ def generate(context, space_type, use_fallback_keys=True, use_reset=True):
)
kmi.properties.skip_depressed = True
if use_toolbar_release_hack:
# ... or pass through to let the toolbar know we're released.
# Let the operator know we're released.
kmi = keymap.keymap_items.new(
"wm.tool_set_by_id",
type=kmi_toolbar_type,
value='RELEASE',
any=True,
)
wm.keyconfigs.update()
return keymap

View File

@ -33,11 +33,6 @@ from bpy.props import (
)
from bpy.app.translations import pgettext_iface as iface_
# FIXME, we need a way to detect key repeat events.
# unfortunately checking event previous values isn't reliable.
use_toolbar_release_hack = True
rna_path_prop = StringProperty(
name="Context Attributes",
description="RNA context string",
@ -1692,18 +1687,6 @@ class WM_OT_tool_set_by_id(Operator):
space_type: rna_space_type_prop
if use_toolbar_release_hack:
def invoke(self, context, event):
# Hack :S
if not self.properties.is_property_set("name"):
WM_OT_toolbar._key_held = False
return {'PASS_THROUGH'}
elif (WM_OT_toolbar._key_held == event.type) and (event.value != 'RELEASE'):
return {'PASS_THROUGH'}
WM_OT_toolbar._key_held = None
return self.execute(context)
def execute(self, context):
from bl_ui.space_toolsystem_common import (
activate_by_id,
@ -1794,13 +1777,6 @@ class WM_OT_toolbar(Operator):
def poll(cls, context):
return context.space_data is not None
if use_toolbar_release_hack:
_key_held = None
def invoke(self, context, event):
WM_OT_toolbar._key_held = event.type
return self.execute(context)
@staticmethod
def keymap_from_toolbar(context, space_type, use_fallback_keys=True, use_reset=True):
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper

View File

@ -263,7 +263,7 @@ static void build_bvh_spatial(PROCESS *process,
* BASED AT CODE (but mostly rewritten) :
* C code from the article
* "An Implicit Surface Polygonizer"
* by Jules Bloomenthal, jbloom@beauty.gmu.edu
* by Jules Bloomenthal <jbloom@beauty.gmu.edu>
* in "Graphics Gems IV", Academic Press, 1994
*
* Authored by Jules Bloomenthal, Xerox PARC.

View File

@ -16,7 +16,7 @@
* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
*
* NOTE: The canonical source of this file is maintained with the GNU C Library.
* Bugs can be reported to bug-glibc@prep.ai.mit.edu.
* Bugs can be reported to <bug-glibc@prep.ai.mit.edu>.
*/
#pragma once

View File

@ -160,7 +160,7 @@ static RobustInitCaller init_caller;
* Carnegie Mellon University
* 5000 Forbes Avenue
* Pittsburgh, Pennsylvania 15213-3891
* jrs@cs.cmu.edu
* <jrs@cs.cmu.edu>
*
* This file contains C implementation of algorithms for exact addition
* and multiplication of floating-point numbers, and predicates for

View File

@ -1438,12 +1438,12 @@ int isect_line_sphere_v3(const float l1[3],
/* adapted for use in blender by Campbell Barton - 2011
*
* atelier iebele abel - 2001
* atelier@iebele.nl
* <atelier@iebele.nl>
* http://www.iebele.nl
*
* sphere_line_intersection function adapted from:
* http://astronomy.swin.edu.au/pbourke/geometry/sphereline
* Paul Bourke pbourke@swin.edu.au
* Paul Bourke <pbourke@swin.edu.au>
*/
const float ldir[3] = {

View File

@ -1581,7 +1581,7 @@ void quat_to_compatible_eul(float eul[3], const float oldrot[3], const float qua
* was adapted from
* ANSI C code from the article
* "Euler Angle Conversion"
* by Ken Shoemake, shoemake@graphics.cis.upenn.edu
* by Ken Shoemake <shoemake@graphics.cis.upenn.edu>
* in "Graphics Gems IV", Academic Press, 1994
* for use in Blender
*/

View File

@ -7211,14 +7211,14 @@ static void set_profile_spacing(BevelParams *bp, ProfileSpacing *pro_spacing, bo
*
* where edges are A, B, and C, following a face around vertices a, b, c, d.
* th1 is angle abc and th2 is angle bcd;
* and the argument EdgeHalf eb is B, going from b to c.
* and the argument `EdgeHalf eb` is B, going from b to c.
* In general case, edge offset specs for A, B, C have
* the form ka*t, kb*t, kc*t where ka, kb, kc are some factors
* (may be 0) and t is the current bp->offset.
* We want to calculate t at which the clone of B parallel
* to it collapses. This can be calculated using trig.
* Another case of geometry collision that can happen is
* When B slides along A because A is unbeveled.
* When B slides along A because A is un-beveled.
* Then it might collide with a. Similarly for B sliding along C.
*/
static float geometry_collide_offset(BevelParams *bp, EdgeHalf *eb)

View File

@ -228,7 +228,7 @@ void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata)
GPUShader *sh = OVERLAY_shader_edit_uv_verts_get();
pd->edit_uv_verts_grp = DRW_shgroup_create(sh, psl->edit_uv_verts_ps);
const float point_size = UI_GetThemeValuef(TH_VERTEX_SIZE);
const float point_size = UI_GetThemeValuef(TH_VERTEX_SIZE) * U.dpi_fac;
DRW_shgroup_uniform_block(pd->edit_uv_verts_grp, "globalsBlock", G_draw.block_ubo);
DRW_shgroup_uniform_float_copy(
@ -248,7 +248,7 @@ void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata)
/* uv face dots */
if (pd->edit_uv.do_face_dots) {
const float point_size = UI_GetThemeValuef(TH_FACEDOT_SIZE);
const float point_size = UI_GetThemeValuef(TH_FACEDOT_SIZE) * U.dpi_fac;
GPUShader *sh = OVERLAY_shader_edit_uv_face_dots_get();
pd->edit_uv_face_dots_grp = DRW_shgroup_create(sh, psl->edit_uv_verts_ps);
DRW_shgroup_uniform_block(pd->edit_uv_face_dots_grp, "globalsBlock", G_draw.block_ubo);

View File

@ -1,7 +1,7 @@
/* ---------------------------------------------------------------------------------
* File: es3-kepler\FXAA/FXAA3_11.h
* SDK Version: v3.00
* Email: gameworks@nvidia.com
* Email: <gameworks@nvidia.com>
* Site: http://developer.nvidia.com/
*
* Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.

View File

@ -517,7 +517,8 @@ static void updateDuplicateActionConstraintSettings(EditBone *dup_bone,
/* See if there is any channels that uses this bone */
ListBase ani_curves;
BLI_listbase_clear(&ani_curves);
if (BKE_fcurves_filter(&ani_curves, &act->curves, "pose.bones[", orig_bone->name)) {
if ((act != NULL) &&
BKE_fcurves_filter(&ani_curves, &act->curves, "pose.bones[", orig_bone->name)) {
/* Create a copy and mirror the animation */
for (LinkData *ld = ani_curves.first; ld; ld = ld->next) {
FCurve *old_curve = ld->data;

View File

@ -87,6 +87,7 @@ typedef struct TraceJob {
bGPDlayer *gpl;
bool was_ob_created;
bool use_current_frame;
int32_t frame_target;
float threshold;
@ -228,15 +229,17 @@ static void trace_start_job(void *customdata, short *stop, short *do_update, flo
trace_job->do_update = do_update;
trace_job->progress = progress;
trace_job->was_canceled = false;
const int init_frame = max_ii((trace_job->use_current_frame) ? trace_job->frame_target : 0, 0);
G.is_break = false;
/* Single Image. */
if ((trace_job->image->source == IMA_SRC_FILE) ||
(trace_job->mode == GPENCIL_TRACE_MODE_SINGLE)) {
void *lock;
ImBuf *ibuf = BKE_image_acquire_ibuf(trace_job->image, NULL, &lock);
ImageUser *iuser = trace_job->ob_active->iuser;
iuser->framenr = init_frame;
ImBuf *ibuf = BKE_image_acquire_ibuf(trace_job->image, iuser, &lock);
if (ibuf) {
/* Create frame. */
bGPDframe *gpf = BKE_gpencil_layer_frame_get(
@ -249,7 +252,7 @@ static void trace_start_job(void *customdata, short *stop, short *do_update, flo
/* Image sequence. */
else if (trace_job->image->type == IMA_TYPE_IMAGE) {
ImageUser *iuser = trace_job->ob_active->iuser;
for (int i = 0; i < iuser->frames; i++) {
for (int i = init_frame; i < iuser->frames; i++) {
if (G.is_break) {
trace_job->was_canceled = true;
break;
@ -320,6 +323,7 @@ static int gpencil_trace_image_exec(bContext *C, wmOperator *op)
job->ob_active = job->base_active->object;
job->image = (Image *)job->ob_active->data;
job->frame_target = CFRA;
job->use_current_frame = RNA_boolean_get(op->ptr, "use_current_frame");
/* Create a new grease pencil object or reuse selected. */
eGP_TargetObjectMode target = RNA_enum_get(op->ptr, "target");
@ -493,4 +497,9 @@ void GPENCIL_OT_trace_image(wmOperatorType *ot)
GPENCIL_TRACE_MODE_SINGLE,
"Mode",
"Determines if trace simple image or full sequence");
RNA_def_boolean(ot->srna,
"use_current_frame",
true,
"Start At Current Frame",
"Trace Image starting in current image frame");
}

View File

@ -664,7 +664,7 @@ static bool node_ima_drop_poll(bContext *UNUSED(C),
/* rule might not work? */
return (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE));
}
return WM_drag_get_local_ID(drag, ID_IM) != NULL;
return WM_drag_get_local_ID(drag, ID_IM) || WM_drag_get_asset_data(drag, ID_IM);
}
static bool node_mask_drop_poll(bContext *UNUSED(C),
@ -672,19 +672,19 @@ static bool node_mask_drop_poll(bContext *UNUSED(C),
const wmEvent *UNUSED(event),
const char **UNUSED(r_tooltip))
{
return WM_drag_get_local_ID(drag, ID_MSK) != NULL;
return WM_drag_get_local_ID(drag, ID_MSK) || WM_drag_get_asset_data(drag, ID_MSK);
}
static void node_id_drop_copy(wmDrag *drag, wmDropBox *drop)
{
ID *id = WM_drag_get_local_ID(drag, 0);
ID *id = WM_drag_get_local_ID_or_import_from_asset(drag, 0);
RNA_string_set(drop->ptr, "name", id->name + 2);
}
static void node_id_path_drop_copy(wmDrag *drag, wmDropBox *drop)
{
ID *id = WM_drag_get_local_ID(drag, 0);
ID *id = WM_drag_get_local_ID_or_import_from_asset(drag, 0);
if (id) {
RNA_string_set(drop->ptr, "name", id->name + 2);

View File

@ -435,12 +435,12 @@ bool overlapTriangleBox(Vec3r &boxcenter, Vec3r &boxhalfsize, Vec3r triverts[3])
// Tomas Möller
// Prosolvia Clarus AB
// Sweden
// tompa@clarus.se
// <tompa@clarus.se>
//
// Ben Trumbore
// Cornell University
// Ithaca, New York
// wbt@graphics.cornell.edu
// <wbt@graphics.cornell.edu>
bool intersectRayTriangle(const Vec3r &orig,
const Vec3r &dir,
const Vec3r &v0,

View File

@ -17,7 +17,7 @@
* GXML/Graphite: Geometry and Graphics Programming Library + Utilities
* Copyright (C) 2000 Bruno Levy
* Contact: Bruno Levy
* levy@loria.fr
* <levy@loria.fr>
* ISA Project
* LORIA, INRIA Lorraine,
* Campus Scientifique, BP 239

View File

@ -17,7 +17,7 @@
* GXML/Graphite: Geometry and Graphics Programming Library + Utilities
* Copyright (C) 2000 Bruno Levy
* Contact: Bruno Levy
* levy@loria.fr
* <levy@loria.fr>
* ISA Project
* LORIA, INRIA Lorraine,
* Campus Scientifique, BP 239

View File

@ -17,7 +17,7 @@
* OGF/Graphite: Geometry and Graphics Programming Library + Utilities
* Copyright (C) 2000 Bruno Levy
* Contact: Bruno Levy
* levy@loria.fr
* <levy@loria.fr>
* ISA Project
* LORIA, INRIA Lorraine,
* Campus Scientifique, BP 239

View File

@ -17,7 +17,7 @@
* OGF/Graphite: Geometry and Graphics Programming Library + Utilities
* Copyright (C) 2000 Bruno Levy
* Contact: Bruno Levy
* levy@loria.fr
* <levy@loria.fr>
* ISA Project
* LORIA, INRIA Lorraine,
* Campus Scientifique, BP 239

View File

@ -19,7 +19,7 @@
* and:
* OGF/Graphite: Geometry and Graphics Programming Library + Utilities
* Copyright (C) 2000-2003 Bruno Levy
* Contact: Bruno Levy levy@loria.fr
* Contact: Bruno Levy <levy@loria.fr>
* ISA Project
* LORIA, INRIA Lorraine,
* Campus Scientifique, BP 239

View File

@ -19,7 +19,7 @@
* and:
* OGF/Graphite: Geometry and Graphics Programming Library + Utilities
* Copyright (C) 2000-2003 Bruno Levy
* Contact: Bruno Levy levy@loria.fr
* Contact: Bruno Levy <levy@loria.fr>
* ISA Project
* LORIA, INRIA Lorraine,
* Campus Scientifique, BP 239

View File

@ -25,7 +25,7 @@
* Original license from NVIDIA follows.
*/
// This code is in the public domain -- castanyo@yahoo.es
// This code is in the public domain -- <castanyo@yahoo.es>
#pragma once

View File

@ -685,7 +685,7 @@ typedef enum IDRecalcFlag {
* redraw update in that case. */
/* Selection of the ID itself or its components (for example, vertices) did
* change, and all the drawing data is to eb updated. */
* change, and all the drawing data is to be updated. */
ID_RECALC_SELECT = (1 << 9),
/* Flags on the base did change, and is to be copied onto all the copies of
* corresponding objects. */

View File

@ -762,8 +762,12 @@ typedef struct UserDef {
char _pad13[4];
struct SolidLight light_param[4];
float light_ambient[3];
char _pad3[4];
short gizmo_flag, gizmo_size;
char gizmo_flag;
/** Generic gizmo size. */
char gizmo_size;
/** Navigate gizmo size. */
char gizmo_size_navigate_v3d;
char _pad3[5];
short edit_studio_light;
short lookdev_sphere_size;
short vbotimeout, vbocollectrate;
@ -773,9 +777,7 @@ typedef struct UserDef {
int prefetchframes;
/** Control the rotation step of the view when PAD2, PAD4, PAD6&PAD8 is use. */
float pad_rot_angle;
/** Navigate gizmo size. */
char gizmo_size_navigate_v3d;
char _pad12[3];
char _pad12[4];
/** Rotating view icon size. */
short rvisize;
/** Rotating view icon brightness. */

View File

@ -4720,11 +4720,6 @@ static void rna_def_userdef_view(BlenderRNA *brna)
"Show a small rotating 3D axes in the top right corner of the 3D View");
RNA_def_property_update(prop, 0, "rna_userdef_gizmo_update");
prop = RNA_def_property(srna, "gizmo_size_navigate_v3d", PROP_INT, PROP_PIXEL);
RNA_def_property_range(prop, 30, 200);
RNA_def_property_ui_text(prop, "Navigate Gizmo Size", "The Navigate Gizmo size");
RNA_def_property_update(prop, 0, "rna_userdef_gizmo_update");
prop = RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_PIXEL);
RNA_def_property_int_sdna(prop, NULL, "rvisize");
RNA_def_property_range(prop, 10, 64);
@ -4761,6 +4756,11 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Gizmo Size", "Diameter of the gizmo");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop = RNA_def_property(srna, "gizmo_size_navigate_v3d", PROP_INT, PROP_PIXEL);
RNA_def_property_range(prop, 30, 200);
RNA_def_property_ui_text(prop, "Navigate Gizmo Size", "The Navigate Gizmo size");
RNA_def_property_update(prop, 0, "rna_userdef_gizmo_update");
/* Lookdev */
prop = RNA_def_property(srna, "lookdev_sphere_size", PROP_INT, PROP_PIXEL);
RNA_def_property_int_sdna(prop, NULL, "lookdev_sphere_size");