def toggleLayerVisibility(level, context): hide = not level.visible parent = getModelParent(context) if not parent: return # find the related level parent Blender object for o in parent.children: if "level" in o and o["level"] == level.index: toggleObjectVisibility(o, hide)
def updateHeight(bundle, context): # update height and position for all levels prk = context.scene.prk # build a dictionary of all level parents up levels = {} parent = getModelParent(context) for o in parent.children: if "level" in o: levels[o["level"]] = o elif "h" in o: totalHeight = o h = 0. update = False for l in prk.levels: if update and l.index in levels: levels[l.index].location.z = h else: update = True h += prk.levelBundles[l.bundle].height totalHeight.location.z = h