text:
Reversing an action: Bevelling
I'm learning Blender but something that strikes me as an infuriating oversight is the apparent lack of ability in the software to delete a feature like a Bevel. In Solidworks the features are listed and you can edit or delete them with a few clicks thm wheneber you like.
How do I delete a bevel. And don't say "undo". That's not useful at all. And how do I edit one after having made a few. If I want to come back to it and tweak it, how do I easily edit a bevel?
Surely there is a way to do such a simple task efficiently? Everyone is going on about how good blender is but there doesn't seem to be any way to do what should be an extremely simple and straightforward task.

Blender and Solidworks are 2 different softwares that don't have the same purpose, you can hardly compare. For the bevel, if you want to reverse you need to work with modifiers, don't bevel with Ctrl B, assign a Bevel modifier to your object and use the option that you need.

and this allows you to edit and delete it in future?
I'm aware that they are not comparable. But it doesn't excuse the lack of what should be a straightforward task from an UI perspective! But if this works then it answers the question and redeems blender for me haha!

Again, use the Bevel modifier, it is not destructive, but it may not always work, it really depends on your object. Also dig into the Geometry Node. The fact that they are 2 different softwares excuses the lack you're talking about, Solidworks is not capable of certain tasks as well. If you feel that you are able to fix this challenge in Blender I guess the Blender foundation would be glad to have you as a developer   ^^

https://blender.stackexchange.com/a/165516/19307

Thank you! Never wanted to compare to Solidworks though just to avoid confusion. I merely mentioned it to show that it's possible and from a sheer UI perspective it should be just as easy since it's a simple task.
Put it this way and answer the question: Should removing a bevel or editing it be a complicated task?

@MattBolt: sorry to say, but this sites is for solving specific problems you have with Blender. It is not about philisophic questions like "should it be a simple task". If you wanna discuss that, maybe search another forum/site like Blenderartists.org. And no, i didn't make the rules here...and moonboots already wrote: use a modifier, then it is an easy task to remove it (because it is a modifier).

and if you wanna use Blender a bit more professional, maybe think about the autosave option/add-on which saves a Blender file every x time so that you can go back to an earlier stage of your work.

Seems like we are getting very defensive about this :D. While this is a real problem in all surface modelling software. Solid modelling is simply way more suitable for easily adding bevels and it is going to be a more difficult task in any surface modelling software like Blender is. So the answer is - yes, it is a more complex task in Blender and it has to be, because of how surface modelling works with vertices, edges and faces. Bevel modifier however does make it non-destructive so some desired functionality will work(like being able to adjust and remove it later).

Sure. There is a non-destructive way to make bevels - Bevel modifier.

You can choose a different limit method so you can define the edges that are beveled with it. You can do it by face angle, vertex group or weight. You can set weight of the bevel modifier for edges in edit mode:

Or assign vertices to vertex groups in the Mesh tab, in the Properties Editor:

Note that bevels are very different in surface modelling than in solid modelling and you will inevitably find that they are more limited in Blender(as well as in all other surface modelling software) than in something like Solidworks, because they need to work with the mesh consisting of vertices, edges and faces instead of some mathematical description of a volume. Bevel modifier will attempt to clamp the bevel if it results in overlapping geometry - this will often cause problems with complex or untidy topology that you will need to address(or consciously ignore sometimes).


text:
Weight covers too large an area, more elements moving
I've tried everything, at the start I had a problem with getting the armature to work with the mesh - I fixed it after hours and now it's happening, when I move one bone, three pieces move...
Changing envelope (3 picture) isn't working
I've tried to paint it over by hand, but it's going to take me hours and it's still doesn't look good
Still everything moves.
Same thing happens when I try move head (eyes drowning in the head)

The weight paint pics-- if autoweight based-- suggest backwards normals.  Check, fix, re-autoweight if that's the case.  Bone envelopes are bad.  Don't use them.

source: Stack Exchange

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

sort: votes


text:
A stationary object stuck in an render animation
there is nothing in the preview, and when I render the animation, some objects appear
Help me, how to make them disappear

Check your outliner, some objects might be disabled for the viewport but not for rendering.

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


text:
Is there any way to get blender control rig in unreal engine.?
I need to use control rig for a model that was created in blender and rigged with bones and control rigs. I need the same control rig instead of creating it from scratch in unreal. Is it possible to use blender control rig in unreal engine instead of using direct bone adjustments?. If it is possible, what are the model/blender export settings I need to follow!.


text:
Freestyle lines are not fully shown / not visible
Does anyone know why all the outline options I try in blender have this same effect.
When I look at the object from the front view some lines are not shown.
I actually need the lines in front to be shown as well.
In the example down I used the freestyle outline option (because I needs an quick fix in multiple viewpoints)

You may notice, that the outline occurs where ever a sharp edge is located or it's needed to seperate visually overlapping parts like on the left and right side of the mesh in yor image.  What exactly are you needing this for? is it just for refrence when modeling?


text:
how to smooth these parts of the material?
I am stuggling, this part of my 3d model is having trouble beiing smooth. Am I missing something? I have already done a shade smooth, recalculate normals, and checked orientation faces.  what am I doing wrong? any ideas for me?

Hello, try to go into the Data panel > Geometry Data > Clear Custom Split Normals Data, if it doesn't work please share your file

Seems like a model imported from some CAD software. It could be that it's made out of unconnected parts, you could try merging by distance, but it also sometimes happens that it's not possible as sometimes solid models might get converted to surfaces that do not necessarily have vertices in the same places. In that case there is not much that can be done easily and it might be easier to just remodel the whole thing making sure it has proper topology. ...or try to re-export it from whatever CAD software it comes from with different settings, but that might not always be possible.

@moonboots YES! that solved it THANKS!

Here are 2 things that you can try that might help,

Clear Custom Split Normals Data,

then use Weigheted Normals Modifier,


text:
Is it possible to adjust the sensitivity of the zoom in the 3D viewport when Zoom Method is set on Dolly?
In Blender Preferences > Navigation,  we can easily adjust the Orbit Sensitivity, but there is no setting such as "Zoom Sensitivity".
I use Zoom Method set on Dolly, with Zoom Axis set on Vertical, so I can zoom in and out by moving my mouse up and down, as long as I hold a key down. But I want to modify how much up and down I have to move my mouse to reach a certain zoom level.
So is it possible and how can I adjust the sensitivity of the zoom in the 3D viewport when Zoom Method is set on Dolly ?


text:
Is it possible to change the zoom direction in the graph editor using Ctrl + Middle Mouse by moving the mouse to the right instead of to the left?
In the graph editor, we can zoom in and out using the Ctrl + Middle Mouse shortcut.
We zoom in vertically by moving the mouse down, and horizontally by moving the mouse to the left.
I would like to zoom horizontally by moving the mouse to the right instead of to the left.
Is it possible?
I searched in Blender preferences but found nothing about this.


text:
Why Dyntopo with the Refine Method option on Subdivide Edges still Collapse edges in dense topology?
In Sculpt Mode, when using the Simplify tool with Dyntopo enabled, you have the choice between 3 Refine Methods :

Subdivide Edges
Collapse Edges
Subdivide Collapse

When I test it, Collapse Edges and Subdivide Collapse work as expected.
But when I select Subdivide Edges, the Simplify tool acts exactly like if Subdivide Collapse was still selected.
So rather than only subdivide edges in areas with less dense topology than the defined resolution, it also collapse edges in areas with denser topology than the defined resolution.
So is this a bug or is there something to do to make the tool work as expected?

As specified in the manual:
The Simplify brush is specifically meant for use with Dyntopo to remove/add detail in the mesh. Even when the Refine Method is set to Subdivide Edges, this brush is always able to collapse edges. This ensures that while focusing on adding detail to your sculpt, the Simplify brush can always be used to simplify and polish surfaces.


text:
how to export indexes of selected faces to an txt file
I want to render some selected face using program.
But i don't know the indexes of the faces that i want to render.
Is there a good method to output the indexes of selected faces to a file?
Thanks so much.

You can do this using Python:
import bpy

obj = bpy.context.active_object

with open('/PATHTOFILE/selected_faces.txt', 'w') as file:
    for f in obj.data.polygons:
        if f.select:
            file.write(f'{f.index} ')

Run it in Text Editor. Paste it into new text file and press run (button with play icon) :

Thanks so much for your answer.  But could you please explain where to run these script?

In text editor. Paste it into new text file and run (button with play icon)

It's awesome. Thank you for your detailed perfect solution.


text:
Deformation after merging by distance
I'm facing a problem with a mesh that has a Multiresolution modifier applied. Everything was progressing well as I worked on the UV mapping. In an attempt to eliminate any duplicate vertices in the mesh, I opted to merge them by distance, which resulted in the merging of two vertices. Unfortunately, this action has caused an issue when viewing the mesh in Object mode, and it appears to be irreparable. Kindly review the images depicting the mesh before and after. Could someone please provide assistance with this?

The modifier is not applied. You could delete it and create another. It's also possible to apply it at higher subdivision and then use "unsubdivide" when you re-add it so you don't loose detail. The term "apply" means to bake it into geometry when we are talking about modifiers. It's done by pressing ctrl+a while hovering over it. You wouldn't say you "applied" it yet, you could say you just "added" it or simply you are "using" it.

@Martynas Žiemys Applying the modifier before merging by distance proved to be helpful. Thank you so much.


text:
how i can join this too meshes and put them in the right place?
i been trying to join these to together in the exact join but i cant do it, is there at least a way to make those joins be in the exact place to match the meshes?

Are you trying to merge them into a single mesh or are you trying to attach the arm(?) to the torso for animation? You can use the "Child Of" object constraint to make the arm follow the torso

Are these two armatures wouldn't the arm rig just be apart of the rest of the body rig?


text:
Help understanding selection functionality or is this wrong?
This is maybe more a workflow question, but I find myself consistently frustrated with Blender with the following workflow. Please follow these instruction precisely to encounter what I'm talking about or skip to section 2 for an attempt at a written explanation.
Section 1:

Select any object (I have the default cube on screen)
The object now has an "Orange" selection highlight.
CTRL C / CTRL V to copy and paste
The selection highlight now turns "Dark Orange."
Select the MOVE tool and drag / move the object away from the cloned / original one.
The moved object remains with the "Dark orange" highlight.
The cloned / original object is no longer highlighted at all.
This is the part that gets me every time; I believe the moved / highlighted object is STILL the one selected for all subsequent changes. i.e. If I scale or change dimensions or something, the un-highlighted object is still the one selected? Why is that?

Is there some rhyme or reason to this and/ or can I change it?
SECTION 2:
Why are there two highlight colors and why does an object remain "selected" even with no highlight and the currently highlighted object is not actually highlighted for all operations?

You seem to be missing the concept of Active Object https://docs.blender.org/manual/en/latest/scene_layout/object/selecting.html

Also see https://blender.stackexchange.com/a/223995/19307

Yes, I understand, but do you care to express your understanding of the rationale? Why on Earth would the still selected, or otherwise modifiable object, still be "selected" with ZERO highlight, while the visually selected object, albeit with a darker color, not be???

As explained in the link, because it original object remains the active one, despite not being selected. Pasting objects selects the newly pasted objects, but since there can be any number of them, it doesn't set any new one as active, because the active object would then be seemingly arbitrary. As such the devs made the intentional decision to not change the active object, so as not to create false expectations

Ah, this helps, but the issue still remains, yes? The issue is the still "active" object is no longer highlighted. Why turn off the active highlight?

This seems to be more of a critique of Blender's behavior than a question now.

"8. This is the part that gets me every time; I believe the moved / highlighted object is STILL the one selected for all subsequent changes. i.e. If I scale or change dimensions or something, the un-highlighted object is still the one selected? Why is that?
Is there some rhyme or reason to this and/ or can I change it?"


text:
Did someone know how to "bake" pivot point orientation (like in maya)
i have several objects wich i have to modified, and they have diferent position and rotation (image 1)

to linked them i need to "bake" position and rotation, but set origin gave me only position
i little bit confused, but looks like blender pivot point have no rotation at all
(in maya its will be done with "bake pivot")

Ctrl A > Apply Location/Rotation/ Scale.

I know about this function, but I need exactly the opposite action
(if i do Apply to all objects and then "link object data" they will just move to the origin
what actually need: each one have its position and rotation by the world

do you mean that you want the origin of each object to be align with the orientation of its mesh?

yep this is what i try to recieve)

If you want to align the origin of each object to its geometry (because for some reason it was misaligned) go in Edit mode, select a face and make its normal the new transform orientation:

Then in Object mode activate the Transform Affect Only Origins option:

And finally, Object > Transform > Align to Transform Orientation:

Thank you very much )))
it's great solution

authors: Александр Давыдов


text:
Why does remeshing punch a bunch of holes in my model?
I'm currently working on a model I made in the 'modeling' tab, and went over to sculpting to sculpt it. When I did I couldn't actually make any direct modifications to it, but I (think I) found a way around that via remeshing. Unfortunately when I remeshed the model, it punched a thousand giant holes into it and I've been desperately attempting to patch all of them manually after my attempt to Generate>Solidify didn't work to help clean the mesh up. Any ideas on what I could do to remesh or fix this quickly? Link below is to a google drive dump of my model.
https://drive.google.com/file/d/1xZOL8XeZgprLt1A7rgPtJXzbQgOuXjxS/view?usp=sharing

Reduce the number of subdivisions on your modifier from 5 to 2. Apply both modifiers. Use Remesh under Object Data properties (underlined below) and do a Voxel Remesh with a smallest voxel size of 0.05 (any smaller and you risk using up all your memory and crashing blender - so save a backup first regardless) - you don't need to go that small, you can stick with the default value if you like. Don't forget to hit the Voxel Remesh button when you're all set up. End result is like this:


text:
How do I make the eyelashes follow the rig?
I joined the eyelashes to mesh to have them blink and had hope it would follow the rig when I rotate the head but sadly could not do it and unsure what can be done here to fix this.
What I did was:
I added shape keys to them after I had joined them to the mesh which is the body and I'm unsure if that was wise because I never parented them to the bones beforehand and wonder if that could part of the reason why I'm having this problem. I really don't know what to do here other than backtrack but not knowing how to do it in the first place would probably not go so well. What can I do?

Here's the blender upload file:
https://workupload.com/file/XK5Tz5FBENf

To parent the eyelashes to the head bone (spine.006), select the eyelashes, go to pose mode, select the head bone, press Ctrl+P, this will parent the eyelashes to the spine.006.

Little late on response I know but thank you so much! This helped!


text:
How can I make eyes and eyelids follow the rig
After generating a rig and aligning it and parenting to automatic weight paints I've run into a couple of issues. However I'm unsure if this is a weight problem that automatic weight paints can't solve or a parenting problem I tried weight painting the eyeballs and eyelids myself but no results so I can't seem to get it follow the rig when I rotate the head. Is there anything I can do about this? What am I doing wrong?
Here's the file:
https://workupload.com/file/HyKmvezGskS

It looks like you have extra vertex groups eyes, if removed they will work correctly.
You're using rigify for your character and parented the eyes with automatic weights, they are usually parented to MCH.Eye bones.
For the eyelids you need to hide every part of the mesh except them, then you choose the head bone (DEF-spine.006) and press Ctrl+x to set weight.
I recommend removing all vertex groups and weights that you don't need, such as body and clothing hair weights. There are over 1.6 million polygons in your file, vertex groups can make it work slower.
You have a hair system there, this could be the cause of the lags.
(Also you can delete a few armature modifiers)
Hope this helps, this was my first answer on Stack Exchange.

WOW! Well, that would explain why I have lag so much when I do anything. Feels so much better now also I didn't know made so many modifiers. Explains a lot. (recently learned that too can cause lag on my research) Thank you!

@William
Rigify can generate the rig faster by excluding the face bones if it takes too long.
A custom face rig can be created with a few bones and the Rigify face can be deleted. The eyes can be rigged with a damped track bone constraint.
Please mark this answer as correct if it solved your problem, so others can find it too.

Right. My bad still learning how to use this site features. So in short I can delete some bones to make a faster generating rig and then create less bones that can help control the face so that it doesn't also clutter my screen. Good to know. (I was too afraid to delete much of anything without knowing first if it would mess up something else and make it unusable.) Ty

Yeah, my experience with Rigify was sitting and trying to figure out what it doesn't like about leg bones. The pelvis bones were connected incorrectly.
Now, I'm trying to create a fully custom IK rig without Rigify. That's even more challenging.
You can switch to Blender 4.0, rigging is much easier there.
CGdive has some really helpful tutorials on rigging.
There is a playlist on his channel: Rigify 4.0


text:
How do I fix an upper arm and shoulder not bending correctly?
I'm not very sure how this happened but I assume this issues started when model wasn't in a T pose before I generated rig. When I tried to rotate my upper arm bone on the right shoulder to put it in a T pose this happened.
What I tried to do to fix it?
I tried weight painting it myself to see if that would fix but no change happened, I tried mirror weights, but it didn't mirror correctly I assume because it mentioned the vertices count error failed, so I tried merges all the vertices to see if that did anything to help with that but sadly did not. I would delete one side then mirror but afraid that would interfere with my shape keys. (Tried to do some research on this but unsure what problem I can even describe could match this.)

The file for it is here:
https://workupload.com/file/4gTJzAJVLA4
Is there a way to fix this?

Hello, if you think that the right part works, why don't you simply mirror it?

Like deleting the left arm and mirror the right arm? I thought about that moments ago but thought there was a better way. than that. (That might actually be the simplest way)

Problem. I tried but the arm doesn't line up correctly with the body and when I move it the other arms moves with it. When I go into object mode the arm ends up disappearing as well.

Yes because you have shapekeys, your rigging is a bit of a mess actually, your armature is not even symmetrical, you should clean the whole thing, keep the part that is correct, mirror it, symmetrize the armature, etc

