Jump to content

blender 2.75: instance_geometry gets name attribute


Gaia Clary
 Share

You are about to reply to a thread that has been inactive for 3280 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi;

In Blender 2.75 the Collada exporter adds a name attribute to instance_geometry nodes. This feature was requested to workaround a bug with instance nodes during upload to Second Life. The feature will become available in daily builds beginning tomorrow (3-may-2015)

@Drongle: Maybe you can comment on this and explain when this becomes important and useful? thanks.

Link to comment
Share on other sites

"Maybe you can comment on this and explain..."

TLDR: It gives uploaded objects the right names.

Oh dear .... how long have you got? :matte-motes-smile:

The Project-Importer viewer is the branch of development where there are supposedly going to be several improvements to the mesh uploader code. One of these is to change how objects in multi-object LOD files are associated so that the right objects get associated at each LOD (and physics). In the release viewer, this is done by the order the objects appear in the file. This has often led to problems we have had to deal with in this forum, because it was difficult to control the order of objects in the file (specifically, it was the order of <geometry> sections that mattered). Gaia solved this for Blender users by adding the sort-by-object-name export option, so that we could control them by a flexible naming convention.

The new scheme in the Project-Importer viewer is in development, and it can't be certain how much of it will get through to release. At the moment it associates files at different LODs (and physics) using a new and inflexible naming convention (not so far documented except by reading the code). This specifies precise names for objects in the lower LODs. They have to be the high LOD name with postfixes "_LOD2", "_LOD1" and "LOD0" (and _PHYS"). The information available suggests that if you don't use this scheme, the uploader will "fall back" to use the old index-based scheme, but so far that isn't working (jiras done). There are all sorts of problems with this, but hopefully they can be worked out.

Now, to get the names, there are several places the uploader can look. For the names eventually attached to the objects, it is currently using the <instance_geometry> tag of the <visual_scene> section of the collada file. This is the part that says "this scene contains an instance of this geometry", where the geometry is referenced by its ID attribute. The <instance_geometry> is allowed to have an optional "name" attribute and an optional "ID" attribute (the latter has to be unique in the file), and that is where the uploader looks first for a name. If the uploader doesn't find one of these, then it will look in the parent section instead, which is a <node>. However, because a <node> may have multiple <instance geometry>s*, it needs to make a unique name for each. It does that by inserting a sibling index at the end of the <node> name. So if there is no name in <instance_geometry>, then the first object will be called "nodename_1", then "nodename_2" etc. For the lower LODs, it actually (tries to) insert the index before the LOD postfix, making names like "nodename_1_LOD2" etc. Whether it has to add the sibling index or gets the name directly from <instance_geometry>, that name is used as the object name inworld, the name you see in your inventory when you upload the object(s).

The Blender exporter uses the Blender object name to make both the name and ID attributes of the <node> by which each object is made part of the <visual_scene>, but it didn't put any name or ID attribute in the <instance_geometry> inside the <node>. So the uploader was adding the sibling index. Obviously we would prefer to have the object appear inworld with the name we gave it in Blender, without that index, and that should now be accomplished by putting the object name in the name attribute of the <instance_geometry>, as Gaia has now kindly done.

However nice, that convenience alone would not have been enough for me to request this change. In fact, there was something wrong with the code that added the sibling index, putting it at the end in the LOD names, when it was supposed to be in the middle. The result was that the rest of the code could never find the expected names for the LOD meshes, and it was impossible to upload any LOD files at all, even if they used the correct naming scheme. Putting the name in the <instance_geometry> was a way around that, as it would avoid the sibling indices altogether. That was why I requested it - to make it possible to upload LOD meshes in the Project-Importer viewer.

As it turns out, they have fixed the index problem in the meantime, and it is now possible to upload LOD files as long as they adhere to the very specific naming convention. The fallback to the old indexing system is still not working. So the change in the Blender exporter was no longer absolutely necessary for uploading, but it is still very welcome because it should give the the intended name for the uploaded object, without an unnecessary "_1" attached.

The other big change in the Project-Importer viewer is that it allows the upload of models, single or multiple object, with more than eight materials per object. It does this by splitting the object into multiple objects. Unfortunately there are some rather unpleasant complications when this gets combined with the old >21844 triangle problem. I would like to hope that they will take this opportunity to make the 21844 triangles per material an official and enforced limit, so that all the old and new problems could be dismissed at one go. After all, if you have as many materials as you like, you can just use multiple identical ones of you really do need to have them with so may triangles. However, experience tells me not to be optimistic.

*I don't think the Blender exporter does this but other exporters may.

PS For anyone whom found this too simplified, try jiras BUG-83734 and BUG-8996 for the naming stuff and BUG-9015 for the >21844 triangle stuff.

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3280 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...