Greetings,
If you have 2 separate setups and you want to merge them into one there are a few ways to do that with zBuilder.
To get info from the scene there are 2 commands.
retrieve_from_scene()
and
retrieve_from_scene_selection()
retrieve_from_scene_selection() works on selection and there are 2 modes it works in. Either gets whatever is selected explicetly OR gets selection and whatever it is connected to. This is useful if you want to get everything associated with a muscle (materiels, fibers, attachements, etc)
If you want to get everything connected to a muscle you can do like so: (one hint is watch the stats in script editor after it is done to see what it is grabbing)
select muscle
import zBuilder.setup.Ziva as zva
z = zva.ZivaSetup()
z.retrieve_from_scene_selection()
If you wanted to get only attachments connected to a muscle:
select muscle
import zBuilder.setup.Ziva as zva
z = zva.ZivaSetup()
z.retrieve_from_scene_selection(solver=False,bones=False,tissues=False,attachments=True,materials=False,
fibers=False,embedder=False)
If you wanted to get a specific attachment (or fiber, or material)
select attachent (or fiber or material)
z.retrieve_from_scene_selection(connections=False)
the above it is important to turn off connections, thats how you get specifically what you select.
If you have 2 setups in maya and want to merge them, you can do one of those options above. Depending on what exactly changed determines what method you do. If it is just a few things and you know exactly what they are the last one should do. Once you do that if they are in different scenes you can save it on disk
select attachent (or fiber or material)
z.retrieve_from_scene_selection(connections=False)
z.write('C:\\Temp\\temp.ziva')
Then in new scene that you want to merge it with do a
import zBuilder.setup.Ziva as zva
z = zva.ZivaSetup()
z.retrieve_from_file('C:\\Temp\\temp.ziva')
z.apply()