sinclairzx81 / blender-node

NodeJS binding to Blenders Python Scripting Environment
Other
59 stars 10 forks source link

Update to 3.2 #3

Open samevision opened 2 years ago

samevision commented 2 years ago

Hello,

first of all thanks for providing this package! Is there any chance that you will update this to Blender 3.2? That would be really nice.

Thanks

sinclairzx81 commented 2 years ago

@samevision Hi. Thanks.

Yeah, I'd actually like to keep this project up to date with rolling releases of Blender (so, 3.2 and beyond). But unfortunately, the way in which this project was originally developed (i.e. generating the TypeScript Blender/Python interop by scraping Blenders HTML website documentation) is fairly untenable as a solution moving forward.

As such, the project is currently on hold, but offered primarily as a "proof of concept" for a potential future where-in a TypeScript interop can be generated from metadata provided by Blender itself (mitigating the need to scrape the Blender documentation website)

From memory, the Blender documentation website is generated by a process that introspects Python code. So for this project to proceed, it would be necessary to tap into that process to produce some JSON/XML metadata IDL that describes all the callable functions and types exposed by Blender. Once that exists, an interop can be generated in this project (as well as other languages)

Current

This is how this project was originally generated. Note that the generation of the TypeScript interop is parsing out HTML. (Code for that can be found here and here)

        ┌───────────────┐
        │     Python    │   <-- Blender Python API
        └───────────────┘
                ^
                |           <-- Website Generator
                |
        ┌───────────────┐
        │  Doc WebSite  │   <-- Website
        └───────────────┘
                ^
                |           <-- Cheerio HTML Scraping 
                |
       ┌────────────────┐
       │  BlenderNode   │   <-- This project
       └────────────────┘

Future

This is what is required to update this project to 3.2 and beyond.

       ┌────────────────┐
       │     Python     │ <-- Blender Python API
       └────────────────┘
               ^
               |          <-- Python: JSON IDL Generator
               |
       ┌────────────────┐
       │  Python IDL    │ <-- Blender JSON IDL
       └────────────────┘
          ^         ^
         /           \
        /             \
┌──────────────┐ ┌───────────────┐
│  BlenderNode │ │  Doc WebSite  │ 
└──────────────┘ └───────────────┘

Would you be open to doing a little bit of side research into obtaining a IDL for 3.2? If you can source a IDL for Blenders Python scripting environment, ill be happy to update this project to 3.2. Note that such an IDL would need to be released on each version of Blender (so may require contributions to the Blender project to make happen)

Thanks again S