示例#1
0
    def remove(self, objs):
        """Remove a world object from the simulation.

        \param objs World objects to be simulated (given as names or objects)
        """
        #~ print "Removing...", objs
        objs = cmds.worldObjects(objs)
        for obj in objs:
            #~ print obj.name
            self._remove(obj)
示例#2
0
    def remove(self, objs):
        """Remove a world object from the simulation.

        \param objs World objects to be simulated (given as names or objects)
        """
        #~ print "Removing...", objs
        objs = cmds.worldObjects(objs)
        for obj in objs:
            #~ print obj.name
            self._remove(obj)
示例#3
0
def remove(objs):
    objs = cmds.worldObjects(objs)
    
    for o in objs:
        for c in o.iterChilds():
            remove(c)
        for s in getScene().items:
            if type(s) == ODEDynamics:
                try: s.remove(o)
                except: pass
            if type(s) == cgkit._core.WorldObject:
                try: s.removeChild(o)
                except: pass
示例#4
0
def remove(objs):
    objs = cmds.worldObjects(objs)

    for o in objs:
        for c in o.iterChilds():
            remove(c)
        for s in getScene().items:
            if type(s) == ODEDynamics:
                try:
                    s.remove(o)
                except:
                    pass
            if type(s) == cgkit._core.WorldObject:
                try:
                    s.removeChild(o)
                except:
                    pass
示例#5
0
    def add(self, objs, categorybits=None, collidebits=None):
        """Add a world object to the simulation.

        \param objs World objects to be simulated (given as names or objects)
        """
        objs = cmds.worldObjects(objs)
        for obj in objs:
            if obj.mass <= 0 and not isinstance(obj, cgkit.odedynamics.ODEJointBase):
                print "Using default mass=1 for " + str(obj)
                obj.mass = 1
            self._add(obj, categorybits, collidebits)
            if obj in self.body_dict:
                obj.odebody = self.body_dict[obj].odebody
                obj.odegeoms = self.body_dict[obj].odegeoms 
                manip = self.createBodyManipulator(obj)
                if manip != None:
                    obj.manip = manip
示例#6
0
    def add(self, objs, categorybits=None, collidebits=None):
        """Add a world object to the simulation.

        \param objs World objects to be simulated (given as names or objects)
        """
        objs = cmds.worldObjects(objs)
        for obj in objs:
            if obj.mass <= 0 and not isinstance(
                    obj, cgkit.odedynamics.ODEJointBase):
                print "Using default mass=1 for " + str(obj)
                obj.mass = 1
            self._add(obj, categorybits, collidebits)
            if obj in self.body_dict:
                obj.odebody = self.body_dict[obj].odebody
                obj.odegeoms = self.body_dict[obj].odegeoms
                manip = self.createBodyManipulator(obj)
                if manip != None:
                    obj.manip = manip