mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 21:53:40 +00:00
typing
This commit is contained in:
@@ -16,8 +16,20 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import annotations
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
def purge_unused_profiles(ifc, profile):
|
||||
if TYPE_CHECKING:
|
||||
import bpy
|
||||
import ifcopenshell
|
||||
import blenderbim.tool as tool
|
||||
|
||||
|
||||
def purge_unused_profiles(ifc: tool.Ifc, profile: tool.Profile) -> int:
|
||||
"""Purge profiles that have no invserses.
|
||||
|
||||
:return: Number of removed profiles.
|
||||
"""
|
||||
purged_profiles = 0
|
||||
for element_profile in profile.get_model_profiles():
|
||||
if ifc.get().get_total_inverses(element_profile) > 0:
|
||||
|
||||
@@ -52,6 +52,17 @@ class Blender(blenderbim.core.tool.Blender):
|
||||
OBJECT_TYPES_THAT_SUPPORT_EDIT_GPENCIL_MODE = ("GPENCIL",)
|
||||
TYPE_MANAGER_ICON = "LIGHTPROBE_VOLUME" if bpy.app.version >= (4, 1, 0) else "LIGHTPROBE_GRID"
|
||||
|
||||
BLENDER_ENUM_ITEM = Union[tuple[str, str, str], tuple[str, str, str, str], tuple[str, str, str, str, str]]
|
||||
"""
|
||||
Options:
|
||||
|
||||
- (identifier, name, description)
|
||||
|
||||
- (identifier, name, description, number)
|
||||
|
||||
- (identifier, name, description, icon, number)
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def activate_camera(cls, obj: bpy.types.Object) -> None:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user