コード例 #1
0
 def saveCurrentLightProperty(self, propSet):
     for obj in self._nativeObjects():
         if mxs.classOf(obj) == mxs.VRayLight:
             if propSet.value('primaryVisibility'):
                 so = SceneObject(self._scene, obj)
                 so.userProps()['previousInvisibleState'] = obj.invisible
                 obj.invisible = True
コード例 #2
0
    def objects(self):
        """Return a list of the objects that are part of this layer group

		:return: list of :class:`cross3d.SceneObject`'s

		"""
        from cross3d import SceneObject
        return [SceneObject(self._scene, obj) for obj in self._nativeObjects()]
コード例 #3
0
ファイル: mayascene.py プロジェクト: tws0002/cross3d
	def _objects(self, getsFromSelection=False, wildcard='', type=0):
		""" Returns a list of all the objects in the scene wrapped as api objects
			:param: getsFromSelection <bool>
			:param: wildcard <string>
			:param: type <cross3d.constants.ObjectType>
			:return: <list> [ <cross3d.Variant>, .. ]
		"""
		from cross3d import SceneObject
		return [SceneObject(self, obj) for obj in self._nativeObjects(getsFromSelection, wildcard, type) if obj.apiType() != om.MFn.kWorld]
コード例 #4
0
ファイル: abstractcontainer.py プロジェクト: tws0002/cross3d
    def objects(self):
        """
		Returns the SceneObject's that are associated with this object group
		
		:return: a list of :class:`cross3d.SceneObject` objects
		
		"""
        from cross3d import SceneObject
        return [SceneObject(self._scene, obj) for obj in self._nativeObjects()]
コード例 #5
0
    def parent(self):
        """
			Returns the parent item for this object	
			:return: :class:`cross3d.SceneObject` or None
		"""
        nativeParent = self._nativeParent()
        if (nativeParent):
            from cross3d import SceneObject
            return SceneObject(self._scene, nativeParent)
        return None
コード例 #6
0
    def childAt(self, index):
        """Returns the child at a particular index for this object
		
		:return: :class:`cross3d.SceneObject` or None
		
		"""
        nativeChildren = self._nativeChildren()
        if (0 <= index and index < len(nativeChildren)):
            return SceneObject(self._scene, nativeChildren[index])
        return None
コード例 #7
0
    def objects(self):
        """The objects that are using this material.

		Returns:
			list: The list of `cross3d.SceneObject`s using this material.
		"""
        from cross3d import SceneObject
        return [
            SceneObject(self._scene, o) for o in self._nativeObjects() if o
        ]
コード例 #8
0
    def model(self):
        """Returns the SceneObject that is the model for this object
		
		:return: :class:`cross3d.SceneObject` or None

		"""
        nativeModel = self._nativeModel()
        if (nativeModel):
            from cross3d import SceneObject
            return SceneObject(self._scene, nativeModel)
        return None
コード例 #9
0
    def findChild(self, name, recursive=False):
        """
		Loops through the children for this object searching for the 
		proper one

		:return: :class:`cross3d.SceneObject` or None

		"""
        nativeChild = self._findNativeChild(name, recursive=recursive)
        if (nativeChild):
            from cross3d import SceneObject
            return SceneObject(self._scene, nativeChild)
        return None
コード例 #10
0
    def children(self, recursive=False, wildcard='', type=''):
        """Returns SceneObject wrappers over the children for this object
		
		:param recursive: If True, will recursively traverse child tree
		:param wildcard: ?
		:type wildcard: str
		:param type: ?
		:type type: str
		:return: list of :class:`cross3d.SceneObject` objects

		"""
        from cross3d import SceneObject
        scene = self._scene
        return [
            SceneObject(scene, native)
            for native in self._nativeChildren(recursive, wildcard, type)
        ]
コード例 #11
0
    def dispatchEvent(self, signal, *args):
        print 'Dispatching event', signal
        if (self.signalsBlocked()):
            return

        # emit a defined pyqtSignal
        if (hasattr(Dispatch, signal) and type(getattr(
                Dispatch, signal)).__name__ == 'pyqtBoundSignal'):
            # this should identify the object type before emiting it if it needs to emit something
            getattr(Dispatch,
                    signal).emit(SceneObject(Scene.instance(), args[0]))

        # elif process application specific signals like xsi's value changed

        # otherwise emit a custom signal
        else:
            from PyQt4.QtCore import SIGNAL
            self.emit(SIGNAL(signal), *args)

        # emit linked signals
        if (signal in self._linkedSignals):
            for trigger in self._linkedSignals[signal]:
                self.dispatch(trigger)
コード例 #12
0
 def objects(self, wildcard='*', type=0):
     return [
         SceneObject(self._scene, nativeObject)
         for nativeObject in self._nativeObjects(wildcard=wildcard,
                                                 type=type)
     ]
コード例 #13
0
 def constrainingObjects(self):
     from cross3d import SceneObject
     return [
         SceneObject(self._scene, nativeObject)
         for nativeObject in self._constrainingNativeObjects()
     ]