text:
Perspective Flatten Geometry by Shrinkwrap
I have a 3D scene I need to flatten towards the cammera in order for the geometry to still appear 3D when viewed in a 2D game from the front. I've done this in Maya with the shrinkwrap method and the "toward the world center" option but so far I've found no way to do this with Blenders shrinkwrap options or any other method in Blender. Is there a way to do this or with a pluggin?
In this example I used a torus and sphere to illustrate what I want but often I need more complex geometry that will not work with by the parallell projection methods Blender uses as it it then like the sphere would overlap the torus incorrectly from the origos point of perspective in flattened form.

bpy_extras.object_utils.world_to_camera_view

Use the world to camera view method to map to image coordinates, similar to a UV with 0, 0 the bottom left hand corner, 1, 1 the top right hand corner.
The z component is mapped to 0 and the width scaled such that the projection image has width 1.
Using the half angle tangent of the camera angle, moving such that the width is one, maps the projection onto the rostrum (face or whatever it's called) of the camera.
>>> from bpy_extras.object_utils import world_to_camera_view
>>> world_to_camera_view(
world_to_camera_view(scene, obj, coord)
Returns the camera space coords for a 3d point.
(also known as: normalized device coordinates - NDC).
Where (0, 0) is the bottom left and (1, 1)
is the top right of the camera frame.
values outside 0-1 are also supported.
A negative 'z' value means the point is behind the camera.
Takes shift-x/y, lens angle and sensor size into account
as well as perspective/ortho projections.
:arg scene: Scene to use for frame size.
:type scene: :class:`bpy.types.Scene`
:arg obj: Camera object.
:type obj: :class:`bpy.types.Object`
:arg coord: World space location.
:type coord: :class:`mathutils.Vector`
:return: a vector where X and Y map to the view plane and
   Z is the depth on the view axis.
:rtype: :class:`mathutils.Vector`

To use the script below select whichever mesh objects you wish to project onto the scene camera plane.
import bpy

from bpy import context
from mathutils import Matrix, Vector
from math import tan, radians
from bpy_extras.object_utils import world_to_camera_view as w2cv

def tocam(scene, obs):
    cam = scene.camera
    cam_vec = cam.matrix_world.to_3x3() @ Vector((0, 0, -1))
    R = cam_vec.to_track_quat('-Z', 'Y').to_matrix().to_4x4()

    s = Vector((1, (scene.render.resolution_y / scene.render.resolution_x), 1, 1))
    # scale based on resolution
    S = Matrix.Diagonal(s)
    # translate such that origin is middle point of image (and hence cam)
    T = Matrix.Translation((-0.5, -0.5, 0))

    for ob in obs:
        ob.data.transform(ob.matrix_world)
        ob.matrix_world = Matrix()
        for v in ob.data.vertices:
            vec = w2cv(scene, cam, v.co)
            v.co = vec.x, vec.y, 0

        ob.data.transform(S @ T)

        ob.matrix_world = R
        angle_x = cam.data.angle_x
        x = (0.5 /  tan(angle_x / 2)) * cam_vec.normalized()
        ob.matrix_world.translation = cam.matrix_world.translation + x
        if cam.data.type == 'ORTHO':
            ob.scale *= cam.data.ortho_scale

bpy.ops.object.duplicate()
tocam(context.scene, context.selected_objects)

EDIT: fix for ortho camera.

When using your script, I get this error: TypeError: unsupported operand type(s) for @: 'Matrix' and 'Vector'

https://blender.stackexchange.com/questions/129473/typeerror-element-wise-multiplication-not-supported-between-matrix-and-vect/129474  Clearly from screenshot this is for blender 2.8.

oh shoot. Could you give me a hint how to change the code, so it works for blender 2.79?

replace @ with *   There is a similar script in question linked to in your recent question.

Thank you, this gives me another error about missing function Matrix.Diagonal(s). But when using the other script you mentioned (I guess this ) the coordinates I get make no sense at all.

Ok. Its a matrix with element  0,0 = scale.x, 1, 1 = scale.y etc.

Okay I got it now. But how do I get all the coordinates now? The ones in ob.data.vertices aren't correct in the end. I am a little bit puzzled.

I tried this: for v in ob.data.vertices:         print("{},{}".format(rnd(res_x*v.co.x), rnd(res_y*v.co.y))) but the coordinates aren't correct.
Is the point (0,0) in the middle of the view?

This could be done with a script, but maybe an existing add-on will do?
If you install the shipped Tissue Tools add-on, you'll find it has a feature: 'UV to Mesh'.
So, having installed, you can set up a camera with the correct perspective view, and a square aperture. Then, while in the camera view, in Edit mode, U unwrap your objects, with the option 'Project from View'.
Then you can use the UV to Mesh option to convert the UV map into a mesh.
The new mesh is placed in the XY plane with UV 0 at World 0, 'attempting to match the surface area of the original object as closely as possible'
This may not suit, in which case a script may be preferable.


text:
bpy - detect modified mesh data (vertices, edges, loops, or polygons) for caching
say I have some deterministic expensive function calc_foo, that operates on a bpy.objects.Mesh.
How can I detect if a given bpy.objects.Mesh object is identical-to (unmodified-from) a previously processed mesh object.

I've never used it, but you could try unit_test_compare See 2nd answer here https://blender.stackexchange.com/questions/28793/how-to-tell-whether-object-is-a-duplicate

@Psyonic thanks for a recommendation, unit_test_compare appears to be quite sophisticated, i think it crawls a huge variety of mesh properties (see https://github.com/blender/blender/blob/3022a805caaec98aa83f6a982eda4cba19659bc8/source/blender/blenkernel/intern/mesh.cc#L766-L807) however, it primarily asserts equality, and I need to determine exactly what is different so these differences can be used as primary keys. Its very interesting to look at blender function, i thought it was much shallower than it is before I found it.

I'm not sure if this is reliable, but for now i'm leveraging python's hash() of strings and tuples to impose an order-based hash of a mesh
def MESH_PROP_cachekey_get(self):
    return str(hash((
        bl_info['name'],
        bl_info['version'],
        tuple(tuple(i.co) for i in self.vertices),
        tuple((i.vertices[0], i.vertices[1]) for i in self.edges),
        tuple((i.vertex_index, i.edge_index) for i in self.loops),
        tuple(tuple(i.loop_indices) for i in self.polygons),
    )))

def register():
    bpy.types.Mesh.cachekey = bpy.props.StringProperty(get=MESH_PROP_cachekey_get)

must be str, because the int is too large for a blender Int
this seems to be a reasonable way to hash a mesh to me,
I can then journal this in bpy
if obj.data.cachekey != obj.get('last_cachekey', None):
    print('mesh is dirty: %s' % obj)
obj['last_cachekey'] = obj.data.cachekey

or
db = dict()
if obj.get('last_cachekey', None) is not None and obj.data.cachekey not in db:
    print('mesh not indexed: %s' % obj)

also, r.i.p to performance doing integer comparisons as strings

source: Stack Exchange

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

sort: votes


text:
how to delete (or select all) all meshes that have no vertices?
how to delete all meshes that have no vertices?
some other software in my pipeline generates lots of these "meshes" that contain no mesh data, Is there build in blender function to select all empty meshes (meshes with no vertices) to handle this kind of mess manually?

Not sure to understand what you mean with "no vertices" because those looke like vertices to me

each orange dot is an mesh object with no verticies

Hello :). Unfortunately Blender seems unable to filter by vertex count. Perhaps a python script would help here.

Maybe related: List of objects in scene with counts (verts, faces, tris)?

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


text:
bpy.ops.console.scrollback_append RuntimeError context is incorrect when called from SimpleOperator template
repro:

Run Blender 4.2.0
File -> New -> General
Scripting Workspace
Template -> Simple Operator

replace main function with
def main(context):
    bpy.ops.console.scrollback_append(text="hello world", type="OUTPUT")

Blender generates a runtime error because object.
Python: Traceback (most recent call last):
  File "/operator_simple.py", line 41, in <module>
  File "./blender-4.2.0-linux-x64/4.2/scripts/modules/bpy/ops.py", line 109, in __call__
    ret = _op_call(self.idname_py(), kw)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Error: Python: Traceback (most recent call last):
  File "/operator_simple.py", line 18, in execute
  File "/operator_simple.py", line 5, in main
  File "./blender-4.2.0-linux-x64/4.2/scripts/modules/bpy/ops.py", line 109, in __call__
    ret = _op_call(self.idname_py(), kw)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Operator bpy.ops.console.scrollback_append.poll() failed, context is incorrect
Location: ./blender-4.2.0-linux-x64/4.2/scripts/modules/bpy/ops.py:109

What context needs to be setup?
in blender 3.x i would specify an override for window, screen, area
override = {'window': window, 'screen': screen, 'area': area}
bpy.ops.console.scrollback_append(overide, text='hello world', type="OUTPUT")

but in blender4, i cannot seem to specify these, either as args (no accepted), kwargs (ignored), or bpy.context (refused mutation, read only). i suppose there are other, less accessible ways to change the window, screen, and area.
might be looking into a temporary change current window

overriding the context of a bpy operator changed, there is now bpy.context.temp_override in blender 4.2+ specifically for changing the window, screen, and area context items.
for example, to bpy.ops.console.scrollback_append to all consoles currently layed out in blender:
import bpy
with bpy.context.temp_override(**override):
    for window in bpy.context.window_manager.windows:
    screen = window.screen
    for area in screen.areas:
        if area.type == 'CONSOLE':
            override = {'window': window, 'screen': screen, 'area': area}
            for line in str(data).splitlines():
                with bpy.context.temp_override(**override):
                    bpy.ops.console.scrollback_append(text='hello world', type="OUTPUT")

see also https://blender.stackexchange.com/questions/273474/how-to-override-context-to-launch-ops-commands-in-text-editor-3-2


text:
How to speed up rendering of transparent areas?
This is a bit of a trick question. We know that HOLDOUT will subtract objects from renders. My question is slightly more elaborate. I had a render that I spent a fair amount of money on (render farm), only to find out that a material was set to the wrong settings. So I'm re-rendering the animation with every other object BUT the one I need using the HOLDOUT feature.
However, Blender is crawling all over the rendering even though 80% of the frame is 100% transparent. I'd love a way to have Blender only render the area where the object exists. I know about setting a render area method, but the problem arises where I need the object to be in the EXACT location that its predecessor was that had the material problem, so rendering the entire 4k frame is very helpful for a clean overlay.

Hello :). Since 2.9 there's adaptive sampling available. It should make transparent areas render very fast, since they don't need any samples.

Thank you for this. I had seen this but didn't realize it affected this area. Much appreciated.

@JachymMichal Thanks! I hadn't twigged to that, either.

This took rendering times from 45 mins to 12 mins. Really amazing. Thank you again.

Since 2.9 you can enable Adaptive Sampling.
Transparent areas (or pure HDRI) are then rendered with 1 sample only.

I had problems with 2.9.x corrupting my objects, so I pulled back to 2.8.3.6. I'm now using copies of my files to simply render. This was the key! 2.75 hour renders down to 30 mins.


text:
Render result is completely blank
A scene I made is not rendering, at all.
This grey screen stays the same and nothing changes.

Here are my settings:
 [

This usually happens when I get an error, like out of VRAM on my GPU or maybe an exception caused by a buggy addon. Usually if you render and it actually renders you will get transparency or a solid color.

Related https://blender.stackexchange.com/questions/67490

Just had this issue and none of the suggested solutions worked. I eventually figured out that in the Compositing nodetree sidebar, under the performance section of the options tab, the "Chunksize" field had no value. I set it to 256x256 and it fixed the problem.

Restarting my computer did the trick. Was probably a RAM issue.

Yes, in this particular case (render shows blank screen with the grid), this was actually the right answer! Restart did the trick.

My case too. I had a blank render, a completely transparent image, because I also had transparent film on (deliberately)

The problem is, in the Output Properties under Post Processing > Pipeline the Sequencer is enabled. This is by default and usually no problem when you create a 3D scene and want to render it, as long as there is nothing in the Sequencer.

But you have a strip with a movie clip there, so the Sequencer determines what the output shows - and there is no strip for the scene. The problem now is, you can press Shift+A > Add > Scene, but the only option available there is "New Scene", you cannot choose the active scene in which you are in.

To do this, you have to create a new scene with the New button next to the scene name. I would not copy the original scene but start with a completely new scene.

If you now go to Video Editing and try to add a scene strip, there appears the name of the other scene ("Scene") to choose it as input. This way you can have many different scenes where you create 3D contents and additionally have one scene only for the video editing. In your case you have to add the movie clip there as well of course.

If you just want to render your object to see how it looks and do not care for the movie clip, you can disable the Sequencer in the post processing pipeline while you render.
If you do not want to use the Sequencer from the Video Editing at all, you can go there, delete the strip containing the movie clip and since it's the only one, your scene will now be rendered normally. To get the movie clip in the background you can add it in the Compositor and use an Alpha Overlay node to composite the 3D scene above it.

You may have no light but you don't realize it because in the Viewport Shading panel you have disabled Scene Lights and Scene World, so in Render Preview your scene is enlighted by the Material Preview world, but it won't be in the final render. The solution is to reactivate the options and create the lights or world you need for render.

This was happening to me and I had previously post processed an image and noticed the console mentioning post processing before the render would stop after 32 seconds. I turned off post processing in the render settings and my render would work again. Hope this helps

I had this problem and I found that my Display Device was set to 'None'. I set it to sRGB and it rendered.
Further reading on Color Management

When I was messing about with the mist with the compositor nodes I had left the Use Nodes and Backdrop buttons selected, as there was no longer anything to composite there was no longer anything to output I presume.

Additionally I found that the focus needs to be set to a specific object in the depth of field pane. If no object is set, you will get a blank screen

It's perfectly acceptable to have no object as the depth of field focal point - you must have been experiencing some other problem.

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


text:
How to map UV on generated Mesh from Curve?
Hi I created a Mesh from a curve with a Bevel Object and now I need to UV map it.
It should become a rebar and needs the typical ripples at its sides as displacement. I created a seam and tried different unwrap methods. Actually I hoped that the generated texture coordinates would fit already but it is always stretched along the long part as shown in the picture.
How can I map it as an even cylinder along the mesh so that I can achieve the typical rebar look?

You need the UV map to be flat and straight, as if the rebar was still straight.
The rings will then just follow the bent shape.

UV Map
The UV Map is the most important thing here. It needs to be flat and straight.
Don't forget to cut off the end caps with seams, like I did.
I used the default Angle Based unwrap, which may/may not work in your case.
There's also an addon called UV Squares which comes with Blender and will do the work for you.

Mapping Node
The Mapping node will allow you to precisely scale the texture.
Notice that in my case, the Y Scale is considerably smaller.
Also, don't forget to plug in the UV Map output.

Note
I used a generated wave texture for the rings. With a proper image texture you'll surely get better results.
Good luck.

Many thanks, I forgot to mark the seams at the caps and to scale.

If you check 'Use UV for Mapping' in a curve's Data tab > Texture Space panel, it doesn't need manual unwrapping. When converted to a mesh (if that's necessary,) the curve's length and circumference, (its geometric U and V)  will be mapped to 0-1 in the texture UV of an automatically generated map.

Thank you I tried that but it still gives me some distortion. But I guess it is because I  started with a vertex, extruded and beveled it and converted the result back to a curve, because it was easier to create the shape with. Will try it with a curve from the beginning now.


text:
Is automatic "Reload from disk" confirmation in Text Editor possible?
I use an external editor for my scripting. When I return to Blender I want the script in the text editor to reload my changes. Blender does indeed detect the changes (red button) which is great but it quickly becomes a nightmare having to confirm my changes over and over.
So, is it's possible to make the "reload from disk" confirmation automatic, via preference, console command, or scripting?

Update 2:
@batFINGER I tried to wrap it into an addon but I'm new to this and cant get it to work properly.
Edit: removed code as it should be posted as a new question instead.

The addon I shared here makes a menu from a folder of scripts, it checks and reloads changed scripts before running with no prompt. If you don't want the menu, you could make an addon that adds a button that will reload without prompt.

Tnx, I'll take a look at the script and see what I can do with it. Do you know any good place to start learning about addons and blender scripting?

The addon intro tutorial and the python API docs. You can also find a lot of python bits here, or ask how.

Using a draw callback
Investigated a few ways to do this for an edit with vim addon I put togeter. In the end didn't go with any,
My first choice would be using the loophole in the draw callback that lets us manipulate properties, which you cannot do from a draw method. The red lifesaver on text editor header is drawn when text and text.is_modified. I have left in the reload method I use, however it doesn't update the text.is_modified. I've used the reload operator instead for this question. (intead I use os to keep tabs on file modified time)
If the test script below is run from blender text editor it will add the draw callback.  To use from an addon or such, would import the class and instance it, that way it can be removed, or stopped by calling instance.remove_handle().  An update on a boolean property to turn on and off could be another alternative
The script.
import bpy

def reload(text):
    fp = bpy.path.abspath(text.filepath)
    text.clear()
    with open(fp) as f:
        text.write(f.read())
    return False

class DrawingClass:
    lock = False
    def __init__(self, context, prop):
        self.prop = prop
        self.handle = bpy.types.SpaceTextEditor.draw_handler_add(
                   self.draw_text_callback,(context,),
                   'WINDOW', 'POST_PIXEL')

    def draw_text_callback(self, context):
        if self.lock:
            return
        space = context.space_data
        text = space.text

        if text and text.is_modified:  # if is_modified(text):
            print("reloading text")
            bpy.ops.text.reload()
            '''
            self.lock + True
            self.lock = reload(text)
            '''

    def remove_handle(self):
         bpy.types.SpaceTextEditor.draw_handler_remove(self.handle, 'WINDOW')

if __name__ == "__main__":
    context = bpy.context
    dc = DrawingClass(context, "Draw This On Screen")

Other approaches worth considering:

A modal timer operator. See  text editor > templates > python > Operator Modal Timer .  The issue here is that while a modal timer is running, you may be turning off auto-save.
A scene update handler.  (IMO a pita, as it runs toooooo often)

Update 2 in first post:
Thank you for the answer. I'm new to python and new to Blender. I've only managed to wrap one of my scripts into a working addon by using a template. I've tried wraping your provided code into an addon but I can't get it to show in the prefs>addon. Not really sure how to register() the class and or functions where to get it started.
Also you say you have to use a callback as a "loophole", does this have to do with many contexts being read-only and scripts run as addons can't write to properties? How do one get round this limitations if one can?

@JoelArt On the loophole, if you try and alter properties from a draw method (eg in a panel or header), you get an error and warning that you can't do it.   At the moment a draw-callback lets you do this, as shown above, if modified: the text is loaded whenever the text editor has focus (in answer to your original question).  As for part ii make it a new question.

I dunno about automatic, but you could make a keyboard shortcut to do it for you which is a little more slick than accessing it via menu with the mouse.

Tnx, I tried that but it's still not good enough though, there must be a way to just have the text update when refocusing on blender or at least on text editor.

I really don't understand how people actually make scripts from blender without this basic functionality


text:
Local transform gizmo isn't visually matching the selected object. Is this a bug?
Is this a bug?
Whenever I have to move around many objects with individual orientations and move them in local mode and dragselecting with box/circle/laso, the object only stays orange and the transform gizmo keeps the orientations of the "active" (yellow) object. But when I grab and move an axis it moves correctly according to the object local orientation.


text:
Trying to open unknown but simple looking (just geometry) ascii 3d model file.txt in blender
So I have this weird .txt file for a really old game project. I don't know what kind of file it is but it is a text file (.txt). It contains stuff like this. It should be 3d model in some weird txt format... ascii something? I'm sure it is some kind of existing file format but I don't know what it is called. All I remember is that I saved the file as a backup some 15 years ago. The file seems to only contain geometry of the mesh (vertices).
2.000000
166
452
X: -349.039856
Y: 25.686975
Z: 28.132673
C: FF5777A1
X: -346.128082
Y: 21.734615
Z: 27.500698
C: FF5777A1
X: -344.545929
Y: 19.567871
Z: 25.994253
C: FF5777A1
X: -343.364471
Y: 17.949909
Z: 23.516270
C: FF5777A1
X: -342.886230
Y: 17.294985
Z: 20.678743
C: FF5777A1
X: -342.886230
Y: 17.294985
Z: 9.678737
C: FF5D7CA6
X: -342.886230
Y: 17.294985
Z: 3.678736
C: FF5D7CA6
X: -342.886230
Y: 17.294985
Z: 0.678359
C: FFCCEBFF
X: -345.812744
Y: 21.328114
Z: 29.460487
C: FF7392BC
X: -349.039856
Y: 25.686975
Z: 30.247604
C: FF7392BC
X: -343.681366
Y: 18.510126
Z: 27.357716
C: FF7190BA
X: -342.323212
Y: 16.458624
Z: 24.520267
C: FF7190BA
...and so forth. The ending is like this:
X: -366.034607
Y: 21.981529
Z: 1.920586
C: FFCBEAFF
The actual .txt file is couple of megs. Does anyone recognize what kind of file it is and how to open it in blender? Could it be point cloud data of some kind? I'm assuming the c: xxxxxxx is some kind of mesh or face identifying tag because it is repeated a lot in the file... maybe so it knows to which mesh or face each vertice belongs? Because the file is so old I think all meshes are either triangles or quads. No n-gons.
I don't know how to write python script so I can't write my own file importer. But if I knew what is the name of the file format I could probably find a blender importer or find some other software than can open it...
edit
So I managed to create a "decoder" in libre office from this file. Is there any file format that blender can open that accepts something like this for example:
42.5345, 5.2342, 88.456
43.5345, 8.2342, 88.456
46.7345, 12.2342, 88.333
...
Basically a simple list of vertices like this:
 x,y,z
 x,y,z
 x,y,z
I'd be happy with anything at this point...

You could use Animation Nodes to parse the text file and plot the vertices. Node setup wouldn't be too complex.


text:
When I move armature on one arm, one part of the mesh on the other arm moves as well
Here's the picture:
It's not bad weight painting, I think, since I checked all of the bones and none of them have influence on the part of the mesh.
Btw, here is the .blend file:

please provide your blend file because you gave us nearly no information at all...

It looks as if you may have a disconnected vertex from your image but as @Chris says we really need to see your Blend file. You could try going into Edit mode, select all, and then Mesh > Cleanup > Delete Loose. Suggest you save the file before you try that though just in case...

@JohnEason I've added the blend file.

You have a bone named "Bone.003" which is set to deform, isn't mirrored, and won't get its VGs mirrored because it's not in .L/.R format.  When the L arm moves, Bone.003 moves, affecting verts on both sides of the mesh.

"You have a bone named "Bone.003" which is set to deform, isn't mirrored, and won't get its VGs mirrored because it's not in .L/.R format. When the L arm moves, Bone.003 moves, affecting verts on both sides of the mesh." –
Nathan
This was correct, thank You.


text:
How to identify/derive the pixel coordinate of vertices of an object in the render of a scene?
I am using version 2.93.6 of Blender and I am fairly new to Blender. I am struggling to find correct functions/APIs which would help me achieve the following:
From the example below we can see a scene and the viewport of the camera which shows what would get rendered to an image if one would like to do so. I would calculate programatically X,Y in pixel coordinates of the vertices of the cube. Is there a ready API or, collection of API functions which would enable me to do so?
Any guidance would be most welcome.

You might want to start here.

I'm not sure certain what the right rule is for rounding camera coordinates to individual pixels, but I think examining coordinates in Camera space using world_to_camera_view and multiplying this by the Camera resolution in each of the x, y dimensions should be very close to what you want to do:
from bpy_extras.object_utils import world_to_camera_view
x_res = bpy.context.scene.render.resolution_x
y_res = bpy.context.scene.render.resolution_y
for i, v in enumerate(bpy.context.object.data.vertices):
    cam_coord_vec = world_to_camera_view(bpy.context.scene, bpy.data.objects['Camera'], bpy.context.object.matrix_world @ v.co)
    print(f"vertex # {i} has camera coordinates vector: {cam_coord_vec}")
    x_pixel = x_res * cam_coord_vec.x
    y_pixel = y_res * cam_coord_vec.y
    print(f"in pixels (unrounded): {x_pixel, y_pixel}")
    if 0.0 <= x_pixel <= x_res and 0.0 <= y_pixel <= y_res:
        print(f"in pixels (truncated): {int(x_pixel), int(y_pixel)}")
        print(f"in pixels (rounded): {round(x_pixel), round(y_pixel)}")
    else:
        print(f"Vertex lies outside of camera view.")

Example output on a new file with the Default Cube and standard default camera view of it:
vertex # 0 has camera coordinates vector: <Vector (0.6812, 0.7147, 10.7735)>
in pixels (unrounded): (1307.944107055664, 771.8815183639526)
in pixels (truncated): (1307, 771)
in pixels (rounded): (1308, 772)
vertex # 1 has camera coordinates vector: <Vector (0.6674, 0.3192, 11.6640)>
in pixels (unrounded): (1281.3787078857422, 344.7615337371826)
in pixels (truncated): (1281, 344)
in pixels (rounded): (1281, 345)
vertex # 2 has camera coordinates vector: <Vector (0.4928, 0.5843, 9.5452)>
in pixels (unrounded): (946.1326217651367, 631.0685062408447)
in pixels (truncated): (946, 631)
in pixels (rounded): (946, 631)
vertex # 3 has camera coordinates vector: <Vector (0.4934, 0.1534, 10.4357)>
in pixels (unrounded): (947.3159980773926, 165.6905597448349)
in pixels (truncated): (947, 165)
in pixels (rounded): (947, 166)
vertex # 4 has camera coordinates vector: <Vector (0.5039, 0.8240, 12.0766)>
in pixels (unrounded): (967.4798583984375, 889.9529600143433)
in pixels (truncated): (967, 889)
in pixels (rounded): (967, 890)
vertex # 5 has camera coordinates vector: <Vector (0.5036, 0.4608, 12.9672)>
in pixels (unrounded): (966.9661331176758, 497.6470613479614)
in pixels (truncated): (966, 497)
in pixels (rounded): (967, 498)
vertex # 6 has camera coordinates vector: <Vector (0.3180, 0.7217, 10.8483)>
in pixels (unrounded): (610.5794334411621, 779.4238471984863)
in pixels (truncated): (610, 779)
in pixels (rounded): (611, 779)
vertex # 7 has camera coordinates vector: <Vector (0.3318, 0.3282, 11.7388)>
in pixels (unrounded): (637.0874977111816, 354.452440738678)
in pixels (truncated): (637, 354)
in pixels (rounded): (637, 354)

And, when zooming in so that exactly 1 individual vertex is in the camera view:
vertex # 0 has camera coordinates vector: <Vector (1.6310, 1.8400, 1.7263)>
in pixels (unrounded): (3131.4981079101562, 1987.1581935882568)
Vertex lies outside of camera view.
vertex # 1 has camera coordinates vector: <Vector (1.2461, -0.3058, 2.6168)>
in pixels (unrounded): (2392.500686645508, -330.248122215271)
Vertex lies outside of camera view.
vertex # 2 has camera coordinates vector: <Vector (0.3615, 2.1165, 0.4979)>
in pixels (unrounded): (694.1628456115723, 2285.783586502075)
Vertex lies outside of camera view.
vertex # 3 has camera coordinates vector: <Vector (0.4503, -2.1049, 1.3885)>
in pixels (unrounded): (864.6673393249512, -2273.3101558685303)
Vertex lies outside of camera view.
vertex # 4 has camera coordinates vector: <Vector (0.5155, 1.7917, 3.0294)>
in pixels (unrounded): (989.8183822631836, 1935.0868606567383)
Vertex lies outside of camera view.
vertex # 5 has camera coordinates vector: <Vector (0.5120, 0.3703, 3.9199)>
in pixels (unrounded): (983.0441665649414, 399.89579916000366)
in pixels (truncated): (983, 399)
in pixels (rounded): (983, 400)
vertex # 6 has camera coordinates vector: <Vector (-0.5962, 1.8353, 1.8010)>
in pixels (unrounded): (-1144.6806335449219, 1982.1323347091675)
Vertex lies outside of camera view.
vertex # 7 has camera coordinates vector: <Vector (-0.2335, -0.2493, 2.6916)>
in pixels (unrounded): (-448.320837020874, -269.2303079366684)
Vertex lies outside of camera view.

Caveats:

as written, this code ignores shape keys (these change the way you need to compute the vertex's position in world space, before passing it to world_to_camera_view)
this does the computation for the currently active object and an assumed-to-exist camera named "Camera" (swap out bpy.context.object for some other object reference if you want to do it on a different object, and swap out bpy.data.objects['Camera'] if you want to compute with a different camera)
I wrote and tested this in 2.83.2, not 2.93.6
I wrote/tested this in the Python REPL embedded inside the Scripting tab of a new Blender file, where Blender already pre-imports the bpy library. You'll need to explicitly import this if you're using this in code for an Add On you're writing or some such
As I said initially, if it is important that you not just be very close to the right pixel (which this will achieve), but get the exact pixel value, then you'll need to figure out the proper rounding rule. Probably the simplest way to do this is to generate a few test renders and open them in software that lets you browse the image on a per-pixel level (e.g., PS or GIMP I think could do this), and to try a few different rounding rules until you find one that seems to consistently work correctly

Thanks a lot for the code and tips to the APIs: world_to_camera_view as well as matrix_world in the extras module. I was not aware of those. I also notice that the above code need to be adjusted a bit because the rendered coordinates is "upside-down". For instance pixel (0,0) in a rendered image would be top-left while in world_to_camera_view it is bottom left. (i also note it is mentioned in the documentation). Thanks again !

Oh, yes, that's right; I forgot that people usually represent pixel-space with the origin in the top-left, and you're completely right that world_to_camera_view expresses in terms of a basis that places the origin in the bot-left. I'll amend the answer slightly later to note this, so new readers won't have to look in the comments


text:
Fluid simulation flows through effector

My first issue, was that the particles got nowhere near the mesh. Increasing the resolution divisions seemed to work. But, everything now flows through my object. Trying a whole new setup, works - the objects collide. Maybe the mesh here is weird? I have not a clue.

Have you recalculated the simulation (Cache > Type > Replay)?

provide blend file, so we can check it out...but i am pretty sure it is your resolution...

@moonboots It is set on replay. I've also just re-selected it, and run the simulation again - but no luck

Yes you need to reselect to relaunch a calculation, but it doesn't seem to be the problem here. As Chris says, perhaps tweak the resolution of your domain?

@Chris I've got the resolution at 500. Not sure what number is actually high on this scale. The file is now attached. I'm super unsure though

@moonboots The resolution change has not seemed to help. I'll continue playing with the numbers

@ShivarIshripersadh: I just downloaded your file, changed resolution to 100 and got: [1]: https://i.sstatic.net/cPIkT.gif ....so what is your problem!? Or did you upload another file than that, what you tried?

@Chris That is the most recent update. My resolution was set at 500. I thought, a higher number is better. I set it to 100, and it worked. Even seeing your gif, of it working made me melt with satisfaction. I'll get to finishing it. Thank you

You are welcome


text:
Add a GroupNode to all objects except 1 specific one with Python
Does anyone have a clue how to do this?
In python code i have a button that selects all my objects in the scene except 1 object named ‘PLANE’.
Those objects have all a material (Principled BSDF and Material Output). When this button is pushed, the operator selects all the objects except the PLANE and adds a Groupnode to those materials of thos objects (in between the Princepled BSDF and the Material Output). This works, links the nodes and all.
But my problem is that even when the PLANE is not selected and has also a specific other material, it also recieves the Groupnode. And that is just what i do not want. The PLANE must keep its own material. Anyone knows how to fix it? Thanks
this is the code.
class SETACTIVEMATERIAL_OT_operator(bpy.types.Operator):
    bl_idname = "object.section_material"
    bl_label = "Set color to all"
    bl_description = ""

# this gives the RGB controller in the panel
    col:bpy.props.FloatVectorProperty(name= "pick color", subtype= 'COLOR_GAMMA' , size=4, default= (0,1,0,1), min=0.0, max=1.0)

    def execute(self, context):

    # selects all objects in the outliner that are a MESH, except a specific one called Section Plane A
        for collection in bpy.data.collections:
            bpy.data.collections.get("")  # between brackets is name of choice of the collection
            if collection:
               for obj in collection.objects:
                   obj.select_set(True)
                   obj.select_set(obj.type == "MESH")
            for obj in bpy.context.scene.objects:

                if obj.name.startswith("Sec"):   # even the beginletters are sufficiant
                    obj.select_set(False)
                else:

                      bpy.context.view_layer.objects.active=obj

            group_name = "GlobalMixer"
            mixer_name = "Overrider"
            MixerGlobalGroup = bpy.data.node_groups.get(group_name)
            # create a group
            if MixerGlobalGroup == None :
                test_group = bpy.data.node_groups.new(group_name, 'ShaderNodeTree')
                # create group inputs
                group_inputs = test_group.nodes.new('NodeGroupInput')
                group_inputs.location = (-200,0)
                test_group.inputs.new('NodeSocketShader','MainShader')
                # create group outputs
                group_outputs = test_group.nodes.new('NodeGroupOutput')
                group_outputs.location = (400,0)
                test_group.outputs.new('NodeSocketShader','MixedShader')
                # create three math nodes in a group
                node = test_group.nodes.new('ShaderNodeMixShader')
                node.location = (-200,-200)
                node.inputs[0].default_value = 1
                node2 = test_group.nodes.new('ShaderNodeBsdfDiffuse')
                node2.inputs[0].default_value = self.col ########

                node.location = (200,100)
                # link inputs
                test_group.links.new(group_inputs.outputs['MainShader'], node.inputs[1])
                #link output
                test_group.links.new(node.outputs[0], group_outputs.inputs['MixedShader'])
                test_group.links.new(node2.outputs[0], node.inputs[2])
                MixerGlobalGroup = test_group
                print('Global MIxer Created:', MixerGlobalGroup)
            else:
                test_group = bpy.data.node_groups[group_name]
                print('Global MIxer Exists: ', test_group)
                diffuse = test_group.nodes.get('Diffuse BSDF')  ##########
                diffuse.inputs[0].default_value = self.col      #########
            #####################################################################################
            # ADD A MIXER GROUP
            #####################################################################################

            for mat in bpy.data.materials:

                nodes = mat.node_tree.nodes
                if nodes.get(mixer_name) == None:
                    mixer = nodes.new(type="ShaderNodeGroup")
                    mixer.node_tree  = MixerGlobalGroup
                    mixer.name = mixer_name
                    mixer.location = (200,200)
                    print(mixer_name," [created] ", mixer)
                else:
                    print("....overrider already exists")
                mylinks = mat.node_tree.links
                matOut = nodes.get("Material Output")
                matInput = matOut.inputs
                mixerOut = nodes.get(mixer_name).outputs
                mixerIn = nodes.get(mixer_name).inputs
                old_link = matInput['Surface'].links[0].from_node
                if old_link.name != mixer_name:
                    print("conected to: ",old_link.name)
                    mylinks.new(mixerOut[0], matInput[0])
                    old_link = mylinks.new(mixerIn[0], old_link.outputs[0])

            return {"FINISHED"}

# to change it from an operator to a dialog box:
    def invoke(self, context, event):
        return context.window_manager.invoke_props_dialog(self)

class RESTOREMATERIAL_OT_operator(bpy.types.Operator):
    bl_idname = "object.restore_material"
    bl_label = "restore material"
    bl_description = ""
    bl_options = {"REGISTER", "UNDO"}

    def execute(self, context):
        for mat in bpy.data.materials:

            node_tree = mat.node_tree
            nodes = mat.node_tree.nodes

            #Get the node / GroupNode in its node tree (replace the name below)
            node_to_delete =  mat.node_tree.nodes['Overrider']

            #Remove the node / GroupNode
            mat.node_tree.nodes.remove( node_to_delete )
            mainShader = nodes.get("Principled BSDF")
            material_output = nodes.get("Material Output")

            # Update the links. The current links will get overwritten
            links = node_tree.links
            links.new(mainShader.outputs[0], material_output.inputs[0])

        return {"FINISHED"}

Hi, so i have to remove that line of code?Sorry for the indentation, i copied my code from my phone.

Instead of running through all materials in your blend, filter the materials from the desired objects by using Object.material_slots and add the node group to these materials only: https://docs.blender.org/api/current/bpy.types.Object.html#bpy.types.Object.material_slots
import bpy

C = bpy.context

# Filter the materials from all objects in selection
mats_filter = set(slot.material for o in C.selected_objects for slot in o.material_slots)

# Loop through all materials of objects in selection
for material in mats_filter:
    custom_group = bpy.data.node_groups.get("NodeGroup")
    # Add the node group to each material
    if custom_group:
        new_node = material.node_tree.nodes.new(type='ShaderNodeGroup')
        new_node.node_tree = custom_group

How to iterate over material index using Python
How do I iterate over all selected objects and change a property on their materials?

Thank you for this info. I understand what you mean, but i do not know where to put those lines in the code above and what lines i have to remove. I keep messing up the  code. The line custom_group = bpy.data.node_groups.get("NodeGroup") is where the NodeGroup name will be replaced by Override because that is the name of the Nodegroup i want to add i suppose. I am new to all the python coding stuff. It is cool to learn and i am learning every day.

@KVDAM -> https://www.codepile.net/pile/EgWBmDRk replace bpy.data.materials as mentioned in my very first comment.

Thank you for helping. I followed your instructions and it seems to be working. By it seems i mean that when i for example have 1 object selected or active, that object also does not get that groupnode added. If i select the plane the groupnode gets added to all the objects like it supposed to be. I tried to copy my code into here but the indentation gets messed up.


text:
Issue Rendering Glass Cycles
I'm using version 2.93.6 and the glass in my model is not rendering properly in the final render. It does show up properly in the viewport which is what has me confused. I'm a total blender novice, but I'm using blender mainly to change some materials and get a nice final image of this model I designed.  Any help would be appreciated.

please add a screenshot of your glass material's node tree.

It looks like you have some object hidden from viewport (base mesh?), but not from rendering ... Check if all disabled eye icons have disabled camera icons as well under Outliner editor.


text:
Smooth shading not applying in renders
I found that after I finished modeling my base, adding materials, and adding smooth shading that once I proceeded to render my model the everything, but the smooth shading applied.
It is the most peculiar occurrence for I have applied smooth shading to other models and once I rendered those the smooth shading worked. Also, on the blender user manual the author states that smooth shading applies to the viewport and the render.
I have researched the problem and have found nothing, and my bewilderment continues to increase. I am using Blender version 2.93.4 and I have also attached two photos of my problem.
I have also update blender from 2.93.4 to 2.93.6 and the problem continues to persist.
First photo, the rendered model with the recurring problem of not applying smooth shading.

Original model, not rendered, complete with materials and smooth shading, no problem here.

How can I add the file to the post to help people answer the question better?

To upload a file use either Blend-Exchange or pasteall. Edit the link to your file into your question.

are you using a subdivision surface modifier on the object?  If so, check its settings to make sure the number of subdivisions is > 0 for rendering.

Yes, I am using a subdivision surface modifier with a subdivision count greater than 0.

I fixed it!! The problem was the shading language on the subdivision surface modifier.


text:
How make particle objects follow z axis while also following the ground?
I am using the particle system to spawn thousands of grass objects which are just planes (imagine 10cm tall, 2m wide) with texture mapped on them. How do I get the planes to follow the ground (rest on ground) while also being vertical. There are questions about hairs but not about this specific issue.
Like this:
https://i.sstatic.net/AZiaS.png

maybe you need to enable the Advanced option, then enable Rotation and in Rotation > Initial Orientation choose Global Z, as explained here: https://blender.stackexchange.com/questions/39192/making-hair-go-straight-up-instead-of-following-the-shape/39194

Thanks for the comment. However the problem is not to get the grass to point upwards but to make it point upwards while also following the ground. I understand particle system may not be able to do it so maybe there is another way.

well I think that what I linked explain how it follows the ground, no?

Maybe I am explaining myself poorly. I changed the image hopefully to make clear what I want. Please have a look at the image once more, thank you.

oh ok sorry I understand, I don't know if it's possible

The particle system uses the normals from the mesh to grow the 'hair'. So, if you want to make all the particles grow upright and follow the terrain, what you should do is:

Create another mesh above the terrain (as simple as possible, like a
plane, or circle)
Subdivide it a few times
Use a Shrinkwrap Modifier on the new mesh, so it follows the
terrain, at the same time preserves the normals pointing upwards
You may use Wrap Method as Nearest surface point and Above Surface, but you may try other methods if you like
Make the particle system on this new mesh; (on the modifiers list,
the Shrinkwrap must be above the particle system).

This way your grass will grow upwards, and the roots will follow the terrain.


text:
Best way to create the ground for house model
Im trying to create a 3d house model.
The tutorial I learnt from taught me how to create a plane for the ground of the house. The ground in the tutorial was a rectangle and so it can be easily achieved by creating the plane and specifying the X and Y.
I need a ground that is not usual rectangle, how should i go about doing it? Do i create a plane and make changes to the plane accordingly? or do i create multiple planes and join them to form the ground i need?
It will be great if steps are given as I am new to the Blender.
Thanks in Advance
UPDATE:

Please comment if there is any other better way or if im doing it wrong in any steps.

Dunno if this is really a question for Stack Exchange. Since there are lots of required steps to turn a simple plane into a terrainmesh that fits to your house. You usually start with one plane. Tesselating the plane and do displacement is one possible way to go. Sculpting another. Then there are several shader techniques to make the terrain looking good. Plus some tricks like a wet map. You need some greens, sticks, stones etc. too. That's a job for the particle system. And so on. It's simply a pretty general question that can't be answered this generally.

thanks for the help. by not usual rectangle I mean by not the standard X by Y size of plane. but rather the ground can be made up by more than 1 plane. So im not sure if i should use 1 plane and start transforming into the shape i need or should i join lots of different size plane together to form the shape i need. forgive me if the question was too vague or sounded too stupid as im new to blender.

There is no stupid question. The whole matter is just too general. And so not easily to answer. Using more than one plane means to have seams. That's usually something that you want to avoid. However, when you for example want to have some far away mountains, then this can of course be another plane, as long as  the seams are not visible and disturbing. A square plane is also no must. It's just ways easier to work with square geometry for that purpose, since displacement uses usually a square image - In the end, allowed is everything that works. So toy around what works best for your case ;)


text:
How to import XMF/XML files from IMVU into blender?
I was wondering if there was a way I could import XMF/XML files from IMVU in to 2.78 or 2.70? I've read two questions on the same topic but nothing provided worked for me.

Any advice would be helpful :)

Search is your friend, related: https://blender.stackexchange.com/questions/57048/how-do-i-convert-xmf-file-to-an-obj-file

I've searched every part of this site and others when it comes to importing XMF/XML files and nothing was helpful. Only a blender add-on to import City XML files...

XMF does sound rather propriety and probably lisenced, so I doubt that anyone has written a translation addon to import the files into Blender.

@DiamondBones007 https://create.imvu.com/knowledge-base/exporting-to-cal3d-from-blender/  and   https://www.katsbits.com/codex/imvu-export/    Sometimes it is easier to find blender related info  on, in this case,  IMVU forum posts, than vice versa.


text:
GPU/CUDA volume and SSS support
As my fedora repos are way behind and still on blender 2.69, I've gone and compiled the latest myself. Everything seems to work and is quite recent. I can even bake CPU SSS, which is great. However I still get the error "Volumes/SSS not supported on GPU". Have I missed a flag or library (eg OSL support) in CMAKE or is this still on the todo list? If its just not finished yet, I don't mean to rush the devs but definitely looking forward to its release.

The official Windows version of 2.70a does not support it, and the cycles release notes of 2.71 do not mention it either. I guess you still have to wait for that feature.

Unfortunately, these features aren't finished yet.
SSS
GPU SSS is working, but still experimental.
To test it, you need to add one line in the kernel_types header file:
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 8d7adb2..1175c16 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -66,6 +66,7 @@ CCL_NAMESPACE_BEGIN
 #ifdef __KERNEL_CUDA__
 #define __KERNEL_SHADING__
 #define __KERNEL_ADV_SHADING__
+#define __SUBSURFACE__
 #define __BRANCHED_PATH__
 //#define __VOLUME__
 #endif

It seems the main reason that this isn't yet included as  an experimental feature is that it requires compiling kernels twice:

we cannot make it available just under experimental, we would need to compile all kernels 2x (for each architecture).

Update:
GPU SSS is enabled in master as of this commit. Now any new development build will have SSS on GPU. This will be in 2.72.
Volumetrics
Volume support for GPU was unofficially working shortly after its addition (see 2:22 of this video), however broke with the addition of scattering (see 2:50 of this video).
According to the same video, GPU volumetrics was supposed to be fixed for 2.70. Since that was not the case, I can only assume that development was delayed and it's still due to be fixed at some point.
update:
GPU volume support has been added to master as of this commit, but currently is in a very experimental state and smoke/fire renders are not supported yet. This will be in 2.72.

oh its so fast and deliciously pretty. thank you for all the info and links!! I'll be keeping an eye out for volumetrics next

@jozxyqk GPU Volumetrics are here now :)

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


text:
Select all and delete in outliner search results
Here's my problem...
I have many objects which I've duplicated but didn't notice myself duplicating the camera while I was in side view:

Now this is ok, because I've spotted a search box. I can find/delete...

Except deleting (while mouse is in 3D view) only deletes the one white-selected camera. The a key does toggle a form of selection, but instead of being an actual selection it's more of a doesn't do anything at all selection. The outliner is pretty unresponsive to what I would think of as typical user interaction.
How do I actually-select lots of things in the outliner?

I have just noticed that without search results I can make a doesn't-do-anything selection, right click and choose "select" to create an actual-selection. Either a all or b box select works to make a doesn't-do-anything selection. I can't however create typical shift-select between first and last so I think I need a bigger monitor to display more outliner for my box select. This right click "select" method doesn't work on doesn't-do-anything selections after filtering the outliner with the search box.

Selecting in the outliner would mark its list items as selected but does not select the objects you want to remove. To select more than one object in the outliner you can Shift-LMB each object.
Instead you could select them by name in Object Mode Menu:Select / Select pattern, Type Camera.* (this omits the default camera) and press X.

This is not exactly what you asked, but might come in handy anyway:
import bpy

for obj in bpy.context.scene.objects:
    obj.select = ( obj.name[:3] == "Cub" )

It's a python script you can paste into blender's Text Editor and then Run Script.  (although the Text Editor starts out without any text buffer and you have to click New to make it typable/pasteable).

You have discovered that selecting things in the outliner using keys like a or the b box-select does not equate to selecting them in the 3-D view (in contrast to mouse clicking the outliner item).
Fortunately, if you right-click in the outliner you get a menu whose first entry is "Select" which can transfer the selection from the outliner to the 3D view.  One caveat is that the menu will not pop up if you happen to have the Scene "selected" (often happens if you use the a).

Thanks! In my version (2.75.1), sometimes the menu will only pop up when you right click a non-selected item. Eventually I got it to work, but it's quite buggy. Hopefully fixed in something more recent.

Select one of the Cameras
Go to
Select > Grouped > Type
or simple
ShiftG > T
Note: This will obviously delete all objects of that type. So unselected anything you don't want to delete.

If you go to the outliner and with your mouse cursor go to that little empty space next to the object that you want to remove (in my case it where 400+ particles) hit the B to do a group select and scroll down hit B again than that way you can select all your desired objects you want to remove and right click and delete to delete the selected list at once...


text:
How to make crenel from a cube?
Here is the base structure.

Using subdivide I could achieve something below, but it's not what I want. How could I subdivide the hollow rectangle from the inner side? I need the the surface between crenels to be parallel

Here is the reference Image.

Use the knife tool to cut these orthogonal edges (K to activate, A to cut orthogonally, C to cut through):

You end up with this, don't forget to remove all the oblique edges:

Create some loopcuts with CtrlR:

Extrude up the crenels:

If I'm understanding your question correctly, I have a solution assuming your cube is oriented perfectly to the X and Y axes (as I'm sure it will be)
From what you've got here, select one of your inner-facing edges and then scale it by 0 along either the X or Y axis, depending on which way it's facing.
I'm not able to get into Blender right now so cannot show a screenshot, but the easiest way is to select an edge, then press S, X, or Y, then 0.


