python 来自http://community.thefoundry.co.uk/discussion/topic.aspx?f=37&t=26551

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 来自http://community.thefoundry.co.uk/discussion/topic.aspx?f=37&t=26551相关的知识,希望对你有一定的参考价值。

No problem :) It's worth building up a library of utility functions like the above. It cuts down the amount of donkey work and repetitive coding you have to do from script to script. Here's another one you might find useful at some point, it takes an item type ( eg mask, groupLocator, mesh etc) and a name and returns the ID (or None if it doesn't exist):


def GetItemID(type, name):
    """
        Return the ID string of an item of known 'type' and 'name'
    """
    numitems = lx.eval('query sceneservice %s.N ?' % type)
    if numitems > 0:
        for x in xrange(numitems):
            if lx.eval('query sceneservice %s.name ? {%s}' % (type, x)) == name:
                return lx.eval('query sceneservice %s.ID ? {%s}' % (type, x))
            else:
                return None
    else:
        return None


you'd use it like the following:


cam_id = GetItemID('camera', 'Camera')

or 

maskID = GetItemID('mask', 'Matr: Red')

etc

以上是关于python 来自http://community.thefoundry.co.uk/discussion/topic.aspx?f=37&t=26551的主要内容,如果未能解决你的问题,请参考以下文章

WPS for Linux 2017版+字库安装

Ubuntu16.04安装WPS

Ubuntu下的svn的安装

在ROS使用自己安装的eigen时的cmake错误

在ROS使用自己安装的eigen时的cmake错误

在ROS使用自己安装的eigen时的cmake错误