Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

"Import Jack" node #53

Open
novhack opened this issue Oct 18, 2022 · 4 comments
Open

"Import Jack" node #53

novhack opened this issue Oct 18, 2022 · 4 comments

Comments

@novhack
Copy link

novhack commented Oct 18, 2022

I really love the latest work that has been done on Blackjack. I think it's currently missing an ability to import one blackjack project as a node to a different blackjack project. I think the most straightforward approach would be to use Jack files and expose their promoted parameters as inputs.

Since it introduces dependencies it would be cool if it was then possible to export Jack files which would bundle in all other Jack files which were imported. Or maybe include relative paths to those Jack files.

@setzer22
Copy link
Owner

setzer22 commented Oct 20, 2022

I agree that Blackjack currently lacks a mechanism for modularity, this has been on my radar for quite a while now. What you are describing is similar to the role HDAs play in Houdini. There are other related features that I'd like to be part of this:

  • Copy and paste a group of nodes, not just within the same application, but even between multiple instances of Blackjack. Ideally, I want something like Material Maker where you can hit Ctrl-C on a group of nodes, and paste it as RON file in a chat application. I believe something like this has a lot of potential for helping a community grow: When it's easy to share snippets, people will do it more often.

  • "Encapsulate" a group of nodes. Sometimes you just want to tidy up your graph, but not necessarily reuse the individual subgraph in other projects. Blackjack should have a mechanism for that (grouping nodes together) which allows seamless transition between external dependencies (i.e. "Jacks") and internal, embedded subgraphs.

I need to think about the best way to tackle this, but I think it is one of the major topics I could prioritize after I finish with the next big update (gizmos).

An "Import jack" node would, as of today, be a bit of a hack. I'm not against adding it, but only as a temporary solution: Jack files only contain compiled code, so I wouldn't be able to implement the other features I'm describing on top of that node.

@novhack
Copy link
Author

novhack commented Oct 20, 2022

I agree with any kind of modularity. Would it be possible to save encapsulated nodes as a separate project? Or import a project into another project as a node/group of nodes? I proposed to use Jack format mainly because inputs are clearly defined in it but if it was possible to import .blj projects and use promoted parameters as inputs as well I would like that too.

@setzer22
Copy link
Owner

setzer22 commented Oct 24, 2022

Would it be possible to save encapsulated nodes as a separate project?

With the rework I have in mind, that would be equivalent to saving a game asset: I need to give this a bit more thought, but I'm currently leaning towards unifying the blj file format and the current bga (blackjack game asset). The separation is not very useful in practice, and this would allow engine integrations to offer more features.

So, we'll add the ability to encapsulate nodes as an embedded subgraph, or splitting them out in multiple files. The former is better for when you just want modularity / composability, and the latter would be for when you want to reuse a jack across multiple projects.

I proposed to use Jack format mainly because inputs are clearly defined in it but if it was possible to import .blj projects and use promoted parameters as inputs as well I would like that too.

Yeah, the two file formats are currently serving two slightly different purposes. I still do not have a serious solution for serialization in blackjack. I've been mainly relying on dumping struct information via serde, but that makes having a proper data migration system very difficult. So my plan is to create a new file format, one that is a bit more hand-crafted and built with forward & backward compatibility in mind. This will replace the existing blj and double-up as the way to export Jacks to game engines.

Unlike other proprietary 3d applications, Blackjack has nothing to hide, 🙂 so there's no need to store obscured compiled outputs and split project and export files in different file formats.

setzer22 added a commit that referenced this issue Oct 27, 2022
This is a small detour initiated in #53, due to the fact that the Jack
file format is now broken after we no longer represent graphs themselves
as compiled lua code (which is a prerequisite to implement Gizmos, among
other useful optimizations).

The idea is to get a single canonical file format that can be used both
as an editor representation, and a representation for exported 'Jacks'.
Additionally, we will take extra care to make the format
forwards-compatible by defining mirror structs for the serialization.
This may be tedious, but gives us better control of the serialization
output and lets us build a more future-proof format.
@setzer22
Copy link
Owner

setzer22 commented Nov 6, 2022

After the merge in #62, there is now a single serialization format .bjk just as I described above 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants