Skip to content

Commit a5a6a01

Browse files
authored
Always log the primary component last so it is joined properly (#1217)
* Always log splats before the primary component * Make comment clear that the important thing is primary last not splat first
1 parent afec6b0 commit a5a6a01

File tree

10 files changed

+51
-37
lines changed

10 files changed

+51
-37
lines changed

crates/re_sdk/src/msg_sender.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,17 @@ impl MsgSender {
256256
pub fn send(self, session: &mut Session) -> Result<(), MsgSenderError> {
257257
let [msg_standard, msg_transforms, msg_splats] = self.into_messages()?;
258258

259-
if let Some(msg_standard) = msg_standard {
260-
session.send(LogMsg::ArrowMsg(msg_standard.try_into()?));
261-
}
262259
if let Some(msg_transforms) = msg_transforms {
263260
session.send(LogMsg::ArrowMsg(msg_transforms.try_into()?));
264261
}
265262
if let Some(msg_splats) = msg_splats {
266263
session.send(LogMsg::ArrowMsg(msg_splats.try_into()?));
267264
}
265+
// Always the primary component last so range-based queries will include the other data. See(#1215)
266+
// Since the primary component can't be splatted it must be in msg_standard
267+
if let Some(msg_standard) = msg_standard {
268+
session.send(LogMsg::ArrowMsg(msg_standard.try_into()?));
269+
}
268270

269271
Ok(())
270272
}

rerun_py/rerun_sdk/rerun/log/arrow.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ def log_arrow(
8181
if ext:
8282
_add_extension_components(instanced, splats, ext, None)
8383

84-
if instanced:
85-
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
86-
8784
if splats:
8885
splats["rerun.instance_key"] = InstanceArray.splat()
8986
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)
87+
88+
# Always the primary component last so range-based queries will include the other data. See(#1215)
89+
if instanced:
90+
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)

rerun_py/rerun_sdk/rerun/log/bounding_box.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,10 @@ def log_obb(
105105
if ext:
106106
_add_extension_components(instanced, splats, ext, None)
107107

108-
if instanced:
109-
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
110-
111108
if splats:
112109
splats["rerun.instance_key"] = InstanceArray.splat()
113110
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)
111+
112+
# Always the primary component last so range-based queries will include the other data. See(#1215)
113+
if instanced:
114+
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)

rerun_py/rerun_sdk/rerun/log/extension_components.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,10 @@ def log_extension_components(
126126

127127
_add_extension_components(instanced, splats, ext, identifiers_np)
128128

129-
if instanced:
130-
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
131-
132129
if splats:
133130
splats["rerun.instance_key"] = InstanceArray.splat()
134131
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)
132+
133+
# Always the primary component last so range-based queries will include the other data. See(#1215)
134+
if instanced:
135+
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)

rerun_py/rerun_sdk/rerun/log/lines.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,14 @@ def log_line_strip(
9191
if ext:
9292
_add_extension_components(instanced, splats, ext, None)
9393

94-
if instanced:
95-
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
96-
9794
if splats:
9895
splats["rerun.instance_key"] = InstanceArray.splat()
9996
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)
10097

98+
# Always the primary component last so range-based queries will include the other data. See(#1215)
99+
if instanced:
100+
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
101+
101102

102103
def log_line_segments(
103104
entity_path: str,
@@ -174,9 +175,10 @@ def log_line_segments(
174175
if ext:
175176
_add_extension_components(instanced, splats, ext, None)
176177

177-
if instanced:
178-
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
179-
180178
if splats:
181179
splats["rerun.instance_key"] = InstanceArray.splat()
182180
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)
181+
182+
# Always the primary component last so range-based queries will include the other data. See(#1215)
183+
if instanced:
184+
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)

rerun_py/rerun_sdk/rerun/log/points.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,14 @@ def log_point(
118118
if ext:
119119
_add_extension_components(instanced, splats, ext, None)
120120

121-
if instanced:
122-
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
123-
124121
if splats:
125122
splats["rerun.instance_key"] = InstanceArray.splat()
126123
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)
127124

125+
# Always the primary component last so range-based queries will include the other data. See(#1215)
126+
if instanced:
127+
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
128+
128129

129130
def log_points(
130131
entity_path: str,
@@ -244,8 +245,9 @@ def log_points(
244245
if ext:
245246
_add_extension_components(comps[0], comps[1], ext, identifiers_np)
246247

247-
bindings.log_arrow_msg(entity_path, components=comps[0], timeless=timeless)
248-
249248
if comps[1]:
250249
comps[1]["rerun.instance_key"] = InstanceArray.splat()
251250
bindings.log_arrow_msg(entity_path, components=comps[1], timeless=timeless)
251+
252+
# Always the primary component last so range-based queries will include the other data. See(#1215)
253+
bindings.log_arrow_msg(entity_path, components=comps[0], timeless=timeless)

rerun_py/rerun_sdk/rerun/log/rects.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,14 @@ def log_rect(
8888
if ext:
8989
_add_extension_components(instanced, splats, ext, None)
9090

91-
if instanced:
92-
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
93-
9491
if splats:
9592
splats["rerun.instance_key"] = InstanceArray.splat()
9693
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)
9794

95+
# Always the primary component last so range-based queries will include the other data. See(#1215)
96+
if instanced:
97+
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
98+
9899

99100
def log_rects(
100101
entity_path: str,
@@ -190,8 +191,9 @@ def log_rects(
190191
if ext:
191192
_add_extension_components(comps[0], comps[1], ext, identifiers_np)
192193

193-
bindings.log_arrow_msg(entity_path, components=comps[0], timeless=timeless)
194-
195194
if comps[1]:
196195
comps[1]["rerun.instance_key"] = InstanceArray.splat()
197196
bindings.log_arrow_msg(entity_path, components=comps[1], timeless=timeless)
197+
198+
# Always the primary component last so range-based queries will include the other data. See(#1215)
199+
bindings.log_arrow_msg(entity_path, components=comps[0], timeless=timeless)

rerun_py/rerun_sdk/rerun/log/scalar.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,10 @@ def log_scalar(
128128
if ext:
129129
_add_extension_components(instanced, splats, ext, None)
130130

131-
if instanced:
132-
bindings.log_arrow_msg(entity_path, components=instanced, timeless=False)
133-
134131
if splats:
135132
splats["rerun.instance_key"] = InstanceArray.splat()
136133
bindings.log_arrow_msg(entity_path, components=splats, timeless=False)
134+
135+
# Always the primary component last so range-based queries will include the other data. See(#1215)
136+
if instanced:
137+
bindings.log_arrow_msg(entity_path, components=instanced, timeless=False)

rerun_py/rerun_sdk/rerun/log/tensor.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,10 @@ def _log_tensor(
128128
if ext:
129129
_add_extension_components(instanced, splats, ext, None)
130130

131-
if instanced:
132-
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
133-
134131
if splats:
135132
splats["rerun.instance_key"] = InstanceArray.splat()
136133
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)
134+
135+
# Always the primary component last so range-based queries will include the other data. See(#1215)
136+
if instanced:
137+
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)

rerun_py/rerun_sdk/rerun/log/text.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ def log_text_entry(
137137
if ext:
138138
rerun.log.extension_components._add_extension_components(instanced, splats, ext, None)
139139

140-
if instanced:
141-
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
142-
143140
if splats:
144141
splats["rerun.instance_key"] = InstanceArray.splat()
145142
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)
143+
144+
# Always the primary component last so range-based queries will include the other data. See(#1215)
145+
if instanced:
146+
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)

0 commit comments

Comments
 (0)