Jump to content

Blender exporter and empties


Recommended Posts

Hello everyone,

I am creating an game which displays a map where I would like to mark some points (base on these points will be various models placed - it depends on data from backend). These points I am creating in the Blender by Plain Axes empty object. This objects appears also in exported *.babylon file in meshes part of file.  So far so good, but problem is that I need somehow mark these points, the Tag feature seems like good choice, but there isn't a Tag field in Blender UI like is for meshes. So my first question is: Do you know any way how to add tags at empty entity? And second one:  Do you know any other way how to mark such points? I was thinking about simple small circle but it seems like very ugly workaround for me. I was also thinking about using of entity name as a "tag", this solution seems like candidate for me, but delaing with multiple tags on one object will needs some ugly name/tag conversion.

 

Thank you for help

SeagullCZ

Link to comment
Share on other sites

Hi Seagull, welcome to the forum!

I have some ideas for this... using a Blender "custom property" that you name 'metadata'.  It must be named metadata so that it arrives in BJS (imported) as the mesh.metadata property.

Note:  Lights and cameras ALSO carry the .metadata property, but let's ONLY talk about mesh.metadata, here/now.   [click here for forum-wide search for 'metadata']

In Blender, this mesh/object property VALUE could be set as a string value, and that string COULD BE a serialized JSON object.  After the .metadata string arrives into a BJS scene, it can be JSON parsed, and it will become an object.  That object COULD be a database of marker names, and each marker's worldspace position (x/y/z).

One problem.  Imagine you have 100 or more markers on a ground/floor.  The string you must edit/paste into the Property Value text-input field... (with each marker's name and position) will be long and ugly.

--------------------
We need to talk with @JCPalmer and other Blender exporter experts... for a moment.  Jeff/others... do you think it is possible to make the exporter... TRY to run a little "extra" user-written Python func.... during the exporting?

Objectives of the user-created Python func: 

  - Ignore the existence-of (don't export) ANY mesh named _marker_### (where ### = some number 000-999+)

  - Assemble a giant metadata string (serialized JSON) containing the names and positions of all _markers_.

  - Place that long string into parentMesh.metadata ... for export to BJS scene... where Seagull can use that _markers_ database.
-------------------

Then, Seagull, in your Blender scene... you could place little boxes or spheres at every _marker_ point, and if you named each...  _marker_xxx, then they would NOT be included in the scene export-from-Blender, but their names and positions WOULD be included... in someOtherMesh.metadata string.  A suitcase or traveling bag.  :)

Do you think this would work... for your needs, Seagull?  I don't know if it is possible, but, let's run it up the flagpole and see if anyone salutes it.  :D

Would that user-coded Python func be called an exporter pre-processor?  *shrug* 

My whole idea might be the wrong approach, as I'm not an export expert.  All ideas/comments welcome, always.

Link to comment
Share on other sites

I was just thinking about just a single verts, but it seems not convenient.

I took a look on the mesh.py addon file, but play with empties doest not appear easy (example, they aren't bpy.types.Empty - I could be wrong), so I don't success to show a Tags input box ?

By writing this, 'thought maybe the simpliest solution: create a custom mesh-empty without faces:

nh7iN09.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...