Giter Club home page Giter Club logo

nxt's Introduction

NXT Python Core

nxt (/ɛn·ɛks·ti/) is a general purpose code compositor designed for rigging, scene assembly, and automation. (node execution tree)
Installation/Usage | Docs | Contributing | Licensing

Installation/Usage

This repo is the nxt core, it does not come with a UI. If you're looking for the UI, please see the nxt editor. This package is designed for headless execution of graphs in a render farm or other headless environment.
Only clone this repo if you're contributing to the NXT codebase.


Requirements

Requirements for contributors

NXT Python Core

Our releases are hosted on PyPi.

Install:
pip install nxt-core

Execute Graph:

import nxt
nxt.execute_graph('path/to/graph.nxt')

Update:
pip install -U nxt-core


Special Thanks

Sunrise Productions | School of Visual Art and Design


Release Dev
Build Status Build Status

nxt's People

Contributors

imlucasbrown avatar michaelaldrich avatar mikerozo avatar wyoder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nxt's Issues

Rename Attributes Propagation

Is your feature request related to a problem? Please describe.
Relates to #29

Describe the solution you'd like
Renaming an attr (perhaps with a preference on) would update tokens in the target or even all layers.
This is a rename vs refactor problem, that's why I think it should be a preference for which is the default behavior.

Making token raises TypeError

Describe the bug
In rare cases its possible for token_content to be None

Desktop (please complete the following information):

  • OS: Windows 10
  • Version API v0.8.1

Additional context

 Traceback (most recent call last):
File "c:\users\suesa\appdata\local\programs\python\python37\lib\site-packages\nxt_editor\dockwidgets\property_editor.py", line 1469, in mouseMoveEvent
token = tokens.make_token_str(attr_name)
File "c:\users\suesa\appdata\local\programs\python\python37\lib\site-packages\nxt\tokens.py", line 59, in make_token_str
return TOKEN_PREFIX + token_content + TOKEN_SUFFIX
TypeError: can only concatenate str (not "NoneType") to str

Language support

Is your feature request related to a problem? Please describe.
At times we've wanted to directly execute bash from a code block.

Describe the solution you'd like
Add support for other languages other than python to be in a code block.

Duplicate Node Paths in Save File

Due to existing save format for nodes,

