text:
Rotating particles in two different axis
I'm having some trouble randomizing these particles on top of my cylinder. My goal is to randomize the orientation of my particles with respect to the object's y-axis, which makes the particles stand up as shown in the image below, however now I am having some issues randomizing their phase in the z-axis. Hence they all look like they have a uniform rotation about the z-axis. Anyone have any ideas how I might be able to stand my particles up while also randomizing their phase in the z-axis? The origin of all my particles is located in the middle of their base at the bottom. I also tried creating duplicates and rotating them myself, but this didn't work out either. Please help! :(

Here's a setup for having the objects rotate only on 1 axis:

Hey Sanbaldo, thanks for the reply! I've been able to get it to randomize the phase about 1 axis, however I'm still having issues getting it to rotate about the z-axis. :( The best idea I was able to come up with was to make multiple objects with different z-axis rotations, then enable "Object Rotation", but I'm not sure if that would be the optimal solution.


text:
How to get rid of the odd lines shown in the image?
I made the texture 2048x2048 in GIMP.
The odd lines are caused by GIMP's blur.
I'm not killer with nodes, so how do I get the height map not to show these odd lines?

These "lines" are the border lines between different values on the height map. The Bump node converts grayscale gradients to normal map angles and the gradients only work on these borders (or value steps). Since you are using a 8 bit image you only have 256 different values to play with. To make things worse, you are only using a small part of that gamut (you don't use fully white to fully black) so you end up with about 70 grayscale values.
So what you need to do is to take your height map back to what ever image tool you use, convert it to a 16 or 32 bit image, adjust the levels so that the information uses the full gamut and blur the edges away.
This problem is a handling problem, not anything that a specific tool introduces.

I must add that too high compression level, e.g. RIOT plugin, gives this effect either and this cannot be helped. And it's hardly a question about Blender and 3D

@Lukasz-40sth I don't understand, do you mean that discussing bit depth or compression on a height map would be out-of-scope for this forum?

If you read my edit, Jackdaw, you see the original question was hardly within the scope. I said nothing, in it Blender, can help and the rest is just an explanation. Everything is OK to me.

Turns out Eevee has limits.
https://docs.blender.org/manual/en/dev/render/eevee/limitations.html#materials
the info about 8 bit n 32 bit was educational .I'll use that info from now on.

source: Stack Exchange

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

sort: votes


text:
Import human from MakeHuman has modifier which has (robe, hair and penis) which should not be there
Anyone seen this issue before?
I import my character from MakeHuman using the Import Human button. It was all normal.
I was having trouble parenting my rig, so I deleted doubles(Merge vertices 'by distance'), but that did not help.
Next, I read that deleting unnecessary modifiers can help. So I tried that and when I deleted the last modifier, my character had a robe, wig and penis.....wut?
No mater what I change, the issue persists.
Any ideas?

I don't have makehuman installed on my machine right now, but the modifier you're showing is the Mask modifier that hides certain vertex groups. You're seeing the "helper" geometry that is supposed to aid in fitting hair and clothes to the MH basemesh.

Thanks Ron. Do you know if there is anyway to disable this before import?

Found the answer. Here ya go yall

That looks right. You can save settings as presets if you load a lot of MHX2 files

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


text:
Can't use loop cut on some faces
I can't describe it with words, so I recorded video.
video
And I can't even cut them separately.
Can anyone help with it?

Only thing that i can think of is that there has to be double vertex or something similar. If the model is absolutely the same, it would be a bug. Just try select all vertexes and merge by distance, if there will be some merging there were more vertexes in one.

double vertex or face inside or separated faces?

There wasn't any double vertex. I tried merge all vertexes by distance and it says me "Removed 0 vertices".

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

ok I uploaded it. link in the post now

https://blender.stackexchange.com/questions/57150 https://blender.stackexchange.com/questions/17870

So as I said you have inner faces, but there are hidden so you need to unhide and delete. You can't create edge loops if the edge separates more than 2 faces, and by the way those inner faces are not good for your topology, it may create artifacts.

thanls a lot for help, i will try to delete them.


text:
Transform this into a flat surface
How can i transform this sphere into a flat terrain with the pattern of the sphere ?

you mean you want to make an animation of it unfolding/flattening?

No, i want this Sphere to be like terrain

a terrain with the same kind of geometry?

A flat surface with the pattern that the sphere has

ok so perhaps edit your question to make it more understandable  ;)

I'm not sure it's even possible, what's possible in 3D won't be on a flat terrain, or it will be distorted like a map of the earth if you see what I mean

I only want that a plane has the same pattern/texture as the sphere

He wants the terrain to have the same topology.

Two ways of doing this:

Use that sphere for knife project tool

Cut the sphere in half in Edit Mode
Choose Top View
In Object mode select your sphere, and then select the pane
Go into Edit Mode and Knife Project

Collapse the sphere

Cut the sphere in half in Edit Mode
Select all vertices
Scale it along the Z axis to 0 (On a keyboard: S + Z + 0)

I am quite new to Blender myself, but in my experience, these are the two easy ways of achieving it.


text:
Can't offset even with Extrude to Cursor
I am complete beginner to Blender, and trying to do extrude a basic obloid shape (a 'wall') at an angle, only along x and y axes (ie I'm in top orthographic view), keeping the wall exactly same thickness. I have seen someone doing this in youtube video, with the extrude to cursor tool, I think they previously set the 'Offset Even' option to do this, but Offset Even checkbox is not available on this tool I think?
So I turned Offset Even on with another tool, switched to this one, but it's not preserved setting.
See enclosed picture for what I want. Anyway, however I do it, I am not offsetting even, and the wall thickness varies with the angle I extrude to, not what I want :-(
I am using Blender 2.8. Thanks so much any ideas?
Update
I must be doing something wrong, tried @moonboots solution below, and still got walls different thickness when I extrude normals from planes with offset even. I guess can just copy walls and move round, but would be nice if possible make this work.

As Trey Harper says, it's normal, given that when you rotate your face the thickness decrease.
You could to do it with the Shear tool and some align view to face but it must be a bit tedious.
Maybe the best solution is to build a flat wall (or delete the thickness in your case as you've already built your wall), then select all, AltE > Extrude Faces Along Normals, extrude, and make sure that the Offset Even option is enabled in the Operator box to keep an even thickness.

The edge loop created as you extrude is staying the same size, but when an angle is forced, the "wall" thickness changes based on the new angle.
The only way to correct for this is to rotate the edge loop as to go along.


text:
How to render animation of a spheres inside a cube? After rendering i see only cube please help me out
I added few spheres in a cube. What should I do to see all objects after rendering
Sorry for bad image.

I am trying to make animation of electrons moving between a metal bar. But when I render it shows only the bar

if your cubes are opaque, how could we see the spheres?

there is a screenshot function in windows. Snipping tool. 2. you're displaying the bar as wired, but it's getting rendered in solid. Uncheck camera visibility in cycles for the bar.

Please use https://www.take-a-screenshot.org/ for clearer screenshots. Thanks.


text:
Render angle is different to viewport
I am new to Blender and I am rendering a title animation. I see that the angle of the render is different to the viewport angle. The angle of the render is 45 degrees, just like the camera angle and I want it to be like my front view, just flat.  Can you advise how to change settings to get a render with the same angle as the viewport please? Thanks a lot for your answer. Best regards, Maarten Fenenga.

Hi. Please use the edit button below your question to add images that give us a better idea about your problem. Also, please read this to learn how you could help us to give good answers.

If don't want to have perspective effects you change your camera to orthogonal.

Hello Luca, Thanks very much for your quick reply. I did change to orthogonal and I did this by going to the Scene collection and click on camera, then the camera icon appears in the tool box under the scene collection. I was able to scale the ortho to the right size as well. Thanks again!


text:
Drive the viewport display color from a 'combine color' node
The following video shows how to 'drive' an object's viewport display color by its base color.
https://www.dropbox.com/scl/fi/ucdvh12ak1trpcipbmbcp/2024-04-22_06-56-25.mp4?rlkey=a3kseg8n8722rd7nmgzga99dy&dl=0
Is there a way, however, to 'drive' an object's viewport display color by the result color from a 'Combine Color' node, for example? Basically want to average all the colors of a texture, and apply that color to the object's viewport display color.
... but still have the texture viewable in 'Rendered' or 'Material Preview' mode.

Hi Ryan, i am not sure, but it looks like that you didn't understand the vector input node of the image texture node. The input is not (!) a color, but a UV coordinate. This UV coordinate will be used to determine the color of the output, which is the color of the image at that UV coordinate. So you don't get the color of a combine color node by your node setup. You have to plugin the combine color directly in the color input of your principled bsdf node for that behaviour.

...and one more thing: you asked already some questions here as you can see: [1]: https://i.sstatic.net/LHRjxIdr.png. As you notice there is nothing green there, green means: you clicked on the checkmark left of an answer to 1) reward the one who answers for his effort and 2) tell everybody else that the answer is useful. So please be a good citizen and click on that checkmark for all answers which helped you and which also shows that you aren't totally unthankful. thx.

will do.  A lot of those questions did not have answers per se but I usually up vote comments, etc.  I will look back just to make sure.

The information is unfortunately not available because it is computed at runtime and delivered straight to the GPU.
When you manually input a rgb color in the color field (or a float value in a float field, ...), you set up the "default value" of the field, which is statically available from the API and which you can use to setup a driver.
When you draw a link from socket to socket, you tell the field to ditch the default value and wait for the previous node to be evaluated to compute its own value.
However you can setup a simple script to read the values of the pixels of an image and tweak a material viewport color.
Reference : https://blender.stackexchange.com/a/214510/86891
import bpy
import numpy as np

img = bpy.data.images["Image.png"]  # Case sensitive
x, y = img.size
pixels = np.empty(x * y << 2, dtype=np.float32)
img.pixels.foreach_get(pixels)
mean_color_rgb = np.mean(pixels.reshape((x, y, 4))[:, :, :3], axis=(0, 1))  # Don't average alpha value

mat = bpy.data.materials["Material"]  # Case sensitive
mat.diffuse_color = list(mean_color_rgb) + [1]  # Add alpha value to the mean

Thanks @Gorgious!  Can this script be made into a shader node? Or would you have to run this externally, for every material definition?

@RyanSchultz This can't be made into a shader node, because only OSL is supported (you would also lose supported for GPU) and the shader doesn't have any links nor can it change the values of properties outside of its scope. and for performance reasons you don't want it to run continually so I think making it into its own script and adding it to a button in the interface or a handy add-on would make sense.

Okay, good to know!  For what it's worth, as you probably saw on the OSarch forum, stefanm2 suggested the following plugin, but doesn't seem to work with 4.1:
https://www.blendernation.com/2020/03/06/free-addon-to-set-viewport-color-based-on-nodetree/

for those following, @Gorgious provided further insight here: https://community.osarch.org/discussion/comment/20276/#Comment_20276


text:
Prevent material flicking in Blender animations
Is there a way to prevent the material flicking, as you can see in the following video?
I understand that it's most likely from objects being too close to one another, but they are modeled so one object covers another, by 1 or 2 inches.  That is, they are not coplanar.
Is there a setting one can use to fix this problem?
video: https://www.youtube.com/watch?v=vlqKx5hdk3U
edit:
blender file: https://gitlab.com/openingdesign/highland_haven/-/blob/837de31cb8ca0d78a9e1fe44440ddcc3a845d066/Models_and_CAD/BlenderBIM/Highland_Haven.blend

there's a problem somewhere, it can be the camera clipping values or Z fighting, hard to say, maybe share your scene (just keep one house)?

Hi, here's the blend file: https://gitlab.com/openingdesign/highland_haven/-/blob/837de31cb8ca0d78a9e1fe44440ddcc3a845d066/Models_and_CAD/BlenderBIM/Highland_Haven.blend

So it looks like you have overlapping faces in your roofs, what does it give if you remove or move up a bit a roof that is overlapping?

I increased the clipping start distance, and it 'seems' to have corrected it!

maybe also move up the roofs to avoid z fighting as well

You have overlapping faces in the roof, it creates a Z fighting effect, if you want to keep these roof layers, at least move them a bit to create a tiny gap:


text:
The number of samples in the render view does not go up
I don't speak English, so I use a translation tool!
The number of samples doesn't go up in the viewport render view, but somehow the number of samples goes up when the blender is minimized!
Is there a way to increase the sample size without minimizing it?
After editing.
At first time i open render of viewport,  it dose not work properly. but once when i minimize the window that number is going up properly,  What i want to know is the way not to minimize??

That's a challenge. sample size goes up, meaning Blender keeps rendering? What language to you speak, maybe someone can help clarify.

Hi, welcome, images may help, edit your question and add a screenshot showing how you are comparing those numbers...

As I can see you have a volumetric which takes alot of time to render so when you minimize it is still rendering and the sampled number increases .You can increase rendering in the viewport by decreasing the size of the viewport or using your GPU if you have one.


text:
My scene looks like it's a hobby model
I don't know why my scene looks like a hobby model. (like one of those things people paint and glue) Picture below. Is there any way I can improve this and make it look more realistic? I want it to look like a photo taken from a plane. I think mainly it's the runway and planes that need some TLC. Any suggestions?

@Patisawesome200 what do you mean by opinion based?

@Patisawesome200 is this better?

@Patisawesome200 better yet?

@Patisawesome200 what do you mean by small details from image textures? And how would I sculpt/texture paint it?

Did you properly set your light up? When handling huge object, the environment light will become very critical part since that's how we can notice the thing is huge. And you might want to use a focal length at maybe 12mm or 14mm since we don't take picture on moon with Hubble space telescope to see a vessel in this kind of angle

@HikariTW Ok ill try that


text:
Issue with join when shaded smooth
I'm new to Blender and am trying to get my head around things and practice what I've learnt. I'm sure I've done something wrong order here, but I'm having an issue:
I modelled a glass with a handle, starting by creating the glass shape from a cylinder. I then extruded the top of the handle out by selecting that face and hitting 'E'. Then, using the spin tool I created the handle loop (spinning down towards where the handle connects near the bottom of the glass). Then I used the Bridge tool to connect the round shape to the bottom of the glass.
For some reason, although the bottom connection between glass and handle looks perfect, the top one looks way too sharp. I can't quite work out what I've done wrong here! Any help would be appreciated.

you should check the normals, remove doubles, check inner faces...

Ahh. Your comment prompted me to check the inside face and I realised, I probably should have applied my Solidify modifier first?

no, don't apply the modifier! check if the mesh is correct before!

The edges are darker on the problematic area. This indicates there is overlapping geometry there. Maybe you tapped "E" twice when first extruding ? Try going into edit mode and selecting all vertices, then go right click > Merge > By distance

Ahh. I already applied the modifier and it fixed the issue. However, if it's bad workflow, I'll give it another go without applying! I'm just practising so I'll have a few goes.


text:
How to make multiple light array objects follow curve path with rotation as well?
I was trying to array large amount of lamp posts across my scene with the lamp post being "face instancing" on a rectangle with array and curve modifiers.
I want two light object located at each lamp, so I parent them towards the rectangle, and now I face the issue of light objects are not rotating according to the reference curve.
Attached File:

Thanks!

Hello :). I'm unable to reproduce the issue. If you share the file I'll be sure to look into it :).

hello Jachym, I meet the same problem, could you please share your file?

I had updated post with attached blender file, please take a look thanks!


text:
How to get Z-distance (not depth) from camera to object for every pixel in the frame?
I am currently doing a computer vision task and got stuck on the following problem. I need ground truth values for my sequence. I have a nice sequence where the camera moves trough my scene and captures the RGB-frames. Now, I need a corresponding frame for every RGB-frame, but instead of the RGB-values it should store the distance. I know, that you can get the total depth (euclidean distance from camera to real-world-object) by connecting the 'Depth'-output of the Render Layer Node to a File Output Node in the Compositing workspace using the EXR file format. But I just need the Z-component of the distance to the camera and I don't want to convert it afterwards with the camera parameters (already did it, but I need a cleaner workflow).
I stumbled upon this function: bpy_extras.view3d_utils.region_2d_to_location_3d , but could find almost nothing about how to use it properly. I don't know what I should give it as input.
Has anyone a solution or maybe already used the function and can explain me how i would use it in the default Blender setup (just a Cube, Camera and Light) and if it does what I expect it to do (giving the x,y,z and then I can strip the unnecessary information)?
I already tried using the world_to_camera_view function, but this only works for object-parameters like vertices and not for the whole surface to create a dense map.
I also know, that you can render the scene with a Cycles material to store x,y,z in the RGB-channels, but there you only get world-coordinates and you have to change the materials after you rendered the real sequence.
I really need just a frame with z-distance to the camera for every pixel in the frame.
I would be really grateful if someone could help me, because I've been trying to do that for days now. I posted the same question before, here at stackoverflow, but I thought it might be more suitable to post it here now, because it is blender-specific.
EDIT:

I am interested in getting  for every pixel  on my image plane.
The way I am doing it currently is, that I get the depth   for  from Blender and then I use the Thales' theorem to get  with my known focal length and the known principal point.
My problem with this solution is, that I don't get the actual true values for  because of the discrete pixels. A simple plane that is parallel to my camera (image plane) at the z-distance of 10 metres will give me values between 9.98 and 10.02 metres after my current approach.

Related https://blender.stackexchange.com/questions/28557/problem-with-casting-rays-from-the-camera-into-the-scene-for-each-pixel  Raycast into a scene, get the object and local location of hit if hit. Feeding global loc back into world to camera "should" give correlating results. Also see questions relating to camera projection matrix.

An ortho camera would give depth from camera plane?

The question you mentioned looks promising. I will try it. I think using an ortho-camera would change the camera parameters and therefore the depths wouldn't correlate to the pixels of my RGB-images anymore.

with ortho cam scaled to match frustum of persp camera

The Camera Data node will give you a shader which will return the values you are looking for in the pixels of an image.
Here's a calibration scene. The camera is at World (0,0,1), the planes are at Z = 0, 1, 2, 3.

With this shader set-up, the pixel-value will be Z-component of the vector from the camera to the shading-point. ( You could also have shaded the planes using the Texture Coordinate node, in the Object space of the camera, and taken the Z component of that)

The nodes in the 'Illustration Only' frame are there to bring the lengths into a 0-1 range.. you wouldn't use those. Ensure the render output is linear, (set the Color Management to 'Raw'), and save to a floating-point format, probably, as you say, EXR, (in which case, as @susu has commented, color transforms will be bypassed.)

EXR will bypass color transforms so it doesn't matter what settings are used for color management, it will be linear data. To ensure linear output on display referred formats use Raw. Standard will curve data by adding a "gamma curve".

@susu Thanks. Edited. Wow. The more I read on this, the more confused I get.

I think you could easily build a shader which calculates any relation between world position and camera position as well as orientation/direction. The shader node graph gives you the option to access the camera position/direction and the world position of any shading point. Additionally there are Vector Math nodes which help you to calculate whatever value you have in mind.
https://docs.blender.org/manual/en/latest/render/shader_nodes/input/camera_data.html
https://docs.blender.org/manual/en/latest/render/shader_nodes/converter/vector_math.html
https://docs.blender.org/manual/en/latest/render/shader_nodes/input/geometry.html
If you need more help on this I would ask you to elaborate on your issue with a small drawing so I can better understand which component of the depth you would like to see in the pass.

just edited my question with a drawing. My problem is not to get the position of the camera or the position of an object. My shading point you mean the object-point that is getting represented in the image-plane when rendering the image? How can I call every shading point for my 1920×1080 px?


text:
Dark shadow on some faces, already recalculated normals and merged vertices
I'm encountered similar problems a few times and can't figure it out. I have simple low poly mesh, normals are correct and there are no extra vertices but still some faces look darker.

flat shading mode
Proof of no extra vertices
https://gfycat.com/niftyshockedclingfish.gif

Merging faces by Distance with the default value only works, if the vertices share almost the exact same coordinate. It looks like you have copied vertices that are of by a tad more than that. Try Merge by Distance again, but change the distance value (bottom left corner) to a higher value

I did the same thing but there are no extra vertices.

Looks quite like a duplicate of this https://blender.stackexchange.com/questions/133816/bad-shading-on-imported-mesh or linked one in there

This error is most probably caused by shade smooth.
To fix this go to object data properties -> Normals -> Check the Auto Smooth Checkbox

Did you try to shade flat (Object mode, right-click or press W and there is an option)? And move the vertex. Maybe there is more than one.

There is no extra vertices I checked few times and the image I posted is already flat shaded. Also I tried smooth shaded too but nothing changed.

select those dark faces and press on f3 and search for flipped normals try that

Nothing changed :(


text:
Blendshapes wont create!
I'm trying to create i blend shape but after i finish making one, the vertices never reset and don't even move after i edited them. Please help! https://gyazo.com/2328df14475881eb5ed40e57ad29846e
I tried creating it at 0 that still didn't make any difference, it's not the first time i create blend shapes on this same mesh and it worked fine before, now i'm completely confused as to what happened.
P.S. the vertices screw up the mesh as well when moving the blendshape value or deleting the blendshape, mesh looks deformed.

you can press L to select the whole mesh, you don't need to switch to the material tab and press Select, but that doesn't anwser  ;)  maybe share your file? https://blend-exchange.giantcowfilms.com/

The file you're working on, you created it with another version of Blender or are you using the same version you created the file with?

i never change my blender version from 2.79 it was always on it

Try again or use another way to share file (someone will upload it :)

I can't download with the site you're using (dropmefile), I don't know why

http://www.mediafire.com/file/tt9hjbg9d3dyi48/tail+(1).blend/file

"Automatically merge vertices at the same location" is on...

So, turn it off to solve the issue.

OMG u saved me! thank u so much!


text:
Blender only rendering one frame from animation - Using Cell Fracturing
The animation is 40 frames long, however Blender will only repeat the first frame 40 times.
I have tried changing the output format (I.e. PNG) but does not change anything. I just get 40 *.png files.

http://www.mediafire.com/file/1dcy81gt9967r5j/Explosion.blend/file

Have you baked the simulation ?

No. I've just been looking into that. Do you know how to bake Cell Fracture animations? I will keep looking. Ty.

press here and bake it for render.


text:
Blender suddenly crashing Desktop Environment
I have used Blender for atleast a year now, and suddenly certain normal actions are causing blender to crash my Window Manager entirely. Actions that are causing this include importing textures, and certain actions in rendered view like looking around in rendered view. I have not had this issue at all before, and I am having a similar issue with UPBGE. I am running the latest version of Blender on Steam on ArchLinux, my Desktop Environment is XFCE4, Display Manager is LightDM, and I have a Nvidia 960M GPU.
EDIT: I decided to download blender 2.80 from blender.org, and it is working perfectly fine with no issues, so the issue must be with 2.83.

Does that happen with the version from blender.org?

If it suddenly started crashing, but worked properly before, then the question is what has been changed on your system? Were you using the same version of Blender before? Have you checked that the GPU is working correctly and is using a recent graphics driver?

Reinstall blender and enable extensions one by one till it starts to crash again.

I have already installed 2.83 from blender.org, and it also has the same issue. I tried to verify files on steam, and it found 174 invalid files, but even after it fixed that the issue persisted.


text:
Rigging two-handed weapon in Blender 2.8
I'm having trouble with rigging a two-handed weapon in Blender 2.82. Basically, I want to achieve this:

Such gif was retrieved from a previous questions and answer, but the solution applied for a Blender version lower from 2.8 so does not apply the same.
I think I did something wrong. I followed the solution propposed by @moonboots. However, when I move the gun, the hands do not follow it in terms of translation, only rotation. What could be?

have you tried with a Child Of constraint for both the 2 hands?

I'm not sure I follow the nature of the suggestion. I'm not that experienced with rigging. So, how could I implement your answer?

Create a root bone for your gun, create 2 children bones, one for handle 1, one for handle 2:

In Pose mode, give each of your hand controller a Child Of constraint, with the handle 1 and handle 2 as Target, click on Set Inverse:

Move each controller close to the handle, move the fingers so that it looks like they are grabbing the handles, keyframe:

Move your gun, the hands should follow:

Just awesome. Works perfectly. Thank you so much.

I got a problem in terms of translation. What could be? I edited the original question to show my issue. @moonboots

It doesn't sound like you have IK arms, while @moonboots 's solution assumes you do.  Try giving your arms IK controllers, then child-of the IK controllers to the gun.

Yes what I called controller bones are the IK target, is it your problem?

Once again, I'm sorry for looking like an annoying noob (which in basic terms, I am) but I'm not sure how to do the IK arms thing. I mean, I know there's the modifier, but don't know how to use it.@Nathan @moonboots

follow this tutorial: https://www.youtube.com/watch?v=0bFrZn8xlLw

I think I got it. Was like adding a "Child Of" constraint, but instead "Inverse Kinematics" with the target bone, right?

IK are for the lowerarms. You need to create a bone that will be the target of the IK (that will control the lowerarm), in my screenshots it's the vertical bone under the wrist. You'll give these controllers a Child Of constraint so that they will be themselves controlled by the bones of the gun

@moonboots I achieved my objective. Thank you so much for the advicing.


text:
How to get rotation of constrained object?
So let's imagine I have a gun pointing at a target. Gun has copy location constraint to locate to another object that rotates around the same axis as the gun. Gun has track to constraint to keep it pointing towards the target (just up/down movement, rotation around its y axis which is x axis in world space). On it's 0-position there is an initial angle of about 10 degrees of up (measured by hand).
How do you actually get the gun rotation so I can set its allowed range to -55 to +55 deg? How do I even get the gun rotation value at all? The gun object rotation in the n.menu transform panel is 0 and never changes no matter how I move the target. I've tried using limit rotation constraint but it is totally broken and just set's the object rotation to its max value
Here is a sample file:
http://www.mediafire.com/file/c4x62lx6kmil7nu/constraints.zip/file
The rotation of the rectangle object causes the "gun" to go outside of its rotation limits. The cylinder should point towards the target as long as its angle is inside its local rotation limits. These rotation limits come from the rectangle object.
In other words the angle limit is for the angle between the rectangle and the cylinder. Cylinder moves with the rectangle (rectangle just rotates) and cylinder points at the target as long as its angles are inside its limits.

A Limit Rotation after a Track To constraint seems to works, but maybe share your file? https://blend-exchange.giantcowfilms.com/

Thanks. I have added a sample file.

The file you've linked works as it is supposed to work, you've given a Limit Rotation on the X axis of -30° and 30°, as seen below. 0° on the X axis is a flat axis (in Global axis but also in cylinder's Local axis if you ever switch to it).

If you want the gun to follow the angle you're displaying you need to choose Min -60° and Max 0°.

If you want the angle to be relative to the rectangle rotations, don't use a Copy Location for your cylinder, parent it to the rectangle so that it's new Global orientations depends on the rectangle, not on the world. Also don't forget to limit on Z so that it doesn't flip.

Rotate the rectangular piece and the limits are exceeded. The cylinder follows the rectangle and doesn't respect its rotation limits

because you've given your cylinder a Copy Location constraint, Copy Location won't change the cylinder's Global axis, it is still the world, but if you parent it to the rectangle, it will consider it as its new Global axis

ok, that works, thank you. Is there a way to get the rotation angle for a constrained object? The cylinder angle still stays 0 no matter what. The limits work but how do you get the angle it is at?

I don't know, maybe you should open a new question


text:
Does instancing work with boolean modifier?
I am looking at trying to create a flexible system that allows me to place hole patterns on part I am making. Basically it is a riot shield and I want  a hole pattern on it.
I am trying to use instancing to create the hole pattern but it does not do anything. So I have a plane called shield1. I have another plane with subdiv modifier called holes1. I have a small cylinder parented to holes called cyl1. Holes1 has instancing set to vertices. When I try to add boolean modifier to shield1 using the instanced holes1 nothing happens.
So does instancing even work with booleans or modifiers?
example .blend file:
https://www93.zippyshare.com/v/1eSm1urQ/file.html

Trying to visualize, but others will probably appreciate images...

I'll add a blend file in a sec

The point instances aren't "real" geometry when you instance them.  They're instances, which follow their own rules.  But in 2.93, it's possible to turn GN instances into real geometry just by following them up with any sort of modifier, after which a boolean will work properly:

You can see here that I'm using a modifier that isn't even doing anything.  Note that some modifiers look like they're smart enough, sometimes, to know when they're not doing anything, and so don't even make real geometry out of instances on certain settings (a 0.0 strength displacement, for example.)

If you don't mind a destructive approach you can convert all instances in real objects and use them in the boolean.
With the instance object selected Ctrl+A>Make Instances Real to convert all instances in actual objects, Shift+Select an Object to make an active, Ctrl+J to turn all instances in one object and use this as the boolean object.

I do mind which is why I am trying to use instances :). But it seems instances don't work with booleans.


text:
Merging curves created one curve object with two connected splines in it - how to fix?
I have two bezier curves. I can't join them no matter what I try. Pressing F when two nearest vertices of bezier are selected does nothing. The curves are in same direction and non-cyclic. However I did manage to join them somehow. My current issue is that I have 1 curve object which is two splines. One of the splines has no segments so the curve is now ignored by all other objects.
How do I make the curve into one spline that has segments? Below is a blend file of the issue:
https://www44.zippyshare.com/v/YMcWVaJz/file.html
Here is an image that kinda shows the issue:

If the question is about the addon, and not general workflow then gifs and/or images would be especially helpful to help users understand your problem.

Blender does not allow a curve with branching points.  It allows multiple segments.  You can join two curves by connecting end points. Maybe if you write about your final goal in your question then readers can make better suggestions.  Can you use multiple curve objects to achieve your goal?  Can you state what failed?

It is not a branch. Just two splines inside one curve object with apparently one of the splines not having segments. Just open the blend file. Try to set another object to it sing the curve modifier for example. There is something weird going on.


text:
Is my blender somehow bugged (lots of useless drop down menus)
I just updated from 2.82 to latest 2.91. This is what I noticed immediatelly. The modifiers take twice as much space. On the left is 2.82 and on the right is 2.91.

Is this supposed to be like that or is my version broken in some way? I used my startup file and prefs from 2.82, should I redo my install or is it really supposed to be like that?

More options: more fun! (and more confusion as well), If you don't need all of the new parameters available to you, in favor of some screen real estate, you can click on the triangles for the parameter to minimize them.

Maybe because this is an old file all the menus have been expanded automatically?   Just so you know, Apply and Copy are now located under the drop down arrow next to the viewport and render visibility buttons.

There are only two new options, the shell and the rim vertex groups at the bottom. The rest is pretty much the same. Just with tons of wasted space and a lot more scrolling. To me this looks and feels like a big downgrade. I use modifiers a lot and this adds a lot of unnecessary scrolling for me. I think I'll stay with 2.82 until there is an addon that fixes this.

If you don't want the new options of the new version, then you probably don't need to upgrade. Work in the old one. No need to be unhappy.

Well I am unhappy as this makes all future blender versions annoying for me. I'd like to use the latest software so I can have the complete toolset available to me and having to stay back because of these kind of issues is annoying. But in reality I just don't understand how making the menus take more space and hiding stuff under countless dropdown menus is an improvement. No matter how I look it the left side image is better in every imaginable way.

This is normal. I think it is because:
A) The bigger layout is easier to work with, and
B) It's probably easier to code as well. Just stacking the widgets has got to be simpler than the compact format.