text:
How do I correctly apply array and curve modifiers for this object?
In my project, curve and array applied and object is in x axis.
That is fine but I want to rotate curve slightly (30º) in edit mode and after that curve modifier deform axis is same but object rotates and I want this object perfectly face x axis you can see in this image. How to do it to align properly?

The easiest way to fix this would be to parent your arrayed object to the curve, if I've read you right.

Could you share your Blender file using https://blend-exchange.com/ to give it a try ?


text:
i hava some troubles in understand the import_bvh.py when i use blender , thank to you good
What is the meaning of the following code?
bone_rotation_matrix = (bone_rest_matrix_inv @bone_rotation_matrix @bone_rest_matrix)

I want to know what the bone_rotation_matrix represents? The result is different from the rotation value in transform panel.

the formula seems to be a eigen decomposition of some rotations (from euler, most likely) to the rest matrix. I guess this should provide the same rotation but from the rest pose.

Are you able to look at the documentation for Blender, bpy or Python?


text:
Apply geometry node on curve
I ve been trying to create a set of verticies on a curve with a uniform distance in Blender. After failing with having the curve represented as a mesh,i ve found out that the curve has precisely the node i need - Curve to Point. However, when I try to apply it, so i can work with those newly created points I get an error.

So the question is - can I somehow "export" those newly created points or apply the modifier?
Thanks!
Adam

