text:
I am having issues with the pivot constraint
I am making a steam shovel model and trying to do a simple rig with no bones. I threw on a pivot constraint so that I could move the main arm and still have it rotate around an axis. It works great, but now when I try to move the whole machine (ie. turn it on the z-axis), it goes kind of crazy. Here are some pictures to show what I mean:
Note that I have "Always" selected for the "Pivot When:" option. I tried changing this to just the Y-axis to no avail, so that is not the answer. For those curious, here is the .blend file

Is it possible that you are rotating in World space instead of Local space? Your blend file does not seem to be available any more.

It is a Loop Dependency. You can't make a children object parent father of is father.
A constraint look like a parent in Blender, so you have to make some parents organization in your file.
Arm Rotation is Father of Shovel.
But, Arm Rotation is in the Pivot constraint of Shovel, so, it's child of Shovel.
This parenting are avoid, you have to use bones and armature to simplify.

I'm sorry. Could you elaborate? I don't see where the loop exists. Both the object and the pivot point are children of the same object.

Arm Rotation is Father of Shovel.
But, Arm Rotation is in the Pivot costraint of Shovel, so, it's child of Shovel. This parenting are avoid, you have to use bones and armature to simplify.

I see what you mean, though I still don't completely understand why it was impossible. Either way, I started to make an armature, but the pivot constraint does not want to behave with bones. Is there another way I can achieve what I'm trying to do here?

I had this issue and corrected the parenting chain but the issue was still not fixed. So I just randomly just tried to correct the bone roll and it worked as I had hoped. Seems like there is an issue when the bone roll of the 'target pivot point bone' and the bone that has the pivot constraint have different rolls.
I don't know the underlying concept but it worked so .


text:
How to extrude as a round shape in concentrated areas?
I hope that I'm explaining my question right as I'm new to blender but I really am at a loss here. I've been stuck for a couple days now of what to do with this.
So, I'm trying to make a side table, this one specifically: here. Everything was going good until I came to the point where I needed to extract round shapes (sorry, I don't know how to explain this), which I've watched many tutorials and thought I could do it also, but I couldn't. I've added more loop cuts, did the bevel action (which created a totally weird shape in diff directions), etc. Either I'm doing those things wrong (possibly since I'm new) or I just have to re-do what I did to make it so I can do these actions correctly.
Let me show you some photos to help explain what I mean (top is what my whole thing looks like, bottom w/paint done on it to show what I need it look like):

So in the first photo I did bevel it because I thought that was what could help me make it round but I could only do the sides of each face to get it round. I have had no idea how to do make the whole thing extend round. I also have no idea how to then make all of them the same size etc so I ran into that as well.
I'm sorry if this makes no sense. I have no idea how to correctly term things but I hope someone could help me or point me in the right direction on how to do this.

Here's how I would go about it.
lets say we have our initial shape (mine is slightly different):

I extrude a rectangle out of each one (Alt + E , extrude along normals):

Now, I select only the long edges (this can be done quickly using the box select in x-ray):

Then, I just bevel the edges to create a circle:

Final Result:

If you want yours to be more circular, just extrude out a larger square initially.

thanks so much for explaining! I really appreciate your simple steps. I did manage to get the shape so I'm happy with the result. I now have a problem where there is a weird opening on the top and bottoms? I have no idea what I did to get it like that. I may have pressed something without realizing it? But some of my mesh is like broken up, if that makes sense? Here are some photos: https://i.imgur.com/IegSuqB.png + https://i.imgur.com/QvMKcoG.png

actually nevermind! I managed to figure it out. Your explanation helped a lot!

One way of accomplishing the effect you desire is with the proportional editing tool.
I've started out with geometry fairly similar to yours.

Select one of the edges along the top or bottom of one of the slats and press SHIFT + G > Length to select all of the edges of the same length.
Subdivide these edges, and click the number of cuts up to 3.
Turn your proportional editing tool on, and set the mode to Sphere.

Somewhat tediously, select only the center edge of the new edges created by subdividing.

Press S to scale, then SHIFT + Z to constrain the scaling to the X-Y plane. Move your mouse to control the amount of scaling, and use the scroll wheel to control the size of the proportional effect as represented by the white circle. When you get it right, click to confirm.

An alternative to save some time would be to delete all but one slat, perform these same operations on just that one slat, and then duplicate and rotate that slat around the circle.

nice, this method seems much cleaner than mine.

Maybe @person132 but your is simpler, which is also useful for beginners.

they should really implement a Select Similar > symmetric about axis option for things like this

@Rekov thank you so much! I did what you explained and I got the shapes I needed. I feel a huge relief. After I did that I noticed that some of the tops and bottoms of the shapes were missing? Did I do something wrong? Here's some photos: https://i.imgur.com/IegSuqB.png + https://i.imgur.com/QvMKcoG.png

@Rekov y'know what I actually figured it out so thanks for your help!

source: Stack Exchange

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

sort: votes


text:
Displacement modifier as a wave?
To see if it's possible, I'm trying to make pulsating veins on a heart in blender render. This step isn't too difficult, you can use a simple normal geometry of a veroni crackle texture and change the normals over time, or bake that texture into an image and use a displacement modifier and keyframe the strength over time.
But, the next step is to make this pulsating effect move like a wave through something like an actual heartbeat would, wherein one part on one end of the vein network starts the deformation, then the wave travels through gradually deforming only the vein texture onto the mesh over time.
Can this be done?
There is the wave modifier but this is a very outdated modifier that lacks a lot of precision in its control, it's pretty much only useful for large oceans.
I guess you can think something along the lines of this
https://www.youtube.com/watch?v=9tcR81BfiVY

Could you add some pictures of what you are starting from? Eventually, upload your current file.

If I knew how to make a model to take a picture of it, then I wouldn't need to post the question.

I meant about your setting before the wave effect.

Something like this? https://blender.stackexchange.com/questions/70151/how-to-animate-a-beating-heart

Have you seen that the blend file of the indicated video can be downloaded?

Another 'In Principle' option...
Animate a 'pulse' mesh along a curve derived from, or used to construct, your blood vessel, using a Curve deform modifier, keying the location of the pulse mesh along its deformation axis:

Give the blood vessel a  Vertex Group for displacement, set to 0. (Vertices outside the group altogether will not be affected) Assign a Vertex Weight Proximity modifier, using the vertex group, targeted on the pulse mesh:

Assign a Displace modifier to the blood vessel, aimed at the vertex group.

'In principle', because, to say the least, you probably want the shape of your deformer, weight influence, timing, everything to be tweaked differently. :D But all the adjustments are available.
The pulse mesh could itself be shape-keyed on its journey, to modulate the expansion.

Skin crawlingly Related https://blender.stackexchange.com/a/122232/15543 Result here could come out of this one, lol.

@batFINGER Ahh. memories! The 'here' answer was very helpful, thanks! Is the 'Related' link a typo?

Oops .. https://blender.stackexchange.com/questions/153177/worms-crawling-under-skin

@batFINGER Yuk! As so often.. Duarte's been there, done that :)

DRF is always a rich vein of info.... albeit varicose in this instant.

Is there a way to adjust this so that the weight isn't dependent on vertices? This might be able to surpass the warp modifier if there is a way to more generally weight paint with a texture.

@Bangarang  This can be combined with a texture.. it will multiply the extent to which the texture displaces the mesh....which could be mixed. You might also consider render-only displacement, using a displacement shader.. maybe you can tighten up the description of  the exact effect you're after?

I can't really tighten up the description because there's usually multiple ways to do the same thing, but what I can do is try it myself and see if I can get it to work.

A way do it from a curve and a wave modifier:

Make some network, with just segments:

Convert it to a curve, set the curve type to Bezier and the handle type to automatic and give it some bevel and a better resolution:

Now add a wave modifier, and activate "Normals" then tune the other parameters as you want:

From that, I wanted to have the effect on a surface:

The subdivided plane is shrinkwraped to the veins.
As we can't shrinkwrap to a curve, this last image uses a skin modifier instead of a curve, but the principle is the same.

This is impressive, it's a good example of something I remember running into a while ago. It looks very smooth, but again the wave modifier is very limited in its precision and adaptability to the surface of other meshes, there must be some way to combine this notion with one of the others. The warp modifier is nice because you can adapt it to any surface of any mesh, whereas this is specifically for a plane, due to the limitations of the wave modifier.

Can you use custom UV coordinates as the input to the wave texture, to get better control of the timing?

@JohnDvorak, that could be an idea. Have though about it, though doing it for "any mesh" should mean you know how to organize this UV map accordingly. So, that seems more complicated (or I don't know how to make it simple) but... that could be a way.

A pressure 'wave' travelling through a vein...

...Is a Curve-Path extended for length with CTL-LMB and bevelled with a Curve-> Circle.
The Circle is scaled down to size the Path's diameter. (vein)
A cast modifier could be used to produce a bulge travelling along the path.  A large and enlarged section of vein was also tried in order to overwrite the original with masking as it slides along the vein but neither trials improved what is seen above.
Curves (the vein) can be textured also.
Hooks or shapekeys can be used to animate the path's control points and produce nicely formed biological curves.  Hooks were used for their convenience here.
(See attched Blend file - vers 2.77a)

No this is worse, do you see how the wave is lopsided? It needs to travel along the length of the vein but you clearly have a point source that emanates in all directions. This is along the lines of the first attempt I was talking about. If you have a mostly linear vein that would work, but not for a generic one.

Sorry, my medical knowledge is somewhat lacking.  It was an attempt to steer you towards what I thought you were after.

Well I'm in the same boat, I started with something like that and quickly realized the limitations.

You can simulate pulse using the Warp modifier.
It can be adjusted to your heart's content (sorry... I'll see myself out...)

Create your vein and subdivide it
Add two objects to drive the deformation (two circles in my case)
Animate all the properties you need.

It has adjustable strength, radius, falloff, texture and a custom falloff profile...

That looks like a nice modifier, thanks. How...detailed can it be? Cause the veins I'm using are generated from a procedural texture.

Hello :). Well, if your veins are procedural, perhaps a displacement map could be a better solution. Would you mind adding more details into your original question?

Well displacement modifier is what I mentioned in my question.