I dislike it a lot. If I have couple of modifiers for an object then the modifier list gets really long and cumbersome to use very quickly. Constant need to scroll and click dropdown menus open to access basic functionality. I don't see how bigger layout with ore wasted space is easier to work with. I think I'll stay with 2.83.

Does collapsing the modifier GUIs by clicking those little arrows help you any? They little triangles next to the names of every sub-area of the modifier.


text:
The light passes through edges of a model
The problem is as in the pictures. When Rendered mode is on, light passes through the edges of the model. When exporting to Unity3D, the problem is the same.

Blend file: https://drive.google.com/file/d/1ghvqRvovUO_ul_0DJACBYCKao5_dKI9g/view?usp=sharing

Select your light, and in the light properties panel, tick the "contact shadows" box.

I did it but nothing has changed.

Hmm. Not  sure then. Maybe try giving your plane some thickness? It's kind of hard to tell anything else from the photo.

Could you please see what is wrong with this model?
https://drive.google.com/file/d/1ghvqRvovUO_ul_0DJACBYCKao5_dKI9g/view?usp=sharing

First off, your light type is sun, of which 1000 is WAY too high a value. 10-15 is considered (almost too) strong for a sun light, and most people don't go over 5. I suggest changing it's type to a point light and setting the brightness to 2000 or something... or move it closer. However, If you want a light with good shadows coming (seemingly uniformly) from one direction, I would use a large area light instead of a sun. Looks more natural I think.

