[Closed] Help with Custom attributes
Is it possible for a bunch of instanced objects to have unique varible values when using the same custom attribute definition.
For example say I have two spheres ‘$sphere01’ and ‘$sphere02’ which are instances of each other, And a Custom Attribute definition which looks like…
[color=Cyan]CaTest = Attributes TestAttrib
(
Parameters main
(
CAn type:#integer
)
)
[/color]
If i add Catest to sphere01 like this
custAttributes.add $sphere01 CaTest
Then i find that $sphere02 also has the custom attribute.
Worse still if I change the varible in sphere02 …
$sphere02.CAn = 2
I find that
$sphere01.CAn == 2 is true as well
Is there a way round this so that the variable stays unique ?
[color=PaleTurquoise]
[color=Cyan]custAttributes.MakeUnique [/color][/color]$sphere02[color=Cyan] CaTest [color=#fffffe]does not seem to apply in this case.
I actually need to store a material definition in the Custom attribute so ‘Node user properties’ won’t really help in this case.
Can any of you guys help
[/color][/color]
You can’t have unique CA’s on an instanced baseobject. Instead, make a reference of the object and apply an Attribute Holder onto both objects (you need to apply the modifier to each object separately, otherwise the modifier will be instanced as well and then it won’t work for the same reason). Then, add the CA to these modifiers on both objects. This will maintain the instanced baseobject, but with unique custom attributes.
Hope this makes any sense! :hmm:
- Martijn
Thanks Martijn
Arrg …
custAttributes.add $sphere CaTest BaseObject:false
seems to work
Man i’ve spent hours banging my head trying to sort this out, and i soon as i write the post i find the answer