text:
How to intersect two lines that are not touching
I have two lines that are not intersecting, but I would like to extend them until they touch.

What's the best way to go about this?

Edit: So you say that it's a bezier curve, in that case you can't do this operation, unless you convert to mesh then back to bezier.
First thing, in the options enable Auto Merge and Split Edges & Faces:

Then select a vertex, press GG to slide, and C to extend the slide beyond the limit. When the edges will cross it will automatically create a vertex thanks to the options:

Wow, I didn't even know this existed. Good answer

Thanks for your answer. But unfortunately, I do not see those options available. Do you have an addon by any chance?
The only options I see are three check boxes. One for 'Origins', 'Locations' and 'Parents'.

You need to be in Edit mode

So I managed to turn on 'Auto Merge' and 'Split Edges & Faces', but when I double press G after clicking the vertex of my line, my line is still following my cursor and not staying on its current course. Any idea why that may be the case?

Could it be because I'm using a Bezier curve?

Yes you didn't precise, in that case, convert your curve to mesh, do the operation, then back to bezier

Using your steps, I managed to get edge slider working and can extend lines. However, the 'intersecting vertex' is not being made. Both Auto-Merge and Split Edges & Faces are ticked. Both lines were converted to mesh too
There is a step I'm missing somewhere. When I open a new project, here's what I do.

Tick auto-merge and split edges and faces.
Bring in two Bezier curves.
Convert both Bezier lines to poly lines (to make them straight).
Convert both lines to mesh.
Use the 'GG' + 'C' to extend both lines to get an intersection.

But the vertex still doesn't appear.

The 2 edges need to overlap, in my case they are aligned on the Z axis, otherwise no vertex can be created. So first thing maybe select all in Edit mode and press SZ0

I found my mistake. I had them both as separate items in my scene collection. After joining them with CTRL-J. I now get my vertex. Sorry for sending you on a wild goose chase.

Oh ok great then   ;)

@moonboot's way, the straight-up, straightforward use of tools, is preferable, IMO.. but if you had to do this repeatedly, then the shipped add-on Mesh:tinyCAD has a 'VTX|AUTO' operator that will extend coplanar edges to their intersection:


text:
How to Replicate Vergil's Judgement cut end Effect in Blender?
I'm fairly new to Blender so I don't know a whole lot. I'm in the process of working on an animation and wanted to include an effect similar to Vergil's Judgement Cut from Devil May Cry 5, where everything looks split like a shattered glass mirror. I have no idea how to go about achieving this effect.
Currently, I've attempted to place multiple cubes over a model with materials that have 1.0 transmission, 0 roughness, and screen space refraction turned on. The result isn't that great. I'd appreciate any advice one has to offer as to what I can do to create the effect I'm after. Thank you for your time.
I'll link a video to help demonstrate the effect I'm looking to replicate: Devil May Cry 5 - Vergil Motivated Combo
Here is a picture of the specific effect I'm attempting to achieve from the linked video as advised. I'm trying to make it where it'll look like everything in my scene is split apart by glass. Unfortunately I don't know how to describe the desired result any better than that.

Sharing some screenshots of what you have already and describing the effect you are after and your specific scene might help you get answers. Now it's not very clear what you are talking about. It's hard to imagine what you want your result to be.

It seems like it could also be achieved with some masking and position change in the compositor.

You could surround your object (or scene) with a large cube, and give it a shader like this - it's just a Voronoi Texture "warping" the refraction of the cube. It only works in Cycles, though, and there are un avoidable black "chunks" that show up in certain areas depending on the values fed to the IOR (as seen at the top in the screenshot). It may take some tweaking, but given the scene example video, you may be able to incorporate the "black spots" into the background in a way that is not obvious or unpleasant.

source: Stack Exchange

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

sort: votes


text:
How can I remove a linked library with Python?
Load and add linked object
I'm working on an add-on. The purpose is to link and un-link groups from another blend file. Thanks to stack exchange and the Blender documentation this works pretty well.
This means I can load a library and import a group from it.
with bpy.data.libraries.load(path, link=True) as (sourceData, targetData):
    targetData.groups = sourceData.groups

Then I search the library and extract the group to create an instance of the group:
instance = bpy.data.objects.new(name, None)
instance.dupli_type = 'GROUP'
instance.dupli_group = group
context.scene.objects.link(instance)

The result is a dupli-group object that links in the other blend file. (the link is persistent and will survive a reload .. that is what I want).

Unlink/Remove/Delete
My idea is to do the opposite. If the user does not want this link anymore, I would like to get rid of

the instance
the group
the linked library

This works pretty nicely too for this instance:
context.scene.objects.unlink(instance)
bpy.data.objects.remove(instance)

and the group:
group.user_clear()
bpy.data.groups.remove(group)

I saw (in the outliner/Blendfile)there is still a user to the library. I guess it is the group object. So I removed that too:
for object in  library.users_id:
    for object in  library.users_id:
        object.user_clear()
        bpy.data.objects.remove(object)

Now the outline shows me the library without any user ... but

How can I unload/remove/delete the library without reloading the blend file?
It seems there is no API call to do that. bpy.data.libraries.remove() does not exist. There is a load but no unload.
Saving/Loading the file removes the library. But this is far away from any comfort.

Reloading the blend file destroys the current context. E.g. undo would not be possible anymore. It also involves unnecessary file operations, that leads to another cycle in the backup files. Beside of that it simply feels incorrect to use such a workaround (Imagine you need to restart your PC each time you delete a file)

I found this one: Q: Proper way to remove unused linked Group data-blocks but this does not answer my question as I want to get rid of the library not just the group.
Do I miss something?
Thank you
Monster

Great question! Would be awesome to have this as add-on. Major issue is removing the group IMO, unfortunately I also could not find a proper way of doing this. Why not starting a bounty to get more attention?

I really think this is not implemented. I doubt a bounty will help there any further.

Quite an old thread, but it seems there is finally a solution available.
Newer versions of Blender provide the batch_remove method in the bpy.types.BlendData type.
So you can call:
bpy.data.batch_remove(ids=(my_library,))

my_library is a bpy.types.Library object in this case and no string/name.
Keep in mind that to this date, the documentation states, that this method is considered experimental, but as long as you don't deal with blend file critical data blocks like scenes, it seems you should be fine.

Straight forward way of removing all the libraries

import bpy

for lib in bpy.data.libraries:
    bpy.data.batch_remove(ids=(lib,))

Using a python "with" statement you don't need to unload/remove/delete the library, because when you leave the block of with, the resources are cleanly released regardless of the outcome of the code in the block. I suggest this post to better understand the use of with.

Unfortunately I do not see how this helps. The "with" clause is used along with load() - which is a (timely) separate step. I do not know what exactly the context managers are doing beside closing the file? My experiments didn't show any success in getting rid of the library reference.

You don't need to close the library, because when you go out of the with statement you have already closed it

My aim is less to close it. It automatically does this as you correctly state in your answer. I want to remove the reference to the library after the last user gets removed.

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

authors: Μυρτώ Θεοδουλίδου

authors: Сергей Игнатович

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


text:
Generate x cubes at random locations but not inside each other?
I'm generating cubes with this code:
for a in range(10):
    x = random.randint(-5, 4)
    y = random.randint(-2, 7)
    z = random.randint(3, 10)
    bpy.ops.mesh.primitive_cube_add(location=(x,y,z), radius = 1)`

What do I add to make sure no one of these 10 cubes are created with some part of it inside of one of the earlier created cubes?

I would look into Poisson sampling

@SebastiánMestre would be interested in seeing an answer using Poisson Sampling

my mistake, i meant poisson disk sampling. and i am sorry, i won't be leaving a reply

A similar answer that utilizes Blender's Mathutils' Vector length property (prevents you from needing to calculate distances in all 3 axes individually):
import bpy
from random import random
from mathutils import Vector

cubeRadius    = 0.25
maxIterations = 1000 # Max iterations to prevent while loop from running forever

# min and max values for each axis for the random numbers
ranges = {
    'x' : { 'min' : -10, 'max' : 10 },
    'y' : { 'min' : -10, 'max' : 10 },
    'z' : { 'min' : -10, 'max' : 10 }
}

# Generates a random number within the axis minmax range
randLocInRange = lambda axis: ranges[axis]['min'] + random() * ( ranges[axis]['max'] - ranges[axis]['min'] )

size  = 250 # Number of cubes
cubes = []  # Cube coordinates list

loopIterations = 0
while len( cubes ) < size and loopIterations < maxIterations:
    loopIterations += 1

    # Generate a random 3D coordinate
    loc = Vector([ randLocInRange( axis ) for axis in ranges.keys() ])

    if len( cubes ) > 0:
        # Search for overlapping points (within the cube radius radius)
        overlappingPoints = [ p for p in cubes if ( p - loc ).length < cubeRadius * 2 ]

        # if any found, skip this location
        if overlappingPoints: continue

    # Add coordinate to cube list
    cubes.append( loc )

# Add the first cube (others will be duplicated from it)
# Note: in blender 2.8 size arg is used instead of radius
bpy.ops.mesh.primitive_cube_add( radius = cubeRadius, location = cubes[0] )

cube = bpy.context.scene.objects['Cube']

# Add all other cubes
for c in cubes[1:]:
    dupliCube = cube.copy()
    dupliCube.location = c
    bpy.context.scene.objects.link( dupliCube )
    # in blender 2.8 an api change requires to use the collection instead of the scene
    # bpy.context.collection.objects.link(dupliCube)

Much more efficient. The only thought i would have for a change is instead of a max iteration check for consecutive fails vs a max fails in the event someone wanted to push the limit of size > iterations. (easily incremented & reset at the "overlappingPoints" check. And i guess regarding the specific question adjust for using randint(). but thank you for the improved version.

Good candidate for using any if any((p - loc).length < D for p in cubes): continue

For small sample sets testing collision can be done like this:
import random
import bpy

obj_ctr = []
obj_radius = 1
# one object must be created outside the loop for data structure to be available for testing
x = random.randint(-5, 4)
y = random.randint(-2, 7)
z = random.randint(3, 10)
obj_ctr.append((x,y,z))

#while len(obj_ctr) < 10:
for a in range(10):
    test_x = False
    test_y = False
    test_z = False
    x = random.randint(-5, 4)
    y = random.randint(-2, 7)
    z = random.randint(3, 10)
    for test in obj_ctr: #verify the new randoms will not allow collision
        if abs(test[0] - x) < obj_radius * 2:
            test_x = False
        else:
            test_x = True
        if abs(test[1] - y) < obj_radius * 2:
            test_y = False
        else:
            test_y = True
        if abs(test[2] - y) < obj_radius * 2:
            test_z = False
        else:
            test_z = True
    if (test_x and test_y and test_z):
        obj_ctr.append((x,y,z))

for obj in obj_ctr:
    bpy.ops.mesh.primitive_cube_add(radius = obj_radius, location = obj)

As you attempt to create more items iterating through all the previously created items to test for intersection will become increasingly time consuming.If you use the while loop (to ensure 10 objects) be careful that the random ranges are large enough or radius is set small enough to avoid infinite loops.

I am not very good with Python codes, but there is one node in Sverchok Add-On that basically scatter bunch of vector points and "remove within distance" so you don't get overlapping. Check the node Python code and you can see the algorithm.

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


text:
Why are some of the faces on my mesh lit up?

I'm relative new to blender, and I found myself working on some models for a game.
Recently I was modeling this door, but at some point I've noticed that some of the faces are lit up for some reason.
I tried some things I knew about but none of them worked yet.
Maybe someone knows how to fix this problem

I hope this image provides more info.
I've also tried to recalculate and flip the directions of the normals, but none of these are fixing it.
If I smooth the mesh it looks way more weirder than having it on flat shading.
The mesh keeps its lit faces inside the game engine too.
I'd reconsider making a totally new mesh, but I'm still curious about the faces acting this  way.

It might be just a blender thing. Try importing it into the game engine and see if the problem persists?

It would really help if you uploaded the file. What rendering engine are you using? What display/shading method are you on? Where is the light source relative to the door, and what kind of light is it?

You're probably getting an edge-lighting effect because there's a light in the scene that's almost directly beside and/or above the door; look in the vicinity of the top-right corner of this image.

Blender Internal engine (shown on screenshots) in Texture shading mode will take lighting into account so that is result from your lamp. I don't have any idea about how the problem persists in the game engine unless you test this in Blender Game engine with the same light conditions. Try adding more lights into the scene (not 20, I mean 1 sun and 1 spot or alike)

Are you talking about the "orange" parts?

First off, you should check where your light is coming from.
If the light is close to the door, the dents of the doorframe might block light, only parts that are raised a bit will catch the light. You could easily check that by placing another light source in the scene.
Another thing you should check is if your normals are ok. You can tell blender to recalculate these when you go into Edit Mode, select the affected faces of the model (should be ok if you just select the entire model) and then press "Recalculate" in the left tab under "Shading/UVs". Flipped Normals can often cause lighting issues in the viewport as well.


text:
Mesh with weird inverted light direction
Sometimes while editing meshes I get stuck with a weird kind of behaviour. I know mostly it happens due to my fault as a newby, but I need find the way to fix it.
Step by step explanation appreciated.

https://www.sendspace.com/file/7pyhz1

Hope this helps.

Are your normals correct?

Yes, normals were ok, Mike`s solution helped me