Also, you should up the distance of your contact shadows to something like 2M, and in your render properties tab, under shadows, make sure both "high bitdepth" and "soft shadows" are checked. It's not PERFECT, but it makes it a whole lot better.


text:
How do I diffuse light that responds to the thickness of an object?
I have an image of a lampshade that I am trying to make a material shader for. I have a bulb inside that is a point light or I have also used a light bulb model with emission for cycles. I am trying to render in cycles to get a photo realistic render.
I can't go with emission because I need the subsurface to stay white corresponding with the subsurface image.

Lampshades that are lit by an point light from the inside often benefit from some transmission value to allow the light to "pass" through the shade, which should respond to thickness the way you want.

Hello :). Please add some reference image, so we know what exactly you're going for.

I added a couple of images of a render and the shade I put together with translucency and sss


text:
Cant get camera to move through my corridor
I am having a problem.
Can my problem be caused because there is already an animation in my project?
What I want, a video for a music track of mine.
What I have is a corridor with some kind of red light, reacting to my music.
Next thing I want is the camera to fly through the corridor.
I must be doing something wrong.
At the start I hit I and insert a keyframe location, then go to the end and move camera to end of corridor.
I see two yellow squares appear in the time line.
When I then click in the view port all is gone.
And trying to do calculate I found in a question like this does not work either.
Is there maybe a good tutorial explaining this?
A vid of what I have now, so you guys can get an idea on what I am after.
The corridor I have is now much longer then in the vid.
Start frame is 1, end frame is 6600.
https://www.youtube.com/watch?v=fbJrFz2nKls

Although I now have a new problem, I was using the wrong constrain.
Maybe I can redo the keyframes, because now my camera starts at the end.
Think I am gonna take a short break. Lost count on how many tutorials I watched, and it never works like that in my project.
Maybe I will start with new simple file, to see if I can figure this camera movement, and then find the issue in my project.
I do wonder if my problems come from another animation.
All tutorial I see have only one animation.
Mine has two, red lights reacting to my music track, and then the camera moving animation.
Maybe I should add the music track last?
Edit: I am getting desperate, somebody on Blender artist said I was doing it wrong I needed to add a plane add a curve modefier, and parent the camera to the plane.
Although the plane does what I want, the camera like before refuses to work along.
No matter what I try, like the other solutions given to me, the camera refuses to work along.
I hope somebody can help me, I hope I packed the file right with the mp3, that is used to animate the red lights. There is a license on the music track, but that comes down to, as long as you admit you got it from me, you can with it what you like.(its also on soundcloud)

A picture showing the issue, were the plane is, the camera should be too:

Edit:
Somebody had a look at my file, and his conclusion is that there is an issue with my file. I will be starting over with a new file, then make the path, plane and camera working, and then add back the other stuff, to see if I can find were the problem comes from.

I do not understand why you accepted an answer and keep on asking more questions on the same post. If the issue was resolved then ask further questions in a different post. If the answer didn't solve the issue then don't mark it as accepted.

I might be better off starting a new question, but I can explain what I did.
I have a problem, then somebody told me how to do it. I tried that but it did not work in my file.
It does how ever work, when I start a new file, that's why I marked it as accepted.
I just removed the accepted tag though.
I added the blend file posted a new picture, but nobody seems to see this?
It was what you and others who told me to do this, edit the original post.
Not looking for an argument, but getting confused on what you want me to ?
I even put the word edit in front of my edit.

Try using the Follow Path Constraint on your camera. Here is an simple example: https://www.youtube.com/watch?v=7dMD8ihmkiA
Make sure to click "Follow Curve" on the Camera's Follow Path Constraint:

That looks like what I need but I can't get it to work.
As we type I have the camera follow the path ( clamp to path constrain)
But the camera keeps looking straight ahead, instead of looking a the directing of the bezier curve.
When I try to use the follow path constrain working. it seems I am not allowed to select my bezier curve. it askes for a camera ? but what ever I select, nothing happens.
This is what I have now:
https://www.youtube.com/watch?v=MMXg4ssXzWc

Make sure you click "Follow Curve" on the camera constraint

There is another really cool method I learned from this youtube video: https://www.youtube.com/watch?v=a7qyW1G350g
Basically, you use auto key frames while moving the camera manually in walk mode using the WASD keys (like a video game), then use keyframe resampling to smooth the motion out.

You need to press I twice, the first time to set the keyframe at the start of the animation and the second time to define the end of the animation

I am still not getting it fully but I have my camera moving although very slow.
Progress :)
Pressing I twice seems to have done the trick.

Almost there:
https://youtu.be/MMXg4ssXzWc

I was again having issues inserting a keyframe, and found this:
Can't insert keyframe in blender 2.81

You have to press [I] while holding your mouse on whatever you want to
make a key frame on.

I finally got it working. https://blenderartists.org/t/animate-camera-problem/1241041
Things I did wrong:
Origins of the path, plane and camera not lined up.
The way I parented the camera to the plane. I used the option from the right site of the screen, but should have done, object, parent, vertex triangle.
https://www.youtube.com/watch?v=wz5DDCSuZP4&feature=youtu.be
To do:
Fix some caps and add a bit more details to some places, and figure out how to speed up the camera.


text:
Camera follows path, but is not looking the direction I want
I think the easiest way to explain is the next two pictures.

Cant seem to add two pictures with the add picture option.?
If a moderator knows how to fix that ?
Edit:
The problem I am having, it's not working.
Can it be that another animation is messing things up?
I am using follow path, but were the bezier curve I am using, is going to the right the camera just moves straight on. Unless I also add a clamp to track constrain.
Here is a vid of also the weird stuff happening.
Maybe I need to upload the file so people can have a look ?
The music track made by me. I am trying to make a vid for it.
Next is a link to another video, that shows the other animation, which is working fine. But I do wonder if this one is messing the other animation up (the camera moving). https://www.youtube.com/watch?v=fbJrFz2nKls&feature=youtu.be
I have set a start frame (1) and an end frame of (6650), which matches the end of the music track.
Edit 2.
I just did a test and deleted the bezier curve.
The animation of the camera movement keeps working. (although only in a straight line off course )
For me this is proof that the second animation I have is causing this problem. (or the way I have set it up)
The first animation is the red lights reacting to my music track.
From frame 1 to frame 6650. This length matches the duration of the music track.
I also notice that although the camera movement is working I don't see any keyframes markers in the window below the scene.
After adding an empty, see what is happening, the exact same problem I have with the camera. Follow path and follow curve get ignored, and I don't understand why.

If you use a Follow Path constraint, you can simply enable the Follow Curve option, and the camera orientation should follow the curve. In that case deactivate the Clamp To constraint. If you don't want to use a Follow Path, just keyframe the camera rotation.

I am giving up on on this. For a reason I can't figure out, this is not working in my project.
I suspect it has to do with the second animation I have.
The only way I can have my camera follow the path I made (a bezier curve) is to use the clamp too constrain. Gonna try for now with inserting an empty object.
The follow curve options gets ignored. I hope its not a bug, but my inexperience with Blender.

I've had success by making the camera track an "empty" object. You could have the empty follow the curve directly in front of the camera, and link the camera to it.
Here's a video describing this technique
https://www.youtube.com/watch?v=ageV_llb0Hk

Make a rig
Speculative answer re the "chicanery" illustrated in question.  If you are going to be driving along the path may pay to set up a rig to both  move along path and  "look where you're driving"

