text:
How to model 4 camera automatically in python
import bpy
import numpy
import math
import os
from mathutils import Euler
from bpy import context, data, ops

scene = bpy.context.scene
bpy.ops.object.select_all(action = 'SELECT')
bpy.ops.object.delete(use_global = False, confirm = False)

#***********************Camera parameters**********************************
focal    = 3.04  #focal lenght (mm)
sw       = 3.68  #sensor width (mm)
sh       = 2.76  #sensor height (mm)
eul_mode ='XYZ'

number_cam = 4
count      = 1

location = [(0, 0, 3), (3, 0, 3), (0, 3, 3), (0, -3, 3)]
rotation = [(math.radians(0), math.radians(0), math.radians(0)), (math.radians(45), math.radians(0), math.radians(90)), (math.radians(45), math.radians(0), math.radians(180)), (math.radians(45), math.radians(0), math.radians(0))]

if count <= number_cam:
    for cam in scene.objects:
        cam_name = 'Camera' + str(count)
        cam      = bpy.data.cameras.new(name = cam_name)
        cam.lens = focal
        cam.sensor_width  = sw
        cam.sensor_height = sh

        cam_obj                = bpy.data.objects.new(cam_name, [cam + str(count)])
        cam_obj.rotation_mode  = eul_mode
        cam_obj.location       = location[count]
        cam_obj.rotation_euler = math.radians(rotation[count])
        scn.collection.objects.link(cam_obj)

count = count + 1

I am a beginner in python with Blender.
I would like to create 4 cameras automatically with Python but I have an error in this code.
Can you tell me what this error is and if what I want to do is possible?
Thanks a lot

Hello, what are you trying to do ultimately ?

error is: Traceback (most recent call last):
File "/Text", line 11, in
NameError: name 'scene' is not defined
Error: Python script failed, check the message in the system console ...you SHOULD copy all your code in here, not just parts. With the imports too...!

and if you would assign the scene variable correctly...the next error is: raceback (most recent call last):
File "/Text", line 16, in
NameError: name 'focal' is not defined
Error: Python script failed, check the message in the system console
....sorry, but you SHOULD watch/read some beginner python tutorials. You will not get any result without some basic knowledge.

Thank you for your comments.
So, Gorgious, I'm trying to create 4 cameras with different locations and orientations. I want to have some automation because it's the same code all the time.
Chris, I'm sorry I didn't put in all the code. I'll keep that in mind. I hope now that it is OK for you! Also, I have already watched some python tutorials for beginners, otherwise I would never have written this code. Thanks again for your comments.

Some fixes.

Lose the "bling" ... many moons ago a language named COBOL was
nicely aligned on equals signs, would stick with pep8 for python. The
result below is result of autopep8 via nvim text editor.
Never a fan of scripts that delete everything first, took that out,
it was an issue with your original logic, since the scene now had no
objects.
Made one loop to add each camera. Named via fstring formatting rather than string addition (which can be slow).

Resultant script.
import bpy
from math import radians
from bpy import context, data

scene = context.scene

#***********************Camera parameters************************
focal = 3.04  #focal lenght (mm)
sw = 3.68  #sensor width (mm)
sh = 2.76  #sensor height (mm)
eul_mode = 'XYZ'

number_cam = 4

location = [(0, 0, 3), (3, 0, 3), (0, 3, 3), (0, -3, 3)]
rotation = [(radians(0), radians(0), radians(0)),
            (radians(45), radians(0), radians(90)),
            (radians(45), radians(0), radians(180)),
            (radians(45), radians(0), radians(0))]

for count in range(number_cam):
   cam_name = f'Camera{count}'
   cam = bpy.data.cameras.new(name=cam_name)
   cam.lens = focal
   cam.sensor_width = sw
   cam.sensor_height = sh

   cam_obj = bpy.data.objects.new(cam_name, cam)
   cam_obj.rotation_mode = eul_mode
   cam_obj.location = location[count]
   cam_obj.rotation_euler = rotation[count]
   scene.collection.objects.link(cam_obj)

Thanks a lot! It is what I was searching


text:
black around an image set as image texture (jpg or png)
I have made a cylinder, unwrapped.
I want to wrap an image on it, but not to cover all the cylinder.
If a scale it down, i see black around my label instead of object's material.
How can i fix this?
I'm novice in blender

https://blender.stackexchange.com/questions/8706/what-is-the-right-way-to-apply-an-image-texture-over-a-glass-or-plastic-material https://blender.stackexchange.com/questions/44806/how-can-i-get-the-bottle-glossy-w-o-the-label-too/ https://blender.stackexchange.com/questions/46424/add-a-transparent-image-on-top-of-a-material/46447

i read carefully. none of them is my case. maybe i did not explain well, so here is the link for the blend file: https://drive.google.com/file/d/1bjgZb1YI1XMO-NBQGsATB0veI4jiqknU/view?usp=sharing

source: Stack Exchange

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

sort: votes


