Platform Bug when attaching attributes

Hi all,

I have one model which suddenly (unsure exactly when) started behave differently on the platform compared to my local machine. I started to minimalize it, and the problem seems to be related to attributes. Here is where I got so far:
You can use this file as input geometry: test_00.3dm (51.0 KB)

A short explanation to help you understand:

  • The model simply sorts a bunch of curves, then attach some attributes to them. Using attributes, a copy of each curve is created on a different layer (‘bckup’ as in screenshot).
  • Optionally, is possible to modify the vertical position of curves: this happens before the attributes are created.
  • After attributes are created, only curves on ‘main’ layer are kept visible in the viewer, but the download file includes both

Now, here is the weird behaviour:

  • If I choose to modify the vertical position of curves (toggle on), everything work as expected.
  • Instead, if the upmentioned toggle stays off, attributes are created wrong and all the curves end up in the ‘bckup’ layer. Hence, they are not visible in the viewer (but you can download them as an output)

Here is a screenshot of the part of definition that creates the attributes:

Again, this is weird because the attributes are created completely independent from all previous operations. I can see no reason why moving the curves in space should change the way attributes are created.


I think the problem is related to the warning shown by the Inject Attributes component:

1. [GH-WARN-7]-[name: InjectAttr]: Some input objects already contain attributes. Those attributes will be overwritten. Use the “Add Key-Value Pair” component to add keys to an existing attributes object.

This happens because the Inject Attributes component does not clone objects, it just attaches attributes. Please try to make a deep copy of the list of objects, before feeding it into the second Inject Attributes component. You could do that by copying the objects in place (move using a vector 0,0,0).

Hi Alexander, thank you for your input, which suggested an effective work-around.

Still, the warning only suggests that the new attributes are going to over-ride whatever is already in place (which is desired).

By using two different inject attributes components in parallel (as in screenshot), I am trying to create two identical object with different attributes. In fact it works as expected locally, while in shapediver is displaying incoherent behaviour. Specifically, it acts funny when I am attaching attributes to an external input that has not being otherwise modified throughout the definition.

In my work around, I fixed it by moving the input curves by a small unit. Interestingely, copy in place with a zero vector does not do the trick.


As I explained above, the Inject Attributes component does not clone the objects you feed in. Therefore, if you use two of these components in parallel, the end result is not really well defined. It depends on which of the two components solves first.

Alright, likely the Move component detects the case of the zero vector and does not clone the object in this case. You could use two Move components with inverse vectors :wink: