text:
Unable to select bones in pose mode (Blender 2.8)
This question has been asked a few times in various forms here, but none of the solutions work for me. I have included a short video showing the issue, where I highlight everything.
https://youtu.be/OP9Q6qG978s
Video broken down:

Brand new install of 2.8 (even deleted the data in Appdata/Roaming/Blender Foundation/2.80)
Restriction Toggle for the armature is not disabled
'Lock Object Modes' in Pose Mode whether On or Off doesn't fix it
Unparenting the mesh from the armature and reparenting doesn't fix it

Something I forgot to say in the video, importing that character mesh into 2.79 works and doesn't have any of these problems (opening a saved 2.79 project in 2.80 does not fix it either). Same with other character meshes I have tested.
I genuinely don't know what to do, and neither do my buddies who work with Blender regularly. I have been trying to fix this for 3 days now, and I am very frustrated as it's preventing me from working with any armatures.
Can't Select Bones in Pose Mode (Blender 2.8)
I can't keep my armature in pose mode when selecting another object
Why can't I select bones in pose mode

Try to disable "In Front" in Viewport Display in the Armature Tab - that worked for me

This worked for me also.... as did circle select mentioned in another answer.

This issue seems to occur on a per-file basis. I managed to fix it in a file by playing around with the "Local View" (Num Pad [/]), "X-Ray" (<Alt>[Z]), "In Front", "Display As", and "In Front (Animate property)" (Object Properties) options. I can click to select bones again afterwards, even with "In Front" on, but I had to restart Blender to click the 3D view panel widgets. It didn't work until after I'd enabled and disabled the "Animate" diamond for "In Front" either.

For reference, here is a thread on BlenderArtists with other people's findings:
https://blenderartists.org/t/unable-to-select-bones-in-pose-mode-blender-2-8/1168325/
Here is a linked bug ticket that is supposed to have been resolved:
https://developer.blender.org/T65221

I had his same problem. So apparently this bug happens when you start a file with an older version of Blender and then load it into 2.8. What I would do is open a new blank file and just "append" or import it from your older file.

I had the same problem just a moment ago. Imported character were working, but their duplicate pose was unselectable. I saved and restarted the software and it is now working. A bad answer but we all forget to do it first.

I had the same issue for a long time. It seems that you can select individual bones using the Select Circle tool instead of the standard Select.

I'm not sure if it's a bug or if it means that we should use it from now on. But it works.

I had this issue with a character I'm rigging, only Circle Select and Select All worked.
I found that turning off In Front on my armature fixed the issue.
My armature was still in front of my mesh, turns out I had X-Ray on as well, the combination of that and In Front caused my bones to be unable to be selected with box select mode.


text:
How to render specular highlights as a separate image with alpha channel?
I'm using the Blender Cycles engine to create graphics for a game; specifically, I want to display a grid of coloured ellipsoid counters for the player to move around.  To avoid creating a separate image for each colour, I want to store a single greyscale image in the resources, and apply a colour tint at runtime:

However, with this approach, the specular highlights would also be tinted; so I would like to store the highlights as a separate image with an alpha channel, and overlay it on top of the tinted image.
I've tried Googling for ways to do this in Blender, and cannot find anything.  The best solution I can think of is to set the glossy BSDF colour to red (1.0, 0.0, 0.0) and the diffuse BSDF colour to green (0.0, 1.0, 0.0):

I would then need to create a mask from the red channel, and create base and overlay greyscale images from the green and red channels respectively, either as a manual step in Gimp, or (better) store a single image in the resources and do the channel operations in code:

While I realise that I'm probably subverting the properties of light for the sake of coding simplicity, I am concerned that I may not be getting the most believable results.  Given that the rendering engine knows more about the light paths than I do from the final image, is there a way to do this in Blender?
Thanks!
UPDATE
For posterity, these are the material nodes I ended up with:

With a further change to adjust the alpha channel on the highlight image, these are the compositing nodes I created:

Finally, this is the end result, after tinting and overlaying in the game source code:

You need to research about "render layer passes" which can be exported separately.

Hi Leander, thanks for your comment.  I checked the Cycles render passes page, but it doesn't have any instructions on how to go about exporting separate images.

If you meant the Blender Render passes page, which has better instructions, that's no good; I wanted to use the Cycles engine.

Look at the second image of the answer you have, you can see the out-sockets of the renderlayer node named diff / gloss, to output them separately, use a file output node.

Thanks.  The Blender docs appear to be more reference than tutorial; but with Jackdaw's answer and your further suggestions, I've (mostly) got it working.

You should add in the specular with color, not mix shaders. In that way you will get a white highlight.
Here I'm using color ramps to make a mask for transparency and removing some of the gray on the specular before adding it to a solid color.

You can also render out Diffuse and Glossy and use the Compositor to choose color.

You need to add light passes for gloss direct and diffuse direct

The new passes can be then be exported from the Compositor via Image editor (set the image to be "Viewer Node") and then saved from there Image->Save As...

Thanks Jackdaw; however, I want to apply the diffuse colour in the Java code for the game I'm writing, not in Blender (this way, I only have to store one set of images, and can generate colour at runtime, from the game board dimensions).

You said "You can also render out Diffuse and Glossy and use the Compositor to choose color".  Assuming I can save separate images to disc, that's exactly what I'm trying to do; could you give me some pointers on how to go about it? (if that was obvious from your screenshots, they do not appear to have uploaded successfully!)  Thanks.

I have updated the answer with details about how to export the images. You will need to do the composition in your game but the math should be the same.

Also... you can set the rendering to be transparent (Scene->Film->Transparency) and then add the alpha to one or both of the images via the Viewer node.

That's great, thanks.  Only one minor point: even though I've enabled "transparent" in the film properties (checkered background shows in the render layers compositing node), and enabled "use alpha" in the viewer nodes, I'm still getting a solid black full alpha background in the viewer nodes.  Even connecting the alpha output of the render layers node to the alpha input of the viewer nodes made no difference.  Any ideas?

Worked it out, thanks to the (curiously unvoted) answer to this question.  I routed the gloss and alpha outputs from the "render layers" compositing node to a "set alpha" node, and routed its output to a "viewer" node.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Modify a blend file via console outside of GUI
I have built a little 'smart' robot using a Raspberry Pi and Arduino. Currently it can move around, sense obstacles, determine if it can pass, etc. My biggest problem so far is that it is completely "in the moment" and doesn't remember that there was a wall on its left once it's not sensing it. I'd like it to remember there was a wall on its left and so on so I thought, maybe I could use Blender for its visual memory!
Is it possible to add/manipulate meshes in a blend file outside of Blender via Python? My robot's code is in Python but I suppose if I have to use C for it, I can just write a Python wrapper. I don't expect to generate high detail meshes or anything like that, just cubes so I can inspect what obstacles it's remembering.

possible duplicate of How to pass command line arguments to a Blender python script?

Hmmm. I didn't think of command line args but wouldn't the problem with this be that a new instance of blender would need to run every time i wanted to add a new object to the blend file? Currently everything I'm doing is command line but i do have a desktop environment on this distro so i dunno if that would work. Maybe if i could send command line args to the current open instance of blender?

As far as I know, the 2 ways to add data to a blender scene that isn't open is by passing arguments and/or by running a script via command line, as that duplicate question shows. If you are saying that you can have blender open, then that seems like a different question. There are quite a few arduino questions here on SE.

You can also build bpy as a standalone module using cmake, and use it in a python script with import bpy
This is pretty similar to doing blender -b -P customscript.py

Hmm, very interesting. I did a little looking and i found this: http://wiki.blender.org/index.php/User:Ideasman42/BlenderAsPyModule - It seems to be pretty much what you are suggesting. I may have to toy around with this idea some!

So i managed to get this working after a few days of headache. Definitely not simple but it seems to do what i was looking for. Marking as answer =-)

I can imagine some server-client solution like code running inside blender listening for robot(s) input and creating meshes etc. according to incoming data. The robot(s) could then request info from the master blender code.
This is an idea, the technical aspect will be more difficult, like what protocol to use, how to implement server side (some code loop) inside blender (listening for callbacks and updating will be challenging).
Actually are you sure you need blender for this? Your robot probably doesn't have 3D range-finder so you can create the environment maps in some custom app in 2D from top-view. Start small and then build up.

Nah, technically i dont really need blender for it but I am more familiar with editing with blender/python than plotting and reading a 2d map. I hadnt really thought about a client/server kinda thing but I may look into that a little as it might be kinda neat to have a 'central brain' =-)

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
How do I paint textures without adding a material?
I am using Cycles Render and an Image Texture Node so that I can paint my texture and remove seams.  However, in order to do this I have to add a material and that causes my object to be shiny, which is not the look I'm going for.  How do I keep the new texture (I have saved the painted texture image as a new file on my desktop) but lose the material?  I've tried removing the material from the properties bar and then opening the new texture image in the texture section of the properties bar, but that just turns my object white.

You can't just have a texture floating around directly applied to an object, that texture has to belong to a material. If the material is too shiny why not adjust it to match what you expect?

What material do you create that object becomes "too shiny"? Default Diffuse shader barely gives that, could you show screenshots of your setup?

I think it's the default diffuse material, but I liked how it looked before-- completely flat.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Convert flat roundish meshes to angular meshes
I extracted road markings using Open Data and Python. In the attached screenshot the road markings are still rounded. Since road marking is usually not roundish but angular, I would like to design the meshes also angular.
The attached screenshot is a. svg image imported into Blender. Would it be possible to convert all surfaces into splines and then widen them to create rectangular road markings?
Is there a solution in Blender?

this is one possible way to make roundish curves  into angular meshes:
this is a curve object (closed):

in edit mode you can select all nodes and convert them as vector

which will "straighten" curves changing nodes handles

which will become

if you can get those shapes as svg, you could try steps above...
edit:
note, you can get perfectly square shapes if source svg curves have suitable control points, like in this example below:

Thank you for your solution! That doesn't look bad, but road markings are rather rectangular and less trapezoidal. The screenshot above is an .svg image imported into Blender. Would it be possible to convert all surfaces into splines and widen them afterwards?

@freddykrueger afaik, svg imported in blender should result in a curve (based on splines) object... you can convert that to mesh, later (alt-c in object mode)