text:
Loop Tools > Circle
I'm making the neck of a mesh figure, when I click, loop tools > circle, I get two distorted circles instead of two semi-circles. The front part of the neck is ok, but back of the neck is the problem. Also, at that point there is a 'rogue' vertex which I can't move or delete? (it's not origin object) The screen shot with the red tick is what I'm after.

Hi, it appears your screenshot didn't make it into the post.

Ok, I added the image, Thx

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


text:
When using black stroke color to animate a imported model, the stroke color turns grey after animating it

The stroke shown over the imported asset

I think it's just using the 3D interface on 2d animation to fix this problem since I did that but im not sure

Never mind, I fixed it by going to 3d view in the 2d animation interface and then moved the imported image to be behind the stroke so the stroke is not interfering with the image plane


text:
Camera stuck in a resolution
When I try to increase or decrease the FOV/resolution of my camera view, it can't get more large vertically or horizontally, and when I try to render it, it's just plain black, and this is a problem since I want to increase the size of the project so that it's not all blurry when rendering with the original size (256x256).

Make sure your camera rotation is correct and Does this answer your question? Render result is completely blank

You should focus on one problem per question. I guess your size problem and the black screen might have different causes. My answer is for what I guess your size problem is.

your sizing issue is likely because your X resolution is very small, if you increase it the aspect ratio will change, could you post a screenshot of your camera settings? For the problem with black screen it could be because there is no lighting, could you post a screen shot of both the world view as well as the shader for the backdrop?

Peterdagrape.
When I try to resize the image it tries to get resized in, let's say, 360 pixels in  X dimension but all it does is get thinner and thinner in one direction, and when I try to render it just renders black, it just simply renders all frames in 1 second and just won't render anything, just black, hope this anwers your question.

Gordon Brinkman.
Your third statement is the problem, does this help?

Then maybe the fourth statement is the solution...?

It is probably the problem, sorry for the inconveniences, im just really dumb with all of this explaining thing.

Oh wow, it actually helped, thanks man!

No solution here for the black render, hard to tell from the screenshot which settings might be wrong. But about the size:
Your screenshot doesn't really show what the problem is... you have set a resolution of 256 × 516 pixels and the camera looks like the aspect ratio fits these dimensions.
So if you're saying "it can't get more large", do you mean the camera's field of view doesn't get larger so that it extends the objects vertically or horizontically?
The FOV is dependent on the camera settings, especially the Focal Length. How much you can see through the camera is determined by the focal length and the distance to the objects - more or less like in real life.
For example if you want to render a typical 16:9 image, it doesn't matter if you set it to 1920 × 1080 pixels, 3840 × 2160 pixels or 256 × 144 pixels, the camera's view will always be the same. Just the rendered image changes in size. The same goes for setting a resolution and then change the percentage into something different than 100%.

Downvoting because I have to guess a solution for lack of clarification in the question is quite impolite.

Well I edited the question, hope that helps.


text:
pixelated render
I am a new-ish blender user and I have so much trouble with rendering. I feel like no matter how many videos I watch my renders always come out blurry. Can anyone help me maybe clear up stuff I'm missing or don't understand? ... Thanks

Do you have motion blur enabled intentionally?

@if u r new and rnt doing any complex renders then u wanna disable motion blur

I just watched a tutorial about making renders more clear and they said to turn it on, but i just turned it off and it's still blurry if you zoom in

Could you add a picture of your resolution settings and an example of your blurry render? It would really help us evaluate the problem better.

Ok I added them up there! Thanks for your help!!

You should not set the render resolution percentage to 200%

Additionally, how do you mean blurry?


text:
corrupted double linked lists in material preview mode
I'm using Blender on Ubuntu 20.04 (fully updated) and unfortunately it is highly unstable. I crashed very often, especially when I'm in Material preview mode.
For example when I try to parent one object to another in Material preview mode, which seems to work, and then click anywhere else i shows an error line similar to "double linked list corrupted" (it differs sometimes).
From this point on Blender doesn't react anymore to any input although it doesn't seem to be crashed (Blender doesn't write any kind of log or shows further messages). I can only kill the process and restart it.
To reproduce the problem:

duplicate the default cube
shift select both cubes
parent them via ctrl+p (object keep transform)
click anywhere else

If I do these steps in Solid mode everything is fine. As soon as I do the same step in Material preview mode, the error occurs. But this is only one example, this happens in various other situations, preferably in Material preview.
It happens on Blender 2.82 - 2.92 and it happens with factory-startup enabled, like for example:
wm_event_do_handlers: Handling event
wmEvent  type:1 / LEFTMOUSE, val:2 / RELEASE,
         prev_type:1 / LEFTMOUSE, prev_val:2 / RELEASE,
         shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(1463,741), ascii:'', utf8:'', pointer:0x55869e5738d8
malloc(): smallbin double linked list corrupted

Any ideas what might cause this problem or how to tackle it? As it doesn't really crash, as far as I can tell, it doesn't write any logs and the debug mode doesn't show anything usable.

Solution: If anyone else ever stumbles about this problem, it seems to only occur in Blender versions from the Ubuntu PPA of Thomas
Schiex. The vanilla version don't show this behavior.

You should report a bug on https://developer.blender.org/.

If you have found a solution, feel free to post an answer to your own question.


text:
wm.context_toggle_enum(Context Toggle Values) shortcut setting is not working in Blendre 3.6?
I googled to see if I can toggle menu items with shortcuts and they explains wm.context_toggle_enum(Context Toggle Values)can do that, but in Blender 3.6 this shortcut setting doesn't work. Is there anyway to do same thing in Blneder 3.6? I need to toggle many things like Transform Operations, Transform Pivot Point, Viewport Shading, Snap Elements ,and so on.

Have you seen this in the Blender Python API? https://docs.blender.org/api/current/bpy.ops.wm.html#bpy.ops.wm.context_toggle_enum

I saw it. I tried some combinations sometimes it works and sometimes it doesn't work. For example wm.context_toggle_enum context attribute=
tool_settings.transform_pivot_point value = CURSOR value = INDIVIDUAL_ORIGINS it works  but this won't work. I don't know why. wm.context_toggle_enum context attribute =
tool_settings.snap_elements  value = VERTEX value = EDGE

FWIW: I wonder if what you just added to your question wouldn't be better posted as an answer to it? It would show more clearly that you found a solution to your problem.

choosing my post as an answer to my question? If it is ok I will.

See this link specifically about answering your own question: https://blender.stackexchange.com/help/self-answer Just a suggestion, IMHO it might be clearer if you edited your question to cut out the part beginning with "I found out the reason..." and everything following, including the code snippets and paste all that into an answer. Also, if you have the time and haven't seen it before, you might take a look around the Help Center: https://blender.stackexchange.com/help

ok thanx. I edited my post.

I found out the reason why only snap_elements toggle_enum can't work as keymap in Blender 3.6. When I try this
import bpy
print(bpy.context.scene.tool_settings.snap_elements)
print(bpy.context.scene.tool_settings.transform_pivot_point)

this gives me something like
{'EDGE'}
BOUNDING_BOX_CENTER

tool_settings.transform_pivot_point can toggle transform_pivot_point using wm.context_toggle_enum with values like BOUNDING_BOX_CENTER with CURSOR combination and this can be used as keymap shortcut but tool_settings.snap_elements can't because it needs {''}. Simply values with EDGE and VERTEX won't work anymore. It used to work but Blender developer changed snap_elements enum setting.
I am gonna use this as a custom operator and assign keyboard shortcut instead. I just need to toggle snap elements. I always need to toggle between vertex and edge.
import bpy
current_snap_element = bpy.context.scene.tool_settings.snap_elements
if current_snap_element == {'VERTEX'}:
    bpy.context.scene.tool_settings.snap_elements = {'EDGE'}
elif current_snap_element == {'EDGE'}:
    bpy.context.scene.tool_settings.snap_elements = {'VERTEX'}
else:
    bpy.context.scene.tool_settings.snap_elements = {'VERTEX'}

I thought wm.context_toggle_enum can't be used as keymap anymore but
other enum things may work as before. At least tool_settings.snap_elements can't be used as shortcut in Blender 3.6 anymore.


text:
Can I use the shoe last technique with modifiers or constraints in Blender?
I want to use the shoe last technique used in shoe making in Blender.
Please see the picture below.

Curved plates and spheres overlap.
The curved plate is like shoe last, and I want to sculpt the sphere.
I tried the following steps.

With the shrinkwrap modifier, the sphere sticks to the curved plate and acts like a shoe last.
However, when attempting to sculpt, the sphere will stick to the curved plate and remain flat.

Removing the shrinkwarp modifier enables free sculpting.

But now the sphere passes through the curved plate.

From the example above the specific features of the technique i want are as follows.

When the mesh of the sphere is outside the curved plate, free sculpting should be possible.
If the mesh of the sphere digs into the inside of the curved plate, the movement of the vertices is limited.
This is similar to the shrinkwrap modifier, floor constraint or limit location constraint.
But it's not about the transformation of the object, it's about the interaction between meshes.

Can I model or sculpt in the same way as above in Blender?

Your formatting makes it hard to read your post...

I am sorry for the inconvenience.
I modified the format using numbering.
Is readability improved now?

No not an option, currently its vertex orientated (and it can add vertexes as well) its not object orientated and i doubt that will get into blender
However what you might do in your case is paint masks and play with the strength of it.


text:
How to add an emission node with a specific color to a material and add that material to an object?
So far I have seen this and this both which did not work for me. Currently I have:
import bpy

bpy.data.scenes['Scene'].render.engine = "CYCLES"

bpy.ops.mesh.primitive_cube_add(radius=1, view_align=False, enter_editmode=False, location=(1.00003, 0.176902, 0.72441),
                                layers=(True, False, False, False, False, False, False, False, False, False, False,
                                        False, False, False, False, False, False, False, False, False))
bpy.ops.object.material_slot_add()
bpy.ops.material.new()

mat_name = 'Material.001'
bpy.data.materials[mat_name].node_tree.nodes.new("ShaderNodeEmission")
bpy.data.materials[mat_name].node_tree.nodes["Emission"].inputs["Color"].default_value = (1, 0, 0.07, 1)
mat = bpy.data.materials.get(mat_name)
ob = bpy.context.active_object
ob.data.materials[0] = mat

When I perform this process in blender the hover text for use nodes in the material->surface section the code is: bpy.ops.cycles.use_shading_nodes() and I get: RuntimeError: Operator bpy.ops.cycles.use_shading_nodes.poll() failed, context is incorrect so I'm not sure if I can/have to perform this action or there is a prerequisite to doing it?
I tried starting blender with --debug-wm but this didn't give me more information of how to perform this action in a script.
Is there a better way to show what blender is doing than --debug-wm? Because I can do what I want in blender itself just not in a script.
I also read a lot of api documentations and the tips for blender scripting, but this didn't really help me.

Thank your for the answer. The important part was removing the other nodes of the material

IMO the important part from link posted is addressing the material by reference by getting or creating via API with materials collection get and new methods respectively   THe code in Q above adds a new material each time, but only ever sets nodes of  a material named "Material.001" and assigns to slot 0.  Suggest using a unique name for your material then need only create it once.  Remove it to create it agai, other wise get it.  This will avoid creating an endless list of materials whilst testing script.


text:
Using Array modifier, is it possible to gradually increase the offset?
I have an oblong circle of sticks (using array and curve modifier), but I would like to increase the offset gradually in two places(as shown on the screenshot). Does anyone have tips on how to accomplish this?

With the addon Animation Nodes you could sample the desired number of points on the curve, and place instances of the sticks, rotated to the correct angle, at the points' coordinates.

Animation nodes provides nodes to create interpolation curves, similarly to F-curves like in Robin Betts' answer. You can set an interpolation curve and evaluate the circle not at regular intervals but offset forwards or backwards.

The expression node in the node tree is added to move the sticks a bit clockwise so that – for a multiple of four sticks – the sticks are moved off the axes. You might also have to increase the resolution of the Evaluate Spline node in the advanced node settings to increase the accuracy.

Unfortunately, this method doesn't allow you to enter the offset numerically. For that you would have to calculate the positions manually.
The animation at the top shows a swipe between regular sampling, sampling according to the interpolation curve with the “disconuity” which creates the cap and sampling according to the smooth interpolation curve which creates a continuously increasing gap. Disconuity in quotation marks as the curve has its control points at .25 and .250001 or so to make the order unambiguous. Otherwise you might get flickering between frames, should you also wish to animate the opening.

@Robin Betts: Ooops, that was embarrassing. I'm so sorry.

You can control the density of the sticks around the curve by using DupliFrames, and adjusting the 'speed' the stick 'travels' around the curve.
Starting with a curve and a stick, all origins at 0:
(Here, we're arranging 120 sticks)

Assign a 'Follow Path' constraint to the stick, with the curve as its path. Do not hit the 'Animate Path' button.
Set the stick's 'Duplication' method to 'Frames' with the Start at 1 and the End at 120.
Adjust the curve's 'Path Animation' > 'Frames' to 120.
Right-click, and insert keyframes on the constraint's 'Offset' field: 0 at frame 0, 120 at frame 120.
With that field active, open a graph editor window to see the F-curve of its animation.

You can now control the density of the sticks by altering the F-curve. I changed the end-keys (V) to 'Vector' type to begin with, to start with a straight line and even distribution. I then inserted 'Vector' keys at frames 30 and 90, converted them to 'Automatic', and rotated them a bit to get the distribution shown.
The illustration shows: The result from above, The F-Curve,  all the relevant panels, and the timeline.


text:
Why is this UV Map face not displaying correctly?
Edit 1
Here's the blender file:

Also here's a better image of the face in question
!https://imgur.com/a/PKXzx
The texture of my model is not displaying correctly onto my mesh.
It revolves around the UV/Image Editor, I'm trying to get that face in the two panels of the first image on the right to show the texture as it does in the image on the left. (note that the image on the left is the right arm of the character and the other two are of left arm)

The dotted face in particular. Not sure if this helps but when I scale that face in the uv map, I've noticed the texture is flipped.

Please give more detail of what your problem is, or what you're trying to achieve.

The problem I'm having is better shown in this image (https://imgur.com/a/yMSLp) and it revolves around the UV/Image Editor, I'm trying to get that face in the two images on the right to show the texture as it does in the image on the left. (note that the image on the left is the right arm of the character and the other two are of left arm) hope this helps.

Try moving the vertices around and see if the 'dotted' face goes away. In my experience, you don't want that 'dotted' face. It usually means that there are two faces overlapping.

In the uv/image editor i did find an overlapping face (which is the selected non-dotted one), however I think both are necessary as one is used for the right arm and the other for the left. But one thing I did notice is that edges of the white triangle outlined in red are connected to the point of the dotted triangle (note that this triangle [in yellow] doesn't have a face there), while the triangle overlapping the dotted one doesn't have this. (The yellow highlight shows where both the selected triangles were before I moved them) (https://imgur.com/a/RWg3B)

If you have more useful information, use the 'edit' link at the bottom of your post to add it in.  Go to the opposite arm, and look at how the UV map is shaped, and duplicate that shape on the other side. You said the other side was working, correct? Also, upload your blend file here so others can look at the issue closer

The face must be flipped in the UV editor.

it's becouse your triangle is rotated. Let's i describe it in image:

your vertex number 1 is on position of vertex 3, n.2 on position of 1, n.3 on pos. 2.
so it look like all vertex on right place, but this places are wrong:

Selecting in mesh uv sync mode displays that one vertex is on different positions in UV.

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


text:
Issue with rendering fire on Transparency
I am having an issue with rendering fire on a transparent background. I've gone into the world and changed the alpha from the sky to transparency. I've checked the transparent box under the render properties, under the film section. However, when I do this only my emitter renders, not my fire simulation. Unchecking the box under the film section causes renders to return to normal. Any help would be appreciated. Wondering if something is setup incorrectly with my nodes? Or If I am missing some setting.
Thanks!

Can you add a screenshot?

Renders at 10% Added

Can  you upload the file? You can use https://blend-exchange.giantcowfilms.com/ for this.

Added Thanks Crantisz! I mostly followed a tutorial as I don't quite understand all the settings yet.

I saw that, but it isn't a viewer only issue, renders aren't correct. Also, whereas that post has the fire still visible, although not displaying correctly. Mine has nothing except the emitter displaying.

It's exactly your question. The only difference is that  your fire visible because you have non-transparency emitter behind it

What does make you think renders aren't correct? Did you try overlaying rendered image over some solid color to check? Note also that render output should be saved to OpenEXR to allow correct work with transparency

Yeah, I've overlayed it on a solid color and there is nothing other than the emitter showing up, not so much as one particle of fire. ;)  I've tried saving as both exr and a png with rgba turned on.

Perhaps, I am not reading the article right? I can't use a blue or green screen because it doesn't key nicely with the fire element. What other options do I have?

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


text:
Is it possible to toggle Blender's built-in Boolean command state temporarily by pushing keyboard shortcut?
Is there any way to toggle blender's Boolean command state while pushing keyboard shortcut? I always enable weight paint tool's Restrict mode but sometimes I need to disable it. I would like to disable weight paint tool's Restrict mode while I keep pushing keyboard shortcut and when I release the key Restrict mode needs to be enabled again. I would like to do something like sculpt tool's temporal smooth brush which is activated when I keep pushing shift key.(default setting of sculpt tool shift key works as sculpt.brush_stroke with Stroke Mode:Smooth)
I assigned 2 custom python script to A key.
this one works when A key is pushed
bpy.context.scene.tool_settings.weight_paint.use_group_restrict = False

And this one works when A key is released
bpy.context.scene.tool_settings.weight_paint.use_group_restrict = True

but it doesn't work always. When I push A key it surely disables Restrict mode but sometimes Blender fails to get key release state and 2nd python script isn't executed. I guess it's because I do weight paint while I keep pushing A key, and this brush stroke thing disrupts Key release event?
If you know much smarter way please tell me.

You may consider assign both keymap to a operator
Since you cannot execute another operator when the built-in operator modal is running, it will fail in some cases,
Success disable and enable: Hold A then hold Left mouse to paint, release left mouse and release A.
Success disable only: Hold A then hold Left mouse to paint, release A then release left mouse.

import bpy

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

    def invoke(self, context, event):
        bpy.context.scene.tool_settings.weight_paint.use_group_restrict = event.value != "PRESS"
        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

it works thank you but like you said releasing A key before releasing Left Click disrupts A key release event. seems I need to use other application like AHK to control Left Click release state.

Yes, there doesn't seem to be an simple way to do this., unless you can rewrite the paint operator: paint.weight_paint

never mind AHK script won't work.  Simply Weight Paint Brush event keeps disrupting A key release event. Thank you for  anyway.


text:
How can I put bone's head on the place where two bones crossed
I need to move a bone like these pictures.

There are two long bones,and in edit mode I need to put the small bone's head exactly on the place where two long bones crossed. I tried to use edge snap mode, but it didn't work. Do you know how?

Most of this work is knowing the coordinates to be moved. However, with the exception of the head and tail, it is rare for two bones to share exactly one point. So instead of the shared point, I decided to find for the closest one to the two bones. The following script will move the 3D cursor to the expected coordinates, then snap the destination bone to the cursor yourself.
import bpy

def closest_point_between_two_lines(va1, vb1, va2, vb2):

    from mathutils import Vector, Matrix

    va = [va1, va2]
    vs = [(vb1 - va1).normalized(), (vb2 - va2).normalized()]

    ma = Matrix([
                [vs[0] @ vs[0], -vs[1] @ vs[0]],
                [vs[0] @ vs[1], -vs[1] @ vs[1]]
                ])

    if not ma.determinant():
        raise

    vc = Vector([(va[0]-va[1]) @ vs[0],
                 (va[0]-va[1]) @ vs[1]])

    # where, C + A @ R = 0
    vr = -1 * ma.inverted() @ vc

    vp = [0]*2
    for i in range(2):
        vp[i] = va[i] + vr[i] * vs[i]

    return 0.5 * (vp[0] + vp[1])

obj = bpy.context.object
bones = obj.data.edit_bones
bone1 = bones[0]
bone2 = bones[1]

pos = closest_point_between_two_lines(
                    bone1.head, bone1.tail,
                    bone2.head, bone2.tail
                    )

bpy.context.scene.cursor.location = obj.matrix_world @ pos

I won't go into the details of my function, but you can find something similar with keyword "closest point between two lines".
Edit
Sorry, the desired function has already been provided in the mathutils module.
mathutils.geometry.intersect_line_line(lineA_p1, lineA_p2, lineB_p1, lineB_p2)

import mathutils
poss = mathutils.geometry.intersect_line_line(
                    bone1.head, bone1.tail, bone2.head, bone2.tail
                    )

pos = (poss[0] + poss[1]) /2
bpy.context.scene.cursor.location = obj.matrix_world @ pos

I used your script but 3D cursor is little bit away from the crossover point, why?

@Yokomizo Maybe I forgot to convert to world coordinates. Edited

it works, but I have to say, I think your script only see 1st and 2nd bones of an armature, so if  armature has lots of bones your script won't work.

I guess this kinda thing is needed? It works.
bones = []
for b in bpy.context.selected_editable_bones:
bones.append(b)
bone1 = bones[0]
bone2 = bones[1]
pos = closest_point_between_two_lines(
bone1.head, bone1.tail,
bone2.head, bone2.tail
)
bpy.context.scene.cursor.location = bpy.context.object.matrix_world @ pos

@Yokomizo Unfortunately It's impossible for me to know which pair of bones you want to use. The rest of the work is yours.

ok. anyway "selected_editable_bones" makes it work. thank you.


text:
My model is magenta in Texturing Paint. What does it mean?
I try to add texture to my cat.
My model is Magneta color in Texturing Paint. What doesn't it meaan?

When I select ViewPort Texture is like this.

I try to put hair in my cat. I don't know how .
Thanks

That magenta means that the material of your cat has a non assigned texture; the colored checkboard means that an UV map has been created referring to that image.
Open a UV Image editor window, select the colored checkboard, save it to your hard drive with a name like "Cat skin";
Select your material and load the saved "cat skin" as an image texture.
Now you should be able to paint it in texture paint mode.
It should work both in Cycles and Blender Internal.
To make your cat furry you will have to add to the skin material a new "hair" particle system and play with the adjustements.
Good luck!

In texture paint mode, you need to add a paint slot of your choice from the Tools menu. Probably, you would choose Diffuse from the drop down. Above that, you can choose between Image if you want to adjust a texture or Material to paint it by hand from scratch.


text:
How to create perpendicular edges along one direction?
I made path in Inkscape, import it to Blender and make it 3d.  Now I need to bend it in one direction but wires connected to non-perpendicular points. Please look at image to understant what i mean.

I don't think there's any automatic way to do that, for example you could create a grid above your mesh and use the Knife Project tool?

Should I make mesh from bezier curve at first?

what do you mean? It's already a mesh

When I import it from svg - it's bezier curve. But then I convert it to mesh.

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

@moonboots added to post

it makes my Blender crash, I'm not sure what you mean, what you show in the screenshot is a mesh, you were right to convert to mesh, now you could do what you want to do with a tool like Knife Project tool, I can make a full answer if needed

Hmm. Okay. I will try it, but maybe I making something wrong and it can be made much easy? Here is SVG image. I need to import it to blender and bend in single dimension like i described in preview. https://svgur.com/s/Fpc

@br. as moonboots said, this can be done easily enough using "Knife Project" <= That's your search keyword

How about MeshDeformModifier ... you put a cage around your mesh (a simple box will do) and deform the cage.  Make sure you have enough divisions in you cage to do what you want.  I can write this up as an answer if this is of interest.

Will try both and will say how solved, thanks

actually what's the reason why you want to keep parallel edges?

You can achieve that by creating a plane and subdividing it using Ctrl + R into parallel equally spaced edges, then using Knife Project tool, you can project your object to the plane, all you need to do later is to remove all the faces that fall outside the projected faces.
But looking at your file, you need first to turn your object into a mesh using Alt+C and choose Mesh from curve, then in edit mode, select all, press X and choose Limited Disolve, in order to reduce the vertices in your object.
Here's your edited file:

Ctrl + r may not work because they will stay parreale to the mesh.

Ctrl + R is to be used on the plane, not the object @Yohello1

Okay then it should work fine.


text:
How to create a material with fading edges effect?
I am trying to make a fresnel kind of effect that only is visible on the edges of an object. Kind of like a fading outline. So I tried to take the angle between the camera normal and object normal and depending on the size of the angle I want another color. This is how my shader graph looks like

I'm not sure if the vectors are normalized, hence the normalization nodes. Also not sure if the vector transformations from different spaces are correct, but I think so. The result looks like something I'm trying to achieve, but it's not so easy to see. Is there a way to visualize it better or "debug" the shader? And is this a correct setup for what I am trying to achieve?

May I ask why didn't you just use the fresnel node as a factor?

@Georges doesn’t the fresnel node just act like a ”shell” on the object? I mean if I put it on a sphere it ads value not only on the outlines, but to the middle facing the camera as well? Sorry, if I aint making myself clear

You can try it yourself, just add a "Layer Weight" node from input in the shader editor, you can use either "Facing" or "Fresnel" Ctrl+Shift+RMB on the node to see it's effect in the viewport in render mode, if you need more control you can add a "Color Ramp" node. I usually use this node combination as a factor between two shaders or two textures. "Fersnel" is supposed to be more physically accurate, but sometimes I find "Facing" provides me better with the effect I'm after, so you need to experiment with these.


text:
Why are the highlights and specular gloss disappearing in this toon shader setup?
I've been rebuilding Irie's famous Toon Shader (a la this blendswap) because I have exactly zero skill is OSL and I don't know about you, but I can't even run the silly scripts.
The good news is, I recreated the 'toon' material - the bad news is, I've tried to recreate the 'edge' material, with not as much luck. I'll explain.
Using the basis of the shader's hackyness (what with the flipped normals of a solidify modifier, according to this stackoverflow reponse) I can get those crisp black lines. Problem is, for some reason, the transparency of the Transparent BDSF isn't... transparent. A picture is worth 1000 words, so here's what I mean.
The modifier set up. Let's pretend the 'flip normals' is selected, I was messing with things when I took a screenshot of this.

The node set up for the edge material, based on the suggestion on blendswap

And the output of said set up.

Those edges sure are beautiful aren't they? What could possibly be the problem, you ask. Well, the transparent BSDF (or maybe the backface cull, I'm not even sure) is eating my highlights and specular gloss shines. Without the solidifier, my 'toon' material looks like this:

If you look at Irie's original project, the glosses and highlights definitely are not supposed to be eaten up by the solidify modifier - just lay on top, all pretty like.
So to sum up - why the heck is my node setup eating all of my lighting? And how can I fix it?

If I'm understanding you correctly, then I think this covers what you are missing:

See the whole article from BlenderNPR for the full explanation: http://blendernpr.org/solidify-modifier-contouroutline/

Please add some explanation as to what that node setup is doing and how it answers the question.

100% correct - worked like a charm. Thank you Drudge!


text:
Strawberry leaves
I would like to model a strawberry:

However, I don't know how to model the leaves on top. I already made the basic shape:

This shouldn't be asked as a one question. Please use edit button and make this one about seeds OR leaves. You can ask as much questions as you want. Please also be more descriptive in your questions.

Also check here: https://www.blendernation.com/2017/04/09/behind-scenes-strawberry/

@LukeD Okay, I'll do so. Thanks a lot for the link!

The leaves in that linked tutorial are quite different from your reference, I would try to model (and texture) a flat shape like real leaves above, then maybe deform them using curve modifiers...? You could also use planes textured with alpha (transparency) images, to get simpler geometry. There are many questions here about modeling leaves, usually LOTS of leaves...


text:
Dynamic Paint; invisible object is acting as brush anyhow
I model a concrete structure in which water is rising and falling and would like to create wet walls using dynamic paint (Blender 2.81). Rising and falling water are modelled by two (or more) meshes whose visibility is animated (e.g. one on - the other off, under "Object properties - Visibility"). The "water" objects are defined simultaneously as brush, the concrete parts as canvas. The problem is, that all brush objects act as brush when baking, even the non-visible ones.
Is there any trick to convince Blender that only visible objects should act as a brush while invisible ones shouldn't?
EDIT: There is a workaround by replacing disappearing of an object by sudden movement out of sight and vice-versa while the object stays visible all the time.

There are a few ways to do this, but both require new properties to be animated in sync with when you are animating the object's visibility.
The first way is to animate the visibility options on the Dynamic Paint modifier (on the brush object):

You can do this either by right-clicking on the icon and choosing 'Insert keyframe' or by pressing I when the cursor is over the icon. Note: You have to keyframe both the 'Show Viewport' (screen icon) and 'Show Render' (camera icon) settings to get this to work. Animate these values to be on when the object is visible and off when it isn't.
The second method is to animate the 'Alpha' value on the brush object to be '0' when you want it to have no effect and '1' when you do:

You may also have to animate the 'Wetness' value, depending on your setup.
Note that you should be able to copy your existing keyframes onto these properties by using the 'Dope Sheet' editor (but you must add at least one keyframe to these properties before they will appear in the Dope Sheet) by using the Key> Copy Keyframes and Key> Paste Keyframes menu options.

Well, thanks for the good answers! In my case, the workaround was best suitable, anyhow, but there may be situations where these proposals are essential.

Ok. Not sure if you're saying this solved the issue or not, but if it did, you can 'accept it'. See: https://stackoverflow.com/help/someone-answers


text:
Outliner slows animation preview in 3d viewport
I played animation preview in 3d viewport but when outliner area is displayed animation preview is slowed.
if I hide outliner, animation preview gets faster.
Outliner does something useless when animation preview is played. Is there anyway to optimize it? I need outliner but when animation preview is played I don't need outliner to update something and use up CPU and GPU powers.
I use python script which hides outliners when animation is playing but I can't stop outliners from updating itself? I even don't touch and see the outliner when I play animation.

In the timeline you can set the playback to active window only.

it doesn't solve the problem. when outliner exists somewhere  it consumes CPU resource like animation preview in quad view window uses quadruple resource. If I hide outliner, preview FPS increases.

I don't think any settings exist for what you want to do and I don't think it's possible to optimize performance without altering the source code if at all. It seems like hiding the Outliner with Python is a decent solution. You can write an operator and assign a hotkey to whatever you need to do to hide it. Why is that not good enough?

I use handlers and manually hiding outliners by script which almighty Chat GPT made for me, but I simply don't understand why outliner keeps consuming PC resource when it shouldn't.

This is the script I use. 2nd script's handler just simply replaces Outliner with Python Console panel temporarily when animation plays.
manually hiding script
import bpy
for area in bpy.context.window.screen.areas:
    if area.type == 'OUTLINER':
        area.type = 'CONSOLE'
    elif area.type == 'CONSOLE':
        area.type = 'OUTLINER'

handler script
import bpy

# Define handler functions
def handler_pre_func(scene):
    """Hide the Outliner when animation playback starts."""
    for area in bpy.context.window.screen.areas:
        if area.type == 'OUTLINER':
            area.type = 'CONSOLE'  # Temporarily switch to CONSOLE view
    print("Animation started, Outliner hidden.")

def handler_post_func(scene):
    """Restore the Outliner when animation playback stops."""
    for area in bpy.context.window.screen.areas:
        if area.type == 'CONSOLE':
            area.type = 'OUTLINER'  # Restore the original Outliner
    print("Animation stopped, Outliner restored.")

def remove_handler():
    """Remove the specified handlers."""
    # Check by function name
    bpy.app.handlers.animation_playback_pre[:] = [
        handler for handler in bpy.app.handlers.animation_playback_pre if handler.__name__ != handler_pre_func.__name__
    ]
    bpy.app.handlers.animation_playback_post[:] = [
        handler for handler in bpy.app.handlers.animation_playback_post if handler.__name__ != handler_post_func.__name__
    ]
    print("Removed handler_pre_func and handler_post_func.")

def register_handler():
    """Add the handlers."""
    bpy.app.handlers.animation_playback_pre.append(handler_pre_func)
    bpy.app.handlers.animation_playback_post.append(handler_post_func)
    print("Registered handler_pre_func and handler_post_func.")

def toggle_handlers():
    """Toggle the registration or removal of handlers."""
    # Check if already registered by function name
    pre_registered = any(handler.__name__ == handler_pre_func.__name__ for handler in bpy.app.handlers.animation_playback_pre)
    post_registered = any(handler.__name__ == handler_post_func.__name__ for handler in bpy.app.handlers.animation_playback_post)

    if pre_registered or post_registered:
        remove_handler()  # Remove if already registered
    else:
        register_handler()  # Add if not registered

# Toggle on execution
if __name__ == "__main__":
    toggle_handlers()


text:
How can i use OpenGL/Viewport render in rendered mode on cycles?
Whenever I do it on Eevee, it works. and I find it to be a great way to render faster, but whenever I do it on Cycles, I just get nothing besides a grey screen, Help? My render settings are on the default.
Example:
In Cycles:

In Eevee:

Please add details to your question. What scene did you create that you have a grey screen? Add screenshots of your lighting, materials and objects. What render settings did you use?

Yes, i added them now, and just to be clear to anyone else, this is not the F12 render, this is the OpenGL/Viewport render.


text:
What's the easiest way to get as close to cycles as i can on Eevee?
Simple  question, While tweaking with the render settings, I had noticed that compared to Cycles, Eevee looks kind of... "flat".
i.e.
Eevee:

Cycles (preview render at 3 samples) :

The Cycles render not only feels as if it has more "depth", but the shadows are softer, and overall generally feels less "cheap".
If possible, How can I get as close as possible to Cycles on Eevee?

Hello :). Could you please add some images that illustrate that "flatness"? There are many things that Eevee does differently.

What @ChristopherBennett said is true, but the difference between Eevee and cycles is that eevee somewhat fakes everything. It as little calculations sas possible, saving time but reducing quality. Cycles, however, does everything, making realistic but long renders. You cannot get the same quality as cycles with eevee

Eevee uses approximated direct-source lighting, and Cycles uses bounced lighting. To approximate bounced lighting in eevee, you must use an Irradiance Volume. Additionally, you must bake indirect lighting. As you can tell from this instruction, this only works with indirect light sources (point lights and the like are considered direct lights in eevee - use emission materials instead.) The "softness" in the shadows of the image below are as a result of the indirect light from the World Environment (grey background) - not the point light.

Further reading: How does EEVEE work?


text:
mesh not following armature completely
i made an armature to my model (human), did all the parenting etc. i used empty weights and applied the weights to the vertex groups manually in edit mode because auto weighting didn't work out so well (the auto weighting is not there anymore. i made a new armature from a backup file w/o any armature work on it because i knew i would screw up eventually).
luckily, posing the bones causes only the selected vertexes to move, but not as quickly as i thought it would. an example on the hands:

as you can see, the mesh doesnt follow the armature, though it is certainly influenced by it.
i have looked at the weight painting, it looks like this (assigning the vertex groups was all in edit mode; i didnt make any changes in weight painting mode):

and these are the vertices (including front and back of the hand; used x-ray) i selected for the vertex group.
pasteall file: https://pasteall.org/blend/0d726d4ea3994c59a574ad8fd836ccb9
thank you in advance :)
-- edit: for moonboots --

ive changed the weights for the forearm and the arm, but the mesh still doesnt yield:

hello, please share your file: https://pasteall.org/blend/

@moonboots done !^_^

Select your armature, shift select the mesh, switch to Weight Paint mode, select the arm bones, you'll see that the hand is part of the vertex group that they are supposed to control, which should not be the case:

To correct that, you can either do it with a brush (set to Subtract), or in Edit mode, select the hand vertices, remove them from all groups, and reassign to the hand group only:

i used a brush to remove the vertices from the arms, but it seems nothing changed. i'll post images into the question again

Yes because for some reason other bones, like Spine1 and Spine2 also influence it, so you need to correct this (make sure that the Front Face option is disabled in the brush > Advanced settings), and when it's done make sure that the hand bone affects the hand mesh (this tilme use Blend > Mix)

The second method, through the Vertex Group list, make things faster.

fixed it! i do wonder how the other bones ended up influencing it, since i started with an empty group? maybe i mirrored something incorrectly... either way thank you so much.

Hard to say what happened  ;)


text:
Bone moves one part of mesh but not the other
When I move the bone of the leg it moves everything except for the straps on the boot, I checked the weight and it was at 1. It's very odd because the straps are attached to the boot.(someone said to put a screenshot of the "N" panel.

Does it happen on both sides? Is there maybe a mirror modifier involved?

I have already applied the mirror modifier, that shouldn't be it

In edit mode, select a vertex of a strip and take a screenshot of the "N" properties panel, vertex weight tab, or upload your file.

You didn't include Vertex Weight rollout into the screenshot of the N panel.

I do not see an area for weight for some reason


text:
Could anyone explain what he is doing in this video?
I'm new to Blender and I found a video on Youtube where someone did that same thing that i want to do, but this video has no commentary so I don't know how to follow along. Could anyone explain to me what the Person in this Video is doing at min 02:00.
Video Link: https://www.youtube.com/watch?v=3481ueuDJwQ

Thank You!

He just added a mirror modifier and then started extruding. If you are new I would recommend watching https://www.youtube.com/watch?v=JYj6e-72RDs&t=867s

Why not ask the person who made the video? If their video is unclear and you let them know, both of you can learn from it.

I assume that you're talking about his use of the "mirror" modifier. At exactly 2:00, he checked the "clipping" box. What this does is it restricts edits to the object that would extend it past a line drawn through the origin point, perpendicular to the mirrored axis. For example:

"Clipping" prevents me from moving the selected edge past the origin point along the X-axis.
Without clipping, this would be possible:

For more, see this video on the mirror modifier.


text:
Create a self creating box like in this video
I'd like to create a simple line box that draws itself that I can import in Blender's VSE.
This can be done in after effects like in this video tutorial: https://youtu.be/YLNmtk67unY

What methods would be best to recreate this and could I use such methods to creat other simple self revealing shapes a simple well?
Many thanks for any help!

A nearly identical question arised yesterday, and had at least an answer: http://blender.stackexchange.com/questions/68590/how-do-i-create-a-self-drawing-2d-shape. Any shape built like that can be "imported in VSE" as scene, imho.

try searching for python turtle or you can try this https://docs.python.org/2/library/turtle.html

cheers for the response, sorry for the late reply, ill have a look at the other question and see if it answer my question. I'll also have look at the python turtle (though i've had no interaction with the python console as of yet).


