text:
Inside of Glass dark
The sand inside the glass and the sand outside are the same material, but the ones inside are darker.
Light Paths settings are all turned up
Max Bounces total : 802
glossy : 478
Transparency : 441
Transmission : 353
I made sure the base color of the glass is completely white.
I tried lowering the alpha value, but the glass reflection starts to become fuzzy and I get a problem where I'm able to see the inner edge of the glass because I made the glass solid.

First of all, your Transmission bounces setting at 115 is useless, when the Total is 12. This way your Transmission bounces are limited to 12 as well (only Transparency bounces are independent from the Total bounces). Next question, why do you make the glass solid? This way the refraction looks incorrect and it doesn't help with the brightness inside either.

All glass has some thickness to it, that's why I made it solid.

Most people use "solid" to say it's glass through and through, you mean you used a Solidify modifier to create some inner walls? That's okay, the refraction didn't look like it somehow. Some people don't use a Solidify modifier, which doesn't work on glass materials as if the walls were infinitely thin, but as if it was a solid block of glass.

I solved it by unchecking shadows under ray visibility in the glasses objects menu. It appears that the inner darkness was caused by the glass casting a shadow onto the objects inside of it.
Although now the glass doesn't cast shadow. Is this the right way to do it?

Well, I tried to give an answer to show the different possibilities. The problem is always the shadow. I've made some material which works a bit like unchecking shadows in ray visibility, this gives good results for the inside of the glass, but it has the same problem with the glass no longer throwing shadows. I'm trying to find a better material for quite a while now, but until now nothing was flawless.