Historically blender never allowed applying constructive modifiers on curve objects, as far as I know. Possible workarounds are exporting as mesh instead, then manually convert to curve afterwards; export as points; or instance something like an empty on them, realize instances, then manually reconstruct a curve from those objects.

Object > Convert > Mesh is what you're after I think

Thank you guys. At the end, I used the Convert > Mesh approach, and then in Geometry Nodes I used Curve to Points.


text:
Eyes won't show correctly (Overlapping?) (Transparency Issue?)
I have these eyes & there are eyeballs & eyes. The eyeballs are meant to be transparent, & there are until I add the eye? So the black eyes themselves are transparent but once I add the white it just does that as shown in picture 2, so I need the eyes to show.

These are the nodes, the 1st one is the eye & the second one is the actual eyeball.

Eevee treats transparent objects differently than Cycles. They are sorted from front-to-back per object and do not receive any screen space effects.
This is fast and works fine for many cases, but it is only approximate and gives incorrect results for some object shapes. For more accurate results, enable Alpha Hashed transparency in the material. With a sufficient number of samples to resolve the noise this gives accurate transparency.


text:
please help me with the drivers
help me with the drivers please
i am trying to make the wheel  rotate always forward using drivers  but when i change the Direction of the variable (cube ) , the wheel start to rotate in the negative Direction
it should always rotate  forward around the the x axis in the local transformation
this is the images help me understand please