As I feared. I made messes along the way. That will probably do then. Sadly, trying to do all that alongside keeping the right parts is getting harder as I go. (Might be because I don't know where to start or how to go about fixing the problems) Starting to wonder if restarting while taking into account would be easier lets see what I can do about it.. At least I know why it's messing up so much. This old project needs a remodel and update. THANK YOU!


text:
How do I stop the cloth from moving too much upward and deforming so much that it tears apart?
I been messing with cloth simulations for a few months now and I just can't get it to do much of what I actually want it to do. I tried experimenting with the stiffness while keeping the damping low then messing with gravity, but things got worse as time went on. For this I'm just trying to make the cloth move but not at a fast pace while still staying low not going upward than ripping apart or deforming. I also wonder if its because of the long simulation that's making it do that.
What am I doing wrong here? I'm unsure what can be done to make the desired effect of character walking and the trench coat just falling along.
Blender file here
https://workupload.com/file/kFyrVquynTa

cloth simulation relies heavily on good topology. Yours...

isn't suitable. You should try to make quads with somehow equal width and height so that Blender can calculate the simulation easily. Also it shouldn't be too high poly.
If that still doesn't work, you can try to scale up everything by 10 or 50 which helps in most cases.

I see. It makes sense now this is really essential, yet somehow, I never even thought about this. Curious question though how do I make all quads same with widths and height?

i would recommend watching some cloth tutorials like this https://youtu.be/W9GDWKzf1mc?si=F18gO7BBgmha4LOK and rebuild them first, if successful, you can build your own. Don't believe that you know how to do it by just watching.....it is a huge difference between watching and doing it yourself.

Thank you. I knew eventually I'd have to learn sewing so now is a good time as ever. Restarting on the trench coat would be better than skipping out on learning something new that will help me far more in the long run.

you are welcome and....right!


text:
Geo Nodes - Distribute points on faces
Heyo ya'all!
I've been trying to wrap my head around a concept.
Is there a way to distrubute points on the faces of an animated mesh, without some disappearing/appearing due to the mesh transformation?
For context the mesh is also generated and animated via geometry nodes.
The concept is simple:

Generate a box
Use said box as points to distribute spheres inside of it
Animate said sphere's scale
Merge everything together to create a "blob-like" appearance (mesh to volume -> volume to mesh)

However now I wanted to add some spikes to this
These shouldn't be "remeshed" so my idea was to distribute them along the faces of the blob and then join them afterwards.
However since the blob is animated the "Distrubute Points on Faces" node causes the glitching.
Here's the current node tree:

And the result of the geo nodes without the spikes so far:

Any help is highly appreciated!
Cheers!

The problem with remesh is that you have absolutely no consistency between frames. In case of deformations, you can save original positions, or use a constant UV Map, like I do here:
Geometry nodes - Disappearing points on deforming surface
However, you still can have some consistency: you can use a simulation zone, to store your original positions, and you can move your points to the nearest surface, instead of respawning them. I additionally move the points towards their original, first spot, so that they maintain their position; it's still possible that some point will be captured in some kind of pocket, and the animation could be such, that traveling is possible only in one direction, and so the point will never return...

That did it!
Thank you so much man, there's no way I would have came up with that solution on my own ^^
I'd have a follow up question on this however, maybe you'll have an idea.
So now I can position the spikes with a rather consistent location that only moves them a little bit, how would one align them to the normals of the remeshed object tho?
Also once that is done is there a way to make them ignore all follow up transformation of the mesh? I'm thinking that if they follow the normals of the mesh through it's transformation it'll just lead to them twitching too much.

@Normaly sample nearest surface to get a normal. This gets a face normal, however, not a smooth normal. You can calculate a smooth normal based on the distances to the vertices of the face (you can make it easier on you by triangulating the mesh, then it's just 3 verts per face always). The twitching should be minimal with this approach but in the end if the surface changes rapidly, so too everything relying on the surface.

Geo nodes are finally starting to click with me more and more, figured out the first part of this approach based on your reply! However how would one calculate the smooth normal? As in what nodes would be used for that?
If it's easier just direct me towards some documentation or resources so I can try and figure it out on my own. But I feel like I'm almost at the finish line here

I'm not sure about the exact algorithm Blender uses, but to get rid of "twitching", just weighted average based on distances is enough (well, it would be if the remesher was smooth, and it isn't). And if you want to get rid of twitching entirely, simulate the rotation change...


text:
Black spots on my Roblox rig (Roblox Starter Pack Rigs)
Okay, so I downloaded the Roblox starter rigs pack and when I select a rig it appears with some black things in the material preview and render view. In Cycles I don’t see the black things but in EEVE I do. I tried to load it on the 3.5 and 4.0 and it stills the same. Im using a Mac. Thanks!


text:
Moving an image with Video Editor expressions frame offset as a constant
I want to move a 2D image at a constant speed using the frame count in the video editor.
I also need to subtract the images self height so it starts from the top.
Pseudocode of an expression into the image strips transform y position:
self.y.location = -(self.imageresolution.y * 0.5) + videoeditorframecount
Halving down the resolution so it would be at the top because the reference point is the center and adding frame count to represent how far the image has scrolled with time.
Yes this requires variable video lengths with variable image heights.
The most important is constant speed.
Also another thing I need to know is what other internal hidden variables there are available in the expressions line. Or is this a completely wrong angle of approach? In regards of which I thought if there is a method to extrapolate the position based on 2 keyframes on the graph editor.
The entire reason I'm scooting over to video editor is that rendering an image sequence with real lighting takes a long time. I'm hoping it's faster to render a big image and then move it and render in an editor. I'm open to any other options and currently starting with the video editor to see if it's faster in total.


text:
Trying to apply array modifier to armature
I'm trying to create drawers dynamically and place them in a Desk. I have created a drawer instance with an armature, as I want to add some contraints to it to allow it to open only in X certain amount. I'm creating this in a separate blender folder so I can import it as an asset from anywhere. This is the desk:
And I would like to add this drawer's aramatures to be child from the main desk2 armature and add then a constraint to them.
I have tried using array modifiers, but does not work as the modifiers only apply to the mesh, not to the armature so only the drawers are being populated
I have tried to parent the Drawer Armature that contains the mesh from another empty mesh to use instancing, but because the mesh I'm creating is a plane, and it does not have Height, drawers are not being populated vertically.
I would like ideally to reach a solution similar to another desk I built manually
But currently I'm finding it really difficult to do it with array modifers or grid/empty object instancing. Any ideas how this should be done? Thanks!

Hello, what kind of animation do you plan to create exactly?

Not planning to add any animation. But when I export that desk asset, I would like to open certain random drawers to fit the scene as I want. Sometimes I might have all the drawers closed, sometimes I would like one to be half opened, that is why I want to add constraints to the bones, so the drawers can only open certain amount. But would like to do this in an automated fashion if possible, so all these bones are added automatically using the array modifier and parented to the main desk bone.

You could use a Limit Location constraint so that you can easily limit the drawer on X. You can't use the Array modifier because it doesn't create meshes or objects that you can individually manipulate, maybe simply create link-duplicated objects? Parenting each object to a bone would allow you to quickly reset them to their default pose, you could also create a pose library?

The limit location constraint is not a problem, what I'm wondering is how can I automatically using the array modifier or some other way, to create 3X5 Drawers with their bones and limit constraints linked as a parent to the main desk bone.

Create a drawer object, link-duplicate it (but it could also be part of the furniture object as a simple mesh), create an armature, align each bone to each drawer...

I think you're getting confused between the the Object constraint modifier and the Bone constraint modifier. You won't actually need an armature or bones at all if you aren't intending to animate the object.

I think I need both. I want to add a drawer with a bone with a constraint modifier, so the drawer can be opened or moved from an axis only. That would be simple to do if I only had one drawer, but I have 15. And I don't want to go one by one binding bones to the parent desk bone (I want all the drawers to move if the parent boen is moved) so I thought the array modifier would help. but it is very challenging as well.

the Array modifier won't help a lot, you can use it if you want but you'll need to apply it at the end, and separate each drawer as separate objects if needed

I would like to do something like that, but if all the objects that I'm generating would be automatically parenting their drawer armature to the desk base armature would be great. Trying to do much manual work if it can be automated somehow. But using the array modifier doesn't work, as it leaves the drawer armature out, and I need it to open the drawers once I hypotetically be able to apply the modifier.

I'm afraid you need to do it manually, it won't take long


text:
Making mesh of ocean modifier into shape of circle
I've been trying to make my ocean mesh into the shape of a circle. The mesh itself started out as a circle I extruded. But once I put the ocean modifier on it, it makes it into the shape of a square.
I've looked online and tried to play around with how to make the ocean modifier into the shape of a circle. The most prevalent answer was to change the Geometry feature from "Generate" to "Displace". As you will see in my included screenshots, doing this turns my mesh transparent. (Some other ideas I've tried were using the boolean modifier with a circle plane and a sphere)
One comment suggested that I need enough geometry on it, which I went back to my circle plane and I subdivided it yet still got this result.
Any suggestions would be helpful! Thanks!

did you try a boolean modifier after ocean modifier which cuts it out?


text:
When exporting my video in blender there is this strange secondary text I cannot see in my viewport?
I am trying to export the video of the text on the (top picture) and it looks normal but when I go to render there is this secondary text (bottom picture) and is in the way of my render as it is covering my main text. I have no clue how to get rid of this! I cannot render my project. I appreciate anyone that helps me.

Text and Text.002 in the Outliner are hidden in the viewport (eye icon) but not in the render (camera icon). Click the camera icon for both objects and they should be hidden in the render as well.


text:
I imported an SVG file, and wanted to color individual parts of my logo, how can i disconnect two parts?
I imported a .svg file into blender, made it 3d, and now I would like to put two individual colors on the logo. The problem is that the two parts I want to be different colors are connected. How do I disconnect them to color individual parts (The red lines is where I want to disconnect them)

just select all the vertices of one part, then hit P -> selected
but...
you can also use another material on the same object by just adding another material, select that material, then select in edit mode the faces you wanna paint, and hit assign.

THhanks but when I hit P, it shows separate and not selected, and even if I color one of them, they all turn the same color.
Can you help me please?

if you select vertices (in edit mode of course) and hit p, this should appear: [1]: https://i.sstatic.net/RWSHG.png

Look, https://imgur.com/ewc9V4o

@Chris It is an imported SVG, so it's a curve object as long as it is not converted to a mesh (and the screenshot shows it is not). There you have not the same menu for separating parts. And you cannot assign different materials to different parts of a curve.

@GordonBrinkmann, So what do I do ?

@pax First of all convert the curve object to a mesh object, but how to give materials to different parts of an object etc. will be a completely new question... and actually I think when you do not know how to give materials to a mesh you should probably watch some beginner tutorials on materials, texturing etc.


text:
Can't See Color in Shading Viewport
When I go to the shading viewport, my objects are 2D grey (not white) even though the 'material viewport' tab is auto selected. Downloading the same Blender file, to another computer it works fine. My computer's specs are adequate and the drivers updated. Anybody have an idea what's up? thanks

Hello maybe it's a driver problem, what does it give if you come back to a previous one?

Hi @moonboots - sorry, not sure what you mean. Do you mean to try using a previous driver?

Yes that's it...........

Thanks - Actually I found someone with same problem in a three year old thread and using an earlier version of the driver was a fix for them so fingers crossed, I'll give that a try.

@moonboots - SUCCESS! I rolled back the drivers and all good - THANK YOU

Going to device manager, display adaptors, drivers, and clicking the option to 'roll back' the drivers to previous versions solved this problem. thank you @moonboots


text:
How to skip some frames when tracking a marker?
I have some footage with tracking markers, that I set to use the affine motion model. Sadly, one of the markers goes out of frame just ever so slightly. When tracking, of course, Blender loses the track as soon as this happens. However, literally three frames later the marker re-enters the frame. I'm trying to figure out how to get Blender to pick up the track again for that frame. That way, I can do the tracking manually for the three frames where the marker is partially out of frame.
The "easy" solution would be to let Blender track until this frame, then manually do the tracking for the three offending frames, and then let Blender pick up from there. However, this doesn't seem ideal, because this creates a new keyframe that Blender will track from for the remainder of the video, instead of using the same keyframe from before. Especially because it's an affine track, it's going to be hard to precisely line up the track to minimize error.
What I think I need is a way to somehow just tell Blender somehow to "skip" the three offending frames and continue tracking. Or else, a way to tell Blender which keyframe to use as a base to track from. I cannot figure this out, either from clicking around in the UI, or from reading the manual... Is there any way to do this?