This warp modifier seems to work on any mesh, and it includes texture, so far this is the best. I can make a semi-circle to emulate veins on a surface of a mesh.
Now using a series of follow paths I can think of a very complicated setup to accomplish this, I'm wondering if there is a more efficient way to do it.
Why does it anti-deform an object as I move it away from a mesh? That is counterintuitive

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


text:
Can't get second brush to register on canvas using dynamic paint image sequence
Trying to paint a plane with 2 brushes at the same time, but one isn't registering on the canvas in the image sequence bake.
I'm painting one texture on top of another using image sequence. I got it to work with one brush, but even duplicating the same mesh to make the second brush wont cause the desired painting effect with the second mesh.
GIF of the issue:
https://i.sstatic.net/jXdpq.jpg
I am sure the mesh intersects the plane, even gone so far as to group the two into a brush collection, but only one brush shows up on the canvas in the image sequence bake. Anyone know some possible causes? Can post blend files if necessary.
P.S: Below is my canvas material node layout. Bottom texture box is the grayscale texture of the image in the top texture box, while the image sequence obviously holds the baked images.

I found the issue. My brushes are following paths. For some reason, I couldn't copy my path over from my previous brush without it painting over the same area. I have flipped the path upside down as seen in the gif, but the paint was still occurring at the same coords, despite the brush visually moving at different coords.
Add a new path, constrain your second brush to the new path and everything works fine now.


text:
Is there a way to hide in-scene lights in reflections?
I have a scene with lights that are placed in camera view.  The lights themselves don't show up in the camera, but their reflections show up in the windows of the scene.  Example:

Is there an easy way to keep these lights from reflecting in reflective surfaces?  I found this but it seems to only apply to objects, and it's actually the inverse of what I need.
[EDIT:  Ideally it would be possible to do this in both EEVEE and Cycles but the final render will be in Cycles, so if it can only be done in Cycles that would be fine.]

Are you using EEVEE or Cycles?

@moonboots Which Diffuse value of the light?

Sorry I meant the Specular value of the light in Eevee only

If on Cycles, you could go in the object properties > Visibility panel > Ray Visibility panel, and disable Glossy:

If on Eevee, you can set the light's specular property to zero:

In both cases, this makes the lamp appear in no reflections at all.
If you want to more precisely decide where to show in reflections or not, a way around could be to use Light linking, but this would remove all light effects on the designated objects. So it works best if you have objects with just one glass-like material that doesn't need any lighting in the first place. I.E. if you have a window: make sure you separate the glass part into a different object without the frame and whatnot.
Make a collection, and additively add to it the objects you don't want to receive light from your light source.
Then select the light, go to its object properties > Shading panel > Light Linking sub panel. Add the collection you just made. You should see a list of the objects you put there. Uncheck them to exclude them from receiving light from this light object.

That worked like a charm!  Thank you, you've saved me an immense amount of time.


text:
How to get higher quality for second camera in stereoscopy multi-view?
I'm new here but I use your platform to solve some problems that I sometimes have with blender.
So I use stereoscopy multi-view a lot for creating different views of the same object. But somehow since a few weeks the first camera in the list renders correctly but the second and all the other camera's after that render in low quality. See the images.
I'm using Eevee to render. My sampling rate is 100 for Render and Viewport. It doesn't change the output of the second camera.
For shadows I have:
Cube size: 512 px
Cascade size: 1024 px
Soft shadows is checked.
I hope you can help?

Solution:
I upgraded to 3.2.2 and Blender renders the images in a correct way.

I did a test on my mac and there it seems to be working in a correct way. The same file. Is it some settings in Blender? Or not enough memory? I have 64GB internal memory and my graphics card is a 3060Ti.

I upgraded to 3.2.2 and Blender renders the images in a correct way.


text:
What's the fastest way to make soft body and/or cloth interact at a fixed position with a rigid object?
I'm just trying to get this physics to work at all.
I have a plane I subdivided like 15 times, so it should have enough verts to render something. I then made all edge vertices as a pin vertex group with a weight of 1.00 and all  inner vertices with a weight of .98 and set those vertex groups as the mass and goal in the soft body physics tab for the plane.
I then tried animating a basic materialed cube moving into the plane, and it wouldn't render the collision. Blender rendered the plane's self-deformation, how it sags in the middle, but no matter what I do, it refuses to render a basic collision with this rigid object.
I got it to work for the cloth settings by setting the rigid object as a collision object, but it still doesn't work for soft body.

what's the question? what are you trying to do? (not so clear from your post)

Get soft-body to detect the collision and thus deform as a result of a generic rigid object, as indicated.

Wow I did not think such a basic question would be unanswerable. People here...know what soft body physics is right?


text:
Vertices connect to mirrored vertices
Im in edit mode with mirror and the vertices when i try to connect them are connecting to the mirrored vertices. I found out what it was. The model had somehow flipped which side was which and i had to delete that section

You have to delete the section, it flipped the sides

How to take a ScreenShot


text:
White lines appear in texture
I tried to UV wrap a label to a bottle, but weird white lines appear on the UV wrap (lines in blue circles below). Original image does not have the white lines :

original image (cut):

UV Wrap printscreen:

weird polygon loops appear at upper and lower area:

Anyone can tell me what is the issue and how to fix it?
I am using Blender 2.81a, cycle.
Thanks!

it's because of the PNG format it compresses whatever is behind the transparency. if you want them to go away just setup your material accordingly

It looks like the original image isn't as tall as the label -- the regions you're talking about appear to be red bands above and below the image itself. That suggests you might be doing something interesting with the UV unwrapping -- can you show your UV map?

@Reese, you are right the issue the label did not cover the full area correctly. I wonder where the problem is? Added a printscreen for the UV map in the post above.

@Mobin, I checked the image, it is in jpg

Hello :). This looks like Subdivision modifier stretching the texture from adjacent faces. You can solve this by adding more loopcuts to the top and bottom edge.

@JachymMichal hey you are right again. After adding several loopcuts, the texture is now ok, without the upper and lower red bands. I also found that (in solid view) there are weird polygon loops (last image in the post above), these are the area where the red bands occured. So I can use these as reference for how many loopcuts to add and where to add.

Your Texture is being repeated. I forget exactly but I think you need to select "clip" or un select repeat.

@Dontwalk, I haven't tried this method, as it was already fixed by using suggestion by Jachym.

@JachymMichal, yes it does. Thanks :)


text:
Bone selection in weight paint and paint mask enabled
Good day all!
In previous blender i can select bones in weight paint + paint mask mode enabled, with CTRL+click
In blender 3 i can't do this, it is possible?

In 2.93 and 3.0 to enable this you must select the armature; shift select the mesh; and then enter weight paint mode.  Once you are in weight paint mode, You need to hold Ctrl while left selecting the bone.  I've just verified that this works in 3.0

Thank for reply! but do u turn on the Paint Mask mode? I cant select in this mode, pls see pict above

That's how it works in 2.9 as well.  I believe the change was made after 2.83, but I don't know for sure.  3.0 weight paint is almost 100% the same as 2.9x weight paint.

seems this feature has gone cause new multi selected object edit mode feature, like changed knife project workflow.
I find, that you cant select in mask mode is very annoying behavior, you need to switch on off paint mask every time you want to select second bone.

and worse there's no easy hot-key way to toggle the paint mask.

No, there is, you can use  or  keys, to toggle 'Face Paint' mask or 'Vertex selection' accordingly

This answer is gold. I don't know why they changed that, it was way simpler in 2.7.


text:
GeForce GTX 760: Unsupported Graphics Card or Driver
I recently installed Blender on my desktop to dip my feet into 3D modeling and printing.
The computer has an AMD A10-5800K CPU with integrated graphics, which does not support OpenGL. I recieved the “Open GL 3.3” error when trying to run blender.
I then salvaged a GeForce GTX 760 from another computer and installed it, and installed the newest drivers for the card. However, even though the GTX 760 supports OpenGL up to 4.3, I’m still receiving the 'Unsupported Graphics Card or Driver' error with the “Support for OpenGL 3.3 or Higher is required”.
I’m not sure if Blender is still trying to use my AMD integrated card. I have attempted uninstalling and reinstalling Blender after installing the GTX 760.  I've also disabled the integrated graphics in my BIOS.
Windows 7, 64 bit

The GTX 760 is supported and should work. The most recent driver is 442.59 (WHQL) for Windows. What operating system are you using?

Sorry, should have included that in the main post.
Windows 7, 64-bit.

I was finally able to figure it out.
Had to go into my BIOS and disable the integrated graphics (again), then completely uninstall the AMD Catalytst Control Center, then uninstall and reinstall Blender again.


text:
bpy.ops.wm.append not functioning properly with Blender 3.6?
After moving from Blender 3.3 to 3.6.1 (on Macos en Unix), my scene-building python scripts fail to execute, not properly importing materials or collections when using bpy.ops.wm.append. The operator doesn't give any error, but just doesn't load anything. I have made two example scripts to isolate the problem. The first creates two cubes and gives both a unique material. This file is saved, to be used as a library. The second script tries to load a material or a collection using bpy.ops.wm.append, but both fail to do so.
The material loading script:
import bpy

MainDir = bpy.path.abspath("//")

def ImportMaterial(filename, Material, Linked=False):

    bpy.ops.wm.append(
        directory=MainDir+filename+"\\Material\\",
        filename=Material)

    return bpy.data.materials[Material]

Data = ImportMaterial(
    filename='TestCollection.blend',
    Material='Material_2'
    )
print(bpy.data.materials[0])

The collection loading script is:
import bpy

MainDir = bpy.path.abspath("//")

def ImportCollection(filename, Collection, Zpos=-100, Instanced=False, Linked=False):

    bpy.ops.wm.append(
        directory=MainDir+filename+"\\Collection\\",
        filename=Collection)

    return bpy.data.collections[Collection]

Data = ImportCollection(
    filename='TestCollection.blend',
    Collection='Cubes'
    )
print(bpy.data.collections[0])

The script making the library file is:
import bpy

bpy.ops.mesh.primitive_cube_add(size=2, location=(0, 0, 0))
Cube_1 = bpy.context.object
Cube_1.name='Cube_1'

bpy.data.materials.new(name='Materials_1')
bpy.data.materials['Materials_1'].diffuse_color = (0, 1, 0, 1)
Cube_1.data.materials.append(bpy.data.materials['Materials_1'])

