News for hackers. Stuff that matters.
Re:Blender 2.93 LTS by mkaic on Wednesday June 02, 2021 @03:56PM (#27373287)
The Blender dev team never ceases to amaze me with their incredible iteration speed. It's crazy how much you can get done when you assemble a team of highly skilled, organized, and passionate people to all work on what they love full time.

Blender is hands-down my favorite piece of software I've ever used. I use it for professional purposes semi-regularly, and with each new update just keeps on getting better and better.

Excited for the 3.0 releases!

Re:Blender 2.93 LTS by ahaferburg on Thursday June 03, 2021 @01:24AM (#27377520)
Probably very much depends on what you do with Blender. I've been trying to port my exporter plugin from Maya to Blender, and it has been nothing but frustrating. It's been quite a while since I wrote it for Maya, but I remember the Maya API (C++ and MEL) to be well documented, well structured, and quite pleasant to work with. I was always amazed at Maya's basic architecture: Every UI action maps to a command that is run by the interpreter. This makes scripting very easy.

Blender's Python API on the other hand is very poorly documented, and - to me - seems poorly thought out. It's not really designed as an API, it's just exposing the existing C++ code, and usability is not a concern. It feels tacked on, leaving lots of gaps. Somewhere I've seen a quote by Ton Rosendaal that Blender is for artists, not for coders. If you want Blender to be a competitor for Maya that seems very short sighted.

The one thing that impressed me though, was the speed by which the Blender devs react to tickets. Hats off to them!

Re:Blender 2.93 LTS by prox on Thursday June 03, 2021 @02:34AM (#27377885)
Another problem is that the code changes from version to version, so a big chance that example you found no longer works. While annoying it’s not insurmountable, but a good doc would help a lot indeed! Perhaps with the LTS release that’s a thing to solve.
Re:Blender 2.93 LTS by rguetzkow on Thursday June 03, 2021 @07:15AM (#27379513)
Unless the example is from 2.79 and earlier it shouldn't take any or only minimal adjustments. There have been some API changes between versions since 2.81, but they usually wouldn't affect a lot of add-ons or are very easy to change.

All the API changes are also documented in the release notes [0] and the API docs allow to view the Python API for each version [1].

What change between versions caused you problems and what parts of the API docs were lacking?

[0] https://wiki.blender.org/wiki/Reference/Release_Notes [1] https://docs.blender.org/api/current/index.html

Re:Blender 2.93 LTS by ahaferburg on Thursday June 03, 2021 @09:56AM (#27381413)
Upgrading your plugins is not so much a problem.

What is a problem, though, is that when you google an issue, and find a solution, you then have to upgrade that solution to your version of Blender. That is very annoying because unless you're familiar with Blender, you can't tell if the solution is wrong, or correct but outdated.

Re:Blender 2.93 LTS by rguetzkow on Thursday June 03, 2021 @12:40PM (#27383889)
From my experience script examples usually indicate what version they were made for and add-ons have to declare the minimum supported Blender version in their `bl_info`, which tells what API version it was implemented for. I know that at least on Blender's Stack Exchange the community tries to provide updated answers if anything relevant has changed in a new version.

I can see that older scripts for 2.79 and earlier may cause the issue you're describing, but this doesn't seem like a Blender specific issue. How did Maya handle API changes between versions? I would assume that there were breaking changes at some point that caused similar issues.

Re:Blender 2.93 LTS by jensus on Thursday June 03, 2021 @04:55AM (#27378674)
I have no experience with blender but have been developing for maya for 7+ years or so. Python in Maya is very much a afterthought and extremely slow (even for Python standards). There is noting pythonic about the api which by all means is just a port of the mel interface.

The documentation is great, agreed, but I am not sure you can attribute that to the python part of Maya. The documentation structure goes back to pre python days.

If any of the major studios spent a fraction of their development budget on Blender rather than Maya (and contributed back to the community) I think we could see great strides in polishing Blenders usability for scripting.

Re:Blender 2.93 LTS by rguetzkow on Thursday June 03, 2021 @07:04AM (#27379449)
I have never developed a plugin for Maya so I cannot compare the two, but this statement confuses me:

> I was always amazed at Maya's basic architecture: Every UI action maps to a command that is run by the interpreter.

That is pretty much how it works in Blender. All the buttons and properties in the UI are accessible through the Python API.

Re:Blender 2.93 LTS by ahaferburg on Thursday June 03, 2021 @09:53AM (#27381367)
> That is pretty much how it works in Blender. All the buttons and properties in the UI are accessible through the Python API.

Yes, it seems that way, and I was hopeful at first. But then I tried to use it.

In Maya, you can just copy paste a command from the command window, and it will work.

When you do that in Blender, it will probably give you an unspecific error message like "not possible in the current context". Because you need to manually switch Blender e. g. from Object mode to Edit mode (Faces), and your command only works in that context. So you develop a script that works initially, but later you find that it only works if Blender is in a certain state. That state is nowhere documented, you have to guess what it wants.

While Maya uses arguments to commands, Blender uses the equivalent of global variables.

Re:Blender 2.93 LTS by rguetzkow on Thursday June 03, 2021 @12:19PM (#27383610)
That is specific to operators (Blender's implementation of buttons) since they are closely tied to their use in the UI. They may expect a specific context which is checked by the operator's `poll()` function. The namespace the operator is in should hint at what that context is, e.g. `bpy.ops.mesh` works with mesh data which is accessed in edit mode. Other operator namespaces directly reference area types, those need to be executed within that area. For instance operators `bpy.ops.view3d` will most likely require to be executed in an area of type `VIEW3D`. That is a requirement because the data that the operator needs is otherwise not accessible. I understand that the approach you are used to in Maya is more convenient.

When you have issues with calling an operator due to a wrong context, there are different ways to approach the problem:

1. Figure out what the necessary context is and switch modes, areas, etc. to match the requirements.

2. Figure out what the necessary context is and override the context.

3. Avoid using operators.

Approach 1.) could be accomplished by checking where the operator is originally used in Blender. For instance the `bpy.ops.mesh.remove_doubles()` is available in edit mode in the Mesh > Clean up menu. Thus edit mode is required to run the operator. This will work for many operators because they don't have very complicated requirements.

Approach 2.) is for when you must use an operator, it requires a complicated context and you know about Blender's internals. You can look at the operator's (poll) implementation and construct a specific context that is passed into the operator [0]. This should only be used if there is no better alternative.

Approach 3.) is preferable when you are working with mesh data. Instead of using regular operators you can use bmesh instead [1]. It doesn't require switching to edit mode or passing a context. It's usually the more efficient approach as well.

[0] https://docs.blender.org/api/current/bpy.ops.html#overriding...

[1] https://docs.blender.org/api/current/bmesh.html

Re:Blender 2.93 LTS by rguetzkow on Thursday June 03, 2021 @01:28PM (#27384571)
The comment above is more of an explanation of how this currently works in Blender and how one can approach the aforementioned challenge.

I do agree that the Python API is often just a thin wrapper around the C/C++ code [0] and that the documentation of the required context for operators is a bit lacking for people who are not familiar with Blender's implementation. This is also acknowledged in the API docs [1]. However, I do think the API is quite usable and not particularly complicated to understand.

[0] https://docs.blender.org/api/current/info_gotcha.html

[1] https://docs.blender.org/api/current/info_gotcha.html#why-do...

Re:Blender 2.93 LTS by shahar2k on Thursday June 03, 2021 @03:31PM (#27386209)
I have the same observation as a fairly novice maya programmer. it's absolutely priceless to be able to do something using the "regular" UI and just see every single command that is run and then just copy paste the appropriate bits and stitch them together with various conditionals and tests.

maya is even MORE layered than just ui -> script commands, there's the intermediate layer of the node editor which shows the scene data as a set of interconnected nodes and what information they're passing between each other (with a few odd omissions) basically any function in maya can be accessed at least 3 ways at 3 different levels of technical skill. where in blender there are still fairly large missing chunks to translate between the UI level, node level and script level.

all that being said it's a very impressive 3d suite and I highly welcome any and all competition!

Re:Blender 2.93 LTS by agumonkey on Thursday June 03, 2021 @01:53AM (#27377671)
that would be pretty telling, I expected python to be big advantage for blender but if the internals/model are fluffy, and fluffier than good old maya i'd be worried
Re:Blender 2.93 LTS by Wistar on Wednesday June 02, 2021 @05:28PM (#27374227)
v2.7 was, for me, the version that got me to slowly move from 3D Max to Blender. Now, I can hardly remember 3D Max.
Re:Blender 2.93 LTS by can16358p on Wednesday June 02, 2021 @06:29PM (#27374838)
I'm not professional or anything but I find 3ds max UI and way of doing things/UI/toolbars/working with geometry and keyboard shortcuts MUCH more intuitive than Blender. Everybody says Blender is awesome and I respect that, but seriously, no matter how hard I try I always end up saying "this is much easier in 3ds max". Any recommendations?
Re:Blender 2.93 LTS by Wistar on Wednesday June 02, 2021 @07:20PM (#27375236)
Probably to stick with 3D Max. I really like 3D Max a lot. It was my tool of choice for about 18 years but, as I stopped doing much 3D professionally, I just decided to give Blender a shot and, once I got over some of the weird UI, most of which is now fixed, I found that I liked it a lot.
Re:Blender 2.93 LTS by Dracophoenix on Wednesday June 02, 2021 @09:11PM (#27376028)
How did you get into doing 3D Max professionally? Have you used any other packages like Maya, Lightwave, or Alias's offerings way back when?
Re:Blender 2.93 LTS by Wistar on Wednesday June 02, 2021 @10:35PM (#27376637)
I started using 3D as a lark. I am a long-time on-line editor and VFX compositor and had access to 3D in the various studios I worked when commercial 3D packages became a thing, starting in about 1983 or so. More importantly, I had access to some amazingly good animators, modelers and 3D engineers of whom I could ask questions and who I could watch work (and annoy). They had a lot of downtime to talk because of rendering time. Several of these people are, today, legends in the field.

In 1995 I started my own 3D animation, design and VFX studio. It was a Softimage house on SGI with a DEC Alpha render farm but I had a couple seats of 3D Max as well as Side-Effects Prisms and, later, Houdini.

I have used Cubicomp 3D, Bosch FGS-4000, Vertigo, Wavefront, Alias|Wavefront, Softimage, Prisms, Houdini, Maya and 3D Max packages as well as the Rhino 3D Nurbs modeler and several other long-gone packages including a 3D solids system whose name I cannot recall.

A 3D guru I am not, though. I regularly see stuff today that I just cannot imagine how in the hell was done and the insane skill levels involved in doing it. I will point out one thing that was common among the really good 3D practitioners: most of them are really good musicians in addition to being outstanding fine artists. The character animators generally had a drama background.

Now, I just mostly play around, doing the occasional explainer video/animation pieces and elements, usually having to do with automotive and aviation technologies. My old-ass brain can't keep up any more.

Re:Blender 2.93 LTS by Phrodo_00 on Wednesday June 02, 2021 @07:24PM (#27375275)
Have you tried it after 2.7? I'm not familiar with 3d modeling, but I heard a lot of people praising the UI changes for that release
Re:Blender 2.93 LTS by Wistar on Wednesday June 02, 2021 @08:29PM (#27375727)
Yes. 2.8 was the big UI change which made it a lot more familiar to folks used to the "mainstream" 3D suites/apps.
Re:Blender 2.93 LTS by can16358p on Thursday June 03, 2021 @02:56AM (#27377998)
Yup, it was actually after 2.8 which changed UI a lot as I read (don't know how it was before 2.8)
Re:Blender 2.93 LTS by Wistar on Thursday June 03, 2021 @03:36PM (#27386260)
Very much its own UI that didn't follow (the admittedly somewhat loose) established conventions. Right-clicking to select and other weird stuff. I got used to it but it really required a lot of playing around to begin to associate the user-model with my prior experience in 3D software-land.

I remember thinking at the time that, had I had no prior experience to build on, I probably would have given up on it.

Re:Blender 2.93 LTS by hrnnnnnn on Saturday June 05, 2021 @12:47PM (#27406568)
There's a fork called Bforartists which recreates this workflow in Blender.

https://www.bforartists.de/