bulletbase.py
def connect(self, args=None): # {{{1
    "Start the shared memory server and GUI client"
    # Collect arguments to pass to connect()
    def parseArgObj(argobj):
      if isinstance(argobj, basestring):
        return argobj.split()
      elif argobj:
        return argobj
      return []
    cargs = []
    cargs.extend(parseArgObj(self._connectArgs))
    cargs.extend(parseArgObj(args))
    cargs = " ".join(cargs)

    # Start and connect to server
    logger.debug("Starting GUI server: {}".format(cargs))
    self._server = p.connect(p.GUI_SERVER, options=cargs)
    p.setInternalSimFlags(0)
    if pyb3.HAS_PYB3_DATA:
      p.setAdditionalSearchPath(pyb3.pybullet_data.getDataPath())

    if self._plugins:
      for plugin in self._plugins:
        if ":" in plugin:
          path, prefix = plugin.split(":", 1)
        else:
          path, prefix = plugin, ""
        self._loadedPlugins[path] = p.loadPlugin(path, prefix)

    # Add standard debug config sliders
    self.addSlider("Gravity X", -20, 20, self._defaultGravity["x"])
    self.addSlider("Gravity Y", -20, 20, self._defaultGravity["y"])
    self.addSlider("Gravity Z", -20, 20, self._defaultGravity["z"])
Start the shared memory server and GUI client
Start the shared memory server and GUI client
Start the shared memory server and GUI client
def connect(self, args=None): 
    def parseArgObj(argobj):
      if isinstance(argobj, basestring):
        return argobj.split()
      elif argobj:
        return argobj
      return []
    cargs = []
    cargs.extend(parseArgObj(self._connectArgs))
    cargs.extend(parseArgObj(args))
    cargs = " ".join(cargs)
    logger.debug("Starting GUI server: {}".format(cargs))
    self._server = p.connect(p.GUI_SERVER, options=cargs)
    p.setInternalSimFlags(0)
    if pyb3.HAS_PYB3_DATA:
      p.setAdditionalSearchPath(pyb3.pybullet_data.getDataPath())
    if self._plugins:
      for plugin in self._plugins:
        if ":" in plugin:
          path, prefix = plugin.split(":", 1)
        else:
          path, prefix = plugin, ""
        self._loadedPlugins[path] = p.loadPlugin(path, prefix)
    self.addSlider("Gravity X", -20, 20, self._defaultGravity["x"])
    self.addSlider("Gravity Y", -20, 20, self._defaultGravity["y"])
    self.addSlider("Gravity Z", -20, 20, self._defaultGravity["z"])
def connect ( self , args = None ) : def parseArgObj ( argobj ) : if isinstance ( argobj , basestring ) : return argobj . split ( ) elif argobj : return argobj return [ ] cargs = [ ] cargs . extend ( parseArgObj ( self . _connectArgs ) ) cargs . extend ( parseArgObj ( args ) ) cargs = " " . join ( cargs ) logger . debug ( "Starting GUI server: {}" . format ( cargs ) ) self . _server = p . connect ( p . GUI_SERVER , options = cargs ) p . setInternalSimFlags ( 0 ) if pyb3 . HAS_PYB3_DATA : p . setAdditionalSearchPath ( pyb3 . pybullet_data . getDataPath ( ) ) if self . _plugins : for plugin in self . _plugins : if ":" in plugin : path , prefix = plugin . split ( ":" , 1 ) else : path , prefix = plugin , "" self . _loadedPlugins [ path ] = p . loadPlugin ( path , prefix ) self . addSlider ( "Gravity X" , - 20 , 20 , self . _defaultGravity [ "x" ] ) self . addSlider ( "Gravity Y" , - 20 , 20 , self . _defaultGravity [ "y" ] ) self . addSlider ( "Gravity Z" , - 20 , 20 , self . _defaultGravity [ "z" ] )
Start the shared memory server and GUI client
Start the shared memory server and GUI client
# {{{1 "Start the shared memory server and GUI client" # Collect arguments to pass to connect() # Start and connect to server # Add standard debug config sliders
self
args