bpy.ops.object.move_to_collection(collection_index=0, is_new=True, new_collection_name="Cubes")

bpy.ops.mesh.primitive_cube_add(size=2, location=(-4, 4, 0))
Cube_2 = bpy.context.object
Cube_2.name='Cube_2'

bpy.data.materials.new(name='Materials_2')
bpy.data.materials['Materials_2'].diffuse_color = (1, 0, 0, 1)
Cube_2.data.materials.append(bpy.data.materials['Materials_2'])

bpy.ops.object.move_to_collection(collection_index=2)

The script are set up for Blender 3.6.1. The import works flawless in Blender 3.3, but does not work in 3.6.1. I would appreciate any help.

The first and second scripts worked well in my Blender 3.60 (windows). But I has changed the index, for example, materials[-1] or collections[-1].

Are you on Windows? It is not a matter of indexing, as there are no materials at all after running the script on my Mac.

To answer my own question, it turns out you have to use / rather then \\ in Blender 3.4 and later when adding the within-blender directory. So use filename+"/Collection/" rather then filename+"\\Collection\\".

no that is bad practice. you should use os.path.join() or the newer pathlib instead of raw string concatenation to ensure your code remains cross-platform and maintains compatibility with different file systems.

Also for internal blender directories?

what do you mean by "internal blender directories", can you give an example?

If I understand this correctly, they are basically what you see if you switch in the outliner to the Blender file view. Or when you open a file using the menu through File-Append.

For your case, directory=os.path.join(MainDir, "filename.blend", "Collection") is more correct and future proof. It seems that interior blender structures are accessed as os folders. I tested it within an add-on for Blender v3.3 and v3.6 with both Windows and macOS and everything works well.


text:
world_to_camera_view() returns wrong vertex coordinates
I'm trying to get 2D pixel coordinates (i.e. with respect to the rendered image) of the outline of some spheres I have in my scene. Ultimately, I would like to obtain a segmentation mask for the object, pretty much like the one that images in the COCO dataset have.
I'm not even sure I'm doing the right thing here, since I'm currently looking for the vertices' coordinates, but here's the code I'm using at the moment:
import numpy as np
import bpy_extras
import bpy

BALLS = 'Balls'
CAMERA = 'Camera'

scene = bpy.context.scene

render_scale = scene.render.resolution_percentage / 100

# Get width and height of the rendered image
render_width  = int(
    scene.render.resolution_x * render_scale
)
render_height = int(
    scene.render.resolution_y * render_scale
)

balls = bpy.data.collections[BALLS].all_objects

# This dictionary maps ball names to a list of vertex coordinates
ball_names = [ball.name for ball in balls]
ball_boundaries = dict(
    zip(ball_names, [[] for _ in range(len(balls))])
)

camera = bpy.data.objects[CAMERA]
for ball in balls:

    for vertex in ball.data.vertices:

        # Get vertex coordinates in world space
        vertex_coords = ball.matrix_world @ vertex.co

        # Get vertex coordinates in camera space
        vertex_camera_view_coords = bpy_extras.object_utils.world_to_camera_view(
            scene,
            camera,
            vertex_coords
        )

        ball_boundaries[ball.name].append((
            vertex_camera_view_coords.x * render_width,
            vertex_camera_view_coords.y * render_height
        ))

    print(f'{ball.name}: {ball_boundaries[ball.name]}')

According to the documentation for world_to_camera_view(), the function is supposed to return coordinates in the [0, 1] range ((0, 0) being the bottom left corner of the rendered image and (1, 1) being the top right corner), though values outside that range can also be returned, which I suppose would intimate that the object is outside of the camera's view.
In fact, the coordinates returned by world_to_camera_view() for the balls' vertices are outside that range even though they are within the camera's scope, as witnessed by this image:

While that was the camera view in "Rendered" mode, here's the same but in "Solid" mode:

Actually, no ball is within the camera's scope in this case, but I would assume that the "Rendered" view is what matters, right? Because if I try to render the scene, the image I get is what the camera sees in "Render" mode, not in "Solid" mode. In any case - and this is not the main question - do you know why the camera view in "Rendered" mode is different than that in "Solid" mode?
Looking once more at the documentation for world_to_camera_view(), I noticed that the function "Takes shift-x/y, lens angle and sensor size into account as well as perspective/ortho projections.", although it doesn't say what that implies. Looking at the source code didn't help, either (unless I failed to understand what it does). Truth be told, I actually modified the camera's sensor size and field of view (as you can probably tell by the distortion present in the image), though I don't know how to take such modifications into account so that world_to_camera_view() returns coordinates in the [0, 1] range as expected. Here are the parameters I've set for the camera:

world_to_camera_view doesn't work on the render data, it works on the direct data you see in the 3D view, so if an object is outside the camera in 3D space (regardless of the render) that's the data world_to_camera_view uses. Essentially, it doesn't work with 'Panoramic' camera types. I don't know of a workaround otherwise I would add this as an answer.

This is also why the 3D view differs so much from the render, because the 3D view cannot show the 'Fisheye Equisolid' distortions in realtime.

@RayMairlot That's some very useful information, thanks

To your question "why the camera view in "Rendered" mode is different than that in "Solid" mode", this is due to the fact that you are using panoramic camera which has non linear space which cannot be rendered in Solid mode (or Eevee) which is rasterized. It can only be rendered in ray tracing mode.

The answer in https://blender.stackexchange.com/questions/165777/how-to-find-all-image-coordinates-of-rendered-object is perfect for creating images like the ones in the COCO dataset. If you still need the coordinates you could write a python script that returns the coordinates of all pixel having a specific color.


text:
Not created again already exists material
I have a such a code
    for image in bpy.data.images:
        if image.users:
            continue
        bpy.data.images.remove(image)
    mat = bpy.data.materials.get("Material")
    if mat is True:
        mat.use_nodes=False
        bpy.context.active_object.data.materials.delete(bpy.data.materials['Material'])
    if mat is None:
    # create material
        mat = bpy.data.materials.new(name="Material")
    mat.use_nodes=True
    nodes=mat.node_tree.nodes
    for node in nodes:
        nodes.remove(node)
    principledBDSF = nodes.new(type='ShaderNodeBsdfPrincipled')
    principledBDSF.inputs[0].default_value = 0.8, 0.11, 0.02, 1
    principledBDSF.inputs[4].default_value = 0.5
    principledBDSF.inputs[5].default_value = 0.45
    principledBDSF.inputs[7].default_value = 0.35
    LCAoutput = nodes.new(type='ShaderNodeOutputMaterial')
    LCAoutput.location = 300,0
    links = mat_LCA.node_tree.links
    link = links.new(principledBDSF.outputs[0], LCAoutput.inputs[0])
    bpy.context.active_object.data.materials.append(bpy.data.materials['Material'])

When I run this function, I create material, but when I run it again, this material is created again. I am curious how to make the material not created as it already exists.
Greets

A material never is True.
Use if mat: which is boolean true if not None  Using if mat is True:  for a material will never be true.
Since you are setting use nodes later can also do this
mat = materials.get("Foo") or materials.new("Foo")

To drill this in here is a simple example
import bpy

context = bpy.context

def main(context):
    mat = bpy.data.materials.get("Foo")
    if mat:
        print("Material Foo exists, skipping")
        return
    else:
        mat = bpy.data.materials.new("Foo")
        print("Created Material Foo")
        # do something with new material

    return

# test calls

main(context)
main(context)
main(context)

Output from default file no material "Foo"
Created Material Foo
Material Foo exists, skipping
Material Foo exists, skipping

Thanks :-) And If i want do nothing with this material. Go to next step > if mat_LCA : > mat_LCA = bpy.data.materials.get("LCA Material") > mat_LCA.use_nodes=False

As your Q code stands the line mat.use_nodes = True  will always be run, regardless of any prior setting. Perhaps add a return if the material already exists.  (or indenting is incorrect above)

Without it, in Blender Use nodes will be turn off. I want just make, that if I'm pressing button again, the next this same material will not created.

I know how it works.  Please review your question code.  Perhaps the line mat.use_nodes = True and every line below needs to be indented one tab right to bring it under the if material is none clause.  Can only go by code posted.

Ok I made one step forward. Now I have error in line 216 for node in nodes: and I have such a error line 216, in execute UnboundLocalError: local variable 'nodes' referenced before assignment

AFAIC this has answered the question (as it was when answered)   You are describing a basic syntax error that is telling you that the code is getting to line 216 at which point nodes is still undefined.

I fixed it but still I have this same problem.  I don't want to re-create the same material as it already exists. At the moment, this happens when I run the code again.

It doesn't sound like you fixed it. Added mega simple example that either creates a material "Foo" or does nothing.

Ok, few steps forward, but know I have such a error Function.result expectd a set, not a NoneType