The last frame before the marker leaves the image

Three frames later, the marker is back. It barely moved, so Blender's tracking should be able to find it... if only I could tell Blender to skip the three frames and keep tracking

Hello and welcome to BSE. Just select the marker and manually move it with G to the position where u expect the marker to be then you can continue tracking. It's all manual whenever blender loses track or incorrectly tracks.

Blender will not remember. The algo it uses is to continue tracking whatever was on the previous tracked marking. And since you lose tracking on the 3 frames you have to specify where the "previous" marking is so it can continue.

So if I understand correctly, there is no way to move a marker with G/R/S and not mark that frame as a keyframe it should track from?

i'm not sure what you mean, maybe can you add more screenshots of the issue?


text:
how to make uv sphere with different colors in in like this
how do you make colours inside the UV sphere? Like red and dark inside it

Hi. Please use a title that matches the content of the question. It should be descriptive but succinct, unique and identifying, summarizing the issue so that anyone searching for a similar problem is likely to find it. Remove anything superfluous, avoid using words like "this", "help with", "issue" or "question about", instead describe what "it" is. Remember, your title is the first thing potential visitors see, answers you get depend heavily on how insightful it is. See What is the problem of asking “How do I do this?"

It looks like a glass shader ...


text:
Walk navigation panning controls?
I  have a PS4 gamepad that I am mapping to the controls for the Blender walk navigation to control my camera. This is basically very similar to what is happening in this tutorial (https://www.youtube.com/watch?v=7qgY5ZvA6ZY).
I successfully managed to map the W, A, S, D, E, and Q keys. I also tried mapping the movement of the mouse to control how the camera pans. Attaching a screenshot of the options I have on the app I'm using to map the keys below (Gamepad Mapper, OS Ventura). I have experimented with both Mouse Cursor and Mouse Scroll, and although the actual cursors moves outside Blender, the view does not follow it in Walk Navigation.
Does anyone know what Blender would consider the right mouse/key combination to pan the camera? or have any other ideas?
I suppose I could always use Fly Navigation instead, but the movement doesn't feel as natural to me.


text:
How to apply FBX animation on a rigged character?
I bought an animation pack (GunFu Pistol Attacks) and I only got weird point cloud fbx files and not an actual rig/skeleton.
How can I apply this animation on a rigged character in blender?
Currently the rigged character has a different skeleton than the fbx file.


text:
Blend curves in Blender like Illustrator does, but with more steps inbetween
I found here this interesting solution.
That's great node solution! However, I would like to ask you if it's possible to push that even further. What I mean is that here we have only 2 curve shapes initially, but waht if I would like to have more, like 3 or 4 or more steps? I tried to mix in one more, but it doesn't make a trick. Ideally I would like to have 1 on the bottom, 2nd one a bit higher and moved to the left for instance, 3rd step goes again higher and to another side and so on if I would like to have mulitple steps in between, do you undestand what I mean? The so to say tower of curves goes to different directions dependeing on where 3rd one or more are located in between.
I don't know how to mention Robin, but I hope someone else could answer.

You can mention @RobinBetts like this ;)


text:
Noise along certain direction of each instance
I have this simple node setup of a circle with 32 points and curve line instances on those points, where each one goes away perpendicularly from circle's center. We can a simple sun silhouette, if you like.
For each curvle line I've set 30 points with help of "resample curve" node to have some resolution for the next step, where I want to apply some randomness to each line in a way it become wavy/noisy by adding a "set position node" in combination with "Noise texture" node.
The problem is I don't know how to apply this effect along each curve normal. As you can see these lines go in defferent direction, and I want to use those exact directions. But, for example, when I try to apply noise along Y axis it affects all of them in a way thhat when noise getting closer to Y axis the curve lines there (top one and bottom one - highlighted in red) become just straight. And whe I apply it to both axis Y and X, then 45 degrees area (highlighted in red on the second screenshot) curves are getting straight.
I hope you got the idea, I just want to get the wavy/noise effect to each line, no matter what direction it goes. I think I understand why this undesirable effect happens, but I just don't know how wto set it up correctly.


text:
Child object not rotating or turning (only moving) after parenting to a bone on MC Character Rig (Endertainer Rig Remastered v1.2)
Okay, so I'm quite new to blender and I'm essentially just getting started with trying to learn everything about the program, and I've encountered my first problem that I have yet to find an answer for or fix...
While trying to learn how to make a Minecraft animation using the rig listed in the title, I wanted to provide my character with a sword for a practice animation. I know in order to make the sword move with the arm, I have to parent the sword to the armature bone (if I'm saying that right) by selecting the arm in pose mode, then going to object mode, selecting the sword and then shift clicking the arm, and using ctrl+p - Bone (unless it's click the sword then shift click the arm in object mode then go to pose mode and clicking on the hand/arm bone, I've tried both bones and both orders).
I can successfully get the sword to parent to the bone and move with the arm... but that's all it does, it'll move, but the sword won't turn or rotate with the hand

Does anyone know how I can fix this? It seems to be an issue with just this rig because I tried the BPS Rig V.4 and it worked like a charm, but I'd prefer to use the Endertainer Rig.

I hope I've been descriptive enough...

You are parenting the sword to the IK bone and not to the FK.
Hand IK bone has no rotation so the sword can't copy it.
That could be the reason, but I can't help you without the .blend file.


text:
Make #frame active only in some frames
I made a gear chain and I used #frame/7 to make it rotate continously, and I wanted to know if there is a way to make it start and stop after specific frames and also if there is a way to ease in and out the start and end of the driver.

The problem you don't realize is that if you disable a driver on a given frame, the evaluated value won't stay on the last value evaluated by the driver. See the comments (For an easy answer) and Stef's answers (For a mathematical approach) here: https://blender.stackexchange.com/q/306627/60486

you can use if-statements in drivers. So to make it start and stop you can e.g. do this:
frame/20 if frame > 10 and frame < 50 else 50/20

If the if statement is true, it executes the command before the if, here: "frame/20".
The else statement is 50/20, because if the gear stops rotating, it is frame 50 and then it should "stay" in the rotation position.
Note: if you really wanna start and stop your gear multiple times, i would recommend using keyframes.
for easing i am using this formula:
-(Math.cos(Math.PI * x) - 1) / 2

so if you now use this and use it for these values:
frame start: 10
frame end: 50
you can use this as a driver:
50/20 if frame > 50 else 50/20*(cos(pi*((frame-10)/40))-1)/(-2) if frame > 10 else 0

and you will get:


text:
Blender Object Mode Transform Dimensions Vs. Edit mode dimensions
My object is square with respect to X and Y. In object mode, I  changed the X and Y dimensions in the Transform drop down. I made X and Y smaller by two millimeters. When I went back into edit mode and checked the X and Y measurements of my object’s square base, the measurements were the same as before I changed the dimensions.
I need to make the measurements I see in edit mode smaller by 2mm. I expected them to change when I lowered the dimensions.
When I change the dimensions from the transform menu, what is that actually changing? Does it affect measurements in edit mode? Or is it just changing the scale of the object?

Hi. In Object mode you need to press Ctrl->A and click Scale to reset the scale to 1. The scale was changed when you changed the dimensions in the dropdown.


text:
How to treat a group of vertices as one in Sculpt mode?
I am very new to Blender, and very much learning.
As of right now, to get a feel for how Blender works, I just use premade models, that I try to edit (the base figure from DAZ Studio, namely).
I have figured out how to use masks to avoid accidentally modifying parts I don't want to, like teeth or eyes. The problem is, I consistently have troubles with "lumpy" areas (let's call those "moles").
To be more precise:
Here's a plane with a "mole".
When trying to sculpt the area that contains that mole, the mole itself distorts. It usually ends up too wide, or flattened, or fusing weirdly into the rest of the mesh. Like so:
Which is not what I want. I'd like that mole to keep (at least roughly) the same shape and diameter, regardless of what happens to the surface it is on. So of course, I tried using a mask, but then a new problem arises:
All of the vertices of the mole are locked in space, and therefore do not end up where they belong (on the surface of the modified plane).
My understanding is I am looking for a way to make a group of vertices behave as one, so that all vertices in that group move in space together, but never in relation to one another. That is to say, I'd like all of the mole to move as a whole when I grab it, to be displaced but not distorted when I sculpt its surroundings, and so on. How would that be achieved? Or perhaps is there another method that I am not aware of to avoid that issue?
I should also mention that I usually sculpt models exported from DAZ to export them back and create a morphs, which means that it is quite essential whatever solution I use does not modify the topology of the figure.
Thank you very much in advance.


text:
Finding angle between two objects as seen from an axis
Suppose I have two cylinder objects that vary in Z-Location. Like this

(Note: they move thanks to python-scripting)
Now when seen from the top z-axis it looks like this

Although they aren't overlaid on top of each other, is it possible to find the angle of their rotation. Like

Like virtually overlay the first cylinder on top of the second cylinder and find the angles as seen from top z-axis

Translation doesn't affect rotation, so you should be able to directly compare the obj.rotation properties


text:
Creating a line effect that follows two dynamic spheres
I have two spheres that are moving in the space using python scripting. How can I create a line like effect between the spheres? I don't want to snap a cylinder to the center of a sphere as the positions of the spheres may vary and cylinder height may come up short. The effect I'm referring to is similar to the line-renderer effect from unity. Is it possible in blender?

If I'm not confused, it's very easily done through the GN


text:
What tool can generate this kind of illustrations?
I am writing my thesis about 3D modelling, and I found these illustrations in another thesis. I would like to make something similar.
I can already draw the "egg" shapes in Blender, but this "mesh" and the blue and red details are still a mystery to me. For the mesh, I tried the wireframe modifier, but that doesn't seem to be right for many reasons (it has a thickness, and I couldn't find the dotted option).
Obviously a beginner here, not even sure if this was made in Blender. Any tips on how to do it in Blender (or where this could have been drawn) will be welcomed. I'm unfamiliar with the terms, so the nomenclature for the dotted lines and the blue/red/gray areas would also be helpful.

