Commit Graph

3771 Commits

Author SHA1 Message Date
tim ca50044dba Remove object text from subheadings (#4445)
https://github.com/IfcOpenShell/IfcOpenShell/issues/4312
2024-04-17 14:58:13 +02:00
Bruno Postle 6944c247ca Drawings panel: fix select_all_drawings operator
Previously it always deselected all drawings, now works as advertised
2024-04-17 14:54:42 +02:00
Andrej730 aee264b587 black format 2024-04-17 14:54:42 +02:00
Andrej730 4490efc017 Fix ifc linking tests 2024-04-17 14:54:42 +02:00
Andrej730 37e06338c4 Fix issue removing material set
1) core.remove_material_set were removing material set and calling material_tool.get_active_material_type()
2) material_tool.get_active_material_type() called MaterialsData which failed with the traceback below since props.materias[current_index] had ifc id that were just removed

Traceback (most recent call last):
  File "\prop.py", line 96, in get_material_types
    MaterialsData.load()
  File "\data.py", line 43, in load
    "active_styles": cls.active_styles(),
                     ^^^^^^^^^^^^^^^^^^^
  File "\data.py", line 119, in active_styles
    material = tool.Ifc.get().by_id(material)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \blenderbim\libs\site\packages\ifcopenshell\file.py", line 411, in by_id
    return self[id]
           ~~~~^^^^
  File \blenderbim\libs\site\packages\ifcopenshell\file.py", line 396, in __getitem__
    return entity_instance(self.wrapped_data.by_id(key), self)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \blenderbim\libs\site\packages\ifcopenshell\ifcopenshell_wrapper.py", line 4619, in by_id
    return _ifcopenshell_wrapper.file_by_id(self, id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Instance # 66 not found
File "\prop.py", line 94, in get_material_types
WARN (bpy.rna): C:\Users\blender\git\blender-v410\blender.git\source\blender\python\intern\bpy_rna.cc:1366 pyrna_enum_to_py: current value '2' matches no enum in 'BIMMaterialProperties', '', 'material_type'
2024-04-17 14:54:42 +02:00
Andrej730 2b27f4423f fix ui error getting active styles for non IfcMaterial materials
Error was:

```
Traceback (most recent call last):
  File "\blenderbim\bim\module\material\ui.py", line 43, in draw
    MaterialsData.load()
  File "\blenderbim\bim\module\material\data.py", line 43, in load
    "active_styles": cls.active_styles(),
                     ^^^^^^^^^^^^^^^^^^^
  File "\blenderbim\bim\module\material\data.py", line 117, in active_styles
    return results

  File "\blenderbim\libs\site\packages\ifcopenshell\entity_instance.py", line 194, in __getattr__
    raise AttributeError(
AttributeError: entity instance of type 'IFC4.IfcMaterialLayerSet' has no attribute 'HasRepresentation'
```
2024-04-17 14:54:42 +02:00
Andrej730 ecc8832c46 typing and small refactor 2024-04-17 14:54:42 +02:00
Andrej730 dbff0e51aa Blender 4.1 - fix errors due to renamed type manager icon 2024-04-17 14:54:42 +02:00
FabioPiccinini 8464fb5aad Update sample.css (#4459)
Changed unescaped ; with , because it may cause problems if the style is included in svg
2024-04-17 14:54:42 +02:00
FabioPiccinini e3f66981e7 Unescaped ; was causing problems in Inkscape (#4456)
* Update default.css

An unescaped ; was causing problems when opening svgs that included this style with Inkscape

* Update default.css
2024-04-17 14:54:42 +02:00
Andrej730 a29fbb6239 bump ifc version #4174 2024-04-17 14:54:42 +02:00
Andrej730 ac191ac71d typing 2024-04-17 14:54:42 +02:00
Andrej730 afbf001694 grammar 😬 2024-04-17 14:54:42 +02:00
Andrej730 11bf227730 Clarifying info message saving guids to the text inside .blend #4446
Example - https://i.imgur.com/YtuQ9YA.png
2024-04-17 14:54:42 +02:00
Andrej730 860eb054d1 black format 2024-04-17 14:54:42 +02:00
Andrej730 489e92da4e typing 2024-04-17 14:54:42 +02:00
Andrej730 bae58e517a bim.select_similar_type optimization
1) avoid selecting elements of the same type multiple times
2) iterate over occurrences of the type rather than visible objects, as it's usually smaller amount of objects
2024-04-17 14:54:42 +02:00
Andrej730 ef3d61e6c1 make spatial elements unselectable from viewport by default
It seems most of the time they only get in the way trying to select some objects at scene origin.

fyi @theoryshaw
2024-04-17 14:54:42 +02:00
Andrej730 acafc910f7 typing 2024-04-17 14:54:42 +02:00
Andrej730 a511be18a8 unload decorations on unlinking ifc file 2024-04-17 14:54:42 +02:00
Andrej730 a656d32e56 fix issue with removing collections and scenes unlinking .ifc
it couldn't find linked collections and scenes since it was comparing `filepath` from `props.links` (.ifc file) and collection.library.filepath (which is .blend file)
2024-04-17 14:54:42 +02:00
Andrej730 a1f5c84ec2 hide "no object selected" label when there are no linked ifc files 2024-04-17 14:54:42 +02:00
Andrej730 ed53f58ae7 Remove appending occurrences from library in favor of fcaac6b 2024-04-17 14:54:42 +02:00
Andrej730 89114f4f65 Append IfcElements from linked IFC files
Example - https://imgur.com/a/phPcKSo

Appending ifc elements from library files will be deprecated as it's much more limited than appending it from linked files (in library you can only see object's name).
2024-04-17 14:54:42 +02:00
Andrej730 0bd52e2431 collector.sync note 2024-04-17 14:54:42 +02:00
Andrej730 bf770ce8d4 typing 2024-04-17 14:54:41 +02:00
Andrej730 8c028827fa Fix for loading IFC files with non-IfcElement based IfcRelNests
Example is below, it was using IfcAlignment to aggregate IfcAnnotations and IfcReferents.