enter image description here

the file link

For driving along a path https://blender.stackexchange.com/a/133032/15543  The drivers can be driven by curve modified mesh location z (in case of link example)  Search for the blender car rigs of Roubal who uses this setup.

thank u so much this will help for sure
but do u know how to make it work without the the curve ?

To put this another way. What you see is the result  of driving the rotation with transform channel y . eg as it travels around a unit circle path, local centre (0, 0)  y will oscillate between -1 and 1. , whereas for each lap we travel 2pi.  Could go in the x direction infinitely and never spin the wheels..  The set-up suggested in comment lets you keyframe in the distance traveled by  the curve modified mesh.  Your images suggest you are using a path.


text:
Squeeze things in sculpt mode? - 2.8
I would like to know if there is a way to move a portion of the sculpture "downwards", like smooshing it so it  can be more at the same level of it's surroundings, but preserving its  outlines and main shape, losing the minimal amount of detail.
Like in this simple example of an eyeball, the iris is with too high elevation:

I could use the grab brush from different angles pushing it downwards, but it seems inefficient...
Maybe the best way of doing this is in edit mode then?
I know this example doesn't have much detail and would be faster making it from scratch, but I would like to know: what is the best workflow in cases like this? Is there a nice technique to squash things?
Thanks!

look into proportional edit setting, hotkey = o