Hello, Lucas.. welcome. To kick you off in the right direction I would suggest a thorough reading of either the 'Freestyle' or 'Line Art' section of the user manual, and some experimentation. 'Freestyle' might be the route that  presents you with less widely distributed settings, since it does not involve the creation of independent geometry. That may be sufficient to answer this, (perhaps too general for Blender SE?) question.

If the above suggestion does work for you, then perhaps this post should be replaced with some more specific questions, when/if you encounter difficulties with it. to help you up that particular learning-curve. See, for example: https://blender.stackexchange.com/a/156364/35559 .. incomplete from your POV .. but the sort of thing.

Are the blue and red "details" based on equations?

@RickT No, just a generic area. The image is about contact mechanics. So these painted areas are general contact surfaces.

Hi. Please use a title that matches the content of the question. It should be descriptive but succinct, unique and identifying, summarizing the issue so that anyone searching for a similar problem is likely to find it. Remove anything superfluous, avoid using words like "this", "help with", "issue" or "question about", instead describe what "it" is. Remember, your title is the first thing potential visitors see, answers you get depend heavily on how insightful it is. See What is the problem of asking “How do I do this?"

Here is way other than freestyle edge to make this kind of illustration. I used a mix of geometry nodes and blender modifiers and got this result
I will link the file at the end of the post

The sphere's dots and outline are made with geometry nodes
The outline is just the sphere slightly offseted with its normals flipped. The dots are the sphere's edges, that I converted into curves and instanced cubes along these curves. The material needs to have backface culling enabled for the outline to work properly
Here is the node setup :

You can also choose to use sharp edges to control where to put the doted lines

For the red part, you can used a plane, subdivide it and project on the mesh target. I also added a solidify modifier so the backface is visible as well and not occluded by the mesh target.
If you use the outline, set the shrinkwrap modifier snap mode to Above Surface and set the offset to the same value you used for the outline. Then, for the solidify modifier, change the offset to 0 and give it a bit of thickness

For the materials, here is what I used
The sphere material:

The black line material :

The red part material :

Here is the file. Please use blender 4.1 or above for it to work properly

Freestyle in Blender is quite complex and (for me at least) a bit frustrating sometimes because you just do not seem to get lines where you want them :D But to give you a quick idea how you can get something similar like your reference:
Slightly simpler things are not that hard to achieve especially when using the option Mark Freestyle Edge in Edit Mode. For the following example I used three different Freestyle Line Sets, one for the thick external contour, one for the dashed lines of the visible wireframe edges and the last for the thinner, fainter dashed lines of the hidden wireframe:

The material has some alpha transparency to get a bit of that semi-transparent look of your reference. Note however that even the hidden dashed lines will always be overlaid, the material transparency is not necessary for them to be visible.
Also note, although there is a setting where you can have lines on material boundaries, it is not possible to get black outlines along these painted color patches. Freestyle does not detect contours within textures.
For the dashed lines of the wireframe I simply selected all edges in Edit Mode, then Ctrl+E > Mark Freestyle Edge. This way all edges of the base mesh are showing, but all the additional smoothing edges of the Subdivision Surface modifier I put on the object are not visible.
To enable Freestyle, check the option in the Render Properties tab, then you can edit and add line sets in the View Layer Properties tab. The main settings I changed for the three line sets are (by the way lines will be overlaid with the top most line set in front down to the bottom line set in the background):

contour:
Visibility Type > Visible
Edge Type > External Contour
Freestyle Thickness > Base Thickness > 10

dashed line:
Visibility Type > Visible
Edge Type > Edge Mark
Freestyle Strokes > Dashed Line > Dash 1/Gap 1 > 3
Freestyle Thickness > Base Thickness > 3

dashed line hidden:
Visibility Type > Hidden
Edge Type > Edge Mark
Freestyle Strokes > Dashed Line > Dash 1/Gap 1 > 2
Freestyle Alpha > Base Transparency > 0.75
Freestyle Thickness > Base Thickness > 2

The good thing with marking edges as freestyle edges is, no matter how dense a mesh is, you can decide which edges you want to see in a wireframe rendering, like in the example below where all spheres have the same resolution, but different wireframes:

Really appreciated the detailed steps.

You could project an image onto the surface of your object, the image needs to be on transparent background (PNG format) and you'll plug the Alpha output of the Image Texture node into the Alpha input of the Principled BSDF. The inconvenient of this method is that you'll need to change the thickness of the lines if you don't want them to get thinner towards the poles:

0.5, rounded up :)   IMO a  good option for the filled ellipse, but some sort of 2D line art better for the wireframe/black line?

@Robin Betts Sure, it's far from perfect but it may be simpler than freestyle and co

I think with the introduction of the edge marks in 3.0 it has become quite easy to use Freestyle for basic wireframe rendering... a lot easier then using workarounds with the Wireframe modifier (unless you want geometry on the wireframe) or borders on reset UVs which I used previously.

@Gordon Brinkmann oh ok great, i haven't studied it yet


text:
Cavity shading in different model sizes problem
I have a trouble with cavity shading in viewport. I really like using it, but I notice it doesn't work as I would expect with bigger objects.
Is there a way to make it more visible keeping the desired objects size too?
Here is an example of object with length of 26mm, the valleys inside the windows are properly visible. You can clearly see where the edges ends and valleys starts.

Here is the same house but 10x bigger, notice that the edges next to windows are not visible at all.

How can I set it to display it better without changing the size of actual model?
Best,
Piotrek

Those are as far as I dependent on the distance you view the edges at, rather than the size of the model itself. Obviously larger models have to be viewed from further apart, hence why they seem to be less visible. Maybe play with the Distance setting inside the Gear button next to the Cavity settings, but those are prone to produce banding artifacts


text:
How to model this specific flat part and wrap it around a cylinder
I'm wondering what should be the best approach for modeling this specific part:
I was thinking about drawing it in 2D curves then adding some thickness and bending it around the cylinder but it bends quite tricky and I'm not sure how to do it in a best way. Maybe the is some simpler way?
thanks,
Piotrek

Hi. Please use a title that matches the content of the question. It should be descriptive but succinct, unique and identifying, summarizing the issue so that anyone searching for a similar problem is likely to find it. Remove anything superfluous, avoid using words like "this", "help with", "issue" or "question about", instead describe what "it" is. Remember, your title is the first thing potential visitors see, answers you get depend heavily on how insightful it is. See What is the problem of asking “How do I do this?"

You can begin with a cylinder, cut its bottom:

Give it a Mirror modifier, extrude the bottom:

Bevel this edge:

Add some edge loops:

Cut the holes:

Give it a Solidify modifier, a Bevel then a Subdivision Surface:

To do the hole, select 2 faces:

Inset with i:

Enable the LoopTools addon and RMB > LoopTools > Circle:

Then remove the faces to cut off the hole:

Nice! Thanks for the advise I'll try that, I'm only worrying how to properly bend the "wings" of this object to be accurate

Hey, I was also wondering how to cut out those hexagonal holes you did? Did you insert face and use some loop tools for that? https://i.sstatic.net/jW03q.jpg

@Piotrek B. I've editd my answer to explain more in detail

Thank you soo much for your help! Now I get it!


text:
Unable to read depth from buffer when offscreen rendering
I'm trying to read the depth buffer from a frame buffer during offscreen rendering using the gpu.types.GPUFrameBuffer.read_depth() function from the gpu module. No matter what I do, all values in the buffer are always 0. I found this answer, which works for getting the depth buffer of the viewport. I tried to adapt it to offscreen rendering, but with no luck. Here is the relevant code snipped of my script that does the rendering. I am using a custom shader to render the currently selected object.
offscreen = gpu.types.GPUOffScreen(DIM, DIM)
with offscreen.bind():
    gpu.state.depth_mask_set(True)
    gpu.state.depth_test_set('LESS')
    framebuffer = gpu.state.active_framebuffer_get()

    batch.draw(shader)
    depth_buffer = framebuffer.read_depth(0, 0, DIM, DIM)
    # have to reset these because I run into https://projects.blender.org/blender/blender/issues/98486
    gpu.state.depth_mask_set(False)
    gpu.state.depth_test_set('NONE')

offscreen.free()

Interestingly, writing to the color buffer by not setting depth mask and depth test and using framebuffer.read_color() like this works:
offscreen = gpu.types.GPUOffScreen(DIM, DIM)
with offscreen.bind():
    framebuffer = gpu.state.active_framebuffer_get()

    batch.draw(shader)
    color_buffer = framebuffer.read_color(0, 0, DIM, DIM, 4, 0, 'FLOAT')

offscreen.free()

Is reading the depth buffer not supported when rendering offscreen or am I missing something here? I am very new to blender, so this might very well be a mistake on my side.
For reference, here is the entire script
import bpy
import gpu
import numpy as np
from gpu_extras.batch import batch_for_shader

def get_world_mesh_data(o):
    """
    Returns the meshes of all passed objects combined.

    Parameters
    ----------
    obs : Iterable[bpy_types.Object]
        Objects to combine. Fails if non-mesh object is passed.

    Returns
    -------
    verts : numpy.ndarray
        Nx3 float array of XYZ vertex coordinates in world space
    indcs : numpy.ndarray
        Nx3 int array of triangle indices
    info : list[tuple]
        Holds a tuple for each passed object. The first entry stores
        the index of the first element in 'verts' belonging to the
        corresponding object, the second entry the same for 'indcs'.
    """
    # Accumulate vertex and triangle counts of all passed objects to
    # later allocate the right amount of memory
    mesh = o.data
    mesh.calc_loop_triangles()

    # Initialize joined lists
    verts = np.empty(len(mesh.vertices) * 3, dtype=np.float32)
    indcs = np.empty(len(mesh.loop_triangles) * 3, dtype=np.int32)
    vstart = 0
    istart = 0

    # Calculate object's slice in combined list
    mesh = o.data
    vend = vstart + len(mesh.vertices) * 3
    iend = istart + len(mesh.loop_triangles) * 3
    vslice = verts[vstart:vend]
    islice = indcs[istart:iend]

    # Get vertex coordinates of current object
    mesh.vertices.foreach_get('co', vslice)
    # Transform vertices to world space
    verts[vstart:vend] = transf_pts(
        o.matrix_world,
        vslice.reshape(-1, 3),
        ).ravel()

    # Get triangle indices of current object
    mesh.loop_triangles.foreach_get('vertices', islice)

    vstart = vend
    istart = iend

    verts.shape = (-1, 3)
    indcs.shape = (-1, 3)
    return verts, indcs

