pf.transforms

Members

procfunc.transforms.coerce_shaders_to_materialresult(_call_node, subgraph)[source]
Parameters:
Return type:

ComputeGraph

procfunc.transforms.eliminate_duplicate_result_types(graphs, uses_threshold=1)[source]
Parameters:
Return type:

list[ComputeGraph]

procfunc.transforms.eliminate_duplicate_subgraphs(graphs)[source]
Parameters:

graphs (list[ComputeGraph])

Return type:

list[ComputeGraph]

procfunc.transforms.extract_shader_vectors_as_inputs(graph, extract_funcs=None)[source]

Pull out shader vectors as inputs to the graph instead

Parameters:
procfunc.transforms.fill_graph_defaults_with_call_node(call_node, graph)[source]
Parameters:
Return type:

ComputeGraph

procfunc.transforms.remove_v1_name_from_graph(_call_node, graph)[source]
Parameters:
Return type:

ComputeGraph

procfunc.transforms.replace_ids(graph, ids, val)[source]

Pull out hardcoded arguments to be inputs to the graph instead

Parameters:
  • graph (ComputeGraph) – The graph to extract constants from

  • extract_mask – A mask of which args to extract. The key is a tuple of the parent node id and the arg name.

  • ids (set[int])

  • val (Any)

procfunc.transforms.colors_to_hsv_definition(graph)[source]
Parameters:

graph (ComputeGraph)

Return type:

ComputeGraph

procfunc.transforms.distribution_to_mode(compute_graph, graph_name=None)[source]

Transform a generator to use the mode of the distribution instead of random samples

Parameters:
Return type:

ComputeGraph

procfunc.transforms.outlier_distribution(compute_graph, pct=0.05, graph_name=None, normal_clip_std=3.0)[source]

Transform a generator to generate outliers with a given probability

Parameters:
Return type:

ComputeGraph

procfunc.transforms.infer_distribution_hypercube(graphs, memo=None)[source]
Parameters:
Return type:

list[ComputeGraph]

procfunc.transforms.infer_nodegroup_distributions(graphs, supported_types=(float, int, tuple, t.Vector, t.Color, np.ndarray), colors_to_hsv=True, use_randint=False)[source]

Find all multi-use subgraphs within the graphs, and compute the hypercube distribution for all the numeric parameters ever used with each subgraph

Parameters:
Return type:

list[ComputeGraph]

procfunc.transforms.extract_parameter_distributions(compute_graph)[source]
Parameters:

compute_graph (ComputeGraph)

Return type:

list[Node]

procfunc.transforms.map_graph_list(func)[source]
Parameters:

func (Callable[[ComputeGraph], ComputeGraph])

Return type:

Callable[[list[ComputeGraph]], list[ComputeGraph]]

procfunc.transforms.map_subgraphs(func)[source]
Parameters:

func (Callable[[Node, ComputeGraph], ComputeGraph])

Return type:

Callable[[list[ComputeGraph]], list[ComputeGraph]]