//EDIT: I improved my glass material a little more, you'll find it at the end. Be aware that this is no overall solution, depending on the objects and scene other material setups will work better - this one is a glass material for things like hourglasses, snow globes, ships in a bottle etc. where other objects are inside a glass container. Different glass objects like e.g. windows in an interior scene may look better using the refined glass material mixed by Is Shadow Ray.
To get more light on objects inside a glass object, one way would be to disable the Clamping > Indirect Light in the Light Paths settings. I think the default value is 10, if you set it to 0 the clamping will be disabled. This will make the inside a little brighter, however this may cause more noise and fireflies at low sample rates.
Another problem is, that even if you have a bright sunlight which produces sharp shadows outside of glass objects, inside the shadows will be diffuse and soft. To change this, you have to tweak the glass material by mixing it with a Transparency BSDF and the Is Shadow Ray output of the Light Path node. This way the inside will get very bright. To reduce the brightness to a normal level, you can plug the Is Shadow Ray and Diffuse Depth output into a Math node set to Maximum. This is in my opinion the best compromise for a glass material (note that it doesn't matter if you use the Glass BSDF or the Principled BSDF with Transmission = 1). However, this will result in the glass having no shadow.
What I don't recommend is increasing the Max Bounces. Yes, there are differences in brightness between bounce values from 0 to 10 maybe, but higher values will make much difference in this case and only increase render times.
To see that and compare with other methods I mention above, I made an overview of the different settings I tried:

I tried a lot of Math nodes on the Light Path outputs and it seems it's easier than I thought: it's bright enough inside the glass, shadows are sharp and the glass still throws a shadow - the Ray Depth output is working quite well, just not the default output value, but plugged into a Math node set to Greater Than with 2 as Threshold. Only the refraction seems to be a bit different. Well, nobody is perfect...

I will look into those options, thanks! I was hoping for an easier solution, but it looks like this is not straight forward problem to solve.

@Mike I finally got glass throwing shadows on the outside and edited this material in at the end. Can't see the shadows there because I disabled the exterior in the render, but it works. Still not perfect though...

@Mike It was just a few days ago that someone had a problem with glass, and often before... I'm in on this topic for quite a while and keep working on it, I'm still searching for the swiss army knife of glass materials.

If you want 100~ transparent or transmission bounces you must set Max Bounces to a high number as well, but that isn't your main problem.
After bouncing into a glass object, when the ray strikes a backface that hit is registered as Glossy.  You need to increase Glossy bounces as well.
Without enough bounces, the ray is reported back as lost which gives a black color for that sample, darkening the overall result.

The number of Total bounces only limits the Transmission (and Diffuse, Glossy and Volume) bounces. Transparency is independent from them. Increasing the Glossy bounces helps with black edges in the glass itself, it doesn't make things brighter much inside of glass objects.

I solved it by unchecking shadows under ray visibility in the glasses objects menu. It appears that the inner darkness was caused by the glass casting a shadow onto the objects inside of it.

Hello and welcome. This site is not a regular forum, the answer section is reserved exclusively for answering the OP question. To ask for clarification, post comments or replies please use the comments section instead. If you have the same problem or a different question please use the Ask Question button at the top right. If you want to add additional information or further developments, use the edit button below the original post instead.


text:
Composited render missing occlusion with white outline
I am trying to learn how to render out elements in different layers. For some reason I am getting a couple issues when I attempt to composite 2 layers.
Below is a combined render of all elements, and a composited version of the creature, smoke, and background. The composited version has a weird outline around the creature, and there is no shadows/ambient occlusion on it as well.
I have a view layer setup for the creature and the smoke elements. The explosion in the creature view layer is set to "indirect only" and the creature in the smoke view layer is set to "holdout"
google drive link
https://drive.google.com/file/d/1wbUuCqGi34zJxhbVCxcOr2-yuIAoZNGn/view?usp=drive_link
edit: The white outline issue was solved by setting the premultiplied values on the alpha over nodes to 1.

If no one answers your question, you can try compositing the finished render in Gimp to remove the white outline and paint shadows for each frame.

i would recommend providing a blend file - i think this attracts way more people

From the screenshots, the monster and smoke are on different layers, and each layer has a transparent background. Maybe this video is helpful, though I am not sure: https://www.youtube.com/watch?v=tmb5HRU1cUo

The link to the file requires an account.

https://blender.stackexchange.com/questions/67346/where-do-the-white-lines-come-from-in-my-composite

your google drive link is not accessible. can you please make it public.

I just did, sorry.

Try checking "Convert Premultiplied" for one or both of the "Alpha Over" nodes.
It looks like the alpha channel of the creature is not premultiplied and it might help.

it doesn't seem to work

source: Stack Exchange

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

sort: votes


text:
Setting Smoke volumes to indirect only
I have a scene where I have a smoke simulation surrounding an object. I would like to render the scene in layers so I can composite the final shot in After effects.
I can put the smoke and object in separate view layers, however, they don't effect each others lighting or shadows.
So I put the smoke in the same view layer as the object, and set its visibility to indirect only. The smoke doesn't show up in the render, but also doesn't affect the lighting of the object or cast any shadows.
How do I get two renders, one with the smoke, and another with the object, but with the smoke still effecting the lighting/shadows of the object.
Combined Render

Composited Render (creature + smoke sim)

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


text:
i cant bake save or bake udim textures
I want to save udim tiles textures and bake but it doesnt allow me. Here an example:
[

Probably you should create all the UDIM tiles first. And seems like currently (2.91.0) Blender can't bake all UDIMs at once, but you can try this addon https://github.com/anfeo/blender_addon_bake_UDIM


text:
Soft bodies for car tires
How would you go about using soft bodies for the tire tread of a car?
I can simulate the tread by itself squishing and deforming easily, however, I haven't figured out how to attach it to a tire rim (which is not supposed to squish) and then attach that to an axle/body of the car.

Video example (soft body tire treads are parented to the tire rim, with goal enabled)
https://www.youtube.com/watch?v=l3SWlJNjkgc
Your help is appreciated.

Side note, use blend-exchange.com for Blend file sharing on this site, whenever you can.

My issue was related to a tutorial that I was following in which they set the "bending" value to 2. I got the treads to behave correctly by lowering this value. https://www.youtube.com/watch?v=yhYrHxxbZUc&t=62s
So basically.

parent the treads to the rim.
Assign the inner tread to a vertex group.
use the vertex group as the goal in the soft body settings
set default strength to 1.
check mark edges.
play with the bend value + other settings.

However, I am dealing with another issue where the treads want to slide towards the left while touching the ground. This seems to be especially so if the treads don't have much geometry.

You should post the second issue as a separate question. I’m glad you found the solution to this one!

I believe the way to do this is to create vertex groups of the beads of the tires (I.e. the part where they touch the rim), and then in the soft body physics, set those groups as goal weighting groups with 100% spring stiffness strength and maximum weight. With the tire objects parented to the non-soft body wheel aka rim objects, that should give you what you’re looking for.

where can "pin groups" be found in the soft body physics?

if you mean the vertex group within the goal setting, I have tried that but it doesn't seem to pin the rim area.

Sorry, yes I do. Did you turn the spring stiffness and the max influence all the way up?

I have. the tire stays in place but looses its soft body characteristics. as if its pinning the whole tread, even though the vertex group only includes the vertices where the treads meets the rim.

You seem to be getting the treads and the sidewall mixed up.


text:
Rockbottom rank newbie question about the Blender UI (Blender 2.9.0, on a Mac)
Since this is the only forum accessible to me, here's the question: The term "Edit mode" gets used a lot, but there is more than one layout (arrangement of tools available) for Edit Mode, for example, the initial layout, with a long column of tools running up the left side, and the vertex, edge, and face icons up next to the "Edit mode" ID, plus those same three choices spelled out at the end of the row. OR: there is a different Edit Mode Layout without those two reference clusters for choosing a target. They are absent. Gone. So if I'm in one of those layouts, how do I get to the other, and vice-versa?

You may need to show what key combinations you used and the object selected

If you refer to the online manual Regions entry you will see that there are two pull out bars, called the tool bar (on the left side) and the sidebar (on the right side) of the 3D viewport:

You can use hotkeys to toggle those bars so that they are visible or not. The t key will toggle the tool bar and the n key will toggle the sidebar.
Also, when the bars are not present, there is an arrow that you can drag with the mouse to pull them out:

You can also use the arrow to drag them closed.  (When the mouse hovers over the arrow it changes into a two-arrow cursor.)
Update: The difference between the toolbars in your update are because of what object is being edited, which you don't show, or what tool is being used.

Thanks for taking a stab at it, Chris. I added a doctored image to my original post to clarify the problem-selective editing is possible in one state, but not the other.


text:
How to Animate Mask to Hide/Reveal 3D Object
So, I'm new to Blender and I'm trying my best to complete my first project. I've modeled a logo in 3D: it's similar to a winding film strip, but a solid color (color A on the top of the film strip and color B on the bottom of the film strip) instead of textured.
My end goal is to have this 3D object with an animated mask of sorts, so that it wipes down the length of the film strip to the end side, revealing the logo completely, and then the loop starts back over from the start side of the film strip, hiding the logo completely. Essentially, you can think of this as a Loading Screen icon of sorts. Just a continuous loop where the logo is revealed along the path and then hidden along the path. (edit: Here's a quick mockup of the different stages of the animation.)

Is this something I can do with an animated boolean? That seems to be something I've come across that might work, but I'm not sure. I've attempted to apply a Boolean modifier to a test Cube to see if it interacts properly with my Bezier Curve mesh and I have no results. Here's a screenshot of my scene and properties.

If you have any advice on a technique or tutorial I can use, I am happy to do some more digging into this. Just looking to turn this project around soon and needing some direction.
Thanks so much!

Some kind of sketch of the desired start-mid-end points would really help here.

Good call. I've added a quick mockup of the progression. Hopefully that helps!

This looks like a good candidate for an extruded curve with an animated end point.

As Gorgious has commented, no need for a Boolean here.
You can use the native extrusion, and mapping range, of a curve:

The start and end points of the extrusion can be set, and key-framed.
To get the 2-sided material, you can use a Geometry node in the shader, to discriminate between front and back-facing shading points:

Yours would probably be a bit more sophisticated.. but this is the result, in the viewport:

Robin, how can you only keep one output (Backface) for your Geometry node?

@moonboots Ctrl-H toggles reveal of unused fields / sockets.

@moonboots Ah! I thought the shortcut was the only way! (I've got to lean the Node Wrangler moves, myself)

no I didn't mean there was another way, I meant I already saw the trick but didn't know it was Ctrl H  ;)

Nailed it. This is so super helpful. Thank you for your helpful reference images and GIFs too. I was able to knock this out easily – way easier than I thought it would be. So, thanks again!


text:
Subsurface value of principled BSDF shader affects other materials with subsurface

As the picture shows when I decrease the value of subsurface for one material (skin in this case), other materials (around the eye) that also use subsurface are getting black even though they are all separate materials. Does principled bsdf somehow just share this value across all its instances or what exactly is going on, is this a bug?

Are you certain you're creating new materials and not applying the same instance to different meshes?

Yes, I changed the gif so now it is more obvious with subsurface on eyes. Skin and Eye are using completely different materials with their own node setup. Both are using principled bsdf tho.

Could you quickly check if this still happens when you use Cycles? Afaik, the SSS in Eevee is not raytraced, but rather "fake". So it might be a settings issue.

Yes, happens with cycles as well.

I am not at a computer right now, but at first I would suspect, if the eye and the skin use subsurface scattering, light travels through these objects. If you are then decreasing the subsurface scattering on the skin, the eye gets less light from the "inside", from the head behind and to the side and maybe this darkens the eye. Just a wild guess though.


text:
Copy rotation doesnt work correctly
I want to rig the eyelids of my character but when i use copy rotation, the eyelid rotates 90 degrees that also happens with the lower eyelid when i use invert x  I follow this turtoriel

It sounds as if you may have missed applying the rotation to the UV Sphere that makes up the eyelids at 2.14 into the tutorial.

ah ok, i immediately switched to the rigging part because i already finished the eyes before i watched the turtoriel

Did that cure the problem?

nothing changed, now when i use track to i can only rotate the eye on a axis where its looking up

We'll need to see the Blend file in that case (with just the eyes and armature if the whole file is very large). https://blend-exchange.com/help

i added the blend file

No armature bones for the eyes in that Blend file so I can't check it and the rotation hasn't been applied on the eyelids anyhow.

i updated it and i thought i had to apply only on the uv sphere

Let us continue this discussion in chat.


text:
How do i make the Black edges dissapear?
 Im trying to put a heart shape texture on the eye of my robot but there is a black edge. i reused this eye model from my other robot, there i had to select faces assing it and unwrap but i cant figure out how to do it with a heart i also want to make other shapes like a spade

You can use one unique material, plug your image into a Color > MixRGB, use the alpha as factor, plug the MixRGB into the Diffuse, make sure that the UVs of the rest of the eye is not over the red painting but over the alpha transparency:

that iris thing still doesnt blend in with the rest of the eye, i also changed repeat to clip so there wouldnt be multible hearts https://imgur.com/a/L0JMJLs

could you please pack the image and share your file?

i updated the blend file and addet the image to the post

The problem is that you don't use the same white color for the 2 materials (the white hex reference of the first material is E7E7E7, use the same for the second one), but why don't you simply use one unique material for the whole eye, as I show?

The iris thing is now gone when i use one material but there is a weird texture on the other side of the sphear (see post)

As I said you need to make sure that in the UV Editor all these faces are overlapping a transparent part of your image, so select them all, unwrap again, scale down and put them on a transparent part like what I've highlighted in green in my picture

Now it works, thanks


text:
Why doesnt the eye go along with the head?
I parented both of these eyes to the head bone but only one eye goes with the head

With the way you've named things, it's very difficult to work out what's going on! - The right eye (eye.001) has a Track to constraint on 'eye_bone_l' and the left eye (eye.002) has a track to constraint on 'Armature.002'! Similarly for the naming of the bones for the eyelids.

Im sorry, i updated the blend file. l and r are suppose to be left and right

You have only parented the right eye to its eye bone. The left eye has no parent. And because of this, it doesn't move with the eye bone and the head. -- I also recommend turning down the viewport levels of the Subdivision Surface modifiers. For render, you have only 2 levels. That's ok. But for the viewport, you have up to 5 levels. This generates over 2 million vertices in the viewport just for this character. It's a waste of resources and can cause a lot of lag.

Oh, and you have accidentally created extra armatures instead of bones for the eyes and the eyelids. Merge the armatures and give the bones and objects proper names.

As @Blunder says, the left eye isn't parented, but that also applies to the left eyelid and the left eyelashes haven't been parented to the eyelid either!


text:
rig doesn't work correctly

I'm trying to rig my first organic model and the problem i have is that the sleeves disconnect with the body, the collar also moves along with the sleeve. I did this all with automatic weights.

Your mesh and rigging is a bit a mess, first thing apply the Mirror modifier to simplify things, put the Armature at the top of the modifiers stack, do the same for the other parts of the body:

Select the arms and shift select the body, in Edit mode remove all these vertices from all groups:

Assign the same vertices to the correct vertex group (I've simplified the name), now they are all part of the same group and they should work correctly when you'll move the arm:

Seems to be working but when i move the left foot the sleeves also move. I updated the blend file


text:
Outliner: Is there a way to select objects by data type within a Collection?
Is there a way to quickly select all objects of a given type within a specific Collection?
Right-clicking on a Collection in the Outliner brings up this menu:

↑ There is an option to "Select Objects" within the Collection.
There is also a way to select objects of the same type (as the selected one) using ShiftG in Object Mode:

Is there a way to select objects matching both criteria?
(In Collection AND of Type)
For that matter, a logical AND search that could match various combinations of these categories would be useful. (For other kinds of Boolean logic too.) It must at least be possible with Python, even if it's not so "quick" to pull up in the UI.

What you can try:

Right click on the collection
Click select objects - it will select all objects in your collection
Press / to go to Local View (or View > Local View > Toggle Local View)
Now press Shift+G and select objects by whateveryouwant
Press / again to exit Local View

Nice, thanks! (I made a minor edit to your answer, just that Isolation Mode is now listed as Local View in the menu)


text:
Mathematically, what's happening under the hood with Shape Keys?
I recently put together a node tree in Geometry Nodes that emulates the functionality of Shape Keys.
The result is very close but not always exactly the same as when using native Shape Keys.
A comparison of the Geometry Nodes Shape Keys result (grey) against the native Shape Keys deformation (blue):

I suspect it has something to do with how face normals are being calculated.
So I would like to know, what is the formula Blender uses to calculate a Shape Key mix?
The goal is to "code" that math into the note setup to improve the accuracy. Thanks.

Well, the standard shape key transformation is linear, so for each vertex an offset vector is stored which is added to the original vertex location, multiplied by a factor which is given through the shape key value. If you have a second shape key, they are both added to the original location as much as their individual factor is set to. Since this is a linear transformation, things like rotating shapes cannot simply done by animating shape key values from 0 to 1.

@GordonBrinkmann Thank you for your comment. I am aware that rotation is not possible, as it is only handling vertex positions. In my node setup since the vertex positions must be taken from two separate objects with matching topology, the basis is subtracted from the key to get the difference, and then that is factored and added to the mix. Seems essentially the same as the process you describe. Maybe it's due to a floating point limitation during the vector addition process... and maybe that doesn't happen when Blender calculates internally.

It's a bit complicated.  You can follow the code starting in MOD_shapekey.c but given the math involved I would speculate that your guess about floating point limitations holds, even in the simple case.


text:
SVG import: How to restrict material count to the SVG's palette colors?
I did an Image Trace in Adobe Illustrator and saved it as an SVG. The trace was restricted to a palette of just 6 colors. But upon importing into Blender, I end up with a separate material for each island, which in this case is hundreds of objects titled incrementally such as SVGMat.820
Up to this point, whenever I imported SVG data into Blender, it was simpler geometry, maybe a logo or something. So I just replaced the default SVG import materials with my own, maybe sampling the hex colors where relevant, and throwing away the rest.
But this time I want to keep that palette of 6 colors and just modify the shader data (I mean send unique material colors from RGB Nodes into a shared Group Node containing the shader setup - do you follow?). Unfortunately Blender has no idea that some of those materials share a common color, while others do not. And I don't feel like pasting that Group Node into 820+ separate materials! lol
Is there a way this can be tackled using Python to loop through all materials named SVGMat.* check if the Diffuse Color matches an existing material's Diffuse Color, and if it does, discard that redundant material in favor of the existing one?
(I feel like ideally the option to restrict materials to unique colors ought to be included as a setting of the SVG importer, possibly as default, but for now any kind of scripting workaround would be awesome.)

An easier workaround for this problem might be to just join all objects with the same color in illustrator ahead of time. Selecting them and joining them in illustrator should be relatively easy, that way when imported you only get one single material. Separating them by loose parts in Blender should also be relatively easy if you do in fact need separate objects.

@DuarteFarrajotaRamos I appreciate your suggestion. And it does seem like a practical idea. Unfortunately, Join isn't working. Illustrator gives the following error message: "The selected objects cannot be joined as they are invalid objects..." Even if they aren't in any group and are each a  by themselves. Pathfinder: Unite doesn't work either - it just puts the paths into groups. This is quickly turning into a gnarly Illustrator question...

Hum, not versed in illustrator myself. Try opening the svg in Inkscape and joining there, perhaps

@DuarteFarrajotaRamos You convinced me to revisit Inkscape after quite some time, and I'm glad I did. Inkscape enabled me to accomplish what Illustrator could not. Steps: 1Go to Layer > Layers & Objects 2Create a layer for each color to keep paths in order. 3Select the topmost layer in the stack, then Edit > Select Same... Fill Color, and drag those selected paths into the topmost Layer. 4Repeat step 3, selecting the topmost path, but move to the next layer down. Do this for ea. color. 5For ea. Layer, select the range of all paths inside, then Path > Union 6Save As

I'd say that deserves an answer. Could you post it below with a few screenshots of the result? Feel free to ping me in the comments for an upvote.

@DuarteFarrajotaRamos Thanks. :-) Do you think it's better to post the answer here for the sake of resolving this question, or to post a new question + answer in Graphic Design SE? I was sort of wondering what to do with this since it turned out that the solution involves software other than Blender.

Using other software is fine here if it solves the issue, as long as it focuses on a Blender related problem. You may also consider posting there as well for the Inkscape part at least, I'm not a frequent visitor there, so not sure about the on-topicness, but at least initially it seems fine. haven't used it much lately, but Inkscape matured quite well lately, especially the multi-page support.

@DuarteFarrajotaRamos I've posted an answer - something a little more comprehensive than the explanation in my comment. :-)

Assuming you are starting with a muli-path trace result created with some vector design software such as Illustrator or Inkscape - here are the steps in Inkscape for consolidating and joining the paths of that artwork according to color:
1. Go to Layer > Layers & Objects. This gets the Layers panel to appear if it isn't already visible.

2. Create a layer for each color to keep paths in order. To make the result more intuitive, you can re-order the layers so that Layer 1, Layer 2, Layer 3, etc go from top-to-bottom instead of bottom-to-top.

Tip: You can re-order layers quickly by clicking the Up and Down arrow buttons at the top of the Layers panel.
3. Select the topmost path in the group, then Edit > Select Same > Fill Color, and drag those selected paths into the topmost layer. Aim carefully to drop into the layer, not above or below it.

The selected layers are now those which share the same color.

Tip: Once a layer contains something, a triangle icon appears to the left of it. You can use this to keep track of which layers you have already dragged paths into. It's a good idea to click this icon to collapse a layer to hide its contents after dragging paths into it.
Tip: If you have a solid color background in your trace result that you want to get rid of, now is the time to delete that path - before joining the paths by color.
4. Repeat step 3, selecting the topmost path, but move the selected paths to the next layer down. Do this for each path color / layer.
5. For each layer, select the range of all paths inside.

Note: I don't currently know of a way to select all paths in a layer in a single step, but you can select the top path and then Shift+Click the bottom path, and that whole range will be selected.
From the menu, choose Path > Union

After doing Union, rename the path to a number indicating its position in the stack.

Optional: You can drag each of these paths into a single layer to consolidate / organize. You can then delete any unused layers and groups.

6. You're done! Save As. This SVG is ready for import into Blender, and will now have a manageable number of paths, and materials to match.
Inkscape version used in this answer is 1.2.1 for Mac


text:
Does "Hide Value" do anything on an Output socket? (Isn't it always hidden?)
This is a really simple question. I was just wondering if a node's Hide Value option has any effect at all when it's for an Output instead of an Input. (This is found in the Group tab when editing inside of a Group Node.)
The following screenshot was taken within the Compositor, but this exists in Material Nodes and Geometry Nodes too.

I was wondering if it's for some planned future feature, or just a vestigial UI element, or if it actually does something I'm not aware of... because I can't think of any nodes that have sliders on their output sockets.
Just curious if anyone knows. Thanks.

Having a quick look at the implementation, the Hide Value checkbox sets the SOCK_HIDE_VALUE flag when enabled. There does not appear to be special behavior for the output sockets, as far as I could see.

@RobertGützkow Thanks. So do you interpret that to mean it was coded generically for any kind of socket, and the option was left available for output sockets too even though it appears not to make any difference for them?

That seems to be the case. The flag is checked in std_node_socket_draw (drawnode.cc), uiTemplateNodeLink and ui_node_draw_input (node_templates.cc), gpu_uniformbuffer_link (gpu_unifirmbuffer_link), update_socket_to_match_interface (node_common.cc), matches_common_data (node_declaration.cc), node_socket_copy_default_value (node_socket.cc) and ntree_shader_unlink_hidden_value_sockets (node_shader_tree.cc). In none of those use cases it seems to differentiate between input and output sockets wrt. the use of SOCK_HIDE_VALUE. I have only checked superficially though.

Well, it says "Hide the socket input value". It is important - Group Input node has no input sockets.
If you made a group using Ctrl + G, then hide value:

In group node, you will see, that the input value field actually hides:

Output sockets always have no input fields, even in input nodes  (as you have already noticed):

In GN (in top node tree), this option seems to be useless, due to group node is not shown.

Yes, I am aware that it hides input socket value sliders (with the exception of a GN top level node tree). But my question is specifically about output sockets, for which it appears to do nothing.

Sorry, I don't understand. Output sockets are hidden, but this switcher disables input socket in the node outside the node group

@Crantisz What do you not understand? The "switcher" exists for input and output sockets, and the question was what are they actually doing for the output sockets. Saying they hide the input sockets doesn't clarify this.

It says "hide Input socket". Output is always hidden.


text:
How to use Curve Modifier to buldge part of the mesh (modelling rabbit ear)
I modelled a very simple beginners version of a rabbit ear (improvement proposals for better implementation welcome).
I managed to create a curve from the root to the tip of the ear by applying a Curve Modifier and using a Path I deformed in Edit Mode. This is what I have: Blend file.
Now I want to create a curvature at the root of the ear to buldge the lower part like  (but not that extreme). I made a Vertex Group (earRoot) for all the bottom vertices and wanted to place them onto a (circle) Path using the Curve Modifier. But I have several problems:

Whenever I assign the Vertex Group to the Curve Modifier the lower part of the ear gets displaced from the rest of the ear and totally twisted
If I do not use the Vertex Group I also do not find the correct axis/settings/position to deform the ear like I wish.
I also tried to set the origin of the ear to the bottom with no effect.

Any help appreciated.
[EDIT:]
The answers from @cegaton and @MikeMoore already helped perfectly to achieve the desired end result and I understand it is lot easier and simpler to do proportional editing here. But I'd still love to understand the correct usage of the Curve Modifier for this purpose (assuming it is even possible) - and what I did wrong (learning purposes).

I agree that it would be easier to just model this regularly, instead of using curve based modifiers.
In edit mode, click on this button to enable proportional editing mode:

Proportional editing mode allows you to effect all vertexes surrounding the ones you have selected with the change you're making, for example, in this picture I am selecting the highlighted vertices, hitting S to scale, and then hitting X to lock the scaling to the X axis of your ear.

Also, please flip your vertices! All your faces are inside out, to do this, simply select your whole mesh in edit mode by hitting A (this deselects anything you have selected currently before selecting everything), then hit W, and hit the "Flip Normals" button.
An even easier way to flip faces is to just hit CTRL+N, which tells blender to decide which faces it thinks should be flipped automatically. Not always reliable, but in this case it works just fine.
Please feel free to ask any more questions about what I've said here. :)
MikeMoore

thanks a lot for your detailed explanation and additional advice.. To be honest I tried to achieve what I wanted by using proportional editing before, but it seems I was not patient enough to find the right vertices to select and the right tool/transform operation combination :-) I have one question: How did you recognize the vertices are flipped? I already did "Recalculate: Normals" from Toolbar, but will also do "Flip Direction" now. Thx again

They get that funny darkened gray color when they're backwards.

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


text:
Add objects to center of mesh faces using particles
Using Blender 2.79: I have a UV Sphere and would like to add objects to the center of the faces.
Following this post it was not a problem to achieve this. But now I want only parts (rings) to be stocked with a specific object and other parts (rings) with other objects. I tried to use vertex groups for that.
The problems I am facing:

I do not find a way to add objects to just 1 ring of faces.

My approach: If I want 2 or 3 rings coherently I highlight them (faces), apply them to a vertex group and then add a weight of 0 to the outermost edges. This does not work if I only want 1 ring. The objects will be distributed over 2 rings (above and underneath the vertex group edge). I also tried to add single particles to the desired faces in particle edit mode which worked fine but then they where not centered.

I suppose the way I organize my vertex groups is not correct? Would you even use particles for that or recommend another approach?
Anyone? :-)

Consider
Technique 01

Duplicate a ring mesh by itself with a particle system. Then move the ring to be coincident with the original sphere.  One sphere object for shape.  One ring object for particles.
For the duplicate ring, do not render emitter.  The particles remain.  Ensure the Particles per faces setting is value 1.  Set the value of number of particles.

Technique 02
See Duplication on faces.

Above the deleted faces of duplicator.

Above rendered image smoothed and using subdivision surface modifier.
Link
Tapering a tentacle mesh with uniformly scaled suction discs
If your particles are static you might even use the Array Modifier.

thank you very much for your detailed answer! I am very happy you mentioned the dupliframe method, did not use it before but it seems it also has the advantage of being able to scale the objects to the face sizes! I will have a close look at this later but one of your techniques should do the trick!

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


text:
Animation Node: Bake to Keyframes (convert animation)
Followed a tutorial on Animation Nodes by Jacques Lucke on Youtube the other day and tried a very basic setup. This was my very first AN test.. As I would like to render it on a renderfarm, I have to get the animation up and running without the AN addon. This is the setup:

I found some info on the Set Keyframes Node, used it on my Object and after that clicked Bake to Keyframes. This worked well for all simple Loc/Rot/Scale transformations.
Problem is, the "simple" deformation of the Grid mesh that is caused by the Point Distance Falloff Node is being ignored. Is there a way of converting the deformation to Shape Keys? Or which "Custom" value could I use in the Set Keyframes Node?

you can't really bake mesh animations to shape keys. The best practice  is to bake the mesh into an alembic file. Can you try that?

thanks for your quick reply.. I am still pretty new to all this, so have to admit never heard of alembic before. but I just googled it and will do some more research to try and figure out how to "bake" my blender animation into an alembic file

@JacquesLucke finally .. I revisited my project and tried your suggestion! It worked very well: All I had to do is export the file to .abc format and then import this file into a new project. All the shapes from the animation nodes animation where applied automatically to keyframes then. A Mesh Sequence Cache Modifier which piointed to the .abc file was applied to the Mesh automatically. So - your comment is the solution to my problem. Thanks again.

You can convert your node or alembic animation into a shapekey for each frame then animate those shapekeys using this script below. You also should remove your mesh sequence modifier after running the script.
import bpy

ob = bpy.context
obAc = ob.active_object
    mesh_data = obAc.data

start_frame = bpy.context.scene.frame_start
end_frame = bpy.context.scene.frame_end

if not obAc.data.shape_keys:
    obAc.shape_key_add(name="Basis")

# Create shape keys for each frame
for frame in range(start_frame, end_frame + 1):
    bpy.context.scene.frame_set(frame)

    # Evaluate the mesh with modifiers
    depsgraph = bpy.context.evaluated_depsgraph_get()
    object_eval = obAc.evaluated_get(depsgraph)
    mesh_eval = object_eval.data

    # Create a new shape key and set its points based on the current frame
    shape_key = obAc.shape_key_add(name=str(frame))

    # Collect vertex positions for the current frame
    vertices = [vertex.co for vertex in mesh_eval.vertices]

    # Set shape key data
    shape_key.data.foreach_set('co', [c for v in vertices for c in v])

if obAc.data.shape_keys:
    shape_keys = obAc.data.shape_keys.key_blocks

    # Iterate through shape keys and set keyframes
    for frame in range(start_frame, end_frame + 1):
        ob.scene.frame_set(frame)

        for shape_key in shape_keys:
            if shape_key.name.isdigit():
                value = 1.0 if int(shape_key.name) == frame else 0.0
                shape_key.value = value
                shape_key.keyframe_insert(data_path='value', index=-1)


text:
Why does the object appear behind the other object when i move the camera
When i move the camera some object appear behind my character

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

i just addet it

The body has its In Front option activated, so it will always appear in front of the other ones (in the viewport, not in render), disable this option:


text:
How to correctly put the texture on?
I'm trying to put this Texture on the chest like in the reference but it doesn't look right. Any idea on how to put it on correctly ?

If this (image below) is what you want, you need to unwrap again, and use this kind of setup: copy paste the Principled BSDF of Material.009 to get the correct blue, mix it with your image, with the Alpha of the image as Factor of the Mix Shader:

But actually you don't need 2 materials, you could have included the image in the Material.009 material, just make sure that the UV islands of the blue parts are overlaying the transparent parts of the image:


text:
Dynamic Paint displacement use wrong normals if placed after deforming modifiers
I've been trying to use the displacement option from the Dynamic Paint physics modifier after an Armature modifier, but it seems that the normals used for the displacement direction are from the raw mesh, even with the vertex positions used being the deformed ones.
The scene i've created for testing contains a tube mesh deformed by a SplineIK and a Dynamic Paint canvas modifier with displacement surface type, the tube normals are inverted for the displacement to happen from inside to outside (creating a bulge effect). A sphere with a Dynamic Paint modifier brush is following the curve and displacing the tube from inside.
The SplineIK rest pose is just a line, and in this pose the displacement behaves the intended way.
The tube have only the Armature and Dynamic Paint as modifiers, with the Armature being above.
[![Inverted normal SplineIK tube with displacement Dynamic Paint being wrongly displaced by a sphere following the spline][1]][1]
This Dynamic Paint normal issue also occurs with the wave surface type (or i'm missing some dynamic mesh checkbox in the modifier options, which is unlikely since deformed positions are being used).
Final edit (8 months after):
Ignore everything i said below, i probably broke something messing with the code. Turns out that between me installing blender and me downloading the source code, there was a new blender version with the issue fixed.
----- (old, wrong information starts)
Edit:
After months ignoring this problem, yesterday i decided to download Blender's source code and take a look. I didn't understood it very well because i don't use c language (and surely also because there is a lot of code, probably the main reason), but i found in the file dynamicpaint.c the following line inside the method dynamicPaint_frameUpdate:
DynamicPaintSurface *surface = *canvas->surfaces.first;

I then changed it to:
DynamicPaintSurface *surface = *canvas->surfaces.last;

I proceeded to test it and found that the problem was solved. I have no idea if using the base mesh is intentional nor if this change cause problems with other dynamic paint functionalities. I don't know what or if i need to change something in this question, or even if this should be an answer, so i'm just gonna add the development tag because of the code change.
Edit 2:
Tested with waves option in dynamic paint, before and after changing code, also fixed.
----- (old, wrong information ends)

How do you make the mesh collapse after the sphere moved through it?

@Blunder I checked the Dissolve option in the Dynamic Paint. I used 10 for the time value inside the Dissolve tab.

Issue is now fixed in Blender 3.1, probably because of mesh normals refactoring.
Dynamic paint displacement before and after:

Dynamic paint waves before and after:


text:
Animating annular sectors, vertices along a circular path, using skeletons
I need to create an animation of planar data to look like the following (without the slider):

This is two annular sectors that are growing in length (increasing angle), one annular sector that is shrinking (decreasing angle), and two sectors that are growing (increasing in angle). The annular sectors are "stroked" with fully-opaque black along their edges.
The green, blue, and pink regions are all semi-transparent, so they cannot overlap. There is a region visible below the graphic, so I cannot rotate covered-up semi-circles into place.
This needs to be exported via glTF to a custom game engine, so I must use skeletal animation. (I cannot use the AnimAll extension to animate vertices per frame...which would need a lot of custom baking, or precise interpolation handle editing to move along a circular path.)
Let's ignore the black outlines, because those are easy, and focus on just the sectors and annular sectors.
I've created geometry and skinned them to rotating bones. (I've evenly spaced the geometry and bones for the common case.) The result looks good enough in the middle of the animation (or when covered by bones):

...but as you can see, at the extremes the outline moves out of circle, and the vertices start to pile up badly, causing faces to overlap and ruining a uniform semi-transparency:

Other than throwing more bones at the problem (one bone per radial line?), is there a way to animate this in a circular fashion?

Edit: to avoid an XY problem, I suppose I should say that it does not HAVE to be skeletal animation. It occurred to me while writing this up that the runtime engine does support KHR_animation_pointer glTF extension, so perhaps I could accomplish the result with static geometry and animating a texture's UV offset to somehow slide in a radial fashion?

I would recommend making the outer part border, or at least the purple bits a separate mesh from the circular part. Since only one part of it needs to actually move you can avoid the border getting squished.


text:
Write glTF Extension to Import Custom Animations
Summary: How can I use the extension mechanism of the glTF importer to read in my custom animation data and merge it into other actions created by the importer?
Background:
I'm using a custom extension to the glTF standard that stores custom animation data (the visibility of a node). After much confusion and fighting, I have written an extension to the glTF export/import add-on, and it writes the desired results. (Yay!) For the curious, here's an example of an animation in the glTF JSON that's using my extension. (You mostly don't need to understand the details for this question.)
{
  "name":"SlideZAndBlink",
  "channels":[
    {"sampler":0, "target":{"node":0, "path":"translation"}},
    {"sampler":1, "target":{
      "extensions":{
        "KHR_animation_pointer":{
          "pointer":"/nodes/0/extensions/EXT_node_visibility/visibility"
        }
      },
      "path":"pointer"
    }}
  ],
  "samplers":[
    {"input":6, "interpolation":"CUBICSPLINE", "output":7},
    {"input":8, "interpolation":"STEP", "output":9}
  ]
}

The important parts to note are that:

The extension references nodes by index, and
A single animation on a node might animate multiple properties (here, translation and visibility), some of which are not part of my extension, and
When multiple NLA Tracks in Blender have the same name, they are exported as a single glTF animation with channels that might target many different nodes.

Now I want to write the importer extension to round-trip this data. Unfortunately the documentation is quite sparse on how to use the extension capabilities of the add-on.
Through experimentation and diving into the source code, I believe this is the order of the callback hooks for the importer:
gather_import_gltf_before_hook
gather_import_scene_before_hook

for each node:
    gather_import_node_before_hook
    if node has a mesh:
        gather_import_mesh_before_hook
            gather_import_mesh_options
            for each primitive:
                gather_import_decode_primitive
            for each material:
                gather_import_material_before_hook
                gather_import_texture_before_hook
                gather_import_image_before_hook
                gather_import_image_after_hook
                gather_import_texture_after_hook
                gather_import_material_after_hook
        gather_import_mesh_after_hook

    else if it is a camera:
        gather_import_camera_before_hook
        gather_import_camera_after_hook

    else if it is a light:
        gather_import_light_before_hook
        gather_import_light_after_hook

    gather_import_node_after_hook

gather_import_scene_after_nodes_hook

gather_import_animations
for each animation:
    gather_import_animation_before_hook
    gather_import_animation_channel_before_hook
    gather_import_animation_channel_after_hook
    gather_import_animation_weight_before_hook
    gather_import_animation_weight_after_hook
    gather_import_animation_after_hook

gather_import_scene_after_animation_hook

My plan/implementation for the importer is:

Use gather_import_node_after_hook to keep track of which glTF node index turns into which Blender object:
def gather_import_node_after_hook(self, vnode, gltf_node, blender_object, gltf):
    self.object_by_node_index[vnode.mesh_node_idx] = blender_object

(Seems fragile, but also seems to work so far.)

Use gather_import_animations to loop through all the animations, find my extension data, and extract the info I need to decode:
def gather_import_animations(self, gltf_animations, animation_options, gltf):
    node_index_re = re.compile(r'^/nodes/(\d+)')
    for anim in gltf_animations:
        for channel in anim.channels:
            target = channel.target
            if target.path != 'pointer':
                continue

            for ext_name, data in target.extensions.items():
                if ext_name != khr_pointer_extension:
                    continue

                pointer = data.get("pointer")
                if not pointer or glTF_extension_name not in pointer:
                    continue

                node_index = int(node_index_re.match(pointer).group(1))
                blender_obj = self.object_by_node_index[node_index]
                sampler = anim.samplers[channel.sampler]
                self.vis_animations_to_add.append((blender_obj, anim.name, sampler))

(this step is also working as desired)

Sometime later, after the importer created all the other actions, go through the Blender scene, see if the blender_obj has an NLA Track with the right name already added; if so, add the FCurve data into it; it not, make a new action with the right name, and add FCurve data to that.
This is where I'm stuck.

The Question(s): Where in the importer extension am I supposed to be able to do this, and how am I supposed to modify the actions? Am I supposed to mutate some data structure during gather_import_animations, so the real importer does the work for me? Am I supposed to wait until gather_import_scene_after_animation_hook, and just use all bpy API to manually create the NLA tracks and actions, replicating code already in the importer add-on?
I lost a couple days trying to use the perfect-sounding BlenderNodeAnim.get_or_create_action() static method, before discovering that it was never meant for this purpose. I'm looking for guidance from anyone who has worked with this code base as to how an importer extension is supposed to elegantly integrate with the existing add-on.


text:
How to render cameras at larger resolutions using cycles?
Using Blender 4.2. I have several cameras with distinct settings. I want to render the scene using Cycles, once for each camera. I can use a single 3D Viewport filling my workspace, and make the camera my active view, to render at < screen resolution (due to UI and window chrome that gets in the way). However, I want to render at (slightly) larger than screen resolution. [This is not a "how do I render a 30k image" question.]
If I choose either View > Viewport Render Image or Render > Render Image I'm shown a completely blank/transparent image. Nothing renders, AFAICT. I find posts online where people say "Oh, yeah, you cannot use Viewport Render Image with Cycles"...but (a) I'm not sure if that's old information (e.g. Blender 2.8) and (b) it does not tell me HOW to render the view through a camera at a fixed size using Cycles.
I'm new to Blender, so I think I might be missing the workflow here. How am I supposed to kick off a render for a camera view using Cycles?

It is true that you cannot use Viewport Render Image when the viewport is in rendered view, only in the other shading modes. For the rest, I do not understand the question. You can set the resolution of the rendered image in the Output Properties, the resolution is not limited to the screen resolution so I'm not sure what you want.

"For the rest, I do not understand the question." The question was ~"if Viewport Render Image and Render Image both produce blank content, what am I supposed to do in order to actually render at the Output resolution". However, I realize I was too hasty: if I invoke Render Image and wait 30s, I start to get progress messages about it gathering the information needed to render. After another minute, the first pass is finally shown. I assumed I was doing something fundamentally wrong since the Viewport approach didn't work.

Render > Render Image (F12) is the correct approach, and does work with Cycles. Depending on scene complexity and computer performance, you may have to wait a long time before you see the first progress message indicating that it's getting ready to render, and an even longer time for the first pass of the Cycles renderer to fill the transparent image. Be patient.


text:
Animation Nodes: Object Instancer | Update instances & Splines from object origin
Experimenting again with animation nodes, I'd like my scene like:

Have a cube in the center which I can copy n times with the Object
Instancer node
The cube has a Modifier (Wireframe) and its rotation
keyframed
Make the relationship lines from the cube to its instances
visible by splines
Update the instances when Modifier and rotation of the source cube
change

I have problems with getting 3. and 4. working:

I managed to make splines between the instances visible but not from the source cube origin to its instances (like the relationship lines in the viewport. How should I do that?
The changed and animated value from the source cubes Wireframe Modifier are not applied to its instances "on the fly". Same goes for the rotation. I added 2 Triggers in the Toolpanel for the Node editor which do not have an effect. What do I miss here?

Any help appreciated :-)

Relationship Splines
Create edges using the Create Edges Node from a list filled with the location of the source object and the locations of the instanced objects, then use the Splines From Edges node to create splines from the edges, output the splines and you will have the relationship lines.

Instances Modifier Values
To understand why your values don't update, you have to understand how the Object Instancer Node works. By default (When only Copy From Source option is enabled) Animation Nodes create a number of empty objects equal to the number of instances and set their mesh to the mesh of the source object. Subsequently, non of the object properties (including modifiers and constraints) are retained, simply because object are created not copied. If Copy Full Object option is enabled, Animation Nodes will get the object's properties, modifiers and constraints from the source object and set them to the instances.
It is important to note, however, that Animation Nodes will first check the  objects that were created in a previous execution using the instancer node and if they matched the number of required objects, the node have no effect and just return the objects. If the number of objects were less than the required amount, it will create more and if they were more that the required amount, it will delete the extra. So even if you change any of the object properties or set different meshes, the node won't see the changes and won't take action. The only way to reset the properties is to set the number of instances to zero and set them back to the required amount.
So, to edit the values on realtime, you have to do that manually using the Attribute Nodes, that is, get the value of the property of the source and set it to the instances.

In the previous example, we set the thickness of the modifier modifiers["Wireframe"].thickness.

Thank you so much for your detailed explanation, this is exactly what I did miss/not understand before.

@ho.s :: To anyone doubt why this answer is really good, Omar himself is one of the most important developers of the Animation Node add-on.


text:
Skinning rigged model - Fine adjustments in Weight Painting for twisted skin
I made a very basic human body mesh and want to make my very first character animation with it. I rigged the model and when I made the rig the parent of the mesh I chose the option to apply automatic weights. When I move the head and legs in Pose Mode I am pretty happy with which parts of the Mesh are affected. But the arms are a desaster: I modelled them stretched out and when I try to bring them down in Pose Mode there is too much going on in the chest area, when I move the lower part of the arm the area around the "elbow" the "flesh/skin" is twisted; same is true for the hands and wrists. So I tried to adjust weights in Weight Painting Mode around these bones (and also tried to remove Faces from the Vertex Groups) but then I ended up getting this:

The problem I think is that I cannot subtract weight in small amounts, I can choose my brush to be just 10px but it will always be a very huge area (like a whole vertex) be selected while painting. Can that be more fine-tunded somehow? I ended up selecting my Mesh and applying weight from bones again. What can I do to not have twisted "flesh/skin" and to have the right (fine) amount of weight in the chest area influenced by the upper arm bones? This is my blend file.

You can subtract weight in small amounts, but it will still affect a large area, because the weight is per-vertex.
To change how much you add/subtract/etc., change the Strength slider in the left (T) panel.
As for exactly how much weight you need, I can't help you there. (:
(With your particular model, it's so low-poly I might just tweak the weights manually, from the Vertex Weights section in the right (N) panel.)

Ah ok I could have concluded that .. that the weight painting is of course vertex-wise. Thanks.. Ok and because my model is that lowpoly, .. now it makes sense :-) Vertices will not bend ^^ I think I'll try to make it a bit less lowpoly and give it another shot, maybe also by assigning the weight vertex-wise in properties panel ..

Glad I could help, good luck!

For future (also bloody beginner) readers of my post: To achieve the less low poly mesh and add more vertices to do a more finetuned weight painting/assigning I added and applied a Subdivision Surface Modifier to my model .. Now I still have to figure out which weights / distribution of weights around bone are best to have a smooth loooking skin which does so twist or fold

Yeah, that's the hard part. (:

BTW, if you just want a human model, there's a great tool called MakeHuman that allows you to create a (fully rigged) human model just by tweaking sliders!


text:
Apply shader color based on distance to mesh surface (Sculpted Mesh)
I have an asymmetrical Mesh with sculpted bubbles on it (edit: and a Multires Modifier). I would like to use a procedural shader and color the elevated bubbly parts differently from the rest.
This is an example of what it could look like:

As the bubbles can have different heights and are not equally positioned along any axis or the objects origin, using a Gradient Texture or Geometry Node with Separate Z axis like for these examples does not work of course:

I would need a condition based on the actual distance from the Mesh surface > 0. I found the Math Vector Node in Distance Mode which sounds promising, but I don't now how/if I could use it in my case.
Any ideas howto address the elevated areas? Can it be done by using only procedural nodes?
[using Blender 2.82]

A shader cannot show distance from the surface because in this case it is always on the surface. You could probably use Geometry node's pointiness output to achieve something like this to some extent. Or you could make the bumps with displacement so that you have a height map anyway.

You could work out something if you keep the base mesh without the bubbles and a dynamic paint setup with a canvas / brush set to "Proximity" but as Martynas stated, you won't be able to do it fully procedurally in the shader editor since the vertices are unaware of the entirety of the mesh they are a part of.

Ok .. I thought maybe as the Multires isn't applied there could be a way to access the original surface data / calc the geo height or sth., so my answer to this task is, it is not possible to achieve by just using nodes or Modifiers if the bubbles are sculpted as in my file. Thanks for your comments.

This is rather easy to do with an object that has a MultiResolution modifier as you mentioned. Such a mesh offers the possibility to bake the displacement from the base mesh to the subdivided one into a 32bit displacement map, and re-use that input for color ramps to drive the material color. Such a workflow also allows you to clearly distinguish between indentations and elevations as a bonus.
First, create your mesh as usual, and make sure there is a proper UV map to it. This UV map is critical for baking, so the better the layout, the better the displacement quality. Sculpt your detail into the MultiResolution modifier.
Next, create a texture of a reasonable size (I chose a 2K image in this example), and make sure it uses 32bit Float. This will make sure that there is enough image depth available to avoid banding artefacts in the texture, making it perfectly smooth:

Now create a material on the object, and use the image in the node tree, connecting it with the UV map. It doesn't matter yet where you connect the texture to, but you can already pipe it into a color ramp and the result of that into the Shader:

Now make sure that the image texture node in the Shader Node Tree is the active node (white highlight frame around it):

You are now ready to bake the displacement. The mode we will use records the difference between the Preview level of the modifier and the highest sculpt level, so in general you will set the preview level to 0 before baking:

Go to the Render Properties tab in the Properties Editor, and open the Bake Panel. Set the options as follows to bake the Multires Displacement data into a map:

By now, your object should look like this:

And after re-enabling the Preview subdivision levels to the max, like this:

Thanks for your detailed, well explained answer! Although I solved the original work in the meantime with the Vertex Paint approach I'll accept your answer bcs. it solves the original task best (plus I learned a lot, didn't know of this possibility)

