Beispiel #1
0
 def _loadVsBlocks(self, staticBlocks):
     for staticBlock in staticBlocks:
         vsBlock = ObjProperties().getObjByPropVal(
             'visual_block', staticBlock['block_number'],
             self.scene.objectsInactive)
         self.scene.addObject(vsBlock)
         vsBlock = self.scene.objects[str(vsBlock)]
         vsBlock.visible = False
         vsBlock.position = staticBlock.position
         vsBlock.setParent(staticBlock, False, False)
Beispiel #2
0
def _attachBg(targetObj, col, sceneName, visible=True):
    from objproperties import ObjProperties
    from scene_helper import Scene

    scene = Scene(sceneName).getscene()
    bg = ObjProperties().getPropObjGroup('background_view', scene, 0)[0]
    bg['target_obj'] = str(targetObj)
    bg.visible = visible
    bg.color = col
    scene.addObject(bg)
    bg = ObjProperties().getObjByPropVal('target_obj', str(targetObj),
                                         scene.objects)
    bg.position = targetObj.position
    # push it back alittle
    bg.position[2] -= 0.4
    bg.setParent(targetObj)