Is there a way, that the meshes look like this (https://t4.ftcdn.net/jpg/01/16/26/45/240_F_116264554_1SmZ4pehMmMjg5bMFCwyD6OmYBcN7Xbz.jpg)?

@freddykrueger depending on the source svg, yes: see updated answer


text:
Armature Mirror Problem
I'm rigging a model manually because I don't like Rigify. I forgot to enable X-Axis Mirror at the start, and clicking it now does nothing at all for some reason, so I did it the manual way that everyone reading this probably already knows (by default Numpad5, Numpad1, Shift+C, ., Shift+D, S, X, -1). This looks fine in edit mode, but when I go to object or pose mode the hand is twisted the wrong way, the arm IK works strangely, and the pole target (the sphere) is in the wrong place. As well as this, some bones are mispositioned slightly, but this is not a big problem. Anyone able to help?
UPDATE: Interestingly, when I parented the armature to the mesh with automatic weights, the mesh snapped into place exactly around the bones. Picture at the very bottom.

(Above) The entire armature as seen in edit mode.

(Above) The problems as seen in pose mode.

(Above) The mesh snapping into place when parented.

Did you have the pivot point set to cursor? Did you apply (Ctrl A) rotation and scale of both armature and object before performing mirroring and parenting? If this doesn't solve you should upload your file.

The file is now completely screwed up; all the bones have twisted the mesh into weird positions even though they weren't applied to it.

If you remove the armature modifier from the object, the mesh should come back to its original shape.

In Edit Mode with the bone(s) selected that you've moved, go to Armature, then Symmetrize.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Blender FBX to Xnormal uv export not working
I was trying to export a simple cube from Blender to Xnormal in FBX format. However, when baking it said:
The low poly model mesh has no texture coords assigned
How do I export with texture coordinates?

Did you unwrap the lowpoly prior to exporting?

Yes, I used the smart unwrap.


text:
Compiling Blender as a Python Module Windows
I'm trying to compile Blender as a python module on my windows machine so I can use an external IDE. In the tutorial on the blender site. I've tried to follow it, however, the instructions are pretty confusing. The first step says to copy bin\bpy.pyd C:\Python36\Lib\site-packages\. I can't find the bpy.pyd in the blender directory or the blender source. How can I do this?

You missed the build step in this tutorial. The install part refers to the bpy.pyd you have just built, and can be found in the "blender-git/build" directory. There is a tutorial on building blender on windows. Just don't forget the cmake options: WITH_PYTHON_INSTALL=OFF, WITH_PLAYER=OFF, WITH_PYTHON_MODULE=ON

How do you change these options with CMake?


text:
ReferenceError: BMesh data of type BMesh has been removed cause and fix
I've made a lot of scripts that had this error: ReferenceError: BMesh data of type BMesh has been removed. While I've usually found workarounds I would like to know what causes this error and how to fix it for future scripts.
Edit:
This is my fence.
import bpy
import bmesh

class Create():
    mesh = bpy.context.active_object
    bm = bmesh.from_edit_mesh(mesh.data)

    def Verts(self,pose):
             self.bm.verts.ensure_lookup_table()
        self.bm.verts.new((1,1,1))
        bmesh.update_edit_mesh(self.mesh.data

class Modal(bpy.types.Operator):
    bl_idname = "object.modal"
    bl_label = "Modal Op"
    bl_description = "Other thingy"
    bl_options = {"REGISTER"}
    @classmethod
    def poll(cls, context):
        return True

    def invoke(self, context, event):
        bpy.ops.object.mode_set(mode='EDIT')
        context.window_manager.modal_handler_add(self)
        return {"RUNNING_MODAL"}

    def modal(self, context, event):
        c = Create()
        if event.type == "LEFTMOUSE" and event.value == "PRESS":
            c.Verts((0,0,1))
            print("Test")

        if event.type in {"RIGHTMOUSE", "ESC"}:

            return {"CANCELLED"}
        keys = ["WHEELUPMOUSE","WHEELDOWNMOUSE","MIDDLEMOUSE","LEFTMOUSE"]

        for i in keys:
            if event.type == i:
                return{"PASS_THROUGH"}

        return {"RUNNING_MODAL"}
def register():
    bpy.utils.register_class(Modal)

def unregister():
    bpy.utils.unregister_class(Modal)

if __name__ == "__main__":
    register()

Most commonly this is caused by making an edit mode bmesh.from_edit_mesh(me), and then toggling object mode.

How can I avoid it?

Don't toggle object / edit mode with an active live edit bmesh. Suggest posting some samples from  your scripts demonstrating  how you invoke the error. Otherwise it becomes a  guessing game.  Basic rule of thumb I use is if's not needed as a UI tool, use object mode bmesh.

How and when do you want the operator active? If it's an edit mode tool suggest making switch to object mode cancel the operator. If context.mode != 'EDIT_MESH'.

I would do that but I want to stay in edit mode when it’s cancelled.

Assigning class properties
The error you were seeing was in the way you were setting the bmesh in your Create class. The property bm will be the bmesh for the context edit mesh when the sctipt was run, rather than, what you want,  when the operator is invoked.
Suggest rather than instancing the class in modal loop, make one instance in invoke and use that.  Add a constructor to your Create class with an argument context to ensure it is for the context mesh.
Example where the bm is set as a class property of the operator.
import bpy
import bmesh

bmeshes = {}

class Modal(bpy.types.Operator):
    bl_idname = "object.modal"
    bl_label = "Modal Op"
    bl_description = "Other thingy"
    bl_options = {"REGISTER"}

    bm = None

    @classmethod
    def poll(cls, context):
        return True

    @classmethod
    def bmesh(cls, context):
        me = context.edit_object.data
        cls.bm = bmesh.from_edit_mesh(me)

    def invoke(self, context, event):
        bpy.ops.object.mode_set(mode='EDIT')
        self.bmesh(context)
        context.window_manager.modal_handler_add(self)
        return {"RUNNING_MODAL"}

    def add_vert(self, loc):
         return self.bm.verts.new(loc)

    def modal(self, context, event):
        # no longer in edit mode
        if context.mode != 'EDIT_MESH':
            self.bm.free()
            self.bm = None
            return {'CANCELLED'}

        me = context.edit_object.data
        if self.bm is None or not self.bm.is_valid:
            # in edit mode so try make a new bmesh
            self.bmesh(context)
        if event.type == "LEFTMOUSE" and event.value == "PRESS":
            v = self.add_vert((0, 0, 1))
            # update after all operations
            self.bm.verts.index_update()
            bmesh.update_edit_mesh(me)
            print("added", v)

        if event.type in {"RIGHTMOUSE", "ESC"}:
            return {"CANCELLED"}

        if event.type in ["WHEELUPMOUSE","WHEELDOWNMOUSE","MIDDLEMOUSE","LEFTMOUSE"]:
            return{"PASS_THROUGH"}

        return {"RUNNING_MODAL"}

def register():
    bpy.utils.register_class(Modal)

def unregister():
    bpy.utils.unregister_class(Modal)

if __name__ == "__main__":
    register()

For panel code to have an edit mode bmesh I often use a global dictionary
bm = bmeshes.setdefault(me.name, bmesh.from_edit_mesh(me))

which can be set / cleared using the panels' poll method.


text:
Why is blender failing to export object textures?
I am very new to blender, and I am trying to export a mesh object with materials/textures as a DAE/Collada file.  When I try to re-import my object into Blender or open it with meshlab, there are no colors/textures/materials included and the entire object is grey.  There seem to be some related questions (example 1, example 2), but those approaches don't seem to help.
I am using blender 2.79a.  Since the Collada export GUI options seem to have changed recently, I've included a screenshot of the settings I've tried.
Here is a link to the blender file that I am trying to export:
https://www.turbosquid.com/3d-models/simple-rochet-schneider-1909-fbx-free/1101519
Thanks for your help!

Update 1: A poster suggested that this is a copy of .fbx export why there are no materials or textures?.  I don't believe this is the case, since the linked questionseems to be referring to full, complex, material definitions. Whereas in my use case, I'm trying to export a simple shading material.
Update 2: A poster commented that they didn't have access to the turbosquid link above.  To accommodate I've include a link to the blender file here: https://drive.google.com/file/d/1DNeYYSNaGzGhzb7gzv_8NRT-B-lsuiTt/view?usp=sharing

Possible duplicate of .fbx export why there are no materials or textures?

You using cycles?

Duarte - The question you mention seems to be referring to full, complex, material definitions.  Whereas in my use case, I'm trying to export a simple shading material.  With that in mind, I don't think my question is a duplicate.

David - I'm not sure if I'm using cycles or not.  How can I check for that?


text:
Rope dynamic physics
So I'm creating an animation and I've faced a serious problem. There's a moving object and I want a rope to be attached to this object while its moving, and the other end of the rope should be connected to somewhere else offscreen. I've used some techniques I've seen on youtube. But none of them were good for my case. Some tips would be appreciated.

I did 2 things. 1) I created a bunch of cubes then connected them together and then hooked them to a curve. In this case, the rope would stretch. 2) I created a curve then gave it a cloth modifier but I was not able to get it to work(It would connect to the moving object but the other end would not stay at a  fixed position.

Thanks. It solved my problem. I made the mistake of hooking the vertices directly to an object rather than to an empty then making it a child of another object.


text:
"use self" in driver inside Geometry Nodes
I need to make a geonode that will be used by several objects.
I need to use a custom property inside the geonode.
This custom property is carried by the object that uses the geonode.
I thought that using the Self Object would let me access the properties of the object that uses the geonode. It doesn't.

Note that in my example, I do not try to access a custom property (yet), but just a simple scale ... No need to say that I get the same problem with a custom property ...
Am I doing something wrong?
Any idea?

Just try the node Self Object in combination with Object Info and Separate XYZ. Then you have the Location.

You can't, probably for the same reason you can't do that inside a material. Some node trees can have multiple users. Geometry Node trees are evaluated separately for each object, so there is some room to implement it in Blender, but I'm 99% sure it is not yet implemented. What you can do is put a driver on the modifier, which is unique to each object. But then the driver won't be there when the modifier is added by some user of your asset… Of course if you relly want to access the location, then quellenform's suggestion will work.

Thanks you for your answers.
Alas, as I said, the location is not what I need. It is a custom property.
@Markus, I am 99% confident that you are 99% right when you say you're 99% sure.
And as there is a Self object node available, there is probably just a bit of work left to do to implement this.
Right now the object info node is relatively poor and does not provide much info.
A depressing workaround would be to pass a float value  through the scale of the object, for instance, and unscale the geometry within the Geonodes.
Should an improvement be proposed on Blender community ?


text:
Animated Shape Key on a Rigid Body : The shape change is ignored by the physics simulation
I need to animate the shape of an Rigid Body object with shape key.
The problem is that the Shape Key animation is ignored and only the initial Shape is taken into account in the Rigid Body animation.
It is well detailed here :
Youtube tutorial
Here the ball is getting bigger but is still acting as if it was small ( same as me when I gain weight ).

Here is my Blender 3.6 file:

( The clean version, without the problems mentionned by Gordon in the comments )
Sorry ... but I suspect that I have missed something obvious here.
Thanks !

i think this might be a bug

Thanks Chris. Worst case scenario. Is so, the question is : since which version ?

@Nicolas Sorry, we are not keeping track of all functions in each Blender version. In general the Rigid Body physics are a bit buggy sometimes. If I build something like shown in the video, it can work. Playing with a few parameters might result in weird unpredictable behavior though. But, in your file I found a few things that surely will not help: you haven't applied the scale on the objects, this can lead to issues. There are drivers on the scale of the sphere which is problematic and different from the tutorial. Then your objects are huge. Also bounciness is buggy with deforming.

Thanks Gordon, you are absolutely right.  I applyed the scale and removed the (useless) driver. The problem is still here. ( Sorry I should haved delivered a "clean" file. ) I am going to try this on my older versions.

I have tryied with older Blender versions up to 2.81.
The problem is still here.

this time you didn't apply the rotation. if you apply it, it works. Looks like scaling your object during animation was the problem, changing shape keys seems to works (at least in my tests)

@Chris, I don't get It. I applyed the ball's rotation, but , no change. 'Looks like scaling your object during animation was the problem ' but what is scaled ? Sorry ...

i didn't mean the ball, but the passive part below it. You scaled the ball in the first version of the blend file, which you deleted now. I rebuild your setup in a clean small way, and with shape keys it works fine, as soon as i keyframed the scale, it didn't work anymore.

Well, I rebuilt the setup ... and it works.  But I don't see ( yet ) what made the other version fail. I go for a little inquiry, replacing the elements one by one ...
( ending this post without a proper answer would be embarassing ... )

Well as Chris said, rebuilding the setup in a simple and clean way provided a working example.
By comparison,I found that setting a low sensitivity margin for the ball ( 0.001 ) could lead to the same simulation fail.
Sadly, if I set the default value ( 0.05 ) in the failing example I provided ( for the ball and the floor ), I can't get to make it work. So this sensitivity margin value cannot be identified as the sole cause of this problem.


text:
Function to keyframe any custom property; curve created but animation ignored
The original question was in fact ridiculous, a very basic syntax mistake. I corrected the error. But something more interesting occurred :
Although the animation curve is created, it is ignored and the custom property remains constant.
But :
If I move a keyframe in the curve editor, if I close Blender and reopen the file,  if I delete the keyframes and undo, then the animation works.
This is strange and inconvenient.
Context :
I need to animate a set of custom properties for a bunch of objets.
I found convenient to create a function to do it.
Here it is :
def KeyframeCustomProp ( obj , propName , value , time ):

    string = "[\"" + propName + "\"]"
    obj[propName] = value
    obj.keyframe_insert(data_path=string, frame = time)

I test the following calls :
KeyframeCustomProp(cube,"prop", 0.0,  10)
KeyframeCustomProp(cube,"prop", 1.0,  45)

My use :
I have a big collection of instances. I need to animate the material(s) individually.
The material of the instanced object uses the attribute node to get the value of a custom property set on each instance.
It works ... I just need to animate these custom properties. The function lets me do it ... and with multiple custom properties if needed. ( although the curve created is ignored )
The material of the object ( generating the instances ) uses the attribute node :

Here is a simplified example with 2 instances. The first one gets its material animated independently from the other :

To reproduce the problem, delete the keyframes and run the script, you'll see that the "prop" custom property remains constant ... untill I do one of the inconvenient things mentioned earlier.
T H A N K S

instead of escaping double quotes, just use single quotes either for your string or for the string inside, plus use formatted strings to easily embed variables: obj.keyframe_insert(data_path=f"['{propName}']", frame=time)

Thank you Markus ... that's much more elegant.

Although I get "TypeError: bpy_struct.keyframe_insert() property "['prop']" not found" if I replace just this line in my file ... which does not make no sens for me.

I just checked, apparently I was wrong, and single quotes inside don't work, so you need obj.keyframe_insert(data_path=f'["{propName}"]', frame=time) (tested this line)

No error. Cool. But something weird happens : I see the curve of the animated Custom Property, but its value is ignored in the material and it does not change in the Object Property tab. Insane.

If I move a keyframe in the curve editor, the changes are ... validated, and then it works ...

If I close Blender and reopen the file, the curve is also taken into account (using Blender 3.4 ) ... Isn't this a little bug ?

Same thing if I delete the keyframes and the undo. The curve is effective. Note the same thing occurs in your version and in mine ...

I think there's a need to "refresh" Blender when you made changes in animation via Python. At least I remember having similar issues, and doing some operations that update the viewport seemed to fix it. In my Convert Rotation Mode addon, I change the current active frame, partially for that purpose if I remember correctly.

Thank you L0Lock, but my scripts changing or creating an animation via Python did not need this. Here, the problem began when I animated a Custom Property.
BTW, alas, changing active frame did not wake Blender up.


text:
What are some use cases for the singlar ray output?
Using the singular ray output, it's possible to detect whether or not the object is being viewed through a perfectly sharp reflection or refraction:

Besides changing colors of reflections, what are some possible use-cases for this variable?

Maybe for some sort of vampire effect ?

It can be useful for subtle effect in glass refraction without have to go through the pain of caustics effect etc.

I still have not spent the time to do a proper write up of this, but here is a preview of the effect, and the Blend File for your own use.
Even though this seemingly begins to look like a distance based thing, I really believe (in my own opinion, without further study) that this is still using amount of refraction as the basis for this effect, and the margin is pretty small. I would imagine that playing with settings such as the ones found here: This Link would change this potential up quite a bit, how ever I can see some sequential lighting animation being done with this node, as long as each light would have to pass through something that would cause this type of refraction like the glass prism shown in this answer.

Note tat the Is Singular Ray value is actually doing nothing in your example.  The trig functions only take one input, the second one is ignored.

Definitely my mistake, I just left the Is Singular Ray Plugged into the math node, and somehow switched and forgot it switched. Great Catch.  I am still experimenting though, and after I do, I'll post a write-up as a Pre-pend to my bogus answer. Just a note on what I'm going to write up... Is Singular Ray can act as an inverse of the Ray Length Node, which may spark some more ideas on how it can be used, but in the write up, I will demonstrate what I mean. Just need to find the time to gather it all together.


text:
How to Make Multi User Objects Single User?
I duplicated a few objects with Alt+D and now I want to apply some modifiers to them, however I can't, because they are multi-user objects.
I tried U > Objects but I still can't apply the modifier.
How to make multi user objects single user?

check this video if your still not having any luck... it worked for me... https://www.youtube.com/watch?v=DwmdbMsnANw

For Blender 2.8+ it's in the 3D View main menu
Object > Relations > Make Single User > Object + Data > Selected Object (or All if you need that)

life savior, still in 4.3

Press U > Objects and Data. Then apply your modifier. Using just Object will make the object a new, separate datablock for the mesh (but will ignore modifiers). However, using Object and Data will make both the objects mesh and it's modifiers a new, separate datablock.

Oh hey, I was about to post asking how to do this in bulk because I thought I'd tried this and had it not work for me... but now it does! The magic of searching. ... Also I think the 'object' part is only relevant for objects that are in more than once scene, since there's no way for different objects in the same scene to share a modifier stack.

Why is it that when I hit the space bar and enter "make single user", select the only option in the list I only get options "Selected objects" and "all"?While pressing "u" gives "Objects and Data" as option as well and the option list has the header "Make single user".

Go into Data properties, and small number button next to the data name. This will create a single user copy of the data.
Note that you have to make only the data single-user.

You can also just use Alt+C > Mesh from Curve/Meta/Surf/Text to convert it to a mesh. This will apply the modifier for all instances of the mesh. This means you can get just one instance looking exactly how you want it, use the Alt+C command, and it will be applied to all the meshes.

Useful trick to know, but not very helpful if I only want to apply one modifier to one object..


text:
How to use an animation for one object on another object?
I've animated the location of a text object, and now I want to use that same animation on many other text objects at arbitrary times. How can I do this?

Would this previous BSE answer help?

When you keyframed the locations on an object, an action has already been created

Select the object which should be animated
Switch to the Dopesheet and change to the Action Editor
Assign the action to your object. (default name here is Textaction)

Note that the keyframes have absolute coordinates, I you're looking for relative changes you would need to offset them in the NLA-Editor (or alternatively change the origin of the individual text objects).
When you want start animations at different time offsets you would need to place them as Action-Strips in the NLA-Editor there you can move the strips to the time offset they should start (and even scale the duration).

I think I'm missing something.. How can I make it so each object using the action plays it at a different time? Currently they all just go at the same time..

You would need to place them as Action-Strips in the NLA-Editor there you can move the strips to the time offset they should start.


text:
Is it possible to view the scene in the viewport camera view at 1:1?
I'm manipulating some things in the scene from camera view, and I'd like to be able to tell exactly how big they will appear in the render.
Is there some way to make the camera view zoom to 1:1 in the viewport, without rendering the scene?

Yes, Blender has this feature:
From the 3D View Header:
View -> Navigation -> Zoom Camera 1:1 (Shift + NumpadEnter)


text:
Which is more efficient? duplifaces, particles, or group instances?
Particles give more controls for doing things like randomizing rotation of instances, but duplifaces and group instances allow for rotation and scale of individual instances.
For something like creating a forest with a lot of trees, is it more efficient to use a particle system? Or a dupliface object?
What is the most efficient way to instantiate a large number of objects?

By "efficient" I mean in terms of rendertime/memory usage.

I do not know the specifics of Blender's implementation. But, it seems to me, they would use the exact same algorithm in both cases. With particle instancing, you have a position vector and a transformation matrix for each particle. The only difference with dupliface is the position vector is determined by an object's face, rather than a particle.
So, memory is going to be the same. Render time should be the same, unless you're using extra features. For example, you can have objects deform along a particle's path when using particle instancing. The deformations would take extra time to compute when rendering.

Deformations should only increase Building time, not Render time.

@someonewithpc building BVH is done for rendering, so you could arguably consider it as part of render time..

@gandalf3 but if you use Cache BVH, it skips building and just renders...

@someonewithpc True.. But only only if nothing changes. But whether it's building time or render time is pretty trivial imo. Doesn't really matter :P

@gandalf3 No, it doesn't, really. :D


text:
Does the Vector Math Normalize operation use the second input?
The Vector Math node has an operation called Normalize.  I have always presumed that this is a monadic operator which ignores the second input and returns a unit vector in the direction of the input vector.  This is also what poor said in this answer.
However, I was recently reading the manual and noticed that it says:

Normalize
  Normalizing input 1 and 2.

Which is super-duper unhelpful.  I have never known of a binary "normalize" operation (and couldn't find one in a quick Google search), so I don't know what "Normalizing input 1 and 2" means.
So what is going on here?  Does it use the second input, if so how?  Or is the manual just plain wrong?

Input 2 is not used, manual is wrong, I guess. Links to the source code for the node are below, you can clearly see input 2 is never called when in normalize mode.
SVM: https://developer.blender.org/diffusion/B/browse/master/intern/cycles/kernel/svm/svm_math_util.h
OSL: https://developer.blender.org/diffusion/B/browse/master/intern/cycles/kernel/shaders/node_vector_math.osl

authors: Екатерина Астрелина


text:
When to use add shader?
I know the basic difference between a mix shader and an add shader, this question is about the applications of each.
I have heard that add shader should be used with translucent shaders.  But in answering a question about the difference between add and mix, Maccesch said "Add Shaders aren't necessarily physically correct.".  So my question is what does "aren't necessarily" exactly mean; and when, if ever, is an add shader appropriate when making physically-correct materials?

I think Maccesch meant that in the context of reflecting shaders.
Think of it this way:

In a diffuse+translucent material, you want the light transmitted through in addition to the light reflected off the surface.
Though you may want to darken the translucent node a bit to simulate absorption:

In a diffuse+glossy material, you want some of the light to be reflected specularly (glossy), and some to be reflected and scattered (diffuse).
Here "some"  can be conveniently defined by the factor of a mix node (which in this case is defined by the angle of the surface to the camera, via a fresnel node). Using this setup, at most you can reflect the same amount of light as received:

You don't want to reflect more light than what hits the surface, as easily happens with an add shader:

The exact difference between the two nodes is nicely covered in question you linked.

Thanks for the answer, that explains it very nicely.  One more thing comes to mind; using your logic for the translucent shader, should the add shader be used for SSS as well?  I usually use a mix for SSS.

@PGmath I've often wondered the same thing ;) I think the SSS shader is sort of in-between, as there is backscattering (which comes out pretty much like diffuse reflection) as well as transmission. I usually use a mix shader too, but I guess whatever looks good.

The add use-case with translucent shader does not conserve energy, you might want to change the example to volumetric absorption. As it turns out people are still pointed to this old answer and it might confuse them.

I'd argue that the add shader is never physically correct, since it duplicates the incoming energy, and adds the results.  But you can still produce physically plausible visual results through careful accounting.
In this answer, three glass shaders are added together.  But each shader absorbs two out of three colour channels, so the outgoing light energy matches the incoming light energy.

As a physical model, there would be anomalous heat generated, but cycles doesn't track that anyway, so it works fine.

The way I see it -

Most shaders like diffuse and glossy will "reflect" the same light from Light A to the camera with a different appearance. These should be mixed together.
A translucent shader allows additional light from Light B to pass through the object, reducing it's intensity along the way and should be added to the Light A result.
So you mix different effects from the same light and add effects from new sources of light.
With a SSS shader you have a bit of both, it is originating from the same light source, yet it is passing through the object and bouncing back in a similar way to the translucent effect.
But remember, at the end of the day it is only an artistic choice, use the one that renders a result that you are pleased with. It doesn't take long to compare the two.


text:
What units does the cycles SSS scattering radius use?
As a sort of follow-up to this question, what units does the scattering radius use on a cycles subsurface scattering shader?

I can't find anything definite, but I would assume that it is in Blender Units.

There is a BlenderArtists thread on this subject. In it it is said:

About Scale: 1 blender unit = 1 meter. (I use metric system) don't know how works with Imperial, never tested.
Scale is actually multiplied by the Radius then, so if you use Scale = 1.0 and Radius = 0.1, 0.1, 0.1 is equal to Scale = 0.1 Radius = 1.0,1.0,1.0
When using colors it's the same but calcs are not that quick, at least for me.
Let's say we want the monkey to sub-surface scatter a bit of red like my example above. Setting Scale = 0.1 And Radius = .5, .05, .05 (RGB!) will give the same output as Scale = 1.0 and Radius = .05, .005, .005 (as you see I divided by 10 the Radius values to compensate the Scale being 10 time bigger)

The radius appears to be derived from both the scale of the object and the radius values. Applying the scale should change results, and is a good way to test this theory.

I think they are talking about the scale spinner on the SSS node, which (according to them) works just as I guessed, just a multiplier to the radius.  In terms of my question though, I gather from the first sentence that it uses blender units (=meters).  Is that how you read it?

That is what I gathered. Again, I am not sure how reliable a source that person would be for something like that, but it could be a good working hypothesis.

Scale seems to increasing the number of rays rather than how deep they penetrate the surface.  Radius acts more like depth.  Its the radius that matters most but the way it works in combination with scale is weird.

As informative as this is, it doesn't really answer the question.

authors: Михаил Беззубиков


text:
want to run two actions when pressing a hotkey
I have these two actions
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
bpy.context.tool_settings.mesh_select_mode = (True, False, False) #vertex

currently I'm running it from the text editor in blender and it works fine.
I would like to create an addon that could...
run both actions (w the vertex variation) when the Key "1" is pressed,
run both actions (w the edge variation) when the Key "2" is pressed,
run both actions (w the face variation) when the Key "3" is pressed
So far I have this script(addon) working from the text editor, n can be installed n enabled
# by EB, done with blender 2.79
bl_info = {
    "name": "EB 3Dview >> EditMode >> VertexSelect",
    "category": "3D View",
}

import bpy

class view3dEditModeVertSel(bpy.types.Operator):
#    """Edit Mode _ Vertex Select"""      # blender will use this as a tooltip for menu items and buttons.
    bl_idname = "view3d.editmode_vertsel"        # only lowercase allowed # unique identifier for buttons and menu items to reference.
    bl_label = "view3dEditModeVertSel"         # display name in the interface.
    bl_options = {'REGISTER', 'UNDO'}  # enable undo for the operator.

    def execute(self, context):        # execute() is called by blender when running the operator.

        # The original script
        bpy.ops.object.mode_set(mode='EDIT', toggle=False)
        bpy.context.tool_settings.mesh_select_mode = (True, False, False)

        return {'FINISHED'}            # this lets blender know the operator finished successfully.

def register():
    bpy.utils.register_class(view3dEditModeVertSel)
    # bpy.ops.view3d.editmode_vertsel()

def unregister():
    bpy.utils.unregister_class(view3dEditModeVertSel)

# This allows you to run the script directly from blenders text editor
# to test the add-on without having to install it.
if __name__ == "__main__":
    register()

Hi dr Sybren, ok I got the Addon working w hotkeys and all, I just was wondering, if is it possible to write the "Select Vertex", "Select Edge", n "Select Face" in a single addon, each one with its own hotkey, cuz I have seen that other blender py addons have multiple hotkeys assigned to them, please could you provide a code example for that?
btw would you know what is the difference between these two?
km = wm.keyconfigs.addon.keymaps.new(name='Object Mode', space_type='EMPTY')
kmi = km.keymap_items.new(view3dEditModeVertSel.bl_idname, 'SPACE', 'PRESS', ctrl=True, shift=True)
kmi.properties.total = 4
addon_keymaps.append((km, kmi))

the former is from the Blender Addon Tut, the latter from "PieMenu Addon"
km = wm.keyconfigs.addon.keymaps.new(name='Object Non-modal')
kmi = km.keymap_items.new('wm.call_menu_pie', 'Z', 'PRESS')
kmi.properties.name = "pie.shade_of"
addon_keymaps.append((km, kmi))

thanks advanced.

The most future-proof way to go about this is to create your own add-on. First create an operator that performs those actions. You can then bind that operator to the keyboard, add it as a button to a panel, add it to a menu, etc.
This is all documented in Blender's documentation.

Hi dr Sybren, please could you provide a code example? I'm new in programming. I had tried reading the blender addon tut before, but I just don't know what class to use for the two actions that I have in my script above. thanks advanced again

There are code examples in Blender's documentation. Just follow the links and read a little.

I do have read it, I added the code I'm trying in my question, but it doesn't work, please could you correct it? thx advanced.

I can fix it, but only if you tell me what's not working, what errors you get, which version of Blender you're using, etc.

thx dr Sybren, I'm using the last version of blender, I edited my question, added the console error msg, many thanks, I know a bit of python, n AHK, but really blender API is overwhelming

The bl_idname must be in the form "xxx.yyy", so two components separated by a dot. Also I can recommend following PEP-8 when it comes to naming things and formatting your code.

Hi, dr Sybren, yes I fix it, I realized the name didn't allowed Uppercase, I edited my question, adding the script(addon) that runs fine in the texte editor, I can install it, enable it, but I just can call it when adding a hotkey, the value that must be place in "None" I don't know what to put there, I tried bpy.ops.view3d.editmode_vertsel() but it doesn't work, the console panel says search for unknown operator thx advanced

Hi dr Sybren, ok I got the Addon working w hotkeys and all, I just was wondering, if is it possible to write the "Select Vertex", "Select Edge", n "Select Face" in a single addon, each one with its own hotkey, cuz I have seen that other blender py addons have multiple hotkeys assigned to them, please could you provide a code example for that? thanks advanced.

To have an operator perform different tasks, you'd have to add a property (probably an EnumProperty) to it, and change the behaviour based on the value of that property. Blender's documentation already has a code example on this topic too, albeit a rather minimal one. You can use self.my_float to access the property value of the example.

Note: I created a bug report about this shortcoming in the documentation, which also contains another code example.


text:
Frame handlers ( pre and post ) : Crash trying to rebuild the scene for each new frame
Instead of using keyframing, I try to rebuild a scene at every frame. It means deleting all the animated objects and rebuilding them. Their geometry and properties depend on frame number and the value of an animated custom property (x).
For this, I use :
bpy.app.handlers.frame_change_pre.append(frame_handler_pre)

... which lets me execute a function ( a handler named frame_handler_pre ) before the frame is built.
The crashes at render are so frequent that this file is not really usable.
To isolate the problem, for this post solely, I built a file as small as possible, with one object depending on a custom variable x and frame.
My code :
import bpy
import math
import numpy as np

def frame_handler_pre(scene):
    # Not used (yet)

def frame_handler_post(scene, depsgraph):
    dg = bpy.context.evaluated_depsgraph_get()
    frame = scene.frame_current

    M = scene.objects["M"]
    current_world = scene.world.evaluated_get(depsgraph)  # HERE
    x = current_world["x"]
    M.location = (x,x,x)

    if bpy.data.objects.get("Point") is not None:
        obj = bpy.data.objects["Point"]
        bpy.data.objects.remove(obj, do_unlink=True)

    #create mesh and object
    bpy.ops.mesh.primitive_ico_sphere_add(subdivisions=2, radius=1.0, calc_uvs=True, enter_editmode=False, align='WORLD', location=(x,0,0), rotation=(5*x, 0.0, 0.0), scale=(1,1,1))

    object = dg.view_layer.objects.active   # error : 'Depsgraph' object has no attribute 'active_object'
    object.name = "Point"

#    Event Listener   Frame Change
bpy.app.handlers.frame_change_pre.clear()  # just once
bpy.app.handlers.frame_change_post.clear()
bpy.app.handlers.frame_change_pre.append(frame_handler_pre)
bpy.app.handlers.frame_change_post.append(frame_handler_post)

Any idea to improve this ?
T H A N K S !
My  file :

Hello, I think def frame_handler_pre(scene): can take an optional despgraph argument like frame_handler_post. eg change it to def frame_handler_pre(scene, depsgraph):

"instead of using keyframing, I try to rebuild a scene at every frame. " Why?

@Gorgious Hi, and Thanks but adding the argument  :  AttributeError: 'Depsgraph' object has no attribute 'active_object'

Hi Martynas, I thought I would have more freedom and more clarity. Having to keyframe vert's position for instance seemed heavy and tedious. Being able to develop an object's geometry slowly frame by frame for (another) instance seemed interesting ...
But if the price is too heavy in terms of trouble and carshes I'll go for keyframing ...

Depsgraph doesn't have active_object as a member but it does have a view_layer as a member which has an objects.active you can access. See https://docs.blender.org/api/current/bpy.types.Depsgraph.html#bpy.types.Depsgraph

Even if you want different meshes for each frame, you can use keyframe animation for hiding and showing them. Handlers may not work well when rendering an animation(depending on what you do with them), because context is different during rendering. You may encounter unforeseen problems, if you decide to do things different way than they are done. It's best to at least make a decent attempt to use existing functionality before going to totally custom solution with Python.

Yes Martynas, this is was a little voice in my head is telling me, louder and louder. But at least I wanted to give it a try. And considering the amount of posts about it, here and there, I feel that I am not the only one, and that solving this could be useful to others ...
Last reason, but not least : I am stuborn.

object = dg.view_layer.objects.active  ends the two symptoms I was dealing with. But the rendering is unstable and often crashes.

Just one question about the good practices in this forum : As a correction ( Thanks @Gorgious ) helped to narrow down the problem, is it pertinent to edit the main post and change the question and its title ?

Yes, if it adds value to the question, you can modify the title and body. However if it totally changes the meaning of the question, you should post a new question instead of overwriting this one

@Martynas , I am right now building a version of the file with keyframed animation. It gives me another reason to use the frame handler approach : you need to build a function to construct the object, and ANOTHER one to keyframe their vertices. Both functions have the geometry of the object in common (the order of the vertices their index ), so changing anything in this structure needs to be repercuted to both fuctions ... unless you make a third called by the two others, and compatible with them ... well. It is not at straight forward as the frame handler approach. What do you think ?

I think you need to step away for a minute and rethink the bigger picture. Do you need Python to generate the geometry, might it be easier to just model different versions? Is it maybe possible to use Geometry Nodes for procedural modelling/animation? Even if you need Python, can you maybe think of a way to do that more efficiently? If you want help with this, it might be worth to consider asking another question describing the full context of the higher level task.

Well, the purpose is to illustrate some math courses. I defitely need Python. Geonodes is great for a lot of things, but not for this.
I have just finished the big file with keyFraming istead of handlers. It is able to draw and animate curves ( morphing ), lines and points. It is satisfying. So it is a good day of work. Thanks for your advices ...

@Nicolas I had a look at your file that I missed previously. It makes little sense, to be honest. It's completely unclear what you are actually trying to do though. I would advice to consider asking for help providing the full context, maybe in the future questions. This is clearly an XY problem. You could save yourself some frustration. It seems to me you don't have much knowledge about functionality in Blender and so you tend to do things the hard way. People here can help, but only if you provide full context.

@Martynas "It's completely unclear what you are actually trying to do" Sorry  as I built this minimal example for this post. Indeed, its purpose was not to "do something" except isolating the problem. The full context was too much. That said, in your answers, since the beginning, I can't help seeing an slight desire to put people down in a place where people help each other out ... which is here possible as Gorgious did it, writing far less than you.   Please accept that what you don't understand is not necesseraly weak and absurd, it might simply be poorly explained ... my bad.

These are all comments though. The question did not get any answers. Sorry about my rudeness, I am still trying to help though. And I do believe that I am still right in this case and more context would benefit the question and it is still possible you are missing something here. The code in the file makes no sense - you don't need to delete and add a new object just to change it's position and rotation, so there is a chance you might be doing something absurd here, it's simply not possible to rule that out by looking at the code example.

But you are right - I don't know if it is weak or absurd. If you know for sure that's what you need, that's fine, if you don't and decide to provide more context, I will however attempt to figure it out no matter my tone or pleasantness. I hope this sort of balances things out.


text:
frame_change_pre handlers : accessing a custom variable in render
I tried to use frame_change_pre to animate my scene in a fully python generated way ( No keyFrame ).
The scene worked fine in viewport but stood still in render.
So I went for the onion strategy : I striped my file of the most complicated objects and python function. The result is the following minimal file ... that still has the same problem.
Here is the Python code :
def frame_handler(scene, depsgraph):

    frame = scene.frame_current
    M = scene.objects["M"]
    current_world = scene.world
    x = current_world["x"]
    M.location = (x,x,x)
    print(str(x))

#    Event Listener   Frame Change
bpy.app.handlers.frame_change_pre.clear()
bpy.app.handlers.frame_change_pre.append(frame_handler)

Edit : As I said in the comments, the problem comes from x = current_world["x"]
Accessing this custom variable during render is the problem.
If I change it with x = frame/30   ... I get the motion ...
Any idea to solve this would be welcome and would let me add back a few onion layers ...
T H A N K S.
Here is the file :

Does it work if you also append your handler to bpy.app.handlers.render_pre or bpy.app.handlers.animation_playback_pre?

Hi Jakemono, Same problem with both ...

When I replace x = current_world["x"] by another way to change x like x = frame/30  ... it works. So the problem is to access this custom property ... during render ...

This is not yet a correct "minimal working example", because I get errors related to file paths which obviously aren't present on my machine. Please create a new project, and reproduce the problem there using as few steps as possible. How to upload a blend file on BSE - good practices and advice

You need to evaluate the frame first before you can access the evaluated data, which you do by using the frame_change_post event and accessing the depsgraph argument:
import bpy
import math
import numpy as np

def frame_handler(scene, depsgraph):

    frame = scene.frame_current

    M = scene.objects["M"]
    current_world = scene.world.evaluated_get(depsgraph)  # HERE
    x = current_world["x"]
    M.location = (x,x,x)
    print(str(x))

#    Event Listener   Frame Change
bpy.app.handlers.frame_change_pre.clear()  # just once
bpy.app.handlers.frame_change_post.clear()
bpy.app.handlers.frame_change_post.append(frame_handler)

If you really want to do this in frame_change_pre then you could have both _pre and _post and in the _post store the last evaluated value (which will be 1 frame behind when accessed by _pre) or otherwise you can evaluate the fcurve associated with the property to get the data for current frame number... Of course this solution is not generalized and it works when the property is animated by an f-curve, not when the relation is more complex and requires evaluating the depsgraph.

Thanks Markus !  ( Your answer is clear, usable, and used : it works ). Though as I said in the original file, I experience a systematic crash, probably du to the use of context as in bpy.context.collection.objects.link(object). I am not sure how to replace this lines using depsgraph instead ...

"Though as I said in the original file, I experience a systematic crash" - I only see a "crash" mentioned in your answer where you mention disabling "Lock interface", which is supposed to help with the crashes, but ultimately the problem you run into is that you're changing the scene after it has already been prepared for rendering. So maybe you do want to use frame_change_pre but evaluate the objects of interest using your own depsgraph (dg = bpy.context.evaluated_depsgraph_get()). For an onion effect you might want to play the animation once, gather data, and then render?

As I said, the example provided here is not the original file I was working on, and is simplified for the sake of clarity. ( I clumsily called the simplification "onion striping ). In the original file, I indeed delete and recreate every objects, depending on the animated value of x = current_world["x"] .
So now, I will correct my file using your dg = bpy.context.evaluated_depsgraph_get()
If it doesn't work I may start another post as the problem is significantly different from this post's . ( What do you think ?  ... I create a new post ? )  T.H.A.N.K.S

@Nicolas go for it, perhaps concentrate on the effect you want to achieve, to avoid https://en.wikipedia.org/wiki/XY_problem ? Though remember the question should be simple rather than asking for some complex tutorial on achieving some elaborate effect...

New post :
https://blender.stackexchange.com/questions/322360/frame-handlers-pre-and-post-trying-to-rebuild-the-scene-for-each-new-frame

sadly, I realyse that my new post is another example of XY problem ... ( already posted when I saw your comment )

I unchecked the "Lock interface" option in Render menu.
The problem seems to be solved, as if the Interface was needed to read customs properties.
... but I have now to deal with the numerous crashes my scene generates when the "Lock interface" option is unchecked .


text:
How can I use an image texture as a guide for weight painting?
So I have an image of a map which I would like to use to paint vertex groups (for terrain feature particle systems) on certain areas of an object (a sphere).
I have mapped the map onto the sphere.  But even if I am in material or textured view, when I go into weight paint mode the object turns blue so I can not see the map so I don't know where to paint.
My next idea was to have a second, slightly larger sphere (in the exact same place) with a semi-transparent material of the map on it such that I could see the map on the large sphere and the weights underneath on the sphere I am weight-paining.  But it seems that material view does not show cycles transparent shaders. so the transparency on the large sphere shows up as opaque white and I can not see the weights on the sphere underneath that I am painting.
So is there a way to do this?  Either by showing textures/materials in weight painting mode, or by showing the transparency of the material on the large sphere?  Or some other way I haven't thought of yet to use an image as a reference to weight-paint on an object?
By the way, this is not a duplicate of this or this, both of those answers only work for BI materials it seems, I am using cycles.

Here is my solution:
Create a plane and subdivide it (as many times as you like, depending on your weight paint resolution requirements). Unwrap the mesh. Now you want to create a sphere from a plane using shapekeys. See the Cegaton's answer on how to do it here: What is the best way to unwrap a sphere?

When your transformation is ready, check the Basis key and add your heightmap image as a background image. Scale the added image to fit the size of a plane and check the image display type to Front. Set the Opacity value as you like.

Now you can easily paint in Weight Paint Mode, seeing a heightmap texture.

Transform a plane to a sphere using shapekeys.

As you can see all work quite nice.

You can change the weight painting colors, which might help with this.
Go to the Edit menu and click on Preferences

Then go to Editing and find the Weight Paint section and click on Use Custom Colors. The default custom color ramp should have white at one end and black at the other. Adjust the colors in the ramp as you would any other color ramp in the node editor. If your ramp has white or a light grey on the left hand side, unpainted parts will show up more or less like a texture without an overlay. If you are in weight paint mode when you open preferences you should be able to see the overlay updating as you edit the ramp.


text:
What happens when you plug a BSDF into a value socket?
What happens when you plug a BSDF (shader) socket into a value (float/color/vector) socket, or vice-versa?  Obviously there is no way to convert a function to a value, so what does blender do?
From some simple testing it seems that it converts the BSDF to 0.5, but sparked by the discussion in comments on this answer I would like a more definitive answer.

It doesn't do anything.
Cycles will use the value specified for that socket and ignore the invalid connection:

This example uses a color input, but the same applies for value inputs.
As you can see, the render result is the same with or without the diffuse node in the above setup.
For some explanation on why cycles works like this, see Convert cycles closure (shader) output to colors?
For a workaround, see Is it possible to use the output of a Renderlayer in the material nodes of another RenderLayer?


text:
What is the technical difference between conformal and angle-based unwrapping?
When unwrapping an object, there are two options for the Method to use: Conformal, and Angle Based.  What is the technical difference between these two methods?

I usually leave it at Angle Based, but sometimes that distorts tight geometry and I switch to conformal.  So basically I just blindly see which looks better project by project, I am interested in how they work.
Note: I am aware of this question and answer, but that more addresses the use of the two methods, I am looking for the technical difference.

Conformal
Uses LSCM (Least Squared Conformal Mapping). This usually gives a less accurate UV mapping than Angle Based, but works better for simpler objects.
(As describled by blender user manual)
Attached is the link to the White paper on LSCM
http://www.cs.jhu.edu/~misha/Fall09/Levy02.pdf
http://alice.loria.fr/publications/papers/2002/lscm/lscm.pdf

Please avoid link-only answers.  Someone should be able to find an answer to the question from reading your answer without going anywhere else or reading any 10-page paper.  I specifically asked for the technical difference between the two methods.  (BTW, your two links are to the same document.)

Well technical as it is, the answer isn't a short one so I thought future questions of such nature could be addressed through understanding those technical papers. The reason why there were 2 links is that if one fails there is another one to it. And the topic cannot be easily addressed in one post anyhow "technically".


text:
What is the difference between an edge loop and an edge ring?
I've heard the terms "edge ring" and "edge loop". What do they mean and how are they different?

Edge Loop
An edge loop is a series of directly connected edges:

You can select an edge loop with AltRMB.
Edge Ring
An edge ring is a series of edges which are not directly connected, but share faces:

You can select an edge ring with CtrlAltRMB.

As a bonus, you can run the select edge loop or the select edge ring operator on every selected edge automatically by pressing Edge loop or Edge ring in 3D view > Header > Select.


text:
Where is the render display mode setting in 2.8?
In 2.7x and earlier we have a setting which controls where the rendered image is displayed when F12 was pressed.
The setting can still be set via the python api (bpy.context.scene.render.display_mode), but I can't seem to find it in the gui anywhere. Is it still there? If so, where is it?

I think it has been removed (at least temporarily), the idea is to avoid "temporary layouts" I believe

In 2.81 these settings have been moved to User Preferences > Interface > Editors > Temporary Windows:

I think this is what you are looking for
Good LUck


text:
Is it possible to render other materials besides volumes using a procidural texture to define "density"?
In other words, is it possible to render an image of a cube like this:

But make the "spheres" refractive as opposed to scattering volumes?
When I attempted with this (I did not expect it to succeed):

I got this:

As you can see, there are no surfaces inside the cube.
Is it possible to render a procedural texture in 3D so that black parts bend or reflect light?

BSDF surface shaders only works on 'real surfaces', i.e. faces that are part of a mesh.  Surfaces inside a volume created by change in density will not be treated or rendered with a BSDF surface shader.
This image might be able to show you what I mean. The geometry has a volume shader and a glossy shader, driven by a checkered texture. Notice the shiny material is correctly applied only to the outside surface of the mesh. Interior surface boundaries remain non-glossy.

I don't understand what your first sentence means, and I'm not sure what your image is supposed to demonstrate. Maybe I'm just dense, but I need a little more step-by-step.

@Matt As I understand it, "surfaces" defined by the texture which are inside your actual mesh cannot be rendered as such.

Yeah, that makes a lot of sense. I guess I thought Mike was saying "you can easily assign them any BSDF shader you like (...and it will work as you expect it to)." But he must be saying "you can ... assign them any BSDF shader you like (...but it still won't render any interior part of the 'surface.')"

Sorry about the confusion. I edited my answer, let me know if it's any clearer.


text:
Strange liquid in glass and thick glass behavior
I am doing a chemistry render but I am struggling with my cupric sulfate solution in a flask in Blender : the Volume Absorption node doesn't really works as expected.
I have a too light area and a thin dark zone (instead of the thick one).
I also have a dark area in the thick glass.
Render

Mesh of the thick glass part with sub surface disabled

Node setups
The colors are light shades of blue, darker ones gave a really dark result.

Texture assignment (with normals)

Light Paths

Color Management

I think I gave enough information to solve the problem, but feel free to ask me for more. So what am I doing wrong ?
Thanks for your help in advance.

I believe you are over complicating the problem, I don't think your need all those "interface" materials, a simple Glass and CuSO4 material should suffice for a physically accurate solution. Hard to see in your image, but it seems you also have duplicate surfaces, and inverted pointing normals, the usual setup is generally to suppress the glass surface where the fluid meets it, as far as I know. See https://blender.stackexchange.com/questions/35726/fluid-in-a-glass

It's a solution yes, but less physically accurate (in real life, the fluid doesn't go through the glass).

Finally, I tried several things and I got a better result by reworking lighting and trying a new camera angle. I closed the space where my flask is, added windows, added a ceiling, and added a few area lights at the top. I also tweaked my colors and absorption values. I also separated the interface meshes (now, they aren't connected, but still in the same object).
Here is my result

And here is my CuSO4ToAir material (the only difference with the CuSO4ToGlass is the IOR)

I will mark this answer as solution, but I am still listening to a better solution if you have.


text:
Best way to cleanup these messy edges?
I want to cleanup the highlighted vertices so they are rather sharp edges (which can then be beveled with a modifier if I wish). I've tried just selecting those vertices and doing remove doubles, limited dissolve, and decimate, but each time it ends up affecting the non-highlighted parts (the faces which I want to keep smooth).

Here's another example. I want to clean up the edges without losing the roundness of the pegs:

This is what I ended up with for the first picture:

I've never done that before. Something like described here? https://www.pluralsight.com/blog/tutorials/retopologize-nine-times-faster-shrink-wrap-modifier-blender

Curiously, if I use shrinkwrap with a high subsurface count on the sphere, it keeps the messy edges I'm trying to get rid of. If I use it with a low subsurface count, it doesn't keep enough detail...

I ened up doing a pretty decent cleanup job by using decimate on discrete features, like one loop at a time. In the first picture above, there are 4 loops, and if I decimate them one at a time I could get each one down to 30-60 vertices.

@Matt Chambers - You may want to consider an approach like [img]https://i.imgur.com/lfqChg9.png[/img] in the future.


text:
Hair/Fur Stay flat after collision
I'm trying too create a effect where a door opens and moves over a carpet made with hair, but when i collide with a cube the hair moves back to its original position, is the a way to keep it flat?


text:
Self-Collision not work well
I wonder whether cloth self-collision works.
I created a cloth with two materials and folded them like the first picture.
I started cloth simulation, whose self-collision distance is 0.75. The cloth became strange like it in the second picture.I tried different self-collision distance, but it didn't work well.... Let me show four sets of experiments. I need cloth self-collision in my clothed avatar. Cloth self-collision doesn't work well as I think. Penetration or repel happens on pocket, collar or hip where shirt and pants (they are one mesh object) overlay.
Experiment 1: Large cloth dropped to a cube with 0.75 distance on Self-Collision. The result looks good, but the beginning is not.
Experiment 2: Large cloth dropped to a cube with 0.55 distance on Self-Collision. The result looks bad, but the beginning is good.
Experiment 3: Smalecloth dropped to a cube with 0.75 distance on Self-Collision. The result looks good, but the beginning is bad.
Experiment 4: Small cloth dropped to a cube with 0.55 distance on Self-Collision. The result looks bad, but the beginning is good.

Have you tried Apply Scale? If this doesn’t help, can you share more details of your setup? Eg, show your mesh in Edit mode to show the geometry.

I updated the questions. Scale are applied. Does the mention work? It doesn't turn blue in my commend. :( @RichSedman

Thanks for the additional detail - that really helps to understand the issue. You should be able to have the Self Collision Distance low without ill effect. Most likely the problem is due to the quality of the simulation - try increasing the Cloth Quality Steps from 20 to, say, 200. This will slow down the simulation as it will have more work, but should be more accurate in the sim. If it helps but still not perfect then try increasing even further and/or try increasing the Cloth Collision Quality settings and see how that helps.

The maximum of Cloth Quality Steps are 80 and that of SelfCollision is 10. Still can't get a good simulation. Do you know how people deal with cloth with pocket or collar in the physics simulation? @RichSedman

I’m not all that familiar with tuning cloth as I find Soft Body to be more generic and adjustable. I’ll see if I can replicate your settings and behaviour and try and provide a solution.

I've added an answer. I did manage to replicate your problem and I believe the solution will be to increase the subdivisions - and then leave the self-collision Distance as 0.75. I hope this helps.

The  cloth self-collision is affected by the scale of the faces making up the cloth. This means that when you have a fairly coarse level of subdivision the self-collision Distance will result in a cloth that is quite separated whereas if you subdivide the mesh more finely the cloth is permitted to get closer before colliding. Since you only have a single face-width between your folds the self collision is forcing the sections apart in your first example, resulting in the cloth being blown out into the unnatural shape.
The solution is therefore to simply add more subdivisions. This will result in  the scaling of the self-collision to be more appropriate and will also produce a more natural behaviour of the cloth - but this will also significantly affect the simulation time.
To demonstrate this working, here's my subdivided example mesh :

I first ran the simulation with lower subdivision and a Self-Collision Distance of 0.55. This resulted in overlapping faces as in your second example. Using a high Distance also caused the cloth to 'blow out' as in your first example.
However, the higher subdivisions allow the Distance to be left at the default value of 0.75 without the cloth being 'blown out' while also preventing it from self-intersecting. In addition, the cloth was allowed to collide quite close together so there is not a significant gap between the layers. This produced the following result :

This was produced with the following cloth settings :

If you still have intersection issues (particularly from fast moving collisions) you may need to increase the Cloth Quality Steps and/or the Collision and Self-Collision Quality settings (this will also slow down the simulation).

Thanks for your help. I tried it in my clothed avatar. With a correct setting, the collar and hip look good. I have one more question, can Blender handles 2 or more layers cloth simulation? I dropped two or three clothes on a cube before and got a bad result. @RichSedman

Glad to help. Please start a new question for the multiple layers of cloth.


text:
how to rig leg with hydraulic jack
im modeling a robot and want to have a hydraulic jack on the back of the leg
how can i rig that?

i found  that if you do a copy location and change the Head/Tail value and then add a track to the other side

why don't you mark your answer as accepted so people will be more likely to look at it if they have the same problem? :)

good point i did so now


text:
alpha over node is adding to the foreground artifact that is not in the background
i'm using blender 2.8 beta and i'm trying to conduct a test in which i make a lightsaber without volume for the haze so that the rendition isn't to long, so i used 2 view layers (used to be called render layers) one of the blade and one of everything else so that in the compositor i can change the blade color, and then blur it, and then use a alpha over node to use it for the background of the other view layer. yet it adds a green to the edge of the handle.]2
i'm trying to get rid of the green artifact around the handle of the lightsaber. it is more clear with colors other then white around it but alpha is replaced with white on this site. on the compositer screenshot i gave shows more clearly the problem

Hello and welcome. Could you clarify what your question is? Has it stands there no question mark in your post and it is not clear what you are asking. Please edit your question and use punctuation and paragraphs so it is more clear and we can help you.

The viewer is broken. If you use associated alpha, your glow should work absolutely fine, just display broken in the viewer. For a couple of great answers, see https://blender.stackexchange.com/questions/34002/glow-effect-invisible-on-transparent-background/44137#44137 and https://blender.stackexchange.com/questions/57816/how-do-i-get-the-glare-node-to-output-transparent-instead-of-black-background/57824#57824

thanks that worked

I'm not really sure what you're trying to do, sorry.  This might help, might not: https://uvassociates.in/sites/default/files/resize/remote/c0631e46351ca76e7380488b072beb7f-400x312.png
It makes a mesh invisible and just renders the light from it.  It's an older version of Blender, so may not work.  GL


text:
Half a Diffuse texture comes out as white in render
Tried rendering out my model but half of the ground renders out as white. All the texture is, is a green diffuse texture. In the Rendered View its normal but when I actually render its half green half white.
Rendered View

Render

.Blend File
If anyone has any solution to this, it would really help. Thanks.

Files are gone. Question doesn't make any sense anymore. Downvoted the question, please fix.

There was a hidden layer that was over it. I just ALt + H and it popped up


text:
Normals of exported Blender model (.fbx) are not correct displayed in gameengine (CRYENGINE)
You can see in the first picture that the normals of the left pillar are not correct displayed. This happens with all "subobjects" in the model that are duplicated AND mirrored. The model is created in Blender and according to Blender the normals should be correct as you can see in the second picture.
Does somebody know the reason for that and how to fix it?

Blender 2.79b
CRYENGINE
Model has no texture - just the standard material
Model exported in .fbx

CRYENGINE:

Blender:

Try to apply scale of the object in Blender in Object mode, object selected, Ctrl+A, then recalculate normals


text:
Context Problem in Blender 2.80 python module
I run Blender 2.80 as python module (for running on a server with Django), so there is no gui.
Apparently passing the correct context doesn't seem to work for me in this case.
I have tried many suggested implementations to override context (a lot were for Blender 2.7), but i still get context errors for most operators
For example the line: bpy.ops.object.mode_set(mode='EDIT')
with or without     ...(override, ...
produces the error

bpy.ops.object.mode_set.poll() failed, context is incorrect

and I cannot search through the contexts until for example the correct area is found:
for area in bpy.context.window.screen.areas:
    if area.type == 'VIEW_3D':
        v3d = area.spaces[0]
        rv3d = v3d.region_3d
        for region in area.regions:
            if region.type == 'WINDOW':
                break

override = {
    'scene'            : bpy.context.scene,
    'region'           : region,
    'area'             : area,
    'space'            : v3d
}

as this will produce the error:

'NoneType' object has no attribute 'screen'

When running the following Code:
print(bpy.context.window)
print(bpy.context.mode)
print(bpy.context.area)
print(bpy.context.region)
print(bpy.context.scene)

the output I get is:
None
OBJECT
None
None
<bpy_struct, Scene("Scene")>

So maybe there is no fully set context to begin with? Could it be an option to make a new context?
The problem occurs even when i have a .py (with only some other Django methods) where i use import bpy at the start of the file and do bpy.ops.object.mode_set(mode='EDIT') in an if statement that is activated by django at the program startup.
However this code example works normally and exports a .stl file with a rounded cube:
import bpy
bpy.ops.object.select_all(action='SELECT')
bpy.data.objects.remove(bpy.data.objects["Cube"], do_unlink=True)
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.mesh.primitive_cube_add()
myObj = bpy.context.object
myObj.select_set(True)
bpy.context.view_layer.objects.active = myObj
myObj.location = ( 0, 1, 1)
myObj.scale = ( 1/2, 1/2, 1/2)
mySubsurfMod = myObj.modifiers.new(myObj.name, 'SUBSURF')
mySubsurfMod.levels = 4
bpy.ops.export_mesh.stl(filepath="myExportSTL.stl")

Does someone know how to make override context work in blender 2.80?
Or maybe at least a good resource for deep level commands to avoid operators? Or is there maybe even a way to see the deep level commands which are accessed by the operators (similar to the info screen) in blender?
Thanks in advance!!!

Please provide some example of how you are running this from command line, where and how you are overriding context.

I now added some additional information and did some corrections.

Expect context.window, context.screen etc to be None in headless mode. Where are you getting the error for edit mode change operator?  Recommend using myObj = context.object  A new cube may not always have the name "Cube"

(In the python script which is activated by a button in HTML and Django) i basically only have import bpy and then bpy.ops.object.mode_set(mode='EDIT'). This is enough to trigger the context error. I see the error in the Django interface and in the command window, which is running the Django server.

How about you actually clarify this. Post a script with the operator that doesn't work. Post the command line you are using to call it. I  Don't use Django, however do have bpy as a python module on ubuntu.  No problems calling  operator from python shell

Thank you batFinger!! By trying your python shell idea i have found a solution to the Problem:
I found that in the command window, when I write what you did:
>>python >>import bpy >>bpy.ops.object.mode_set(mode='EDIT') it works normally and prints {'FINISHED'}
So then i went on to search the cause of the error in where exactly i run my script...

...It seems, that the precise location where i do the import bpy is very important.
My error was that I put import bpy at the top of my .py (prior to some Django getUserInput function).
Therefore i strongly reccomend to others working in Django or other python environments
to always use import bpy DIRECTLY before your blender scripting.
I have now also tried to run a more advanced script and it works!

Somehow i did not expect a error of this nature, as the make rounded cube script i posted worked normally.
@batFinger I suggest you formulate this as an answer like:
Expect context.window, context.screen etc to be None in headless mode. Make sure you do import bpy DIRECTLY before your blender scripting. You might also try to run ...(Your Shell Picture)... in your Python shell to see if this works normally.
Then i can accept it as answer.

Shamelessly took you up on the offer. Please feel free to edit in any other info that may be relevant.

Some things to check and look out for.

Expect context.window, context.screen etc to be None in headless
mode.
If an operator works in the python console in blender then chances
are it needs no special window, screen or region for context.  AFAIK
the edit mode toggle operator only needs an editable object active.
Check the bpy module works in your python shell

Recommend using myObj = context.object A new cube may not always have
the name "Cube" eg Cube in another language
The space member of context is context.space_data or from the area as area.spaces.active.

And the answer was, as supplied by the OP

...It seems, that the precise location where i do the import bpy is
  very important. My error was that I put import bpy at the top of my
  .py (prior to some Django getUserInput function). Therefore i strongly
  recommend to others working in Django or other python environments to
  always use import bpy DIRECTLY before your blender scripting. I have
  now also tried to run a more advanced script and it works!

Interesting! I appreciate the answer, but my script still doesn't work even when moving import bpy to directly before the first call to bpy.


text:
How to delete keyframes in the armature
some keyframes are undeletable in dope sheet.

But, they can be deleted one by one in 3D view in object mode.....
This is annoying... How to delete all the keyframes at once?

The file is attached below:
untitle.blend

Can you delete them in the graph editor instead?

The undeletable part are not shown in graph editor... I found this happen only when I added IK feet to the avatar....@Nathan

so what are those keyframes for, feet controllers? Please give more informations, or share your file

Probably, I am not sure. I don't know how to remove it at once. I only can remove it frame by frame in object mode in 3D view.... The file is attached... @moonboots

As you see on my screenshot, some bones have been assigned to some invisible layers, so, even if you can see that there are some active keyframes on the top horizontal tracks of your Dopesheet, you can't see what bones, nor delete those keyframes.
So you can either:

Enable these layers to display those bones (in the 3D view) and their keyframes (in the Dopesheet)
Click on the button Include Channels From Objects/Bones That Are Not Visible (phantom icon) on the horizontal menu on the bottom of your Dopesheet window to display these hidden keyframes in the Dopesheet


text:
Why the edges displayed in render
As shown in the picture, why the square in the red circle looks lighter? I can see the edges in the middle. The normal is correct in edit mode. The shading smooth is is clicked. It looks good in materials.

Probably - inconsistent normals (Ctrl+N with all selected), double vertices, wrongly created (baked with intersecting islands etc) or set up normal map (if in Cycles Image Texture has to be set to Non-Color data). Other than that hard to guess

You're showing us face normals.. have you had a look at vertex normals?

If you upload a .blend, you'll get better answers.

Select the object in object mode and turn on smooth shading for the whole object.

I don't know what is going on. The materials are imported with the models.... This model is combined from two models. It looks strange in texture view, though I modified the texture...
Finally, I delete the materials and recreate it. Everything is somehow good now, except for texture view...

Yes, but I don't know why in the texture view. The model have multiple textures though I recreate a new material.... @cegaton


text:
Low Start Clipping Distance
I have no idea what to do. How do i fix this eye sore?

Answer: The Problem was my start clipping distance was at the lowest setting. Increase the setting and everything will be good.

https://blender.stackexchange.com/questions/86383/jagged-black-edges-artifacts-when-modeling/ and https://blender.stackexchange.com/questions/53825/how-can-i-prevent-my-text-object-from-flickering/53835#53835

I have already removed all the doubles so it cant be that. Im using the archipack ad on and this is the first time its done this.

Yes thats it the clip start distance was way to low.

Check to see if you have double verts. If not, check if you have a duplicate Object in the same place where the artifacts occur. I can't think of anything else.


text:
Scene Organization, When does it get too big?
I'm modeling an entire downtown section of a city - the buildings roads, trees, everything.
But I'm also thinking of using it as a terrain/world in a videogame, where I'm using Unity.  So right now I'm modeling several buildings all in Blender, and I've fooled around with importing them into Unity to make sure it works and it does, but the real question is, as this grows larger, and I have dozens, maybe hundreds of buildings, should I have the buildings in separate Blender files and then combine them in Unity? or Combine them in another Blender file?  Right now I have several buildings wall to wall in one Blender file, and I've got 2 other Blender files with individual buildings from another part of downtown that are disconnected.
Maybe I should keep the individual buildings in individual files, and also have a copy of the buildings in another Blender file? But that would be a pain to update every time I change something.
I like how when I have my Blender models as assets in Unity, I can update them in Blender and it automatically updates them in Unity. Is that probably the best way to organize this?
Thanks for any comments advice or feedback.
Here's a pic of what I got btw:

This is a complicated question. The main things you need to go on are the Principles of Unity project construction, 3D assets creation and optimization, project hierarchy, and the Why question.
If you are new to Unity, it is better to learn some basics, it will save time in the future. First of all, Unity is a good and simple engine for creating mobile games. Its OK for LowPoly but if we are talking about cool architectural visualization of a part of a whole city, it is better to look at Unreal Engine 5 with its nanite system.
When working with 3D Assets, it's worth thinking about where we are now. If we are at the stage of forming a concept, it is good to have one file in which we can compare several buildings, cars, roads and other elements that will fill our scene for the purpose of compositional similarity (such as gamma, scale of objects, the nature of forms). All elements should look like parts of a whole.
During the Asset Creation phase, we need to separate all the models into different files. This will help set the tone of the project hierarchy, not to overload one file, and thus accelerate the work, because in the course of the project each .blend file will acquire textures, references, pre-renderers, and it is desirable to keep it all in separate folders so as not to make a mess in the project.
I have already noted above that it is important to keep the project hierarchy, everything must be organized so that even when the project acquires a large number of files it remains easy to read. And of course if someone wants to join the development it will be easier for him to get up to speed.
Perhaps the most important question to ask is "Why". What is the main goal of the project, to make work in the portfolio, to develop skills in 3D modeling and working in Unity, to get fun with friends in multiplayer, to put the first game in the store, etc.
For all of the above reasons, any experienced 3D artist or developer will advise going from small to big. Big projects look appealing and ambitious, but the cost of a mistake due to ignorance or even a simple change of intent or concept will cost a lot more than if you tried to make one beautiful quarter, or make a story of a single house in the form of a diorama.
As usual: I wrote the answer in a hurry, I will add examples and details in the evening.

Daumn, this is so well put together :). Could've used this advice when starting my first big project :))


text:
Is this a geometry nodes bug or not ? Mesh To Curve node behaviour on 3.6
Notice the difference in behavior between Blender 3.5.1 and 3.6.1, please.
In the latter, split edges are merged into the one spline.
Is this correct behavior?
It's a big difference so it might be a known topic, but let me ask just in case.
[test with same file↓]
I created a simple curve that has six control points.
then I use it in a geometry nodes on a default plane.
3.5.1
3.6.1
Simple WA in this case

Since Blender has to actively merge the vertices in a way to create one spline instead of 5, I would not necessarily think that it is a bug, because it's not like the splitting does not work or something like that, the parts are in fact separate before converted back to curve. The question would be, why was this changed - and this makes me wonder is there now in 3.6.1 a method in _Geometry Nodes _to split segments of a spline into several splines with each only having two control points?

Thanks for your comment. I understand what you are saying. If there is any chance that this is not a bug I will wait for more information around me. (I haven't fully perused the official resources ...... ).
In the simplest case, I think a Separate Geometry node or something like that would be a tentative workaround, I'm sure there are better ways.

Well, the problem is a Separate Geometry node does not split splines into individual segments...

I can't think of any way that this behaviour is desirable. It's semantically inconsistent, Merge By Distance   is available to perform the weld, should you want it .. and yet, as Gordon says, it seems too deliberate to be a mistake. Maybe you should post your workaround as an answer, to be tidy. I think this should be a bug report, if only to provoke an explanation.

Known bug: https://projects.blender.org/blender/blender/issues/109236

Thank you everyone for your comments.
I couldn't find the bug information on my own, so I am very grateful to you for providing the information. By the way, it is also reproduced in 4.0α, so I hope it will be fixed soon.


text:
Strange shadows appearing between transparent objects
Alright, so first off I will say that I am very new to Blender and only started using it a few days ago, so if you want more information or have any solution explain it to my like I am 5 years old. Thank you!
So what I am trying to do is a video transition for OBS Studio, which in this case would be a hexagon grid breaking apart revealing the other scene behind it. I have manage to make everything work, even set up some transparency changes as the hexagons move. However when I check in the renderer on the, what should be completely transparent, hexagon grid there are shadows in the seams of these. If I look in the preview, the surface is completely smooth and solid.

I have tried to turn off every optional shadow that I can find for the grid, even turned off the light and used Emission on the material instead but no luck there. How can I get rid how those shadows?
EDIT:
Here is the blend-file: https://drive.google.com/file/d/1Wd-qnXAuOluV4kLiw8SxE8GrN3w1-54W/view?usp=sharing
EDIT2:
I found a workaround by changing the gap/spacing between the hexagons from 0.0 to -0.0001, essentially completely merging them together. That will work for now, but if anyone has any idea of what the original issue is and how to solve it please let me know!
Using Blender 3.2.2 and Windows 10

do you use Cycles or Eevee for render?

I use Cycles, because as I understood it Eevee can't render transparency in videos. But maybe I am wrong?

@HenrikGrönberg EEVEE can render transparency as cycles do. But EEVEE may have problems with proper alpha sorting in such complex objects.

It is this problem:
Meshes appear darker when rendering with cycles
So just add a small gap:

And transparent passes here:

I believe all you need to do is navigate to the 'Render Properties' tab, scroll down to 'light paths', then 'max bounces'. From there, you need to increase the transparent value up until you don't see those black shapes. I'll attach photos.

Thank you for the quick answer!
I tried doing that, but even if I increased to over 1000 bounces they didn't disappear. However if I did lower the bounces they did become more pronounced (at 1 bounce they are solid black lines), so there seems to be something to it.

Did you change only the transparent bounces, or the total bounces? Also, can you attach your blend file?

Tried to change both. I have linked my blend file in the original post.