Thanks! It does work very well! But then there is no other efficient way of achieving the same results only in sculpt mode right?

Been a while since I've been in the sculpt toolbox, but there is a shrink brush.  If in doubt save a copy and experiment.

Do mean the deflate brush? I tested it to deflate the whole area, it loses some of the detail, but not all... Hmmm... I guess it could work in some cases

So many new brushes in 2.81 I have no idea, you should have a look at the blender today live videos, they covered the new ones in the last episode.

:0 woa!
I didn't know! Thanks! There seems to be some pretty neat new stuff! I'm gonna check it. I have to stay more tuned for the blender community, but they could also put an update notification on the software XD


text:
Render result does not show up in compositing?
I have a weird issue when trying to get a smoke simulation with a transparent backround (transparent film is on).
1. One is that i don't get the show render layer option in the compositing nodes, as an option —— image editor the image is set to render result but it does not appear in render layer node
2. Another weird thing is that the blue smoke has correct alpha in the compositor, but when I save it as a PNG it's just a white screen and when i take it from there to Lightworks, it recognises the smoke but it only appears as a white cloud, without color and without alpha.
I have managed to get transparent background with solid objects to appear, but here I'm facing this problem with the render result missing and that I only seem to get some layers out of the image, but it seems allright in the
render results wiew in the image editor?