Recalling the techiniques uses in the (now dated but) classic car rigs of ROUBAL.  Rather than look in the direction of the tangent of the curve (follow path) when driving our eyes, even our steering reacts to looking around the curve.
By threading a mesh onto a curve using a curve modifier, can move it along the length of the curve via one of its local dimensions, ie the one assigned to follow curve in modifier.  In image above Y is used. A simple driver based on frame makes it constantly lap the closed curve.  .
This is explained in more detail here.  https://blender.stackexchange.com/a/133032/15543
Using much the same as in trains example, make a simple "rig mesh" to which camera is constrained to location of one end and tracks to other.

Camera constrained to "rig mesh" vertex group "root" a single vert at the origin of the mesh, and tracking to a vertex group "Tip" a single vert at other end.
As displayed in gif above, scaling the "rig mesh" focuses further / closer down curve.

Right now struggle-ling because I messed something up.
I might go back to a older version of my project before I started to animate the camera.
And start over with the camera movement.
Making a rig, might be what I am after.
Also gonna study the more detailed version.


text:
How to do this in Blender and select multiple things at ones or is there a better way to do this?
In the end it will be a video, for a music track of mine, a fly though through the corridor.
Let met start with a few picture to explain what I am trying to achieve.
( and a vid )
My question is not about the fly through part, it's about how to model the corridor around the bends.

https://www.youtube.com/watch?v=fbJrFz2nKls
The problem I am having , is how to get not just the hull around the bends, but also the pipes and other details.
The bends I made in edit mode, select edges, then spin (45 degrees) then fill (F)  then extrude, and again spin.
Then delete the faces I used to extrude.
Wiling to share the blend file if that helps explaining my problem.
I hope the answer won't be, I will have to do this part for part.
I am getting the feeling I am doing it too much the 3D cad way, not the Blender way.
I thought I had figured it out so I made the hull a parent, and the details childern, but this does not work for edit mode, only for object mode.

Hi. Please use the built-in uploader when adding images. See: https://meta.stackexchange.com/questions/75491/how-to-upload-an-image-to-a-post . You can use the [edit] link below your question to change them. Thanks.

I guess that you are using an array modifier since your pattern is repeating itself. I think you can very easily achieve your goal with a curve and a curve modifier.
Create you hull-block.

Create a curve and tweak it as you need. You can force the control points to be linear by selecting them and the shortcut V > Vector.

Add an array modifier to your hull, set the length to "Fit curve" to your new curve.
You may need to tweak the direction depending on in which direction you modeled your hull.

Add a curve modifier and set the object to your curve. You may need to tweak the axis or rotate your object in edit mode to get the correct result, You can also tweak the "Roll" parameter of your curve's control points.

Result :

Let's say you have a multitude of different objects to add to the array, you would have to use a "Constant offset" instead. Let's say the block dimensions are 2 meters in the Y axis :

Now you have your pipe elements which are 2 meters long and some kind of repeating thing on top.

Select all these elements and set their origin to the world origin. Make sure you apply the transforms with CTRL + A > Apply all. Now keep them selected and select your hull object as the last object, and choose Object > Make Links > Modifiers.
Result :

Thank you, this is exactly what I need. Will have to do some tweaking to my model, so I can use the array modifier like you do in the example, but thats not a big deal.
Also like how you're screen is divided. I might copy that.
The blend file is saved to my pc. :)
You made me very happy :)

@GuusPoort If this answer has solved your problem you should consider 'accepting' it to mark the question as solved. See: https://blender.stackexchange.com/help/someone-answers

Can't yet use the bezier curves but while reading the manual, I found something else, I have been wondering about.
Extrude along a path is possible with those curves too, interesting.


text:
Can't find certain command settings
I have a background with 3D cad, and since a few days I am trying to learn blender.
When you use the extrude and or subdivide command there are of course some setting.
Stetting like use origine of each surface.
Now my problem, most of the time I can't find those settings, that influence the command.
I am trying to follow some tutorials, and sometimes my blender acts like in the tutorial, but also some times it does not. I understand this is because of those setting but I can find them.
What am I doing wrong? :)
And example of a tutorial I try to follow:
https://www.youtube.com/watch?v=X2lw9JwTrI8&list=PLNShHVjao84f33iutaehtc_k6pR_hZMKt&index=3&t=0s
Subdivide instead of scaling each surface, I see blender do something different.
Where are those setting hiding ?
Blender 2.8

are you talking about the Operator box? It appears on the bottom left of your 3D view just after an operation, but disappears as soon as you launch another one. Not sure about your "subdivide instead of scaling" though...

Thank you
That is probably what I am looking for, I am gonna have a look.
About subdivide, in the tutorial all surface scale inwards, when I try to do this , only the outside of the surface scale , but stay clued together on the inside.
This must be caused by some setting, but I am having huge issues finding it. :)

I think I found it :)
As you said, bottom left a panel appears, I only need to click it to show the options.
One of the setting related to this, individual, when I select this, blender does what I want to do. You saved my day.

about your second question please tell at what minute of the video you're referring to

Its all solved, I feel a bit of stupid, but I just had to click the panel so it opens and shows the setting I could not find.
3min 40 he says Make sure individual is selected.
I could not find that setting, but now with your help I could.
Thank you

I am still struggling.
Made a screenshot which should help explain my problem.
https://i.imgur.com/dxQcfEg.png
That panel in the red square, can't I make this appear right away?
It seems it only appears after I dragged the yellow plus sign.
I don't get the logic behind that, why does this not appear right after I selected the command. ?

it's the Operator box, it will be there once you've made the operation. Your question is relevant though, I guess there must be a reason but I can't tell   :/

It seems that clicking in the viewport is the only way, and then you might have to set some values to 0 before proceeding.


text:
Setting blender context for uv editing issue
I'm trying to run this command, I crash after print 1, which I guess has something to do with setting another context but no idea how to bite it to get it to work... Any hints?
        print("Update graph")
        bpy.context.evaluated_depsgraph_get()
        for window in bpy.context.window_manager.windows:
            screen = window.screen
            for area in screen.areas:
                if area.type == 'VIEW_3D':
                    #set context to 3dview
                    cont = bpy.context.copy()
                    cont['area'] = area
                    cont['region'] = area.regions[-1]
                    bpy.ops.view3d.view_selected(cont)
                    break

        if len(objects) > 0 and cont is not None:
            # Deselect all
            for obj in objects:
                if obj.type == 'MESH':
                    obj.select_set(state=False)

            #Select 1 by 1, and apply the uv system.
            for obj in objects:
                if obj.type == "MESH":
                    obj.select_set(state=True)
                    print("1",cont)
                    bpy.ops.object.editmode_toggle(cont)
                    print("2",cont)
                    bpy.ops.mesh.select_all(action='SELECT')
                    print("3",cont)
                    bpy.ops.uv.smart_project(cont)
                    print("4",cont)
                    bpy.ops.object.editmode_toggle(cont)
                    obj.select_set(state=False)

TIA
I have missed some explanations.
This function is called by a persistent handler
@persistent
def load_handler(dummy):
    bpy.app.timers.register(actionQueue.runInternalFastTimer)

def register()
      bpy.app.handlers.load_post.append(load_handler)

Its done this way as I'm sending command to it from a threadX that is not blender thread. So the idea is to push job function ptr to a queue that then  gets called/executed by blender in its own correct thread.
However at that stage I have wrong context and I get this error >
RuntimeError: Operator bpy.ops.object.editmode_toggle.poll() failed, context is incorrect

EDIT A more comprehensive example of the issue can be found here (second post) > https://devtalk.blender.org/t/creating-a-valid-context-for-uv-editing/15670

What is in the error log? Code is not full. What is objects? If this is bpy.data.objects and some objects are not in the context viewlayer, select_set will raise Error. cont is defined only in if statement, so if there's no 'VIEW_3D' area Error is also will be raised.

Hey, apology objects its bpy.context.view_layer.objects.selected, The function gets called by a bpy.app.timers.register(actionQueue.runInternalFastTimer) Which gets send there from another thread. Esentially I'm pushing a job from threadX to blender thread via timers. When the timmer run the function it has wrong context.

@AndreySokolov I've updated original question with more info. I'm sorry for lack of it from the start.

This is why it is generally recommended to avoid using bpy.ops as far as this is possible: Blender operators are very context-dependent, and it's pretty hard here to find out what is the exact problem with the context for bpy.ops.object.editmode_toggle(). I'd suggest trying to write the full context override instead of bpy.context.copy(), including exact "window", "screen", "area", "region" and "scene". But the problem also may be anywhere else: current mode, no active object, hidden objects... really too many cases to guess.

@AndreySokolov yes I try to avoid them. But I'm not sure how else can I perform this action. I just want to batch apply UV mapping to all selected objects. Any ideas? I tried doing full copy, but that seem to not work either :- (

Maybe after deselecting all objects some deselected non-mesh object remains active object, or there's no active object in the scene at all. Selecting objects this way doesn't make the last selected object active as if it would be done by user. Try to make one of the selected mesh objects active object for the context view layer. It can be done with bpy.context.view_layer.objects.active =  some object

@AndreySokolov Super latte reply. Apology, I tried the active object, sadly did not help. I keep on having the wrong context and I have no idea how to generate/create/get the correct context :/ I tried now ignoring the entire set editabkle/etc and just called directly > bpy.ops.uv.smart_project() This is the error log > its interesting ! https://pastebin.com/VHiF89Mw

Well, in the first long-long line there is really no active_object key in the Context dictionary which is supposed to determine the context active object. It leads to the AttributeError, the active object remains unset in the Context which leads to the error in the smart_project operator's @poll method (which determines condition which allows to execute the Operator). You may try to somehow manually add active_object to the Context dictionary.

Running this script from the cli, I can unwrap an object in the background (no gui window).
I think the key point is setting the active object not just selecting it. I also create a uvmap layer if one doesn't exist and use mode_set rather that editmode_toggle.
import bpy

# Deselect all
bpy.ops.object.select_all(action='DESELECT')

