cPy.cNodeSystem module

Contents

cPy.cNodeSystem module#

class NodeGraph[source]#

Bases: BaseClass

static dynamic_cast(pObject: BaseClass) NodeGraph[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a NodeGraph class or its descendant, and if so, returns the specified object, but of the NodeGraph type.
Category: cStr#
Folder: cStr#
Name: cStr#
LayerName: cStr#
GraphUID: cStr#
KeepIconsFBO: bool = False#
OpenGLInitialized: bool = True#
UVFilter: cList_int#
previewRender: any#
NeedMakeScript: bool#
NeedRefreshResult: bool#
HasCompileError: bool#
CompileLog: str#
RampListTexture: any#
RampListGLTexture: int#
NodeGraphPreviewFBO: int#
CentralImagePreviewHash: int#
RenderPreview(node: any)[source]#
static ProcessNodeGraphPreview()[source]#
Clear()[source]#
SetCanvas(_0: any, AutoDestroy: bool)[source]#
GetCanvas() any[source]#
NodeGraphInEditor: NodeGraph = <Coat_CPP.NodeGraph object>#
NodeAllowGizmo: bool = False#
GlobalPropertyVisibilityLevel: int = 0#
ShowAllOutPropertiesInNodeInspector: bool = False#
BuildTimeKnotId: int = 100#
HasAlbedoOut: bool#
HasMetalOut: bool#
HasNormalOut: bool#
HasGlossOut: bool#
HasDisplacementOut: bool#
HasPositionOut: bool#
HasReflectionColorOut: bool#
HasEmissiveOut: bool#
HasOpacityOut: bool#
HasCavityOut: bool#
HasGeometryInfoOut: bool#
HasOcclusionOut: bool#
HasBugleOut: bool#
Nodes: ClassArray_BaseNode#
nodes and knots in scene
LayersList: any#
CodeNodeDefine: cStr#
iNodeCode: cStr#
iUsedFunctionsCode: cStr#
isActive: bool#
SkipValidator: bool = False#
ForceCheckAllErrors: bool = False#
isAnyActive: bool = True#
isAVUsed: bool#
UsedCavity: bool#
UsedAO: bool#
UsedGeometryInfo: bool#
Type: cStr#
Search: cStr#
FilterByTag: bool#
RenderGlobalVars: bool#
RenderObjectVars: bool#
OutArrays: dict[cStr, int]#
ComputeShaderID: int#
index of defined texture(FBO) by array define name
NeedRecenterNodes: bool#
NeedCheckAOCavity: bool#
ReCenterNodes()[source]#
RefreshResult()[source]#
EditNodes()[source]#
MakeScript()[source]#
iNeedMakeScript: any#
GetPropertiesChanged() any[source]#
GetCurvesTrivialChanged() any[source]#
GetNeedMakeScriptCounter() any[source]#
InsertKnotNamesToScript(aScript: cStr) cStr[source]#
static GetDefaultVarsCode() cStr[source]#
GetNodeSystemHash() int[source]#
Removed legacy Hash variables
GetShaderVarsHash() int[source]#
bPropertiesChanged: bool#
iPropertiesChanged: any#
bCurvesTrivialChanged: bool#
iCurvesTrivialChanged: any#
LastRampBuildHash: any#
BuildRampListTexture(forceUpdateAll: bool = False)[source]#
FindElement(point: cVec2, res: any, find_in_knots: bool, find_out_knots: bool, findnodes: bool, exceptcaptured: bool, Type: any = None) bool[source]#
HandleFlyingKnots()[source]#
ClearSelected()[source]#
FindKnot(id: str) any[source]#
NumSelectedNodes() int[source]#
BuildAllLayersNodeList()[source]#
OnLmbDown() bool[source]#
OnLmbUp() bool[source]#
OnRmbDown() bool[source]#
OnRmbUp() bool[source]#
OnMmbDown() bool[source]#
OnMmbUp() bool[source]#
OnKey() bool[source]#
OnDblClick() bool[source]#
OnWheel() bool[source]#
BreakRender: bool#
Render()[source]#
Process()[source]#
CreateUI(Rect: Rct) any[source]#
void CreateDefaultCategories();
m_pUIWidget: any#
OwnerComponent: any#
OnCreateControlFromScratch(Context: any, Rect: Rct) any[source]#
NodeIdByOutUniqueName(aUniqueName: cStr) int[source]#
CalcPropertyHash() int[source]#
MakeNodeCode(aCodeLang: any, aNodeCode: cStr, aUsedFunctionsCode: cStr)[source]#
WriteToLog(aCodeLang: any)[source]#
ComputeRender()[source]#
DefineTexture(texture_name: str, texture_id: int) bool[source]#
nodeAllowGizmo: bool#
SetupReferences(AllLayers: bool = True)[source]#
MadeUniqNodeName(node_name: cStr, exclude_node: any) cStr[source]#
static System() NodeGraph[source]#
extract NodeGraph from curent UI context - should be called within any UI callback
static Node(pos: cVec2) any[source]#
extract BaseNode from curent UI context - should be called within any UI callback
AddNode() any[source]#
void AddNodesCategory(const char* n);
RemoveNode(n: any)[source]#
NodesAffectResult(aIONodeName: cStr = '') bool[source]#
Save(xml: any, ClassPtr: any, Extra: any)[source]#
Save class to the XML structure
Parameters:
  • xml – The result

  • ClassPtr – The pointer to the data, equals to this if class is directly castable

  • Extra – Extra data pointer

SaveAs(name: str, category: str, nodegraph_type: str)[source]#
Load(xml: any, ClassPtr: any, Extra: any) bool[source]#
Load the class from the XML structure
Parameters:
  • xml – The source XML

  • ClassPtr – The pointer to the data, equals to this if class is directly castable

  • Extra – Extra data pointer

Returns:

true if successful

Return type:

bool

CheckDirectCasting() bool[source]#
Drop()[source]#
DuplicateSelected(Shift: bool)[source]#
DeleteIfNeed()[source]#
DeleteSelected()[source]#
ToggleDisabled()[source]#
LoadNGLFile(file_name: str, node_name: str) bool[source]#
LoadFromFile(file_name: str) bool[source]#
SaveToFile(file_name: str) bool[source]#
IgnoreAllErrors()[source]#
Rebuild() int[source]#
SetProperty(node_name: str, property_name: str, value: float, value_2: float = 0, value_3: float = 0, value_4: float = 0) int[source]#
WriteResultScriptToLog() int[source]#
ConvertAllCurvesToSimple()[source]#
class BaseNode[source]#

Bases: BaseClass

static dynamic_cast(pObject: BaseClass) BaseNode[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a BaseNode class or its descendant, and if so, returns the specified object, but of the BaseNode type.
NodeTypes: dict[str, BaseNode] = {}#
static RegNodeType(node_path: str, node_sample: BaseNode)[source]#
ShowPreview: bool#
ShowInObjectInspector: bool#
InlineNode: bool#
WasInlineNode: bool#
TemporarilyUnhidden: bool#
InlineFrameRect: Rct#
NodeGraphLayerIdx: int#
NGLSrcPropertiesHash: int#
DefinesHash: int#
SourceRevisionID: int#
CalcPropertyHash() int[source]#
AllowSubNodes: bool#
SubNodes() any[source]#
ParentNodeSystem: NodeGraph#
ParentNodeGraph: NodeGraph#
NGLNodeReference: any#
NodeFilePath: cStr#
Node source file path (NGL for materials)
UICompilerMessage: cStr#
An error or warning message for a node
UICompilerERROR: bool#
An error or warning message for a node
IsGlobalVarNode: bool#
IsObjectVarNode: bool#
NodeIdx: int#
position on local space of the canvas
Position: Rct#
NeedDelete: bool#
Selected: bool#
Disabled: bool#
disabled, should not be used incalculations
Captured: bool#
the node is catured to be draged
DefinesExpanded: bool#
TextWithShadow: bool#
Draw txt with shadows
ShowKnotsNames: bool#
Display knots names in UI
LoadSaveExtension: cStr#
set extension there if you need Load/Save botton in node editor triggered by doubleclick
WithoutHeader: bool#
optional feature - node without header
CentralImage: int#
central image over the node, -1 means no image
CentralImageIsFBO: bool#
CentralImagePreviewHash: int#
IconStyle: bool#
wrap central image to the whole node
WrapCentralImage: bool#
wrap central image to the whole node
ImageSize: cVec2#
if ImageSize
Color: int#
color of the node below the header
HeaderColor: int#
color of the header
CommentColor: int#
NodesDistance: int#
vertical distance between the knots
TypeName: cStr#
Text in the node header, this is also listed in RMB menu. You may change it after adding node to the scene.
NodeName: cStr#
NodeUIName: cStr#
Comment: cStr#
Subcategory: cStr#
category of the node for the RMB menu
Text: cStr#
text drawn within the node
HelperText: cStr#
The ID used in editor of the node (if available) as desciption text in the message box. Should be filled in the constructor.
In: ClassArray_knProperty#
input connections
Out: ClassArray_knProperty#
output connections
GetInProperty(aPropertyName: str) any[source]#
GetOutProperty(aPropertyName: str) any[source]#
GetHeaderColor() int[source]#
FixNodeName()[source]#
OnChangeMember(MembClass: BaseClass, MembPtr: any, MembExtra: any, MembName: str) bool[source]#
SetupInPointers()[source]#
SetupInNamesByPointers()[source]#
SetInKnot(aPropertyName: str, aKnot: any) bool[source]#
HasConnectionToAnyNodeInList(list: ClassArray_BaseNode) bool[source]#
GetInlineTargetNode() BaseNode[source]#
GetIncomingLinksCount() int[source]#
GetFinalTargetNode() BaseNode[source]#
SetOutProperty(aPropertyName: str, aKnaValueot: float, aCreatePropety: bool = False) bool[source]#
SetInProperty(aPropertyName: str, aValue: any) bool[source]#
SetDefine(aDefineName: str, aValue: int) bool[source]#
SetStringDefine(aDefineName: str, aValue: str) bool[source]#
UserDefines: any#
Values of Defines that have been set by the user for this node.
GetInVarType(aInId: int) cStr[source]#
GetOutVarType(aOutId: int) cStr[source]#
NodeSource() any[source]#
Render node itself.
UpdatePropertiesByNodeType()[source]#
OnProcess()[source]#
Render node itself.
GetUsedFunctions(aFuncCode: cStr, aCodeLang: any, aRevisionId: int)[source]#
Render node itself.
MakeCode(aCode: cStr, aCodeLang: any)[source]#
GetShaderVarHash() int[source]#
GetVarIdsInShader(aShaderIdx: int, aOutIds: int)[source]#
SetShaderVars(aShaderIdx: int, aVarIds: int)[source]#
Set var value in result shader
ImpactToNodeSystem(aNodeSystem: NodeGraph)[source]#
Make changes in parent NodeSystem if need
findNodeInPrevs(pNode: BaseNode) bool[source]#
getFirstInKnotVarType(aCodeLang: any) cStr[source]#
IN_K(aInKnotID: int) cStr[source]#
OUT_K(aOutKnotID: int) cStr[source]#
SetupKnotsUsage()[source]#
Save(xml: any, ClassPtr: any = None, Extra: any = None)[source]#
Save class to the XML structure
Parameters:
  • xml – The result

  • ClassPtr – The pointer to the data, equals to this if class is directly castable

  • Extra – Extra data pointer

Load(xml: any, ClassPtr: any = None, Extra: any = None) bool[source]#
Load the class from the XML structure
Parameters:
  • xml – The source XML

  • ClassPtr – The pointer to the data, equals to this if class is directly castable

  • Extra – Extra data pointer

Returns:

true if successful

Return type:

bool

LoadBody(xml: any, ClassPtr: any = None, Extra: any = None) bool[source]#
class ndNGLNode[source]#

Bases: BaseNode

static dynamic_cast(pObject: BaseClass) ndNGLNode[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a ndNGLNode class or its descendant, and if so, returns the specified object, but of the ndNGLNode type.
NeedSecondBuild: bool#
customSource: any#
NodeSource() any[source]#
Render node itself.
setNGLSource(ngl_source: str)[source]#
GetUsedFunctions(aFuncCode: cStr, aCodeLang: any, aRevisionId: int)[source]#
Render node itself.
MakeCode(aCode: cStr, aCodeLang: any)[source]#
PreprocessCurves(aCode: cStr)[source]#
Render(canvas: any)[source]#
OnProcess()[source]#
Render node itself.
static GetSourceByFilePath(aFilePath: str, aUserDefines: any, aNodeIdx: int) any[source]#
static LoadAllNodesFromFiles()[source]#
GetClassMask() int[source]#
Masking elements of class. Each member has mask. Element is serializable/visible only if (it’s_mask & hosting_class_mask) != 0
UpdatePropertiesByNodeType()[source]#
LoadFromFile()[source]#
LoadFromFilePath(aFileName: str)[source]#
AddCustomProperty()[source]#
EditSource()[source]#
SaveFile()[source]#
SaveAs()[source]#
class BaseKnot[source]#

Bases: BaseClass

static dynamic_cast(pObject: BaseClass) BaseKnot[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a BaseKnot class or its descendant, and if so, returns the specified object, but of the BaseKnot type.
CurrentOIPaddingCount: int#
Image: int#
isInputKnot: bool#
HiddenWOKnot: bool#
Captured: bool#
HasConnection: bool#
AllowEditKnotColor: bool#
KnotUsage: int#
Position: cVec2#
0 - free knot, 1 - in-knot, 2 - out-knot
KnotName: cStr#
KnotUIName: cStr#
CustomUIName: cStr#
UniqueName: cStr#
Color: int#
PropertyType: any#
CodeFuncAttrType: cStr#
0 - no default value; 1 - Float; 2 - Vector2D; 3 - Vector3D; 4 - Vector4D; 5 - Color;
ParentNode: BaseNode#
InGraphUID: cStr#
each knot may have one input connection
InNodeName: cStr#
InKnotName: cStr#
PInConnection: any#
SetInConnection(aInConnection: any)[source]#
SetIn(node_name: str, property_name: str)[source]#
CompatibleWithOutput(InKnot: BaseKnot) bool[source]#
check if knot may accept this type of output knots, no need to override it if you written own MayBeCastedTo function
CompatibleWithInput(OutKnot: BaseKnot) bool[source]#
check if knot may accept this type of input knots, no need to override it if you written own MayBeCastedTo function
CastTo(type: str) bool[source]#
try to cast this knot to the specified type, returns true if successfull. If empty string passed the node should be untyped if it is allowed
MayBeCastedTo(aKnot: BaseKnot) bool[source]#
check if this type may be casted to type
StrictlyTyped() bool[source]#
return false if this knot may be casted to other types in general
AlreadyTyped() bool[source]#
return true if knot already casted to some defined type
Render(canvas: any)[source]#
Process()[source]#
class knProperty(CL: int, _1: str, aDefaultValue: cVec4, aMin: float = 0, aMax: float = 10, aKnot: cStr = '', aAllowCurves: bool = False, aAllowDefineTexture: bool = False)[source]#

Bases: BaseKnot

static dynamic_cast(pObject: BaseClass) knProperty[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a knProperty class or its descendant, and if so, returns the specified object, but of the knProperty type.
PropertyIdx: int#
NodeSystemRampIdx: int#
isOutProperty: bool#
CustomProperty: bool#
inlineExpression: bool#
AllowCurve: bool#
AllowDefineTexture: bool#
Invert: bool#
IsExpandedInOI: int#
VisLevel: int#
BoundValue: bool#
For whom to show this attribute (for everyone, favorite, for experts or hide)
CodeFuncAttrID: int#
ElementCount: int#
ShowCurveUI: bool#
CustomExpression: bool#
SetInConnection(aInConnection: knProperty)[source]#
bool InlineNode = false;
GetV4() cVec4[source]#
knPropertyType PropertyType = ptDefault; // 0 - no default value; 1 - Float; 2 - Vector2D; 3 - Vector3D; 4 - Vector4D; 5 - Color;
Deform: any#
LastTrivialState: bool#
OnChangeMember(MembClass: BaseClass, MembPtr: any, MembExtra: any, MembName: str) bool[source]#
spHash: int#
legacy: cStr#
Expression: any#
UserDefines: any#
DefKnot: cStr#
DefaultMin: float#
DefaultMax: float#
CopyTypeTo(aDst: knProperty)[source]#
UpdateTypeTo(aDst: knProperty)[source]#
Process()[source]#
Render(canvas: any)[source]#
MakeCode(aCode: cStr, aCodeLang: any)[source]#
GetUsedFunctions(aFuncCode: cStr, aCodeLang: any)[source]#
GetUsedGlobalVars(aGVarsCode: cStr, aCodeLang: any)[source]#
SetShaderAttr(aShaderId: int, aShaderVarId: int)[source]#
EditExpression()[source]#
RemoveProperty()[source]#
EditProperty()[source]#
StartLinkMode()[source]#
CancelLinkMode()[source]#
ConnectLinkMode()[source]#
UnlinkConnection()[source]#
EditCurve()[source]#
ToggleInvert()[source]#
LoadTexture()[source]#
ChangeVisibilityLevel()[source]#
OpenInOI()[source]#
OpenOnClickOI()[source]#
MayBeCastedTo(aKnot: BaseKnot) bool[source]#
check if this type may be casted to type
Save(xml: any, ClassPtr: any = None, Extra: any = None)[source]#
Save class to the XML structure
Parameters:
  • xml – The result

  • ClassPtr – The pointer to the data, equals to this if class is directly castable

  • Extra – Extra data pointer

Load(xml: any, ClassPtr: any = None, Extra: any = None) bool[source]#
Load the class from the XML structure
Parameters:
  • xml – The source XML

  • ClassPtr – The pointer to the data, equals to this if class is directly castable

  • Extra – Extra data pointer

Returns:

true if successful

Return type:

bool

GetClassMask() int[source]#
Masking elements of class. Each member has mask. Element is serializable/visible only if (it’s_mask & hosting_class_mask) != 0