Blender 2.8 Python Bindings For Linked Content

Problem: Our example showcase.zip scene featuring linked content does not export properly from Blender 2.8

To reproduce:

  1. Download & unzip showcase.zip from here : http://advance-software.com/download/tools/blender

  2. Install Infinity exporter for 2.79b and 2.8

  3. Load root.blend from unzipped showcase.

  4. Export as Infinity xsg from 2.79b and 2.8

  5. Note that 2.79b version walks the linked content exporting it correctly.

  6. Note that 2.8 version only performs a limited export & does not walk the full scene correctly.

So: Do we require exporter changes because of linked content interface changes or is this missing features in 2.8 requiring fix up & nothing we can do until this is resolved.

Thanks for your consideration.

Updated our 2.8 script a little to add some debug & a verbose option to the exporter so the diagnostics can be viewed at the console.

From xsg_export.py , the following works in 2.79 to enable us to access linked object information :

			# Check whether this is a linked group (called xref in other packages)
			if hasattr(bobj, 'dupli_group'):
				self.Log("[DBG] Found dupli_group")
				if bobj.dupli_group != None:
					if bobj.dupli_type == 'GROUP':
						self.Log("[DBG] Found dupli_group type GROUP")
						export_map[bobj] = Export_Reference_Group(self, bobj)

It seems ‘dupli_group’ is no longer set intentionally (configuration has changed) or accidentally - feature merge not yet complete.

If this is intentional, please could someone explain how we should identify linked objects in 2.8

Please also note the comments in that code which explain why we have to unload main scene & loaded linked objects to access some of their scene data that’s not available via the link.

If this could be addressed so we don’t have to load/unload components., that’d be awesome.

As a first step, would be great if we could get back to 2.79 feature parity.

Cheers guys, awesome work.

This exporter can be bundled with standard blender distributable if you’d like, once we’re up and running again.

Please see the release notes for an overview of what changed:
https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API

Groups were renamed to collections.

Note that even in 2.79, groups and linked data / xref are not the same thing. Groups are often used for linking, but they can be local too or data may be linked without groups.

1 Like

dupli_group is now what, please. I’ll dump out contents & guess but if you know & can advise, that’d be faster :slight_smile:

cheers

Please see the Renaming section of that page, from there you can figure out the new names.

1 Like

Got it. Cheers.

The one missing part as of 2.79 was there was no dupli_group.scene element so had to load the referenced scene to walk its hierarchy, which results of lots of unnecessary load/unload operations.

Would be awesome if we had access to instance_collection.scene

or instance_collection.library.scene

or something like that.

A group/collection is not associated with any specific scene. If you link it from a library .blend, it will not use any data from a scene in that library .blend.