當前位置: 首頁>>代碼示例>>Python>>正文


Python PyUtils.load方法代碼示例

本文整理匯總了Python中PyUtils.load方法的典型用法代碼示例。如果您正苦於以下問題:Python PyUtils.load方法的具體用法?Python PyUtils.load怎麽用?Python PyUtils.load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyUtils的用法示例。


在下文中一共展示了PyUtils.load方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: create

# 需要導入模塊: import PyUtils [as 別名]
# 或者: from PyUtils import load [as 別名]
    def create(self):
        """Creates the instant character based on the available description. Attach a reasonable controller, if available."""       
        app = wx.GetApp()
        
        try:
            wrappedController = PyUtils.wrapCopy( app.getController(0) )
        except IndexError:
            wrappedController = None
                
        try:
            character = app.getCharacter(0)
            previousMass = character.getMass()
        except IndexError:
            previousMass = None
        
        
        app.deleteAllObjects()
        PyUtils.load( "RigidBodies.FlatGround" )
        character = self._characterDescription.createCharacter()
        character.computeMass()
        app.addCharacter(character)

        if wrappedController is not None:
            controller = wrappedController.createAndFillObject(None, character)
            if previousMass is not None:
                massRatio = character.getMass() / previousMass
                controller.scaleGains( massRatio )
            app.addController(controller)
            controller.setStance( Core.LEFT_STANCE )
            self.connectController()
        
        return character
開發者ID:MontyThibault,項目名稱:cartwheel-3d-Research-Modifications,代碼行數:34,代碼來源:Model.py

示例2:

# 需要導入模塊: import PyUtils [as 別名]
# 或者: from PyUtils import load [as 別名]
'''
Created on 2009-11-23

@author: beaudoin
'''

import PyUtils

PyUtils.load( "RigidBodies.FiniteFlatGround" )
開發者ID:MontyThibault,項目名稱:cartwheel-3d-Research-Modifications,代碼行數:11,代碼來源:EmptyFramework.py

示例3:

# 需要導入模塊: import PyUtils [as 別名]
# 或者: from PyUtils import load [as 別名]
'''
Created on 2009-11-26

@author: beaudoin
'''

import PyUtils
import Core, wx
import Controllers

PyUtils.load( "RigidBodies.FiniteFlatGround" )
PyUtils.loadMany( "RigidBodies.DodgeBall", 5 )
character = PyUtils.load( "Characters.BipV3" )
character.computeMass();

controller = Controllers.DanceController(character)
controller.loadFromFile("../data/controllers/bipV3/fWalk_4.sbc")
#controller.loadFromFile("../data/controllers/bipV3/fWalk_3.sbc")

Core.cvar.SimGlobals_stanceKnee = 0.00
Core.cvar.SimGlobals_rootSagittal = 0.3
Core.cvar.SimGlobals_stepHeight = 0.25
Core.cvar.SimGlobals_duckWalk = 0.2
Core.cvar.SimGlobals_VDelSagittal = 2.0
Core.cvar.SimGlobals_stepTime = 0.2
#Core.cvar.SimGlobals_upperBodyTwist = 0.2

controller.initialSetup()


開發者ID:MontyThibault,項目名稱:cartwheel-3d-Research-Modifications,代碼行數:30,代碼來源:DanceFramework.py

示例4:

# 需要導入模塊: import PyUtils [as 別名]
# 或者: from PyUtils import load [as 別名]
'''
Created on 2009-08-28

@author: beaudoin
'''

import PyUtils
import Core, wx

File = "Jumping"
#File = "Running"
#File = "SideRunning"
#File = "JumpWalk"
#File = "Walking"
#File = "Turning"

#PyUtils.load( "RigidBodies.FlatGround" )
PyUtils.load( "RigidBodies.FiniteFlatGround" )
PyUtils.loadMany( "RigidBodies.DodgeBall", 5 )
character = PyUtils.load( "Characters.Bip" )
character.loadReducedStateFromFile( "Data/Characters/Bip/Controllers/%sState.rs" % File );
controller = PyUtils.load( "Characters.Bip.Controllers.%s" % File, character )
controller.setStance( Core.LEFT_STANCE );
開發者ID:MontyThibault,項目名稱:cartwheel-3d-Research-Modifications,代碼行數:25,代碼來源:BipFramework.py

示例5:

# 需要導入模塊: import PyUtils [as 別名]
# 或者: from PyUtils import load [as 別名]
'''
Created on 2009-11-26

@author: beaudoin
'''

import PyUtils
import Core, wx
import Controllers

PyUtils.load( "RigidBodies.FiniteFlatGround" )
PyUtils.loadMany( "RigidBodies.DodgeBall", 5 )
character = PyUtils.load( "Characters.BipV3" )
character.loadReducedStateFromFile( "Data/Characters/BipV3/Controllers/WalkingState.rs" );
character.computeMass();
#controller = PyUtils.load( "Characters.BipV3.Controllers.StylizedWalking", character )
controller = PyUtils.load( "Characters.BipV3.Controllers.EditableWalking", character )
controller.setStance( Core.LEFT_STANCE );

app = wx.GetApp()
worldOracle = app.getWorldOracle()
behaviour = Core.TurnController(character, controller, worldOracle)
behaviour.initializeDefaultParameters()
controller.setBehaviour(behaviour)

behaviour.requestHeading(0);
behaviour.conTransitionPlan();
開發者ID:MontyThibault,項目名稱:cartwheel-3d-Research-Modifications,代碼行數:29,代碼來源:WalkFramework.py

示例6:

# 需要導入模塊: import PyUtils [as 別名]
# 或者: from PyUtils import load [as 別名]
#from Data.Frameworks import DefaultFramework
#from Data.Frameworks import DanceFramework
#from Data.Frameworks import WalkFramework


#####################
## BEGIN Custom for Instant Character

character = instantChar.create()
#controller = PyUtils.load( "Characters.BipV3.Controllers.CartoonySneak", character )
#controller = PyUtils.load( "Characters.BipV3.Controllers.ZeroWalk", character )
#controller = PyUtils.load( "Characters.BipV3.Controllers.VeryFastWalk_5-43_0-4", character )
#controller = PyUtils.load( "Characters.BipV3.Controllers.jog_8-76_0-33", character )
#controller = PyUtils.load( "Characters.BipV3.Controllers.run_21-57_0-38_0-10", character )
#controller = PyUtils.load( "Characters.BipV3.Controllers.FastWalk_3-7_0-53", character )
controller = PyUtils.load( "Characters.BipV3.Controllers.EditableWalking", character )
#controller = PyUtils.load( "Temp.Cartoony", character )
#controller = PyUtils.load( "Temp.TipToe", character )
controller.setStance( Core.LEFT_STANCE );
instantChar.connectController(False)

#character.loadReducedStateFromFile( "Data/Characters/BipV3/Controllers/runState.rs" )

keyframeEditor = KeyframeEditor.Model()

## END
#####################

######################
## BEGIN DUMMY STUFF
開發者ID:MontyThibault,項目名稱:cartwheel-3d-Research-Modifications,代碼行數:32,代碼來源:BasicEditor.py


注:本文中的PyUtils.load方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。