As the comments state, there does not seem to be a solely procedural shading solution for the purpose to address the elevated areas of the sculpted Mesh.
But as I did not want to make a whole different approach to generate bubbles, I tried to find a solution being abled to work with the present Mesh. I used Vertex Paint and am happy with the result:

Steps:

Apply the Multiresolution Modifier
Add a new Vertex Color Slot in the Object Data Properties Panel (I named it BubbleCol)
In Vertex Paint Mode paint the elevated areas
In Shader / Node Editor add an Attribute Node and put the (exact!) name of the Vertex Color Slot in
Now you can use either the color output directly or as I did: Use the factor output of the Attribute Node to Mix two different shaders. This way it could be a different shader material too instead of only a different color.


text:
Trying to create a script that makes roofs on selected boxes
I hope this question isn't too broad for Blender stackexchange.
Quite often in my work I import topographical data specifying the flat geometry of buildings. I'm trying to make a script that put roofs on these buildings. I have some Python experiences, but I'm having a really tough time using Python in Blender, and haven't been able to find any in depth tutorials to help me on my way.
The goal of this script is to iterate of all selected faces, check if they have four sides, extrude the faces, then scale the shortest edges to 0. I want to have the shortest edges so to roof aligns correctly. See the image for an example of what I want to achieve.