text:
How Do I Bring Up The Same Properties Menu As In This Video?
I am trying to bring up the same menu that is brought up by F6 in this video. But when I press F6 nothing comes up, what do I do?
My Blender version is 2.77.

Have you tried fn + F6? If this doesn't work, what type of computer/operating system are you running?

The author of the video is adjusting the parameters of a newly added object.
In 3d view, add a new object and press F6. But there is a catch: if you do anything else other than press F6 after creating it, you don't get the window.

Many tutorials I've seen over the years teach you to do this through tool shelf, which isn't visible in that video.

this is the same menu like appear in left panel on bottom - this menu is changing according last function you use. So as first you must add circle by "Shift + A"

Why minus? This is true and I can't see what exactly Red Death doing, so my answer is to the point and best how can be with information I have ;-) If someone thing that I'm owner of oracular ball, I have some news for him: No, I don't own one :D

+1 as I don't see what is wrong here. RedDeath you should give more information if this is not what you want.


text:
Set initial rotation on branches
I am trying to generate a Norwegian spruce with the sapling addon. I have achieved this result:

The problem is that the secondary branches have the wrong starting direction. The rotation between each branch is 180 deg, so that the first branches always is in on plane. However, to get the correct result, the initial angle needs to be set to 90 degrees relative to the default value, so that the first branches is parallell to the xy-plane. Is that possible? Note: It should be easy to add a parameter to the add-on, so I could manage to do that, and also make a pull request upstream, but I may need some input on where the rotation angle is computed and so on.

