0% found this document useful (0 votes)
68 views14 pages

WorkingWithKatanaProjects PythonAPI

The document describes various methods available in the Katana API for working with projects and time in Katana. It includes methods for loading, saving, importing and exporting Katana files. Additional methods provide information about the current project like the asset ID, file path and scene name. Other methods deal with setting and retrieving time values and graph states in the node graph.

Uploaded by

johnnyfingers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views14 pages

WorkingWithKatanaProjects PythonAPI

The document describes various methods available in the Katana API for working with projects and time in Katana. It includes methods for loading, saving, importing and exporting Katana files. Additional methods provide information about the current project like the asset ID, file path and scene name. Other methods deal with setting and retrieving time values and graph states in the node graph.

Uploaded by

johnnyfingers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Working with Projects — Katana Developer Guide https://learn.foundry.com/katana/6.0/dev-guide/Scripting/WorkingWi...

KatanaFile.New()

KatanaFile.Revert()

ValueError

KatanaFile.Load(fileName, isCrashFile=False)

fileName str

isCrashFile bool

KatanaFile.Save(fileNameOrAssetId, extraOptionsDict=None)

str

1 of 14 11/06/2023, 17:16
Working with Projects — Katana Developer Guide https://learn.foundry.com/katana/6.0/dev-guide/Scripting/WorkingWi...
fileNameOrAssetId str

extraOptionsDict dict

None

KatanaFile.IsFileDirty()

bool

True False

KatanaFile.IsFileSavedAsAsset()

bool

True False

KatanaFile.Paste(nodeXML, parent)

nodeXML

nodeXML str

parent GroupNode

KatanaFile.Import(fileName, floatNodes=False, parentNode=None)

list Node

2 of 14 11/06/2023, 17:16
Working with Projects — Katana Developer Guide https://learn.foundry.com/katana/6.0/dev-guide/Scripting/WorkingWi...
fileName str

floatNodes bool

True

parentNode GroupNode None

KatanaFile.Export(fileNameOrAssetId, nodes, extraOptionsDict=None)

str

fileNameOrAssetId str

nodes list NodegraphAPI.Node

extraOptionsDict dict

None

KatanaFile.CrashSave(forceSave=False, logCompletion=False)

3 of 14 11/06/2023, 17:16
Working with Projects — Katana Developer Guide https://learn.foundry.com/katana/6.0/dev-guide/Scripting/WorkingWi...
forceSave bool

logCompletion bool

KatanaFile.CrashSaveEnable()

KatanaFile.CrashSaveDisable()

KatanaFile.GetCrashActions()

int

KatanaFile.GetCrashTime()

float

time

KatanaFile.GetViableCrashFiles(smartPrune=True)

list

bool