Here is a quick script that extrudes selected faces of selected mesh objects, if the face has 4 vertices and the angle between the face normal and the up axis is lower than 3°:
import bpy
import bmesh
from math import degrees
from mathutils import Vector

up = Vector((0, 0, 1))

for ob in bpy.context.selected_editable_objects:
    if ob.type == 'MESH':
        me = ob.data
        if me.is_editmode:
            bm = bmesh.from_edit_mesh(me)
        else:
            bm = bmesh.new()
            bm.from_mesh(me)
        bm.normal_update()

        for face in bm.faces:
            if len(face.verts) == 4 and face.select:
                try:
                    angle = degrees(face.normal.angle(up))
                except ValueError:
                    continue
                if angle < 3: # some threshold
                    ret = bmesh.ops.extrude_face_region(bm, geom=[face])
                    verts = [e for e in ret['geom'] if isinstance(e, bmesh.types.BMVert)]
                    faces = [e for e in ret['geom'] if isinstance(e, bmesh.types.BMFace)]
                    bmesh.ops.translate(bm, vec=face.normal * -0.7, verts=verts)

                    e1, e2, e3, e4 = faces[0].edges
                    if (e1.calc_length() + e3.calc_length()) < (e2.calc_length() + e4.calc_length()):
                        edges = [e1, e3]
                    else:
                        edges = [e2, e4]
                    bmesh.ops.collapse(bm, edges=edges)

        if me.is_editmode:
            bmesh.update_edit_mesh(me)
        else:
            bm.to_mesh(me)
        me.update()

