def fun(): if meshes: factory.ApplyMorphTargetsToMeshes(meshes, morphTargets) if trinity.GetShaderModel() == 'SM_2_0_LO': PD.PortraitTools.RebindDXT5ShadersForSM2(meshes) if callBack: callBack()
def _UpdateCrashKeyValues(self): """ This function sits an infinite loop, periodically updating some meta data for the crash reporting. It's called from a thread when this service starts. """ self.LogInfo('UpdateCrashKeyValues loop starting') stats = [] try: serverInfo = login.GetServerInfo() blue.SetCrashKeyValues(u'serverName', unicode(serverInfo.name)) blue.SetCrashKeyValues(u'serverIP', unicode(serverInfo.IP)) except: log.LogException() statNames = [ 'Blue/Memory/Malloc', 'Blue/Memory/Python', 'Blue/Memory/PageFileUsage', 'Blue/Memory/WorkingSet' ] for each in statNames: s = blue.statistics.Find(each) if s: stats.append(s) while self.state == SERVICE_RUNNING: for each in stats: blue.SetCrashKeyValues(unicode(each.name), unicode(each.value)) blue.SetCrashKeyValues(u'Trinity_shader_model', unicode(trinity.GetShaderModel())) blue.synchro.SleepWallclock(5000)
def _UpdateCrashKeyValues(self): self.LogInfo('UpdateCrashKeyValues loop starting') stats = [] try: serverInfo = login.GetServerInfo() blue.SetCrashKeyValues(u'serverName', unicode(serverInfo.name)) blue.SetCrashKeyValues(u'serverIP', unicode(serverInfo.IP)) blue.SetCrashKeyValues( u'IsRunningWithOptionalUpgrade', unicode(nasty.IsRunningWithOptionalUpgrade())) except: log.LogException() statNames = [ 'Blue/Memory/Malloc', 'Blue/Memory/Python', 'Blue/Memory/PageFileUsage', 'Blue/Memory/WorkingSet' ] for each in statNames: s = blue.statistics.Find(each) if s: stats.append(s) while self.state == SERVICE_RUNNING: for each in stats: blue.SetCrashKeyValues(unicode(each.name), unicode(each.value)) blue.SetCrashKeyValues(u'Trinity_shader_model', unicode(trinity.GetShaderModel())) blue.synchro.SleepWallclock(5000)
def CheckHeightMaps(self): if 'LO' in trinity.GetShaderModel(): heightMapParams = nodemanager.FindNodes(self.scene, 'HeightMap', 'trinity.TriTexture2DParameter') for param in heightMapParams: param.resourcePath = param.resourcePath.replace('_hi.dds', '_lo.dds') else: heightMapParams = nodemanager.FindNodes(self.scene, 'HeightMap', 'trinity.TriTexture2DParameter') for param in heightMapParams: param.resourcePath = param.resourcePath.replace('_lo.dds', '_hi.dds')
def GetCachePath(typeID, graphicID, size, itemID, blueprint=BLUEPRINT_NONE): if evetypes.GetGroupID(typeID) in [ const.groupSun, const.groupPlanet, const.groupMoon ]: return u'cache:/Pictures/Planets/%s_%s_%s.dds' % ( trinity.GetShaderModel(), itemID, size) elif blueprint == BLUEPRINT_COPY: return u'cache:/Pictures/Blueprints/bpc_%s' % GetPictureFileName( typeID, graphicID, size) elif blueprint == BLUEPRINT_RELIC: return u'cache:/Pictures/Blueprints/relic_%s' % GetPictureFileName( typeID, graphicID, size) elif blueprint == BLUEPRINT_NORMAL: return u'cache:/Pictures/Blueprints/bp_%s' % GetPictureFileName( typeID, graphicID, size) elif blueprint == BLUEPRINT_DUST: return u'cache:/Pictures/Blueprints/dust_%s_%s_%s.dds' % ( trinity.GetShaderModel(), typeID, size) else: return u'cache:/Pictures/Gids/' + GetPictureFileName( typeID, graphicID, size)
def ApplyBaseSettings(self): currentSettings = self._GetSettings() self.bbFormat = trinity.renderContext.GetBackBufferFormat() self.postProcessingQuality = currentSettings['postProcessingQuality'] self.shadowQuality = currentSettings['shadowQuality'] self.aaQuality = currentSettings['aaQuality'] self.hdrEnabled = currentSettings['hdrEnabled'] self.distortionEffectsEnabled = self.useDepth = trinity.GetShaderModel().endswith('DEPTH') if 'hdrEnabled' in self.overrideSettings: self.hdrEnabled = self.overrideSettings['hdrEnabled'] if 'bbFormat' in self.overrideSettings: self.bbFormat = self.overrideSettings['bbFormat'] if 'aaQuality' in self.overrideSettings: self.aaQuality = self.overrideSettings['aaQuality']
def GetPictureFileName(typeID, graphicID, size): shaderModel = trinity.GetShaderModel() name = '%s_%s_%s_%s_%s.dds' % (shaderModel, graphicID or 0, evetypes.GetIconID(typeID) or 0, evetypes.GetRaceID(typeID) or 0, size) return name
def SupportsHigherShaderModel(): shaderModel = trinity.GetShaderModel() maxSupported = trinity.GetMaxShaderModelSupported() if shaderModel == 'SM_2_0_LO' and maxSupported.startswith('SM_3'): return True return False
def GetDefaultClothSimEnabled(self): shaderModel = trinity.GetShaderModel() if shaderModel.startswith('SM_3'): return 1 else: return 0
def _DoPrepareResources(self): self.useDepth = trinity.GetShaderModel().endswith('DEPTH') self.prepared = True self.SetSettingsBasedOnPerformancePreferences()
def _is_low_quality(): return trinity.GetShaderModel() == 'SM_3_0_LO'