<div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)">The advantage of SDNA is that it’s backwards and forwards compatible between different versions of Blender, according to docs. That can’t be said of the python API. I don’t know if the blender-file package is backwards and forwards compatible or not.</span><br></div><div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)"><br></span></div><div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)">The main reason to go with SDNA is that there’s a level of introspection not available to the python API, afaik. One can’t view the inside of C++ classes to pull out values with the python API, afaik. I don’t know if the python API is introspective or not…i don’t know python that well either.</span></div><div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)"><br></span></div><div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)">I fully expect that what I write will be mostly generated/meta. At least that’s the plan. If you can show an approach that can be generated using the python API, I’m all ears. I may even split the output into 400+ files.</span></div><div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)"><br></span></div><div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)">I’m not really looking at doing a hand-coded solution at this time. I’m looking at doing a minimal amount of coding for the largest effect. I am not capable of reading an extensive API doc. Something like JavaDoc would be ideal.</span></div><div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)"><br></span></div><div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)">I am not specifically targeting X3D (the standards) at this time. What I’m trying to do is figure out more of a declarative transformer, similar to XSLT for SDNA. I may attempt at something like DFDL, ANTLR, Rose compiler, or LLVM IR. I think we’re all wanting an IR for animated graphics, but there are different goals and constraints for different software, so we keep falling back to partial solutions.</span></div><div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)"><br></span></div><div style="background-color:rgba(0,0,0,0)!important;border-color:rgb(255,255,255)!important;color:rgb(255,255,255)!important" dir="auto"><font style="border-color:rgb(0,0,0);color:rgb(0,0,0)">My previously stated goal was UTF-8. I may make binary mesh and image files.</font></div><div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)"><br></span></div><div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)">John</span></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 14, 2021 at 2:44 AM Michalis Kamburelis <<a href="mailto:michalis.kambi@gmail.com">michalis.kambi@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">It was last updated in 2017<br>
<a href="https://developer.blender.org/source/blender-file/" rel="noreferrer" target="_blank">https://developer.blender.org/source/blender-file/</a> . There's only a<br>
single developer. TBH this approach is really not the way to export X3D<br>
(or anything else) from Blender, as it is very non-standard. This is<br>
not the way to go, IMO.<br>
<br>
If you want to improve Blender -> X3D exporter, then it's really<br>
better to follow the standard approach, approved by Blender devs for<br>
all exporters, and just use the Blender Python API inside Blender --<br>
<a href="https://docs.blender.org/api/current/index.html" rel="noreferrer" target="_blank">https://docs.blender.org/api/current/index.html</a> , following my doc<br>
<a href="https://docs.google.com/document/d/1ad5XsU43gQGxqC7ehSBr21mdX2dQjKZCSXUQtvRwTHw/edit?usp=sharing" rel="noreferrer" target="_blank">https://docs.google.com/document/d/1ad5XsU43gQGxqC7ehSBr21mdX2dQjKZCSXUQtvRwTHw/edit?usp=sharing</a><br>
. This approach is standard, maintainable (Blender API exposes all you<br>
need, and Blender devs keep it working), familiar to Python coders in<br>
Blender and accepted by Blender devs (so they'll accept contributions<br>
this way).<br>
<br>
Regards,<br>
Michalis<br>
<br>
<br>
<br>
<br>
śr., 14 lip 2021 o 07:38 John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> napisał(a):<br>
><br>
> Does any one have experience with this python package and can recommend it?<br>
> <a href="https://pypi.org/project/blender-file/" rel="noreferrer" target="_blank">https://pypi.org/project/blender-file/</a><br>
><br>
> On Mon, Jul 12, 2021 at 9:54 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br>
>><br>
>> My first thought is reading .blend files in c/c++ using SDNA.<br>
>><br>
>> I’ve heard that .blend files are TLV, which leaves me to believe STEP/EXPRESS might be useful if binary is encoded in hexadecimal. I will make an informed choice on ARM vs Intel endianness.<br>
>><br>
>> I have downloaded the latest blender source code.<br>
>><br>
>> So I will begin by tracking down how open files, and see what Blender does.<br>
>><br>
>> John<br>
>><br>
>> On Sat, Jul 10, 2021 at 5:19 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br>
>>><br>
>>><br>
>>><br>
>>> I think Blender needs a JSON, XML, STEP/EXPRESS or python dict full export of .blend files. I do not know if either Collada or glTF support that. I will probably start working on a native UTF-8 export for Blender. I believe that Blender will become more useful and open with a full, human readable export, similar to how NeXT’s .nib format got converted to .xib format. I think there’s still plenty of room for things like typed arrays in webGL and webgpu. I’m not opposed to dropping into JavaScript or shading language if they can be parsed with an import tool.<br>
>>><br>
>>> So that’s what I’ll be pursuing. I don’t think we’ll ever see a good X3D export from Blender unless the Blender team is convinced it’s useful, or if someone starts fresh with the newest Blender API. I do see usefulness in “outing” the Blender format, and providing an upgrade path for Blender import/export tools.<br>
>>><br>
>>> I’m guessing the final result will be something like STEP. Alternatively, I may pursue a “class grammar” as popularized by Cameron Browne on the Ludii project.<br>
>>><br>
>>> I hope to protect import/export tool writers from the versionitis of the Blender API. If you’re a good designer or architect, I welcome your effort on my team.<br>
>>><br>
>>><br>
>>> John<br>
><br>
> _______________________________________________<br>
> x3d-public mailing list<br>
> <a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
> <a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</blockquote></div></div>