def transf_pts(mat, pts):
    """
    Apply a transformation matrix to every point in a list.

    Parameters
    ----------
    mat : Iterable
        4x4 transformation matrix to apply to every point
    pts : Iterable
        List of 3D points

    Returns
    -------
    pts : numpy.ndarray
        Copy of 'pts' with transformed coordinates
    """
    # blender.stackexchange.com/a/139513
    # return np.einsum('ij,aj->ai', mat, homog_vecs(pts))[:, :-1]
    return (np.asanyarray(mat) @ append_one(pts).T).T[:, :3]

def append_one(pts):
    """
    Append a coordinate equal to one to every vector.

    Parameters
    ----------
    pts : Iterable
        Points to append to.

    Returns
    -------
    hpts : numpy.ndarray
        Copy of 'pts' with appended coordinates

    Examples
    --------
    >>> append_one([[0, 1, 2], [3, 4, 5]])
    array([[0, 1, 2, 1], [3, 4, 5, 1]])
    """
    vs = np.asanyarray(pts)
    hpts = np.ones(np.add(vs.shape, (0, 1)), dtype=vs.dtype)
    hpts[:, :-1] = vs
    return hpts

DIM = 512
COLOR_IMG_NAME = "Color"
DEPTH_IMAGE_NAME = "Depth"

# switch to edit mode
bpy.ops.object.mode_set(mode='EDIT')

# Construct depthpass shader
shader = gpu.types.GPUShader(
    vertexcode='''
    in vec3 pos;
    void main() {
        gl_Position = vec4(pos, 1);
    }''',
    fragcode='''
    out vec4 col;
    void main() {
        col = vec4(0, 0, 1, 1);
    }'''
)
shader.bind()

# Create batch from all objects in edit mode
verts, indcs = get_world_mesh_data(bpy.context.active_object)

batch = batch_for_shader(
    shader, 'TRIS',
    {"pos": verts},
    indices=indcs,
)

offscreen = gpu.types.GPUOffScreen(DIM, DIM)
with offscreen.bind():
    gpu.state.depth_mask_set(True)
    gpu.state.depth_test_set('LESS')
    framebuffer = gpu.state.active_framebuffer_get()

    batch.draw(shader)
    depth_buffer = framebuffer.read_depth(0, 0, DIM, DIM)
    # have to reset these because I run into https://projects.blender.org/blender/blender/issues/98486
    gpu.state.depth_mask_set(False)
    gpu.state.depth_test_set('NONE')

offscreen.free()

Seems I simply forgot to clear the depth buffer before writing to it. This works:
offscreen = gpu.types.GPUOffScreen(DIM, DIM)
with offscreen.bind():
    gpu.state.depth_mask_set(True)
    gpu.state.depth_test_set('LESS')
    framebuffer = gpu.state.active_framebuffer_get()
    # This is the line I was missing
    framebuffer.clear(depth=1.0)

    batch.draw(shader)
    depth_buffer = framebuffer.read_depth(0, 0, DIM, DIM)
    # have to reset these because I run into https://projects.blender.org/blender/blender/issues/98486
    gpu.state.depth_mask_set(False)
    gpu.state.depth_test_set('NONE')

offscreen.free()


text:
Any way to deform one object around another on one edge only?
I'm new to Blender so I apologize if this is something that is either super easy or clearly impossible. I've tried looking for solutions and a couple have come close to what I want to accomplish, but it's not exactly what I want.
Here's what I want to do (I'll try to be as clear as possible). I have two separate objects:

I want to put the pyramid-like object onto the cylinder object in the direction of the arrow and have it appear as though both objects are actually one, per the previous screenshot. However, the two objects are completely different in terms of shape and angle so of course the bottom of the edges go through the top of the cylinder as seen below:

Now, that is the final position that I want the pyramid to be at and in most cases the clipping at the bottom would be fine. However, for my specific purposes I can't have clipping. So, I was wondering if it is possible in Blender to deform ONLY the bottom edges of the pyramid object so that they conform to the shape of the top part of that cylinder object?
I've tried a few different things based on my research, but nothing has achieved exactly what I want (probably for good reason since my use-case is so specific and in most other cases, the clipping would be fine). The closest I ever got was using a lattice and adding a shrinkwrap modifier to it. However, that ended up warping the whole object rather than just the bottom edges as seen below:

