Open novhack opened 2 years ago
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.
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.
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, :slightly_smiling_face: so there's no need to store obscured compiled outputs and split project and export files in different file formats.
After the merge in #62, there is now a single serialization format .bjk
just as I described above :+1:
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.