The obj file has bad normal data for some reason, which gets imported into Blender. The way to fix it is to delete any custom normal data using the 'Clear Custom Split Normal' button from the object data panel.

Great, thanks for quick reply, very helpful!

When some faces look dark on a mirrored side of a mesh put your mouse in the 3D view and press 'n' to toggle the right side menu to appear and then 'tab' to edit mode.
Scroll down the properties column till you find the Mesh Display, you'll find
Normals: Click on the cube, that's for the faces.
The lines stick out of the facing faces. If some are facing the wrong way they are inverted and the back side will look dark. The normals indicator will help you determine that.
You have 2 choices:
1 try selecting the entire mesh then use the Recalculate in the Shading/UV tab in the left side menu, press  't' to toggle that menu to appear.
2 If that doesn't work select only the face that are inverted and choose Flip Direction.

I took a look at the files, and strangely enough the normals actually look alright. The problem doesn't seem to be coming from the material, either. https://i.imgur.com/tvv5Txz.png It's got to be something else.

In fact, this is what the model looks like with flat shading. I haven't a clue what's going on here. https://i.imgur.com/NgJg61Y.png

Oh I see now, Delete the mesh data. In the properties tab scroll down to the Geometry Data and delete all the mesh data on the 3 buttons. That is weirdness is usually found in imported mesh. See if that works.