So, is what I am trying to do even possible without having to manually edit each vertex (which is what I first tried, but it's extremely tedious and I have many more objects I would need to do this too and I figured there must be a quicker way) and if so, how do I go about accomplishing it? If there is no way, then so be it. I just wanted to try saving some time and effort.
Also, just in case this matters, there is no animation or anything that will be applied to these objects. This will all purely be static.
Regardless of the outcome, thank you very much in advance for helping me out with this. If more details are required, I will be happy to provide them.

Is it possible to automatically and cleanly connect two meshes ?
As far as I know, no you can't really. Geometries that don't have the same amount of vertices (resolution if you prefer) is a complex topic, that I don't know well. Here is a quick overview of what I would suggest. Keep in mind nothing below is an absolute rule.
Does it matter to have clean geometry ?
Not always !

Do you need as much vertices ?
Your models are quite heavy on the vertex count. Why do you have multiple vertices on the same flat plane ? If you are working your mesh in Edit Mode, you should first simplify it as much as possible.
Do you intend on using Subdivision Surface ? Or will your models stay on a more low-poly style ? You should answer these questions for yourself first.
Do you need the two parts to be connected ?
In some cases, this doesn't matter at all (not an exhaustive list) :

No transparency/translucency
No intend of using Subdivision Surface
No intend of using Bevel

If one of these points is yes, you probably need to have them connected. Otherwise, you totally can just have the base of your triangular shape inside the other mesh.
Do you need to have clean geometry ?
If you are using modifier to further change the geometry, like Bevel or Subdivision Surface, a bad geometry is likely to create artifacts with this kind of modifiers.
You may still merge them at your own risk (meaning geometry could get ugly) with Boolean modifiers. Here is an example of Boolean modifier set to Union. On the left side are the 2 objects before applying the modifier, right side is after applying.

You may think this is clean geometry, but don't be fooled ! For exemple a face with more than 4 vertices is likely to generate artifacts when combining with other operations.
You could also apply a boolean operation, then tweak a little bit the mesh manually to be more clean. If you add a modifier (without applying it), you'll quickly see the regions that react badly and need rework.
To summarize by priority :

Let your meshes be separate
If not possible, then try a ugly way like Boolean operations
If not possible, then merge them by hand

I guess the first thing you have to do is make sure the bottom vertices of the cone object and top vertices of the cylinder object are equal. And then try to snap the vertices of  the first object into the second
i dont know  this is what you are asking  but hope it works


text:
Splitting a cube into 6 planes
This is toy example, but I'm fairly new to blender. I want to be able to programmatically take an object and decompose the faces into child objects. I suspect a simple example like a cube will let me debug any issues as I develop the script.

What do you mean by "child objects"?

You can do that with the following script:
import bpy
import bmesh

# get the object
o = bpy.context.object

# create a bmesh from object data
bm = bmesh.new()
bm.from_mesh(o.data)

# split using all edges
bmesh.ops.split_edges(bm, edges=bm.edges)

# put back bm data into object data
bm.to_mesh(o.data)
bm.free()

Documentation here.


text:
Grease pencil lineart modifier does not appear through the image plane
An image plane acts as a barrier for the grease pencil lineart modifier as if it's an actual plane. Is there a way for the lineart modifier to pass through flat planes? Could there be an add-on perhaps??
The outline on a rectangle is actually an emission material with a solidify modifier. I had to do these manually for each object, but it doesn't have the same effect as the lineart modifier that outlines particular creases & edges. We're planning to put animated image sequences for our thesis animation as a final render, which is the dilemma we're facing right now.
Thanks in advance.

Could you share your blend file with https://blend-exchange.com/ ? You can delete everything else but the few objects concerned by your issue (be sure to save a copy of your blend file before deleting anything).

For a quick fix, you can use the Occlusion parameter within the Line Art Modifier.
Within object properties of the grease pencil object, make sure the In Front parameter is checked off to activate the Occlusion parameter. Within the line art modifier, under Occlusion, select Level $1$.

Each level represents a layer of faces occluding/blocking the geometry you want to use to generate line art. Since you are only using a single image plane, only the first set of faces are obstructing the line art that you want to generate. Hence, why we would select Level $1$.
Personally, I would generate the occluded lines in a separate line art modifier stacked on the first so that it wouldn't interfere with the line art that has already generated.


text:
Is there a way to extract coordinates of a moving object
I'm doing material composition research in blender. I wanted to know if there was a way to exact the coordinates of a moving object. Right now it's giving me the initial starting coordinate of the object for all time points of the physics animation simulation. Anything helps!

What kind of physics is it?  Rigid body?  Softbody, cloth?

do you mean extract?

And the coordinates of the separate elements, or just the volume?

if it is a rigid body simulation, you can e.g. add a custom attribute, add a driver with these settings:

which gives you the x location.
Just add two more with y and z and you got the whole location.

if you wanna use animation nodes, it is a bit nicer and quicker:

especially if you wanna watch more objects, animation nodes is very supportive:

The numbers in the transform field isn't the final, "visual" transform.  It's the number after your manipulations, reading the f-curve, and any drivers.  But rigid body physics and constraints act on top of this number.
If we want the location at some particular point in the animation, just because we're curious about the location, we can use "apply visual transform" operation:

I'm using this from the ctrl-a menu.  It applies the visual transform to our actual transform fields.  If we don't want this to change our animations, we'd want to undo after reading that value.
If we want a complete description of the locations of our rigid bodies, we can use a rigid body "bake to keyframes" operation to write the (visual) transform of physics into keyframes:

This will replace our existing physics with keyframes-- once you do this, your physics will no longer respond to changes you make in the scene.  Because you won't have any physics on anything that you baked, just keyframes.
If we wanted to have something readable, live, that didn't alter the physics in any way, we'd want an object with "transform channel" type driver, which reads the visual transform of an object.  Chris's method works; my personal way would be like this:

That driver copies the world space X location of the cube onto the empty.  If I also copy the Y and Z, I have the full location of the cube.  The output of the driver shows up in the transform fields of the empty, as shown.
We could do something similar with a GN object-- GN nodes see visual transforms, so we could read them there, and output them in GN however we'd like.
And there's one final method, which is, maybe I don't need the actual numbers, I just need to put something there.  In which case, constraints will also target the visual transform of objects:

Just like physics objects, constrained objects can have their constraints "baked" to keyframes or have visually applied transforms.


text:
Tracking object data to excel (Location, Rotation, etc.) - Blender
I'm doing simulated motion tracking for my research. I am trying to calculate parameters such as velocity, motion path and trajectory, and tortuosity. However, I can't do any analysis with MATLAB or FIJI without the data from Blender. Currently, I’ve been baking meshes to keyframes and manually extracting coordinates data and transforms frame by frame, but it is really tedious, and I’m getting tired of it. I see there is a spreadsheet option but it doesn't give data I'm looking for. Is there a way to export location data from Blender into an Excel sheet? If so how? Thanks!
Attached is an example of what I need.


text:
How to bridge / connect two 2d shapes into one object
I would like to know if there is a way in blender to bridge between two 2d shapes to make a elongated 3d object that is essentially morphing it's cross section from one shape to another along its axis? In the pic below I try to picture what I would like to achieve by, for example, morphing between two letters to get this long "tube" that morphs in it's shape from one letter to another along it's axis. First the cross sections of desired object are shown and below is the sketch of 3d shape I want to make.
I tried messing around with bridge edges option, but it doesn't really work on shapes that are too different from each other like here.

Ctrl E > Bridge Edge Loops or LoopTools > Bridge should work, if not please share your mesh

Not sure what's the problem with LoopTools > Bridge or CtrlE > Bridge Edge Loops? Create your A and O, make sure that they have the same amount of inner and outer vertices:

Select the holes and right click > LoopTools > Bridge, set the amount of segments you want in the Operator Box:

Same thing for the outer edge loops:

Result:

Thank you! I think the problem was in different number of vertices between shapes in my project.

If you add some vertices to your edge loop you can use the LoopTools > Space to equally space the vertices, also LoopTools > Relax can be useful if you want to round the shape


text:
Rigid body object animation won't preview or play?
I have a simple rigid body animation that won't preview.
The diamond object docent react to the floor as it should when previewing.
The Other 2 objects in my scene do react correctly. My blender file can
be downloaded here
https://www.dropbox.com/s/jv0fseluf3gsnam/Diamond%20test.blend?dl=0
Can someone help with advice on this please?

Works for me with Blender 2.72a

Thanks but I also downloaded the latest version of Blender but it still dosent work.
The diamond object dosent react to the floor as it should when previewing.
It drops with gravity but it dosent spin or roll once it hits the ground.
It needs to tip over and roll similar to the Ico Sphere..

That's very odd. Looks like a bug to me, best to report it to the tracker. If you don't want to write a report, do you mind if I use your file to report it?

Run the simulation Alt-A until all frames have been displayed, this causes a real time bake. After that it should work fine.

I ended up replacing the diamond with a new one and it works now. Thanks for trying to help.

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


text:
grab brush not working properly
it should grab it and move it to the right

help
it is doing this instead of this i resetted the brush and still happening what do i can do?

Hello could you please share your file? https://blend-exchange.com/

my file is 31 mb , blender paste is 30mb how can i compress it? or similar

or use another platform like workupload

ok im on it https://workupload.com/file/KF7B3r2pfX5

workupload.com/file/KF7B3r2pfX5 tried with quad sphere, f9  , subdivision 2, extrude on z axis 1 time the 4 center faces of top , multires modifier to 3 , tried with round cube, still got the same error, resetted the brush and still getting the problem, its a class

Disable the Cavity option (not sure why it messes up your sculpt though):

you are a master, thank you, solved!!! and sent extra hamburguer for u, tnx

where do i report this bug to dev team?

I'm not sure this is a bug actually, but I don't understand why it acts like that, Cavity should allow the brush to act on the mesh except its cavities (concave areas)


text:
getting weird shaping using curves on objects

i am trying to do this shape but
is not working

how can i do?
https://blend-exchange.com/b/qk1BJ9SV

There are many issues to be solved in order to make it work:
Both curve and mesh objects have some rotation and non uniform scaling, you have to apply their rot and scale:
Select the curve in obj mode, press Ctrl A > Apply Rot and Scale.
Do the same for the mesh object.

Then both object should have the same origin location:
Select the mesh, press Shift S > Cursor to selected.
Right click on the curve obj > Set Origin > Origin to 3D cursor.
Then go to edit mode, select all control points, set their Mean Radius to 1, and their Mean Tilt to -90.

Now you can add the Array Modifier (toward Z), and the curve modifier (Deform Axis Z).


text:
Add object on mesh face, geometry node
I ask for help in solving my problem.
It is important for me to understand which nodes to use to calculate the location of an object's face and which bundle to transfer and indicate this position to another object.
No tutorial has been able to explain this task:

How to indicate to objects their specific position on a specific face of the cube. The objects in my case are text
What is the easiest way to solve the positioning problem in this case?

How do I see the solution (how I think it should work):

determine the ids or indexes of the faces of the object (cube)
use the attributes of a node of the set position type to indicate to another the bundle in which place he needs to be
profit

I am attaching various references.
The best solution will be saved in our hearts and on my personal page.
It is also planned to reuse the created cube in other industries, 3d printing, 3d milling, web game development (three.js or other)

simple example
https://youtu.be/rXqGQHX0dDk
https://youtu.be/vIaN2Rvac3U
https://youtu.be/-Plwyf8ocZA

(Using Blender 3.6.5)
To put one object relatively to one face of another object

1. The targetted face is identified by its Index. For the demo, an Input/Constant/Integer node is used.
2. The face centre coordinates are recovered from the receiving geometry using a Sample Index node set in Face domain and linked to a Position node.
3. The face normal coordinates are recovered from the receiving geometry using a Sample Index node set in Face domain and linked to a Normal node. This vector is converted to a rotation through an Align Euler to Vector  node. Its Axis property is set to Z because the text to put on the targetted face is generated in the (X,Y) plane. So the Z axis is perpendicular to the text to put. The Align Euler to Vector node is thus computing the rotation that is aligning the text normal to the face normal. As a consequence, the text is tangent to the face.
4. A Transform Geometry node is used to specify the position and the orientation of the text to put relatively to the receiving geometry.
5. The geometry of the text to put is generated by extrusion of a curve. Because the extrusion offset is negative, a Flip Faces node is required to properly specify inside vs outside.
6. Scaling, upside/down rotation, and fine positioning of the text to put are performed by an other Transform Geometry node, before putting its geometry on the targetted face.
7. It is to notice that the text to put is offset in Z direction by half the extrusion offset. This way it is embedded only by half its thickness inside the receiving geometry.
8. The text volume is removed from the receiving geometry by a Mesh Boolean node set to Difference operation.
Resources:
To put objects on each face of another object

1. The face centre coordinates are recovered from the receiving geometry using a Mesh to Points node set in Faces domain.
2. The face normal coordinates are recovered from the receiving geometry using a Capture Attribute node set in Face domain and linked to a Normal node. This vector is converted to a rotation through an Align Euler to Vector  node. Its Axis property is set to Z because the text to put on the targetted face is generated in the (X,Y) plane. So the Z axis is perpendicular to the text to put. The Align Euler to Vector node is thus computing the rotation that is aligning the text normal to the face normal. As a consequence, the text is tangent to the face.
3. An Instance on Points node is used to specify the position and the orientation of the text to put relatively to the receiving geometry.
4. The different texts to put are collected through a Geometry to Instance node and the face index, same as the point index thanks to the Mesh to Points node, is used to select a different text for every face of the receiving geometry.
5. The geometry of the texts to put is generated by extrusion of curves.
6. It is to notice that the text to put is offset in Z direction by half the extrusion offset. This way it is embedded only by half its thickness inside the receiving geometry.
7. Because the extrusion offset is negative, a Flip Faces node is required to properly specify inside vs outside. The text volume is removed from the receiving geometry by a Mesh Boolean node set to Difference operation. It is to notice that a Realize Instances node is required before Boolean operations with instances.
Resources:

Thank you for such a quick and elegant response. I probably didn't make myself clear. I repeat the requirements.

Determine the specific position of any face of any object
Set these coordinates to another object as a reference. At least positions.

In general, your answer is appropriate, but I would like more control and I'm looking for a way to get it.
Also look at the references - can you extrude an object inside a cube?

By "extrude inside", do you mean that you are expecting a sunken text, instead of a protruding text on each face ?

sunken text is what I'm trying to achieve. I was thinking of using negative values in the extrusion node, but at the same time the front wall is preserved, which prevents me

(NB: Comments above are related to a previous edition of this answer).


text:
Images added as backgrounds not showing in render
I had to redownload Blender after my laptop was rebuilt. Now, when I add images as backgrounds they don't appear in a render like they did before and they have different property options. Attached- the smaller selection of options now

Empties won't render, even if they carry an image. Use image as plane instead.

@lemon yes! thank you. I just looked and there's no option to add an image as a plane. there was in my previous version but not this time

image as plane is a standard addon: just activate it

@lemon thank you so much for your help!


text:
Blender 4 keeps lagging for no reason
Ever since I downloaded Blender 4 it has been lagging so much(especially when I use physics simulations),
whenever a project is starting to be a little complex blender starts operating at a very low FPS and it becomes unworkable.
The reason can't be my PC because 3.5 worked perfectly.
My PC has:
12th Gen Intel Core i7-12700F 2.10 GHz
16 GB of RAM
GTX 1650
Windows 10 Home
Can someone please help me out with this?

pls share your file at blend-exchange


text:
Weird Mesh Shading with no Effect of Recalculating, Clear Customs, Remove Doubles and Clean Up
I've been working on 3D cars for a while and this problem is very upsetting. The model has some weird shade around it like it looks flat on some parts, even through i'm using auto smooth at 45º.
Things i've done:

Recalculated Normals (Outside);
Removed Doubles and Loose Geometry;
Weighted Normals;
Cleared Custom Split Normals and Sharp Edges.

The model doesn't have the best topology, but i can't figure if that's the problem.
I will leave the .blend file so you can take a look at. I apologize any misundertanding from my part. Thank you.
Also had to take the materials and tires of the car in order to get a 30MB File Size.


text:
Damped track hair - Cycles vs Eveee
I created hair with damped track on armatures to "simulate" physics when head to which is hair connected with childOf. When I use Evee armatures with damped track are moving smoothly however when I change to Cycles it is shaky. What can be problem?
In viewport everything is OK
Here is video of Cycles (problematic one): https://www.dropbox.com/scl/fi/7gobfqpo11eepts2ud1jq/testcycles0001-0049.mp4?rlkey=1isr06vn7a4n666l3qnvt1g25&dl=0
Here is video of Evee: https://www.dropbox.com/scl/fi/8xlcjnt3x5ph0lg2vl0eb/testevee0001-0049.mp4?rlkey=m77fnafb3d5cx7dbxoz6reetp&dl=0


text:
How do I know which meshes can be seen by one camera but not by another?
I now have a need like this: I have two cameras in blender, marked A and B. I want to know which meshes A can see but B cannot?

This is vague. Try to be specific.

@Lukasz-40sth: what about the question is vague? i don't understand. For me the question although it is very short, it is crystal clear.

this should help you: https://blender.stackexchange.com/questions/45146/how-to-find-all-objects-in-the-cameras-view-with-python

@Chris "can be seen" indeed is vague: in Cycles you can be visible in a reflection for example. Also in Eevee you can be seen as a single pixel barely visible through a 99.9% alpha object. What if an object is occluded, can it be seen (if there was no object) as opposed to actually being visible? If the OP explained his project it would be easier to find the right solution.

@MarkusvonBroady: for me is "can be seen" if one pixel can be seen and reflection is for me NOT the object. Materials won't matter. Of course, that this my opinion. Maybe i am thinking too easy ;)

Great thanks for your reply! My project is not that complex. I assume all faces are opaque and I don't consider reflections. But I need to account for occlusion, which means if there is a face that is obscured by another face, I don't consider that face to be visible. I noticed that a few people mentioned calculating whether the face is within the camera's view frustum, which doesn't meet my needs as it doesn't seem to take occlusions into account.

I also noticed someone else mentioned scene.ray_cast, I haven't tested it yet, but I think this will work similar to what I need, but it can only handle one ray at a time. I could indeed write a function to split a camera into a bunch of rays and calculate them separately, but that doesn't seem that convenient.

I would render cryptomatte with 1 sample from a given camera and then check which colors are present in the render.

@MarkusvonBroady This is interesting, but doesn't the lighting in the scene change the color of the faces?And how can I color each face individually?

update, scene.ray_cast can only caculate the object, not the face, which is not what I need.

Lighting in the scene changes the color, but only if the shader reacts to lighting.  You can use a different mat (an emissive mat) in your renders to check occlusion, or, you could just render an AOV ouput.  If occluding objects output 0 and test object outputs 1, your object is not occluded if your single-pixel render has a (floating point) value > 0.

I think bmesh raycast returns the index of the polygon https://docs.blender.org/api/current/mathutils.bvhtree.html#mathutils.bvhtree.BVHTree.ray_cast

@Gorgious yes,that works

Thanks to everyone's help, I finally solved the problem. I put my approach here, it may not be the best way, but it works.
You can try the following code, copy the code into blender and run it. This code will do the following things:

Remove all the existing object in the scene.
Add a camera and config the rendering setting.
Add a "monkey".
Calculate the rays that the camera should emit.
Calculate the faces that hit by rays.
Delete the faces that not hit by rays.
Add some cylinders to represent rays (for debugging).

If everything works perfectly, you will find all the meshes that can not seen by the camera are removed.Like the following picture.

import numpy as np

import bpy
import bmesh
import mathutils

def delete_objects(del_obj):
    with bpy.context.temp_override(window=bpy.context.window, selected_objects=list(del_obj)):
        bpy.ops.object.delete()

def init():
    if bpy.context.mode != 'OBJECT':
        bpy.ops.object.mode_set(mode='OBJECT')
    delete_objects([ob for ob in bpy.context.scene.objects])
    # set the camera
    bpy.ops.object.add(location=(0, 0, 0), type='EMPTY')
    camera_parent = bpy.context.active_object
    bpy.ops.object.camera_add()
    camera = bpy.context.active_object
    camera.parent = camera_parent
    camera.data.shift_x = 0
    camera.data.shift_y = 0
    camera.data.clip_start = 0.1
    camera.data.clip_end = 1e6
    camera.data.angle = 0.785398
    camera.data.type = 'PERSP'
    camera_constraint = camera.constraints.new(type='TRACK_TO')
    camera_constraint.track_axis = 'TRACK_NEGATIVE_Z'
    camera_constraint.up_axis = 'UP_Y'
    camera_constraint.target = camera.parent
    bpy.context.scene.camera = camera
    camera.location = (0, 0, 8)
    bpy.context.scene.render.film_transparent = True
    bpy.context.scene.world.use_nodes = False
    bpy.context.scene.world.color = (0, 0, 0)
    bpy.context.scene.render.resolution_x = 800
    bpy.context.scene.render.resolution_y = 400
    # add a monkey
    bpy.ops.mesh.primitive_monkey_add(enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))

