Ejemplo n.º 1
0
def default_click_callback( user=UserProxy, ob=BlenderProxy ):
	print('select callback', user, ob)
	w = api_gen.get_wrapped_objects()[ ob ]
	view = w( user )
	view['selected'] = time.time()  ## allow multiple selections, the server can filter to most recent to.
	if 0:
		view['location'] = list( ob.location.to_tuple() )
		#view['location'] = Animation( seconds=3.0, y=-5.0) # TODO relative and absolute
		view['location'] = Animations(
			Animation( seconds=3.0, y=-5.0),
			Animation( seconds=3.0, y=5.0),
			Animation( seconds=3.0, z=1.0),
			Animation( seconds=3.0, z=-1.0),
		)
		view['rotation_euler'] = list( ob.rotation_euler )
		view['rotation_euler'] = Animations(
			Animation( seconds=3.0, x=-5.0),
			Animation( seconds=3.0, x=5.0),
		)
		view().on_click = api_gen.get_callback( 'next1')
Ejemplo n.º 2
0
def default_click_callback(user=UserProxy, ob=BlenderProxy):
    print('select callback', user, ob)
    w = api_gen.get_wrapped_objects()[ob]
    view = w(user)
    view['selected'] = time.time(
    )  ## allow multiple selections, the server can filter to most recent to.
    if 0:
        view['location'] = list(ob.location.to_tuple())
        #view['location'] = Animation( seconds=3.0, y=-5.0) # TODO relative and absolute
        view['location'] = Animations(
            Animation(seconds=3.0, y=-5.0),
            Animation(seconds=3.0, y=5.0),
            Animation(seconds=3.0, z=1.0),
            Animation(seconds=3.0, z=-1.0),
        )
        view['rotation_euler'] = list(ob.rotation_euler)
        view['rotation_euler'] = Animations(
            Animation(seconds=3.0, x=-5.0),
            Animation(seconds=3.0, x=5.0),
        )
        view().on_click = api_gen.get_callback('next1')
Ejemplo n.º 3
0
def next2(user=UserProxy, ob=BlenderProxy):
    print('next click callback2')
    w = api_gen.get_wrapped_objects()[ob]
    view = w(user)
    view['color'] = [0, 1, 1, 1]
    view().on_click = api_gen.get_callback('next3')
Ejemplo n.º 4
0
def next2( user=UserProxy, ob=BlenderProxy ):
	print('next click callback2')
	w = api_gen.get_wrapped_objects()[ ob ]
	view = w( user )
	view['color'] = [0,1,1, 1]
	view().on_click = api_gen.get_callback( 'next3')