PNG is a fucked format and doesn’t encode alpha correctly. Never use it. Many answers here worth searching, as this is a duplicate.

I use PNG as it´s seem´s to support alpha in lightworks . I now tryed similar settings with simpler smoke settings, it can be that that some complexity in the settings caused these problems. try now to move on by more simple settings in compositing and smoke simulation in a hope , it will work out better. I have used PNG with alpha and it does not always have these problems.

i got it to work with less complex settings, probaply something made the process go out of order and created an error. If moderators want to close the case im fine with that. or want to leave it as an example that´s fine too.

PNG is a busted format. It really is. Avoid it.

It might be ... Eny succestions of a format that would work in lightworks too ?


text:
How to properly hook up various maps types in Cycles?
I created some texture maps in MindTex to use in Blender, but I can't figure out how to properly hook them up. The maps I have:
 - Diffuse
 - Normal
 - Height
 - Specular
 - Gloss
 - Self Illumination
 - Reflection
 - Ambient Occlusion

MindTex (left) vs. Blender (right)

As you can clearly see it's a pretty big difference.
Here is my material node setup in Blender.
In the examples I don't actually use self illumination or reflection images, but including this in the answer would be helpful.

This post is mostly outdated now and focusing on pre Blender 2.8 workflows before the implementation Principled BSDF. For a more up to date answer with PBR based solutions in mind see Jachym's answer instead.
First thing to have in mind is that you have some conflicting data, and some redundant maps that can't all be used at the same time because their functionality overlaps.
Second thing to have in mind is that Blender Cycles is a physically accurate renderer, that means the results tend to converge to a physically realistic solution. Some of the maps you have there are made as approximations of a real solution and as such are "incompatible" with the way Cycles works or at the very least not needed and will "worsen" the result.
Ambient Occlusion AO map is for example a map that is generally useful for real time rendering contexts, but usually not desirable in offline or realistic renders.
It can still be used in cycles to but the results will be "less realistic" and will partially ignore scene lighting.

As my default "base setup" I would recommend using the Diffuse D map on a Diffuse Shader color socket, the Specular S map as a mixing factor to mix it with a Glossy Shader (amount of shine or specularity)  and the Glossiness G map as input for the Glossy Shader Roughness socket (how clear or rough each reflection is):

Then the Height H map and the Normal N map are mostly self excluding, either use one or the other as far as I know. I am not very proficient with Norml maps but would go with the height map which is more versatile and easier to use but do as you please.
Either use the normal map with a Normal Map + Bump Map node connected to all used shaders,

Or use the Height H map as bump, as material displacement or ideally directly in a Displacement Modifier for actual geometry deformation
Bump

Material based displacement

True Displacement using the Displace Modifier with a Subsurf to give it extra geometry to apply the effect

Workflow for Principled BSDF
Use Non-Color color space for most textures.
Only  Color and AO maps use sRGB color space
List of maps and where to connect them

Diffuse/Color → Base Color
Ambient Occlusion → use with Eevee, not with Cycles
Metalness → Metallic
Roughness → Roughness
Gloss → add Invert node and plug into Roughness
Specular/Refl → don't use, specularity is handled differently
Bump → run through Bump node (as Height) and into Normal
Normal → Use with Normal Map node and plug into Normal
Height → Use as a Bump map or a Displacement Map.
Displacement → run through Displacement node (as Height) and plug into Displacement input.
- Don't forget to enable displacement in Material options > Displacement

Further Reading

CGBookcase How to use PBR Textures in Blender
SE: How to plug specular map into Principled Shader?
SE: What does Height Map mean in Blender

Nice answer, but really unsure about editing in a link to your own answer in the top-voted answer. Might set a bad precedent. Votes are meant to promote useful answers and your answer is already in second place, so quite discoverable.

@RayMairlot Good to know, I'll remove the link then :). Thanks for the guidance.

I am no guru (:P), but as far as i can see:
It is a lot easier now in Blender 2.79 with the "Principled BDSF shader" in cycles shader setup:
1) plug the diffuse "gravel_d.png" into the colour socket
2) plug the specular "gravel_s.png" into the specular slider
3) plug the gloss "gravel_g.png" into the roughness slider (with an "invert colour node" in between)
Also:
4) plug the heightmap "gravel_h.png" into the displacement modifier after subdividing the surface that is being textured.
(The AO map is not used as blender will ray trace in cycles, the normal map is not used as the height map works better in a still image in cycles if there is time available to render it.)
Results should look like this:

The left hand sphere is not height mapped, the plane and the one on the right uses a subdivision surface modifier and then a displcement modifier with the "gravel_h.png" as the texture. the strength can then be adjusted to taste. As I inderstand it you could use the normal map and AO map to fake a lot of this for a faster render - e.g. animation / game; and i even hesitated to use the specular map as I have already likely got some/all of the info in the gloss map)
Here is the node setup:

My mistake there plugging spec into the spec tint socket

You can always [edit] your post to add info, or make corrections. No need to append corrections in the comment section.

The quickest way to generate a node setup for your textures is to use Node Wrangler.
First Enable the toolset in menu Edit -> Preferences, Add-ons tab: search for Node Wrangler and tick the check-mark in the results. It should stay enabled in future projects.

Select the Principled BSDF node in your material.

Press CTRL+SHIFT+T

Navigate to, and select all relevant files. Press ENTER or the "Principled Texture Setup" blue button. Node Wrangler will try to figure out the purpose of each file from the filename, so you should make sure your filenames are named correctly - have one of the keywords below:

keyword used by texturehaven.com
socket
alternative keywords

diff
-> Principled BSDF: Base Color
diffuse diff albedo base col color

disp
-> Displacement: Height -> Material Output: Displacement
displacement displace disp dsp height heightmap

nor or bump
-> Bump: Height -> Principled BSDF: Normal
normal nor nrm nrml norm, bump bmp

rough or gloss
-> Invert -> Principled BSDF: Roughness
roughness rough rgh, gloss glossy glossiness

spec
-> Principled BSDF: Specular
specularity specular spec spc

?
-> Principled BSDF: Subsurface Color
sss subsurface

?
-> Principled BSDF: Metallic
metallic metalness metal mtl

? - I couldn't find such texture on texturehaven.com
AO (ambient occlusion) maps will be ignored.

Today's final result will be this:

Diffuse/Ambient Occlusion
Plug both into a Color > MixRGB node set to Multiply. Send the MixRGB's Color output into the Diffuse BSDF's Color input. There is also a second way to use an AO map. "eppo" recommends good ways to use AO maps here, saying the following. Something tells me you knew all of this, because you already had those two maps set up that way.

a) Use Color mix, multiply AO and diffuse texture.
b)Use AO as a Factor to mix two shaders - one general surface material, another - dirty surface.

Diffuse on top, AO on bottom:

Material preview:

Height/Normal
In general, choose either the Height or the Normal map. Using both gets repetitive.
The Height map get's fed through a Vector > Bump node before finally ending up in the Diffuse BSDF's Normal input. Send the image's color output straight into the Height input, and connect the Normal output to input. The Strength: and Distance: values can be tweaked to your liking, but I found the ones in the screenshot below to be effective for this texture. BlenderGuru has a good talk about bump mapping here.
The normal map can be combined with the bump map, but perhaps not quite how you think.
First, add a Vector > Normal Map node. Make sure it is set to Tangent and connect the two color in/outputs. Set the Strength: value to 0.6 to match the Bump node. I figured out how to use the Normal Map node here.
Add a Converter > Vector Math node. Set it to Normalize. Plug the Bump output into the top vector input, and the Normal Map output into the bottom vector input. Plug the Vector Math node's output into the Diffuse BSDF's Normal input.
Current nodes:

Material preview:

Gloss
This map can be used as a fac in a Mix Shader between everything created so far and a Glossy BSDF with a Roughness: value of 0.1 (don't forget to plug the Vector Math output into the Glossy BSDF's Normal input). However, I found it effective to first run it through a MixRGB node set to Multiply. The fac should be 0.7 and the bottom color, black.
MixRGB node:

Nodes currently:

Material preview:

Specular
I'm going to guess the last map is a Specularity map and not a Self-illumination map because rocks don't generally glow. :)
Simply connect the color output to the Roughness: value of the Glossy BSDF node. You can read more things to do here, but I thought that this was the best for this particular situation.
Final nodes:

Material preview:

Final .blend:

How come you didn't plug the vector into the diffuse & specular? I thought they would both use it?

@DavidPrentice They would. I took the wrong screenshot, but was pressed for time and couldn't fix it. Sorry. By the way, if my answer helped, please consider accepting it.

@DavidPrentice I updated the screenshots; sorry again for the confusion. Also thought I'd mention that the .blend file doesn't have the connection that you mentioned that I missed. You will have to add that yourself.


