本文整理汇总了Python中GameLogic.setLogicTicRate方法的典型用法代码示例。如果您正苦于以下问题:Python GameLogic.setLogicTicRate方法的具体用法?Python GameLogic.setLogicTicRate怎么用?Python GameLogic.setLogicTicRate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameLogic
的用法示例。
在下文中一共展示了GameLogic.setLogicTicRate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: path
# 需要导入模块: import GameLogic [as 别名]
# 或者: from GameLogic import setLogicTicRate [as 别名]
# Add system Python path (required for Blender from ubuntu repositories):
sys.path.append("/usr/lib/python%d.%d/site-packages" % (
sys.version_info.major, sys.version_info.minor))
sys.path.append("/usr/lib/python%d.%d/dist-packages" % (
sys.version_info.major, sys.version_info.minor))
import numpy as np
import xinput
import gnoomutils as gu
if init:
GameLogic.Object = {}
print("BLENDER: GameLogic object created")
GameLogic.Object['closed'] = False
GameLogic.setLogicTicRate(100)
mice = xinput.find_mice(model="G500")
for mouse in mice:
# xinput.set_owner(mouse) # Don't need this if using correct udev rule
xinput.switch_mode(mouse)
blenderpath = GameLogic.expandPath('//')
for mouseno in range(0, len(mice), 2):
s1, conn1, addr1, p1 = \
gu.spawn_process("\0mouse%dsocket" % int(mouseno/2),
['%s/evread/readout' % blenderpath, '%d' % mice[mouseno].evno, '%d' % (mouseno/2)])
conn1.send(b'start')
示例2: print
# 需要导入模块: import GameLogic [as 别名]
# 或者: from GameLogic import setLogicTicRate [as 别名]
try:
GameLogic.Object
init = 0
except:
init = 1
blenderpath = GameLogic.expandPath('//')
if init:
print(blenderpath)
GameLogic.Object = {}
print("BLENDER: GameLogic object created")
GameLogic.Object['closed'] = False
GameLogic.setLogicTicRate(60)
mice = xinput.find_mice(model="Mouse")
m = [mice[0],mice[1]]
for mouse in m:
xinput.set_owner(mouse) # Don't need this if using correct udev rule
xinput.switch_mode(mouse)
if len(mice):
s1, conn1, addr1, p1 = \
gu.spawn_process("\0mouse0socket",
['%s/evread/readout' % blenderpath, '%d' % mice[0].evno, '0'])
s2, conn2, addr2, p2 = \
gu.spawn_process("\0mouse1socket",
['%s/evread/readout' % blenderpath, '%d' % mice[1].evno, '1'])
示例3: file
# 需要导入模块: import GameLogic [as 别名]
# 或者: from GameLogic import setLogicTicRate [as 别名]
# set available Action Units from the blender file (Blender Shape Actions)
cont = G.getCurrentController()
owner = cont.owner
acts = [act for act in cont.actuators if
not act.name.startswith('-') and act.action]
check_defects(owner, acts)
# all properties must be set to the face mesh.
# TODO: p26 is copied on the 'jaw' bone too, use the one from face mesh.
G.server[FACE].set_available_AUs([n[1:] for n in owner.getPropertyNames()])
# ok, startup
G.initialized = True
G.setMaxLogicFrame(1) # relative to rendering
G.setLogicTicRate(MAX_FPS)
import Rasterizer
# Rasterizer.enableMotionBlur( 0.65)
Rasterizer.setBackgroundColor([.0, .0, .0, 1.0])
print "Material mode:", ['TEXFACE_MATERIAL','MULTITEX_MATERIAL ','GLSL_MATERIAL '][Rasterizer.getMaterialMode()]
G.last_update_time = time.time()
return cont
def update(faceServer, time_diff):
"""
"""
global INFO_PERIOD
cont = G.getCurrentController()
eyes_done = False