Sunday, August 27, 2017

Print Infos Warnings Debug that is better than print

Print 'Done'. print 'value is 10'.. so many prints and those make script slow and take long to clean up once we done debugging. So i've been going slowly to other, I find better solutions to debugging and showing infos to unser.

>>> 1  Showing infos to user.
There are three types of infos we can print directly into the Maya Status Line. So User has no need to open script editor to see the note.

pm.error('This will be printed as error in in Status line')
pm.warning('This will be printed as warning in in Status line')
pm.displayInfo('This will be printed as info in in Status line')


>>> 2. Debugging
Logging is great because we can choose between different levels and can turn them off/on for the entire file by modifying one line

# set up
_logger = logging.getLogger(__name__)

# set level
logging.basicConfig(level=logging.INFO)


# throughout the script - logg

_logger.warning('There is a odd value returned %s'%value)

_logger.info('IK switch0isfk is %s'%switch0isfkTfb        )

_logger.debug('snapping slaveDup')

# to turn / on

logger.disabled = False




LevelWhen it’s used
DEBUGDetailed information, typically of interest only when diagnosing problems.
INFOConfirmation that things are working as expected.
WARNINGAn indication that something unexpected happened, or indicative of some problem in the near future (e.g. ‘disk space low’). The software is still working as expected.
ERRORDue to a more serious problem, the software has not been able to perform some function.
CRITICALA serious error, indicating that the program itself may be unable to continue running.

Maya 2018 Auto Retopo Function

I just found this handy hidden function in Maya 2018 to turn your Mesh into even Quads or Triangles. // MEL //  turn selected mesh int...