/TMPDIRp/*.katana

KatanaFile.WasFileLoadedFromCrashFile()

bool

True False

NodegraphAPI.GetInTime()

4 of 14 11/06/2023, 17:16
Working with Projects — Katana Developer Guide https://learn.foundry.com/katana/6.0/dev-guide/Scripting/WorkingWi...
number

NodegraphAPI.SetInTime(inTime, final=True)

NodegraphAPI.SetOutTime(outTime, final=True)

NodegraphAPI.GetOutTime()

number

NodegraphAPI.GetWorkingInTime()

number

NodegraphAPI.SetWorkingInTime(workingInTime, final=True)

NodegraphAPI.GetWorkingOutTime()

number

NodegraphAPI.SetWorkingOutTime(workingOutTime, final=True)

NodegraphAPI.GetCurrentTime()

number

GetInTime() GetOutTime()

5 of 14 11/06/2023, 17:16
Working with Projects — Katana Developer Guide https://learn.foundry.com/katana/6.0/dev-guide/Scripting/WorkingWi...

NodegraphAPI.SetCurrentTime(newTime, final=True)

newTime number

final bool

"parameter_finalizeValue"

GetInTime() GetOutTime()

NodegraphAPI.GetTimeIncrement()

float

NodegraphAPI.SetTimeIncrement(incTime, final=False)

NodegraphAPI.GetAutoKeyAll()

bool

NodegraphAPI.SetAutoKeyAll(autoKeyAll)

NodegraphAPI.GetProjectAssetID()

str

NodegraphAPI.GetOriginalProjectAssetID()

6 of 14 11/06/2023, 17:16
Working with Projects — Katana Developer Guide https://learn.foundry.com/katana/6.0/dev-guide/Scripting/WorkingWi...
str

GetProjectAssetID() '/tmp/a.katana'

GetOriginalProjectAssetID()

NodegraphAPI.GetProjectFile()

str

GetProjectAssetID()

NodegraphAPI.GetProjectDir()

str

NodegraphAPI.GetKatanaSceneName()

str None

NodegraphAPI.IsLoading()

bool

True

False

IsLoadingAsync()

katana

livegroup

7 of 14 11/06/2023, 17:16
Working with Projects — Katana Developer Guide https://learn.foundry.com/katana/6.0/dev-guide/Scripting/WorkingWi...

NodegraphAPI.UpdatePluginsFromGlobals()

NodegraphAPI.GetCurrentGraphState(**kwargs)

NodegraphAPI.GetGraphState(timeval, **kwargs)

GraphState

float

NodegraphAPI.GetGraphStateAtPort(searchPort, startPort, startGraphState)

searchPort startPort

startPort

startGraphState searchPort

None

searchPort Port Port

GraphState

startPort Port Port

startGraphState GraphState GraphState

GraphState None

GraphState searchPort startPort

startGraphState None searchPort

NodegraphAPI.GetSampleTimesFromGraphState(graphState, useSinglePrecision=False)

8 of 14 11/06/2023, 17:16
Working with Projects — Katana Developer Guide https://learn.foundry.com/katana/6.0/dev-guide/Scripting/WorkingWi...
GraphState

GetSampleTimes()

graphState GraphState GraphState

shutterOpen shutterClose maxTimeSamples

useSinglePrecision bool True

FnAttribute

tuple float

tuple

NodegraphAPI.GetSingleSampleTimeFromGraphState(graphState)

GraphState

maxTimeSamples

GetSampleTimes()

graphState GraphState GraphState

shutterOpen shutterClose

float

NodegraphAPI.StackedLocalGraphState(graphState)

None

NodegraphAPI.GraphState

class NodegraphAPI.GraphState

pybind11_builtins.pybind11_object

9 of 14 11/06/2023, 17:16
Working with Projects — Katana Developer Guide https://learn.foundry.com/katana/6.0/dev-guide/Scripting/WorkingWi...
__init__() → None

edit() → SPI_Nodegraph_v1::GraphStateBuilder

GraphStateBuilder GraphState

getDynamicEntry(path: str) → Geolib3::internal::FnAttribute::Attribute

path None

getDynamicHash() → int

GraphState

getHash() → int

GraphState

getMaxTimeSamples() → int

GraphState

getOpSystemArgs() → Geolib3::internal::FnAttribute::GroupAttribute

GroupAttribute GraphState

getROI() → tuple

GraphState

getRenderMethodName() → str

GraphState

getSampleRateX() → float

x GraphState

getSampleRateY() → float

y GraphState

getShutterClose() → float

GraphState

getShutterOpen() → float

GraphState

10 of 14 11/06/2023, 17:16
Working with Projects — Katana Developer Guide https://learn.foundry.com/katana/6.0/dev-guide/Scripting/WorkingWi...
getStaticEntry(path: str) → Geolib3::internal::FnAttribute::Attribute

path None

getStaticHash() → int

GraphState

getTime() → float

GraphState

getView() → str

GraphState

isDiskCachingAllowed() → bool

GraphState

isExternalRenderAllowed() → bool

GraphState

isHotRender() → bool

GraphState

isROIAbsolute() → bool

GraphState

isTaskCachingIgnored() → bool

GraphState

matchVariableWithCEL(variableName: str, celStatement: str) → bool

variableName celStatement

class NodegraphAPI.GraphStateBuilder

pybind11_builtins.pybind11_object

__init__() → None

build() → NodegraphAPI.GraphState

build()

GraphState

11 of 14 11/06/2023, 17:16
Working with Projects — Katana Developer Guide https://learn.foundry.com/katana/6.0/dev-guide/Scripting/WorkingWi...
deleteDynamicEntry(path: str) → NodegraphAPI.GraphStateBuilder

path

deleteStaticEntry(path: str) → NodegraphAPI.GraphStateBuilder

path

setDiskCachingAllowed(allowCaching: bool) → NodegraphAPI.GraphStateBuilder

GraphState

setDynamicEntry(*args, **kwargs)

path attr

path IntAttribute value

path DoubleAttribute

value

path StringAttribute

value

setExternalRenderAllowed(allowExternal: bool) →
NodegraphAPI.GraphStateBuilder

GraphState

setHotRender(isHot: bool) → NodegraphAPI.GraphStateBuilder

GraphState

12 of 14 11/06/2023, 17:16
Working with Projects — Katana Developer Guide https://learn.foundry.com/katana/6.0/dev-guide/Scripting/WorkingWi...
setIgnoreTaskCaching(ignoreCaching: bool) → NodegraphAPI.GraphStateBuilder

GraphState

setMaxTimeSamples(maxSamples: int) → NodegraphAPI.GraphStateBuilder

GraphState

setROI(roi: List[float[4]]) → NodegraphAPI.GraphStateBuilder

GraphState

roi int

setRenderMethodName(name: str) → NodegraphAPI.GraphStateBuilder

GraphState

setSampleRateX(sampleRate: float) → NodegraphAPI.GraphStateBuilder

x GraphState

setSampleRateY(sampleRate: float) → NodegraphAPI.GraphStateBuilder

y GraphState

setShutterClose(time: float) → NodegraphAPI.GraphStateBuilder

GraphState

setShutterOpen(time: float) → NodegraphAPI.GraphStateBuilder

GraphStae

setStaticEntry(*args, **kwargs)

path attr

13 of 14 11/06/2023, 17:16
Working with Projects — Katana Developer Guide https://learn.foundry.com/katana/6.0/dev-guide/Scripting/WorkingWi...

path IntAttribute value

path DoubleAttribute value

path StringAttribute value

setTime(time: float) → NodegraphAPI.GraphStateBuilder

GraphState

setView(view: str) → NodegraphAPI.GraphStateBuilder

GraphState

14 of 14 11/06/2023, 17:16

You might also like