The two shorter edges of the top-face is collapsed to create a sensible roof.
Note that it doesn't account of degenerated quads (non-planar, self-intersecting), but should work good enough for your use case.

Here is another solution:
import bpy
import bmesh

def extrude_and_collapse(obj, height):
    if not obj or obj.mode != 'OBJECT':
        raise RuntimeException("requires object mode")

    bm = bmesh.new()
    bm.from_mesh(obj.data)

    selection = [face for face in bm.faces if face.select and len(face.verts) == 4]
    for face in selection:
        face.select = False

    result = bmesh.ops.extrude_face_region(
                            bm,
                            geom=selection,
                            use_keep_orig=False
                            )

    created_verts = tuple(elem for elem in result['geom'] if isinstance(elem, bmesh.types.BMVert))
    created_faces = tuple(elem for elem in result['geom'] if isinstance(elem, bmesh.types.BMFace))
    edit_faces = []

    for face in created_faces:
        face.tag = False
        for vertex in face.verts:
            if not vertex in created_verts:
                break
        else:
            face.tag = True
            edit_faces.append((face, face.normal.copy()))

    collapse_edges = set()
    for face, normal in edit_faces:
        for vertex in face.verts:
            n = 0
            for linked_face in vertex.link_faces:
                if linked_face.tag:
                    n += 1
            vertex.co += height * normal / n

        edge_min = min(face.edges, key=lambda x: x.calc_length())
        for loop in edge_min.link_loops:
            if loop.face == face:
                break
        loop = loop.link_loop_next
        loop = loop.link_loop_next
        edge_opposite = loop.edge

        collapse_edges.add(edge_min)
        collapse_edges.add(edge_opposite)

    bmesh.ops.collapse(
        bm,
        edges=list(collapse_edges)
        )

    bm.select_flush(True)
    bm.normal_update()
    bm.to_mesh(obj.data)
    bm.free()
    obj.data.update()