I've added support loading collections for IfcPositioningElements besides IfcGrid (grids already handled separately).

https://community.osarch.org/discussion/2034/ifc-not-visible-after-loaded-in-blender-bim
2024-04-17 14:54:41 +02:00
Andrej730 588a946fde typing 2024-04-17 14:54:41 +02:00
M!l!nd 596e63e7e7 fixed qsets to display separately (#4423)
* fixed qsets to display separately

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>

* updated data.py and run black formattor

---------

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>
2024-04-17 14:54:41 +02:00
Ryan Schultz 5bacf70727 small fix to cdd332d1ee, for clarity 2024-04-17 14:54:41 +02:00
Ryan Schultz 24e1c70d5a fixes #4434 2024-04-17 14:54:41 +02:00
Andrej730 16fa8573d3 fix error loading representation without styles
If current representation didn't had any styles, only a material and it was failing during `assign_material_slots_to_faces` since it was looking for blender material only in self.styles and not in self.materials.

Note: `assign_material_slots_to_faces` is not skipped since `parse_representations` returns `True` because other representation has a style and it's added to the materials.
2024-04-17 14:48:57 +02:00
Andrej730 f7f828f70c python code style docs 2024-04-17 14:46:07 +02:00
Andrej730 144ef8821a fix bug after 8291a0ca6 2024-04-17 14:46:07 +02:00
Andrej730 6bb507dfc0 viewport decorations for IfcAnnotation/MULTI_SYMBOL 2024-04-17 14:46:07 +02:00
Andrej730 7ff2f56f46 common method for getting annotation symbol 2024-04-17 14:46:06 +02:00
Andrej730 6ff721f5af Indicate rotated/scaled symbols in viewport 2024-04-17 14:46:06 +02:00
Andrej730 4b634b91ac Support for rotated and scaled symbols with IfcAnnotation/SYMBOL
See: https://community.osarch.org/discussion/2027/bbim-rotation-of-ifcsymbol
2024-04-17 14:46:06 +02:00
Andrej730 fad51eb388 black format 2024-04-17 14:46:06 +02:00
Andrej730 886467dfd6 typing 2024-04-17 14:46:06 +02:00
Andrej730 914dd031bd indicate IfcText symbol rotation in viewport 2024-04-17 14:46:06 +02:00
Andrej730 dd1978d61d BBIM IfcTester - option to generate ODS report
https://i.imgur.com/0JyXVK6.png
2024-04-17 14:46:06 +02:00
Andrej730 6873c21d27 Fix #4421
1) Excluded annotations from other drawings that user might accidentally include in IfcAnnotation
2) Excluded from EPset_Drawing.Include to avoid getting there other element types besides spaces
2024-04-17 14:46:06 +02:00
Andrej730 96cc24c820 typing 2024-04-17 14:46:06 +02:00
Andrej730 6eeac88e1c small fixes 2024-04-17 14:46:06 +02:00
Andrej730 0cf8574e1f spatial.workspace - add hotkeys using add_layout_hotkey 2024-04-17 14:46:06 +02:00
Andrej730 78fb986f0b bim.decorate_boundaries to decorate all boundaries in the scene
It's added as alt+v hotkey in Spatial Tool
Now it's possible to combine it with bim.load_project_space_boundaries to show decorations for all the boundaries or to keep the boundaries after Alt+B and just disable the decorations.

example - https://imgur.com/a/ecbPz13
2024-04-17 14:46:06 +02:00
Andrej730 a265a41ebe Fix issue with drawing same boundaries multiple times
If you'd hit alt+b in space tool multiple times it would redraw them again and again instead of switching between hiding and showing.
2024-04-17 14:46:06 +02:00
Andrej730 998b4a0565 model.space.py - small fixes 2024-04-17 14:46:06 +02:00
Andrej730 9852e4fa54 BBIM - option to append occurrences from the other ifc files
Example - https://imgur.com/a/yASjbs8
2024-04-17 14:46:06 +02:00