I found the line in add_curve_sapling.py:
--- bRotate = oldRotate + uniform(-rotateV[n], rotateV[n])
+++ bRotate = oldRotate + uniform(-rotateV[n], rotateV[n]) + pi / 2

Should make the suggestion to add the angle as a third parameter.


text:
Is there a shortcut to find the selected object in the outliner?
I have a scene with a lot of objects which can clutter the outliner very quickly. Is there a shortcut to find the selected object? Basically, if I select an object, I would like to have a shortcut to move my outliner view to include that in the displayed portion of the outliner.

:O I searched for it using several different keyword combinations!! Oh well, good eye

"[outliner] numpad" was the search, minus the quotes.

Hover over the outliner view and press Numpad .. This will move the view to show the object that is selected in the viewport. There is no shortcut if you are hovering over another region.


text:
Is there a faster way to close these holes
I'm working on this statue, I started it as two separate objects, the lion and the orix, I merged them to one object using Ctrl + J, I need to connect the mesh properly so it can be 3D printed, and later I will use Sculpt to make the details, I've been moving, edge looping and connecting all these vertices manually, but it's an extremely tedious job, is there a better way to merge or connect all these vertices and remove the excess resulting edges? The problem isn't only with the long time it takes, but with each edge loop added, I'm increasing the faces count, and I'm trying to keep it as low as possible.

