Describe the bug
If you have an object 'child' which is in an asset bundle, and you change the material, those changes are resetted if you do any_other_obj.addAttachment(child).
To Reproduce
Spawn any object of any type, let's say a mode, which will be 'obj'
Spawn an object of type Custom_AssetBundle with a MeshRender component with parameters in associated material, which will be 'child'
Change a material paremeter for example child.setMaterialValue(0, "_Name", 1, 3) (to set _Name=3 in the first material). This should be done after the object has been created and spawned. We can see it takes effect.
Execute obj.addAttachment(child)
Expected behavior
The child is now attached to the object without changing and carries as normal
Screenshots
If applicable, add screenshots to help explain your problem.
Tabletop Simulator Info (please complete the following information):
OS: Windows 10x64
Version: 12.4.3
Known workarounds
None
Additional context
I have tried several workarounds to no avail. The idea was to change after the attachment, but I cannot seem to get a valid object. I tried "obj.getAttachments()", but this give a GUID that I cannot combine with "getObjectFromGUID()", since it returns nil as with all attachments. I investigated further and there was a "obj.getChild(name)", but apparently it uses the gameobj name, not the tts name, and for this use case, the name is... "Custom_Assetbundle(clone)", so not useful at all. Looking more options I found a "obj.getChildren()", with seemed promising, but with a bunch of "log()" I discored it is a LuaGameObjectReference instead of a LuaGameObjectScript. Funnily enough I can get the Custom_Assetbundle(clone) here (which I couldn't directly from the obj), but no way to access anything that will bbe usable by "setMaterialValue". It does have a "getComponents()" functions, which behave like "obj.getComponentInChildren", and this gives me a MeshRenderer, but If I try to use material.SetFloat() I'm blocked by MoonSharp.
Working but not really feasible workarounds are to essentially have all the possible values in a different assetbundles, and spawn each of them in each change. But in my case, considering combinations, it's not really usable. Same for using the TTSEffects.
Describe the bug If you have an object 'child' which is in an asset bundle, and you change the material, those changes are resetted if you do any_other_obj.addAttachment(child).
To Reproduce
Expected behavior
Screenshots If applicable, add screenshots to help explain your problem.
Tabletop Simulator Info (please complete the following information):
Known workarounds None
Additional context I have tried several workarounds to no avail. The idea was to change after the attachment, but I cannot seem to get a valid object. I tried "obj.getAttachments()", but this give a GUID that I cannot combine with "getObjectFromGUID()", since it returns nil as with all attachments. I investigated further and there was a "obj.getChild(name)", but apparently it uses the gameobj name, not the tts name, and for this use case, the name is... "Custom_Assetbundle(clone)", so not useful at all. Looking more options I found a "obj.getChildren()", with seemed promising, but with a bunch of "log()" I discored it is a LuaGameObjectReference instead of a LuaGameObjectScript. Funnily enough I can get the Custom_Assetbundle(clone) here (which I couldn't directly from the obj), but no way to access anything that will bbe usable by "setMaterialValue". It does have a "getComponents()" functions, which behave like "obj.getComponentInChildren", and this gives me a MeshRenderer, but If I try to use material.SetFloat() I'm blocked by MoonSharp.
Working but not really feasible workarounds are to essentially have all the possible values in a different assetbundles, and spawn each of them in each change. But in my case, considering combinations, it's not really usable. Same for using the TTSEffects.