mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 05:52:33 +00:00
You can now load a project from the project panel. See commit message.
This is in preparation for partial loading and unloading for scaling up to larger IFC scenes. Similarly, there are bits in place for different collection modes instead of the hardcoded collection hierarchy which we currently have.
This commit is contained in:
@@ -78,12 +78,32 @@ def additionally_the_object_name_is_selected(name):
|
||||
|
||||
|
||||
def i_set_prop_to_value(prop, value):
|
||||
try:
|
||||
eval(f"bpy.context.{prop}")
|
||||
except:
|
||||
assert False, "Property does not exist"
|
||||
try:
|
||||
exec(f'bpy.context.{prop} = "{value}"')
|
||||
except:
|
||||
exec(f"bpy.context.{prop} = {value}")
|
||||
|
||||
|
||||
def prop_is_value(prop, value):
|
||||
is_value = False
|
||||
try:
|
||||
exec(f'assert bpy.context.{prop} == "{value}"')
|
||||
is_value = True
|
||||
except:
|
||||
try:
|
||||
exec(f"assert bpy.context.{prop} == {value}")
|
||||
is_value = True
|
||||
except:
|
||||
pass
|
||||
if not is_value:
|
||||
actual_value = eval(f"bpy.context.{prop}")
|
||||
assert False, f"Value is {actual_value}"
|
||||
|
||||
|
||||
def i_enable_prop(prop):
|
||||
exec(f"bpy.context.{prop} = True")
|
||||
|
||||
@@ -222,6 +242,7 @@ definitions = {
|
||||
'the object "(.*)" is selected': the_object_name_is_selected,
|
||||
'additionally the object "(.*)" is selected': additionally_the_object_name_is_selected,
|
||||
'I set "(.*)" to "(.*)"': i_set_prop_to_value,
|
||||
'"(.*)" is "(.*)"': prop_is_value,
|
||||
'I enable "(.*)"': i_enable_prop,
|
||||
'I press "(.*)"': i_press_operator,
|
||||
'the object "(.*)" is an "(.*)"': the_object_name_is_an_ifc_class,
|
||||
|
||||
Reference in New Issue
Block a user