[3
]5

Can you post the Blend? Prior to the merging of the meshes?

How do I do that Rick Riggs?

I added a link on sketchfab, I uploaded the OBJ file before merging the objects.

If the sculpture were a bit more flat it could be possible shrinkwrap a plane atop of these 2 meshes. In this case I don't think it's solution, so if you'd like less polys and meshes connected to each other, use Boolean or Knife Project to cut statue into the base with using Ngons to lower amount of faces. If the area of connecting is going to be flat nothing should be wrong.

I'm with Mr Zak on one point, looking at your mesh it looks like a simplistic enough mesh to successfully pull of boolean operations, which is why I wanted to see if your geometry was closed before you joined it. You mentioned that you had holes, where those introduced when you started hacking away at the joined mesh, or where they there to begin with?

If you have the blender file, this would be ideal, as you need to join sketchfab just to download the files. To add it use the following LINK.

Thank you Mr Zak, I'll research these methods and try them.

Rick Riggs, I meant by the holes, the difference between the edges of the two meshes after I merged them, as in the images.

I uploaded the .blend file, and linked it to the question url

@cegaton, I didn't know how to upload the .blend file, when Rick Riggs gave me the link, I did upload the .blend file to blender-exchange and linked to the url here, but I can't find it anywhere! I only added the sketchfab link when Rick Riggs asked for the file, this was the only way I knew how to do it.

@MrZak and Rick Riggs I used the Boolean method on the separate objects after closing the meshes, it's awesome! Thank you!

You should add a boolean modifier to merge the two objects. You might have a few new vertices in your mesh but it will be far easier to clean up once you have deleted the inner faces created in the operation.

I used this method, in my case it is the most useful method

I'm constantly editing similar meshes, I usually subdivide smooth (meshes absorb to each other), then laplacian smooth, remove doubles and then maybe laplacian smooth again. Play around with the Lambda factor in laplacian smooth to get the desired result. Lessoning the vertices in the less visible areas is always a good idea.