This no longer has anything to do with this question / answer.  Error suggests: A return from an operator has to be a set showing the return status  eg {'FINISHED'} (all good)  or {'CANCELLED} (failed for some reason, eg material already exists)  Please search for these, or follow some simple examples given in  blenders text editor templates or the docs.  As stated, this answer answers your question as posted.  It is not my or anyone elses "job" to work thru this with you.  If you come to an impasse ask another question. (A question not a question in a comment)


text:
How to combine texture and normal map to create procedural paper/cloth material?
Let's say we want to create a shader (in Eevee, no displacement) to mimic crumpled paper or wrinkled cloth.
If we just use the paper or cloth texture with a noise texture + bump-node as normal map the result is poor as it looks like the texture (e.g. hex pattern) is just projected onto the noise.

A more realistic approach would make the texture get distorted/warped/bend by the noise.

My idea was to change the texture coordinate from $(u,v)$ to $(u,v) + c f(u,v) \nabla f(u,v)$,
where $c>0$ is a parameter, $f$ the noise and $\nabla f$ its bump map. That's prob. not correct and causes artefacts.
It kinda goes into the right direction, but surely I'm not the first to come up with this problem, so I'd appreciate any links or suggestions. Thanks in advance.

I'm not sure about the mathematical part of this, but what about mixing uv with normal map with a color mix node?:


text:
Batch renaming materials to texture filename, not texture name
I have imported a scene from CityEngine, works great in Blender as is; except the materials are all named like CityEngineMaterial_2_mat. Which is a problem within Unity where I plan to use it, as I need to assign the right texture to the Unity materials.

however I would like to rename them to the linked texture. I found a script by Killer-in-Exile at
https://blenderartists.org/t/batch-rename-materials-with-file-names-of-linked-texture/1215110/5
Which does half the job, it renames the material to 'tex_2'; however I would like the filename of the texture, in this case ConcretePavement.jpg.

Related https://blender.stackexchange.com/questions/277488/batch-renaming-materials-to-texture-filename

You just need to change line 22 of the original script to material.name = os.path.basename(link_node.image.filepath). (It's now line 21 in the script below.)
Also, cleaned up the script a bit so the bpy.context.object.active_material_index doesn't get messed up. There is no need to touch it because you already have the material in the for material in ... loop.
import bpy
import os

# get the selected object
obj = bpy.context.active_object

# Go through list of materials assigned to selected object
for material in obj.data.materials:
    old_name = material.name
    try:
        # Get the nodes in the node tree
        nodes = material.node_tree.nodes
        # Get a principled node
        principled = next(n for n in nodes if n.type == 'BSDF_PRINCIPLED')
        # Get the slot for 'base color'
        base_color = principled.inputs['Base Color'] #Or principled.inputs[0]
        # Get the link
        link = base_color.links[0]
        link_node = link.from_node
        # Rename the material to the image file's name including the extension
        material.name = os.path.basename(link_node.image.filepath)
        # Print the results
        print( "Material Old Name:", old_name, )
        print( "Material New Name:", material.name )
        print( )
    except BaseException as err:
        print(f'Skipping material "{old_name}", no Image Texture connected to the Principled BSDF found.')

Thanks so much! I ended up fixing it through Unity; when creating the materials, it links the textures through a guid for a meta file; simply changing the .jpg.meta files to .png.meta files solved it!


text:
Stylized cartoon transparent material for gltf export
I am trying to create a stylized bottle of potion.

and I need to export it to glTF (.gltf/.glb)

exactly like this:

https://sketchfab.com/3d-models/stylized-low-poly-potions-pack-01-c53614906d934b0b99f5540240e0b9d7

How do I create the transparency effect of the bottle?
And then export it to .glb

I tried the following method but, I am not able to export it,
Magic Transparency part (0:00-0:36):

https://www.youtube.com/watch?v=n9ZNGVvMOSQ

Thanks in advance!

The Magic Transparency method is correct: the bottle uses backface culling + flipped normals to make the side facing towards you invisible.
To make exporting to glTF work, you just need to make sure the material you use follows one of the patterns the exporter supports (see the manual).

Here's the material I used. The node setup is recognized by the exporter as an unlit vertex color material. To enable backface culling, turn on the Backface Culling option in the sidebar. (The exporter understands that option; it doesn't understand the Geometry->Backfacing trick in your video.)

Normally this would cull the polygons that are facing away from you, but if you flip the normals, it will cull the ones facing towards you instead so that you can see the contents through the bottle.
To flip normals, go to edit mode and with the bottle's faces selected, pick Mesh > Normals > Flip.

That's it, you can export now.
Here's the .glb I exported: https://files.catbox.moe/z563qh.glb. You can import it to see how it works if you want.
The same trick works for outlines, just use a pure black "bottle" (a black RGB node instead of a Color Attribute node should work).

Now I get it!!!
The node used in the video for backface culling is not exported, as the glTF exporter doesn't look anything like that. Thanks!


text:
How to get all integers/floor positions inside a "voxel-shaped" geometry
I need to store in a file all the "floor" positions that are inside a  "voxel-shaped" geometry. All geometries are dimensioned as if they were composed of a multitude of 1x1x1 voxels, but they really are in reality only one object. Also, all edges are parallel to the x,y, or z axes, and all corners are on integers coordinates.
For example, if I have a cube with dimensions 2x2x2, aligned with the XYZ axis, starting from [0,0,0]. But with a missing voxel between [1,1,1] and [2,2,2].
I need the positions : [0,0,0], [1,0,0],[0,0,1], [1,0,1],[0,1,0],[1,1,0],[0,1,1].
But, it could be more complicated geometries like "Minecraft-like" houses.

The coordinates you provided are of the 8 3D corners of the voxel cube, within the 2x2x2 cube (see image link below). Is this what you're aiming for? https://pasteboard.co/ItlIoRdkzNcF.png

It is nearly that. To be more precise it is the corner With the smallest coordinate of the 8 voxel inside the cube. Son a voxel that go from 1-1-1 to 2-2-2. We should get his position at 1-1-1

Please add information to your question about how what kind of output you would expect in a rotated object, non-cube objects, larger objects, etc.

Thank you for the feedback, I edited the question. Hope it is complete enough now.


text:
Is it possible to export sides of an object as separate vector files?
I have very little experience with blender, but I'm hoping that a 3D model will help. I am designing a basketball for production where each section will have a pattern (not pictured yet). I need simple flat vectors of each section to export, is that possible on blender? much appreciated <3
I basically need something like this:

Unwrap the ball spherically using seams end export UVs perhaps?

@Lukasz-40sth yeah i agree,  i think that is the proper solution!

//EDIT: After all this extensive answer I forgot to answer the simple question you asked in the title: yes, you can export the UV layout in a vector file, from the top menu of the UV Editor go to UV > Export UV Layout and there you can choose either SVG or EPS instead of PNG. The only uncomfortable thing is, when using SVG each face is a single object if you open it in e.g. Illustrator. Using EPS results in each face being a single object and the edges being separate objects as well.

If you have a basketball you can mark all boundary edges around those 8 sections as seams by selecting them and either right-click (only if you are in Edge Select mode) or Ctrl+E and then choose Mark Seam from the context menu. Now the seams are shown in red.

The following steps are starting with the premise that you might not know the correct dimensions of the sections and want to get them from the UV map:
First select all with A, then press U > Unwrap (just the default unwrapping, no special settings). By default, the Unwrap settings should be Angle-based and Correct Aspect enabled, this is okay. A minimal Margin won't matter much as well.

Depending on your mesh your UV map might of course look different but my next steps can easily be transferred to other UVs as well. I want to find out how the aspect ratio between width and height of a section is.
To do that I make sure that the UV Editor is in Vertex Select mode and UV Sync Selection is disabled. On the UVs of left-most section I select the vertex which is farthest to the right. On the UV map, the X direction is to the right and Y direction to the top. A map starts at the bottom left with (0, 0) and goes to the top right at (1, 1). So I know since a section fills half the height of the map that it is 0.5 Y direction. The X and Y values of the selected vertex you can readout in the Image tab of the sidebar panel which you bring up with N. I want the X value to determine the width of the section, in this case it's 0.135 wide.

What I now try to do is create an image texture where all 8 sections are placed next to each other. Let's say I want a texture with a height of 1000 pixels, which is 2000 × 0.5, the UV height. For the texture width in pixels I need to multiply the factor 2000 with the UV width and the number of sections, i.e. 2000 × 0.135 × 8 = 2160.
Next I create a new material for the basketball (or take an existing one, whatever fits your model). The crucial thing here is, you need an Image Texture node. Click on the New button to add a new image, set Width = 2160 and Height = 1000 and click OK.

With the Image Texture node selected (it doesn't have to be connected to anything in the material, it only needs to be selected) you select all of your mesh again with A and unwrap it again with U. Now this might look incorrect at first because with the Image Texture node selected, the UVs are created according to the non-square image. And if there is no image selected in the UV Editor the UVs are squeezed to fit the 1:1 aspect ratio.

But as soon as you open the newly created image with the correct aspect ratio in the UV Editor, the sections have their correct size as well.

Thank you SO much!! This was an incredible and thorough explanation and exactly what I was looking for! You are too kind for including the screenshots and details. Have an amazing day

Glad I could help. You might consider accepting the answer then...?


text:
Why does stencil in texture paint not work?
I want to draw the pepsi logo on my modelled bottle can and i saw in a tutorial it can be done with stencil in texture mapping settings but when i click and drag over the object nothing happens.
here the tut: https://youtube.com/shorts/Bwzqhq4EABw?feature=share
file:

please pack your image and share your file: https://blend-exchange.com/

file is now in question

Recalculate the normals in Edit mode: Select all and ShiftN.

ok i will try, thanks

tysm @moonboots it worked!


text:
Bone Constraints and Drivers not exporting correctly on FBX
I'm currently trying to export my armature + mesh to Unity, however, the animations did not seem to export correctly (FBX).
The armature's bone constraints and driver seemed to only be refreshed 1-2 frames after the beginning of each animations, resulting in a snappy/jittery motion, the animation then plays fine afterwards. The animation too plays fine in Blender preview when the constraints and drivers are fully refreshed and working as intended.
After looking around the internet for the issues, it seems cyclic dependencies could be the issue but after looking around, I've made sure that there are no cyclic dependencies present in my armature. And that the only other solution I found was to tick the "Extra Object Update" and "Extra Data Update" in the Armature Properties.

However, the solution mentioned above is only available in version 2.79, and not present in any version afterwards, I am currently on version 3.1.
I am unfortunately also unable to link my blend file, but I am confident there is nothing wrong on my end.
Any advice/solution is greatly appreciated! Thank you.

Don't know if you can apply it in your case, but I generally use the Bake Animation function, in order to bake all the deforming bones visual keying animations, and export a simplified rig, deforming bones only (and maybe one root bone), without any constraint or driver, whoose action gets applied during the baking process.

We've thought about this method before but it felt a bit destructive and the workflow won't really work well with our current pipeline.
Still, thanks for the advice!


text:
Slide Distance Rather than Factor
I'm trying to move an edge along another edge by exactly 7.81m. edit: How do I do this? I tried using the slide tool using Shift+V, G G. However, the only distance setting is a factor.
If I could type in 7.81m there, that'd be perfect.
There are a ton of settings in the move dialog box, but I can't figure them out.
Any advice would be great. Thanks!

Hi :). You cannot slide vertices/edges using metric units. They only work with the Move Tool. But there are workarounds.

I figured there would be at least one workaround. Can you suggest one? Thanks!

I edited by question to explicitly ask a question if that helps.

Hi Becca :) One of the workarounds is using a custom orientation. I'll add an answer when i get to it later today.

