Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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