text:
Darken a shadow on a shadow catcher without changing the light on the object casting it? (Blender Cycles 2.81)
I am making a very short video in which a miniature dalek model (https://www.blendswap.com/blend/6326) goes around my table, and I made a shadow catcher plane, and I wanted to make the shadow brighter without making the object brighter. Strangely enough, in the render viewport, the image looks just as I want it.

(This is the image when in the render viewport)

(however this is the image when properly rendered)
As far as I can tell, this scene has two light sources, a HDRI environment texture and a "window" that I modeled approximately to the shape of our window, that I just added an emission texture, to simulate the light of the real window.
I would be hugely grateful if anyone can help with this.
Thanks.
And sorry about the rubbish formating. I am new and not very familiar with this yet.

One way is using compositing: isolate your shadow and use brightness/contrast or Color Correction before composing it with your robot.

I was thinking something possibly like that, but I was thinking if it looks right in the render view in the viewport, then why doesn't it in the actual render.

it might be that you're just lucky with the viewport result as it has a lot of simplification vs the final render which is supposed to be more physically accurate. The problem is that Shadow Catcher in itself is not physically accurate, adding some unpredictability to the process.

Yes, probably. :( Thanks though.


text:
Is it possible to change the opacity of wires in version 2.8?
I just downloaded Blender 2.8 and I really like the new interface and many of the new features, but I have run into an issue where I can't really see a reference image behind my mesh, even with wireframe on. It appears that the wires are extremely compact and it has a darker filter over it.
Is it possible to adjust this so I am able to have better visibility of my image behind the mesh?

I'm not sure what you mean when you talk about extremely compact wires and darker filer, but have you tried the X Ray option in the Shading menu?

Go to the Edit menu on the top left of your screen, and select User Preferences. Under the tab that says 'Themes' you will find settings for the Wire and Wire Edit. These are the ones you want to change.

Could you direct me to the overlay? I can't seem to find it.

My deepest apologies; they had it in an earlier version, but it appears to have been removed. HOWEVER I shall edit my answer, because I found another way to do it.


text:
problem with array modifier while trying to create a plant
i am trying to create a plant, but when i am adding array modifier to a leaf and seting the properties that you can see on the screenshot below, it is having this strange distortion, so i want to know how to clean it up and where is my actual mistake

Your object have a non-uniform size, specifically along the z axis and thus the slight displacement of the leaf is amplified along the z axis. So just apply the scale of the object using Ctrl+A >> Scale.
The same problem may appear when the offset object have a non uniform size as well.

@travisscott Please accept the answer if it answers your question.


text:
Character's Underlying Mesh is showing through top mesh of Jeans
I downloaded a character model/rig and have been experiencing problems with the mesh of the jeans. When the character is facing forward, the jeans look fine. Once you rotate the character or move the legs, the underlying body mesh shows through the jeans. How can I fix this?
Rig facing forward:

Rig slightly rotated on Z axis:

As you can see the skin mesh is showing from underneath the jeans mesh. What could be going wrong here and how can it be fixed?

You could delete this part of your mesh. If you prefer a non-destructive way you could give your object a Mask modifier:

In Edit mode, select the part you want to make invisible, assign it to a group.
Back in Object mode, give your object a Mask modifier, in the Vertex Group field, choose the group you've created, click on the arrow on the right to invert the masking effect.

The Mask modifier worked, thank you so much!!


text:
Some particles appear too bright
So I was watching Blender Guru's videos on donut making in Blender and when it came to the sprinkles they showed up super bright on the rendering. I don't know what happened. In the image, you can see the spherical sprinkles are just fine but the rest aren't

share blender file please

have you tried changing the material?

It looks like you used an Emission shader or changed the Emission color of the Principal BSDF shader.

@sanbaldo If you're asking someone to upload a blend file and if it is needed then it's better to suggest where users should upload to, i.e. https://blend-exchange.giantcowfilms.com/

I don't know what i did that made them look like that but i restarted and everything is fine Thanks for the help!

It looks like your particles are actually emitting light. In order for this to happen, they either have an emission shader, or a principled shader in which the Emission value is not set to black.
If the particles using an emission shader, simply change it to a principled shader and that should fix the problem. If they are using a principled shader, simply go to the Emission box and set it to black.

it can also be some "bloom" effect in Evee


text:
How to align some vertices group by polygon/edge and axis?
How to align some vertices group by polygon/edge and asix ?
It may solve by boolean operation.
Or using snapping to grid, because snap to grid works such as intersection with align axis. But another snapping tool doesn't work like that.
Simple example:

This is a standard Boolean operator task:

I know and wrote it in question. But i want another solution. On image usual case, but i have often another case more difficult.


text:
Geometry following a curved object
I was looking for a way to snap one object ( wooden plank ) in a rounded surface ( sphere ).
actually i'm using a shrinkwrap modifier but the result is not what i want..

I would like that the wooden plank follow the curve of the sphere like the brick follow the curved surface in this picture.

I hope I explained myself.

Could you please embed the screenshots directly in your post? Use the Edit button then the Image icon. Thx

Already tried, the image link tell me that the image is not supported, even if i insert the url that i shared with you

create a 2D lattice and match it with your tile
use the Lattice modifier on the tile and assign the create lattice
parent the tile to the lattice
add the Shrink wrap modifier to the lattice
Enable Snap to Face on your target object
move the lattice on the target object.

Play around with shrinkwrap offset, lattice resolution and subdiv modifiers to tune it.

The Shrinkwrap modifier will need the wood to have plenty of edges to make the turn first of all BUT it will flatten the wood. So, make first only a 2d plane to Shrinkwrap that is the size of the wood's X and Y but not depth.
Shrinkwrap (perhaps by projection, not "nearest surface point" as is in the blurry image). Position. Duplicate. Apply the modifier.
Now you can Extrude the 2D pieces into the 3D planks you envision.


text:
Can smoke be coloured by a UV image?
In blender, I am trying make an object emit smoke in different colours at the same time based on where on the object it is emitting from. Is it in any way possible to use a uv map on an object to control the smoke particles emitting from that object?


text:
Why don't i have an option called collection?
I am a beginner to Blender, and I am watching a tutorial on how to make a donut. This guy has an option called "collection" which he has and I don't. Can someone please explain why?
It happens at 17:25 in this video.

Either you have not changed the Particle Emitter to use collections, or you have not created a collection for the sprinkles. BlenderGuru changed the particle emitter to use collections earlier in the video here.
If you did not create a new collection, you right-click in that window in the top right corner, and press New. This will create a new collection that you can rename by double-clicking, or pressing F2.
Alternatively, you can select all the objects you want to move to the new collection (in this case, all your sprinkles), press M and select + New Collection. BlenderGuru showed this process in the previous video here.

Edit: unrelated to original question, related to comments
Looking at the objects list in the top right corner, The donut and the sphere both have Particle Emitters applied.

To remove them, first, select the object (either the donut or the sphere, you don't want to delete the particle emitter from the icing), then go to the Particle Properties tab (blue icon with a couple of dots connected with lines). Then, press the minus button shown below.

Hi :). I just love how you give detailed and researched answers to even the most basic questions. Thank you for making this site a better place :).

I went through the donut tutorial too :) I know the feeling of being completely lost all too well, so helping others get past the learning curve is the least I can do to contribute back to the community.

Thank you very much for helping me I very much apriceate it

And by the way, can you check my file for errors, of course, you don't have to I just have a fear of messing up

It looked fine to me when I looked at it. If something else goes wrong and you can't find a solution, just post another question.

This is the link

Alright looked over it a bit. I can see that you accidentally applied the Particle Emitter to the wrong objects a couple of times, no worries there, just be sure that you remove the ones on the wrong objects just to keep things neat. There are things that you could do to improve the realism, but that comes over time with practice. You're doing great for your first project!

how would i do that

Updated the answer


text:
Why don't i have vertices on the bottom of my coffee cup
I am watching the blender guru make a coffee cup and he has vertices on the bottom of his cup while I don't can someone tell why my file is down below
VIDEO:https://www.youtube.com/watch?v=7a0cHFs7jkw

TIMING: 13:49

Please check out my file

I don't think I need to put any more information then I already have

Because he explains that you have 32 faces meeting into create one giant face at its end. So what he instructs you to do is to do what is basically a loop cut or extrude on the existing geometry and press i  with the Blender keymap settings set in your preferences to hid the formulated edges that would have been created otherwise.

what do you mean by that

how would I do that

Go to preferences and make sure your blender key map is set to Blender in the keymap settings. Highlight your bottom edge loop and press 'i' to scale in. It shows it right in the video.


text:
Eevee bloom effect covers my texture as camera gets further away from the object
I have a star mesh that has a Texture on it for the mouth, which is just a black curve for a smile. The star's material has a translucent shader and the star has a light inside it, creating a glow effect. However, this causes my mouth to fade out as you move away from the object. Is there a way to stop this from happening? The yellow-mouth material is assigned only to mouth area and the Material is assigned to the rest of the object.

One way is to use 2 render layers with one dedicated to overlay the mouth over the glow effect.

Have you tried my suggestion?

Not yet. How would I do this exactly in blender 2.8?

Sorry but you will have to do some research and learning about this https://docs.blender.org/manual/en/latest/render/layers/layers.html . I would have your base scene, just modified without the smile, then on the second layer, paint your smile on a separate texture so that only the smile appears on the render, then use Compositing to simply add it to the original bloomed render.

OK a few mn to spare to take a crack at it:
The basic concept is to render the smile on a separate layer and overlay it over the bloom effect using Compositing.
In this example, I used a curve instead of a texture for the smile. A texture could still be used as long as it is rendered with some transparency around the smile.

Remove the smile texture from the star material
Check the Film/Transparent box, this allows to do compositing properly

Create your smile using a curve and beveling it. Use a black emission shader. Parent it to the start
Create a 2nd Layer just for the Smile. We'll use this collection to render only the smile in the second layer

Make sure to enable Environment on your main render Layer

Create a second render layer and disable the main collection, leaving just the Smile collection enabled.

Composite the environment and the two layers using Alpha over nodes

Now the smile should remain visible no matter how far the star is or how strong the bloom is. Note that since the composite effect is only applied at render time, the Viewport bloom will still cover the smile if the star is far away.

Wow that was really helpful. Thank you!


text:
Introduce size in mm when scaling edges
Good evening to everyone,
My question is simple but I'm unable to find the answer. I'd like to input the size in mm (or meters) when scaling an arista instead of instroducing the scale unit with the keyboard. Just to be more precise. Is this possible?
The exact issue is that I would like to scale the edge in the picture by introducing the exact mm but I can't find how to do it.

Thanks in advance.
Jaume

Just select your object and press N. A sidebar will open and then you can change your dimensions there.

Hi. Many thanks for your reply but seems not working. I'm inserting a face in a plane and I'd like to input the size in mm in the 4 new aristas. N menu only shows the median.

For the OP and others: arista is edge in Spanish.

Thanks for the clarification Markus

If you enable Edit Mesh Tools in Preferences->add-ons, you can use Set Edge Length operation in the Numbers Panel: https://i.imgur.com/6O2EsgQ.png

