Example #1
0
	def bakeImagePlane(self):
		# find the camera related with the selected image plane in the ui and select it
		camName = ((self.ui.cb_imagePlanes.currentText()).split("->")[0].replace("Shape", ""))
		cmds.select(camName)

		# convert to geometry card
		mel.eval('source "/jobs/layout_dept/tools/maya/geoCardFromImgPlane.mel";')
		mel.eval('geoCardFromImgPlane_doIt("' + self.ui.cb_imagePlanes.currentText() + '");')

		# disable the image plane to leave only the geo card visible
		cmds.setAttr((self.ui.cb_imagePlanes.currentText() + ".displayMode"), lock=False)
		cmds.setAttr((self.ui.cb_imagePlanes.currentText() + ".displayMode"), 0)

		# get the baked planes and apply to them a surface shader
		bakedPlanes = cmds.ls( 'imagePlaneGeoCardBaked*', transforms=True)
		shader.applySurfaceBackgroundShader(bakedPlanes, self.ui.cb_imagePlanes.currentText())
Example #2
0
	def applySurfaceShader(self):
		jobObjects = self.getCurrentSelection()

		if len(jobObjects) > 0:
			shader.applySurfaceBackgroundShader(jobObjects, self.ui.cb_imagePlanes.currentText())