mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
changed imports to integrate with blenderbim
This commit is contained in:
@@ -71,6 +71,7 @@ modules = {
|
|||||||
"covetool": None,
|
"covetool": None,
|
||||||
"augin": None,
|
"augin": None,
|
||||||
"debug": None,
|
"debug": None,
|
||||||
|
"ifcgit": None,
|
||||||
# Uncomment this line to enable loading of the demo module. Happy hacking!
|
# Uncomment this line to enable loading of the demo module. Happy hacking!
|
||||||
# The name "demo" must correlate to a folder name in `bim/module/`.
|
# The name "demo" must correlate to a folder name in `bim/module/`.
|
||||||
# "demo": None,
|
# "demo": None,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import tool
|
# import tool
|
||||||
import blenderbim.tool as btool
|
import blenderbim.tool as tool
|
||||||
|
|
||||||
|
|
||||||
def refresh():
|
def refresh():
|
||||||
@@ -35,8 +35,8 @@ class IfcGitData:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def repo(cls):
|
def repo(cls):
|
||||||
if bool(btool.Ifc.get()):
|
if bool(tool.Ifc.get()):
|
||||||
path_ifc = btool.Ifc.get_path()
|
path_ifc = tool.Ifc.get_path()
|
||||||
if not os.path.isfile(path_ifc):
|
if not os.path.isfile(path_ifc):
|
||||||
return None
|
return None
|
||||||
return tool.IfcGit.repo_from_path(path_ifc)
|
return tool.IfcGit.repo_from_path(path_ifc)
|
||||||
@@ -49,7 +49,7 @@ class IfcGitData:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def path_ifc(cls):
|
def path_ifc(cls):
|
||||||
return btool.Ifc.get_path()
|
return tool.Ifc.get_path()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def branches_by_hexsha(cls):
|
def branches_by_hexsha(cls):
|
||||||
@@ -67,8 +67,8 @@ class IfcGitData:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def name_ifc(cls):
|
def name_ifc(cls):
|
||||||
if bool(btool.Ifc.get()):
|
if bool(tool.Ifc.get()):
|
||||||
path_ifc = btool.Ifc.get_path()
|
path_ifc = tool.Ifc.get_path()
|
||||||
if tool.IfcGitRepo.repo:
|
if tool.IfcGitRepo.repo:
|
||||||
working_dir = tool.IfcGitRepo.repo.working_dir
|
working_dir = tool.IfcGitRepo.repo.working_dir
|
||||||
return os.path.relpath(path_ifc, working_dir)
|
return os.path.relpath(path_ifc, working_dir)
|
||||||
@@ -76,8 +76,8 @@ class IfcGitData:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def dir_name(cls):
|
def dir_name(cls):
|
||||||
if bool(btool.Ifc.get()):
|
if bool(tool.Ifc.get()):
|
||||||
path_ifc = btool.Ifc.get_path()
|
path_ifc = tool.Ifc.get_path()
|
||||||
if not os.path.isfile(path_ifc):
|
if not os.path.isfile(path_ifc):
|
||||||
return None
|
return None
|
||||||
return os.path.dirname(path_ifc)
|
return os.path.dirname(path_ifc)
|
||||||
@@ -85,15 +85,15 @@ class IfcGitData:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def base_name(cls):
|
def base_name(cls):
|
||||||
if bool(btool.Ifc.get()):
|
if bool(tool.Ifc.get()):
|
||||||
path_ifc = btool.Ifc.get_path()
|
path_ifc = tool.Ifc.get_path()
|
||||||
return os.path.basename(path_ifc)
|
return os.path.basename(path_ifc)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def is_dirty(cls):
|
def is_dirty(cls):
|
||||||
if tool.IfcGitRepo.repo and cls.git_exe():
|
if tool.IfcGitRepo.repo and cls.git_exe():
|
||||||
path_ifc = btool.Ifc.get_path()
|
path_ifc = tool.Ifc.get_path()
|
||||||
return tool.IfcGitRepo.repo.is_dirty(path=path_ifc)
|
return tool.IfcGitRepo.repo.is_dirty(path=path_ifc)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import bpy
|
import bpy
|
||||||
|
import blenderbim.core.ifcgit as core
|
||||||
import core
|
import blenderbim.tool as tool
|
||||||
from tool import IfcGit as tool
|
# from tool import IfcGit as tool
|
||||||
from data import IfcGitData
|
from data import IfcGitData
|
||||||
|
|
||||||
# TODO Remove all handler elements once in the correct folder structure
|
# import handler
|
||||||
import handler
|
|
||||||
|
|
||||||
import blenderbim.tool as btool
|
# import blenderbim.tool as tool
|
||||||
|
|
||||||
|
|
||||||
class CreateRepo(bpy.types.Operator):
|
class CreateRepo(bpy.types.Operator):
|
||||||
@@ -34,7 +33,7 @@ class CreateRepo(bpy.types.Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
|
||||||
core.create_repo(tool, btool.Ifc)
|
core.create_repo(tool.IfcGit, tool.Ifc)
|
||||||
handler.refresh_ui_data()
|
handler.refresh_ui_data()
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
@@ -58,7 +57,7 @@ class AddFileToRepo(bpy.types.Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
|
||||||
core.add_file(tool, btool.Ifc)
|
core.add_file(tool.IfcGit, tool.Ifc)
|
||||||
handler.refresh_ui_data()
|
handler.refresh_ui_data()
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
@@ -72,7 +71,7 @@ class DiscardUncommitted(bpy.types.Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
|
||||||
core.discard_uncomitted(tool, btool.Ifc)
|
core.discard_uncomitted(tool.IfcGit, tool.Ifc)
|
||||||
handler.refresh_ui_data()
|
handler.refresh_ui_data()
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
@@ -107,7 +106,7 @@ class CommitChanges(bpy.types.Operator):
|
|||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
|
||||||
repo = IfcGitData.data["repo"]
|
repo = IfcGitData.data["repo"]
|
||||||
core.commit_changes(tool, btool.Ifc, repo, context)
|
core.commit_changes(tool.IfcGit, tool.Ifc, repo, context)
|
||||||
handler.refresh_ui_data()
|
handler.refresh_ui_data()
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
@@ -129,7 +128,7 @@ class RefreshGit(bpy.types.Operator):
|
|||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
|
||||||
repo = IfcGitData.data["repo"]
|
repo = IfcGitData.data["repo"]
|
||||||
core.refresh_revision_list(tool, repo, btool.Ifc)
|
core.refresh_revision_list(tool.IfcGit, repo, tool.Ifc)
|
||||||
handler.refresh_ui_data()
|
handler.refresh_ui_data()
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
@@ -143,7 +142,7 @@ class DisplayRevision(bpy.types.Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
|
||||||
core.colourise_revision(tool, context)
|
core.colourise_revision(tool.IfcGit, context)
|
||||||
handler.refresh_ui_data()
|
handler.refresh_ui_data()
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
@@ -158,7 +157,7 @@ class DisplayUncommitted(bpy.types.Operator):
|
|||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
|
||||||
repo = IfcGitData.data["repo"]
|
repo = IfcGitData.data["repo"]
|
||||||
core.colourise_uncommitted(tool, btool.Ifc, repo)
|
core.colourise_uncommitted(tool.IfcGit, tool.Ifc, repo)
|
||||||
handler.refresh_ui_data()
|
handler.refresh_ui_data()
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
@@ -172,7 +171,7 @@ class SwitchRevision(bpy.types.Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
|
||||||
core.switch_revision(tool, btool.Ifc)
|
core.switch_revision(tool.IfcGit, tool.Ifc)
|
||||||
handler.refresh_ui_data()
|
handler.refresh_ui_data()
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
@@ -192,7 +191,7 @@ class Merge(bpy.types.Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
|
||||||
if core.merge_branch(tool, btool.Ifc, self):
|
if core.merge_branch(tool.IfcGit, tool.Ifc, self):
|
||||||
handler.refresh_ui_data()
|
handler.refresh_ui_data()
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import bpy
|
import bpy
|
||||||
from bpy.types import PropertyGroup
|
from bpy.types import PropertyGroup
|
||||||
|
|
||||||
from bpy.props import (
|
from bpy.props import (
|
||||||
StringProperty,
|
StringProperty,
|
||||||
BoolProperty,
|
BoolProperty,
|
||||||
@@ -8,7 +7,6 @@ from bpy.props import (
|
|||||||
IntProperty,
|
IntProperty,
|
||||||
EnumProperty,
|
EnumProperty,
|
||||||
)
|
)
|
||||||
|
|
||||||
from data import IfcGitData
|
from data import IfcGitData
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
import time
|
import time
|
||||||
from data import IfcGitData
|
from data import IfcGitData
|
||||||
|
|||||||
Reference in New Issue
Block a user