I'm trying to change it this way but seems not working either. When I input my size there the edge goes to the moon!

Perhaps because you don't specify mm so Blender guesses the base unit m which is 1000 times more than what you want.


text:
3ds max user want to find Refine and Connect tool in blender
Hi I'm a fellow user of spline modeling and I cant find the "refine and connect" from 3ds max in blender
this option just create a line/segment between two points/vertices of a curve/spline
so their is an option like that in blender  ? or even an add on ?
edit example of 3ds max refine and connect
edit to @gorgious i add two  screenshot

Hello, typing F with 2 control points selected or going Control points > Make segment should do it. Be careful that one control point can't be connected to more than 2 other control points though.

I follow ur instruction and get this error with two different curves "bezier circle" and "simple circle "

Like I said in my second sentence, a control point can't be connected to more than 2 other control points :)

hahha okay lovely so no way to have the same option in blender like the gif show off (edit2)

As far as I know there is no such tool in Blender, mainly because curves in Blender can't branch.
One workaround is to select an vertex you wish to connect beforehand, duplicate them with ⇧ Shift +  D, Right-Click to cancel and leave them in place.
Then just press  F a bunch of times to connect them.

Beware that Blender doesn't really memorize selection sequence, the connection order will depend on the spline index the vertex was derived from, so it may not always yield expected results if the original splines were not created in the same order you want them connected.
Another potential caveat is that splines must be all of the same type (bezier, poly or NURBs), and belong to the same object, otherwise you will not be able to connect them.

This answering my Question . Too bad Blender doesn't have a real spline modeling option .... I still have to use 3ds max ... 90% of my workflow can be done in blender this is was the last part ... I really hope the next version of blender will improve this part like that I can stop using 3ds max :D
Thank you for u time !


text:
Make a hollow Minecraft build solid
I have an .STL file of a Minecraft building which I would like to 3D print. The building itself is "hollow", but I understand that in the world of 3D rendering, there is no such concept - just vertices and edges.
So the issue I'm having in Blender is that the building is made of units of blocks which themselves are solid, but together create an overall model which is hollow. Thus when attempting a 3D print, the hollow inside of the building is not being infilled which is causing problems.
I just care about the exterior of the model. How do I edit the model in Blender to in essence "fill" the interior of the model? I thought of trying to select all the exterior vertices, then invert, then delete the interior vertices, but that did not work in my case and is unreliable/tedious. I assume there is a proper way to do this anyway (I am relatively new to Blender).
Edit: (Link to file): https://pasteall.org/blend/510d7027732e4e07be713198e682c060
Photos:

The first image is the exterior, the second is the hollow interior. I just want to print the exterior shape as if the whole model were totally solid. How can I achieve this. Thanks!

Sorry, are you looking for the end result to be a solid block, or a hollow shell (with some thickness to the walls)? Or do you want the interior to resemble a "cubic honeycomb" (for lack of a better term)?

Christopher, thanks for your comment. I am looking for the interior to resemble a cubic honeycomb (I assume you are referring to 3D print infilling).

Yeah, I'm not 100% familiar with how it works, but I'm getting the idea. You want every edge to connect to it's adjacent edge through the interior, crisscrossing the edges that run perpendicular. (I hope I have that eight). Your mesh is triangulated - do you want the diagonals filled as well?

Yeah that might me a solution. Whatever makes the object as a whole solid and not hollow is what I am looking for. I only care about the exterior since that is all you would be able to see in a 3D print of it, so I would like the inside to just be infilled.

Ok. I'm not sure how the infill is supposed to be represented as far as instructions to a 3D printer. Blender is picky about faces having a direction (they are one sided as opposed to double sided), and any interior containing a multitude of one sided faces that are "interlaced" so to speak, would make the mesh "non-manifold" which is a no-go for 3D printers as far as I understand. This might mean the (infill) walls need some thickness to them, which might also be a pain to achieve. Since I don't know too much about this, I'll upvote the question so hopefully someone who knows more will see it

I appreciate it!

I think a simple Tris to quads then Merge vertices by distance should render it manifold by the looks of it. Are you able to share the model ? https://pasteall.org/blend/

Thanks for the upload link. Here is the model: https://pasteall.org/blend/510d7027732e4e07be713198e682c060

For 3D Printing, what you need is a "watertight" or "manifold" model. Both terms mean that there are no holes in the exterior of the geometry, but more importantly, no internal faces, which is what you have here.
A great addon for checking your model is the 3D Print Toolbox, which comes standard in Blender, you just need to turn it on!
The simplest way to fix this is to use a Remesh modifier, this will recalculate the object into "voxels" (3D cubes) of a specific size that you can define based on the exterior. This, however, is VERY CPU heavy! It's REALLY slow to calculate!
There is a MUCH better remesh option though. It lives either in the tools panel in the sculpting mode, or under the Remesh tab in the Object Data Properties tab.

0.1mm setting is more than good enough for 3D Printing. But be warned, this is still quite CPU intensive!
For your model, you may need to leave it for a few hours depending on how powerful your PC is!

Thanks for the response. I am launching the calculation now and will leave it until it finishes. In the meantime I also had a chance to upload the file if you are interested. https://pasteall.org/blend/510d7027732e4e07be713198e682c060. I will let you know if the remesh works!

So it appears to create a proper manifold volume with the shape preserved. In my case though, there are now about 8 million faces. Is there a way then to further simplify the geometry?

Okay so this actually does do what I want (I tested with a less detailed remesh and then exported to Cura and the interior was solid!) So now the question is, is there a way to efficiently remesh? As this is a Minecraft build, everything is "blocky", so I certainly don't need 8 million vertices. Is there a way to either remesh more efficiently without losing detail, or reduce the vertices/edges/faces after the intial remesh without stalling the Blender program? Thanks much!

After remesh, try the Decimate modifier, there is a setting to preserve the outer shape

What would that setting be? Thanks.

I was thinking of that setting from memory, my apologizes, it is part of the QuadriFlow remesher... Just try the Decimate mod and see how you go :) You can also go into edit mode after applying decimate, select all and ALT J to convert tris to quads where possible just to clean it up a little more, but to be honest, when you export as STL it will be changed back into tris anyway so it wont affect your final STL.

Thanks! All these suggestions produced what I was looking for. Answer accepted.


text:
Make 3D object from Minecraft manifold and solid
I have an odd situation with an object converted from a .wrl file of a Minecraft building. After remeshing to make the object manifold, it seems to have created a "hollow" object - that is, there is an outer facing layer on both the outside and inside of the object. This is kind of confusing so here are some images:
Here is the bottom corner of the building from the outside. "Outside" facing parts of the faces are highlighted in blue by Blender for clarity.

And here is the bottom corner of the building from the interior. Notice it's still blue, which means there's another layer of "outside" faces pointing inside the building.

Finally, here is a GIF of me going from the exterior to the interior of the building from the bottom a couple times. Notice the red coloring signifying the inside pointing parts of the faces.

My guess is since Minecraft is made of blocks, it's considering the inside of a block to be the "interior" and every face of the block touching air the "exterior", including the faces that are facing the inside of the building. I think this is why when passing through the floor, it showed red.
My goal is to 3D print this building, so I am only concerned about the surface of the building itself. I don't care about its hollow interior. In fact the hollow interior should be infilled by the slicer program, which it is currently not due to this issue.
How can I either make the imported building manifold to begin with so I don't have to remesh at all? (I've tried a handful of things to no avail here like merging vertices by distance, the 3D print toolbox addon, etc.) Or if that's not possible, how do I get rid of everything except the surface of the building - any faces touching 'air' so to speak. The mesh should just consist of what is visible from the outside. Any solution to get this object 3D printed is fine with me.
Thanks!
Edit: I'm linking to an example of a smaller imported Minecraft build with identical problems (one seen in pictures above is too large a file): .

There are a great deal of inner faces within the "hollow shell" - look inside this top of the dome tower - there is a second floor. Inner faces like this will confuse blender.

In edit mode, try hovering your mouse over a face on the inside and hitting L If it selects all the inside faces only you can simply delete them

Right, there are interior faces all throughout which seem to equate to the inside of Minecraft blocks. How can I get it to ignore the inside of the building and just consider the outer surface?

Psyonic, thanks for the response. It seems to select a disorganized mix of both in my case

I see your model now, yeah, that's a mess. Why don't you want to re-mesh? That is what that tool is for after all.

For some reason if I remesh with enough detail to actually print, it does the thing where it has the two “outside” facing faces on the exterior and interior of the model. This makes it hollow and thus the slicer doesn’t infill the empty interior space. The images shown in the question are from the remeshed result.

Ok... I did a re-mesh of 0.1, then added a decimate modifier with ratio set to 0.05. This took some time to compute but SuperSlicer looks like it sliced it just fine :)

Hmm I will try that on the model from the question. Is it possible to send the file for that model? It’s 70 MiB but the Blend Exchange max is 30 which is why I used that smaller example file. Which other options did you have set from the decimate modifier as well?

I find it frustrating that Blender has no way to select faces that are essentially exposed to the outside world. This feature is missing. L will not do the trick. There must be some algo available that selects all faces that can be hit by light and your model is the perfect example for the test. Even the select box tool will not work, it is supposed to select only what is on the outside like this but it ends up selecting faces on the inside as well which is incorrect behavior.

Harry, I totally agree. I’ve tried so hard to find a way to do this and at first I thought it would be easy since it seems like such a basic and common case. But I guess I was wrong.


text:
Syntax Question Python, a command with two variables
I have a question to python programming. I'm writing PieMenus for my Spacemouse. It's a Syntax Question. I want to use a comand with a action and a true command at the same time.
So I want to build a menu like shown in the picture