extrude_and_collapse(bpy.context.active_object, 1.0)

For the given task it should work. (Test #1, #2) But it is not bulletproof. There still might occur plenty of situtations which the script does not handle.

Another test Checking wether the edge ratio is correct, --- Selection, --- Result

@MarcClintDion He assumes all houses are one object and the top faces are selected. Than it works nicely.


text:
What is the best or fast way to add a star on top of a helmet?
To make it simpler, think helmet is a sphere.
Now I need to place a star or any other complex object you can think of - on it. It's a big star, and it looks like taking the half of the helmet - so it should be spherically bent too. It can be separate object.
(P.S. I watched another tutorial where the guy used boolean modifier in order to intersect two objects. The booleans seem to work on simple object. It didn't work in my case.)

I would suggest you use a shinkwrap modifier, as well as a solidify modifier to give it some thickness, and possibly a bevel:

This applies to any shape you'd like to project onto any surface.
Just keep in mind that you need to have enough geometry to allow it to deform smoothly, and preferably a quad loop around the border to avoid shading (or bevel) artefacts:

Starting with a sphere and a star as separate objects, align the view so that the view is straight on to the star (in the second image I used front view).

Select the star then the sphere, enter edit mode. Look oven on the tool shelf and press the Knife Project button. This is what you will get.

Thanks David, this helps a lot. Found this answer useful as the one I marked as an answer (because it was before)


text:
Modifying normals at bent corners to get a flat surface/sharp corner
I've been given a reduced-poly model of a car for real-time use. However, there are many instances where the geometry turns a sharp corner, and the vertex normals at that corner cause the specular reflections on the surface to appear to bend. I don't really care about the effect on the rounded lip edges (they almost abut other geometry). How can I most easily fix this so that the surfaces of the car appear flat and continuous?

Can I easily rotate the vertex normals at the corners to be perpendicular to the main face?
Some way to double-up the vertices at the corner, with different normals?
Something else?

The faces along the right side of this shape are (mostly) co-planar with the faces in the middle, but adjoin faces that bend at a 90 degree angle. The vertex normals along the corner average the two face angles, and cause reflections to bend increasingly across the face.
I need a solution that will affect exporting the model as glTF, not just rendering/appearance within Blender.

what about the Smooth by Angle modifier? Is it not what you want?

Looks like there's some odd shading applied to the object.
Try right-clicking the object and "Shade Auto Smooth"


text:
How do I import/append assets from blender to upbge?
Okay, so I've made some assets in blender 2.91.0 but, I want to put them into UPBGE to use them for a game I'm trying to make and I don't know how. Does anybody know how to help me get my 3d models/rigs,animations,etc into UPBGE from blender 2.91.0 ? I don't know how. I tried to just open the blend file in UPBGE but, that didn't work. I tried to use the append feature to get assets from a blend file I made in blender 2.91.0 but, that didn't work. I really don't know what to do. I'm new to using UPBGE.

Hello and welcome to BlenderStackExchange. I assume you downloaded and tried running a UPBGE 0.3x release? The latest version that is built on is Blender 3.0x, which may not be as compatibility to Blender 2.91.0 releases unfortunately. Unless you are attempting to import those Blender 2.91.0 models into say, a legacy UPBGE version such as UPBGE 0.25b, I'd suggest using the UPBGE 0.3x release built on Blender 2.91.0.
Download any release from UPBGE's official Github repository:
https://github.com/UPBGE/upbge/releases


text:
Deform/bend non-planar object over a surface
First off, I'm pretty new to blender, so I apologise if this is a basic problem/question.
I'm trying to create detail on a surface, and the most obvious way I can think of is to create a half cylinder and shrinkwrap it onto the surface. But I guess this only really works for planar type objects?
What's happening is that the cylinder is following the target surface properly, but it's totally squished flat onto the surface. I want to preserve the cylinder as it wraps over the surface.
Here's what I'm trying to do, I hope it explains it better than I can describe.
Target Object Surface:

The effect of the Shrink Wrap:

What I'm trying to emulate:

So the question is, is there a way to get shrinkwrap to do what I want, or is there a better way altogether?

Please use stackexchange built-in image adding tools instead of using external links.

do you mean that you want to bend a pipe? maybe use a Curve modifier?

@moonboots not the pipe, but the ribs on the muffler. Sorry, the first image I chose wasn't great

don't create a new object, create edge loops on your object and extrude

Rather than creating a new object, you could use your current object, create some edge loops:

Bevel them:

Only keep a part selected:

Press AltE to Extrude Faces Along Normals:

Here is what it gives when you give your object a Subdivision Surface modifier (put additional edge loops if you want to sharpen the edges):

Thanks, that will do exactly what I need


text:
How can I align the tilt of a curve to that of the nearest surface normal of a mesh?
I guess my question is the same as the one asked here:
How can I align the tilt of a GN generated curve to the nearest surface normal of a target? Although the answer that the op posted appears not to be quite working (not sure what  it does, but it certainly does not align the curve to the surface normals of the mesh)?
Basically I have a curve, that in my case is "shrinkwrapped" (using proximity node) onto a mesh, what Im looking to do is then have a quad strip array along that curve angled along the face normal of the mesh its "shrinkwrapped" onto.
Ive made some progress already based on answers Ive found here on stackexchange, but I cant quite figure out how to control the tilt of the curve so that it matches that of the face normal. Any help appreciated.
This is the blend file Im working with in caes anyone wanna solve the puzzle directly in place, Ive pointed an arrow to a node group that would ideally be modified to become functional):

I recently used this setup to align a curve to the surface of a mesh:
It samples the surface normal at each control point and rotates the current normal to the projected mesh normal. Hope this still helps!


text:
How do I give operators of my addon the "Assign Shortcut" button?
// Edit 2/20/2022:
First of all I just want to say that I still havent found a solution as of now! So more answers are needed.
So as by @pyCod3R 's example. If I were to replace the line bl_idname = "object.simple_operator"
with bl_idname = "fast_pbr.simple_operator". Again the issue appears in his example as well.
As my addon is somewhat large (Close to 20 operators total), I want them all to fit under the same roof, so if possible I would rather like to avoid registering them under simply "object".
So I guess the question has now changed to:
How do I enable the "Assign shortcut" button in RMB for operators registered with a custom namespace of my own? Do I need to "register" the namespace itself somewhere?
// End of edit
So Ive noticed that the popup menu which appears when right clicking any of the operators registered to the UI in my addon is missing the "Assign shortcut" button. I can still go into the keymaps preferences and add an entry there manually. I can also just add a hotkey using bpy using something like:
keyConfig.keymaps["Window"].keymap_items.new("fast_pbr.fast_upbge_pie", type="NONE", value="PRESS")
Where setting the type (which determines which key is assigned to the keymap entry we are adding) to NONE one would imagine the "Assign shortcut" thing to appear in the RMB menu, of which it does not (setting it to "NONE" results in no change to the RMB menu, setting it to anything but "NONE" results in "Change shortcut" to appear in the menu, but then we are assigning a shortcut, which in my case is undesired as I just want to make it easy for the users to assign a shortcut without actually holding any keys hostage by default).
Does anyone know how to get this "Assign Shortcut" button to appear for operators that I register myself as a part of my addon?

Thanks for reading

@MartyFouts are you sure this will achieve what the question asks ?

@MartyFouts can you be more specific here? Where does that Text variable live? Is it a parameter or a class member? Also like Gorgious said, are you sure you read my question correctly (Im not looing to override Add to quick favorites, I want to keep that there as well ofc. Assign shortcut offers different functionality)

Sorry, I did read the question wrong.

Works out of the box and there is nothing to do. Example of a built-in operator vs. custom operator, it's the same menu for both.

import bpy

class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

    def execute(self, context):
        return {'FINISHED'}

class HelloWorldPanel(bpy.types.Panel):
    """Creates a Panel in the Object properties window"""
    bl_label = "Hello World Panel"
    bl_idname = "OBJECT_PT_hello"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"

    def draw(self, context):
        layout = self.layout
        row = layout.row()
        row.operator("mesh.primitive_cube_add")
        row.operator(SimpleOperator.bl_idname)

def register():
    bpy.utils.register_class(SimpleOperator)
    bpy.utils.register_class(HelloWorldPanel)

def unregister():
    bpy.utils.unregister_class(SimpleOperator)
    bpy.utils.unregister_class(HelloWorldPanel)

if __name__ == "__main__":
    register()

Hi and sorry for the somewhat delayed reply!
It appears that if I replace
bl_idname = "object.simple_operator"
with
bl_idname = "fast_pbr.simple_operator"
in your example, the assign shortcut menu disappears! To keep my stuff organized I will want to register my things under my own name space (fast_pbr in this case). Any thoughts?
(Im guessing this is the issue Im having with my addon)


text:
Can I change the speed of an image sequence?
I'm using an image sequence in a material, it draws a series of incremental model outputs for a flooding on a landscape. However it's moving too fast for the rest of the flyover animation. It doesn't have to be completely smooth, so I'm hoping I can slow it down by say only using 1 frame of the image sequence for every 2 frames of the animation, or some other ratio. In other parts I would like to speed it up again. Is there a way to do this?
I can think of one way to hack it and that would be to write a python script which duplicates some interval of the image files and then changes the sequence numbers, but I'm hoping there is a more elegant way.

possible duplicate of Change Image sequence frame only every nth scene frame?

gandalf3, yes it is somewhat of a duplicate, but I don't think the answer to your question was satisfactory. If I want to do that method on a 5000 frame animation it will take forever, my suggested hack would be quicker. Maybe there is some Python magic that could be applied in Blender?

To change the speed so you have 5,000 images played over 10,000 frames of blender animation, you should only need two keyframes - frame 1 is image 1 and frame 10,000 is image 5,000 - ensure vector handles are used in the graph editor for a smooth change. For python magic use a driver instead of keyframes and make a python expression calculate which image to use based on current frame number.

sambler, I don't quite follow, could you elaborate on this in an answer? Then I could mark the question as answered.

It is possible by using drivers:

Add an Empty object somewhere;
In its Object panel, choose one Transform channel (such as Z Scale), type in #frame, then hit Enter to confirm. It will add a quick driver for the empty, make the Z scale value the same as the current frame number (e.g. If the current frame is 6, then the scale value will be driven to 6 automatically).
In Cycles Material node editor, move the mouse cursor over the Offset in Image Texture node, hit D to add a driver.
Open Graph Editor, switch to Driver mode, keep that node selected and you'll see the driver added. Set a variable based on the Z scale property of that Empty object. Type the expression like this: variable_name * speed_fac.

For example, in the example below, I used the variable name as var by default, and use 3 as speed factor, which means to make it playing 3X speed up.

NOTE:

It's recommended to control node-related drivers by object transform, which is the tricky part, due to the current dependency limit on nodes.
If The warning message occurs (as below), click Reload Trusted.

Using basically the same idea as the answer from Leung Cheung you can use keyframes to animate the offset property for the image texture.
Go to the first frame (Shift+←), hover the offset property and press I to insert a keyframe. Then navigate to the last frame and enter the new offset value (lower if you want to slow down the texture animation) and again insert a keyframe.
In the F-Curve editor you can then adapt the speed of your texture animation. Even speed ramps are possible that way.

Add effect strip -> speed control, then just make your image sequence length to 2 times or what you want
See it in the manual

Welcome to the site :) You might also want to add that this has to be done separately in the VSE.

