Skip to content

Commit e0bb891

Browse files
committed
Merge remote-tracking branch 'b/master'
2 parents 3abec5f + 582d315 commit e0bb891

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+379
-261
lines changed

intern/cycles/blender/blender_session.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,13 @@ void BlenderSession::create_session()
168168

169169
void BlenderSession::reset_session(BL::BlendData &b_data, BL::Depsgraph &b_depsgraph)
170170
{
171+
/* Update data, scene and depsgraph pointers. These can change after undo. */
171172
this->b_data = b_data;
172173
this->b_depsgraph = b_depsgraph;
173174
this->b_scene = b_depsgraph.scene_eval();
175+
if (sync) {
176+
sync->reset(this->b_data, this->b_scene);
177+
}
174178

175179
if (preview_osl) {
176180
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");

intern/cycles/blender/blender_sync.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ BlenderSync::~BlenderSync()
7878
{
7979
}
8080

81+
void BlenderSync::reset(BL::BlendData &b_data, BL::Scene &b_scene)
82+
{
83+
/* Update data and scene pointers in case they change in session reset,
84+
* for example after undo. */
85+
this->b_data = b_data;
86+
this->b_scene = b_scene;
87+
}
88+
8189
/* Sync */
8290

8391
void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d)

intern/cycles/blender/blender_sync.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ class BlenderSync {
6161
Progress &progress);
6262
~BlenderSync();
6363

64+
void reset(BL::BlendData &b_data, BL::Scene &b_scene);
65+
6466
/* sync */
6567
void sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d);
6668
void sync_data(BL::RenderSettings &b_render,

intern/ghost/GHOST_C-api.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ extern GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
435435
***************************************************************************************/
436436

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

448448
/**
449-
* Returns the state of a mouse button (ouside the message queue).
449+
* Returns the state of a mouse button (outside the message queue).
450450
* \param systemhandle The handle to the system
451451
* \param mask The button state to retrieve.
452452
* \param isDown Pointer to return button state in.

intern/ghost/GHOST_ISystem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,15 +382,15 @@ class GHOST_ISystem {
382382
***************************************************************************************/
383383

384384
/**
385-
* Returns the state of a modifier key (ouside the message queue).
385+
* Returns the state of a modifier key (outside the message queue).
386386
* \param mask The modifier key state to retrieve.
387387
* \param isDown The state of a modifier key (true == pressed).
388388
* \return Indication of success.
389389
*/
390390
virtual GHOST_TSuccess getModifierKeyState(GHOST_TModifierKeyMask mask, bool &isDown) const = 0;
391391

392392
/**
393-
* Returns the state of a mouse button (ouside the message queue).
393+
* Returns the state of a mouse button (outside the message queue).
394394
* \param mask The button state to retrieve.
395395
* \param isDown Button state.
396396
* \return Indication of success.

intern/ghost/intern/GHOST_System.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,15 @@ class GHOST_System : public GHOST_ISystem {
219219
***************************************************************************************/
220220

221221
/**
222-
* Returns the state of a modifier key (ouside the message queue).
222+
* Returns the state of a modifier key (outside the message queue).
223223
* \param mask The modifier key state to retrieve.
224224
* \param isDown The state of a modifier key (true == pressed).
225225
* \return Indication of success.
226226
*/
227227
GHOST_TSuccess getModifierKeyState(GHOST_TModifierKeyMask mask, bool &isDown) const;
228228

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

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

297297
/**
298-
* Returns the state of the mouse buttons (ouside the message queue).
298+
* Returns the state of the mouse buttons (outside the message queue).
299299
* \param buttons The state of the buttons.
300300
* \return Indication of success.
301301
*/

intern/ghost/intern/GHOST_SystemCocoa.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class GHOST_SystemCocoa : public GHOST_System {
198198
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const;
199199

200200
/**
201-
* Returns the state of the mouse buttons (ouside the message queue).
201+
* Returns the state of the mouse buttons (outside the message queue).
202202
* \param buttons The state of the buttons.
203203
* \return Indication of success.
204204
*/

intern/ghost/intern/GHOST_SystemWin32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class GHOST_SystemWin32 : public GHOST_System {
212212
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const;
213213

214214
/**
215-
* Returns the state of the mouse buttons (ouside the message queue).
215+
* Returns the state of the mouse buttons (outside the message queue).
216216
* \param buttons The state of the buttons.
217217
* \return Indication of success.
218218
*/

intern/ghost/intern/GHOST_SystemX11.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class GHOST_SystemX11 : public GHOST_System {
182182
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const;
183183

184184
/**
185-
* Returns the state of the mouse buttons (ouside the message queue).
185+
* Returns the state of the mouse buttons (outside the message queue).
186186
* \param buttons The state of the buttons.
187187
* \return Indication of success.
188188
*/
@@ -211,7 +211,7 @@ class GHOST_SystemX11 : public GHOST_System {
211211
}
212212
#endif
213213

214-
/* Helped function for get data from the clipboard. */
214+
/** Helped function for get data from the clipboard. */
215215
void getClipboard_xcout(const XEvent *evt,
216216
Atom sel,
217217
Atom target,
@@ -337,7 +337,7 @@ class GHOST_SystemX11 : public GHOST_System {
337337
private:
338338
Display *m_display;
339339

340-
/* Use for scancode lookups. */
340+
/** Use for scan-code look-ups. */
341341
XkbDescRec *m_xkb_descr;
342342

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

352-
/// The vector of windows that need to be updated.
352+
/** The vector of windows that need to be updated. */
353353
std::vector<GHOST_WindowX11 *> m_dirty_windows;
354354

355-
/// Start time at initialization.
355+
/** Start time at initialization. */
356356
GHOST_TUns64 m_start_time;
357357

358-
/// A vector of keyboard key masks
358+
/** A vector of keyboard key masks. */
359359
char m_keyboard_vector[32];
360360

361-
/* to prevent multiple warp, we store the time of the last warp event
362-
* and stop accumulating all events generated before that */
361+
/**
362+
* To prevent multiple warp, we store the time of the last warp event
363+
* and stop accumulating all events generated before that.
364+
*/
363365
Time m_last_warp;
364366

365-
/* detect autorepeat glitch */
367+
/* Detect auto-repeat glitch. */
366368
unsigned int m_last_release_keycode;
367369
Time m_last_release_time;
368370

release/scripts/modules/bpy_types.py

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@
2525
StructMetaPropGroup = bpy_types.bpy_struct_meta_idprop
2626
# StructRNA = bpy_types.Struct
2727

28-
bpy_types.BlendDataLibraries.load = _bpy._library_load
29-
bpy_types.BlendDataLibraries.write = _bpy._library_write
30-
bpy_types.BlendData.user_map = _bpy._rna_id_collection_user_map
31-
bpy_types.BlendData.batch_remove = _bpy._rna_id_collection_batch_remove
32-
bpy_types.BlendData.orphans_purge = _bpy._rna_id_collection_orphans_purge
33-
28+
# Note that methods extended in C are defined in: 'bpy_rna_types_capi.c'
3429

3530
class Context(StructRNA):
3631
__slots__ = ()
@@ -118,14 +113,19 @@ class Object(bpy_types.ID):
118113

119114
@property
120115
def children(self):
121-
"""All the children of this object. Warning: takes O(len(bpy.data.objects)) time."""
116+
"""All the children of this object.
117+
118+
.. note:: Takes ``O(len(bpy.data.objects))`` time."""
122119
import bpy
123120
return tuple(child for child in bpy.data.objects
124121
if child.parent == self)
125122

126123
@property
127124
def users_collection(self):
128-
"""The collections this object is in. Warning: takes O(len(bpy.data.collections) + len(bpy.data.scenes)) time."""
125+
"""
126+
The collections this object is in.
127+
128+
.. note:: Takes ``O(len(bpy.data.collections) + len(bpy.data.scenes))`` time."""
129129
import bpy
130130
return (
131131
tuple(
@@ -139,7 +139,9 @@ def users_collection(self):
139139

140140
@property
141141
def users_scene(self):
142-
"""The scenes this object is in. Warning: takes O(len(bpy.data.scenes) * len(bpy.data.objects)) time."""
142+
"""The scenes this object is in.
143+
144+
.. note:: Takes ``O(len(bpy.data.scenes) * len(bpy.data.objects))`` time."""
143145
import bpy
144146
return tuple(scene for scene in bpy.data.scenes
145147
if self in scene.objects[:])
@@ -292,12 +294,16 @@ def vector(self):
292294

293295
@property
294296
def children(self):
295-
"""A list of all the bones children. Warning: takes O(len(bones)) time."""
297+
"""A list of all the bones children.
298+
299+
.. note:: Takes ``O(len(bones))`` time."""
296300
return [child for child in self._other_bones if child.parent == self]
297301

298302
@property
299303
def children_recursive(self):
300-
"""A list of all children from this bone. Warning: takes O(len(bones)**2) time."""
304+
"""A list of all children from this bone.
305+
306+
.. note:: Takes ``O(len(bones)**2)`` time."""
301307
bones_children = []
302308
for bone in self._other_bones:
303309
index = bone.parent_index(self)
@@ -314,7 +320,9 @@ def children_recursive_basename(self):
314320
Returns a chain of children with the same base name as this bone.
315321
Only direct chains are supported, forks caused by multiple children
316322
with matching base names will terminate the function
317-
and not be returned. Warning: takes O(len(bones)**2) time.
323+
and not be returned.
324+
325+
.. note:: Takes ``O(len(bones)**2)`` time.
318326
"""
319327
basename = self.basename
320328
chain = []
@@ -1017,7 +1025,10 @@ class NodeSocket(StructRNA, metaclass=RNAMetaPropGroup):
10171025

10181026
@property
10191027
def links(self):
1020-
"""List of node links from or to this socket. Warning: takes O(len(nodetree.links)) time."""
1028+
"""
1029+
List of node links from or to this socket.
1030+
1031+
.. note:: Takes ``O(len(nodetree.links))`` time."""
10211032
return tuple(
10221033
link for link in self.id_data.links
10231034
if (link.from_socket == self or

0 commit comments

Comments
 (0)