本文整理汇总了Python中ueCore.AssetUtils.getGroup方法的典型用法代码示例。如果您正苦于以下问题:Python AssetUtils.getGroup方法的具体用法?Python AssetUtils.getGroup怎么用?Python AssetUtils.getGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ueCore.AssetUtils
的用法示例。
在下文中一共展示了AssetUtils.getGroup方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createGroup
# 需要导入模块: from ueCore import AssetUtils [as 别名]
# 或者: from ueCore.AssetUtils import getGroup [as 别名]
def createGroup(spec, grpType="default", dbMeta={}):
group = ueAssetUtils.getGroup(spec)
if group:
return group
group["name"] = spec.grp
group["group_type"] = grpType
group["created_by"] = getpass.getuser()
for m in dbMeta:
group[m] = dbMeta[m]
ueClient.client.saveGroup(spec, group)
return ueAssetUtils.getGroup(spec)
示例2: printInfo
# 需要导入模块: from ueCore import AssetUtils [as 别名]
# 或者: from ueCore.AssetUtils import getGroup [as 别名]
def printInfo():
if "spec" not in info:
print "ERROR: Spec not set"
sys.exit(2)
spec = ueSpec.Spec(info["spec"])
if spec.grp == None:
# Project info
assetType = "project"
assetInfo = ueAssetUtils.getProject(spec)
elif spec.asst == None:
# Group info
assetType = "group"
assetInfo = ueAssetUtils.getGroup(spec)
elif spec.elclass == None and \
spec.eltype == None and \
spec.elname == None:
# Asset info
assetType = "asset"
assetInfo = ueAssetUtils.getAsset(spec)
elif spec.vers == None:
# Element info
assetType = "element"
assetInfo = ueAssetUtils.getElement(spec)
assetInfo = assetInfo[spec.elclass][spec.eltype][spec.elname]
elif spec.elpass == None:
# Version info
assetType = "version"
assetInfo = ueAssetUtils.getVersions(spec)[int(spec.vers)-1]
else:
print "ERROR: Could not identify spec as a valid element"
sys.exit(2)
print "Information on %s:\n%s\n" % (assetType, str(info["spec"]))
for a in sorted(assetInfo):
# Get a padding value so the key/value columns will be neatly aligned
spacePadding = 28-len(a)
# Parse the version and datetime info correctly
if a == "versions":
assetInfo[a] = len(assetInfo[a])
elif a in ["created_at", "updated_at"]:
assetInfo[a] = ueCore.formatDatetime(str(assetInfo[a]))
# Get rid of the keys with _id because they're database stuff
if not re.match(".*_id$", a):
print "%s:%s%s" % (a, " "*spacePadding, str(assetInfo[a]))
print ""
示例3: printTree
# 需要导入模块: from ueCore import AssetUtils [as 别名]
# 或者: from ueCore.AssetUtils import getGroup [as 别名]
def printTree():
if "spec" not in info:
print "ERROR: Spec not set"
sys.exit(2)
spec = ueSpec.Spec(info["spec"])
print "Asset tree on asset:"
print spec
print "|"
groups = ueAssetUtils.getGroupsList(spec)
lastGroup = "|"
for g, group in enumerate(sorted(groups)):
spec.grp = group
group = ueAssetUtils.getGroup(spec)
if g == len(groups) - 1:
lastGroup = " "
groupSpaceCount = 34
printLine = "+-+-> %s" % group["name"]
printLine += (groupSpaceCount - len(printLine)) * " "
if info["time"]:
printLine += "%s - %s" % (str(group["startFrame"]), str(group["endFrame"]))
groupSpaceCount += 10
printLine += (groupSpaceCount - len(printLine)) * " "
if info["path"]:
printLine += group["path"]
groupSpaceCount += 30
printLine += (groupSpaceCount - len(printLine)) * " "
if info["date"]:
printLine += "%s, %s" % (
ueCore.formatDatetime(group["created_at"]),
ueCore.formatDatetime(group["updated_at"]),
)
groupSpaceCount += 38
printLine += (groupSpaceCount - len(printLine)) * " "
if info["user"]:
printLine += group["created_by"]
print printLine
assets = ueAssetUtils.getAssetsList(spec)
for asset in sorted(assets):
spec.asst = asset
asset = ueAssetUtils.getAsset(spec)
assetSpaceCount = 34
printLine = "%s +---> %s" % (lastGroup, asset["name"])
printLine += (assetSpaceCount - len(printLine)) * " "
if info["time"]:
printLine += "%s - %s" % (str(asset["startFrame"]), str(asset["endFrame"]))
assetSpaceCount += 10
printLine += (assetSpaceCount - len(printLine)) * " "
if info["path"]:
printLine += group["path"]
assetSpaceCount += 30
printLine += (assetSpaceCount - len(printLine)) * " "
if info["date"]:
printLine += "%s, %s" % (
ueCore.formatDatetime(asset["created_at"]),
ueCore.formatDatetime(asset["updated_at"]),
)
assetSpaceCount += 38
printLine += (assetSpaceCount - len(printLine)) * " "
if info["user"]:
printLine += asset["created_by"]
print printLine
print ""
示例4: updateGroup
# 需要导入模块: from ueCore import AssetUtils [as 别名]
# 或者: from ueCore.AssetUtils import getGroup [as 别名]
def updateGroup(spec, grpType="default", dbMeta={}):
ueClient.client.updateGroup(spec, dbMeta)
return ueAssetUtils.getGroup(spec)