Use the Move Tool if you need absolute values.
To align the Move tool to your edge orientation, switch transform orientation to Normal.

Or you can create a custom orientation.

Select two vertices along perpendicular edge.
Click the little + to create a custom Orientation
Use the move tool.

Hi hi. I'm sure this is correct, but I haven't had a chance to try it out yet and may not for a little bit. As soon as I've verified it works, I'll accept your answer :)


text:
Boolean modifier not working
I'm trying to use BoolTool and the Boolean modifier with no success. I want to cut out the cylinder from the widget in the attached file.
I did look at The Boolean modifier is not working and checked for inverted normals, duplicate vertices, and non-manifold geometry using the 3D Print plugin.
(I switched the names of the two objects in the file. Oops!)

Please let me know what I'm doing wrong. I keep running into these problems. I'm using Blender 3.2.0. Thanks!

Hello and welcome. While files, images, and external videos or links may be helpful additions they should not be the only way to obtain information about your issue. Don't make understanding your question rely on downloading a file, watching a video or visiting an external site. Use the builtin tools to upload images or gifs, along with thoroughly explaining the problem in written form so it can be indexed and searched for thus helping future visitors with similar issues.

Thank you @DuarteFarrajotaRamos. Since JohnEason added images below I won't edit this question since it will be redundant, but I'll do so in the future.

You may have checked your main object for inverted normals, but the normals are inverted on the cutter Widget object as shown in red with Face Orientation on:

Select All on the Widget object in Edit mode, Shift-N to recalculate them and the bool tool works as expected:

Thank you! I won't be able to confirm this until later today to accept the answer -- though I'm sure it'll work! Out of curiosity and for my own learning, do you know what would cause a "brand new" cylinder to have inverted normals "out of the box" so to speak?

To be honest I've no idea with a straight cylinder object. However, if you start with a filled circle or a plane and extrude it downwards in the Z direction instead of up that creates a cylinder or cube with the normals flipped. The same applies if you extrude the face of an object to the left or down instead of right or up which is why it's a good idea to recalculate the normals fairly frequently if you're modelling with extrusions.

That is good to know. Though in this case, I did start with a cylinder that I just rotated and resized. Do you want to add to the answer that the way to recalculate the normals is under Edit Mode: Mesh menu: Normals: Recalculate Outside? I'm amazed it was somewhere easy to find! So many things seem buried. Thank you so much for your help!

I did say use "Shift-N to recalculate the normals" in my answer or you can use Alt-N which brings up a popup menu which is the same as the submenu on the main Mesh menu that you're talking about. To be honest I almost never use the main menus nowadays since there's a hotkey combination for pretty well everything in Blender. Thanks for accepting the answer.


text:
Creating button with flag
I have such a situation that the names of 3D objects that appear on the scene are display in the panel. If a given 3D object has an appropriate name, its name appears on the panel. Once I have that, I would like to create a button that will appear next to the name of object. Just like on screen.

As you can see, it works. My problem is that when I push a button, it works on all objects. I would like this button to work [on/off] and only affect the object it is next to. The button is quite simple, because it only has to select object / point. I know I should use flags, but I don’t know how to do it.

I know I should  set a property for the operator
(button) 'row.prop(context.scene.common_properties, CommonProperties.second_button, text=“Second Button”, toggle=True, icon=‘CHECKBOX_HLT’) The problem is that when I do, I have two buttons pressed at once.  And I would like the first button to be pressed, the second is not. When the second button is pressed, the first one will be not. I know I should use flags, but I don’t quite know how to do it.

maybe this will help: https://blender.stackexchange.com/a/57551/7777, you'll have to adapt it to 2.8+: https://docs.blender.org/api/current/bpy.types.Operator.html


text:
How To Convert Imported Identical Meshes to Instances (Duplicate Linked)?
I was wondering if there is a way (or python script) to convert multiple identical meshes into instances? - where all other identical meshes are referring (instanced) to the first identical mesh e.g., BALUSTER.001.
The file was imported from ArchiCAD via FBX

As long as the origins of the various objects are in correct relation to each object, there is a simple way to do this. Select all objects that are supposed to share the same mesh data, then - in the 3D View - hit Ctrl + L to open the link menu. From there, choose Object Data:

This will re-use the mesh data from the last selected object on all other instances. You can tell that they are instances in the mesh data tab of the outliner. The user count (number next to the data name) should have appeared and increased to reflect the number of meshes that re-use the data:

Thanks. This saves me a lot of time.

I now also realize that a python script would save me "even more" time. Since the first identical mesh has a "- 001" suffix and the identical copies have "-001.001, -001.002, -001.003...suffix sequence.
Any pointers on how to achieve this with a python script that checks the whole scene and links object data to each "-001" in a hierarchy?

@SimonGaitara I have provided a second answer showing how to do this with Python. I do take a few assumptions and shortcuts, so be careful to save your imported scene before running this, and carefully check the result afterwards

An alternative answer to the same question using Python works as follows: I assume that the objects coming in are consistently named, and the restrictions of origin placement are the same as with the other answer I gave. With consistent naming I mean this:
my_obj_01 is supposed to share the data with my_obj_01.001, ..., my_obj_01.015, ...
my_obj_01 is NOT supposed to share the data with my_obj_02

If this is the case, then the following script will do what you request in one shot for the whole selection. So make sure to select the items you want to operate on first. If that's the whole scene, then so be it:
import bpy
import os

# purpose of this script is to link object data of objects by name
# the pattern used is that if an object name has duplicates following
# Blender's .001, .002, .003 syntax, the mesh data will be linked
# between them

# consider only mesh objects
objs = sorted([x for x in bpy.context.selected_editable_objects if x.type == 'MESH'],
            key = lambda x: x.name)

# get a list of the names of the objects above, stripped from any .001, .002 etc
# this will create duplicate name entries enabling us to find the elements we want to link
obj_names_stripped = [os.path.splitext(x.name)[0] for x in objs]

# now iterate over the name list.
# Getting an enumerator here too to be able to index the object later on
for i, obj_name in enumerate(obj_names_stripped):

    # check for i=0 to skip the very first item
    if i != 0:
        # check if the current item has the same name when stripped
        # than the previous item
        if obj_name == obj_names_stripped[i-1]:
            # link the object datas of obj[i-1] and obj[i]
            objs[i].data = objs[i-1].data

A few notes

I am abusing the os module here to strip the .001, .002 etc that Blender adds when importing. However, be warned: I currently do NOT check if you have an object called my_obj.test. My script then would force such an object to share its mesh data with my_obj.other_test, as all I do is strip anything behind a dot.
I am using the trick to sort the list of objects you have selected using the sorted(list, key=function) method that Python provides. By doing so I only need to sequentially iterate over the whole object list once, and compare an item with the one before it. If their names are identical, I link the latter item to the one before, effectively daisy-chaining the mesh data of the first object found through to all copies
I use Pythons enumerate function to provide me a tuple of index and object from the name list, so I can access the mesh object from another list that has the same sorting as the name list


text:
Is there an automatic way to fit this piece perfectly?
I'm trying to create an apple monster character and later on he'll be used in an experimental video game environment. I'm having a problem with this apple piece, I want it to fit perfectly in the hole, it was a perfect fit with the other piece on the left, because the 3D cursor placement stayed the same. I rotated the piece towards 3D cursor's X axis, and typing in 75 for angle. I have a lot of manual "auto-saves", so if it's impossible to fix it on this file, I can go back to that step where the pieces were cut, but didn't have any movement affection.

The pieces were not scaled nor moved, only rotated.

I thought of trying to fix it by "Alt + G"-ing, but a lot of objects scattered around, "Alt + R" no luck too and pretty much I'm out of ideas. And just in case, these pieces will be have to be riggable for animation.

why don't you select both the piece and your apple, go in Edit mode and move the piece vertices so that they stick to the apple?

@moonboots Do you mean by rotating the piece manually to that point when it fits perfectly? That's time consuming and I hoped for some automatic feature for it.

you rotate it as best as possible, then bring some correction manually with the snap to vertices option enabled so that the vertices of the piece stick to the vertices of the apple, but maybe i don't understand everything you explained...

@moonboots snapping did work, but again it took some time. I updated the question, should be a lot clearer now.


text:
Boolean modifier behaving strangely
I'm trying to make a grappling hook. I have two objects in my scene, one for the "stick" and the other for the four claws, as shown below in the pictures. Each claw intersects the stick along its middle edge at the base, as in  the pictures (I don't think this should matter for the union, I just thought of pointing it out. I'm pretty much a newbie so I'm not sure).
The problem comes when I try to unite them with the boolean modifier. I put it on the stick object and set it to union, however, the preview shows only three of the four claws outlined (as well as the stick), and if I apply it, it does what it says. If I set it to difference it outlines the stick and the fourth claw for some reason, and if I set it to intersect, the stick disappears and it outlines the fourth blade.
I'd like to know why this happens and how to fix it, preferably without an overly cheeky workaround, I just want the boolean modifier to work. Thanks! (Pictures below, they're a lot, I hope it's not too clutered)

Edit
For whomever is interested, here is the file:
https://drive.google.com/open?id=1nszm0Wxbn2X7TThB6ltSwOXgvJk4Y5kE

Not sure what is the problem, but I would suggest to joint them manualy, it will have better topology for UV mapping and to working with it. Ii should be easy as the polygons are pretty much prepared for that.
If you insist on boolean could you upload the file? I would like to test it by myself.
Also if you don't want or dont need the seams to be perfect  you can just join the objects.

@Fowl thanks, I didn't know you could just join objects like that (as I said, I'm a newbie), it worked quite nicely. Also, I edited the post and put a link to the file there. Enjoy! :))

it worked for me. The problems can be in few things. 1)objects werent intersecting enought. 2)check you normals, some of them were inside out -> viewport overlays -> face orientation to find out errors. 3) object had points where there were 0 thickness in that three parts of the rod. Anyway I put the hooks more into the object and it worked.


text:
Check if vertex is actually on face and if not put it there?
tl;dr: I have a mesh with a vertex that looks like it's on a face; how can I verify that it's actually on the face? And if it's not, how can I put it on the face?

