mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
Fix example python scripts to work in the UI as well
* In the UI program we can't import renderdoc (it's already imported) so we just alias it to rd.
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
import renderdoc as rd
|
||||
import sys
|
||||
|
||||
# Import renderdoc if not already imported (e.g. in the UI)
|
||||
if 'renderdoc' not in sys.modules and '_renderdoc' not in sys.modules:
|
||||
import renderdoc
|
||||
|
||||
# Alias renderdoc for legibility
|
||||
rd = renderdoc
|
||||
|
||||
# We'll need the struct data to read out of bytes objects
|
||||
import struct
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import renderdoc as rd
|
||||
import sys
|
||||
|
||||
# Import renderdoc if not already imported (e.g. in the UI)
|
||||
if 'renderdoc' not in sys.modules and '_renderdoc' not in sys.modules:
|
||||
import renderdoc
|
||||
|
||||
# Alias renderdoc for legibility
|
||||
rd = renderdoc
|
||||
|
||||
def loadCapture(filename):
|
||||
# Open a capture file handle
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import renderdoc as rd
|
||||
import sys
|
||||
|
||||
# Import renderdoc if not already imported (e.g. in the UI)
|
||||
if 'renderdoc' not in sys.modules and '_renderdoc' not in sys.modules:
|
||||
import renderdoc
|
||||
|
||||
# Alias renderdoc for legibility
|
||||
rd = renderdoc
|
||||
|
||||
draws = {}
|
||||
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import renderdoc as rd
|
||||
import sys
|
||||
|
||||
# Import renderdoc if not already imported (e.g. in the UI)
|
||||
if 'renderdoc' not in sys.modules and '_renderdoc' not in sys.modules:
|
||||
import renderdoc
|
||||
|
||||
# Alias renderdoc for legibility
|
||||
rd = renderdoc
|
||||
|
||||
def printVar(v, indent = ''):
|
||||
print(indent + v.name + ":")
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import renderdoc as rd
|
||||
import sys
|
||||
|
||||
# Import renderdoc if not already imported (e.g. in the UI)
|
||||
if 'renderdoc' not in sys.modules and '_renderdoc' not in sys.modules:
|
||||
import renderdoc
|
||||
|
||||
# Alias renderdoc for legibility
|
||||
rd = renderdoc
|
||||
|
||||
# Define a recursive function for iterating over draws
|
||||
def iterDraw(d, indent = ''):
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import renderdoc as rd
|
||||
import sys
|
||||
|
||||
# Import renderdoc if not already imported (e.g. in the UI)
|
||||
if 'renderdoc' not in sys.modules and '_renderdoc' not in sys.modules:
|
||||
import renderdoc
|
||||
|
||||
# Alias renderdoc for legibility
|
||||
rd = renderdoc
|
||||
|
||||
# Recursively search for the drawcall with the most vertices
|
||||
def biggestDraw(prevBiggest, d):
|
||||
|
||||
Reference in New Issue
Block a user