Building cycles standalone not working for me.?

Not anymore in the latest OpenImageIO, the ones within the namespace have been deprecated. We should actually remove TypeDesc:: from all the other ones.

OpenImageIO does test Windows builds with continuous integration. But of course there could be an issue with some particular configuration or environment.

The Blender make.bat script generates .sln, so copying that behavior should be ok.

That’s why we provide them pre-built for developers, don’t get me wrong they are still hard to build but doing it this way settles just one person with that icky job of building them rather than every single developer.

for all blender developers this change was an svn update and they were up and running again, if you are determined to build all deps from source your self, yeah… I can imagine you will not have a super great time every time we do large library changes.

@StefanW
At the moment, we are able to export meshes, cameras, various lights (point, area, mesh, IBL, sun-sky) and a selection of shaders, notably including Principled and Glass (yet without textures, at this stage).

Indeed, we used the nodes/sockets structure to understand the expected xml syntax and write our exporter. It was quite easy, thanks to the node design and also to Cycles’ great code quality, I must say.

It makes it possible to render quickly a CAD model directly from FreeCAD (without swapping with Blender):

I am excited about the amount of work people has put in already! Is Only I could help out a bit…
If some one already has binaries files I can download, I can try it out write a tutorial and some example images!!

I’m not sure if this message should go into a now thread - anyway:

I have been able to configure, compile and link all depending libraries and cycles itself. Cycles at least starts correctly.

In our application I had to do some minor changes due to the changes since last summer, nothing difficult.

However our application crashes instantly when trying to add shaders to a mesh, actually when calling Mesh::get_used_shaders().
My colleague took the challenge to identify the problem. He found, that there is a problem with the static initialization of objects, namely Mesh (mesh.cpp:126) and Geometry (geometry.cpp:49).
The sequence of the call of static initializers in different compile units is not defined according to the C++ standard.
While in Cycles the sequence of these initializations is appropriate, i.e. first Geometry and then Mesh. In our application however, the sequence is the other way round, which we can not control.
This is a serious design flaw. I remember the warnings of Stroustrup in his C++ book to not use static initializers, rather than to do initialization explicitly by functions.

Is there anyone willing and able to fix that? I/we do not have enough insight into Cycles to do that quickly.

Sounds like the same root-cause as the crashes they saw on openbsd that got fixed here.

I think I should mention this here:
Realthunder who is working on the very promising Link3 branch of Freecad, has plans to incorporate better rendering in his build:

Seems this has been fixed on Monday. It uses the initialize-before-use model. Pitty that it hasn’t found its way into cycles-standalone branch…
Who is doing that? Brecht?

Hmm…I can’t seem to get it to build on Linux (Ubuntu) with info provided on the Cycles webpage.

I’m just a tinkerer, so I may well be doing something wrong…

It’s real hard to help with that kind of problem description, there’s just nothing there to work with.

Just thinking loud:
One solution to the whole problem might be to make Cycles Standalone directly accessible from the Blender command line. The invocation could look like this, for example:

blender --cycles-standalone [cycles-options] scene.xml

…which would trigger Cycles only, with the same result as cycles [cycles-options] scene.xml

In this way, it would allow Cycles Standalone users to rely on all the Blender pre-built stuff that already exists (binaries, packages etc), saving them the arduous task of building it.

What do you think about this?

If you’re gonna require all of blender anyhow, just write out a .gltf file, and call the stock blender to render it, no need to drag cycles standalone into it.

OK, I can try this, but a question beforehand:
Is Blender gltf support absolutely exhaustive compared to Cycles capabilities, including PBR material, glass material (KHR_materials_transmission extension), IBL (BIT_scene_background extension), sun/sky lighting and so on?

Unsure on the exact support matrix, but even if it doesn’t, you can always use it to get the geometry in and use a python script to create custom materials.

What it is, this should be an alternative to photoview360. You make a cool CAD design press render and you got a nice render to share with your customer or social-media. The latter is also important atm since Freecad needs all the attention it gets. People are already saying it is Blender before 2.8. And it only needs a little push. If we can show awesome renders in Freecad and how easy it is to do this it would surely get lots of attention.

Now I am planning to install Linux on my pc so I at least can play around with it! But still especially for CAD most users use Windows so I feel that this is very important!

Poing-pong between Blender and Freecad is not really a nice solutions. Definitely wouldn’t help the idea of Freecad not being user friendly.

Blender and Freecad should make-out more. :relaxed: :heart_eyes:

I’d prefer a solution where we are not responsible for freecad’s end users, surely someone at freecad can step up to the plate and provide windows builds? Happy to talk that person though the build process if required.

I can try it, not sure what level of competence you are asking?

Fair enough.

The Cycles stand alone website says use the pre-build libs and provides the svn command to get said libs.
It says: “The easiest way to build on macOS, Linux and Windows is to use the Blender precompiled libraries.” and “Checkout the folder for your platform”.

It assumes the reader knows what “platform” refers to. The list of things at “https://svn.blender.org/svnroot/bf-blender/trunk/lib” isn’t particularly obvious. Do I want benchmarks (what platform is that?), darwin?, etc. Maybe there is context I’m missing?

I’d guess since I’m dealing with Ubuntu I’d choose “linux_centos7_x86_64”. And this is what I checked out.

Unfortunately, following the rest of the instructions results in errors about can’t find the libs…

I believe it is noted in this thread that indeed the svn command provided refers to a version of the libs that the standalone Cycles code has not been updated to use.
this maybe right? “https://svn.blender.org/svnroot/bf-blender/tags/blender-2.92-release/lib/

I haven’t had a chance to try it since it wouldn’t build for me the other day.

Again, fair enough.

But, is this really a FreeCAD issue?

As I detailed in my other post the instructions on the “Cycles standalone” website don’t seem to be correct. (I forgot to post which website in the other post: “https://developer.blender.org/diffusion/C/” )

Don’t take me wrong.

I’m happy to be talked through this and I will create a wiki page with the details and link from the FreeCAD Render workbench wiki to my details.

Think the context that you’re missing is familiarity with the blender build process, we have scripts there that will automatically grab the right set of libs for you, so devs are at least somewhat familiar with what libs they need even if they don’t grab the libs manually normally

If you only want to build cycles standalone the only folders that matter are

all other folders in /lib are blender related can be ignored, if you craft your directory structure like this

image

cycles build process should automatically pick up on them, they sit one directory up from where your git clone of the cycles repo is.

give it a whirl, and if you run into issues, just holler and i’ll help you out