Full explanation for context:
I'm new to Blender and using it for 3D printing. I know this isn't a 3D printing stack exchange, but I think I've done something wrong in Blender.
I've been using BoolTool, and I've noticed when I use the Difference action, faces that I think are coplanar turn out not to be. The result is a face covering up a hollow area and a sprinkling of vertices that feel arbitrary but I'm sure are where they are because maths. This will happen, say, if I've rotated a mesh, done some other transforms on it, then duplicated it, scaled the duplicate down, aligned the two with minimum Z, and use Difference. (I'm guessing this is because computers don't store floats to infinite precision.) I will also get two vertices that have the same exact global X, Y, and Z on top of each other.
So now I try not to use BoolTool for differences, or I make the negative space mesh slightly bigger or lower that it needs to be.
Am I have the same problem with BoolTool Union actions? Namely that boolean actions aren't happening the way I expect because faces aren't coplanar? I had assumed things were good because they looked good, but now I'm not sure.
Recently, I printed the model above, and when printed, the vertices highlighted did not get printed attached to the face. Basically, I ended up with a hinge -- though not one that I'm inclined to stress test! I'm impressed that the slicer and printer managed to make that gap, but it's also not what I wanted.
So did I mess this up in Blender?
edit: Does the question even make sense? Does a vertex being geometrically "on" a face automatically make it "connected" to the face?

I think your last question is the key to your problem - because the answer is no. A vertex being "on" a face does not connect it. In order to be connected to the face properly it needs to be a part of the face, i.e. one of the vertices that builds the face.

As Gordon commented, just because a vertex is technically located within the plane of a face doesn't mean that it's connected.
You can check whether a vertex is connected by entering Face Select mode, selecting the face, and switching back to Vertex Select mode. If your vertex of interest is selected, good news - it's part of the face.
Another useful checking tool is to hover over one part of your mesh and press L. This will select all of the linked geometry within the object.
To address your broader question - from on your description, you are using BoolTools (and booleans in general) incorrectly. In the case of union, for instance, the bodies to be joined should have some overlapping volume - otherwise you can run into undefined behavior. It sounds like you're trying to line up the faces on both sides of the boolean exactly.

Thank you so much @RayLennon. "Undefined behavior" does sound about right!
Does this sound like the way to do what I want to do?

Use align to make the faces coplaner (or use some other way of moving a mesh to make the faces coplanar).
Ctrl-J them together.
Select the vertices that define both faces.
Ctrl-F them.
Delete spurious edges.
Delete the "inner" face.

It seems correct in that moving one of the vertices of the square donut hole changes the donut face. It seems incorrect in that the L trick doesn't highlight more than one boxes at a time.