def get_rays():
    # Get the real fov, because the fov in blender is actually the fov of the widest side.
    reso_x, reso_y = bpy.context.scene.render.resolution_x * bpy.context.scene.render.resolution_percentage / 100, bpy.context.scene.render.resolution_y * bpy.context.scene.render.resolution_percentage / 100
    aspe_x, aspe_y = bpy.context.scene.render.pixel_aspect_x, bpy.context.scene.render.pixel_aspect_y
    fov = bpy.context.scene.camera.data.angle
    if reso_x * aspe_x >= reso_y * aspe_y:
        fov_x, fov_y = fov, fov / (reso_x * aspe_x) * (reso_y * aspe_y)
    else:
        fov_y, fov_x = fov, fov / (reso_y * aspe_y) * (reso_x * aspe_x)
    # Calculate the direction of the ray
    K = np.array([[1. / np.tan(fov_x * 0.5) * 0.5, 0., 0.5], [0., 1. / np.tan(fov_y * 0.5) * 0.5, 0.5], [0, 0., 1]])
    c2w = np.array(bpy.context.scene.camera.matrix_world)
    # note: the *2 here is something that like upper sampling.
    # I found that if the rays are too sparse, there may be some problems,
    # because ray_cast will only return one of the faces when it hits a point or line.
    i, j = np.meshgrid(np.linspace(0, 1, int(reso_x * 2)), np.linspace(0, 1, int(reso_y * 2)), indexing="xy")
    dirs = np.stack([(i - K[0][2]) / K[0][0], -(j - K[1][2]) / K[1][1], -np.ones_like(i)], -1)
    # This line is a matrix multiplication, but with some transpositions on both the input and output.
    dirs = np.einsum('H W j , i j->H W i', dirs, c2w[:3, :3])
    return dirs

def main():
    init()
    bpy.context.scene.camera.parent.rotation_euler = (np.pi / 6, np.pi / 4, 0)
    bpy.context.view_layer.update()
    cam_location = bpy.context.scene.camera.matrix_world.translation
    rays = get_rays()
    short = [rays[0][0], rays[0][-1], rays[-1][0], rays[-1][-1]]
    # ray_cast!
    # note we need to put all the faces that hit by the ray_cast to a set, and then delete them together.
    mapps = {}
    for ray_direction_world in rays.reshape((-1, rays.shape[-1])):
        result, location, normal, index, obj, matrix = bpy.context.scene.ray_cast(bpy.context.view_layer.depsgraph, cam_location, ray_direction_world)
        if result:
            if mapps.get(obj) is None:
                mapps[obj] = set()
            mapps[obj].add(index)

    for obj, v in mapps.items():
        bpy.context.view_layer.objects.active = obj
        bpy.ops.object.mode_set(mode='EDIT')
        bpy.ops.mesh.select_mode(type='FACE')
        bm = bmesh.from_edit_mesh(obj.data)
        bm.faces.ensure_lookup_table()
        # When entering the face editing mode, all faces of the current object will be selected.
        for i in v:
            bm.faces[i].select = False
        bpy.ops.mesh.delete(type='ONLY_FACE')
        bpy.ops.object.mode_set(mode='OBJECT')

    # add some cylinders to represent rays
    for ray_direction_world in short:
        bpy.ops.mesh.primitive_cylinder_add(radius=0.005, depth=100, enter_editmode=False, align='WORLD', location=cam_location, scale=(1, 1, 1))
        ray_object = bpy.context.object
        ray_object.rotation_euler = mathutils.Vector(ray_direction_world).to_track_quat('Z', 'Y').to_euler()  # 设置射线方向

main()


text:
keeping precise alignment during cube duplication?
I used the Object-> Duplicate Objects to get two cubes, but then when the mouse cursor is moved, the duplicate cube does not stay in alignment.  How can I snap the copied cube into perfect alignment with the original?

Right-click. That will not cancel the duplication, just the subsequent move, so the copy will be dropped exactly in place.
If you want to move the copied object in alignment to some axis with respect to the original, (having chosen your Transform Orientation,) then the shortcuts ShiftDX, Y or Z  will constrain the movement of the copy without a further operation.
Those shortcuts can be followed immediately by a number, to move along the axis by a specified distance.
If, for example, you wanted the movement directions to align to the object-axes of the original, you would set the Transform Orientation to 'Local'.

Appreciate your response, but unfortunately the cube was already placed and the project underway.  I had hoped at the end to just go back and snap the new cube into place with the original one.

That should still be fine, please illustrate your case, and/or share on https://blend-exchange.com/