for obj in bpy.context.scene.objects:
    if obj.type == 'MESH':
        obj.select_set(state=True)
        bpy.context.view_layer.objects.active = obj
        bpy.ops.object.mode_set(mode='EDIT')
        bpy.ops.mesh.select_all(action='SELECT')
        if len(obj.data.uv_layers) == 0:
            obj.data.uv_layers.new()
        bpy.ops.uv.smart_project()
        bpy.ops.object.mode_set(mode='OBJECT')
        bpy.ops.wm.save_mainfile()

I saved it as uvproject.py and used the cli command
blender -b test.blend -P uvproject.py

Hey, I can see it working because its being send from correct thread/managed by blender. But it wont work with my example above... Here is forum post with more examplantion in post2 as to the issue > https://devtalk.blender.org/t/creating-a-valid-context-for-uv-editing/15670


text:
armature relation off center
I have parented a grease pencil drawing to a bone and when I try rotating the bone they don't rotate around the same path. What am I missing? This has worked for me once but then it never worked again so I am at a loss of ideas on what might be wrong.
Starting position

After rotation

Update: Blender file can be found at

Please let me know if I need to provide the blender file too.

I don't know anything about rigging grease pencil, but are you sure the small bone doesn't influence your object?

I believe not. It is set up for InverseKinematics only. It doesn't have any parent associated.

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

I have attached the blend file. Thank you fot taking a look into this.

oh ok it's a grease pencil object, I don't know anything about grease pencil and rigging grease pencil so I hope someone will be able to help

This issue happens because your Grease Pencil object has transform data (location).

To fix this: first, in the Stroke tab, unparent the armature from your layer, otherwise the layer will move when you apply the new position.

Then use Ctrl+A or open the object menu and apply the necessary transforms (in this case, location). After this, your location data should revert to 0 but your drawings will stay in the same position. Then, parent the layers to the armature bones again.

Thanks for this. I would never guessed that the solution is so simple.


text:
Duplicating a group - (right now it just puts it as a sub group when you do)
First you make a group from 3 items. When you select the "entire group" when duplicating, the following happens:

The items are not in a new group. I can understand that when you copy items inside a group, you want them to stay inside. However, it would be good if you could select the entire group specifically, and copy it in its entirety.
Am i missing something?
If not, is there a quicker way then instead of having to remove them first, then adding them to a separate new group?  It gets very tedious after a while

It isn't clear enough what's the problem. If you want to organize a scene using groups, create one from some objects and add it as a group instance (Shift+A > Group Instance), not by duplicating. To select all the elements of the group use Shift+G > Group.

I tried to be as clear as possible smile. When duplicating an entire group. It does not duplicate the group. it only duplicates the items and keeps them inside the same group.

I really don't know how i can be more clear :P
Duplicate a group just like in photoshop for example, where it makes a Group (2) with all its contents inside.

In Blender you don't duplicate group to make objects from group to be repeated across the scene. You add instance of a group by pressing Shift+A > "Name of group". If you want to create completely another group Group2 which could be edited independetly from Group1 then you create another group either by Ctrl+G or in Properties Editor > Object tab.

Yes, when you select a group and then you try to hit Ctrl + D.
It duplicates all the object but puts it inside the same Group.
To fix this try to copy/past e(Ctrl C, Ctrl V) after selecting the group.
It will then duplicate the group

This worked for me. Hope it helps.

After using Shift+D to duplicate the group it will indeed create those ugly copies. No, go to Objects > Group > Remove From All Groups. Then just regroup them.
All the objects of interest should've stayed selected.

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


text:
Convert Blender Internal To Cycles/Eevee?
I'm wanting to re-render a project I made in Blender 2.79. It was made with Blender Internal, but since it's gone in newer versions, the project just doesn't look right in both Eevee nor Cycles. My project has white text on a white background on top of a white plane. I was re-creating a bumper from a TV show I used to watch.
Blender Internal:

Eevee:

Cycles:

Is there any way I can properly convert this to Cycles or Eevee? I'd love to get this re-rendered, plus get this rendered with a transparent background (with only the logo) while keeping all the shading intact.

Probably this could be a way https://blender.stackexchange.com/a/152877/2214 ... if not (since) you use envy for lightning as well, you would have to set such effect manually (if you would have some issues with that share your file with us).

@vklidu I'm not really sure how to use this unfortunately. I have it enabled but I don't know how to get it to show up. Here's the blend. https://drive.google.com/file/d/1xkPMpe8DXiWTTObYEsmhyIaawM8f_eT3/view?usp=sharing

Add some ambien occlusion in EEVEE and play with the settings, also turn on "space screen reflection"

