Skip to content

Commit

Permalink
fix for no customObject input
Browse files Browse the repository at this point in the history
  • Loading branch information
shirubana committed Sep 20, 2022
1 parent ca12fae commit d5e67e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bifacial_radiance/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2282,7 +2282,7 @@ def appendtoScene(self, radfile=None, customObject=None):
#TODO: Add a custom name and replace radfile name

# py2 and 3 compatible: binary write, encode text first
text2 = '\n !xform -rx 0 ' + customObject
text2 = '\n!xform -rx 0 ' + customObject

debug = False
if debug:
Expand Down
9 changes: 5 additions & 4 deletions bifacial_radiance/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,13 @@ def runModelChain(simulationParamsDict, sceneParamsDict, timeControlParamsDict=N
omegaParams=omegaParamsDict,
cellModule=cellModule, **kwargs)

customObject = None

if "customObject" in sceneParamsDict:
if sceneParamsDict["customObject"] is not None:
customObject = sceneParamsDict['customObject']
print("Custom Object Found, will be added to all Scenes.")
else:
customObject = None
if sceneParamsDict["customObject"] != '':
customObject = sceneParamsDict['customObject']
print("Custom Object Found, will be added to all Scenes.")

if 'gcr' not in sceneParamsDict: # didn't get gcr passed - need to calculate it
sceneParamsDict['gcr'] = module.sceney / \
Expand Down

0 comments on commit d5e67e3

Please sign in to comment.