text:
How to intersect objects and delete leftover internal planes?
I'm trying to find a simple way to create vertices where two objects intersect and delete the leftover internal planes + then join the meshes so that I have one hollow mesh to sculpt.
The reason I need to know this is that on my first sculpt I just joined the meshes, but it didn't create vertices at the intersecting points so when I went to sculpt it just overlapped the meshes as you can see here in the neck.

Here is what I am working on now, it needs to be 1 hollow mesh

You can join them in one object and use intersect tool while changing to self intersect in operator panel and then delete internal faces.

@gandalf3 The other posts answer uses the boolean technique, while denis here has described a simpler process.

Related: http://blender.stackexchange.com/questions/12311/subtracting-geometry?lq=1

Select the objects and hit Ctrl+J to join them into one object, change to edit mode and select the meshes you want to intersect, hit Ctrl+F and select Intersect (Knife) from the menu and change to Self Intersect in operator panel.

After the operation is done, intersecting edges will be selected and you can mark them as seams Ctrl+E>Mark Seam, then select internal faces using L button when hovering with the mouse cursor over internal faces while in face selection mode.

Update: Figured out, it doesn't work on planes without a thickness. Apply a Solidify modifier to the whole mesh of planes and the technique described by Denis works without crashing the program. Bools doesn't like flat surfaces apparently.

So, funny thing- when I CTR- F there is no Intersect tool listed. It goes straight from Solidify to Wire Frame. Any ideas?

Blockquote "Update: Figured out, it doesn't work on planes without a thickness. Apply a Solidify modifier to the whole mesh of planes and the technique described by Denis works without crashing the program. Bools doesn't like flat surfaces apparently."

You can use 'Weld Edges into Faces' function for flat surfaces.
1. go to edit mode
2. select all edges which share one face
3. with 'shift' select an edge or edges which you want to intersect. they need to be without faces
4. press 'Weld Edges into Faces' in Face menu
Everything should be coplanar (lay in the same plane) for this operation


text:
Voronoi Texture in Blender
Trying to achieve this simple Voronoi texture (below) but i'm having trouble figuring out what to plug where; i'm kind a missing a ... combine node?

If you are talking about the warping in the size of the pattern, you can use a Noise Texture as an input for the scale. I mixed it with white using a MixRGB node for better control over the strength

Three completely different answers that make evident how unclear the question is!

If I understand the question correctly, what you are looking for can be done using distance to edge.

Use Color output
You are probably using a different setup from what is depicted in the first image.
My wild guess is that you are using the Distance output of the Voronoi texture node instead of the Color.


text:
Transparent part of my image shows up black
I would like to ask for help figuring this one out.
I have a grayscale image with a black background, and I have the same image but colorized and with transparent background.
I need a mixed shader so that the black is gradually transformed into transparent, while the grayscale is transformed to a color scale.
I tried with a ColorRamp but the alpha becomes black in the render even if I have a blend mode to "alpha blend".
It would be nice if I could symply use the grayscale image texture for it, but I could also use on where I load the two images and mix them.
Thanks for any help
Edit: I add the real RGBa if you want to try it with this images

Hello :). By 'gradually transform' you mean animation? Why not just use a mix shader?

Hello :) I do have it, and I can mix them but as I say, the alpha from the RGBa becomes black and I have not been able to change that ¯_(ツ)_/¯

Works just fine with the provided images.
Perhaps you forgot to connect the alpha channel?

That was exactly it! Silly me, I was using Diffuse BSDF instead of principled. Can't believe I spent like 30 min trying to figure it out. Thank you!

Happy to help :). I'd reccomend Images as Planes addon shipped with blender - it connects alpha channel automatically

Oh yes I use it. Indeed I just load the image as a plane and it comes with a nice shader to begin with. I am super new at this. You've helped me a lot. I am doing a video to explain my scientific paper, and it is coming along nicely now!

Good luck with your paper! You don't need to use Principled necessarily, you can use the Diffuse BSDF and a Transparent BSDF, and use the alpha to mix between the two with Mix Shader. It doesn't hurt to use Principled, though! Especially if you prefer the more realistic results.


text:
blender - attach cube to armature
Im trying to joined basically the cube to armature but for no reason the cube move down when I export it and deform itself, can someone tell me why please ??
Here is how its representated by Blender

And in game
And here is file of interest
https://www.transfernow.net/dl/20220209IUpM5wLh
Thanks for your futur help !

Part of it is because your scale is not 1. In object mode, select your armature, use ctrl-A and apply scale. Some things will move around and it may play around with your other rigged mesh but as a standard practice, ALWAYS apply your scale :)

Secondly, it seems that your cube's vertex weights are not uniform. If they were, it would all be one colour in Weight Paint mode:

You'll want all your vertices in this cube to have a weight of 1 so that they all get affected uniformly by the rotation of the head bone.
This can be done in Weight Paint mode or (more easily) in Edit mode. Select all vertices, and in the object data properties tab (green triangle), click the avatar head bone in the vertex groups panel, set the weight to 1 and click Assign:

When I did this, it didn't fully fix it and, having looked again, that's because the cube is also weighted to other bones in the armature. I recommend either deleting the other vertex groups, setting their weights to 0 or, in future, parent objects like this to individual bones within the armature rather than using (automatic or otherwise) weight paints. Hope that helps!

Thank you for reply !! Thank you for you explanations too ! you amazing ! its working now thanks a lot my friend


text:
Viewport focus (pivot) point different in Layout and Sculpt mode
While I was sculpting, the Viewport pivot point moved way out the object all of a sudden. In layout mode, it is still inside the object, meaning when I pan, it moves my object. But in sculpt mode, it’s like moving a camera that is very far away from my object. What happened here and is there a quick fix?
Kindest regards,
Habib

Sounds like you've moved the pivot point for your viewport (not to be confused with any camera in the screen).
In Sculpt Mode you can still use the numpad period (.) key to focus the view (and pivot) back to your object. This should fix the error.
Alternatively, use the Home key to refocus the view and pivot on your whole scene.

Hey Onyx♂ Thank you so much for your suggestions, this helped me immensely!!


text:
I am trying to make a 3D animated text in blender but I cannot find the Faces option
Normally projects get this option

but on my local machine I just cant find this option. This is my POV

so could someone please help me with this!
blender version: 3.0.1

A text is not a mesh, if you want to convert it to mesh, switch back to Object mode (Tab) and right click > Convert To > Mesh.

man, do you ever sleep? :) looks like you're answering questions 24/7/365 :))

@JachymMichal: This is an AI bot from 2030. Pretty old technology because he lags often. And furthermore it still a bit buggy because sometimes it answers questions in comments (so it still can't differentiate between comments and answers) and it has this kind of awareness that it asks questions although it knows the answer...So yeah - from your perspective from 2022 pretty amazing - from us just old technology. :D

we are a whole team actually, we are growing and hiring btw!!!!

@chris that actually explains a lot :))

@moonboots: do you hire only bots? or human beings too? what about cyborgs? and what would you pay for robots from 2055 working for u? (if you have one, you can fire all your employees of course....) so i am not sure whether i can reconcile that with my conscience?!

what are human beings?


text:
what "hashtag variables" are allowed as driver values?
I've found some people mention that almost any blender value can have the magic value "#frame" to use the current frame number as the value.
for example, change an object's X location to '#frame/100" and it will rapidly fly away when walking through the frames.
What I'm looking for, is a list of available # (hashtags) that can be used in this manner, like #end_frame
I found this section in the documentaion, but it seems incomplete, I swear I've seen people use other values here beyond was listed in the docs:

https://docs.blender.org/manual/en/latest/animation/drivers/usage.html#expression

https://blender.stackexchange.com/questions/27053/how-to-create-a-pydriver-in-blender-2-7

https://docs.blender.org/manual/en/dev/animation/drivers/workflow_examples.html#driver-namespace

https://blender.stackexchange.com/questions/195034/why-does-blender-think-this-driver-expression-is-a-security-issue

The other answer is perfectly valid although I would have added a list of the builtin available namespace functions :
print([k for k in bpy.app.driver_namespace.keys()])

>> 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign',
'cos', 'cosh', 'degrees', 'dist', 'erf', 'erfc', 'exp', 'expm1', 'fabs',
'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'gamma', 'gcd', 'hypot', 'isclose',
'isfinite', 'isinf', 'isnan', 'isqrt', 'lcm', 'ldexp', 'lgamma', 'log', 'log1p',
'log10', 'log2', 'modf', 'pow', 'radians', 'remainder', 'sin', 'sinh', 'sqrt',
'tan', 'tanh', 'trunc', 'prod', 'perm', 'comb', 'nextafter', 'ulp', 'pi', 'e',
'tau', 'inf', 'nan', 'bpy', 'noise', 'clamp', 'lerp', 'smoothstep'

Additionnally you can access a list of "builtin" keys with
print([k for k in bpy.app.driver_namespace["__builtins__"]])

>> 'abs', 'all', 'any', 'ascii', 'bin', 'breakpoint', 'callable', 'chr', 'compile',
'delattr', 'dir', 'divmod', 'eval', 'exec', 'format', 'getattr', 'globals',
'hasattr', 'hash', 'hex', 'id', 'input', 'isinstance', 'issubclass', 'iter',
'aiter', 'len', 'locals', 'max', 'min', 'next', 'anext', 'oct', 'ord', 'pow',
'print', 'repr', 'round', 'setattr', 'sorted', 'sum', 'vars', 'None', 'Ellipsis',
'NotImplemented', 'False', 'True', 'bool', 'memoryview', 'bytearray', 'bytes',
'classmethod', 'complex', 'dict', 'enumerate', 'filter', 'float', 'frozenset',
'property', 'int', 'list', 'map', 'object', 'range', 'reversed', 'set', 'slice',
'staticmethod', 'str', 'super', 'tuple', 'type', 'zip', '__debug__',
'BaseException', 'Exception', 'TypeError', 'StopAsyncIteration', 'StopIteration',
'GeneratorExit', 'SystemExit', 'KeyboardInterrupt', 'ImportError', 'ModuleNotFoundError',
'OSError', 'EnvironmentError', 'IOError', 'WindowsError', 'EOFError', 'RuntimeError',
'RecursionError', 'NotImplementedError', 'NameError', 'UnboundLocalError',
'AttributeError', 'SyntaxError', 'IndentationError', 'TabError', 'LookupError',
'IndexError', 'KeyError', 'ValueError', 'UnicodeError', 'UnicodeEncodeError',
'UnicodeDecodeError', 'UnicodeTranslateError', 'AssertionError', 'ArithmeticError',
'FloatingPointError', 'OverflowError', 'ZeroDivisionError', 'SystemError',
'ReferenceError', 'MemoryError', 'BufferError', 'Warning', 'UserWarning',
'EncodingWarning', 'DeprecationWarning', 'PendingDeprecationWarning',
'SyntaxWarning', 'RuntimeWarning', 'FutureWarning', 'ImportWarning', 'UnicodeWarning',
'BytesWarning', 'ResourceWarning', 'ConnectionError', 'BlockingIOError',
'BrokenPipeError', 'ChildProcessError', 'ConnectionAbortedError', 'ConnectionRefusedError',
'ConnectionResetError', 'FileExistsError', 'FileNotFoundError', 'IsADirectoryError',
'NotADirectoryError', 'InterruptedError', 'PermissionError', 'ProcessLookupError',
'TimeoutError', 'open', 'quit', 'exit', 'copyright', 'credits', 'license', 'help'