{"/node/path": {"attrs": {"attr1: {"value": "hello"}}}}

If there are multiple keys in the nodes dictionary that have the same path, during json load, only one is brought in.
In the current architecture, it should be impossible for the editor to produce these malformed save files, they can only appear due to hand editing or a bad git merge.

Early exit node/graph

Is your feature request related to a problem? Please describe.
Ability to cleanly exit a node or entire build.

Describe the solution you'd like
Lucas:

Something like return in the code block to early exit the node's execution.
Something like exit() or halt() to gracefully stop the graph from executing.
Currently these can be handled with crazy indentation and raising an exception (respectively).

Michael:

I like something explicitly nxt oriented for stopping the full graph. like graph_stop(). What are the ramifications for sub graphs? Does this only halt local subgraph or full super graph? Additionally can there(should there?) be ways to skip hierarchy stop_siblings() or skip_descendants()?

File resolution different between python versions

Describe the bug
Python 3.9.7 does file resolution differently than python 3.10.8. It's causing issues as graphs were built a specific way no longer work as expected.

To Reproduce
Steps to reproduce the behavior:

  1. Unzip file attached
  2. Open nxt
  3. Open the nxt_test.nxt file
  4. If you look at that file in 3.9.7 vs 3.10.8, you will see on /node.file_test that the file resolves in one but not the other

Expected behavior
For it to resolve the same in both python versions

Screenshots
nxt_example.zip
https://github.com/nxt-dev/nxt/assets/4167012/ceb1c020-0b73-4374-85b9-ebcbf2f3341e

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 11
  • DCC Maya 2023.3 vs Maya 2024.2
  • Version: API v1.17

Saving Comp Layer (pre-comp)

Is your feature request related to a problem? Please describe.
Provide a way of saving a full comp

Describe the solution you'd like
Comp layer's themselves can not be pickles, but .nxtb could save instructions for quickly loading a comp.
We already have the concepts needed to do this, its just a matter of saving the proxy map somehow.

Relative instance paths aren't propagated

Describe the bug
A node who has relative instance paths, when instanced does not pass on that relative path, but instead passes on an absolute node path.

To Reproduce
Paste these nodes in and compare the instance paths of
/base/inst_tgt vs /base2/inst_tgt

Expected behavior
Relative paths should be preserved on proxy nodes.

Desktop (please complete the following information):

  • Version API v0.8.1

Additional context

[
	{
	    "/base": {
	        "child_order": [
	            "inst_src",
	            "inst_tgt"
	        ]
	    }
	},
	{
	    "/base/inst_src": {
	        "attrs": {
	            "side": {
	                "type": "raw",
	                "value": "L"
	            }
	        },
	        "code": [
	            "${side}"
	        ]
	    }
	},
	{
	    "/base/inst_tgt": {
	        "instance": "../inst_src"
	    }
	},
	{
	    "/base2": {
	        "instance": "/base"
	    }
	}
]

Targeted Re-Comp

An ongoing backlog ticket...

Main functions:

  • Add node
  • Remove node
    • Undo still doesn't know how to build back the proxy nodes removed by redo.
  • Instance path
  • Child order
  • Parent
  • Compute
  • Exec in
  • Enabled
  • Comment

Side notes:

  • Dirty map using tuples to avoid accidental mutation (still somewhat unavoidable since we're using a dict to hold the tuples)

Startup Script/Graph

Is your feature request related to a problem? Please describe.
Would be nice to have the ability to setup any number of user desired things during startup but before nxt is interactable.

Describe the solution you'd like
Working like userSetup.py to allow users to customize their initial session.
Would require the existence of a user specific directory. Could be the same dir as the user prefs file.

Relates to #28

Substitution of code attribute

Currently it's possible to substitute ${/node._code}, but it substitutes the list object we use in the back end, rather than a string, which would be expected behaviour.

Describe the solution you'd like
Substitute a string of the code

Multiproccess module not supported

Because of the nature of the comp, the multiprocess module it not supported.
Node objects are type objects constructed at runtime and thus can not be pickled because they can not be imported.
In the future we hope to offer this functionality with asynchronous sub-graphs.

Catch Circular Paths

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Create an instance that indirectly would result in instancing itself.
Node1._instance_path = /Node2
Node2._instance_path = /Node1

Expected behavior
Gracefully error and move on with the comp, instead of hitting a recursion or inheritance cycle errors.

nxt.env file

Is your feature request related to a problem? Please describe.
Often special environment variables are needed for scripts to run correctly.

Describe the solution you'd like
An nxt.env file would be sourced darning nxt startup to populate any number of env vars.

Relates to #27

Add layer (world) node to lookup at runtime

Is your feature request related to a problem? Please describe.
Dynamically created layer nodes are not in the lookup table of the runtime layer.
Its caused one minor issue, mostly should be done for consistency sake.

Describe the solution you'd like
If no layer node is found in the comp the dynamically created layer_node should be added to the runtime layer's lookup map.

Child order desync with relative instances

As mentioned here nxt-dev/nxt_editor#184, child order seems to break and not properly propagate through relative instances.
The provided example is setup like this:

  • The child order of /rig_components/_component is ['init', 'build'].
  • /rig_components/limb then instnaces that node via ../_component
  • /rig_components/limb/build and its children are localized and have some edits
  • Relative instances of /rig_components/limb (eg ../limb ) get the incorrect child order of ['build', 'init'].

This issue only seems to arise when /rig_components/limb is instanced by its siblings.
BrokenChildOrder.zip

Update instance path when re-parenting instance source

Is your feature request related to a problem? Please describe.
When parenting instanced node to another node it would be valuable to have its instances update their instance path.

Describe the solution you'd like
Broadly this speaks to the need for commands to have the option to auto-refactor other nodes/attrs.

Renaming nodes comps graph twice

Describe the bug
It appears renaming a node causes NXT to comp the entire graph twice.

To Reproduce
Build a new node in a fresh NXT layer.
Rename it

COMPOSITE: ('Number of nodes -->', 0)
COMPOSITE: ('Number of roots --> ', 0)
COMPOSITE: ('Number of instances created --> ', 0)
COMPOSITE: ('Number of layers --> ', 1)
COMPOSITE: ('Number of loops --> ', 1)
COMPOSITE: New comp layer created in: 5ms
COMPOSITE: ('Number of nodes -->', 0)
COMPOSITE: ('Number of roots --> ', 0)
COMPOSITE: ('Number of instances created --> ', 0)
COMPOSITE: ('Number of layers --> ', 1)
COMPOSITE: ('Number of loops --> ', 1)
COMPOSITE: New comp layer created in: 2ms

Composite log shows it is comping twice. For graphs that take 20 seconds to comp this is problematic.

Expected behavior
Do not comp twice.

graph v1.17
api v0.14.0
editor v3.12.1

A way to make reference layers relative paths not full in UI

Is your feature request related to a problem? Please describe.
So I have my custom rigging framework that I've built, similar to the mgear backend.
Within this repo, I have a folder for my NXT graphs (Rig components like arms, legs, etc. as one graph, and template graphs, like biped, quadroped, etc.).
I've now pushed this repo so that other people can use it too, but they're getting importing errors because the graph paths (in the repo) is still looking at MY machine's folder structure.
Is there a way I can make this path automatically update? Or do people need to manually change the path once they've pulled to look at their machines?

Describe the solution you'd like
Can we have a way in the UI to make paths relative
"references": [
"../face_rig.nxt",
"../body_rig.nxt"
],

Thanks Sue

Multiple logging objects instead of custom levels

Is your feature request related to a problem? Please describe.

Currently all of our logging goes through one logger object, the nxt logger.
We should break that up into different logger objects instead of adding custom levels like we do now.

Describe the solution you'd like

Use getLogger('comp') to output comp logs, rather than logger.compinfo

Large Stage Variables Cause Slowness

Describe the bug
Populating stage variables with a large amount of data is causing the entire execution to slow down, even if the stage variable is not being interacted with. The provided example builds quickly to the add_stage_data node, but any node built after that slows down considerably.

{
    "version": "1.17",
    "alias": "stage_slowness",
    "color": "#991c24",
    "mute": false,
    "solo": false,
    "meta_data": {
        "positions": {
            "/root": [
                193.0,
                -63.0
            ]
        },
        "collapse": {
            "/root": false,
            "/root/b": false,
            "/root/c": true
        }
    },
    "nodes": {
        "/": {
            "code": [
                ""
            ]
        },
        "/root": {
            "start_point": true,
            "child_order": [
                "a",
                "b",
                "add_stage_data",
                "c",
                "d",
                "e",
                "f"
            ]
        },
        "/root/a": {},
        "/root/add_stage_data": {
            "code": [
                "STAGE.data_test = [x for x in range(1000000)]",
                ""
            ]
        },
        "/root/b": {},
        "/root/c": {},
        "/root/d": {},
        "/root/e": {},
        "/root/f": {}
    }
}

Desktop (please complete the following information):

  • OS: [e.g. Windows 10]
  • DCC [e.g. Maya, Nuke]
  • Version [e.g. API v0.7.3]

nxt maya
graph v1.17
api v0.14.0
editor v3.12.1

Addtional application support

As we broaden our supported software we're discovering idiosyncrasies about each software that will influence our general approach to application plugins and support.

At the time of this writing the applications we're shipping plugins far are:

  • Maya
    • Editor and easy context
  • Blender *
    • Editor and easy context
  • Unreal(at next release) *
    • Editor and difficult context

* Both Unreal and Blender are in experimental support.

Applications set for future support:

  • Houdini
  • Nuke
  • tbd...

As Houdini and Nuke come online we will have perspective on our first pass, and each experimental plugin will get extra attention as it rolls out into a supported form.

Attributes with (*) text failing

Moved from: nxt-dev/nxt_editor#171
Describe the bug
Any variation of open and close parenthesis with an asterisk character somewhere in between those parentheses in an attribute's text is evaluating on code execute for the node.

To Reproduce
Steps to reproduce the behavior:
-Create node
-Add attribute with (*) text
-Execute the node

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.