Okay. I think I'm making extra vertices that I'm not disposing of. I found "merge vertices" and that seems to fix the L problem. (See https://www.youtube.com/watch?v=Aclg2unKbyY.)

No - this still isn't quite the right way to go about this. A usual fill won't suffice in this case because you're trying to link two perimeters rather than a single one. If you don't want to use Booleans, try deleting both faces that you're trying to join, selecting both of edge loops (e.g. with Alt-Select), and using Alt-F to span the gap.


text:
Move vertices parallel with face they define
I'm new to Blender. I'm using it for 3D printing. and I'm trying to do something I thought would be easy but cannot figure out how.
The basis for the thing I'm trying to print is a sandwich board. I cannot figure out how to move vertices to precisely where I want them. I want to extend the one face so that the two vertices reach the ground. (I added a plane to represent the ground for clarity in the picture below.) Moving these vertices will also result in the bottom of this side of the sandwich board resting fully on the ground.
In non-Blender lingo, I want base of the sandwich board to lie entirely on the plane defined by z=0.
The vertex slide seems really close, but it's missing two things. If you can slide it off the end of the edge it's on, I can't figure out how. And if you can tell it to slide no further than a given plane, I can't figure that out either.
I tried doing this with BoolTool and creating sacrificial cubes to cut the bottoms off the sandwich board. I found that the more I used BoolTool, the more I ended up with erroneous or superfluous vertices.
I know I could get out a pencil and paper and a trig table and manually calculate the vertex positions, but it seems there ought to be a way to do this.
(Another way of looking at this is that I want an extruded parallelogram, though I see myself having the same problem, just with one vertex instead of two.)
I'm open to alternative ways of doing this, too.
edit: I'm on Blender 3.2.0.

edit: This is what my Snapping settings look like.

You might find Transform Orientations -> Normal useful with some playing around it allows to move parallel to the face. And to put edge at exactly z=0 you could use trick with scaling on Z axis with respect to 3d cursor which is at your wanted Z height by setting scale to 0. You might also find custom orientation useful: https://youtu.be/ABayYXu7OfI?t=456

Short answer
G,G and drag back, then hold ALT and drag forward while pressing CTR to snap to the underlying surface*.
Long answer

Press  G, G to initiate Edge Sliding.
Slide the verts back (or up in this pic).
Press and hold ALT to extend the sliding path along the normals.
Drag the verts to where you want. They'll be aligned with the normal of the edge.
If you want to snap to another surface, press and hold CTR to initiate momentary snapping.

*Prior to pressing CTR, make sure to set Edge and Face Project in the Snap To settings.

Hi hi. Just wanted to let you know I recreated the mesh and I'm not getting the extra vertices, so I'd done something else wrong prior that got me the extra vertices. It's still unclear to me how I can get the vertices to stop sliding precisely, though.

So! I discovered GG works with snapping as described in @Robin Betts' answer.

@BeccaDee I included a gif that shows more in detail how I'd do it. What's been added in the gif is some notes on how to snap correctly to the surface, which I forgot to mention in my original reply. (The C key while moving things means you don't have to permanently check the Snap button; it instead works a momentary snapping while you hold the C key, which is what I personally use to prefer.)

@HarryMcKenzie Gosh! How good you brought that up. I actually mistakenly used the wrong key (C) which is the equivalent momentary snapping key in Maya! I've corrected both the gif and the text description to reflect the right key, which is the Control key.

@Henrik nice! but how did you know u had to press Ctrl? hahaha kidding. awesome man! thanks alot for your updates! much appreciated!

@HarryMcKenzie To answer your question, though, about where the momentary snapping key can be found. This operation – what I call 'momentary snapping' – is actually called Snap Invert in Blender and it means you invert whatever snapping state you're in. So if snapping is turned Off, it'll be turned on, momentarily. It appears this feature is undocumented in the current manual as well as not visible when searched for ("Snap Invert") in Preferences > Keymap. But it can actually be seen in the bottom sub-header of the viewport, as shown here: https://i.imgur.com/tfhkMFm.png

This looks like a job for Snap > Project Individual Elements.

It's not incredibly well documented, but seems to work best projecting down an orthographic view, in line (on the left, below). You can achieve the view, looking through the back of the face to be projected, by selecting the face, and hitting ShiftCtrlNumpad 7.
Once there, just tap G once in the aligned view, and the face will project:

Thank you so much. I think this is going to be the answer, but I can't figure out all the steps.
So I can open up the Snap thing by pressing Ctrl-Shift-Tab. When I do that, I don't get any "Target Selection" area. Any thoughts?

I think a remarkably facile step-by-step instruction list would be perfect for where I'm at with Blender. Thanks again :)

Oh, I added my Blender version to the question: 3.2.0.

Okay. I just found https://www.youtube.com/watch?v=4cehZJkW7MU and saw that there's a menu-thing in the header AND a toggle button that looks like a magnet to turn snapping on!

Okay. I have it, though my Snap To settings are different from yours. I'm going to edit my question to include what my settings look like. But then I used GG from @Henrik's answer.

Hi @BeccaDee,, yes the tool is not the easiest to use.. Blender's snap system could still do with improvement, IMO.. we really need some way to constrain target and direction.

Thanks @RobinBetts. For what my specific task, the way to constrain direction was edge sliding, but I do see how that may not be a general solution.


text:
Rendering a fake mirror
I am trying to work out how to have a fake mirror in my scene.
Character A walks by a mirror on the wall, which should reflect the room and everything in it, except Character A. Instead of Character A, it reflects Character B.
So, basically, I want a simple reflective surface, but:

Character A should not be visible in what the surface reflects. Reflections should be rendered as if Character A is not in the scene
Character B will be in the scene, but only visible in the reflective surface, not in the world itself.

Here, crude graphic to show what I mean :D

Less crude graphic here:

Is this possible with Blender? I'm familiar with all of the most general functionality, but I can't think of anything that would achieve this. Are there data properties I can tweak? Is there a modifier that'll achieve it? Reflection probe trickery?
I intend to use Eevee for the rendering, but if Cycles achieves this better, I can switch.
EDIT: I can of course elect to not using a reflective but a transmissive surface and just model the contents of the mirror behind the surface. So instead of having any reflection at all, I'll just copy and mirror the geometry and do everything manually, but 1) that's a lot of work, 2) not really an answer to the technical question I'm asking.

Your Character B is definitely doable, I once did a render with a camera inside a character's head (FPV) where they were looking in a mirror. The head had to be hidden from direct view but visible in the reflection. I'll try to remember how I did it and post later.

You can use "Is reflection ray" output from "Light path" node and plug it into the alpha input of the "Principled shader".
This will work for both Eevee and Cycles. For Eevee you need to set "Blend mode" to alpha hashed in the material setting.

For the one that reflects in the mirror but is not visible outside of it:

For the one that is visible only outside of the mirror:

For Eevee, set both objects to alpha hashed in the material settings:

Sneaky bastard XD Thanks! Works brilliantly!: https://imgur.com/a/SubvWIS

So basically, I'll parent two different meshes to the same armature. One for world, and one for the mirror. Then the animations will sync up and grant the desired effect with no added work except for the shader magic. Thanks again..!

Yes... Eevee does it simply. Cycles is more complicated due to its accuracy for shadows... but it seems you don't need Cycles.

You must use the Input > Light Path node as a factor between the material of the object and an Transparent node.
For your green cube use the Is Glossy Ray output (non visible in the mirror):

For the red cube use the Is Camera Ray output (only visible in the mirror):

Thanks. Good answer. Worth the upvote. The accepted answer is slightly simpler though, just using the default principled shader, so that's why I awarded the green checkmark there :)

sure, you're right  ;)


text:
How can I fix the black parts after I apply subsurf?

As you can see in this picture I was trying to create a face, but when I apply a subsurfaces modifier you get these black spots. Does anybody know how to fix this.
thanks in advance.

Can you possibly upload a picture that is higher res?

is this better?

I had a similar issue and my normals were also all outside. Turned out, my sub-div was after edge split. Moving it above solved it. So probably check your modifier stack

It might be because the vertices in the mesh are not made properly positioned that the blender is not able to properly calculate how to apply the modifier. So try these:

Recalculate the normals properly using: "Shift+N"
Go to edit mode and remove duplicate vertices by "Merge by distance
option" (make sure you set the proper distance in the dropdown menu). Also, make sure
that there aren't overlapping faces


text:
How to limit the impact of Geometry proximity node?
I use Geometry proximity to create steps, but as soon as two stairs are close to each other, they start to mix, I think it’s possible to limit using ID Target, but I don’t know how to do it.

It's  unclear why you are using proximity here at all? Can you please describe your strategy more fully? Usually you would simply instance steps on the curve.. can you describe why you have chosen this method

Plug the Distance into a Compare node

@quellenform .. if you can figure out what's going on, I can withdraw my comment :)

@RobinBetts I have no idea either so I just guessed in the dark...

@RobinBetts I am making steps that will change their size along with the size of the polygon on which they are created
It's just that this decision came to my mind, if it can be done differently, then I will be glad to advice.
I have attached a blend file in which you can understand the problem in more detail

i would recommend providing 2 examples (4 pics) with before (your polygons) and after (with steps how it should look like) so that we have an idea what you wanna achieve. thx.

@Chris I can take screenshots, but I thought the attached blend file would be more informative, stairs have already been made there, and all I want is that they don't stick together when they are close to each other

I was able to solve the problem by just coming up with a new combination of nodes

authors: Дмитрий Ксель


text:
Painting on image doesn't show instantly on the object
I'm having a issue in the Texture Paint Mode and I can't find what's wrong.
Here is my problem : When I paint on the "Image editor" windows it doesn't instantly show the stroke on my object in the 3D viewport, sometimes I can see the beginning of the stroke but it disappears almost instantly too.
So I have to wait the end of the stroke to see what I did and it's very frustating.
I have to precise that this is happening since I update to 2.83, never had this problem in 2.82.
I need your help guys, thanks in advance.
EDIT : After further analysis, it only happens in Solid Render viewport

That is by design: Solid render mode will not display textures.
Textures will only be visible in Material Preview or Render Preview mode


text:
Is there a way to texture-paint with symmetry, hiding the symmetrical side but still affecting it?
(This question is similar to Sculpt mode, Symmetry, and the 'H' hotkey, but the workarounds proposed there can't be applied to this case)
Let’s say I’m texture-painting an A-posed character’s tattoos, with x-axis symmetry on, and that I want to paint on an area such as the inner region of the legs, where one leg keeps getting in the way of the other in the viewport and making painting difficult. I would need some way to invisibilize that leg while still having it receive the brushstrokes symmetrical to the ones I’m applying to the visible one.
Masking doesn’t seem to have any symmetry-preserving option, so, how could I go at this?
On the other hand, is there any addon able to symmetrize one side of an object's texture map while in a Texture Painting Mode's context?
(Editing the texture maps in a paint program to, say, flip a half to cover the other half, isn't practical because of the way the UV mapping is done plus seam issues. Halving the model and using a Mirror Modifier isn't applicable for several reasons, either)

If Mirror modifier isn't working, I guess I would try a boolean modifier (checked to show in Edit Mode) to hide half the model while I work.

I've just tried it and, sadly, doesn't work: it correctly hides half of the body while in Texture Paint Mode, but the brushstrokes done while the Modifier is active don't appear in the other side when it is revealed upon deactivating the Modifier. Which kind of makes sense, as its polygons "weren't there" while painting.
(The reason I can't use the Mirror Modifier is that the model has been prepared for rigging already, with vertex groups and weights, and I would lose most of that work if I split it)

(Same goes for UVs and existing textures. It’s a pre-existing game model, so, rebuilding it isn’t an option)

Ah that's too bad, I guess being active in edit mode is more literal than I had thought

I tried using the Mask Modifier with Occlude turned off, and it still seems the projection operation is considered AFTER the mask in view so that the paint only affects the visible geometry.


text:
Why Geometry Nodes(Realize Instances) make shading ineffective?
The beginning：

After adding the geometry node (Realize Instances)：

My shading:

That seems a bit confusing, but before you Realize Instances, each sprinkle is treated as a separate object - all duplicates which cannot be edited independently, but each is an individual instance.
After Realize Instances, these instances become real meshes and therefore they can be edited independently - however, they are no longer individual instance objects with individual indices which can get random values assigned to them. The whole thing is now one object, but consisting of separate meshes unconnected to each other - so called islands.
And here is a solution: to use random colors on those mesh islands, in the material you have to switch the Object Info node with a Geometry node and use the Random Per Island output. Just be aware that the random colors are not distributed the same way they were before on the instances.

Another method would be to assign random values to each instance before realizing them and store the values in a named attribute. This way after realizing, all vertices of one mesh island carry the stored random value of the instance which they come from originally.
To do this, plug the Instances output into a Store Named Attribute node (which then is plugged into whatever followed the Instance On Points), set it to Float and Instance and plug a Random Value node with Min/Max 0/1 into the Values input. Then give it a name, I used "randID" here for example.
This way you can use an Attribute node in the Shader Editor, enter the name you gave it in Geometry Nodes (make sure to spell it correctly) and use these random values for the color ramp. Since each vertex of a former instance has the same value, this works like the Random Per Island.
Of course the random distribution is different from the other ones before as well, however this method comes with an advantage over the other ones: if you don't like the color distribution, you can change the Seed in the Random Value node until you're satisfied with the result.

@RobinBetts Of course this is just "a" solution, I chose "the" deliberately because I wanted to emphasize that it makes use of the "islands" as the shader material even uses this term in the Random Per Island socket. But that's okay, of course you are right


text:
Snap to face not working on mirrored vertices
Please excuse my ignorance, but I've searched this issue all over the web and have yet to find a fix that works. I'm a beginner working through a character modeling tutorial on YouTube and am at the retopology step of the creation process. I'm really enjoying Blender and how powerful of a tool it is, but occasionally run into a few roadblocks.
The vertices you see on the right side of the character's pants are being mirrored on the x-axis using the mirror modifier. I'm snapping the faces of the low-poly retopology object I'm currently creating (tan color over the pants)to the high-poly pants object (olive color). The vertices all seem to line up properly in the mirrored side (left) until we reach the left-most vertices that stick out and don't snap to the pant faces. I've checked that all objects are centered, have their transformations applied, and even tried making a new object (which displayed the same behavior).
I'd really appreciate any insight and advice as to how I can get the mirrored vertices to snap to the high-poly pants object like the original vertices on the right. I'm sure it's some simple setting or mistake somewhere, but I can't for the life of me find it. Thanks in advance!

You can only snap "real" geometry to the faces. Since the Mirror modifier isn't applied yet, you cannot edit both sides individually.
The right buttock is larger/wider than the left one. The object you're working on is perfectly mirrored to the left side, fitting the width on the right. Snapping the vertices on the right to the large buttock doesn't make them snap to the smaller buttock on the left. They are just mirrored exactly as they are on the right.
So you either have to make the buttocks mirror-symmetrical or you have to apply the Mirror modifier on the low-poly object and edit both sides individually.


text:
Symmetry sculpting is behaving oddly
After joining and remeshing several objects the sculpting symmetry is suddenly off, as shown in screenshot. I didn't bother placing my model at the center from the beginning so maybe that's the problem. I'm a newbie so I really don't know. I read in another thread that you can recenter your model by changing location and rotation to 0,0,0 but that had no other effect than putting in a weird angle. How do I fix it? I really need symmetrical smoothing to finish my frog.

Hi, can you share the file as it was before you put the toad back in center ? I can't figure out why the angle of the frog changed. Would rotating the frog to have it centered solve the problem ?

I found a solution here https://blender.stackexchange.com/questions/199959/symmetry-is-mirroring-on-wrong-axis
It's not perfectly symmetrical but it works for what I need it for.

I would also apply the Scale (Ctrl+A) because it's not uniform for your model. It has different values for each axis as you can see in the side panel. This can cause weird stretchings in sculpt mode. The cursor is also deformed to indicate this and you get a warning about this in the status bar: https://i.sstatic.net/xdzqK.jpg


text:
How to do a loop for selected objects? (solved)
I've done an addon with a button that creates a color animation of sorts where the colors change with regular intervals. But my code only works for a cube. When I try to enable the code for selected objects the script runs fine, but when I press the button I'm getting an error:
Python: Traceback (most recent call last):
line 84, in execute
AttributeError: 'list' object has no attribute 'active_material'
What is wrong here?
The code for the color loop:
class COLORANIM_OT_my_operator(bpy.types.Operator):
"""Click OK and press space to start animation"""
bl_label = "Color Animation"
bl_idname = "coloranim.my_operator"

def execute(self, context):

    mat = bpy.data.materials.new(name='colored')
    obj = bpy.context.selected_objects

    obj.active_material = mat

    colors = [(1, 1, 0, 1), #yellow
                (0, 1, 0, 1), #green
                (0, 0.7, 1, 1), #blue
                (0.7, 0, 1, 1), #purple
                (1, 0, 0, 1), #red
                (0, 0, 0, 1),] #black

    frames = [1 , 30, 60, 90, 120, 150, 180]

    for f, c in zip(frames, colors):
         mat.diffuse_color = c
         mat.keyframe_insert(data_path='diffuse_color', frame=f, index=-1)

    return {'FINISHED'}

def invoke(self, context, event):

    return context.window_manager.invoke_props_dialog(self)

bpy.context.selected_objects returns a list of every selected object ; so you need to iterate through it :
def execute(self, context):
    mat = bpy.data.materials.new(name='colored')

    for obj in bpy.context.selected_objects:
        obj.active_material = mat

        #...the rest of your code

    return {'FINISHED'}

Thank you. You're a saving angel.


text:
is this shader node arrangement valid? (works, but possible circular dependency)
I'm dealing with a Nodegroup that receives the output of several Texture Map nodes. One of those nodes needs to receive the result of some calculations as vector mapping data.
I could have such calculations dangling at the left side of the involved Texture Map node, connected to its Vector input, but I intend to distribute this material among friends, so, I want something a little simpler and tidier to reduce the chance of mistakes on their part. What I'm doing is including such calculations inside the Nodegroup, too, as a sub-block that doesn't contribute to anything other than this auxiliary output to feed that Texture Map node (the attached image is a simplification. The actual Nodegroup is rather large, complex, and full of inputs).

It does work, and the results are correct.
But I don't know if it is a good idea. That kind of thick orange link looks like some kind of warning (for the life of me I can't find what it means in Blender's manual), and I'm noticing that sometimes I'm having to force a recalculation of the material by tweaking some other input field to make Blender react (I'm on Mac, so, I don't know if it's a Mac issue or a Blender-level one). The alternative is to put the mapping calculations back outside the Nodegroup, but I'd really want to spare my friends the hassle they would mean (they re-use data from a normal map, meaning more links criss-crossing the node tree).
So, my questions are:

Is this kind of arrangement "legal" or valid?
Is that thicker orange link a warning of some sort?

(I'm on Blender 3.2.1)

Hi :). RED noodles signal invalid connections. In this case probably circular dependency, since you're feeding the output into one of the input textures. This might cause those other problems :)

Correct or you might have the vector output (blue) going into a shader input (green). Something like that.

In regards to your question I'd say "Ask forgiveness not permission". Send it to one of your friends, see if it works, if they have any issues fix it and resend it to them.

I don't want to make a chat here, but ... Your both Q seems to be answered by Jachym's comment ... it sounds like "What was the first - an egg or a chicken?" ... Anyway if it works for you keep it :) I assume - disconnecting red noodle stops it working, right? If it really works I'm interested what kind of circular dependency is working in blender if you can elaborate more or direct me to this topic. Thanks

It's no trouble at all. :)  I'm updating the attached image to better reflect what's going on with the dependencies in my node arrangement. And my thanks to Jachym and Jakemoyo.

Related: Red shader node noodle (line) from node group vector output to image texture vector input

Nodegroup output connected back into the same nodegroup is an invalid connection.
Even if there's no circular dependency.
Such connections will not properly update, or work at all.
(It's probably just developers being extra paranoid :))
Two identical setups, but one of them goes through a nodegroup

In the case I'm dealing with, it does work, but seems to require at certain times that one updates something else in the nodegroup for it to fully recalculate things.
I'd kill for Blender to offer an image node that one would be able to subject to a mapping action downstream instead of only an integrated mapped texture node. None of this would be needed.
Well, I guess that's all. Thank's everyone :)

Yeah i noticed it acts a bit unpredictably at times :). Anyways, good luck with your project :)


