BlenderBIM to Speckle - Help w/ Accessing & Extracting Object Properties

edited April 2021 in General

Hey all!

I'm currently working on the Speckle 2.0 Blender connector and more specifically integrating with BlenderBIM (note: all this dev is local for now, so the repo is not up to date with this!). I am a bit of a noob when it comes to Blender and IFC in general, so forgive me if this is a somewhat naïve question.

So far, I have managed to send the geometry representation of BlenderBIM projects to Speckle preserving the hierarchy of collections and objects as you can see in this test stream here. However, I am not sure about the correct approach for getting the property sets (and possibly other useful information? open to suggestions) and attaching these to the objects as well.

When inspecting the Blender objects themselves, I seem to only be able to find the ifc_definition_id actually stored on there. The PsetProperties always seems to be empty. However, BlenderBIM is obviously already doing the work of getting the schema and properties to display them in the Object Properties panel.

So my main question: is BlenderBIM storing these properties anywhere that I can get access to from the Speckle Addon? If not, could I please get some advice on how to either use BlenderBIM or IFCOpenShell to get these properties myself so I can attach them to the individual objects when converting and sending to Speckle?

If there is documentation out there on this that I missed, I would appreciate being directed towards it.

Cheers!
Izzy

edit: using Blender v2.92.0 and BlenderBIM v0.0.210405

JanFstephen_ltheoryshawduncanMoultgokermukaiaurelienzh

Comments

  • Hi @izzylys ! Great to see you here. Very nice to see the test stream from Blender to Speckle ?
    The current implementation in BlenderBIM is very new and still undocumented unfortunately. I am quite new to it, but I want to give you some context on this that may be helpful, and certainly @Moult will be able to provide you with a more accurate answer.

    So, the implementation has been completely separated to make the back-end i/o operations with ifc agnostic of the blender environment. The reason the PsetProperties are empty I would bet is because they are not stored there at all, only information pertinent to the functionality of the UI is stored in Blender-specific properties.

    This separation is depicted in the code in the BlenderBIM modules and the IfcOpenShell api, the new high-level api that is being developed for this purpose. Both are divided in folders representing modules and functionalities, so in your case you would look in the pset module and specifically the data.py file is the one that reads all the pset properties. This is called in the ui.py file (L2) that shows the properties in the UI.

    I hope this can provide some guidance, the information you are looking for should be in the Data.psets I reckon.

    izzylys
  • Thanks @Jesusbill for the context! This was quite helpful - I will have a look in the BlenderBIM modules and hopefully get a bit closer to figuring this out. I will admit I was a bit overwhelmed by the repo as there isn't a whole lot of documentation, so I appreciate your pointing me to where to look ?

    Jesusbill
  • edited April 2021

    @izzylys hey there and welcome to OSArch! @Jesusbill gave a good explanation - in summary, you will not find data in the Blender environment at all! Any properties you find (such as PsetProperties) are only for temporary storage when authoring a portion of the file - and are not persistent storages. The BlenderBIM Add-on and Blender is merely a UI / UX layer.

    Instead, the BlenderBIM Add-on works directly with IFC as its data-model, so the data is stored in memory. You can access the current in-memory IFC via:

    from blenderbim.bim.ifc import IfcStore
    IfcStore.get_file()
    

    So really you should be looking to build an IFC Speckle Connector - not a BlenderBIM Add-on Speckle Connector. You can then reuse this Connector with Rhino's GeometryGym tools, or any of the other IfcOpenShell tools, IfcSverchok, etc.

    Hope it makes sense. Feel free to catch us online via the OSArch Live Chat if you'd prefer a more hands-on demonstration.

    izzylys
  • Hey @Moult , thanks a lot for the welcome and the helpful explanation! This gives me a good jumping off point for digging more into the IFC data.

    At the moment, I am actually working on a general Blender Connector for Speckle that I was hoping could also integrate with BlenderBIM if the user happens to be working with an IFC project. I'll have a go at working with the IfcStore for now, but a full IFC Connector may be something to explore a bit further down the line.

    Thanks again! I'll pop in to the live chat some time if I run into any other blockers that could benefit from some more hands-on help.

  • @izzylys no worries. If you need help with Blender, we can also help with that. There are quite a number of experienced Blender devs here!

    Jesusbilldimitrieizzylys
  • edited June 2021

    Rhino and Revit connectors got enhancement, they now are able to carry ifc data !
    Time to dig further as it may be ultimate way to share data across applications.
    see relevant announcment in speckle community forum

    MoultbasweinJesusbill
  • I've been thinking the same thing. I am not a coder so it is just a "old man yelling at the sky" kind of thinking :)
    I did post a connector idea on the Speckle forum https://speckle.community/t/gis-connector-qgis/1468
    Am I right in thinking that the more powerful connector is between speckle and the IFC file itself instead of Blender? (ifcshell?)

  • You are probably right as we need a strong backend in order to create 3d representations.
    So most of the the connector's logick remains application agnostic - we still must create / update representations in target applications when we get data from speckle (using ifc openshell as geometry backend).
    But as soon as the application use "native ifc" as format, we only are required to send changes as ifc to speckle.

  • I re-read the announcement and the impression I get is that "now they are able to carry data", not "they are able to carry IFC data". This is a good move in the right direction, and would love to collaborate with speckle to figure out how IFC can work in this. Ping @izzylys how'd your progress go?

Sign In or Register to comment.