예제 #1
0
파일: gui.py 프로젝트: SEVEZ/skonverter
	def run_calculate_weighting_command( self ):
		target_file_path, message = PySide.QtGui.QFileDialog( ).getSaveFileName( None, 'Save Location' )
		data, message = methods.determine_weighting( self.transform, root_bone = self.root_bone, tolerance = self.tolerance )
		if not data:
			self.warning( message )
			self.file_path_field.setText( 'Data invalid' )
			return False
		
		methods.save_json( target_file_path, data )
		if os.path.exists( target_file_path ):
			self.file_path = target_file_path
			self.file_path_field.setText( target_file_path )
		
		return True
예제 #2
0
def run_skin_calculation( transform, root_bone, tolerance = -1, file_path = '' ):
	"""
	Main method call for the skin converter to calculate skin weights from the transform's shape node.
	
	Returns [ data, message ]
	Data    : skin calculation data
	Message : message about the results. If data == False, message holds more info.
	"""
	data, message = methods.determine_weighting( transform, root_bone, tolerance = tolerance )
	
	# Data is valid, so if a file path was provided too, save the data out. 
	if file_path and data:
		methods.save_json( file_path, data )

	return data, message
예제 #3
0
    def run_calculate_weighting_command(self):
        target_file_path, message = PySide.QtGui.QFileDialog().getSaveFileName(
            None, 'Save Location')
        data, message = methods.determine_weighting(self.transform,
                                                    root_bone=self.root_bone,
                                                    tolerance=self.tolerance)
        if not data:
            self.warning(message)
            self.file_path_field.setText('Data invalid')
            return False

        methods.save_json(target_file_path, data)
        if os.path.exists(target_file_path):
            self.file_path = target_file_path
            self.file_path_field.setText(target_file_path)

        return True