But the code for the Extend comand dosen't works. I get the same effect like in select parent.
# Pie Selection Edit Mode
class PieSelections_PM(Menu):
    bl_idname = "pie.selectionspm"
    bl_label = "Pie Selections Pose Mode"

    def draw(self, context):
        layout = self.layout
        pie = layout.menu_pie()
        # 4 - LEFT
        pie.operator("view3d.select_border", text="Border Select",
                    icon='BORDER_RECT')
        # 6 - RIGHT

        pie.operator("pose.select_constraint_target", text="Select Constraint Target", icon='FORCE_CURVE')
        # 2 - BOTTOM
        pie.operator("pose.select_all", text="Select None",
                    icon='RESTRICT_SELECT_ON').action = 'DESELECT'
        # 8 - TOP
        pie.operator("pose.select_all", text="Select All",
                    icon='RESTRICT_SELECT_OFF').action = 'SELECT'
        # 7 - TOP - LEFT

        pie.menu("pie.selection_Parent/Child_Extend_PM", text="Extend Parent Child", icon='LINKED')
        # 9 - TOP - RIGHT
        pie.operator("pose.select_all", text="Invert Selection",
                    icon='FULLSCREEN_EXIT').action = 'INVERT'
        # 1 - BOTTOM - LEFT
        pie.operator("view3d.select_circle", text="Circle Select",
                    icon='BORDER_LASSO')
        # 3 - BOTTOM - RIGHT
        #pie.menu("pie.selection_Parent/Child_PM", text="Parent Child", icon='GROUP_BONE')
        box = pie.split().column()
        box.operator("pose.select_hierarchy", text="Select Parent", icon='ZOOMIN').direction='PARENT'
        box.operator("pose.select_hierarchy", text="Select Child", icon='ZOOMOUT').direction='CHILD'
        box.operator("pose.select_hierarchy", text="Extend Parent", icon='DISCLOSURE_TRI_RIGHT').direction='PARENT'.extend=True
        box.operator("pose.select_hierarchy", text="Extend Child", icon='DISCLOSURE_TRI_DOWN').direction='CHILD'.extend=True

The code with I want to change is that one below. How I have to seperate  "direction='CHILD'" and "extend=True"?

Related

thanks, needed some time to get how it works, but now my code works

So with the comment I made the following code, which works well:
    #The props= is to get two multiple arguments with one operator.
    props=box.operator("armature.select_hierarchy", text="Extend Parent", icon='DISCLOSURE_TRI_RIGHT')
    props.direction='PARENT'
    props.extend=True


text:
Python: Using pycharm with the blender API gives errors
I was trying to follow this tutorial to use Pycharm with blender. I extracted the API from blender but when trying to use the bpy library, I get multiple errors. Is there some way to fix this or download a more stable version?
I get an error like this:

def template_list(listtype_name, list_id="", dataptr, propname, active_dataptr, active_propname, item_dyntip_propname="", rows=5, maxrows=5, type='DEFAULT', columns=9):' ^ SyntaxError: non-default argument follows default argument

This is after I fixed 7 errors. I know how to fix it but its a huge hassle to fix all the errors.
File: https://www.dropbox.com/s/rbi4r417p8qeq7y/bpy.py?dl=0

I get an error like this:
'def template_list(listtype_name, list_id="", dataptr, propname, active_dataptr, active_propname, item_dyntip_propname="", rows=5, maxrows=5, type='DEFAULT', columns=9):'
^
SyntaxError: non-default argument follows default argument
This is after I fixed 7 errors. I know how to fix it but its a huge hassle to fix all the errors.

Where does the template_list method come from? list_id="" is known as a default argument, ie it has a default value of "".  It needs to be in argument list  after the non-default arguments.

It is in the bpy file I posted above, line 76158

What version of blender? did you read the important note at then end of step 4?

I did read the important note. I have blender 2.79 which they said: "does not work correctly with Blender newer than 2.78."

Hmm, been thinking of giving pycharm a run myself.  Did you try the API defs in link associated with important note?

This answer suggests building blender as a module which can be imported in IDEs outside of blender. This one links to a code.blender article that has an addon to use pycharm to debug a script that is running in blender.

I’ve been thinking of building blender. If I did it on Linux would it work with windows?


text:
Python select keyframes at the current frame
I'm creating a script to automate copying keyframes of an object, I'm using
bpy.ops.screen.keyframe_jump(next=True)

to jump to next keyframe, what I need as a next step is to copy the keyframes at the current frame which I'm getting using:
current_frame = bpy.context.scene.frame_current

Reading the documentation, I found ways to select all keyframes:
bpy.ops.action.select_all()

Which obviously select all keyframes
QUESTION: How to select keyframes at current frame only?

Looking at the documentation:
bpy.ops.action.select_column(mode='KEYS')
Select all keyframes on the specified frame(s)

Parameters
mode (enum in ['KEYS', 'CFRA', 'MARKERS_COLUMN', 'MARKERS_BETWEEN'], (optional)) – Mode

Should select all keyframes at a specified frame.
KEYS didn't do a thing for me, CFRA at first sight looked like some kind of a foreign language, however at a second glance, looks like it stands for Current Frame, it would really be very helpful in my opinion to use a descriptive enum, such as 'CURRENT FRAME" but it is what it is.
So the answer is:
bpy.ops.action.select_column(mode='CFRA')
will select all keyframes at the current frame.


text:
Blender problems with getting the center of an object. (Origin to center is not the center)
As you will see in this image, the center of the object is not exactly the center of the chair, since the pivot point is slightly up.

To verify this, I place the cursor in the center of the world and use a cube to check if it is offset up or down.

How can I really center an object? Since apparently blender does not calculate the position well or there is something I do not understand

The origin of an object can be anywhere you like with respect to the object's mesh.
There are two possible definitions of 'center' provided by Blender's Header menu > Set Origin > Origin to Geometry operation, in Object Mode.

'Median Center', which is the mean location of the object's vertices

'Bounds Center', which is the center of the object's bounding
box.

It looks as if you want 'Bounds Center'.
(In Edit mode, the behaviour of ShiftS Cursor to Selected also varies, depending to whether 'Median' or 'Bounding Box' is selected as Transform Pivot Point.)

Learned something new here, thanks :).

From the tests I did, the center of origin is not in the center of the object ... that's the problem.
Try with the 2 shapes you say and there is no case, it is never in the center, always higher or lower ... It seems to me that there is an error in the internal calculation of Blender3D.

I've never had this as a problem ... say... Cursor to selected, with Bounding Box Pivot  set (and axes orthogonal to mesh)... and then Origin to 3D Cursor? Could you share your file on https://blend-exchange.giantcowfilms.com/ ?


text:
Adding rivets to an object for 3D printing
I have an object which is going to be 3D printed to which I would like to add lot of small rivets, and to do this without losing its manifoldness.  The way I've decided to do this (stupid it may be) is to place spheres in the appropriate place so that a portion of sphere is sticking out, the spheres being separate objects to the thing they are "riveting":

However, keeping them as separate objects is kinda risky (one false move...) and so I'd prefer to incorporate them into the main object.  But I need to do this without destroying my manifoldness. I've tried a Boolean Union but that leaves stuff hanging over on the inside of my object, which makes it non-manifold.  Is there a way to achieve my aim, or maybe an entirely different rivet strategy which I should adopt?

You could model this, if you're starting with  a topology something like the  one illustrated here:
With Pivot set to 'Individual Origins'

CtrlR add three edge-loops
AltP poke the two middle face-rings
Select a couple of consecutive rivet-vertices (not necessarily just one apart)  on the central loop - use CtrlShiftNumpad+ to select the rest, and then CtrlShiftB bevel those vertices, in 'Offset' mode
Space .. look up the 'Circle' operator, and use it on your newly created faces. (They should still be selected)
perform whichever series of insets, extrudes, and scales create the kind of rivets you want.

I don't know whether you're sub-d modelling, but this is the result after putting on a level of subdivision.

You could use the Loop Tools add-on > 'Space' option at the vertex stage, in various ways, if you want to improve the distribution of rivets.
Although the result is not all quads (before subdivision), it's in the flat, for printing, and is not expected to deform, so that's probably OK?

Ooh, yes, lets of things I've not tried before there.  I don't quite have the arrangement you started out with but I have something similar and through an insane number of operations and a little repairing of non-contiguous surfaces from the 3D printing tool I can achieve a manifold riveted object.  Cool. :-)

You just need a radial edge for each of your rivets, and quads all round, to speed up selection. And, of course, you can 1/4 the amount of work you have to do at that stage by using a mirror modifier in 2 axes.

I tried the true modelling method which I think would have been the right way if I were starting from a clean shape but, since I'm applying rivets to an existing shape which is not necessarily always planar, I found that the subdivide/poke/bezel/loop procedure ended up producing shards that were difficult to get rid of.  So I adopted a more laborious but less "shardy" method as follows:

Create a cylinder to use as a rivet-punch.
Position this at each rivet position and Boolean difference it with
the base shape.
Select the edge of the resulting hole, circlify it with loop tools, extrude it as a region and add a face.

Provided I'm careful with the rivetter this always produces a manifold structure. Here's the model, a picture of the thing I'm modelling, rivets exaggerated in the model otherwise they wouldn't be visible (the length of the riveted section you can see in the picture is about 22 mm when printed to the correct scale), and a test print.

Hehe...... you always want to start from a clean shape.. ; )  The Boolean habit can often get you into trouble IMO, but maybe that's just me....

Yeah, I understand that now, one for next time. Thanks for your help, I definitely appreciate pointers on process.

FYI, I've now redone the model starting from a clean shape :-).

Cheers! I've had a look.. It would still be difficult to use this method with your 'fan' topology, rather than generally quad face-loops and a more traditional sub-d approach. Despite its apparent convenience, I think your method will probably wind up being harder work than  a much simpler framework , (basically hinting the sub-d how to make your curvatures for you, rather than explicitly laying in hi-res bevels). Many of Blender's  tools are well-geared to it. Check out some subdivision-surface tutorials (any software) and see if it suits you.

You can use a boolean set to difference to create a hole in the shape of the sphere and then press J to merge the objects into 1.

I can do that but it ends up non-manifold because one side of the hemisphere is still there.  Is there a simple way to delete it?

It is better to avoid boolean operations when possible. They may introduce messy geometry that is harder to work with.