Under Blender 2.79 there is an add-on Material Util Specials that converts BI to Cycles (see link in Q's comment), but it converts materials, your setup is more complex, more than materials it use environment lightning.
I don't think there is an one click way to switch BI to  Eevee or Cycles for you. So here is my adjustments to get closer to BI.

Mainly you use two Point lights and Ambient Occlusion.
There are a few things to care ...
Text object extrusion seems to be shaded only as Smooth under Blender 3.x (or I missed some setup) ... clearly visible on letter K.

To fix that, you can convert the Text object into a Mesh and enable Auto Smooth or for non-destructive way, you can just add EdgeSplit  modifier to the Text object ...

The main shading effect here is done by Ambient Occlusion ...

So probably you are already satisfied with this result, so you can stop to investigate further.

If you want to combine with light it becomes a bit tricky ... Ambient Occlusion is visible only when World color is set to white, but when World light is pure white, than scene lights doesn't affects result anymore.
To see the scene lights effect, you need darker environment ...
Spot_01

Spot_02

Notes:

opening old (2.79) blend file in a newer version converts light strength values into overexposed light, so you have to manually adjust them to something like this ... for soft shadows change Radius > 2.

Don't forget enable Contact Shadows ...

Mixing the lights and AO together I had to set world color to  0.5 ... for Plane reflections set this simple material ... don't forget to enable Screen Space Reflection under Render Properties.

For black environment (asked in comment) ...
For Plane - enable Material Nodes and setup reflective material there ...

For propper reflection you should probably add Light Probe > Reflection Plane object (Probe > Distance 0.02) ...

Ambient Occlusion has no effect for black environment here (as mentioned earlier), so I disabled it and also Spot_02 light is OFF in this screenshot.

Late, but thanks. This helps out a lot. I made another version of this, but the background and the plane is black. Is there any way I could do the same thing while keeping the reflections?

Yeah ... I spent 6h to compare with 2.79, manage all issues there and present ... quite a lot for such "simple" thing. Especially I had to attach all objects into a new file (I could not figure out what makes all objects black even with a new cube). Since in a new file it was fine so some scene mismatch data.


text:
diference between preview and render

Hello
i ma a bit noob... but i need to make glass for helmet which i will put on someone face after that...
so i would like to have the same resoluts with preview render and final render.
so please can someone help me to have the sam resoluts in preview like in render ? thanks
it happend just when i do that glass transparent for render (so that mabie happend in old version too i am not sure now)
here is non transparent shoot:

is there a subsurf modifier on your model, the lower render doesn't support this, but is there anything different between preview and render settigns?

it was... but not any more... - and still the same resolut

can i send you that file ? i do not know where are some preview render settings ...

https://drive.google.com/file/d/1PSOeJB4dgv130vQRj1NtwlUuWvJRAq3-/view?usp=sharing

for now i helped it with higher IOR... but that is not at all the solution :( -> this is reason why i lefted cinema 4D 7 years ago.. becouse theyer preview render was so diferent to final render...

I found a solution: You can refine the alpha channel post render, here is how:

Just use any node that can influence a gradient and stick it in between the native alpha channel and the one of the output node.

Could someone elaborate why this answer is unhelpful?

this is not rly the solution... this solution at the end looks even more diferent than actual glass from shaders... but thanks... i get better resolut with that diferent IOR.

I said "a" solution, not "the" solution. I actually thought once you're compositing this might help out a lot, bc. you don't have to re-render when the head is slightly too concealed by the reflections. The other thing could quite likely be a bug, or a general shortcoming.


text:
Randomizing f-curve offsets for many objects?
I have a scene where I need to light up spheres with emission in a cyclic pattern, where they oscillate between a high point of brightness and a low one.
I want to control the oscilation as I please, the frequency or the limits of the values of brightness. So I connected a value node to the emission node and added a sine f-curve to that value. This gives me precise control over the oscillation, however they all do the animation simultaneously. There is an offset option in the f-curve modifier menu, but I could not utilise it for my purpose.
How can I offset this effect for around 1000 balls, so they all seem flickering randomly? I just want those sine curves for each object randomly offsetted.
Edit:
I also thought maybe animation nodes could be helpful, and I'm not still sure if it could be used to solve my specific problem; but animation nodes system looks very confusing and I'm absolute beginner there. Therefore it did not lead anywhere. Can it be used for this purpose, and if so, how?

Any other route of solution with instructions, to the main problem, is welcome too.

you can use a python script for this kind of task

I cannot even write a single line of phyton or any other code. Can anyone provide such a snippet, if it is relatively simple? I'd greatly appreciate it.

If u provide your blend file - I will write the script

open https://blend-exchange.com/ and follow instructions...but only if thibserts answer doesn't satisfy you...

I've added the blend file, you can see it now.

Instead of a F-Curve, you could use a Shader Node based solution, using the Random output of the Object Info node as an offset.

"frequency", "amplitude" and "minimum" are just Value Nodes, I added them for clarity. You can control your sine signal with them. They are quite equivalent to "phase multiplier", "amplitude" and "value offset" in the FCurve sine modifier.
"frame driver" is a value node with a Driver : simply type "#frame"  in the field ; it will output the number of the current frame.
Object Info/Random output a random value for each object, between 0.0 and 1.0.
Blue nodes are Math nodes which perform this operation : (sine(frame/frequency + random)+1) * amplitude + minimum

It could be more elegant (and convenient) to keep your FCurve and somehow mix it with the Random value, but I hadn't be able to figure how. Also, you can add some math node to fit your needs (ie, add a minimum or maximum value)

In fact, you SHOULD add a minimum vale (plug a "greater than : 0") just before the Emission node. In my screenshot, you get negative values for Emission Strength, which leads to quite inacurate results

Even if added the greater than node, it still gives black for some balls. And I could not figure it out how to sex maximum and minimum brightness in this setup, nor how quickly they would oscillate between these values. Can you please explain how to achieve these with your setup?

I updated my answer with a better solution. sine(x)+1 gives values between 0 and 2, so no negative values (and more sinusoidal than a "greater than 0"). "Minimum" is the lower Strength any light can have. With amplitude = 1 and minimum = 0.3, you should have a signal similar as the one you shown in your screenshot.

I've added a multiply math node after random output, before it connects to add node which connects to sine node. That seemed to gave me more control. I'm still checking for the desired effect. If no new problems arise, it seems like your node system did solve my problem. Thanks so much in advance.


text:
Non manifold structure
I tried to create a manifold structure but Blender keeps complaining that the structure is not manifold. I can't figure out what to do as according to what I see, it is manifold.
What are the steps to have it watertight?structure bottom

In the picture of the bottom I see overlapping faces. Are you sure you did check the model?

I created all the faces from bottom to the cylinder myself, one by one. First the inner and the outer faces after that. I'm not sure what to look for, If I choose "Make manifold" in the 3D print menu, Blender removes the cylinder and all faces connecting to the bottom structure

Can you go into edit mode, deselect all, then choose Select > Select by Trait > Non Manifold and post result

@batFINGER I'm starting to see where I made a mistake: I didn't remove the existing faces before linking the cylinder to the bottom structure


text:
Blender Importer/Exporter Addon updating to 2.8
I guess I need help. I have a plugin (not my code, no OSL) that was written for Blender 2.7x and was working well. It was importing and exporting certain game specific mesh formats. Now I am trying to convert that script for my personal use to Blender 2.8x.
Never been written some Blender addon at all, so my first attempt. A lot of changes I've done already and the plugin is flawlessly activating/deactivating in Preferences now, which is good.
My problem was: I was checking import/export menu (like I am used from Blender 2.7) but the addon doesn't show the options there. First I thought it was not working but I've noticed now it is in the Shift+A menu (where it adds a new type, which is working as well). But it's very unusual to have importer/exporter options in that menu? :)
Can someone point me in the right direction why it is doing that and how I can get it in the exporter menu properly?

Take a look at the implementation of existing import/export add-ons, e.g. for .obj. You likely want to use ImportHelper or ExportHelper for your operator.

I was googling for ImportHelper before but found only entries about having it a filebrowser function.

The plugin is working now, but the import/export entries are still in the Shift+A menu, still working from there. I don't see a way how ImportHelper could help me to get the entries to the import/export sub menues?

It would help if you could add your code to the question. Otherwise I would have to guess what you're doing wrong.

Agree please always, if you have it, post code.  When editing Q could be more appropriately titled "Why is my Addon  appending item to Add Object Menu not Import / Export Menu"  It is courteous to add a link , if code is sourced from elsewhere.

and to answer my own question, finally I found it via Texteditor.
The needed command is TOPBAR_MT_file_import e.g.
bpy.types.TOPBAR_MT_file_import.append(menu_func_import)

Right, I thought that was obvious from my link to the .obj add-on. I'm sorry if that wasn't the case.

Could you please explain why this is the "needed command"  Related https://blender.stackexchange.com/questions/110095/list-of-menu-bl-idnames-info-mt-file-export-etc


text:
Invisible Proportional Editing Circle

I was in edit mode and I wanted to move a vertex with proportional editing on. So I clicked on a point and pressed "g" to move things with it enabled. However, instead of the usual circle to indicate how many points would be moved, the circle did not appear at all but I could still move a bunch of vertices at once. I could tell it was working because when I scrolled up or down on my trackpad more or less vertices were being moved as if the circle was still there, but it's still really inconvenient because I can't see how big my circle is. I have no idea what caused this. I've tried closing and opening the project in blender as well as restarting my computer to no avail.
edit: The circle is back when I opened a new project, so it may be a problem with the specific file I was working on. Maybe I did something to make it go away but I do not know.

It says your proportional size is 0. This is probably a bug in blender, I suggest you report it at developer.blender.org . I have also had this problem a few times, seeing that you are also a mac user it could be specific to macos (I use it too).

It's probably way too big, try and scroll until it's visible.

Alright I wrote a bug report. The proportional size saying 0 seems to be because I was working on a very small object and it increased when I used my trackpad to make the proportional size bigger. @EricXue

Found the answer. I had to the "pivot point" set to the 3D cursor and had to change it to median point. Answer by courtosy of developer.blender.org


text:
Set material density [kg/m³] instead of mass [kg]
Is there any way or plugin which allows enter material density in [kg/m³] instead of direct enter real mass [kg] how it is now in Blender. Blender knows the exact size of the object, so it is possible to calculate volume [m³] and then evaluate weight [kg] based on material density. I personally don't understand why there is just weight [kg] by default. With material density, there could be also possible to preselect common material like wood, steel, iron, plastic, glass, etc. It will allow us to make more realistic physics animation in a much shorter time. Do it now with many objects on the scenes is horrible.

Blender knows the exact size of the object. - Does it? Where can we see the exact size? What if the meshes have a hole (or are non manifold), do they even have a volume then?

Yes. Of course, there is also several CAD extension which helps with precise modeling. And of course, that is possible to create a mesh that has no volume, but you will not use such an object for rigid body simulation. There is 3D Print extension directly in blender which can evaluate volume and are of any selected object, of course also with holes or with applied modifiers.

I found the solution, it is directly in blender itself.
Horizontal menu bar > Object > Rigid Body > Calculate Mass
As you can see here on the screenshot:

https://blender.stackexchange.com/a/137448/99511
Bad thing is that you need to do it every time you change the side of the object. It is not updated automatically.


text:
Is it possile to create a flat-color (shadeless) shader in Blender 2.83 that is also flat when in a reflection?
Toon BSDF and Shader to RGB not fit for me, and I trying to create flat color shader in cycles. I decided to use this shader, and it works well, until the metallic roughness not "0", then it is reflect like diffuse. I was looking for it on other questions, but there shaders not completely flat. And I want just shadeless material, and this should be reflect like flat. This s blender file, if you want to test shader quickly
Edited:
Diffuse shader added to not to illuminate objects around
Edited 2:
Partially resolved with adding "Is Glossy ray" output to "Fac", but some part of rays still illumnate objects around. Not final resolve

Hello :). The Emmision shader with strength=1 will give you exactly that. A flat color not receiving any shadows or lights.

@JachymMichal So am I doing this, or what do you mean? This shader does not work in reflection, when roughness chahging

Related https://blender.stackexchange.com/questions/131015/where-is-shadeless-material-option-for-blender-2-8   https://blender.stackexchange.com/questions/148336/blender-2-8-shadeless-material-setup-not-shadeless

@batFINGER I readed this erlier, it is not working

Flat Color

plug RGB node directly, there is no need to use Emission shader

Flat Color in Reflection with Roughness

math Light Path of Camera Ray with Glossy Ray** and use as factor in Mix Shader node

Shadow

current setup generates shadow, if you dont want that plug Transparent shader into top Shader socket of Mix Shader node.

For your Edit2: Delete your Diffuse Shader that generates indirect light on surrounding objects.

Great article to check How the light path node works


text:
Hide source of particles
I want to hide the particle source (tree), but so that the forest itself is displayed. In 3d viewport this works, but only particles of the pie are displayed on the render. The differences are that the tree is used as a collection, the cake is used as an object. But if I use the tree as an object, then it will be without leaves, despite the fact that the leaves are children. I want to just hide the tree, but render the forest.

I solved it this way: I turned off the tree collection on the current layer, but created a new layer and there the tree collection is turned on. Still it’s not comfortable, but that’s all I have


text:
There is no bump in Cycles
For some reason, the bump of bread only works in eevee, in cycles only displacment works. In other projects displacment works normally. I use procedural texture

Can you share a screenshot of your node setup?

@Sanbaldo I attached a photo to the publication. All material is very big, but in generally there is some superimposed textures, then I guide black and white factor in mixing colors and input height in displacement node, then displacement node into displacement material output

you can try using the NORMAL node inside the "principled BSDF". you should connect there a BUMP node.

@Sanbaldo if I use setting "Bump only" effect becomes like Eevee, may be I have not enough faces. Also In Cycles lighning is not such beautiul. Probably I should use only bump effect

I think it goes like this:
If you set the Cycles settings of a material to 'Displacement' only, then EEVEE, not supporting Displacement shading,  will substitute Bump mapping for any Displacement input to the Material Output node, to make the Cycles and EEVEE renders to look as similar as possible.
Cycles can't depend on that substitution - if you want a normal or bump-map in Cycles, you have to ask for one explicitly:

Not necessarily in Object space, but you get the idea..


text:
How to create baked bread shader?
I want to make a bread shader so that it is darker on top than on the bottom. I know how to make color, bumps and everything else, I'm only interested in a black and white mask for mixing colors. Of course, I can use the usual gradient texture, but I want this transition to be less direct. So far, I'm not doing very well. I hope that I clearly wrote, you can see in the picture what I want.

This is version without bumping, only simple mask

Here, try this setup:

The "mask factor" you are looking for, I achieved by rotating (and slightly moving) a Gradient Texture, and controlling it's cutoffs with a ColorRamp. I then used it as a mix factor for the "bread colors" and adjusted the ColorRamp until it looked right. (This works very well to control the darkness levels).

I then mixed a Noise Texture and a Musgrave Texture to give a scattered displacement pattern, and I used it's inverse as a roughness factor.

I thought the bread colors looked too plain, so I combined yet another Musgrave Texture with a couple of Noise Textures and multiplied them with the bread colors to transfer the darks only.

Lastly, I added the whites from a clamped, detailed musgrave texture to get the "flour coating" on the crust of the bread.

I'll also upload the .blend in case you want to play with it. I even threw in a couple of extra procedural textures (The pan and the table) that can be used as examples.

File is here -
Happy shading!

You may want to try using a gradient on the Z axis controlled using a color ramp, like this. Not sure if this works with your workflow and the final result you're hoping to achieve, but I hope it helps!

No, I want the top to be completely painted over, and there should be bumps around the edges

@user Sorry I wasn't able to be more help! Good luck though!


text:
How to bake Freestyle, or snap Brush to UV or edge?
I want to draw srtright line on my model, like a fresstyle, but I need this lines on texture. I wanted to bake Freestyle, but it seems like it is impossible, so may be I can snap brush to edge on the model or to the edge on the UV? I know that I can use "Pointness" node, but I need to choose needed edges by myself.

Edited: temporary, not completely solution:

Have you looked at drawing grease pencil snapped to the surface? GP can then be baked into the texture if converted to geometry and using AO bake I believe.

@CraigDJones I never used Greace Pencil. I was think that it will be easier


text:
Viewport render image does not work correctly
If I render viewport im wireframe, solid and material preview shading, it works correctly. But if I render viewport in render shading, there are only lines without material. In other scenes it works correctly

Do you mean Viewport Render Image? If it is, works fine for me.

@bao007fei do you did this in my file? In other files it works for me, but not in this. I press (button on top) View > Viewport Render Image (in render shading mode), and pie is hidden.

I checked again. Eevee works fine, Cycles doesn't work. In any blender file:(


text:
How can I control the number of sub-panel instances from an IntProperty?
I'm learning how to create UI panels in Blender. I have an IntProperty that I want to specify a certain number of sub-panels for. So far I here:
import bpy, sys, imp
from bpy.types import Operator, Panel, PropertyGroup, Menu
from bpy.props import *
from bpy.utils import register_class, unregister_class

class OBJECTTOOL_Settings(PropertyGroup):

    count: IntProperty(
        name = "Count",
        description="Number of objects to create",
        default = 1,
        min = 1,
        max = 6
        )

class OBJECTTOOL_PT_main_panel(Panel):
    bl_label = "Object Tools"
    bl_idname = "OBJECTTOOL_PT_main_panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Object Tools"
    bl_context = "objectmode"

    def draw(self, context):
        layout = self.layout
        scene = context.scene
        objecttools = scene.objecttools
        row = layout.row()
        row.prop(objecttools, "count")

class OBJECTTOOL_PT_sub_panel(Panel):
    bl_label = "Sub Panel"
    bl_idname = "OBJECTTOOL_PT_sub_panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Object Tools"
    bl_context = "objectmode"
    bl_parent_id = "OBJECTTOOL_PT_main_panel"

    def draw(self, context):
        layout = self.layout

classes = (
    OBJECTTOOL_Settings,
    OBJECTTOOL_PT_main_panel,
    OBJECTTOOL_PT_sub_panel
)

def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

    bpy.types.Scene.objecttools = PointerProperty(type=OBJECTTOOL_Settings)

def unregister():
    from bpy.utils import unregister_class
    for cls in reversed(classes):
        unregister_class(cls)
    del bpy.types.Scene.objecttools

if __name__ == "__main__":
    register()

So of course the panel is being added by registering it, and it's being made a child by using the bl_parent_id tag.
How can I evaluate the value of the count: IntProperty I have setup, and have the same number of child panels created? I also want it to update the panels whenever the number changes.
(Eventually the plan is to have a menu in the sub panel that offers a menu of objects to create, then I can choose different objects in each panel, set parameters within the panel for that object, and then have a button at the top to create all objects according to the sub-panel selections.)

Dynamically register with python type
Can create a class using the type method.  Code below makes a class name, makes a class with that name and sets the bl_idname class attribute to it as well.  Note can pass draw methods et all in dictionary.
    id = f"OBJECTTOOL_PT_subx{n}"
    panel = type(id,
        (OBJECTTOOL_PT_sub_panel, Panel, ),
        {"bl_idname" : id}
        )

Hence with a dynamic update on int property can register or unregister a subpanel classes on the fly.  Used to be my go to method. It has since been my experience that quick scrubbing of a property can befuddle the registering and unregistering internals and start to fail and report missing RNA errors.
Getting the value of the scene property during restricted context when addons register is an issue if dynamically registering on fly with an update method.
Polling on the number

Instead for multi subpanels these days I go for a register them all (or in chunks as need be) approach and use a class property to poll against.  The parent class poll will take care of any outside polling needs.
Add a class attribute number to each on creations, register them all and poll based on the number.
Another bonus is if the file is saved with 4 as the count prop, it will show 4 panels (when next run)
import bpy
from bpy.types import Operator, Panel, PropertyGroup, Menu
from bpy.props import IntProperty, PointerProperty
from bpy.utils import register_class, unregister_class

class OBJECTTOOL_PT_main_panel(Panel):
    bl_label = "Object Tools"
    bl_idname = "OBJECTTOOL_PT_main_panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Object Tools"
    bl_context = "objectmode"

    def draw(self, context):
        layout = self.layout
        scene = context.scene
        objecttools = scene.objecttools
        row = layout.row()
        row.prop(objecttools, "count")

class OBJECTTOOL_PT_sub_panel(Panel):
    bl_label = "Sub Panel"
    bl_idname = "OBJECTTOOL_PT_sub_panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Object Tools"
    bl_context = "objectmode"
    bl_parent_id = "OBJECTTOOL_PT_main_panel"

    @classmethod
    def poll(cls, context):
        ot = context.scene.objecttools
        return cls.count < ot.count

    def draw(self, context):
        layout = self.layout
        layout.label(text="SUBBY")

class OBJECTTOOL_Settings(PropertyGroup):

    count: IntProperty(
        name = "Count",
        description="Number of objects to create",
        default = 1,
        min = 1,
        max = 6,
        )

classes = [
    OBJECTTOOL_Settings,
    OBJECTTOOL_PT_main_panel,
]

for i in range(5):
    id = f"OBJECTTOOL_PT_subx{i}"
    panel = type(id,
        (OBJECTTOOL_PT_sub_panel, Panel, ),
        {"bl_idname" : id,
         "count" : i}
        )
    classes.append(panel)

def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

    bpy.types.Scene.objecttools = PointerProperty(type=OBJECTTOOL_Settings)

def unregister():
    from bpy.utils import unregister_class
    for cls in reversed(classes):
        unregister_class(cls)
    del bpy.types.Scene.objecttools

if __name__ == "__main__":
    register()

Related
https://blender.stackexchange.com/a/179031/15543
https://blender.stackexchange.com/a/135374/15543

Thank you so much!

Actually I had a follow up - so I've got unique panels, but the panel class now has a propertygroup (with several EnumProperty definitions) and an operator.
Would I need to dynamically register each of those too?

Can't add bpy.props property definitions to a panel. (Wont work as expected).  Dynamically registered panels posted as an example of how to make many based on one without a bunch of class defs that are mostly same.  Not totally sure on what your aim is.  Speculative note: A draw method can be defined on a property group.   If still unclear perhaps post a new question linked back  to this one for context.

Cool, will do, cheers!


text:
Help with Rigging Poncho-Style Cloth
I've recently found this piece of artwork by Janice Chu (https://www.artstation.com/klangoda):

The character is wearing a kind of poncho that's draped over both shoulders. Now, the rig I'm making is going into Unity, so the blender cloth simulation is out of the question, because the character in the game is going to have changeable clothes. So I tried to go with the standart rigging method of "Automatic Weights", and this came out:

So far so good, but then when I move the arms this happens (Green = Where is should be, Red = Where it is now):

Would you guys have any tips or ideas on how I might make this work?
If nothing works I guess I can always go back to Unity's cloth system but that's expensive in both performance and workload.
Any help would be greatly appreciated,
Thanks!

It's not clear from your second picture that anything went wrong. And you don't explicitly tell us what the problem is. Consider doing so, since the picture isn't sufficing to make the problem clear.

I changed the image to make it more clear, thank you!

What happens when you try to weight paint? Does it make any difference to this outcome?


text:
Python: Getting range center of object
Edit: The problem was that I did not update the scene after scaling the object.
I am trying to move the origin of the object to the center of its bounding box.
I tried this solution Get center of geometry of an object
o = bpy.context.object

vcos = [ o.matrix_world @ v.co for v in o.data.vertices ]
findCenter = lambda l: ( max(l) + min(l) ) / 2

x,y,z  = [ [ v[i] for v in vcos ] for i in range(3) ]
center = [ findCenter(axis) for axis in [x,y,z] ]

bpy.context.scene.cursor.location = center

bpy.ops.object.origin_set(type='ORIGIN_CURSOR')

This is how it always ends up:

Clearly, the origin doesn't sit at the center of the bounding box. Any help would be greatly appreciated!

The next code snippet from answer (below code used in post above) uses the bounding box. global_bbox_center

For some reason both of the examples give me the same results. Which seems to be closer to center of mass than center of bounding box.


text:
How to blend/mask materials?
I've been working on the Blender Guru donut tutorial and want to add some variation to the condensation on the coffee cup. Currently the condensation stops very abruptly on the the inner rim of the glass, creating a harsh transition between the glass and the droplets.

Is there a way to mask or hide certain pieces of the condensation material in order to create a more irregular transition with the glass material? In other words, I want the droplets to be visible only on specific portions of each face, not the whole thing. I've seen that color ramp nodes can be used to create a fade/gradient effect between materials, but am unsure how to accomplish this using my water normal map.
My current node setup:

Thanks in advance for your help!

Use a color ramp as gradient to control the mix of two textures or materials https://blender.stackexchange.com/questions/34834/how-to-create-a-gradient-texture-from-one-material-to-another-opaque-to-clear and https://blender.stackexchange.com/questions/10453/how-can-you-smooth-the-edge-between-two-materials

Thanks so much for your response, though I'm still a little confused. I went through the links that you posted and see how the color ramp and gradient features can be used to change the color of an object, but am unsure how to incorporate these nodes with the normal map I'm using above. Is there a way to use the color ramp node in tandem with the image that I'm using for the normal map? I'm still pretty new to all this and I really appreciate your help!

Sure, that's the whole point of shading, you create noise patterns and then use them to guide blend or strength input parameters. Here a example:

Separating Uv coordinates makes a gradient in the chosen direction, add centeri it in the plane and then mix it with a noise on linear light mode. Then use that to guide any blend or parameter. 1 of the millions of ways you can mix values to generate masks, the core technique of shading.