thanks, this worked out for me!

This is perfect, and while I'm sure the driver method works this is much more direct and single-purpose.

Another possibility is to select all events in your timeline and then resize the length.


text:
Is there a way of keyframing RGB curves?
In the node editor the RGB Curves node only lets me keyframe the factor. The control points have boxes for x and y coordinates, but it doesn't allow me to keyframe these boxes. Is there a way around this?

All of the node data is available through python so a workaround could be to use a python script to adjust the curve at the right time.
To view the curve data you can use a script like -
import bpy

theCurveNode = bpy.data.materials['Material'].node_tree.nodes['RGB Curves']

print("R Curve points are:")
for point in theCurveNode.mapping.curves[0].points:
    print(point.location)

print("G Curve points are:")
for point in theCurveNode.mapping.curves[1].points:
    print(point.location)

print("B Curve points are:")
for point in theCurveNode.mapping.curves[2].points:
    print(point.location)

print("C Curve points are:")
for point in theCurveNode.mapping.curves[3].points:
    print(point.location)

So curves[] will always be 0-3 for RGBC and each curve can have any number of points. It would be tedious but you could use the script to generate a list of values that you then use as data for the script that imitates keyframes. Possibly calculating them or interpolating smoothly between frames.
theCurveNode.mapping.curves[1].points[2].location.x = myCurvePointLocX(1,2)
theCurveNode.mapping.curves[1].points[2].location.y = myCurvePointLocY(1,2)
theCurveNode.mapping.update()

Be sure to run mapping.update() after altering any curve points.
You could then setup a script that appends a function for bpy.app.handlers.frame_change_pre that alters the curves based on frame_current.
I can't say this is a recommended method but in theory it could work.

It's apparently not possible; as a workaround, you could use a different node that you can keyframe, or use two or more rgb curve nodes and animate a mix node between them:
add two or more rgb curve nodes using the same input and configure them as you like(for example each node reprents a key frame - start rgb values,intermediate rgb values, and end rgb values; mix their outputs in proper order using color mix nodes, and then animate the mix nodes factor. hope that's clear, sorry for the colossal delay, I've been signed in on a different account :)

Could you explain how to do this?

Good idea to use a RGB mix node as a workaround to keyframing RGB curve values. I wanted to make a sky get darker by keyframing the RGB curves, but ended up duplicating the sky (one light, one dark), and then transitioned from light to dark by keyframing the mix node. Worked great.


text:
Is it possible to dynamically reduce the number particles based on distance from camera?
I want to render an animation in which a car drives along a certain stretch of road. To one side there is a grass field, but this is quite big, both in the direction perpendicular to the car, and along the direction of travel. I don't have enough memory to put highly detailed grass on the whole field, so I was wondering if it was possible to reduce the number of grass strands based on the distance from the camera.
Or maybe there are other tricks to achieving this?

You can use a script that calculates the distance of each vertex in your grass field from the camera at each frame, and updates a vertex group controlling your particle system's density accordingly.

