コード例 #1
0
ファイル: shot_manager.py プロジェクト: UPBGE/blender-addons
def update_scene():
    sm_props = get_shot_manager()
    if sm_props is None:
        return

    current_take = shot_manager.get_current_take(sm_props)
    if current_take is None:
        return

    current_take_name = shot_manager.get_current_take_name(sm_props)

    if current_take_name != share_data.shot_manager.current_take_name:
        send_scene()
        return

    shots = shot_manager.get_shots(sm_props)
    if len(shots) != len(share_data.shot_manager.shots):
        send_scene()
        return

    for i, s in enumerate(shots):
        prev_shot = share_data.shot_manager.shots[i]
        camera_name = ""
        camera = shot.get_camera(s)
        if camera:
            camera_name = camera.name_full
        if (prev_shot.name != shot.get_name(s)
                or prev_shot.camera_name != camera_name
                or prev_shot.start != shot.get_start(s)
                or prev_shot.end != shot.get_end(s)
                or prev_shot.enabled != shot.get_enable_state(s)):
            send_scene()
            return
コード例 #2
0
ファイル: shot_manager.py プロジェクト: UPBGE/blender-addons
def get_state():
    sm_props = get_shot_manager()
    if sm_props is None:
        return

    current_take = shot_manager.get_current_take(sm_props)
    if current_take is None:
        return

    share_data.shot_manager.current_take_name = take.get_name(current_take)

    share_data.shot_manager.shots = []
    for s in shot_manager.get_shots(sm_props):
        new_shot = Shot()
        new_shot.name = shot.get_name(s)
        camera = shot.get_camera(s)
        if camera:
            new_shot.camera_name = camera.name_full
        new_shot.start = shot.get_start(s)
        new_shot.end = shot.get_end(s)
        new_shot.enabled = shot.get_enable_state(s)
        share_data.shot_manager.shots.append(new_shot)