Yes, Clear Custom Split Normals Data and after Add Custom Split Normals in Geometry Data helps me as stated in Mike`s reply. And I did it many times before posting this issue and my mistake was that I was doing this with mesh that became weird after some manipulation with it (mirror or whatever), but correct solution is to do all that stuff with the rest meshes. Thanks!

In my case that one mesh was Vertical Stabilizer Rudder, and the rest meshes - all the rest aircraft parts.


text:
Does the Blender Internal renderer have an internal Light(ing) hierachy?
I'm using Blender 2.77 and I have currently arrived at the native Blender Renderer engine, and I fully want to understand how it works and how I can use, adapt, modify it for my own Blender projects.
I've already read many free e-books, articles and watched many videos about it, but I want to be able to truly understand AND visualize its inner workings.
Unfortunately none of these sources offer much in-depth/under-the-hood insight on how stuff really works, so I still have lots of technical in-depth questions about the Blender internal Render engine like:
QUESTION: Does Blender Render use an internal hierarchy for Light-Sources?
This enables me to figure out (up front, and not by numerous trail-and-error renders) which BI light settings are going to influence and.or trickle down  onto other light/material/texture settings?

You need to explain what you mean by an internal hierarchy of light sources? Why do you need it? What is the goal you want to achieve for having this.

What it seems is that you are seeking programming advice and information about the Blender source code. That is off-topic here: https://blender.meta.stackexchange.com/a/6/7777. You will find people able to better help you on official dev irc or mail-list. It is very likely Blender Internal uses BVH for shadow-ray speedup. You can set the spatial acceleration structure under Performance tab in rendering properties.

@J.Bakker In Blender Internal computing of shadows rays is O(n) where n is number of lights, because there has to be a ray to every light source how it effects the surface. There are many acceleration structures to optimize this like spacial ones and importance ones - this is what he means with internal hieratchy of light-sources.

Btw. @IndogoWarrior9 you can omit the info of what you have red, it is irrelevant to the question and makes it harder to filter what you are after:)

@Jerryno: (1) Thanks for pointing me in the right direction(s). I've found more information now on the Blender Dev/Source/Render/Cycles/BVH page and will contact the chatroom later. (2) I've already downloaded the latest Blender source-code, to take a look at it, from the inside.
(3) One remark: Do not try to assume anything about what anyone wants to know nor what their motivation can be. its better to ask a question back to give them a change to better explain the knowledge they are seeking

@J.Bakker: I want to fully understand which BI "light-source" has the most (light/energy) influence over others "light-sources", so I can use 'm better determine their influence on my scene objects.

If that is the case, than there is no order of strengths of their lights. BI is a ray tracer. Note that the question does not state your last comments. Can you update the question to what you are looking for and keep in mind that this is stackexchange. Is the question really something that other people are also looking for. Or are you looking for a different platform to get your answers.


text:
How does the Blender Internal Renderer create Environment Lighting exactly?
I'm using Blender 2.77 and I have currently arrived at the native Blender Renderer engine, and I fully want to understand how it works and how I can use, adapt, modify it for my own Blender projects.
I've already read many free e-books, articles and watched many videos about it, but I want to be able to truly understand AND visualize its inner workings.
Unfortunately the official Blender Render manual does not offer much in-depth/under-the-hood insight on how stuff really works, so I still have lots of technical in-depth questions about the Blender internal Render engine like:
QUESTION: - How does BI create "Environment Lighting"?
Is this done by adding just another (hidden) Lamp (like spot, point, hemi, sun, area) to the scene or is it done otherwise?

Your links are not working could you fix them?

Links fixed, thanks for your quick reply!

From the Blender documentation 1
Environment Lighting
Environment light provides light coming from all directions.
Light is calculated with a ray-traced method which is the same as that used by Ambient Occlusion. The difference is that Environment lighting takes into account the “ambient” parameter of the material shading settings, which indicates the amount of ambient light/color that that material receives.
Environment Lighting panel.
Also, you can choose the environment color source (white, sky color, sky texture) and the light energy.
Energy: Defines the strength of environment light.
Environment Color: Defines where the color of the environment light comes from.
Using both settings simultaneously produces better global lighting.
It is good for mimicking the sky in outdoor lighting. Environment lighting can be fairly noisy at times.
Internally blender creates a sphere with these settings. Sampling this sphere will influence the ambient parameter in the reflection model.


text:
ray_cast cannot capture unapplied objects？
import bpy
import bmesh
from mathutils import Vector
from mathutils.bvhtree import BVHTree

# Simulate objects in the scene
# Don't change any parameters
# ###########  Start
if(len(bpy.data.objects)==0):
    bpy.ops.mesh.primitive_plane_add(size=1, enter_editmode=False, location=(0, 2, 0.5))
    bpy.ops.mesh.primitive_plane_add(size=1, enter_editmode=False, location=(0, -2, -0.5))

objs = [obj for obj in bpy.data.objects if obj.type == "MESH"]

bpy.ops.object.select_all(action="SELECT")
bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)

objs[0].location[1] = -2
objs[1].location[1] = 2

# Simulate objects in the scene
# ###########  End

# Set the starting position and direction of the ray
ray_begin = Vector((0, 0, 1))
ray_end = Vector((0, 0, -1))
ray_direction = ray_end - ray_begin
ray_direction.normalize()

# New bmesh
bm = bmesh.new()
# Add all objects
bm.from_mesh(objs[0].data)
bm.from_mesh(objs[1].data)

#  mat0 = objs[0].matrix_world
#  mat1 = objs[1].matrix_world
#  # Try
#  bm.transform(mat0)
#  # Or
#  bm.transform(mat1)
#  # Or
#  bm.transform(mat0 @ mat1)
#  # Doesn't solve the problem

bvh = BVHTree.FromBMesh(bm)
# Objects may overlap, which is why I don’t use Object.ray_cast
p,n,i,d = bvh.ray_cast(ray_begin, ray_direction)

# Print: None None None None
print(p,n,i,d)

this doesnt work for objects that are rotated/scaled without this rotation and scale applied, What should I do?

A case of space.
Like object ray cast the bvh ray cast uses object space.  For example the two planes added in question will both have exactly the same local coordinates for each planes four face vertices.
Possibly the easiest solution is to work in global space. Applying a transform is equivalent of converting local to global. Here is a test script to create a bmesh from each selected object, and transform the just read mesh coords to global space as they are being read in.
Have arbitrarily used a from_object bmesh which will have modifiers and shapes applied. (Use as in question to get unmodified / deformed .. but still transformed mesh)
import bpy
import bmesh
from mathutils import Vector
from mathutils.bvhtree import BVHTree
from bpy import context
dg = context.evaluated_depsgraph_get()

bm = bmesh.new()
mesh_obs = (o for o in context.selected_objects if o.type == 'MESH')
i = 0

for ob in mesh_obs:
    bm.from_object(ob, dg)
    bmesh.ops.transform(
            bm,
            verts=bm.verts[i:],
            matrix=ob.matrix_world,
            )
    i = len(bm.verts)

bvh = BVHTree.FromBMesh(bm)

p, n, i, d = bvh.ray_cast((0, 0, 0), (1, 1, 1))
print(p, n, i, d)


text:
How to automatically run 3rd party plugins at startup？
The plugin is simpletabs
Documentation has this problem：
Sometimes, when I start Blender, SIMPLE TABS doesn’t load the correct order.
As mentioned before, you can press the check button. This tends to happens when re-opening Blender from a crash.

But it doesn't solve the problem.
Can I make blender run the following command automatically when it starts?
bpy.ops.simpletabs.update()

There are several ways, but I'm not sure it will fix your issue since it depends when the "startup command" is run compared to the addon's registration.
First, you can have Blender to run a python file at startup, you can do this by running Blender via command line or via a script file (.bat on windows).
myScript.py:
import bpy
bpy.ops.simpletabs.update()

command:
blender -P path/to/myScript.py

Second method is to make a Startup Script that does it for you
import bpy
from bpy.app.handlers import persistent
@persistent
def refresh_simpletabs(dummy):
    bpy.ops.simpletabs.update()

def register():
    bpy.app.handlers.load_post.append(refresh_simpletabs)
def unregister():
    pass
if __name__ == "__main__":
    register()

Put that script into your scripts/startup/.The exact location of this directory depends on your installation. See the directory layout docs.


text:
How to check if an object is in a local view?
I found a lot of places and mentioned that this is a bug, and I have tried it.
such as: How to get a list of objects that's currently in Local View?
C.object.local_view_get(space)

Test version: blender 3.4.1
Fortunately, I accidentally discovered the solution:
Tips from this:
https://devtalk.blender.org/t/custom-collection-property-on-spaceview3d-type-creates-a-tuple/11746/4
import bpy
from bpy import context as C

def get_view_regions(context):
    screen = context.screen
    view_region = None
    view_region_3d = None
    view_space = None
    for a in screen.areas:
       if a.type == "VIEW_3D":
            view_region_3d = a.spaces[0].region_3d
            view_space = a.spaces[0]
            for reg in a.regions[:]:
                if reg.type == "WINDOW":
                    view_region = reg
                    break
            break
    return view_region, view_region_3d, view_space

region, rv3d, space = get_view_regions(C)

deg = C.evaluated_depsgraph_get()

ob = bpy.data.objects["obj_in_local"]
# ob = bpy.context.active_object

print(ob.evaluated_get(deg).local_view_get(space))

Successfully printed "True"


text:
Why does the color of the UI set by FloatVectorProperty appear inconsistent?
theme = bpy.context.preferences.themes[0]

axis_x: FloatVectorProperty(
        name = "axis_x",
        subtype = "COLOR",
        precision=3,
        size = 3,
        min = 0,
        max = 1,
        default = theme.user_interface.axis_x
    )

What should I do?
Thanks!

use subtype = "COLOR_GAMMA"
https://docs.blender.org/api/current/bpy_types_enum_items/property_subtype_number_array_items.html#rna-enum-property-subtype-number-array-items
theme = bpy.context.preferences.themes[0]

axis_x: FloatVectorProperty(
        name = "axis_x",
        subtype = "COLOR_GAMMA",
        precision=3,
        size = 3,
        min = 0,
        max = 1,
        default = theme.user_interface.axis_x
    )


text:
image texture not showing in final render but does in 3d view?
So i've modelled a bottle with a label and cap, i am using an image texture on the label which works fine in the render but the one on the cap shows in the 3d view (in live render mode), but not in the final render (as in when i click the "render" button). It just shows the colour of the cap. anyone know why this is? will include pics.
not enough rep to add multiple images so link to imgur: imgur
EDIT: thanks for replies, added pictures of settings, let me know if you need anything else.
EDIT2: tried re uploading the image file, renaming it etc, still not showing in final render.

Please edit your question and provide more information like screenshots of mesh settings, modifiers, UV mapping, material and texture options. It's impossible to tell with the available info

Also check if the texture is still available to Blender where you left it in the same location with the same name. Check modifiers for different settings between viewport and render, and material settings.

Somehow the cap label image got moved from the original location. (meaning, the image was on your desktop and moved into a folder for example)
It still shows up in the viewport because it put a "thumbnail" or quick load version of it but it is not accessing the original file.
I would reload the original file again and it should work.


text:
Can I calculate the moment in different parts (in an assembly) in Blender?
Can I calculate the moment in different parts in an assembly in Blender?
I would need to calculate the moment affecting a machine when lifting different weight of objects. Can this kind of calculations be done in Blender? I'm trying to find this out before starting to learn Blender
I can see there are nice simulations, but I would need the calculations in different positions.

short answer: AFAIK: no

I don't think so, each vertex is given a weight but I'm not sure how the weight is distributed


text:
How do I remove the glare from my final render?
I am trying to create a 10 second Star Wars animation where a Tie-fighter flies by a star destroyer and I personally think it looks great while it is rendering right up until it finishes where the lights suddenly start blowing out the image making it look awful.
Attached I have a photo of how it looks while it is rendering (how I want it to look) and what the finished render looks like (the blown-out image). I have already tried removing glossy from ray visibility.

without seeing any settings you made - we can just guess or ask for details. So i would recommend providing your blend file

Are you using compositor nodes? Try disabling the compositing step.

@Chris Sorry I have the file attached now

@Leander How would I go about doing that?

one way is simply disabling compositor, as Leander said, then you will get this:

you can disable it by unchecking use nodes in the compositor tab:

You could disable compositing as in @Chris answer, but then you lose all your compositing. You don't have to, you could just remove the glare from that compositing and keep the rest.
You have two active glare nodes in your compositing, as well as your Emission pass blured twice then added onto your render (that's basically a manual glare):

You can select all these nodes, and press M to mute them or ⎈ CtrlX to dissolve them (dissolving is deleting plus preserving the nodes' connections).
In either case, they will not affect your render anymore.
Since you render into a video, you need to press F12 to re-render the entire sequence.
For anyone else doing a single image render:
Press F12 if you haven't rendered yet, or press F11 to open the render view in the Image Editor. You should see your render with the updated compositing. Press Alt S to save it into a file of your choosing.
Final result:


text:
UV project in geometry nodes
I want to project UV coordinates of the instancer on its instances using geometry nodes. I get the rough idea but can't figure out node setup.

Each vertex on instances should have its own "UV position" instead of sharing same information.

You can solve this task as follows:

Instantiate your objects on the surface with Distribute Points on Faces and Instance on Points.
Convert the instances with Realize Geometry into an editable geometry.
Use the nodes Sample Nearest Surface and Named Attribute to get the position on the existing UV map of the sphere.
Save this vector with Store Named Attribute and assign the same material to the objects as the one you use for the sphere.

Note, however, that this technique does not work if an object is located at an intersection of the existing UV map!
(Blender 3.2+)
PS: If you are using a version lower than 3.4, you would need to replace the Sample Nearest Surface node with the Transfer Attributes node.


text:
Blender used 40 GB of my storage
I was rendering an animation and it was supposed to be done on the D: drive. After finishing rendering on the C: drive, Blender had used 40 GB.
I can't find these files anywhere.

Windirstat is a program that will analyze your drive and provide a graphical display telling you what folders on your drive are taking up the most space.  A 40gb folder should stand out.

A Temp folder like @TitaniusAnglesmith suggested might be a good start, but the default path Blender uses is C:\tmp\


text:
Mesh crotch area deforms really weird when posing - using Auto-Rig Pro for armature
This model I am using is a model I got off of CGTrader, so I didn't make it, but I've been trying to rig it using Auto-Rig Pro.
It did have an armature with it when I downloaded it but it didn't work as well as I wanted, no issues with the crotch deforming though. I tried Auto-Rig Pro, everything else seems to move just fine but the crotch area deforms in a weird way. I've tried weight painting it and it helps a bit but not all the way.
I also tried to add custom bones by the inner part of the thigh, which seem to work but they didn't move automatically with the rest of armature even when parented (not sure if they even can with Auto-Rig Pro armature).
I also tried changing the location of the bones that Auto-Rig Pro created, it didn't result in anything better.
I was thinking maybe the topology may need to be redone but not sure. If anyone has any ideas or tips on how to fix this so then I know what to do in the future if it happens again, that would be great!
Also I am somewhat new to Blender, still learning it but kinda know my way around a little bit
Here is the model in rest pose and the topology:

Here is the model with its legs moved and for some reason the crotch pops out like that and even if I weight paint it, it still does this

These two weight paint images are the original weight paint done by Auto-Rig Pro that results in the strange deformation. There are two vertex groups that control this part of the leg.

When I made changes to the weight paint and the results. Not a perfect weight paint but I was just trying out things to see what would work but no matter what I did the results were about the same

The results:

Using Blender 3.2.1

It looks like the problem is indeed the weight paint. I believe it looks better after you edited the weight painting on the legs. Auto Rig and other automated solutions are not perfect and never were. Most of the time they require additional work to weight painting.
On your last picture you can see that the front of the crotch seems to deform better but a part of the back still stretches. Try and improve the backside of the thighs weight paint and see if that solves the problem.

@SolomonTheScapegoat sorry for the late reply, i was trying out your suggestion. i think i got it down now, it took awhile messing around with the weight paint. i kept getting random extrusions each time i weight painted and it was always bumpy looking. took awhile to make it smooth and looking nice.  i also ended up noticing that there was a vertex group that i didn't realize was effecting that area to. I think its good now. Thank you for your response!

In the weight paint menu is the option for smoothing out the current weight paint layer as well as other neat options and shortcuts to manual editing. This can help you to reduce these spikes in topology being moved with the bone in a very quick way. You increase the iterations and it gets super soft and smooth everywhere.

@SolomonTheScapegoat thank you! i need to go through all the options in that menu and see how they all work because i didn't even notice it was there till now. the smoothing option help a lot.


text:
What is the 2.8 shortcut for "Operator Search" on Mac?
I would like to know what key or key combination opens the search field in Blender 2.8 on a Mac. Can anyone answer this? "F3" does not do it.
Thanks!

You have to hold down function (fn) then hit f3.

Unfortunately, doesn't work for me. I am on a Mac, but using an external Windows-like (German) keyboard. None of the function keys are actually recognized, even when trying to manually map them.

You can hold down fn and then hit F3.
If this is not working for you maybe you can change your hotkey for that.
You can read about Keymap editor in the link below. The Keymap editor lets you change the default hotkeys. You can change keymaps for each of Blender’s editors.
https://docs.blender.org/manual/en/latest/editors/preferences/keymap.html
This thread may also be helpful:
how do you change the keyboard shortcuts in blender 2.8?

You might want to explain how to change the shortcut in detail, otherwise your answer is just a copy of the other answer already given one year ago.

I added a link for that.

And how to change the shortcut to call "operator search"?

I kept right click select keymap ... So for me it is still Spacebar


text:
Lightmap Pack is non-uniformly scaling my geometry?
I selected all my objects, then I did a "Lightmap Pack". Initially, it seemed like everything went ok. However, when I look closer, it seems to have stretched some the UVs.

The shape of the selected UV on the left, is not a match for its corresponding face on the right. Why couldn't it preserve the shape?

Update #1: I did more looking around, and noticed that the smallest faces seem to map correctly; notice how this tiny square face (from the same object as the big one) actually did the mapping correctly. I also (for sake of trying) did an "Apply Scale" to all my objects, it seems to have made no difference (even after re-doing the lightmap pack).

Update #2: Max'ing the "quality" setting for Lightmap Pack didn't seem to fix it, or even make it any less distorted.

Is your object scaled? Try applying the scale (Ctrl A) and unwrapping again

@gandalf3 No; nothing is scaled. That face (and its vertices) are from an import of an .obj.

The purpose of Lightmap Pack command is to utilize as much UV space as possible by storing each face (individually) in the UV space bounds.
I must admit that I can't tell you how exactly the algorithm works, but if you consider two similar objects that differ only from the lenght of a face (8.0 vs 8.1) you'll see different results of the lightmap pack command.
In the shortest parallelogram, each face is not "enough" different from the average face size of the object, so they are all stored with the same size in the UV. The proportion are not preserved. They are stretched to fill the boundaries.

In longest parallelogram, Blender sees instead that some faces are much longer than other (they just get over the alghorithm thereshold), so it is aware that they should need more space.
Notice that also in this case, despite what could it seem, proportions are not mantained. The Face is 2:8.1, while the UV is more 2:4. That's because Blender look for the best way to fill all the UV space, regardless proportion. This is a uv layout for Baking textures efficently.

If you are interested in keeping the proportions, Lightmap pack is not the right UV unwrapping method.
In the brought example I would separate each face by extruding them individually by a 0 factor, than Crtl+i to invert seelction and Canc to delete unwanted faces.

Than a simple Unwrap or Smart unwrap, should pack all the faces preserving their proportions in the UV map.

But lightmap is the only unwrap that allows you to do a batch unwrap; if I use a simple/smart unwrap, I have to join all the objects.

You can run the command Smart Unwrap without joining them. Exit edit mode, go to Object mode, select all objects, press the spacebar and then type "Smart UV Project" with your settings.

oh? awesome, but it still appears distorted, and I even tried applying scaling prior, it's still distorted.

That's because Smart Unwrap try automatically to fill the UV space so it scale all the faces by the same factor on one axis and than by another factor the other axis. There are no correspondences between the units in the model (meters, inch...) and the units of the UV/Image editor (which are pixels). If it would be possible to edit at the same time the UV of different objects, it would be just a matter of scaling on one axis. This would led to a non-completely filled UV-Layout...is that your purpose? Consider also that the proportion of your texture modifys the appearence of the UV map.

You said Smart Unwrap "should pack all the faces preserving their proportions in the UV map" well it doesn't. Scaling in one axis of the UV map might be a workaround though, presuming you're right about the implementation of Smart UV. I'm skeptical that your idea actually works because notice on my original question that some of the faces did infact appear correct, so it doesn't preserve portions even along a single axis.

He he, sorry is difficult to explain in a few words! In my opinion, they keep proportion "between faces"...I mean, 1x1 and 2x1 became 1x1 and 2x1 (and than the uv aspect depends on the image proportion and packing), but with lightmap, 1x1 and 2x1, became 1x1 and 1x1.

Here's a gif of what I'm talking about..http://gph.is/1OxxBZo. With Smart UV and a correct UV image aspect ratio, you can have the same proportions of the geometry. With Lightmap only in a few cases (ex all faces of the same size..).


text:
Texturing the sides of a cube (without UV mapping) only appearing correctly in Rendered View?
I'm working on a Minecraft themed map, and have a ton cubes. Some cubes require 3 materials (a top texture, bottom texture, and sides texture). When I apply the top and bottom materials, it applies it correctly. However, when I apply the side material, it looks distorted and smeared, and only appears correctly when viewing it from the Renderer Viewport (rather than the Material Viewport).
Material View:

Rendered View:

Is there a way to fix it, without resorting to UV mapping?

Is scale applied? If it is, then the only thing I can think to do is to UV Unwrap, but instead of taking the time to do it manually, and creating seams, you can just project from cube.

@J.A.Streich It's already set to cube projection. That's what makes it work in rendered view, but it's not appearing correctly in material view.

@cegaton Overkill, and overhead; I don't need that much control, and with several thousand of these cubes being on the map, I'm worried about performance implications. Infact, with the manner in which I merge cubes (to remove hidden faces and duplicate verticies), UV mapping is likely far more difficult than you're imagining.

I am not optimistic that there is a way to "solve" this without using UV maps.
If it is any encouragement, understand that many people before you have converted minecraft data into 3D data sets:  http://www.purplefrog.com/~thoth/minecraft-webgl/two.html ; and they used UVs.
I can't remember why I wrote this, but it is python code that makes up a UV map based on the position of the vertices relative to whichever of the XY, YZ, or XZ planes they are most aligned with.
Here's a copy inline:
import bpy
import bmesh
from math import *
from mathutils import *

def set_uvs_for_face(bm, fi, uv_layer):
    face = bm.faces[fi]
    normal = face.normal
    dx=abs(normal[0])
    dy=abs(normal[1])
    dz=abs(normal[2])

    if (dz > dx):
        u = Vector([1,0,0])
        if (dz>dy):
            v = Vector([0,1,0])
        else:
            v = Vector([0,0,1])
    else:
        v = Vector([0,0,1])
        if dx>dy:
            u = Vector([0,1,0])
        else:
            u = Vector([1,0,0])
    for i in range(len(face.loops)):
        l = face.loops[i]
        l[uv_layer].uv = [ u.dot(l.vert.co),
                           v.dot(l.vert.co)]

def set_uvs(mesh, name=None):

    if name is None:
        if 0<len(mesh.uv_textures):
            uv = mesh.uv_textures[0]
        else:
            uv = mesh.uv_textures.new("cubic")
    else:
        uv = mesh.uv_textures.get(name)
        if uv is None:
            uv = mesh.uv_textures.new(name)

    bm = bmesh.new()
    bm.from_mesh(mesh)

    uv_layer = bm.loops.layers.uv[uv.name]

    for fi in range(len(bm.faces)):
        set_uvs_for_face(bm, fi, uv_layer)

    bm.to_mesh(mesh)

#
#
#

mode = bpy.context.mode
if 'OBJECT' != mode:
    bpy.ops.object.mode_set(mode='OBJECT')

obj = bpy.context.active_object
set_uvs(obj.data)

if 'OBJECT' != mode:
    bpy.ops.object.mode_set(mode = mode)


text:
Reloading Scripts Behavior
Should reloading scripts with F8 cause issues with the UI, and Blender all together? It has been doing such to me (factory defaults), but I don't know much about the feature.
A common issue arising is:
Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender\2.75\scripts\addons_contrib\
space_view3d_quickPrefs.py", line 939, in setup
    gllightpreset_chooseLoadLocation(1)
  File "C:\Program Files\Blender Foundation\Blender\2.75\scripts\addons_contrib\
space_view3d_quickPrefs.py", line 604, in gllightpreset_chooseLoadLocation
    filepath=bpy.context.scene.quickprefs.gllightpreset_importdirectory
AttributeError: 'Scene' object has no attribute 'quickprefs'

This is with factory defaults, but after reloading scripts. I have not changed the scripts folder either. Vanilla settings. This error will pop up every 100ms, until I enable the QuickPrefs addon from the Testing branch.
I'm really not worried about the issue of quickprefs, more than I'm really trying to find answers to the following questions:
1. Is the reload scripts command (default F8), only reloading the base script folder built-in with the Blender install, or does it reload all scripts referenced in the instance?
2. Does the "Scripts" Folder setting effect what folder is reloaded when executing "Reload Scripts".
3. Is it common for a brand new install, without any changes, or enabled addons to error when reloading scripts after it's very first startup?
The point of these questions is so that I may understand that portion of Blender quite a bit better, as well as know what is considered "normal behavior" before reporting bugs. My apologies for not being more clear.

Please add some info to your question as to what issues reloading scripts is causing.

So are you saying that the reload scripts option should not cause issues, because that's all I'm trying to figure out. I've updated the question to try to make this more clear, and the reason I asked the question the way I did. There are lots of other errors, but of course I'm listing the most common.
If it's one of those scenarios where there are certain issues that arise when reloading scripts, I can understand, but I'm really just trying to understand exactly if ANYTHING that errors from this command warrants a bug report.

the addon has a tracker URL: https://developer.blender.org/T27822 and the same problem noticed here ..two years ago and has not been fixed: https://developer.blender.org/T27822#119941 . I don't think the addon should be included until the author (or someone interested in the addon) fixes it.

This particular script should now be fixed as of : https://developer.blender.org/rBAC36fd773d16d24d57d1790dd7b59d517fb6d8286a . next time you download a blender with addons_contrib, this addon will behave properly!

Haha, that's good to know. Thanks for the links Zeffii, now I know where to go when I look up my other script errors in 2.75rc2.
There have been a lot of other issues that have come from my reloading scripts, but I really wanted to understand exactly what was happening before filing any reports. I appreciate all of the input you have all given.

Is the reload scripts command (default F8), only reloading the base script folder built-in with the Blender install

Any addon that you have currently enabled (usually saved in User Settings or default.blend) will go through the motions of unregister() and register() when you press F8. The add-on's unregister() function must carefully remove anything it has added. (in this case that add-on doesn't remove everything and should be fixed)

Does the "Scripts" Folder setting effect what folder is reloaded when executing "Reload Scripts".

Yes. But the Scripts folder is loaded in addition to Blender's own version/scripts/addons/ folders (which can either be local to the binary or in a special storage place used by Blender for all versions of Blender

Is it common for a brand new install, without any changes, or enabled addons to error when reloading scripts after it's very first startup?

On a fresh Blender start-up; add-ons which are not enabled (ie no tick present in the addon preferences ) will not be read by Blender, and not interpreted by Python. So when you do get an error it will be because one or more add-ons has been enabled at some point during the Blender session. If you are getting an error from an add-on that has been enabled, it is most likely an addon in the addons_contrib directory, and exactly what the cause is will be unique to the addon.
edit -- this should now be fixed already in addons_contrib
In the case of the space_view3d_quickPrefs.py it seems to be caused by the persistent handler being added in the register phase but never removed in the unregister phase.
A fix would be to add this line at the end of the unregister function:
def unregister():
    ...
    bpy.app.handlers.scene_update_pre.remove(setup)

Thank you so much for making this clear to me. I appreciate the time taken to deal with such an obscure question. :)

Making addons, complex addons especially, play nice with the F8 can be tricky but it's important because it's a key that gets pressed either intentionally or unintentionally.. I don't consider bugs like this sloppy, but rather due to lack of understanding of the ecosystem of Python / Blender, also not exactly trivial to get to the point of mastery. ( i have not..)

Every addon uses a register function that allows it to add operators, panels, extra properties etc that it uses to work, it also has an unregister function to undo these changes when the addon is disabled.
If disabling an addon gives errors after being disabled that are related to properties or functions that it setup, then it is a bug in the addon that should be fixed.
You may notice that the addon you refer to is from addons_contrib, which is a collection of addons available that haven't been accepted as official addons to be included in release versions. Chances are this error is a known one and is one of the reasons it is still in contrib. In this case a release candidate is not being considered as a release version and includes the contrib addons, which may not be the best option.
While reloading scripts can help in some cases, it doesn't remove every change and start from scratch, for that you will need to quit then start blender. I believe reloading scripts relies on the unregister functions mentioned earlier to work properly.
Whether you are using a new install or an old one, it depends on the addon scripts enabled to whether any issues like this happen.


text:
What is the 3D equivalent of "offset paths" feature in 2D vector design software?
In Adobe Illustrator and other vector design software there's a feature to offset paths, where it creates a second path offset from the original:

I would like to find the equivalent for a 3D object in blender. It would produce something like the outer orange cube in this screenshot, which I just created manually by scaling it - but for more complex geometries, they would appear to get "fatter".

Please note this is different from scaling. Picture a 3D letter "U" - the two uprights would get closer and closer together as the offset was bigger - vs. scaling where they remain the same distance apart.
I've tried some modifiers with no success. Skin appears to be for modifying just vertices, and when applied to an object with faces, Blender hangs for a moment before it produced a very weird result. Some others like mesh cache, remesh, and volume to mesh don't appear to be the right solution. How can this be done?

That looks very much like the Solidify modifier..:)

Try searching for "blender array modifier object offset".  I am amazed at all the scaling and rotation offsets one can accomplish by using an Empty reference object.

https://blender.stackexchange.com/questions/143741/boolean-difference-with-offset/143745 https://blender.stackexchange.com/questions/168234/how-do-i-produce-an-uneven-offset-solidify-modify-on-a-cube/168235

Look at https://blender.stackexchange.com/a/238854/111042

@DuarteFarrajotaRamos displacement is exactly what I was looking for. Thanks! If you answer I can select your answer


text:
Arrays & Curves & Scaling？
Too much gap in spine after scaling curves, how should I modify to normal state?

If your goal is to reduce both the size and the gap, first set the curve vertex radius back to 1 and use the Object Offset of the Array, with an empty as Object, and scale down the empty:

Hmmm... but doesn't that just change the size of the objects along the curve? It's not changing the distance between them, or is it?

@Gordon Brinkmann oh ok I may have misinterpreted his question, I've edited

I guess since it's a spine, the increasing size is intentional...

Thank you, this is what I want... just a little difficult to adjust


text:
How does the drive swing left and right?

The angle between the bones cannot reflect the front and back, causes the shape key to work abnormally, as the picture shows.
How should this be achieved?

I'm supposing that in rest pose the two bones are straight.
You have to use two different shape keys, the first activated when the angle is positive (i.e. state A) and the second when it's negative (i.e. state C).
In my example there's an automatic weights assignement, without "preserve volume" active.
The shape keys are fully activated when bone's Z rot is 90 degrees,so the driver's expression are:
rotation_euler*0.64 for left
-rotation_euler*0.64 for right.

thanks for answer. I don't know how to generate negative angles. I can't find instructions for this. Could you give me a sample file for reference?


text:
Import Houdini particles simulation and display it as icosphere
I imported a foam simulation from Houdini to Blender. But I don't know how to display the particles as object.
The import is an .abc archive.
It is a large sim with 900,000 particles.

I am not familiar with an abc archive or Houdini, but 900,000… um, assuming the problem is not that your computer is now on fire, what does it import as, if not an object? Does the scene show no change? Is there an error in the bottom right? Can you add screenshots of the 3D viewport and Outliner editors?

I dont get any error, because I imported it like a Secuence, not a single file. Its get imported like points. I tried converting this points in instaces with geometry nodes, but in the high frames with lots of "particles" are over 70 millions of objects (I change the instaced object to a cube for optimization). The houdini render can handle that easely because its dosent work with objects at all, they are particles. I dont know if there is any way of importing that particle sistem instead of points to instaces.

“Its get imported like points?” as in, it imports into an object that is purely floating vertices? Or does it import to some data block that is not an object? What do you mean you imported it like a sequence instead of a single file? That’s an image thing. Please add screenshots. Also, the level of English you are at right now seems to be just barely enough to productively communicate about this problem; consider using a translator instead.

Im sorry about my English level. When I say it's imported as a sequence, I mean that blender (so as not to break, I imagine), allows you to import .abc files as sequence files. And it doesn't just upload a 10GB file, it just uploads a smaller file of just the currently selected frame. And blender converts the import to Verts.

Oh… I was wrong. ABC files are individual frames of an animation, but are not graphical images.

I think I've found a pretty optimal way to do it. But anyway, thanks for being patient with me. And if you think of a better way to do it, I'll be happy to try it.

This is the import.

And this blender.

I think I have found a way to display these "particles".
The best way I have found so far has been with geometry nodes. We simply instantiate the points as cubes (I still don't know if it is the least resource consuming geometric shape in blender), then we use realize instances. In this way it is possible to work with these amounts of particles, but you have to be careful with the amount of polygons generated. Because it scales very fast.

This is the solution I ended up with, but surely there are more optimal ways to do it without consuming so many resources.
If you think of any other way, put it so I can try it.


text:
V rip not working the same
I'm following a Domestika tutorial and was automatically getting this rip shape when I selected  vertices and then pressed V, then I started getting the message rip failed, thought I did something wrong and created a new mesh still won't work. I can manually separate the rip with G, but it won't automatically separate. What did I do wrong?
I'm using Blender 3.0.
Also tried with a cylinder without modifiers and I can only get that shape manipulating with G.

If you can separate it, the rip worked. If you get an error "Rip Failed" but you can move the vertex with G, then it means you tried to rip a vertex that was already ripped and has only one face left it belongs to. To rip a vertex to split it, it has to be connected to at least 2 faces (or if there are no faces, only edges, it needs at least 2 edges.

The other thing is, what do you mean with "automatically separate"? When you press V to rip vertices (and it does not fail) and you directly abort the rip for example by right-clicking, the new vertex remains in its original position so the now 2 vertices are in the exact same place. If you want it to directly move somewhere you have to move your mouse before right-clicking. If you do not move your mouse and the vertex stays in the same place it can be that if you now try again to rip it with V, you get the "Rip Failed" error, because it was already ripped before but you just do not see it.

Thank you so much I truly appreciate you took the time to reply, I know it's a bit confusing, my explanation is not very good, I've taken a little video of the issue, you see, on the first video https://youtu.be/WjAVCeq1eGc I'm literally not moving the mouse and the rip automatically separates, but on the second clip https://youtu.be/Jna6rwbLJ7M you can see it separates automatically the first time but not the second or the third time, but it's clear there's a rip, I really don't understand :(.

First of all: nothing is really separating there. The vertices stay in place, it's just the Subdivision Surface modifier rounding the edges because after the rip they are no longer connected and treated as a continuous piece. In the second video you can clearly see that when you first rip it on the side, there appears a little split in the mesh, but different than before. So I guess there are some flaws in your geometry like duplicate vertices etc. which are not visible just looking at it in a video. Have you tried to select all with A and then M > Merge > By Distance?


text:
Graffiti onto mesh with multiple UVs
I am trying to find a way to paint graffiti onto this object with multiple meshes where each one has its own UV and its own image texture.
The graffiti I want to paint is originally a PNG image.
Ideally, I could turn this PNG image into some type of stamp or brush, and use Texture Paint to add it to everything. Would that be the easiest way?
Or, what would be the easiest way to do this?
The blend file is shared here, train_sketchfab.blend.

Use for this stamp image object coordinates or another UV from View ...

You can try to add graffiti image and control position and scale by another object like an Empty used for Texture Coordinate node > Object ...

To use it in more materials you would have to add those nodes into each material. Close these nodes into a node Group to easier add them into materials and sync control between materials for later adjustments (if needed).

Note: instead of texture coordinates from object, you can use another UV Map ... just add another UV slot in Data Properties, Unwrapp > Project from View.
To use image as Brush (Stamp) it is possible, but I don't think blender can paint across several textures at the same time.
Maybe if set as UDIM?


text:
Iridescence shader is not iridescent, only banded
I got this from a tutorial I found on YouTube. It's supposed to create an iridescent surface, but creates only bands of green and black, and that only after I changed the value in the Multiply node to 0.5. I have no idea what to change, or if this setup is fundamentally flawed.

To be honest, quite often beginners are asking about things they are simply missing in tutorials because it can be tricky if you don't have the experience what details you have to pay attention to. So I'm not going to rebuild this shader setup on my own just to get the same result as you. Maybe it would help if you put a link to the tutorial in the question so we could see for ourselves where you might have been wrong. But sometimes it could also be a flaw in the tutorial so without the video it's hard to tell what is going on. From what I see there it doesn't make any sense for iridescence.

The tutorial is here: link

I found a much better tutorial.

Okay, good you found a better tutorial. I found what is wrong with your setup. The Color Mix node is set to the default Mix, but in the tutorial he switches it to Multiply.


text:
Making a pattern 2.5 dimension for a mould making process?
I have a detail which I wish to add to mould that I intend to slip cast, see 3D Printing a Mold for a Slipcasting Mold.
To do this I require that the model is like a displacement map eliminating any overhanging features, however I was wondering if there is an easy way of doing this while preserving my nice topology.
Here is an image of my piece in question:

Also this is an image of an overhanging detail I wish to eliminate:

Thoughts?

The way I have done this is by using a displacement modifier with a densely meshed plane and then retopologized the whole model using this Quad Remesher addon my previous problem was the colour-space was being corrected in the displacement map image format, so I should have been using EXR format :)


text:
How to avoid pinching when using the single vert and screw modifier
I was trying to use the single vert for the first time and I created these objects using the screw modifier. The thing is I am getting some pinching as you can see in the screenshot.

I tried adding additional vert by using ctrl+R but that's changing the silhouette itself.
So can someone help me with this?
file

Uncheck "merge" in the screw modifier

It's not the screw modifier.  It's the subdivision modifier.  Screw doesn't create topo appropriate for use with subdivision (unless you do 4 steps.)  Unfortunately, disabling merge doesn't create topo appropriate for subdiv either (it's left non-manifold.)  So, if you want to use subdiv, apply the screw modifier and retopo.

@Nathan I don't quite understand OP's workflow, wouldn't screw (no merge), subdivide, then weld work?

@MarkusvonBroady As always, it just depends on what you want, but you're not going to get rid of UV sphere subdivision pinching like that-- you'll get rid of the pinching, but you'll no longer have a sphere.  And in this case, where they want to solidify->subdivide, it'll create non-man geo.  I'd be more inclined to subdivide the string, then increase screw steps, as that'll probably match what I'm after better.  But, subdivision of the string is going to change its shape as well.  The solution to subdividing stars is, unfortunately, don't make stars.

Subdivision works great when you meet certain criteria.  One of those criteria is, don't have "stars" or "poles": places where more or fewer than 4 faces meet at a single vertex.  (3- or 5-poles are considered okay, because all-4s are impossible, but they're still not good.) The classic pinching that you see when using subdivision on a UV sphere is what you get when you ignore that guideline.  Here, you're seeing it on your screw modified geometry.  When you use a 16-step screw, including a vertex at the origin of that screw, then you're making a 16-pole.  This is going to subdivide just like a UV sphere: poorly.
So what would I do instead?  Well, it's going to depend on exactly what you need-- the full context of things, the shapes you're using as well as your intended use of the model-- but it might be something like this:

Compare the pole of mine (left) with yours (right).
Rather than subdividing the final mesh, with that 16-pole, I'm just subdividing the string; then, I'm using more steps on the screw.  So no poles are ever getting subdivided.  And, because a screw works differently than subdivision, I end up with a shape more cylindrical than I'd get with subdivision-- which is probably what I want.
Now, when wouldn't that work?  Well, subdividing the string isn't exactly the same as subdividing the final shape (although mirror->subdivide->mask could be used to make it like that.)  If I were to do this to make a UV sphere, my final output wouldn't be as spherical as I'd like.
And, since you were subdividing after your solidify, those solidified edges won't get subdivided.  You'll see I have a disabled Bevel down there, which can be used to "subdivide" those solidified edges.
But also, subdivision is cross-platform, and other modifiers aren't.  So any solution that involves subdivision before other modifiers isn't cross-platform.  And certain features like Simplify settings (in properties/render) aren't going to work well because many of our vertices are being created by modifiers other than subdivision.
Now, what if I wanted to apply modifiers and create decent topo for use with subdivision-- say, for cross-platform use.  What would I do then?
First, apply the screw.  Select the outline of the pole faces and duplicate to a new object.  Grid fill that object, then shrinkwrap to original.  Delete the polar faces and merge our new grid-fill into that gap.

Final output, with 2 subdiv levels, on the left.  What I've made still has some 3-poles, in places that aren't ideal; it could use some tweaking of the curvature, since there are more vertices here. (I probably should have shrinkwrapped to something with appropriate curvature, not the unsubdividable original geo.)  But with very little trouble, I've eliminated the pinching.

As @Nathan suggests in the commentary, the problem is the interaction of the pole, necessarily created at the closed end of your Screw surface of revolution, and Catmull-Clark subdivision. An N-gon can be  slightly better than a pole, at the expense of some flattening.
You could assign the vertex at the origin, which will become the pole, to a vertex group and assign modifiers:

Screw with 'merge'
Bevel (Vertex), limited  by your vertex-group
Bevel (Edge), by the propagated vertex-group
Subdiv.

Which makes this difference, from the unmodified example, on the right, below:

Open your file in Blender. Expand the Screw modifier, and you can see that Merge is checked:

You need to uncheck it:

Screenshots from Blender v3.6.8


text:
Python Startup Script Only Outputs After Render in Background
I have a remote render system on Linux that uses a subprocess to run Blender in the background, and log and parse all of the output. In addition to the Blender output, I would use print functions in the python startup script to log progress of the script. This worked great for over a year, but only until recently the Python script started outputting the prints to stdout after the render.
A few observations:

Thinking it was an order or operations issue, I've tried changing the order of arguments (-b and -P), but with no resolve*
stderr does output prior to render
Only seems to happen when using the Cycles engine
To make sure it's wasn't a script issue, I experienced the same with an empty script with a single print
My script still works as expected on 2.9.11

To give some examples, here are the commands used:

# Logs to stdout immediately
$ blender -P script.py scene.blend -b -y > output

# Log to stdout after the render completes
$ blender -P script.py scene.blend -b -y -f 1 > output

# Alternative script placement (tested after background and file flags)
$ blender scene.blend -b -P script.py -y > output

I'd use the python script to run the render instead of the CLI. Otherwise, maybe this could help: python - How to run a script before rendering - Blender Stack Exchange

Thanks for the suggestion! I should mention this is for remote rendering, so the CLI is quite important. If the render logs could be retained, this would certainly be an alternative. Cheers!

The only way I found to get around this new behavior was to execute Blender twice during my scripted render.
The first execution of Blender is used to run the script, update the scene file, bake simulations, and show the previously mentioned script logs. Once the blender process exits, a second Blender process is run to render the scene, without the startup script.
Example:
blender myscene.blend -b -y -P startup.py \
  && blender myscene.blend -b -y -a

I still cannot find any documentation of this change, and even wonder if it was even intentional. Either way, I'd like to know why this change was made, as well as why the CLI constantly receives undocumented changes.


text:
Constant Crashes with Blender mostly from Materials
Windows 7 Pro x64
Blender 2.74 - 2.75rc2
I'm curious if anyone else has had this error with Blender?
Error: EXCEPTION_ACCESS_VIOLATION

Where is the violation coming from?
I've have been having a lot of issues with crashes since 2.73, and recently it has come down to this error alone. It usually happens when I'm selecting the material menu, creating a material, and even deleting meshes with materials.
I did reload to factory defaults, and created all new userprefs, and of course created a new startup file to go with it. Other issues I was having went away after that, but this one crashing issues still happens, and quite a lot.
Here's my startup file if anyone wants to look at it.
I've really cut down on the addons trying to track this down, but it doesn't seem to be related. There is nothing before the error, just a simple:
Error: EXCEPTION_ACCESS_VIOLATION

I'm hoping someone knows what this violation means, so that hopefully I can remedy this issue.
Thanks in advance.

This could be off topic as a bug and not an actual question, you might want to try BlenderArtists.org for questions like this. If you have enough rep, you can drop a link in the chat stream: http://chat.stackexchange.com/rooms/8888/the-renderfarm

Apparently with my startup file, you can simply click the "new" button under materials right after loading up, and 50% of the time it will crash.

@NoviceInDisguise yeah, the reason I was posting here, was in case someone knew about this error in particular. I don't want to post it as a bug, since I'm not sure if it's just a setting or something. Even if someone was to give some information on how to get more information from my error, that would be helpful as well.

Nevermind. It is obviously a bug. Reported it.


text:
Toggle between states with a single button
The enum function allows a button to toggle between two states. Is there a way to do that in code with a normal single button whose state is momentary?
For example, I am trying to select faces of a model, then deselect with a standard button, not a toggle button.
I've only gotten a theoretical function:
for f in bm.faces:
    if bm.faces[f.index].select == True:
        bm.faces[f.index].select = False
    else:
        bm.faces[f.index].select = True

This will test the first state, then the second which will make them both true. Is there a way to stop at the first state?

Pick the state to use before the loop.
set_state = bm.faces[0].select
for f in bm.faces:
    f.select = set_state

Note that within your loop f is the same as bm.faces[f.index]
Or if you want to loop through until you find the first selected, use break to stop the loop.
for f in bm.faces:
    print(f.index)
    if f.select:
        break

In blender's UI, pressing a button executes an operator. You can give an operator properties and set different values to be used when clicking each button in the UI. This also means you can have one button and choose which value it uses.
An operator with a boolean property -
class MySelector(bpy.types.Operator):
    bl_idname = 'mesh.my_select'
    bl_label = 'sample selecting'

    state = bpy.props.BoolProperty()

    def execute(self, context):
        obj = context.edit_object
        bm = bmesh.from_edit_mesh(obj.data)
        for f in bm.faces:
            f.select = self.state
        bmesh.update_edit_mesh(obj.data, True)

        return {'FINISHED'}

A panel to show the buttons -
class MySelectPanel(bpy.types.Panel):
    bl_idname = "OBJECT_PT_MySelector"
    bl_label = "Selecting"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'

    def draw(self, context):
        row = self.layout.row()
        row.operator(MySelector.bl_idname, text='Deselect').state = False
        row.operator(MySelector.bl_idname, text='Select').state = True

It is also possible to set multiple properties for one button
    b = row.operator(MySelector.bl_idname, text='Deselect')
    b.state = False
    b.value2 = 'Use this value'

OK sambler... you're a genius.


text:
How to achieve the effect of wrapping?

blender file:
https://mega.nz/file/j9YF0Z4J#8rrsE1ln2UHF0ejdSlyxEPZyeifXm7bujUpGXTSHs_k
How should I achieve this effect?

1-off, or  more general (procedural) method?

looks like it can be achieved with beziers or bezier-like math.

Have you tried a "sculpting" approach ?

I have used bezier curves but I can't solve it。@B.Pader, implemented with geometry nodes, not manually


text:
Why won't my 3D model unwrap, even with all seams marked
I made a basic character model, and I wanted to add textures, although I cannot unwrap it in the UV editor.

what do you mean when you say that you can not? You first need to select the faces you want to unwrap (select all if you want to unwrap all)

When you click "Unwrap", it will only unwrap whatever you have selected. In your screenshot, since you have nothing selected, when you hit Unwrap, nothing will happen.
In edit mode, select the parts you want to unwrap, then hit unwrap. If you want to unwrap the entire thing, you can select the whole model with "Select > All" in edit mode. Now that you have the entire model selected, hitting Unwrap should unwrap the full model


text:
Fluid Mantaflow Simulation Effector not behaving correctly
I'm new to Blender's fluid mantaflow, I am currently trying to get the fluid to collide with the main effector, and then flow to a mug, but it seems like both the effector have too dense collision (I guess?). Also the liquid appears to be quite wonky and behaving not calmly even after adjusting the resolution.
My blender version is: 2.93.2.

Here's the attached file

increase the resolution in your domain. If you increase it to 100 you will get this:

Oh thankyou very much Chris, that actually helps alot!

You are welcome


text:
Find all vertices within the view, could the script be faster?
The number of vertices of the test model is: 126290
import bpy
from bpy import data as D
from bpy import context as C
from bpy_extras import view3d_utils
import bmesh
from mathutils import Vector, bvhtree, Matrix
from math import radians, floor
import time

def get_view_regions(context):
    screen = context.screen
    view_region = None
    view_region_3d = None
    for a in screen.areas:
       if a.type == "VIEW_3D":
            view_region_3d = a.spaces[0].region_3d
            for reg in a.regions[:]:
                if reg.type == "WINDOW":
                    view_region = reg
                    break
            break
    return view_region, view_region_3d

def matrix_screen_to_matrix_world(rv3d, v3d_0_0):
    rvm = rv3d.view_matrix.copy()
    v3d_0_0 = rvm @ v3d_0_0
    return (
        rvm.Translation(-v3d_0_0)
        @ rvm
    )

region, rv3d = get_view_regions(C)

def get_vert_idx_in_screen(obj, v3d_0_0, v3d_w_h, rv3d, vertices=None):
    if vertices is None:
        vertices = obj.data.vertices
    matrix = obj.matrix_world
    M = matrix_screen_to_matrix_world(rv3d, v3d_0_0)
    idxs = []
    v3d_w_h = M @ v3d_w_h
    w = v3d_w_h[0]
    h = v3d_w_h[1]
    M = M @ matrix
    for vert in vertices:
        p = M @ vert.co
        isInView = True
        if p[0] < 0 or p[0] > w or p[1] < 0 or p[1] > h:
            isInView = False
        if isInView:
            idxs.append(vert.index)
    return idxs

obj = bpy.context.active_object
start = time.time()
v3d_0_0 = view3d_utils.region_2d_to_origin_3d(
            region, rv3d, (0,0))
v3d_w_h = view3d_utils.region_2d_to_origin_3d(
            region, rv3d, (region.width, region.height))

vert_idxs = get_vert_idx_in_screen(obj, v3d_0_0, v3d_w_h, rv3d)
end = time.time()
print(end - start, len(vert_idxs))

out: 0.18569016456604004 126290
or a better way?
Thanks

Using kdtree or bvhtree should be faster. Try to use one of them

@Crantisz I can't figure out how to use the api they provide

@Crantisz I mean, I don't know how to do what I want to do with those APIs


text:
How to update the mesh state after modifying the mesh's rotation mode?
I need to set the matrix_world of the mesh in quaternion rotation mode. However, the position and size of the object will be abnormal after modifying the parameters in the undo menu.
bpy.context.view_layer.update() can solve the problem:
rotation_mode = ""
if obj.rotation_mode != 'QUATERNION':
    rotation_mode = obj.rotation_mode
    obj.rotation_mode = 'QUATERNION'
    bpy.context.view_layer.update()
obj.matrix_world = M @ obj.matrix_world
if rotation_mode != "":
    obj.rotation_mode = rotation_mode

Is this the correct approach?
Thanks

From your script, I see that rotation_mode remains the same as the original. the object matrix_world can set directly without change the rotation_mode, so just remove all lines except line 6

@XY After restarting the computer, I can't reproduce the bug, I don't understand it.


text:
Smoke appears on viewport but doesn't in final render
I've followed this tutorial (first highlighted answer), I've set the right volume material and voxel texture, have lights, etc... I've baked the smoke, it appears correctly in the viewport, exactly as intended in the 3d viewer. But as soon as I hit render, the smoke object doesn't appears at all.
Smoke used to work on my system, quick smoke is ok etc... I don't understand why in this case it doesn't, do you have any clues?

Have you read the similar (possibly duplicate) posts by others having problems getting smoke to render? http://blender.stackexchange.com/questions/33356/smoke-is-not-appearing-in-cycles-render?rq=1 http://blender.stackexchange.com/questions/18354/smoke-not-showing-up-in-render?rq=1

Thx for your answer, yes, I have, but these does not resolve my pb :)

Actually, I don't understand, maybe a bad manipulation, because after a few tries, it does work !
I'll post the result in a few minutes.

[http://i.giphy.com/l41lXd4N1NPox3OVO.gif]

Hey, that looks pretty awesome! Does this mean your problem was resolved?


text:
Animate two propellers turning in opposite directions
I'm trying to create an animation for UE5, for a Mk14 WW2 torpedo. That had two propellers, turning in opposite directions (one clockwise, the other counter-clockwise, at the same speed).
The torpedo consists of three meshes, the body, and the two propellers. I have parented the props to the body.
I can do two separate animations, one for each propeller, but it seems a bit inefficient to me.
Is there a way to animate both propellers at the same time, in one animation?

well...of course you could use drivers (which only makes really sense if you are animating the propellers a lot (so no constant speed, but often changing speed)) but you only have to copy the animation, mirror it and then move it a bit ...i don't know what's inefficient with that.

@Chris from what I saw, drivers don't export well into UE5? Re inefficiencies - I'd have as many as six torpedoes being animated at once. Having to do 2 tracks per torpedo just for props doesn't seem very efficient to me..

unfortunately you didn't write that in your original question: that you animated six torpedoes, so i thought you wanted to animated just two propellers. That's why i wrote that comment. I really wish people who ask questions would add all (!) necessary informations in the questions instead then commenting on comments or answers because of "extra wishes" - so please improve your question so that other people won't waste their time. thx.

Ok, will try to do. TBH, for me, having two tracks when I'd be doing something that is always attached together and never would be split is inefficient regardless of whether I'd animate one object or two, just from quality-of-life perspective (edits, moves etc.). But I understand that's subjective.

@vlade "quality of life" is a lot exaggerated, isn't it? Here at work when people want to manipulate data, it is the same: when they ask me to write some procedure to do what they want, I ask: how often do you have to do that? 30 times now and then never again? If I try to find a way to do it procedurally and taking all things into account which I have to care for, it takes the same amount of time as doing it 50 to 100 times manually. So that's not really efficient either if it is a one-time action. That's why sometimes it is important to know what you really want to do.

@GordonBrinkmann When I know I'll always use something together, then I'll try to put it together. Not doing so will sooner or later result in a problem in my experience - of coding professionally 30+ years. YMMV, but if I can do it, I prefer to.

@vlade Sure, but that's what Chris means with maybe wasting others' time. Sometimes you wreck your head to come up with a solution that works in many different scenarios. And someone else says, "if you just need this now quickly, you could simply do it like that" and then it becomes the accepted answer. Sure, the other answer might be helpful for future users, but it is questionable if they come across it and if they pay attention to it when another answer is accepted. And other than coding quick and simple solutions can help, because solutions might change quickly with each Blender version.

Rig the model with an armature and use the bones to animate it.
Or, since it's a fairly simple animation,you can animate it directly inside UE. You can even make it procedural, making the torpedo an actor and using bluprints to rotate the different parts. But that's outside the scope of this Stack Exchange so I won't dive deeper into it.

I can do it in a BP no problem (timeline, rotate movement... ). The problem is that I'm doing cinematics, and as far as I can see right now, none of that works in the sequencer - or at least I could not get it going. I'd love a sequencer where I'd have all/most of the logic/animations via BP and then drive the sequence via events/calls to the BP ("flank ahead, rudder 5d left", "open tube 1, fire torpedo at coordinates XYZ"). But that doesn't seem to be possible :(.

I think it is possible to make blueprint logic run in the sequencer by using an event track in the sequencer.

you can, but the problem is that the "move" components (timeline, rotate movement etc. ) don't seem to work when you do - or at least I wasn't able to do get them to work.

interesting. It's been a while since I used Unreal and its sequencer...
If it's not possible, then the next best solution is to rig your torpedo with an armature inside blender, create the rotating proppelers animation in blender and export it as a skeletal mesh, like you would a character or any other rigged mesh.

Re UE5 - It might be passible, but I could not figure it out, and found many posts from people saying the same. Hence I'm trying Blender first (that seems to be workflow for many people). I think it will end up the way you're describing.


text:
How to export hair particles to FBX, OBJ, GLB formats?
I have a seal and applied some hair particles on it, but when I export the model the hair particles does not appear with it. I tried converting the hair particles into mesh but still does not work.
I tried exactly the methods mention here including the convert part and the extruding part  in How to convert hair particles, but still when exporting it to FBX I see no hairs.
What am I doing wrong ?

https://blender.stackexchange.com/questions/57531/fbx-export-why-there-are-no-materials-or-textures


text:
How to get Color and Z-Depth from Viewer Node?
I read some article how to get the z-Depth values from the Viewer Node. So i created a scene with a camera and a Plane with distance z=2. Then i tried to get RGB values and also z-Depth with compositing Nodes.
Code from my Plugin:
bpy.context.scene.render.use_compositing = True
bpy.context.scene.use_nodes = True
tree = bpy.context.scene.node_tree
links = tree.links
for n in tree.nodes:
    tree.nodes.remove(n)
rl = tree.nodes.new('CompositorNodeRLayers')
viewer = tree.nodes.new('CompositorNodeViewer')
viewer.use_alpha = False
links.new(rl.outputs[0], viewer.inputs[0])  # link Image output to Viewer input

# render and get result
bpy.ops.render.render()
links.new(rl.outputs[0], viewer.inputs[0])  # link Image output to Viewer input
pixels = bpy.data.images['Viewer Node'].pixels
print(pixels[0])
arr = np.array(pixels[:])
arr = np.delete(arr, np.arange(3, arr.size, 4)) # delete alpha
arr = arr.reshape((height,width,3))

# save z-depth
links.new(rl.outputs[2], viewer.inputs[0])  # link Image output to Viewer input
bpy.ops.image.reload()
pixelsZ = bpy.data.images['Viewer Node'].pixels
print(pixelsZ[0])
arrZ = np.array(pixels[:])[::4] # every 4th px

Both pixel arrays are the same. I tried this also manually and there it works perfectly. I thought about refreshing the image (in the image editor it refreshs the Viewer Node automatically when i change the node links), but even this didn't work.
Have anybody an idea how to fix this or what i'm doing wrong?
edit: I think i got the problem: I have to render again, after changing the nodes. is there an option to change and read the information without rerendering?

This may be a dumb question, but are you actually rendering the Z depth pass? You won't be able to access it via compositing if it's not been rendered.

Where can i check this? If i connect output Z of RenderLayer to my Image input of ViewerNode and check the Image "Viewer Node" the RGB values are the same and match the Z-Depth (R=G=B ~ 2).

Can you output the zdepth pass to disk, just to check that it's being created properly?

Use a File Output node to save the Z pass to disk.

Also, once you run this script (maybe independently of your addon context), you should see the appropriate node setup in the compositor. You should be able to check if the Z depth pass is in there manually.

The file output does work (UI), but values above 1 are clipped. After running my plugin the nodes and links are correct, but the pixel values aren't.

i have found my error (you must rerender after changing nodes), but until now i have no solution. i can't save the images on disk, i need to get them without saving.

Hmm, you should not have to re-render to get the Z depth info. The first render should be storing all the render passes in a temp EXR file (Blender's internal frame buffer), which means the Z depth pass already exists.

Yes, i thought the same and it worked with the blender UI. But the code in my plugin didn't get the z depth information without rerendering.

I am trying to do something similar. I (think) I made it by connecting the Render Image to Viewer Image and by connecting Render Z to Viewer Alpha. I used your code as a starting point.
import bpy
import numpy as np

bpy.context.scene.render.use_compositing = True
bpy.context.scene.use_nodes = True
tree = bpy.context.scene.node_tree
links = tree.links

for n in tree.nodes:
    tree.nodes.remove(n)
rl = tree.nodes.new('CompositorNodeRLayers')

vl = tree.nodes.new('CompositorNodeViewer')
vl.use_alpha = True
links.new(rl.outputs[0], vl.inputs[0])  # link Renger Image to Viewer Image
links.new(rl.outputs[2], vl.inputs[1])  # link Render Z to Viewer Alpha

#render
bpy.context.scene.render.resolution_percentage = 100 #make sure scene height and width are ok (edit)
bpy.ops.render.render()

#get the pixels and put them into a numpy array
pixels = np.array(bpy.data.images['Viewer Node'].pixels)
print(len(pixels))

width = bpy.context.scene.render.resolution_x
height = bpy.context.scene.render.resolution_y

#reshaping into image array 4 channel (rgbz)
image = pixels.reshape(height,width,4)

#depth analysis...
z = image[:,:,3]
zf = z[z<1000] #
print(np.min(zf),np.max(zf))

I wouldn't use Viewer Depth channel since Image pixels (RGBA) are floats whereas depth are ints.

I am using code that is essentially the same, but my viewer node output is always of fixed size 256 x 256 (regardless of my settings) and all values are zero.  Any idea how to fix this?  (Using Blender 2.83)


text:
rotate custom matrix?

origin = Vector((1,2,3))
v = Vector((6,2,1)) - origin

z = Vector((4,7,3)) - origin
y = v.cross(z).normalized()
x = y.cross(z).normalized()

M = Matrix()
w1 = origin.copy()
w1.resize_4d()
M[0], M[1], M[2] ,M[3] = x.resized(4), y.resized(4), z.resized(4), w1
M.transpose()

The above defines a matrix

M = M.Rotation(radians(10), 4, z)

The result is as follows

I want to rotate 10 degrees around the z axis, what is wrong?
If I want the x-axis to follow the cursor while rotating around the z-axis, how should this be achieved?


text:
ray_cast get all objects?
def x_ray_cast(context, depsgraph, origin, direction, ignored_name=[]):
    ray_cast_objs = []
    hide_objs = []
    scene = context.scene
    while True:
        (result, location, _, face_index, obj, _) = scene.ray_cast(depsgraph, origin, direction)
        if not result:
            break
        if obj.name not in ignored_name:
            ray_cast_objs.append({
                "name": obj.name,
                "location": location,
                "index": face_index
            })
        obj.hide_set(True)
        hide_objs.append(obj)

    for obj in hide_objs:
        obj.hide_set(False)
    return ray_cast_objs

I need to get all the objects on the ray, and this is how I do it now, is there a better way?
Thanks！

I've not tested it, but in the principle, that seems to be fine.

Don't use an empty list as a default argument. See https://nikos7am.com/posts/mutable-default-arguments/

But to answer your question, I think this makes sense.

@Gorgious Thanks, I am not a professional programmer, this is the first time I know there is such a problem

@lemon yes it works fine but i'm not sure if it's good logic

the logic seems good to me. An alternative should be to recast from the previous hit, but in this case you will hit the same object several times. So what you did is better, I think.


text:
How can I make a perfect sphere from an imperfect one?
I'm creating a human eyeball in blender 2.91.
When the eyeball is an imperfect sphere, how can I fix it into a perfect sphere without adding or deleting vertices or making a new mesh?

I realize that I may have misunderstood your question, do you mean that you want to give your object the shape of a sphere or do you want to correct the topology?

I think both make sense. I'm trying to correct the topology to make it perfect sphere.

yes but the tricks I explain won't bring back perfect circles, that's what I meant, it will give your object a sphere shape though

The simplest way is to use the Cast modifier with a Factor of 1:

You could also use the Shrinkwrap modifier with a sphere as Target.


text:
What is the Ambient Color in the Blender Internal Renderer exactly?
I'm using Blender 2.77 and I have currently arrived at the native Blender Renderer engine, and I fully want to understand how it works and how I can use, adapt, modify it for my own Blender projects.
I've already read many free e-books, articles and watched many videos about it, but I want to be able to truly understand AND visualize its inner workings.
Unfortunately the official Blender Render manual does not offer much in-depth/under-the-hood insight on how stuff really works.
QUESTION: - What ARE the World: Horizon, Zenith and Ambient colors?
Are they real light sources (which gets internally ray-traced) or simply visual overlays which gets mixed onto the camera image?

Thanks for your very rapid feedback Cegaton! Do I understand you correctly that I need to break up this  question into 8 little single topic questions?

Ambient Color: The Ambient color is a constant color added to the reflection model. Light sources are summed together and used in the calculation of the diffuse and specular part (See Phong reflection model for details)
phong reflection = diffuse + specular + ambient

Horizon Color: The color to use when the raytracer does not find any intersection for the primary ray (direct ray from the camera). It does not influence the shading at all. You can see this as a sort of background underneath your render.
Zenith: When using sky_blend the background will blend from the Horizon Color to the Zenith. This is done by the output pixel coordinate so the result will be the same for all camera angles and positions.
So the Horizon Color and Zenith, that generates the background, can be seen as an underlay.


text:
Python scripts not working after connecting more than 2 controllers
I'm making a bomberman like game and like the titles says, after I connect more than 2 usb controllers to the game, it's like the python script no longer runs, I have written a script that helps me place bombs, and it works fine with only 2 players connected.
I find this really hard to debug, anyone have a suggestion on what I can try to do?
Has anyone tried making a 4 player local game in blender?

We are going to need more information. If it's a script error, what does it say in the console?

I don't know what to say... it's not a script error :) and there comes no error in the console.

You could post the scripts you are using plus a description how you run it.

I blew my deadline yesterday, I did not expect the game to only work partially when I connect more controllers...
so I'm going to make a in depth description of the project I'm making, probably make a website for it, and split the game op in smaller packages, so the different problem is easy to differentiate from each other, and so i link to a .blend to other ppl without giving them a big project.