Skip to content

Commit

Permalink
Merge remote-tracking branch 'b/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
youle31 committed May 29, 2020
2 parents 3abec5f + 582d315 commit e0bb891
Show file tree
Hide file tree
Showing 45 changed files with 379 additions and 261 deletions.
4 changes: 4 additions & 0 deletions intern/cycles/blender/blender_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,13 @@ void BlenderSession::create_session()

void BlenderSession::reset_session(BL::BlendData &b_data, BL::Depsgraph &b_depsgraph)
{
/* Update data, scene and depsgraph pointers. These can change after undo. */
this->b_data = b_data;
this->b_depsgraph = b_depsgraph;
this->b_scene = b_depsgraph.scene_eval();
if (sync) {
sync->reset(this->b_data, this->b_scene);
}

if (preview_osl) {
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
Expand Down
8 changes: 8 additions & 0 deletions intern/cycles/blender/blender_sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ BlenderSync::~BlenderSync()
{
}

void BlenderSync::reset(BL::BlendData &b_data, BL::Scene &b_scene)
{
/* Update data and scene pointers in case they change in session reset,
* for example after undo. */
this->b_data = b_data;
this->b_scene = b_scene;
}

/* Sync */

void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d)
Expand Down
2 changes: 2 additions & 0 deletions intern/cycles/blender/blender_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class BlenderSync {
Progress &progress);
~BlenderSync();

void reset(BL::BlendData &b_data, BL::Scene &b_scene);

/* sync */
void sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d);
void sync_data(BL::RenderSettings &b_render,
Expand Down
4 changes: 2 additions & 2 deletions intern/ghost/GHOST_C-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ extern GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
***************************************************************************************/

/**
* Returns the state of a modifier key (ouside the message queue).
* Returns the state of a modifier key (outside the message queue).
* \param systemhandle The handle to the system
* \param mask The modifier key state to retrieve.
* \param isDown Pointer to return modifier state in.
Expand All @@ -446,7 +446,7 @@ extern GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle,
int *isDown);

/**
* Returns the state of a mouse button (ouside the message queue).
* Returns the state of a mouse button (outside the message queue).
* \param systemhandle The handle to the system
* \param mask The button state to retrieve.
* \param isDown Pointer to return button state in.
Expand Down
4 changes: 2 additions & 2 deletions intern/ghost/GHOST_ISystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,15 +382,15 @@ class GHOST_ISystem {
***************************************************************************************/

/**
* Returns the state of a modifier key (ouside the message queue).
* Returns the state of a modifier key (outside the message queue).
* \param mask The modifier key state to retrieve.
* \param isDown The state of a modifier key (true == pressed).
* \return Indication of success.
*/
virtual GHOST_TSuccess getModifierKeyState(GHOST_TModifierKeyMask mask, bool &isDown) const = 0;

/**
* Returns the state of a mouse button (ouside the message queue).
* Returns the state of a mouse button (outside the message queue).
* \param mask The button state to retrieve.
* \param isDown Button state.
* \return Indication of success.
Expand Down
10 changes: 5 additions & 5 deletions intern/ghost/intern/GHOST_System.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,15 @@ class GHOST_System : public GHOST_ISystem {
***************************************************************************************/

/**
* Returns the state of a modifier key (ouside the message queue).
* Returns the state of a modifier key (outside the message queue).
* \param mask The modifier key state to retrieve.
* \param isDown The state of a modifier key (true == pressed).
* \return Indication of success.
*/
GHOST_TSuccess getModifierKeyState(GHOST_TModifierKeyMask mask, bool &isDown) const;

/**
* Returns the state of a mouse button (ouside the message queue).
* Returns the state of a mouse button (outside the message queue).
* \param mask The button state to retrieve.
* \param isDown Button state.
* \return Indication of success.
Expand All @@ -247,8 +247,8 @@ class GHOST_System : public GHOST_ISystem {
***************************************************************************************/

/**
* Sets 3D mouse deadzone
* \param deadzone: Deadzone of the 3D mouse (both for rotation and pan) relative to full range
* Sets 3D mouse dead-zone
* \param deadzone: Dead-zone of the 3D mouse (both for rotation and pan) relative to full range.
*/
void setNDOFDeadZone(float deadzone);
#endif
Expand Down Expand Up @@ -295,7 +295,7 @@ class GHOST_System : public GHOST_ISystem {
virtual GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const = 0;

/**
* Returns the state of the mouse buttons (ouside the message queue).
* Returns the state of the mouse buttons (outside the message queue).
* \param buttons The state of the buttons.
* \return Indication of success.
*/
Expand Down
2 changes: 1 addition & 1 deletion intern/ghost/intern/GHOST_SystemCocoa.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class GHOST_SystemCocoa : public GHOST_System {
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const;

/**
* Returns the state of the mouse buttons (ouside the message queue).
* Returns the state of the mouse buttons (outside the message queue).
* \param buttons The state of the buttons.
* \return Indication of success.
*/
Expand Down
2 changes: 1 addition & 1 deletion intern/ghost/intern/GHOST_SystemWin32.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class GHOST_SystemWin32 : public GHOST_System {
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const;

/**
* Returns the state of the mouse buttons (ouside the message queue).
* Returns the state of the mouse buttons (outside the message queue).
* \param buttons The state of the buttons.
* \return Indication of success.
*/
Expand Down
20 changes: 11 additions & 9 deletions intern/ghost/intern/GHOST_SystemX11.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class GHOST_SystemX11 : public GHOST_System {
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const;

/**
* Returns the state of the mouse buttons (ouside the message queue).
* Returns the state of the mouse buttons (outside the message queue).
* \param buttons The state of the buttons.
* \return Indication of success.
*/
Expand Down Expand Up @@ -211,7 +211,7 @@ class GHOST_SystemX11 : public GHOST_System {
}
#endif

/* Helped function for get data from the clipboard. */
/** Helped function for get data from the clipboard. */
void getClipboard_xcout(const XEvent *evt,
Atom sel,
Atom target,
Expand Down Expand Up @@ -337,7 +337,7 @@ class GHOST_SystemX11 : public GHOST_System {
private:
Display *m_display;

/* Use for scancode lookups. */
/** Use for scan-code look-ups. */
XkbDescRec *m_xkb_descr;

#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
Expand All @@ -349,20 +349,22 @@ class GHOST_SystemX11 : public GHOST_System {
std::vector<GHOST_TabletX11> m_xtablets;
#endif

/// The vector of windows that need to be updated.
/** The vector of windows that need to be updated. */
std::vector<GHOST_WindowX11 *> m_dirty_windows;

/// Start time at initialization.
/** Start time at initialization. */
GHOST_TUns64 m_start_time;

/// A vector of keyboard key masks
/** A vector of keyboard key masks. */
char m_keyboard_vector[32];

/* to prevent multiple warp, we store the time of the last warp event
* and stop accumulating all events generated before that */
/**
* To prevent multiple warp, we store the time of the last warp event
* and stop accumulating all events generated before that.
*/
Time m_last_warp;

/* detect autorepeat glitch */
/* Detect auto-repeat glitch. */
unsigned int m_last_release_keycode;
Time m_last_release_time;

Expand Down
37 changes: 24 additions & 13 deletions release/scripts/modules/bpy_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@
StructMetaPropGroup = bpy_types.bpy_struct_meta_idprop
# StructRNA = bpy_types.Struct

bpy_types.BlendDataLibraries.load = _bpy._library_load
bpy_types.BlendDataLibraries.write = _bpy._library_write
bpy_types.BlendData.user_map = _bpy._rna_id_collection_user_map
bpy_types.BlendData.batch_remove = _bpy._rna_id_collection_batch_remove
bpy_types.BlendData.orphans_purge = _bpy._rna_id_collection_orphans_purge

# Note that methods extended in C are defined in: 'bpy_rna_types_capi.c'

class Context(StructRNA):
__slots__ = ()
Expand Down Expand Up @@ -118,14 +113,19 @@ class Object(bpy_types.ID):

@property
def children(self):
"""All the children of this object. Warning: takes O(len(bpy.data.objects)) time."""
"""All the children of this object.
.. note:: Takes ``O(len(bpy.data.objects))`` time."""
import bpy
return tuple(child for child in bpy.data.objects
if child.parent == self)

@property
def users_collection(self):
"""The collections this object is in. Warning: takes O(len(bpy.data.collections) + len(bpy.data.scenes)) time."""
"""
The collections this object is in.
.. note:: Takes ``O(len(bpy.data.collections) + len(bpy.data.scenes))`` time."""
import bpy
return (
tuple(
Expand All @@ -139,7 +139,9 @@ def users_collection(self):

@property
def users_scene(self):
"""The scenes this object is in. Warning: takes O(len(bpy.data.scenes) * len(bpy.data.objects)) time."""
"""The scenes this object is in.
.. note:: Takes ``O(len(bpy.data.scenes) * len(bpy.data.objects))`` time."""
import bpy
return tuple(scene for scene in bpy.data.scenes
if self in scene.objects[:])
Expand Down Expand Up @@ -292,12 +294,16 @@ def vector(self):

@property
def children(self):
"""A list of all the bones children. Warning: takes O(len(bones)) time."""
"""A list of all the bones children.
.. note:: Takes ``O(len(bones))`` time."""
return [child for child in self._other_bones if child.parent == self]

@property
def children_recursive(self):
"""A list of all children from this bone. Warning: takes O(len(bones)**2) time."""
"""A list of all children from this bone.
.. note:: Takes ``O(len(bones)**2)`` time."""
bones_children = []
for bone in self._other_bones:
index = bone.parent_index(self)
Expand All @@ -314,7 +320,9 @@ def children_recursive_basename(self):
Returns a chain of children with the same base name as this bone.
Only direct chains are supported, forks caused by multiple children
with matching base names will terminate the function
and not be returned. Warning: takes O(len(bones)**2) time.
and not be returned.
.. note:: Takes ``O(len(bones)**2)`` time.
"""
basename = self.basename
chain = []
Expand Down Expand Up @@ -1017,7 +1025,10 @@ class NodeSocket(StructRNA, metaclass=RNAMetaPropGroup):

@property
def links(self):
"""List of node links from or to this socket. Warning: takes O(len(nodetree.links)) time."""
"""
List of node links from or to this socket.
.. note:: Takes ``O(len(nodetree.links))`` time."""
return tuple(
link for link in self.id_data.links
if (link.from_socket == self or
Expand Down
8 changes: 6 additions & 2 deletions release/scripts/modules/rna_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ def build(self):
for dim in self.array_dimensions[::-1]:
if dim != 0:
self.default = tuple(zip(*((iter(self.default),) * dim)))
self.default_str = tuple("(%s)" % ", ".join(s for s in b) for b in zip(*((iter(self.default_str),) * dim)))
self.default_str = tuple(
"(%s)" % ", ".join(s for s in b) for b in zip(*((iter(self.default_str),) * dim))
)
self.default_str = self.default_str[0]
elif self.type == "enum" and self.is_enum_flag:
self.default = getattr(rna_prop, "default_flag", set())
Expand Down Expand Up @@ -349,7 +351,9 @@ def get_type_description(self, as_ret=False, as_arg=False, class_fmt="%s", colle
type_str += self.type
if self.array_length:
if self.array_dimensions[1] != 0:
type_str += " multi-dimensional array of %s items" % (" * ".join(str(d) for d in self.array_dimensions if d != 0))
type_str += " multi-dimensional array of %s items" % (
" * ".join(str(d) for d in self.array_dimensions if d != 0)
)
else:
type_str += " array of %d items" % (self.array_length)

Expand Down
17 changes: 8 additions & 9 deletions release/scripts/presets/keyconfig/keymap_data/blender_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -4975,14 +4975,14 @@ def km_view3d_interactive_add_tool_modal_map(_params):
)

items.extend([
("FIXED_ASPECT_ON", {"type": 'LEFT_ALT', "value": 'PRESS', "any": True}, None),
("FIXED_ASPECT_OFF", {"type": 'LEFT_ALT', "value": 'RELEASE', "any": True}, None),
("FIXED_ASPECT_ON", {"type": 'RIGHT_ALT', "value": 'PRESS', "any": True}, None),
("FIXED_ASPECT_OFF", {"type": 'RIGHT_ALT', "value": 'RELEASE', "any": True}, None),
("PIVOT_CENTER_ON", {"type": 'LEFT_SHIFT', "value": 'PRESS', "any": True}, None),
("PIVOT_CENTER_OFF", {"type": 'LEFT_SHIFT', "value": 'RELEASE', "any": True}, None),
("PIVOT_CENTER_ON", {"type": 'RIGHT_SHIFT', "value": 'PRESS', "any": True}, None),
("PIVOT_CENTER_OFF", {"type": 'RIGHT_SHIFT', "value": 'RELEASE', "any": True}, None),
("PIVOT_CENTER_ON", {"type": 'LEFT_ALT', "value": 'PRESS', "any": True}, None),
("PIVOT_CENTER_OFF", {"type": 'LEFT_ALT', "value": 'RELEASE', "any": True}, None),
("PIVOT_CENTER_ON", {"type": 'RIGHT_ALT', "value": 'PRESS', "any": True}, None),
("PIVOT_CENTER_OFF", {"type": 'RIGHT_ALT', "value": 'RELEASE', "any": True}, None),
("FIXED_ASPECT_ON", {"type": 'LEFT_SHIFT', "value": 'PRESS', "any": True}, None),
("FIXED_ASPECT_OFF", {"type": 'LEFT_SHIFT', "value": 'RELEASE', "any": True}, None),
("FIXED_ASPECT_ON", {"type": 'RIGHT_SHIFT', "value": 'PRESS', "any": True}, None),
("FIXED_ASPECT_OFF", {"type": 'RIGHT_SHIFT', "value": 'RELEASE', "any": True}, None),
("SNAP_ON", {"type": 'LEFT_CTRL', "value": 'PRESS', "any": True}, None),
("SNAP_OFF", {"type": 'LEFT_CTRL', "value": 'RELEASE', "any": True}, None),
("SNAP_ON", {"type": 'RIGHT_CTRL', "value": 'PRESS', "any": True}, None),
Expand Down Expand Up @@ -5907,7 +5907,6 @@ def km_3d_view_tool_interactive_add(params):
"3D View Tool: Object, Add Primitive",
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items": [
("view3d.cursor3d", {"type": params.tool_mouse, "value": 'CLICK'}, None),
("view3d.interactive_add", {"type": params.tool_tweak, "value": 'ANY', "any": True},
{"properties": [("wait_for_input", False)]}),
]},
Expand Down
3 changes: 0 additions & 3 deletions release/scripts/startup/bl_operators/uvcalc_follow_active.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@

# <pep8 compliant>

# for full docs see...
# https://docs.blender.org/manual/en/latest/editors/uv_image/uv/editing/unwrapping/mapping_types.html#follow-active-quads

import bpy
from bpy.types import Operator

Expand Down
2 changes: 1 addition & 1 deletion release/scripts/startup/bl_ui/properties_paint_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def prop_unified(

if unified_name and not header:
# NOTE: We don't draw UnifiedPaintSettings in the header to reduce clutter. D5928#136281
row.prop(ups, unified_name, text="", icon="BRUSHES_ALL")
row.prop(ups, unified_name, text="", icon='BRUSHES_ALL')

return row

Expand Down
Loading

0 comments on commit e0bb891

Please sign in to comment.