Note some of these functions don't return a number-compatible value (string, or custom classes) so I wouldn't advise trying to use them.
WARNING: Since it's a mini Python interpreter you risk inadvertently causing side effects. For example try typing quit() in a driver expression field (save your file first) :)
There is also a list of hardcoded functions (Source) :
 'bool', 'float',  'int', 'clamp', 'lerp', 'smoothstep".
It seems there are three additional special cases,

'frame' which returns the current frame. Source
'self' which returns the evaluated object. Source
'depsgraph' which can be used to retrieve data from the current context. Source

I would also add that the title and body of the question are misleading. You make the assumption that # grants access to the list of driver namespace functions, but the purpose of writing # in a property field is to automatically setup a driver. It saves you a few clicks you need to manually setup a driver :

Right click in the field
Add Driver
Then in the popup delete the variable
Write the driver expression in the field

For example you can write #min(2,cos(2)) or #2 to setup drivers. These two concepts (# and namespace functions) are independant of each other.

but "frame" is not in the list. Do you know why or how to get the list with "frame" included (and eventually others)?

@lemon great question. I updated the answer. In addition to the builtins there is bool, float, int, clamp, smoothstep, lerp. Also there are two special cases, frame and self. I don't think there is any other hardcoded keys.

The reason why IMO is because vanilla namespace keys are directly imported from the python math and mathutils module, while others are treated as special cases

Gorgious, thanks a lot. It seems there is 'depsgraph' also https://github.com/blender/blender/blob/df8dea92873a7f02a7d9f662a86d204ea97b50f1/source/blender/python/intern/bpy_driver.cc#L211 ... just to complete the list!

@lemon Ah, yes missed that one ! Cheers

Here's a sandbox subset of the driver functionality - which can be used in projects that are considered unsafe (from unsafe source in a folder excluded from script auto-execution, e.g. downloads folder). Why does Blender think this driver expression is a security issue?

BTW I think it's a security vulnerability that Python imports all math functions with * to the sandbox. What kind of guarantee do we have that at some point Python won't be updated with something in builtin like eval? Hopefully there's a note about this in a todo list regarding updating Python version in Blender...

list the currently loaded names with the blender scripting console attrbiute bpy.app.driver_namespace, this is a python dictionary who's keys are valid "python expression" variable names in Driver Scripted Expressions
we can see the functions available to us, and our current frame
>>> bpy.app.driver_namespace.keys()
dict_keys([..., 'acos', 'acosh', 'asin', 'asinh', ...])
>>> bpy.app.driver_namespace['frame']
1


text:
How to model an android face (clearly divided parts)?
What is the efficient way to create this model in Blender?
How can I create such surfaces?

Question Updated: Added some pictures.

hello, your question is a bit too broad, what are you talking about, material, modeling?

Modeling, how can I model surfaces like the white surfaces seen on the cyborg?

first model the whole head, then cut the different parts

How can I model such clean surfaces?  Can you give me step by step instructions?

"clean" is a bit vague, you need to model a head, cut it in several distinct parts, to make it slick give it a Subdivision Surface modifier (or subdivide it enough)

please tell in what part you are struggling

I do not know where to start to get the same shape?

You need to be able to model a head, if you don't know how to do it you need to watch some tutorials. Once done, choose some of the edges, bevel, delete the bevel faces, and you'll get several pieces of head

By "clean surfaces" I mean the white area that is very flat and has no wrinkles.

Could you send me some good recommendations on how to model such surfaces?

The modelling technique you're looking for is called "Hard surface modelling" as opposed to organic modelling. typing these terms in your favorite search engine will yield you some good material I'm sure. cheers

it's easy to make this kind of surface, create some faces and give them a Subdivision Surface modifier and you'll get something slick, could you please show what you've done so far? it will help to guess where you're stuck

Thanks, I will show the results in an hour or more. Thank you so much.

I've just tried this method, too, which works quite nicely here.

You first need to model the head, let's say it's Suzanne's head, give it a Subdivision Surface modifier and right click > Shade Smooth in order to make the surface round and smooth:

To cut the head in several pieces, select an edge, bevel it with CtrlB:

Then X to delete the faces:

Then rearrange a bit the topology if you want sharp edges, i.e. extrude the border edges. To give thickness give your object a Solidify modifier that you put above the Subdivision Surface modifier:

For the plastic material, you need a low Roughness value:

Hello, I have now recreated almost the same model, but how can I achieve the perfect surface color that has the android face? Here are my results so far: https://imgur.com/a/IaI44P0

you should try the settings of the Principled BSDF I show in my pictures, but I'll also try something else

I would like to thank you for your efforts.

@oapve, I'm not sure you can do it with Metallic at 1, like a kind of white metal, but just playing with Roughness seems to work, like in the settings I show in my screenshot, have you tried? It looks like you're using the Metallic value...

I think the best way to create that is to first sculpt the head in Blender's sculpt mode. After you sculpt a detailed head model, I would box model the shape of the the part that is cut out in the front of the face. Then I would overlap the cutout shape over the sculpt, and then use the boolean modifier, to cut the shape out of the head sculpt. Then, I would retopologize the head sculpt, so that the model is smooth and less dense. Also, you will need to duplicate the head sculpt, and boolean away the other parts, to make a separate mesh for the glass visor on the front. And I would retopologize the glass part as well. It also looks like the white piece is actually pretty thin, so  After retopoligy, I would give it the solidify modifier, and also possibly the sub-surf modifier, to give it some thickness and smooth out the object. Hope this helps!


text:
Sync selection/Select all faces workflow
I have just switched over to Blender after working in Max and Maya for many years. I want to start by saying that I love Blender in so many ways. When it comes to UV editing though there are some basic workflows that I just can't get my head around. My problems arise with that I need to switch between sync selection and selecting faces on my mesh which becomes very cumbersome. So here is a typical example:

I generally want to see all my UVs so I use sync selection. It works fine until I want to move a UV at a border/seam. Since it's the same vertex as the opposing seam (same vertex), it moves both UVs which is not what I want.

I then have to turn off sync selection. I select all faces on my mesh and now it works to move a UV at a border.

So maybe I can always work like this I think? Noops because a while later I want to weld two UVs that share vertex but I can't see which one it is so I have to switch back to sync selection to visualize this, turn it off (or shared vertex drop-down and then switch back to disabled). Then switch back to all faces and do the weld from memory. Or if want to see which UV face corresponds to to which face on the mesh I need to be in sync selection mode since all faces are selected already.

I just don't understand how you get an efficient workflow going like this?
Ideally I would just work with sync selection 99 percent of the time BUT with the option to move UVs independently. And the second less preferred option to have all faces selected on the mesh but somehow visualize shared vertex (Not jumping between disabled/shared location/shared vertex).
So long rambling and a small cry for help :) Any tips, addons or whatnot?

I feel your pain, and really think this should change. Elaborate a well described solution and post it in right click select for voting.


text:
Perfecting Procedural Texture for Long Vertical Cracks on Concrete Surface
I hope you’re all doing well. I’ve been working on a project where I’m trying to create a procedural texture to depict long vertical cracks in a concrete surface, specifically, I am aiming for the look of flexural cracks, which occur at fixed distances apart.
So far, I have made some progress, but I am not entirely satisfied with the results I’m getting. It seems there’s a gap between what I have now and the vision I have in my mind.
Please find the attached images. The first one is the current state of the texture I am working on, and the second is the kind of texture I’m aiming to achieve. As you can see, I’m trying to improve the realism of the crack formation.
I’m using the concrete surface texture that I’ve already designed as a base for this, and I’d like to add the cracks on top of this. However, the cracks are not coming out as realistic as I want them to be. They either seem too artificial, too repetitive, or they don’t quite capture the nuances of flexural cracks on concrete surfaces.
Could anyone guide me on how I can improve my approach and get a more accurate and realistic texture? Any tips on techniques, tools, or methodologies to achieve this effect would be highly appreciated.
Also, I would be thankful if anyone could share some best practices to maintain the fixed distance between these cracks while keeping them look natural and realistic.
Cracks I generated:

Material nodes:

Cracks I want:

I have this answer which may give you some ideas - https://blender.stackexchange.com/a/207287/110840

Maybe a Brick texture would be a good starting-point. It has some advantages:

You can adjust the frequency of cross-cracks independently of the overall texture-scale, so their thickness is easier to control
You can use the mortar 'Softness' setting to put a gradient onto a Bump node, or displacement
The chunks of cement can have randomly-allocated colors, which might be used to tilt their normals

Above the texture-space is scaled, then sheared, then has Noise added to it for the wobble. The Noise is scaled independently in X and Y. A bit of color has been added to the bottom of the cracks for illustration. With full lighting, and your own base-color, you might just use the Bump

It's a first shot: see how you get on with tweaks. Happy to update.


text:
How to change one property (default value) on multiple materials
When I export an .obj from my Shelfplanning tool and import it into Blender, all my materials have the "Emission Strength" set to 1.0 (and there are 450 materials in total).
How to turn off emission on all my materials, without clicking on them and turning it off manually?

What do you mean "Emission 1"?

If I select a material and go into the material properties the emission strength is alway 1 when I import the obj.

This script will set all "Emission Strength"s to 0. Copy it into the Text Editor and hit the "Run" button. It will affect all materials in the file, so be careful.
import bpy
for mat in bpy.data.materials:
    if not mat.use_nodes:
        continue
    for n in mat.node_tree.nodes:
        if n.type == 'BSDF_PRINCIPLED':
            n.inputs["Emission Strength"].default_value = 0

Normally you do "no emission" with Emission Strength=1 and a black emission color though...

If they have the same material, and after import they have the same own material, then just Ctrl + L Material of object selected you want.

They all have diffrent materials thats the problem