Beispiel #1
0
	def setPlatePath(self, path):
		"""
			TODO: This is currently only handling FileSequence paths defined by the cross3d.FileSequence class.
				  It does not support static images or movies.
		"""
		fs = FileSequence(path)
		start = fs.start()
		end = fs.end()

		# Example: S:\\Deadpool\\Footage\\Sc000\\S0000.00\\Plates\\Sc000_S0000.00.[100..190;4].jpg
		fileName = '%s%s[%i..%i;%i].%s' % (fs.baseName(), fs.separator(), start, end, fs.padding(), fs.extension())
		path = os.path.join(fs.basePath(), fileName)
		clip = xsi.Dictionary.GetObject('Clips.%s_Plate' % self.name(), False)
		if not clip:
			clip = xsi.SICreateImageClip2(path, '%s_Plate' % self.name())(0)
		else:
			clip.Source.FileName.Value = path

			# TODO: Do not get why this does not work!
			# clip.TimeControl.clipin = start
			# clip.TimeControl.clipout= end
			# clip.TimeControl.startoffset = start

			xsi.setValue('%s.timectrl.clipin' % clip.FullName, start)
			xsi.setValue('%s.timectrl.clipout' % clip.FullName, end)
			xsi.setValue('%s.timectrl.startoffset' % clip.FullName, start)

		xsi.SetValue("%s.rotoscope.imagename" % self.name(), clip.FullName, "")
		return False
Beispiel #2
0
	def setFrustrumPlaneImagePath(self, name, imagePath, offset=0.0, speed=1.0):

		# Conforming the name. Non supported Softimage character will become underscores.
		name = application.conformObjectName(name)
		clip = xsi.Dictionary.GetObject('Clips.%s' % name, False) or xsi.SICreateImageClip2(imagePath, name)(0)

		# Figuring out if we have an image or a file sequence.
		if FileSequence.isValidSequencePath(imagePath):
			fs = FileSequence(imagePath)
			template = '{}{}[{}..{};{}].{}'
			baseName = template.format(fs.baseName(), fs.separator(), fs.start(), fs.end(), fs.padding(), fs.extension())
			clip.Source.FileName.Value = os.path.join(fs.basePath(), baseName)
			xsi.setValue('%s.timectrl.clipin' % clip.FullName, fs.start())
			xsi.setValue('%s.timectrl.clipout' % clip.FullName, fs.end())
			xsi.setValue('%s.timectrl.startoffset' % clip.FullName, fs.start() + offset)
			xsi.setValue('%s.timectrl.scale' % clip.FullName, speed)

		else:
			clip.Source.FileName.Value = imagePath
			xsi.setValue('%s.timectrl.startoffset' % clip.FullName, offset)
			xsi.setValue('%s.timectrl.scale' % clip.FullName, speed)

		# Finally returning the clip object.
		return clip
Beispiel #3
0
	def setNearClippingPlane(self, distance):
		xsi.setValue(self.name() + '.camera.near', distance)
		#self._nativePointer.Parameters( 'near' ).Value = distance
		return True
Beispiel #4
0
	def setPictureRatio(self, pictureRatio):
		xsi.setValue(self.name() + '.camera.aspect', pictureRatio)
		#self._nativePointer.Parameters( 'aspect' ).Value = pictureRatio
		return True