X-Plane / XPlane2Blender

Scenery & Aircraft export addon for Blender and X-Plane
GNU General Public License v3.0
197 stars 67 forks source link

280: Support instancing and proxies #495

Open tngreene opened 4 years ago

tngreene commented 4 years ago

Related to #450 and #452.

In order to support the "re-usable library" idea that some have had, we can support linked collections and proxy objects. Neither solution is perfect, but, I think people will really like it. What is mainly affected is the collection algorithm, which needs to know how to resolve this sort of thing.

Attached is a bunch of examples of different styles of making this work.

shared_library_concept.zip

tngreene commented 4 years ago

This may be easier than before's solution of making a temporary real version and deleting it later: https://docs.blender.org/api/current/bpy.types.Depsgraph.html#dependency-graph-iterate-over-all-object-instances

tngreene commented 4 years ago

so, bad news, this feature is super buggy with Blender it self. In addition, when working well as it did in 2.79, making instances (or dupli groups as it was known) does not keep the parent-child information for some reason I can only imagine as absolutely horrible and manged.

Read the process here, and try the files attached there (and here) instancing_issue.zip

https://developer.blender.org/T77973

tngreene commented 4 years ago

https://docs.blender.org/api/current/bpy.types.Depsgraph.html#dependency-graph-iterate-over-all-object-instances another way to access instances without using make real I think

danklaue commented 3 years ago

Glad to see this issue has already come up. Sadly, it seems to have stopped working some time after 4.0.0 Alpha 6. i have 50+ instruments, each in their own .blend file, linked to a master .blend project, and up until Alpha 6, I was able to export them without mangling the hierarchies.

(To be thorough, I have to say that of the versions of XP2B I tried installing into Blender 2.91.2, only Alpha 6 and XP2B 4.1 Beta 1 would install... the other ones would never show up in my add-ons manager.. so I'm not ACTUALLY 100% sure that it really stopped working after 4.0.0 Alpha 6, since I wasn't able to test further versions, up until 4.1 Beta 1.)

Anyway, when trying to export this file arrangement (linked instruments into a main file) using XP2B 4.1 Beta 1, the hierarchies were all screwed up. Parts that belonged to one instrument (and therefore, to one linked .blend file), would export as though they were part of another instrument. I tried shortening the ancestry of the hierarchies used inside the linked .blend files, but that only helped a little... Going back to 4.0.0 Alpha 6 allowed me to export all linked files and their hierarchies fully intact.

Not sure what changed between 4.0.0 Alpha 6 and 4.1.0 Beta 1, but hopefully, this report can help track down the issue, and restore this feature to fully operational in a near-future update.