Amazon VERSION 2.0V1 Uživatelská příručka Strana 195

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 264
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 194
195
locationDataChangeEvents = client.getAndResetChangedLocations()
if not locationDataChangeEvents:
return
# Iterate over each location we've been informed about and interrogate it
for event in locationDataChangeEvents:
location = event.getLocationPath()
locationData = event.getLocationData()
locationAttrs = locationData.getAttrs()
if not isinstance(locationAttrs, FnAttribute.GroupAttribute):
continue
# Only look at locations of type 'light'
typeAttr = locationAttrs.getChildByName('type')
if (not isinstance(typeAttr, FnAttribute.StringAttribute)
or typeAttr.getValue('', False) != 'light'):
continue
# Only want to look at xform or material updates
for attrName in ('xform.matrix', 'material',):
attr = locationAttrs.getChildByName(attrName)
# Do something with attr
Advanced Topics
Caching
There are a number of caching systems maintained by various Geolib3 sub-systems. This section covers Runtime-
based caches and Client LocationData caching.
Runtime-based Caching
The Geolib3 Runtime maintains a cache of previously computed (Op, location) pairs. It maintains another cache for
"scattered queries", made during the cooking process. The lifetime of entries in these caches is explicitly managed
through the Client API; see FnGeolibRuntime.h : client.evict(primaryPathToKeep).
24 OP API | ADVANCED TOPICS
Zobrazit stránku 194
1 2 ... 190 191 192 193 194 195 196 197 198 199 200 ... 263 264

Komentáře k této Příručce

Žádné komentáře