text:
Alternative to now read-only mesh.loops[loop_index].normal on Blender 4.1 for game objects importer add-on
EDIT: the original post assumed that this code was dealing with the bmesh API, out of a confusing naming scheme, which was incorrect. The text and sample code have been corrected.
I'm dealing with a 3D game asset importer add-on. Blender 4.1's mesh deprecations broke the way this add-on assigns the original asset's normals data to a new Blender mesh object, and I'm not knowledgeable enough to solve it.
Basically, the original code used mesh.loops[loop_index].normal to temporarily store normals in the mesh, so that if a mesh.validate() step deleted any geometry, such geometry's normals would be gone while the rest maintained their order for free. Once past the validation, it did read that temporary data and did the actual normals assignation.
This is the block of code where things happened, partially de-indented for legibility:
# game_mesh_data is an object with data parsed from a game object file.

# Create blank Blender mesh with the name of the game mesh object.
blender_mesh = bpy.data.meshes.new(game_mesh_data.name)

# Fill it with verts from the game mesh object.
blender_mesh.from_pydata([vert.position for vert in game_mesh_data.vertex_buffer.values()],
                  [],
                  [index for index in game_mesh_data.indices_buffer.values()])

# We store temporary normals in loops, since validate() may alter final mesh.
# We can only set custom loop normals AFTER calling it.

blender_mesh.create_normals_split()  # DEPRECATED IN BLENDER 4.1.

for j, polygon in enumerate(blender_mesh.polygons):
    loop_indices = polygon.loop_indices

    for k, loop_index in enumerate(loop_indices):
        v = game_mesh_data.vertex_buffer[game_mesh_data.indices_buffer[j][k]]

        # We apply the normals to each loop directly.
        blender_mesh.loops[loop_index].normal = [v.normals.x, v.normals.y, v.normals.z]
        # DEPRECATED IN BLENDER 4.1 where blender_mesh.loops[loop_index].normal is read-only.
        # We need an alternative means to store the normal data in a per-loop basis).

# This is the step that might alter the mesh.
blender_mesh.validate(clean_customdata=False)

# Mesh Normals

# Here the Normals are read from the blender_mesh data, with any alterations accounted for.
custom_loop_normals = [0.0] * (len(blender_mesh.loops) * 3)
blender_mesh.loops.foreach_get("normal", custom_loop_normals)

# And here they are set in their definitive form.
blender_mesh.polygons.foreach_set("use_smooth", [True] * len(blender_mesh.polygons))
blender_mesh.normals_split_custom_set(tuple(zip(*(iter(custom_loop_normals),) * 3)))

blender_mesh.use_auto_smooth = True  # DEPRECATED IN BLENDER 4.1: use Smooth Angle Modifier instead.

From 4.1 onwards, mesh.loops[loop_index].normal is read-only, so, I need another way to do the same, which escapes me.
To progress in some form, I've been trying alternatives in 3.6 and 4.0, to see if I can get the same results previous to the mesh.use_auto_smooth() step or its Modifier alternative, as a way to validate it, to no avail.
(I've tried accumulating the normals data in a list by the order determined by the loop, and using mesh.loops[loop_index].normal to assign them before mesh.validate(), and I'm getting something close, but still there are faint discontinuities, showing up as sharp-like, that the original approach solved, and I can see in the resulting objects' normals data slight differences between both)

The FBX importer just uses a temp custom attribute instead: https://github.com/blender/blender/blob/06b25fee0e256184712bee39175ffc211a861da9/scripts/addons_core/io_scene_fbx/import_fbx.py#L1904-L1930

Following your clue, I redid that code to use an arbitrarily named custom attribute. It it didn't solve the issue by itself but led me to learn why: the original normals data wasn't normalized. If I pre-normalize it, it works and the mesh shows no discontinuities. That normalization happened "automagically" in the older technique by using mesh.loops[loop_index].normal to store it. It doesn't happen if using custom attributes. normals_split_custom_set() doesn't seem to do it either. I'm trying to find such a shortcut to save cycles calculating it when importing massive worlds.

Yes, normals_split_custom_set misbehaves badly if the normals are not unit length. You might be able to normalize them quickly with numpy.

As the original asset's parsed data was using the mathutils' Vector type for the normals, I can use the normalize() (acts on the original vector) or the normalized() (returns a normalized copy of the vector) methods. They don't seem to impose much of a time penalty, but still I have to do some tests.

This is odd. The custom attribute data for the temp normals aside, I also create a layer of UV data, which is filled during the same loop as the one filling the custom one.
In some cases, I have to create three layers of UV data instead of a single one (it's to support some animated UV materials), though. If I create the custom attribute layer before I create the additional UV layers, its initial elements (as many 0,0,0 vectors as the mesh' loop indices) completely disappear. I'm having to create it after the UV ones to keep that from happening.


text:
how to get number of selected vertex and the number of total vertex with python?
how to get number of selected vertex and the number of total vertex with python?
and how can I select an object by its name and make it the active?

You have multiple questions there:
import bpy
import bmesh

obj = bpy.context.active_object
if bpy.context.mode == 'EDIT_MESH':
    bm = bmesh.from_edit_mesh(obj.data)
    verts = [ v.index for v in bm.verts if v.select ]
else:
    verts = [ v.index for v in obj.data.vertices if v.select ]

print(verts)
print(len(obj.data.vertices))

and for the second question:
bpy.context.scene.objects.active = bpy.data.objects[name]
# fix shortcoming identified by Omar :
for obj in bpy.context.scene.objects:
    obj.select = ( obj == bpy.context.scene.objects.active)

thanks,the 1st one work fine but the 2nd one is not working well,I want it to select the object only but I find that it select 2 objects the one that was active and the one I select by the script

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


text:
Achieve a high pass filter in blender compositor?
how can I Achieve a high pass filter like that one in photoshop with the blender compositor

By using these instructions from wikipedia:

If you want, then you can create a reusable node group by selecting the nodes and pressing ⎈ CtrlG:

@AlexanderBicukow It works fine for me in 3.1.2, in what way does it not work for you?

it's working, my bad

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


text:
Working with lower resolution in compositor viewer?
I am Compositing a 4k image and when viewing it is very slow,so I want to work only with 1k viewer not the full 4k,but still have the same resolution when final render.

Scale Node
Something I do is put a 'Scale' node (Shift+A > Distort> Scale) just after any high-res image I want to reduce, setting the scale type to 'Render Size'. This will mean that any inputs will be scaled to your output resolution, set in the Render panel.
Using this method you can then reduce the render size to 50% using the resolution percentage property in the render settings and the compositor will reflect that change (though the compositor may only update to the new resolution when the frame is recalculated).
Here, I have the scale node after a 4k image, but with the resolution percentage set to 50% I only do the compositing with a 2k image, meaning the blur node is processing less pixels and will be faster.

When you want to do the full render you can just disable the scale node with M, which 'Mutes' the node or set the resolution back to full. Other scale node types will also work, instead of 'Render Size', this is just my preferred method.
Note: It is important to put the Scale node directly after the input image/movie so all the compositing is done on the low resolution image. Having the scale node at the end of the node tree would have no effect as the scaling would be happening after all the intensive compositing of the node network is computed.
Compositor Quality
You can also set the 'Edit quality' of the compositor to 'Low' in the Performance area of the Properties menu (N) in the compositor.

this work,but I lose the quick set for the view node,is there is any way I can get it back

@Omar Ahmad I don't know what 'quick set' is.

when we press Ctrl+shift+RMB to a node

@OmarAhmad You can do that to any node. So just Ctrl+Shift+RMB on the scale node, if that's what you meant.