To get this to work:

Your grass field needs to have a vertex group, with all vertices included (create then select all verts and press "Assign").
In your particle system, you need to set this vertex group as the Density group, with inverted weight (see the image below).
Make sure to replace the names of your grass field object, particle system and vertex group if needed in the script (they're called "Plane", "ParticleSystem" and "Group" in the code below).
Open a text editor window, create a new text file, copy the code there and press "Run Script".

Here's the code:
import bpy

def weight_from_distance( scene ):
    floor = bpy.data.objects['Plane']  # <== REPLACE "Plane" with the name of your grass field object
    cam   = bpy.data.objects['Camera']

    vert_distances = [
        ( cam.location - floor.matrix_world @ v.co ).length for v in floor.data.vertices #Updated for 2.8+: Replaced '*' with '@'
    ]

    maxDist = max( vert_distances )
    minDist = min( vert_distances )

    for i, d in enumerate( vert_distances ):
        # Normalize distance and set as vertex weight
        floor.data.vertices[i].groups[0].weight = ( d - minDist ) / ( maxDist - minDist )

    pSysName      = 'ParticleSystem' # <== REPLACE with the name of your grass' particle system if needed
    vertGroupName = 'Group'          # <== REPLACE with the name of your vertex group if needed

    floor.particle_systems[ pSysName ].vertex_group_density = vertGroupName # Update / Refresh

bpy.app.handlers.frame_change_pre.append( weight_from_distance )

Amazing work, thanks! I'm going to try and implement this as soon as I have time. I hope you the grass won't flicker too much between density variations, but I guess that will be a matter of fine tuning.

Sure :) Flickering could be an issue. Let me know how it worked for you, I'm curious if this will be actually useful or if a smarter solution is needed.

Basically this same result can be done with dynamic paint.

Makes sense, @PGmath. However, isn't object intersection required for this  to work? (I guess you can parent a sphere to the camera to achieve this). By the way - might be worth another answer to demonstrate this.

@TLousky  I think you do need an actual mesh for the DP brush.  I'd use proximity instead of intersection though.

I'm not sure if theres a way of achieving this.
But
You can hide the grass in 3d view mode if you want, but let it still be visible while rendering. Here's a picture:

Simply click on the little eyeball to hide the grass. You can press the camera if you want to hide it in render mode.
I'm not sure if this completely solves your problem, but I'm guessing it's the best way to go.
Happy blending!

That doesn't work, as when I go and render my memory (16GB) overflows due to the millions of particles.

Sorry then. Don't know what to do...


text:
Planes rotating to face the camera, but only along one axis
I'm using planes as labels on a map over which the camera makes a path. The problem is that if I simply have flat labels they don't look good when the camera is low (blue dots in the animation). With the track to constraint I can make the labels follow the camera (red dots in animation).  The problem is that the labels on the sides also rotate along their Z axis which I don't want. I want the text to always be horizontal wrt the camera, like the labels do in Google Earth.

Try using the Copy Rotation constraint:


text:
Render every Nth frame of an animation
I want to render every Nth frame of an animation, in this case every 12th frame. This way I can play back the animation at 2fps and see if everything is going correctly.
I'm a real novice with Blender Python and cobbled this together:
import bpy

for f in range(startframe,endframe,NthFrame):
    bpy.context.scene.frame_current = f
    bpy.ops.render.render()
    bpy.data.images['Render Result'].save_render(filepath="" + str(f) + '.png')

This kind of works, the right images are rendered and saved. However it completely freezes up Blender, and after about an hour it crashes on windows due to being unresponsive I guess. How can I fix this? Preferably I'd like it to work like rendering an animation normally works, i.e. being able to still use Blender and seeing the progress of each rendered frame.

It's possible to do this without python by changing the Frame step in Render settings > Dimensions > Frame range:

Can't believe I missed that option. Works much better.


text:
problem rendering a camera obscura
I'm trying to render a camera obscura, the light effect shows up in the viewport but doesn't render

Here is the blender file:

Hello, maybe share your file? https://blend-exchange.com/

Here is the blender file

You have an object called boolean parquet that is disabled for preview but enabled for render, disable it or it will obstruct your camera:

I was thinking one day I should make an addon to check this kind of thing, and others.

@L0Lock That would be a good idea   ;)


text:
View not front on
When I'm in side view, I now see the sides of the object instead of it being flat like it was before. I've downloaded the most recent version of Blender, and now it's stuck like this, and I can't change it back.
Thanks

Hi :). Perhaps you're looking for View > Orthographic

It looks like your side view is in perspective instead of orthographic. You can manually switch between perspective and orthographic by pressing numpad 5.
By default, Blender automatically switches between perspective/orthographic view when you switch between free view and side/top/front views.
This is enabled by the "auto perspective" option in the preferences:


text:
Rigify leg issue
I'm having an issue with a Rigify armature I made where the leg bones bend in the wrong direction at the knee bone. I checked the pole targets, and they seem to be in the right location. I posted the blend file so that you can see the issue for yourself.

That's usually caused by the knee bone joints being too straight. Move the knee joints forwards so that there's a slight bend in the armature and see if that fixes it. The same applies to elbow joints in the arm. They should be set slightly back so that rigify knows which way to move the joint.

As explained on Bone Positioning Guide — Blender Manual
You need to add "a slight bend to the knee" (and also elbows):

This is needed for the IK solver to know in which direction to bend the chain.
Be careful to have the bend in only one local axis of the bones, and keep the bones aligned. Otherwise, it will bend in multiple axes at once, and it will be quite a headache to control for the animator.
To straighten your leg

Enable X mirror so to automatically make changes on both sides of the rig:

Select the heads of your left hip and foot bones:

Snap your cursor to your selection by pressing ⇧ ShiftS > Cursor To selected. You should have the cursor about where the knee is:

Select the knee bone's head and snap it to the cursor via ⇧ ShiftS > Selection to Cursor:

Select the knee and hip bone, and recalculate their roll by pressing ⇧ ShiftN > Global +Y Axis:

Press , to set your Transform Orientation to Normal, so to more easily edit the knee's head position without creating unwanted bends:

Use only the Y axis to change the knee's height, and use the Z axis to introduce a slight bend for the IK solver to pick up the bend orientation:

For the arms: same procedure, instead use Global -Y axis at step 5.

I tried doing that and re-generating the rig, but the issue still persists.

Have you aligned the leg in a straight line in the front view?  https://i.sstatic.net/RwL5a.jpg To do this place the 3D Cursor at the head of the left thigh (which is called hip.L for some reason in your metarig). Then select the thigh and shin, and press the period key to set the 3D Cursor as the pivot point. Now, you can press the keys S X 0 to align the bones in a line. Rotate them to match the mesh.

I added a procedure on how to straighten your leg with the correct rolls.


text:
I am using chat-gpt to make a UFO in Blender 3d, It is returning an error
import bpy

# Set the rendering resolution
bpy.context.scene.render.resolution_x = 1920
bpy.context.scene.render.resolution_y = 1080

# Set the output file path
bpy.context.scene.render.filepath = "output.mp4"

# Create a new scene
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete()

# Add a new icosphere to the scene
bpy.ops.mesh.primitive_ico_sphere_add()

# Select the icosphere
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.select_all(action='DESELECT')
bpy.context.view_layer.objects.active = bpy.context.view_layer.objects[-1]
bpy.context.view_layer.objects.active.select_set(True)

# Enter Edit mode
bpy.ops.object.mode_set(mode='EDIT')

# Extrude and scale the icosphere to create the basic shape of the UFO
bpy.ops.mesh.extrude_region_move(TRANSFORM_OT_translate={"value": (0, 0, 0.5)})
bpy.ops.transform.resize(value=(1.5, 1.5, 1))

# Add a loop cut to create a panel on the top of the UFO
bpy.ops.mesh.loop_cut_slide(MESH_OT_loopcut={"number_cuts": 1, "smoothness": 0, "falloff": 'INVERSE_SQUARE', "edge_index": 4, "mesh_select_mode_init": (True, False, False)})

# Extrude and scale the panel to create a cockpit
bpy.ops.mesh.extrude_region_move(TRANSFORM_OT_translate={"value": (0, 0, 0.5)})
bpy.ops.transform.resize(value=(1, 0.5, 1))

# Add a new empty for the UFO to rotate around
bpy.ops.object.empty_add(type='PLAIN_AXES')

# Set the keyframes for the UFO's rotation
bpy.context.view_layer.objects.active.rotation_euler[2] = 0
bpy.context.view_layer.objects.active.keyframe_insert(data_path="rotation_euler", index=2)

bpy.context.view_layer.objects.active.rotation_euler[2] = 3.14159
bpy.context.view_layer.objects.active.keyframe_insert(data_path="rotation_euler", index=2)

# Set the frame rate and duration of the animation
bpy.context.scene.render.fps = 24
bpy.context.scene.frame_end = 48

# Render the animation
bpy.ops.render.render(animation=True)

Traceback (most recent call last):
  File "\Text", line 32, in <module>
  File "C:\Program Files\Blender Foundation\Blender 3.1\3.1\scripts\modules\bpy\ops.py", line 132, in __call__
    ret = _op_call(self.idname_py(), None, kw)
AttributeError: Calling operator "bpy.ops.mesh.loop_cut_slide" error, could not be found
Error: Python script failed, check the message in the system console

I dont think my version is out of date, and I imported bpy

I think it is just a typo. bpy.ops.mesh.loop_cut_slide should be bpy.ops.mesh.loopcut_slide. No underscore between loop and cut.

You can copy the error code and ask ChatGPT to fix it. But with my experience it does get a ton of errors when doing something more complex than scattering objects

for the next error "expected a view3d region & editmesh" have a look here: https://blender.stackexchange.com/questions/15118/how-do-i-override-context-for-bpy-ops-mesh-loopcut -- 3) last error, you cannot add an empty (bpy.ops.object.empty_add...) when you're still in Edit mode or you will get another invalid context error. Switch to Object mode first (bpy.ops.object.mode_set(mode='OBJECT')) -- The UFO still looks a bit strange...