text:
Guidance on creating a Celestial Sphere
I have a project in mind that I want to create with Blender. I'm trying to create what's called a

Celestial Sphere.
   In astronomy and navigation, the celestial sphere is an abstract sphere that has an arbitrarily large radius and is concentric to Earth. All objects in the sky can be conceived as being projected upon the inner surface of the celestial sphere, which may be centered on Earth or the observer. If centered on the observer, half of the sphere would resemble a hemispherical screen over the observing location.
 Earth rotating within a
  relatively small-radius geocentric celestial sphere. Shown here are
  stars (white), the ecliptic (red, the circumscription of the Sun's
  apparent annual track), and the lines of right ascension and circles
  of declination (cyan) of the equatorial coordinate system.

I would like to create everything with objects, i.e. I'd like to avoid using a texture wrap on the entire sphere.
What would be a good way of achieving this ?

https://blender.stackexchange.com/questions/3315 https://blender.stackexchange.com/questions/10741

Wireframe modifier is your friend when you need to create the grid of
the outer sphere
Constellations are just some vertexes connected with edges (the hard part is to put them in the right position - if you have coordinates you can insert them in the object properties > Transform > location XYZ attributes)
you'll need to work with shaders to config how the edges are going to be rendered

For part 2 recommend the ephem module. https://rhodesmill.org/pyephem/tutorial#computations-for-particular-observers


text:
The geometry of the mesh gets distorted when rigged and posed

I tried to set up a rig into my character as you can see in the image. However, I have two problems :
A. When I move the rig, the geometry gets distorted crazy.
B. Whenever I move any joint, the pose mode lags so slow. All the joints do not bend as smooth as they are supposed to be in Youtube tutorials. Here are my approaches to the problem, which did not work :

Since the body mesh had 'Multiresolution' modifier on, I thought it was the excess number of geometry that is causing all the lagging and making the computer difficult to process. So I deleted the multires modifier and tried it with same rig. However, both the lagging or the crazy distortion of the model did not disappear.

I did not tried the weight painting method in rigging which most blender tutorial demonstrates, because just like the pose mode, the weight paint mode lags crazy. Maybe that is the problem, but I will give the description of how it looked when I entered weight painting mode: The character was in full dark blue with no red or green colours. Would there be any other approaches to solve this problem? By the way this is the tutorial that I followed : https://www.youtube.com/watch?v=TL45rxB30_o

Also, here is the file of my mesh : https://drive.google.com/file/d/1URSnA5C7Wp66RLt6UQEupGX9waX3DQpk/view?usp=sharing

hello, for the moment we need an authorization to download your file, please allow anyone  ;)

Sorry. I changed the setting. Is it working now?

yes it works but it makes my Blender crash, I hope someone will be able to help  ;)

Maybe because of different version? I am using 2.8.2.

or please tell me the exact name of the mesh object and armature object so that I can append them

Ok so the name of the body mesh is "bodyassembled.(backup)" in the body folder, and the armature object is named 'Armature" (It does not have a folder so you can find it straight away) Also, there are two body objects. So pick the first one.

So I deleted the Multires, because it's what make your computer lag, I applied the mesh scale, and recalculate its normals and it works fine

what does it mean by applying mesh scale? I know this might be a silly question but I am pretty new to blender.. so this might be the thing that I am missing out on. So deleting the multires and using mesh scale will make it work properly? Can I please have the files that you edited?

I meant the object scale: select the object in Object mode and press ctrl A (apply) > Scale. Here is the file:

So to fix your problem:

Disable the Multiresolution modifier, because it makes your computer lag (before parenting you need to bake the multires normals so that you can use a low-poly object instead).
Apply the object scale with CtrlA > Scale (explanation about object scale here).
In Edit mode select all and press ShiftN to recalculate the normals.

To avoid parenting bugs it's always better to apply scale and rotation and to make sure that the normals are correctly flipped.
The file is here.

Thank you so much. So it was the multires creating all this problem. But now my only concern is because I deleted the multires, I lost the body forms that I created with sculpting. How can I maintain this rig with the initial form that had the multires on? Should I consider retopology?

no it was not the Multires, the Multires made your computer lag, actually try to work with meshes as low-poly as possible. Before parenting, once you have sculpted your object with the Multires, bake the normals, so that you'll be able to use what you've sculpted as fake 3D, maybe follow a tutorial on this topic. Bad parenting was caused by the non-applied scale (rotation was applied) and the flipped normals.

Oh.. now I get it. When you mentioned non applied scale, did you mean the fact that I applied y+ axis align to all arm and leg bones? Maybe that was the part of the problem? Or is it simply me not using the mesh scale?

I'm not sure what you mean, you need to apply the object scale and rotation before parenting to avoid any bug, please click on the link I gave in my answer, or find any explanation on what are the object scale, rotation and location in Blender

Oh nevermind I think I thought kinda wrong.. I am now looking for tutorials on baking normals, and I found it is done to use a normal from high poly mesh to a low poly mesh to give it a similar effect and yet using a lot lower polygon. Is this what you are talking about? https://youtu.be/f1fynKtys-Y

yes exactly, you need to bake the high-poly to only use a low-poly

Ok great I will give it a try. Thank you again for all the help!

source: Stack Exchange

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

sort: votes


text:
Unable to automate converting a duplicated and seperated mesh into a curve with python
Code:
class CurveCreate(bpy.types.Operator):
    bl_idname = "curve.create_operator"
    bl_label = "Curvecreate"
    bl_description = "Duplicates the selected edges and converts them into curves"
    bl_options = {"REGISTER"}

    def execute(self, context):
        bpy.ops.mesh.duplicate_move(MESH_OT_duplicate={"mode":1}, TRANSFORM_OT_translate={"value":(0, 0, 0), "orient_type":'GLOBAL', "orient_matrix":((0, 0, 0), (0, 0, 0), (0, 0, 0)), "orient_matrix_type":'GLOBAL', "constraint_axis":(False, False, False), "mirror":False, "use_proportional_edit":False, "proportional_edit_falloff":'SMOOTH', "proportional_size":1, "use_proportional_connected":False, "use_proportional_projected":False, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "gpencil_strokes":False, "cursor_transform":False, "texture_space":False, "remove_on_cancel":False, "release_confirm":False, "use_accurate":False})
        bpy.ops.mesh.separate(type='SELECTED')
        bpy.ops.object.mode_set(mode='OBJECT')
        bpy.ops.object.convert(target='CURVE')
        bpy.context.object.data.fill_mode = 'FULL'
        bpy.context.object.data.bevel_depth = 0.15
        bpy.context.object.data.bevel_resolution = 3
        bpy.context.object.data.splines[0].use_smooth = True

        self.report({'INFO'}, "Curve Created !")
        return {"FINISHED"}

Question:
This is what I want to do:

What I want the code to do:

Duplicate the selected edges.
Separate the selected edges.
Go back to object mode.
Select the newly separated edges (this is what I cant do).
Convert the selected separated edges into curve.
Adjust some curve settings.

Now the problem is that when Step 3 has been executed that is, going back to object mode I find that the Active object is actually the cube and not the separated edges. Hence the remaining steps get applied to the cube instead. Both the cube and separated edges are already selected when returning to object mode but the cube is the actual Active object.
How do I set the newly separated edges as the Active object in this case?

Assume that you just selected one object to do the procedure:
Then after the separation, the new created object will be "selected" by default, but not active. You can check whether your selected object is not active, then that should be the one you've separated.
# After separation
C = bpy.context # select a correct context first
for obj in [
    o for o
    in C.selected_objects
    if o is not C.view_layer.objects.active #remove active object from list
]:
    C.view_layer.objects.active = obj
    # you can do further comparison here to make sure you select the right object
    break # Break before accessing other
# Do the rest of the code

The C = bpy.context should be C = context if your using a passed context, as your class do

Worked perfectly, thanks.

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


text:
"Unable to open a display" AWS EC2 Background Rendering
I launched an AWS EC2 T3 Medium Ubuntu 20.04 instance and installed blender 2.83.9
When I launch the simple command line blender -b -f 1 I get this error message :
Blender 2.83.9 (hash 5be9ef417703 built 2021-01-19 16:16:34)

ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default /run/user/1000/gvfs/ non-existent directory found
bundled python: /home/ubuntu/blender-2.91.2-linux64/2.91/python Unable to open a display

Aborted (core dumped)

I searched on the web and it has to do with EEVEE and OpenGL needing a display. I was wondering if there was any solution to this problem. I found a few but it uses GPU rendering on AWS P Instances. I would like to render on General Purpose Instances.
Thanks.

Blender 2.8 - AWS EC2 command line EEVEE render - Blender Stack Exchange, Blender 2.8: "Unable to open a display" by the rendering on the background (Eevee) - Blender Development - Blender Developer Talk

I got the same issue and realized that I was using Eevee instead of cycles in .blend file it worked after I changed it to cycles. Apparently Eevee doesn't support headless rendering https://blender.stackexchange.com/a/150532/121173


text:
Hiding/Making an object visible affect the material colors of an unrelated Object
I'm fairly new to Blender, but I'm having fun working on resculpting a Ratchet model from the Transformers Prime Wii game, and everything's been going pretty smoothly so far. I, however, encountered an odd, small, but otherwise aggravating situation.
I have all Ratchet's pieces sorted into collections, and have been assigning materials to them as I resculpt and the like, and it seems, for some reason, that toggling some items in the Faceplates category between visible and hidden changes the colors on a very specific set of faces on his Windshields(made by constructing one and mirroring the other, btw), located in the Chassis category.
Having these objects visible makes this corner of the Windshields white, and hiding them reverts them to red, what they're supposed to be. The weird thing is, some of these pieces don't have the red or white materials applied to them in the first place.
I will have to add the actual Blend file later, as I'm typing this on mobile. My laptop has poor internet connection.
The only other duplicate/mirrored pieces that affect this is the "Right Optic Ridge," (basically his eyebrow) made by duplicating the Left optic ridge. Everything else is standard as far as the imported OBJ goes, I think.

Next time use a screen capture app for better readability.

Please use Blender's built-in Screenshot generator to produce images. You can use Window > Save Screenshot to save the whole window or Window > Save Screenshot (Editor) then click on an area if you just want to save an image of one of Blender's areas.

For your own debugging purposes, and to make your problem easier to understand for a complete stranger to your project, I would also suggest isolating just a couple of components that illustrate the unwanted behaviour.. strip it down as much as possible.


text:
Geometry Node Transform distorting my mesh
I'm having a strange issue that when I use geometry node transform to rotate an object on the z axis it distorts the mesh, whilst if I rotate without the geometry transform node everything is okay? Can anyone help?
Cheers

You must scale reset with Ctrl +  A

Thank you so much, that worked.  You're a legend


text:
How to control the direction for the Build modifier?
I'm practicing with the Build modifier. I understand its basic functionality but I can not figure out, why it starts revealing one section of the mesh from the top, and the next section on the bottom and finally starts to build up the model.

Q: Is there a way just to get the modifier to build up from one direction?

The Build Modifier will use the vertices index number to determine their apparition order. These indices are determined by their order of creation. In your case, if the Build modifier displays the top, then the bottom, then the rest, it's probably because you've created the horizontal edge loops with a bevel operation. With successive extrusions the order will have gone from top to bottom.
To display the Indices option in 2.9, enable Preferences > Interface > Developer Extras, then go in Edit Mode, select the vertices and enable the Indices option in the  Viewport Overlays panel.
To sort the vertices the way you want, go in Edit Mode, put the 3D Cursor where you want, it will determine the last numbers, select all, in Mesh > Sort Elements > Cursor Distance, then in the Operator box click on the Face button.
For more complicated objects than simple vertical/horizontal ones there must be some addons or python codes that allow to sort the vertices index numbers.
You can play with the Build modifier Start value, if you want the object to be deconstructed instead of constructed, click on Reversed.

Yep, that certainly worked great, just one thing though. I cannot find the indices you told me in the overlay panel. I googled and saw a few screenshots, but cannot find in my blender 2.91. On the left is my overlay panel, and on the right is the one from google. Where is the feature not residing? I tried to google it and nothing seems to show it. https://ibb.co/NTtdpJX

Ok I've edited my answer

@moonboots Thanks a lot I didnt know about the "Sort Elements" abilities :) Great to know :) Just it doesn't seem to have an effect to Build modifier for me, tested 2.82 and 2.92.

mmh yes it has an effect, you must miss a step. Too bad it's not easier to choose the vertex index though...

wow....how great is that?!!!!!!

I think you should BOLD the select all in edit mode

@ yossico, hello, could you please tell a bit more?

For a complicated looping structure my idea was to select one end and then use Ctrl+Num+ to add selection, and then sort by selected.

@vklidu I had to look at the operator panel and change from Vertices to Faces, I see it's in the answer but I didn't know if it was always there or if you missed it.  I did :)

@AllenSimpson ... Ha :) Thanks man, awesome ... good catch. With "Selected" order sounds great, but now this didn't work for me :) 3.4 ... any trick here I missed? again :)

For me (3.2) the build modifier uses the face indices (not vert indices) to build the mesh. Meaning you need to select all faces in face mode and then 'Reverse' in 'Sort Elements'.

Oh Ok I didn't know that, I'll test it, thanks


text:
How to install Filmic Blender?
I am new to Blender. Today I caught a treatise by Andrew Price on photo realism, and he suggested installing Filmic Blender but when I went into my Blender Folder I found no other folders such as the "colormanagement" you refer to in your post.
How to install Filmic?

I believe as of version 2.79 Filmic color management is already built into Blender, you just need to use it in the settings.

You can read all about filmic here. There is a version built-in as of blender 2.79b but consider that there are differences to the original repository.

You could refer this https://youtu.be/m9AT7H4GGrA at 12:29.

As Rix said, just download Blender 2.79, it has Filmic built in.


text:
How to add a triangulate modifier and apply it?
Im trying to check if the selected object has a specific modifier, adding the modifier if it doesn't exist, and then applying all the modifiers:
import bpy

obj = bpy.context.object

modifs=[]
for modifier in obj.modifiers:
    modifs.append(modifier.type)

if 'TRIANGULATE' not in modifs:]
    bpy.ops.object.modifier_add(type='TRIANGULATE')

for modif in modifs:
    bpy.ops.object.modifier_apply(apply_as='DATA', modifier=modif)

Code above adds the modifier if it isn't present but it doesn't apply the modifiers to the object. If I paste bpy.ops.object.modifier_apply(apply_as='DATA', modifier=modif) into the python console it applies the modifier. What am I doing wrong?

Try bpy.ops.object.convert(target='MESH') instead of the last 'for modif in modifs' loop above.

Also in your script you should 'modif.append(modifier.name)' not 'modifier.type'. What is unclear: shoud the triangulate modifier be applied?

Nah, type is nice in case there is another trianulate modifier @lemon

@brockmann, was talking about the first loop, not the triangulate.

The list doesn’t contain the newly added triangulate modifier (if there is one). Also, it seems necessary to apply by name, not by type. The following works for me:
import bpy

obj = bpy.context.object

modif_types = [ modifier.type for modifier in obj.modifiers ]

if 'TRIANGULATE' not in modif_types:
    bpy.ops.object.modifier_add(type='TRIANGULATE')

modif_names = [ modifier.name for modifier in obj.modifiers ]

for modif in modif_names:
    bpy.ops.object.modifier_apply(apply_as='DATA', modifier=modif)


text:
How to save multiple blender scripts (text-files) at once?
I want to write a script that saves all the text files inside a Blender file. Is there a way I can access the text files as a list and then select them individually?
Heres my script so far:
import bpy
import datetime

file_destination = 'D:\\Sync Cloud\\Sync\\BLENDER PYTHON SCRIPTS\\Mass Saves By Date'

# GET SCRIPTS
all_scripts = bpy.data.texts
num_of_scripts = int((str(all_scripts).split('[')[1]).split(']')[0])

# GET DATE AND TIME
now = datetime.datetime.now()
date = str(now).split(' ')[0]
time = (str(now).split(' ')[1]).split('.')[0]

# GET BLENDER FILE NAME
path = str(bpy.data.filepath).split('\\')
file_path_num = len(path) - 1
file_name = path[file_path_num].split('.blend')[0]

i=0
for x in range(0,num_of_scripts):
    txt_script = bpy.data.texts[i]

    # DELETE A .py
    script_name = (str(txt_script).split("\"")[1]).split('.py')[0]
    if 'Text' not in script_name:

        py_filename = date +'_'+time+'_'+file_name+'_'+script_name+'.py'

        # SAVE SCRIPT
        bpy.ops.text.save_as(filepath=str(file_destination)+'\\'+str(py_filename),
        hide_props_region=True,
        check_existing=True,
        filter_blender=False,
        filter_backup=False,
        filter_image=False,
        filter_movie=False,
        filter_python=True,
        filter_font=False,
        filter_sound=False,
        filter_text=True,
        filter_archive=False,
        filter_btx=False,
        filter_collada=False,
        filter_alembic=False,
        filter_usd=False,
        filter_folder=True,
        filter_blenlib=False,
        filemode=9,
        display_type='DEFAULT',
        sort_method='FILE_SORT_ALPHA')

    i+=1

This keeps giving me an error:

Error: Unable to save '': Invalid argument
  Traceback (most recent call last):
    File "D:\Sync Cloud\Sync\BLENDER PYTHON SCRIPTS\Save Scripts.blend\Export Scripts.py", line 43, in
    File "C:\Program Files\Blender Foundation\Blender 2.82\2.82\scripts\modules\bpy\ops.py", line 201, in call
      ret = op_call(self.idname_py(), None, kw)
  RuntimeError: Error: Unable to save '': Invalid argument
Error: Python script failed, check the message in the system console

Sure. bpy.data.texts returns a collection of all text files created. Can you elaborate what you'd like to do? Text files going to be stored to the blend by default so I don't get your q.

Thank you! this is what I needed. I'm writing a script to save all my scripts in a blender file.

They are already stored per .blend, I don't get your idea. Why you need to save them twice? I'd suggest add the current state of your code to the post so we can have a look at @TYLRwithspaces

@brockmann I updated the post with my script. I keep getting that error,                            should I make a new post? I'm new here. Im new to scripting in blender and python but ive been writing a lot of scripts across a bunch of different blender files for a project. I've been updating the scripts as I go, its been a learning process so sometimes I mess things up. I want to use this as a way to easily backup all my scripts.

Pathlib
Here is a script that writes all text files in blend with suffix .py to a designated folder.
IMO there is no need to timestamp a file name, since it is given a date when written to or touched.  Timestamp a containing folder name if need be.
import bpy
from pathlib import Path

destination_folder = "/tmp/texts"
df = Path(destination_folder)

#create if doesn't exist
if not df.exists():
    df.mkdir(parents=True, exist_ok=True)

for text in bpy.data.texts:
    p = df / text.name
    if p.suffix == ".py":
        p.write_text(text.as_string())

On getting the path from the blend file name
>>> bpy.data.filepath
'/home/batfinger/Documents/blender/tests/snurf.blend'

>>> Path(bpy.data.filepath)
PosixPath('/home/batfinger/Documents/blender/tests/snurf.blend')

>>> bp = Path(bpy.data.filepath)

>>> bp.stem
'snurf'

If the file is new and has not been saved the datapath will be "". The folder will revert to the base path blender was started from. In my case blender was launched from the terminal in the folder "foo".
>>> dp = Path('')
>>> dp
PosixPath('.')

>>> dp.absolute()
PosixPath('/home/batfinger/foo')

Thanks, this helped a lot. But I'm getting an error when I try to make the directory. <<File "C:\Program Files\Blender Foundation\Blender 2.82\2.82\python\lib\pathlib.py", line 1258, in mkdir
self._accessor.mkdir(self, mode)
NotADirectoryError: [WinError 267] The directory name is invalid: 'D:\Sync Cloud\Sync\BLENDER PYTHON SCRIPTS\Mass Saves By Date\Save Scripts\Save Scripts_2020-02-21_15:23'
Error: Python script failed, check the message in the system console>>

Actually i figured it out

I add 3 lines at the end of the script so that it also saves text files that are not '.py'
import bpy
from pathlib import Path

destination_folder = "/tmp/texts"
df = Path(destination_folder)

if not df.exists():
    df.mkdir(parents=True, exist_ok=True)

for text in bpy.data.texts:
    p = df / text.name

    if p.suffix == ".py":
        p.write_text(text.as_string())

    if p.suffix == "":
        p = df / (text.name + '.py')
        p.write_text(text.as_string())


text:
How to inset and shear polygons evenly?
I have sheared several parts of the mesh on the edge and trying to inset them evenly.
I have tried 2 methods (and also reset all transformations just in case it was a scale issue). But both of them I'm getting uneven results as seen in the examples.
If I use Boolean operation it will make a mess on the object, so I'd like to keep it with clean topology, so whats the correct method to getting the result?
Thank you.

The simplest workaround is to flip the order.

Inset/extrude first, so the geometry is even (check Offset even)
Shear the resulting geometry in any direction
Done

Hi, J, Beat me to it... me  with I, inset, adjusted:  Depth -xxx, Thickness 0-> xxx.

Thansk Jachym worked perfect!
Regards!


text:
How to re-use materials of a pasted object from another file for other objects in the scene?
I have copy pasted an object from one Blender file to another file. I wanted to link the materials of the pasted object to the other objects, since they'll have the same material nodes.
A) I'm doing Ctrl+L to link the materials but nothing happens.
B) I tried Ctrl+A apply all transformations to the copy/pasted object just in case it resets the objects data, but that ruins the node settings, the emission is suddenly lost and goes flat.

What could be the issue?

You can type <kbd>Key</kbd> to insert any shortcut into your posts and again, please always try to make your question title specific. Thanks

Can you select each object that you want to have this material and just choose material.002 from the materials dropdown list? I'm not sure what your intention is when you say "linked". All objects that you choose that material for will be sharing the same material so, in that sense they're linked. Modify the material on any of the objects and you modify it for them all.

Ok, one thing I noticed is that the 30 objects which I'm trying to apply the same material, I have already applied 2 different materials on them, that's why when I try to Ctrl + L (materials) they are not changing. I  added a new object in my scene with no material and tried Ctrl + L (materials) and the object changed.


text:
how to avoid runtime error when calling an operator from a handler or another operator if the called operator has self.report({'ERROR'})
I'm trying to call an operator that has a self.report() from both a handler and another operator. It all runs smoothly until it returns to the calling code, at which point it triggers a runtime error and the message is not displayed to the user.  removing the self.report works, but then I have no way of informing the user of problems they need to manually resolve.
Is there a way to call an operator which uses self.report, from either a handler or another operator without getting the runtime error?
Here’s a small example code: open a blend file and change frame to test the handler, CtrlShiftF will let you run it from a popup menu.
https://www.dropbox.com/s/k2tef36289mftsk/helpme.rar?dl=0


text:
Call a function that prints the name of the node that the user is changing a parameter on?
What’s the most performant way to call a function every time a user changes a parameter on a compositor node (even if the node isn't selected), and get the name of that node in the function which is called?
This is what I have so far, but I guess it's not very performant to call the function for every depsgraph change. I'm guessing message bus would be the most appropriate but what message?
import bpy
from bpy.app.handlers import persistent

@persistent
def desgraph_post(dummy):

    try:
        context = bpy.context
        print ("Node name:", context.active_node.name)
    except:
        print('context is not a node tree')

bpy.app.handlers.depsgraph_update_post.append(desgraph_post)

AFAIK no joy re msgbus and context properties.  Subscribing to bpy.types.Nodes "active" is prob the emulation of above, but will only fire when active node is changed, not a property within. (or if removed https://blender.stackexchange.com/questions/180683/run-function-on-material-node-tree-update)

also would check the arguments available. Load handlers are often given dummy as an argument as during load restricted context limits the availability of bpy data. Others will have scene, depsgraph as arguments.   In the old days (pre 2.8) the active object is also scene.objects.active.  ie  not mixing context with handlers. If the depsgraph of another non context scene is changed, hander above  will report the active node of the context scene.


text:
Can the SVG export export edges?
I would like to export the visible edges of a shape into SVG lines.
At the moment, I am only able to export lines that are made visible by lighting:

But I would like to export all the edges (for example the ones on top of the head here which were not rendered).
I accept answers for both 2.79 and 2.8+ versions of Blender.

Add-on Viewport to SVG can do this ... and many other things.
Tested with Blender 2.92 (2.93 will need attention ...)

Edit: Any add-on contains location info ... 3D View Editor > Sidepanel N > SVG tab

Thank you. Your screenshot truncates the top of the window, what tab do I find "Export SVG" after installing it? Can you share a screenshot of a result you obtained?

Curves are generated (as name state) from point of view and you can result with many variations just check it out ... like export only selected faces or export facing only (like here) so faces not visible from view are not included ...

Awesome thanks!


text:
Trying to make glossy volume shapes
I am trying to make a reflection on the outer rim of letters, as if they were embossed in the paper they're printed on, or written with paint/glossy ink.
Such as this:

Credit Alex Trochut
or:

Goal: (answer to @LukeD's comment): The goal is to give a volume effect to a design (previously made in Illustrator for example, or based on glyphs from a font) to "flesh it out" with its reflections.
I usually start from a .svg, which gives problematic topology when converted to mesh... So beveling doesn't work, neither does subsurf.
Also, beveling isn't what I want, because the whole surface of the paint is round, not just the edges.
Maybe there's a way to fill a .svg path with a metaball-type mesh? Or a way to "inflate" it? (I think in 3ds Max there is a thing called "push" that is similar, but I couldn't find an equivalent for blender).
Ideally, one way to do it would be to be able to "inset" the upper faces; shrink or extrude it towards the offset "middle" of the shape as illustrator does:

Here's a .blend to experiment with:

Here is what I have tried so far:
Subdivision, then displacement modifier from the black and white flattened image (edgy reflection):

Subdivision, then displacement modifier then Corrective Smooth modifier (not too bad, but over 1M faces for just 1 letter):

Using a svg curve (inner) instead of outside path then extruding/depth (ok result, but I am trying to get this result from a svg path of the outside of the letter):

Using an offset path made in Illustrator and connecting the inside and the outside curves into one mesh, then subsurf (only possible for simple shapes):

Fluid simulation with extruded edge of the svg path as collision object and a plane beneath as second collision object (ok result, the best so far depending on resolution):

Things I haven't yet tried (still experimenting): shrinkwrap, cast modifier (would that work, if a shape other than sphere or cuboid was applied?), applying different effects to outside edges.

I think the only way to do it properly is remeshing it manually.

@MicroMachine but is Blender essential in this situation? From what I've read here you have Adobe apps and this kind of effects is pretty simple to replicate in PS. I've managed to make it in Blender by manual retopo of the curve. Effect is great but need some work.

To raise the centre of a mesh text I have used the compositor to modify an image of the text, to achieve that gradient peak in the middle. Here I used it to make an ink bleed effect http://blender.stackexchange.com/questions/62843/ink-on-porous-paper-or-water-bleed-effect/62899#62899

@LukeD I want a solution that is physically correct (i.e.doesn't look like a photoshop filter, but much better) and can be animated

Related https://blender.stackexchange.com/questions/72662/trying-to-make-glossy-volume-shapes/ https://blender.stackexchange.com/questions/315370/chiseled-text-how-to-go-from-2d-quads-to-raised-center https://blender.stackexchange.com/questions/134971/round-beveled-text https://blender.stackexchange.com/questions/58457/how-to-make-a-bevel-on-text https://blender.stackexchange.com/questions/64980/how-to-make-a-metal-emboss

Is this the result you were looking for? It is made from your blend file and the lighting, etc. was just sort of thrown together to give you an idea, but if this is what you want then I can edit this answer to show you how I got there.

HOW IT WAS CREATED
Modelling
This whole process began with the blend file you provided in your question...
After opening the blend file, I chose to work with the letter/symbol on the right-hand side (The one which is a curve in edit mode, not a mesh).
In the curve settings, I changed Extrude to 0 and Bevel to 0.

I then gave it a Solidify modifier of Thickness 0.008 with an Offset of 0.

I then added a Remesh modifier with an Octree Depth of 5 and Smooth Shading checked.

This was followed by a Smooth modifier set to Repeat 20.

And lastly a Subsurface modifier set to 2.

Background
It is entirely up to you as to how you want your background to appear, but as I wanted it to be white, I placed a white plane behind the symbol because if I made the world color white then it would affect the final render. You don't have to use a white plane, it is more efficient to just use the compositor, but I was didn't bother taking the time.
However, my process gives a slight shadow around the symbol so it would have been better to just use the compositor.
Like I said, the background is entirely up to you.
Materials
Next comes the material setup, which I thought would be simple to just mix a diffuse with a glossy shader... but I was wrong! The glossy shader didn't work quite as sharply and as smoothly as I desired, so I transferred to a Toon shader. Below is my node setup for the material... feel free to play around with different settings as you wish. The diffuse color will change the overall color of the symbol, but be aware, tweaking some of the settings in the Toon shader can destroy the color from the diffuse, so be careful. I found lower values produced the most desirable outcomes.

Don't bother editing any values until you have added the lighting, as you will not be able to see any glossy reflections until the lights are in place.
Lighting
Finally, the lighting! This is probably the hardest part. I found that using 2 planes with Emission materials of strength 25 gives fairly good results in most cases, but in all respects the placement and size of these lights determines where your glossy sections will be. Careful time and patience must be taken on this step as you may not get the desired result first try, but here is the locations of the 2 planes and camera which I used for the render above.
FRONT VIEW

RIGHT VIEW

TOP VIEW

FINAL IMAGE
Now that everything is set up... Render it! :D
After following the steps above (and having a little fun by duplicating the symbol and turning it blue), I came up with the final render:

Hope this helps you with your project! Good luck!

Nice! That's very close indeed! How did you do?

@MicroMachine I have edited the answer... Hope it helps!

I'm not sure how to make the edges smooth like in the reference image... I think blender just handles curves a bit funky when solidifying because if you go ahead and subdivide it straight away it turns super jagged and ugly... So you have my solution instead, a gel-like structure still editable as a curve.

It's the best solution I've seen so far when trying to do this! Amazing. Thanks!

You're welcome! Glad I could help! :D

Sorry I didn't award you the bounty in time, you deserved the whole thing! I missed the deadline

Nah all good, I don't care too much for my rep, I'm just happy to help out whoever I can

Here's another approach you could try:

Make sure your text object is extruded slightly, then convert it to a mesh by pressing AltC.
The mesh object will be a total mess. Use a Remesh modifier to subdivide it a bit more uniformly. You need quite a high level of subdivision here; in the image below, the middle object was subdivided with an octree depth of 6, but 7 would have been better.
Apply the Remesh modifier, enter edit mode and convert the object into a 2D shape by deleting one side of the object. Adjust the normals if you need to.
Now the slightly tedious part — you have to select all the vertices around the outside edges of the object. With vertex or edge select enabled, you can pick up multiple vertices by Alt clicking on the outer edges. Takes a while though...

Save these vertices as a vertex group. Exit edit mode and add a Cloth modifier to the object. Then go to the Physics tab, select "Pinning", and select your vertex group in the space below.
Change the Structural stiffness to something much smaller (e.g., 0.1).
Finally go to the Scene tab, make sure gravity is active, and change the direction so that it works in the direction you want the text to bulge out. Press the Play button in the timeline, and hopefully you'll see something like this:

I think the "pixelated" edges could be avoided here if you inset I the outer edge a bit. The same thing would happen closer to the center but the curvature there is smaller so maybe it won't be so visible.

It is not exactly the same effect as the example form Alex Trochut, but here is a very quick approach to make an emboss effect on any plane surface (mesh, text or svg), without any change in the geometry.
It uses Cycles.

The setup is the following :

Set a diffuse shader on your initial object/surface
Duplicate it and set a transparent shader on this duplicated object. This transparent shader will have to be not totally transparent (a little gray or any color)
Array the duplicate so that you obtain 2, 3 or more layers, slightly separated (as visible on the lower right corner of the image above)
Put these transparent duplicates in front of the original (the one with diffuse)
Add a sun light : this sun will give the orientation of the emboss effect

At this step, you can obtain something like what can be seen on the bottom center of the image above.
Now, eventually, use the compositor to obtain more contrasts or other (compositor on the lower left and compositor result on top of the image).

Playing a bit more, you can try :

Several colors for the transparency (no array here, but individual objects each with a different transparent material color)
Change the transparency by glass materials and change IOR to tune the result
In these last cases, eventually change the light paths presets in the rendering panel in order to avoid noisy effects
Several sun lights

That's a good suggestion, but your answer results in an object that is mostly flat on top with rounded corners, while the question asks for a round top

Here is an attempt using the experimental displacement feature.

Uses a heightmap for the elevation (generated in photoshop using the inner glow overlay mode). In this one i used it to control roughness too (through color ramp to revert the glow).
Diffuse map (for the cyan color)

Its probably not the cleanest solution but its incredibly fast to generate/setup. Lighting is not perfect and could easily match the example better.

Greetings
BK

This is a good start, BK, thanks! What is the "PBR Uber" node? I can't find it, did you make it? Eventually, do you think something similar to the inner glow could be done to a svg path? Ideally I would like to keep the vector side of the svg path rather than rasterize

You could apply the inner glow with Illustrator and rasterize it as last step, but always depends on your final application. This workflow uses texture only. The PBR Uber is the result of Andrew Price's (blenderguru) tutorial and few other additions.

The above is the result of the following steps:
I first started by converting the text to path and then simplifying the path in inkscape before importing to blender. Especially your font needs that a lot: it has unneeded sharp nodes and too many nodes in the curvy places.
The simplify command in inkscape was too aggressive so I needed to use path effects with the following settings

It also helps to union the path at this point to avoid artifacts later.
Inside blender, I used the curve bevel to create the bulging effect and then set the offset to counteract the growth of the letters (see image above for values) until just before starting to get artifacts
This creates a nice edge bevel but still leaves us with a a flat portion in the middle. This can be fixed with a nice bump map.
Back to inkscape, I had to Path > Inset (I'm sure there is a similar thing in AI) and then blur the result.
In the above image I converted to mesh and then UV unwrapped the text but this is unnecessary. Just replicate the above node tree on the curve but connect the Generated output of the Texture Coordinate node to the Vector input of the Image Texture.
This process produces the second "This is a test" instance. Honestly though, if you don't really need blender for any other 3D element on your final scene, and you're just trying to do the effect above you are probably better off with a 2D tool. This is for example the result of three Inkscape filters.

Metallized Ridge
Relief Print, and
Glowing Bubble

With some tweaking using the filter editor they should do what you want.

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


text:
Error trying to set only active object's origin with others selected
I am new to scripting in blender/python, and I am unsure what I did wrong here. The script works fine until I try to make it work just with the active object. Then it throws the following error
Python: Traceback (most recent call last):   File "C:\Users\Juantxopanza\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\snap_origin_addon.py", line 39, in execute
    curObject.origin_set(type='ORIGIN_CURSOR', center='MEDIAN') AttributeError: '_BPyOpsSubModOp' object has no attribute 'origin_set'

location: <unknown location>:-1

Here's the code:
bl_info = {
    "name": "Snap Origin to selected",
    "author": "",
    "version": (0, 0),
    "blender": (2, 90, 0),
    #"location": "View3D > Mesh > Snap > Snap Origin to selected",
    "description": "snaps the origin of the object to a selection",
    "category": "Mesh",
}

import bpy
from bpy.props import (BoolProperty)
class MESH_OT_snapOrigin(bpy.types.Operator):
    """It has to begin with a selected element in edit mode"""
    bl_idname = "mesh.snap_origin_to_selected"
    bl_label = "Snap Origin to selected"
    bl_options = {'REGISTER', 'UNDO'}

    only_active: bpy.props.BoolProperty(
        name="set only active",
        description="set only the origin of the active object",
        default=False,
    )

    @classmethod
    def poll(cls, context):
        return context.area.type == 'VIEW_3D'

    def execute(self, context):
        curObject = bpy.context.active_object
        get_3dCursor = (bpy.context.scene.cursor.location[0],bpy.context.scene.cursor.location[1],bpy.context.scene.cursor.location[2])
        print(bpy.context.active_object.name)
        #print(curObject.location[0])
        bpy.ops.view3d.snap_cursor_to_selected()
        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
        if self.only_active == True:
           curObject.origin_set(type='ORIGIN_CURSOR', center='MEDIAN')
        else:
           bpy.ops.object.origin_set(type='ORIGIN_CURSOR', center='MEDIAN')
        # bpy.ops.object.origin_set(type='ORIGIN_CURSOR', center='MEDIAN')
        bpy.context.scene.cursor.location[0] = get_3dCursor[0]
        bpy.context.scene.cursor.location[1] = get_3dCursor[1]
        bpy.context.scene.cursor.location[2] = get_3dCursor[2]
        return {'FINISHED'}

# Registration

def set_origin_button(self, context):
    self.layout.operator(
        MESH_OT_snapOrigin.bl_idname,
        text="snap origin to selected",
        icon='PIVOT_CURSOR')

def register():
    bpy.utils.register_class(MESH_OT_snapOrigin)
    bpy.types.VIEW3D_MT_edit_mesh.append(set_origin_button)

def unregister():
    bpy.utils.unregister_class(MESH_OT_snapOrigin)
    bpy.types.VIEW3D_MT_edit_mesh.remove(set_origin_button)

Override the context.
There is no origin_set belonging to an Object.
There are a couple of ways to do this, either deselect all other objects before calling the origin set operator, or override the context to make the selection only the single (or chosen) object(s)
Am using the python console, which is a great place to nut things out.
With  "Cube" active, and the "Cone" and "IcoSphere" selected...
>>> C.object
bpy.data.objects['Cube']

>>> C.selected_objects
[bpy.data.objects['Cube'], bpy.data.objects['Icosphere'], bpy.data.objects['Cone']]

Make an override dictionary, telling blender the only object to re-origin-ate is the "Cube" by making it the only member of context.selected_editable_objects <- The selected objects that the operator uses.  Why cannot I override the context for bpy.ops.object.origin_set()
>>> c = {}
>>> c['active_object'] = None
>>> c['selected_editable_objects'] = [C.object]
>>> c
{'active_object': None, 'selected_editable_objects': [bpy.data.objects['Cube']]}

Run the operator with that context dictionary c as the first argument.
Blender 3.2+
>>> with C.temp_override(**c):
...     bpy.ops.object.origin_set(type='ORIGIN_CURSOR')

Blender 2.8+
>>> bpy.ops.object.origin_set(c, type='ORIGIN_CURSOR')
{'FINISHED'}

and only the origin of the active object is set.
The error in your question relates to the Object
not having an origin_set property.
>>> C.object.origin_set
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
AttributeError: 'Object' object has no attribute 'origin_set'


text:
Why is my rotation method sometimes incorrect for parented objects
I wrote Python's function to rotate a object 'o' direction, step by step, to 'directionW' direction.
When the o has no parent, the function works great. But, when the o has one or more parent, function sometimes works correctly, sometimes wrong. When it works wrong the direction of o don't going to directionW by shortest way, but going in space by way (like 8-digit) around directionW.
Next is the function:
    def RotateToDirectionW( o, directionW, step, adaptivestep, maxunlock ):
    """o - object to step rotate to directionW"""
    """directionW - direction to achieve step by step (unit vector in world coordinates)"""
    """adaptivestep - if True, then rotation angle has minimal value when direction of o near to directionW,"""
    """maxunlock - maximal vector size to unlock, 1E-5 or 0"""

    matLtoW = o.matrix_world
    matWtoL = matLtoW.copy(); matWtoL.invert()
    if o.parent != None:
        matWtoP = o.parent.matrix_world.copy(); matWtoP.invert()
    else:
        matWtoP = Matrix.Identity(4)

    # direction of o ( axe z+ ) in world coordinates
    dirW = ( matLtoW @ Vector((0,0,1)) ) - ( matLtoW @ Vector((0,0,0)) )
    dirW.normalize()        # need to normalize angle

    # calculate axe, around what object will be rotated (in world c.)
    axeRotW = dirW.cross( directionW )

    power = axeRotW.length

    # unlock
    # if vector is too small to rotate, take any bigger
    if abs(power)<maxunlock:
        axeRotW = Vector( (maxunlock,maxunlock,maxunlock) )
        power = axeRotW.length

    # transform axe of rotation to parent base coordinates
    # (problem somewhere there)
    axeRotP = (matWtoP.to_quaternion() @ axeRotW

    if adaptivestep:
        angle = step * power
    else:
        angle = Vector.angle( dirW, directionW )
        if (angle > step): angle = step

    # rotation
    qutRot = Quaternion( axeRotP, angle )
    o.rotation_euler.rotate( qutRot )

I check every possible intermediate results, they are correct at all. The axe of rotation is correct in world space. I think, problem is when axeRotW converted to parent coordinate space. It look like there is transitional transformation between parent's transformation and o own transformation. I think, i need convert axeRotW to this transitional coordinate system, but there is no information about it.
What is a way to solve the problem? I waste several day of my time to do it, but now i into deadlock.
P.S.: I try, also, to rotate o by bps.transform.rotate(), but this operation can't work with custom rotation axe, XYZ-only.
P.P.S.: A founded 3 conditions for the correct result:

The object o has not parent

The object has parent object with identity (equal 1) 'matrix_parent_inverse'.

The object has parent 3-verticies with same direction of coordinates as parent, and identity 'matrix_parent_inverse'.

P.P.P.S.: To investigate matrix chain calculation, i run script from blender.stackexchange.com/a/160580/15543
import bpy
from mathutils import Matrix

context = bpy.context
ob = context.active_object
M = Matrix()
print("==== calc word matrix ====")
print(ob.matrix_world)
while ob.parent:
    M = (ob.matrix_parent_inverse @ ob.matrix_basis) @ M
    ob = ob.parent

M = ob.matrix_basis @ M

print(M)

If generic child object was selected, then script prints two equal matrices. But, if somewhere in parent-child chain exists 3-vertices parenting, then the printed matrices was different!!!. F.e.:
---- calc word matrix ----
<Matrix 4x4 (-0.0198,  0.1843,  0.4570, 15.1996)
            ( 0.0012,  0.4574, -0.1844, -4.9117)
            (-0.4928, -0.0063, -0.0188,  3.4083)
            ( 0.0000,  0.0000,  0.0000,  1.0000)>
<Matrix 4x4 (-0.0465, -0.2971,  1.1550, 36.2083)
            (-0.0120,  1.1559,  0.2969, 11.8968)
            (-1.1926,  0.0000, -0.0480,  1.8346)
            ( 0.0000,  0.0000,  0.0000,  1.0000)>

It is possible, there is one addition transformation in parent-child chain. And i need to take into account yellow colored block:

How i see, there is no python access to extra v3-parenting transformation matrix. I suppose, with help of some math we can calculate this extra matrix. But how?

Related https://blender.stackexchange.com/a/160580/15543  ie it appears it is not being taken into account ob.matrix_parent_inverse may not be identity.

prob a better link https://blender.stackexchange.com/a/169424/15543

I clear matrix_parent_inverse now, result is changed, but it not correct anymore.
Also i try next conversion: axeRotP = (matWtoP.to_quaternion() @ axeRotW)

Would also need to convert as well as clear.  Basically if the parent inverse is identity then local origin is at parent origin.  This is for a mesh but pertinent here https://blender.stackexchange.com/a/183724/15543 in that aligning object to a face normal vector.  The quaternion rotation difference between vectors will calculate axis and angle.

Thanks for suggestions. A founded 3 conditions for the correct result:

The object 'o' has not parent
The object has parent object with identity 'matrix_parent_inverse'.
The object has parent 3-verticies with same direction of coordinates as parent, and identity 'matrix_parent_inverse'.

How to take into account 'matrix_parent_inverse' - i don't understand. I try insert transformation with 'o.matrix_parent_inverse' in several places, but, without success. My guess how 'o.matrix_parent_inverse' works and how it works in real - is different.

Yes for 3 vertex parenting would need an  intermediary step to calculate  the origin and normal of 3 verts.  Suggest this is a new question.  Anyway back to your original question, IMO the logic is wrong.  Simply build a rotation matrix using v1.rotational_difference(v2)  see https://blender.stackexchange.com/a/183724/15543

Big thanks again. Your examples is very useful.
The problem is coordinate transformation. I have correct rotation axe (axeRotW) in world coordinates. I can't transform the axe to desired coordinate system correctly.
To work with targetAxe.rotation_difference(currentAxe), it is needed to transform targetAxe to coordinate system where currentAxe is. And it is the same problem, what i have now.

How i understand from Your examples and my investigation, matrix_world = parent.matrix_world * parent.matrix_x * matrix_parent_inverse * matrix_basis. And matrix matWtoB = (awR.matrix_world.inverted() @ awR.matrix_basis.inverted() ) @ awR.matrix_parent_inverse.inverted() must do correct transformation, but not do.

Because
matrix_world = parent.matrix_world * parent.matrix_x * matrix_parent_inverse * matrix_basis

where parent.matrix_x is inaccessible matrix by python, we can't calculate matWtoP from o.parent (in common case) and must to use o.matrix_word. The right transformation is:
# transform axe of rotation to parent base coordinates
matWtoP = o.matrix_basis @ o.matrix_world.inverted()
axeRotP = matWtoP.to_quaternion() @ axeRotW

Most basic source of errors in my investigations above was a order of execution of @-operands in Blender. I had false representation about it and tried to use the order like matWtoP = o.matrix_world.inverted() @ o.matrix_basis, what is wrong.


text:
Feathering the edges of a Volumetric shape object
Hi Blendonians (just came up with that haha)
I apologise in advance for having no screenshots, but I think I can explain the problem.
I have a street scene. On the road, there's a sewage grate. I'd like to have some "steam" coming from the grate but I really can't use the smoke simulator... I've tried and it's way too slow for some reason, even though I've got a beast of a machine. Maybe I'll attempt it again in the future, but this technique I'm trying should work, I just can't figure out one part.
So I created a cube, made it into a sort of cone shape, added a volume scatter shader controlled by a noise texture to the volume material output.
This gave me the exact look for the steam I wanted. It looks really nice, especially when light hits it. But the steam is cut off harshly at the edges of the cube.
So I added a gradient texture and tried literally hundreds of different settings and combinations. I got really close, but the cut at the edge of the cube is still there. I've been through loads of tutorial videos about making clouds with volume objects, how to use gradients etc, but nothing is working.
What I need is a way of feathering the volume so it's invisible at the edges of the object.
If no one can explain it to me from that info, I'll get some screen shots soon and upload the blend file.
Many thanks in advance.
Screenshots added.

so why did gradient failed?

It didn't fail, it just didn't remove the edge completely.


text:
Cycles z pass is not expect (1.09 times larger)
I am trying to generate synthetic data using blender for disparity prediction. I used z-pass in Cycles for depth ground-truth, but I find out that the z-pass value is always 1.09 times larger than actual depth.
There is a demo, I use functions from 3x4 camera matrix from blender camera to get extrinsic data.
import bpy
import os
os.environ["OPENCV_IO_ENABLE_OPENEXR"]="1"
import cv2
from mathutils import Matrix, Vector
import numpy as np

################################################################
#from https://blender.stackexchange.com/questions/38009/3x4-camera-matrix-from-blender-camera

#---------------------------------------------------------------
# 3x4 P matrix from Blender camera
#---------------------------------------------------------------

# BKE_camera_sensor_size
def get_sensor_size(sensor_fit, sensor_x, sensor_y):
    if sensor_fit == 'VERTICAL':
        return sensor_y
    return sensor_x

# BKE_camera_sensor_fit
def get_sensor_fit(sensor_fit, size_x, size_y):
    if sensor_fit == 'AUTO':
        if size_x >= size_y:
            return 'HORIZONTAL'
        else:
            return 'VERTICAL'
    return sensor_fit

# Build intrinsic camera parameters from Blender camera data
#
# See notes on this in
# blender.stackexchange.com/questions/15102/what-is-blenders-camera-projection-matrix-model
# as well as
# https://blender.stackexchange.com/a/120063/3581
def get_calibration_matrix_K_from_blender(camd):
    if camd.type != 'PERSP':
        raise ValueError('Non-perspective cameras not supported')
    scene = bpy.context.scene
    f_in_mm = camd.lens
    scale = scene.render.resolution_percentage / 100
    resolution_x_in_px = scale * scene.render.resolution_x
    resolution_y_in_px = scale * scene.render.resolution_y
    sensor_size_in_mm = get_sensor_size(camd.sensor_fit, camd.sensor_width, camd.sensor_height)
    sensor_fit = get_sensor_fit(
        camd.sensor_fit,
        scene.render.pixel_aspect_x * resolution_x_in_px,
        scene.render.pixel_aspect_y * resolution_y_in_px
    )
    pixel_aspect_ratio = scene.render.pixel_aspect_y / scene.render.pixel_aspect_x
    if sensor_fit == 'HORIZONTAL':
        view_fac_in_px = resolution_x_in_px
    else:
        view_fac_in_px = pixel_aspect_ratio * resolution_y_in_px
    pixel_size_mm_per_px = sensor_size_in_mm / f_in_mm / view_fac_in_px
    s_u = 1 / pixel_size_mm_per_px
    s_v = 1 / pixel_size_mm_per_px / pixel_aspect_ratio

    # Parameters of intrinsic calibration matrix K
    u_0 = resolution_x_in_px / 2 - camd.shift_x * view_fac_in_px
    v_0 = resolution_y_in_px / 2 + camd.shift_y * view_fac_in_px / pixel_aspect_ratio
    skew = 0 # only use rectangular pixels

    K = Matrix(
        ((s_u, skew, u_0),
        (   0,  s_v, v_0),
        (   0,    0,   1)))
    return K

# Returns camera rotation and translation matrices from Blender.
#
# There are 3 coordinate systems involved:
#    1. The World coordinates: "world"
#       - right-handed
#    2. The Blender camera coordinates: "bcam"
#       - x is horizontal
#       - y is up
#       - right-handed: negative z look-at direction
#    3. The desired computer vision camera coordinates: "cv"
#       - x is horizontal
#       - y is down (to align to the actual pixel coordinates
#         used in digital images)
#       - right-handed: positive z look-at direction
def get_3x4_RT_matrix_from_blender(cam):
    # bcam stands for blender camera
    R_bcam2cv = Matrix(
        ((1, 0,  0),
        (0, -1, 0),
        (0, 0, -1)))

    # Transpose since the rotation is object rotation,
    # and we want coordinate rotation
    # R_world2bcam = cam.rotation_euler.to_matrix().transposed()
    # T_world2bcam = -1*R_world2bcam @ location
    #
    # Use matrix_world instead to account for all constraints
    location, rotation = cam.matrix_world.decompose()[0:2]
    R_world2bcam = rotation.to_matrix().transposed()

    # Convert camera location to translation vector used in coordinate changes
    # T_world2bcam = -1*R_world2bcam @ cam.location
    # Use location from matrix_world to account for constraints:
    T_world2bcam = -1*R_world2bcam @ location

    # Build the coordinate transform matrix from world to computer vision camera
    R_world2cv = R_bcam2cv@R_world2bcam
    T_world2cv = R_bcam2cv@T_world2bcam

    # put into 3x4 matrix
    RT = Matrix((
        R_world2cv[0][:] + (T_world2cv[0],),
        R_world2cv[1][:] + (T_world2cv[1],),
        R_world2cv[2][:] + (T_world2cv[2],)
        ))
    return RT

def get_3x4_P_matrix_from_blender(cam):
    K = get_calibration_matrix_K_from_blender(cam.data)
    RT = get_3x4_RT_matrix_from_blender(cam)
    return K, RT

#################################################################
#config set

camera_pos=[0,0,1] #change this
lens=25 #change this

bpy.context.scene.render.engine ='CYCLES'
bpy.context.scene.cycles.device = 'GPU'
bpy.context.preferences.addons['cycles'].preferences.compute_device_type='CUDA'
bpy.context.preferences.addons['cycles'].preferences.get_devices()

bpy.context.scene.cycles.samples = 4 #for fast inference
bpy.context.scene.render.resolution_x = 1920
bpy.context.scene.render.resolution_y = 1080

bpy.context.scene.use_nodes = True
bpy.context.scene.view_layers["ViewLayer"].use_pass_z = True

for obj in bpy.data.objects:
    bpy.data.objects.remove(obj,do_unlink=True)

#add plan
bpy.ops.mesh.primitive_plane_add(size=3, enter_editmode=False, align='WORLD', location=[0,0,0], scale=(1, 1, 1))

#add camera
bpy.ops.object.camera_add(enter_editmode=False, align='WORLD', location=camera_pos, rotation=(0, 0, 0), scale=(1, 1, 1))
bpy.context.object.data.lens = lens

#render
tree = bpy.context.scene.node_tree
links = tree.links
for n in tree.nodes:
    tree.nodes.remove(n)
rl = tree.nodes.new('CompositorNodeRLayers')

output_path='test'
if not os.path.exists(output_path):
    os.makedirs(output_path)

# Set up rendering depth
depth_output = tree.nodes.new(type='CompositorNodeOutputFile')
depth_output.format.file_format = 'OPEN_EXR'
depth_output.base_path = output_path
links.new(rl.outputs['Depth'], depth_output.inputs['Image'])

scene = bpy.context.scene
scene.camera = bpy.data.objects['Camera']
bpy.ops.render.render()

K, RT=get_3x4_P_matrix_from_blender(bpy.data.objects['Camera'])

print('extrinsic matrix: ', RT)
depth=cv2.imread('test/Image0001.exr', cv2.IMREAD_ANYDEPTH)
print('depth: ', np.unique(depth))

This code just adds a plan at [0,0,0] and add a camera at some position ([0,0,1] for example). and print the extrinsic matrix and z-pass value:
extrinsic matrix:  <Matrix 3x4 (1.0000,  0.0000,  0.0000, 0.0000)
            (0.0000, -1.0000,  0.0000, 0.0000)
            (0.0000,  0.0000, -1.0000, 1.0000)>
z-pass:  [1.09]

The experiment results are:

set camera at [0,0,1], set focal length as 50: real depth is 1 but the z-pass is 1.09
set camera at [0,0,0.5], set focal length as 50: real depth is 0.5 but the z-pass is 0.545
set camera at [0,0,1], set focal length as 25: real depth is 1 but the z-pass is 1.09

My observation:
The real depth should be the distance between plan and camera origin, and z-pass is always 1.09 times larger than real depth regardless of camera position and focal length
I am very new to blender and I want to figure out where "1.09" comes from? And how could I get the ground-truth depth?
Thanks in advance!

OK I find what's going wrong:
Should be careful of how opencv read exr file.
change
depth=cv2.imread('test/Image0001.exr', cv2.IMREAD_ANYDEPTH)

to
depth=cv2.imread('test/Image0001.exr', cv2.IMREAD_UNCHANGED)

and the z-pass is aligned with real depth.
Edit:
reference: Z depth values in OpenEXR do not match the objects in the scene


text:
Mirror modifier works incorrectly
Hellow!
I've got the following problem with the mirror modifier:
After applying the mirror, it kinda of duplicates an object. I've applied rotation, set origin to geometry or 3D cursor,turned off/on clipping, -  nothung changed. There are no dubbled verts; I checked. Could it be a bug, or am I doing something wrong?

Hello, please share the object before your applied the modifier?

unlikely to be a bug, but, reading the question, we can't know the state of the object before the modifier is applied

You can use Bisect function of the modifier if you want the intersecting part to be cut off:

Yep, just tied it out. Now it's working normally. Thanks a bucnh!

If the answer is helpful, consider accepting it as the solution or upvoting.


text:
Blender 4.3.0 Linux CLI, symbol lookup error: blender: undefined symbol: vkGetDeviceBufferMemoryRequirements
I am seeing this error when running blender --version command:
blender: symbol lookup error: blender: undefined symbol: vkGetDeviceBufferMemoryRequirements

I only see this error for blender 4.3.0. For example, blender 4.2.3 works fine:
Blender 4.2.3 LTS
        build date: 2024-10-15
        build time: 23:33:05
        build commit date: 2024-10-14
        build commit time: 15:20
        build hash: 0e22e4fcea03
        build branch: blender-v4.2-release
        build platform: Linux
        build type: Release
        build c flags:  -Wall -Werror=implicit-function-declaration -Wstrict-prototypes -Werror=return-type -Werror=vla -Wmissing-prototypes -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wlogical-op -Wundef -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Wformat-signedness -Wrestrict -Wno-stringop-overread -Wno-stringop-overflow -Wnonnull -Wabsolute-value -Wuninitialized -Wredundant-decls -Wshadow -Wimplicit-fallthrough=5 -Wno-error=unused-but-set-variable  -march=x86-64-v2 -std=gnu11 -pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off
        build c++ flags:  -Wuninitialized -Wredundant-decls -Wall -Wno-invalid-offsetof -Wno-sign-compare -Wlogical-op -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Werror=return-type -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wundef -Wcomma-subscript -Wformat-signedness -Wrestrict -Wno-suggest-override -Wuninitialized -Wno-stringop-overread -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Wundef -Wmissing-declarations  -march=x86-64-v2 -pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off
        build link flags:  -Wl,--version-script='/home/blender/git/blender-v420/blender.git/source/creator/symbols_unix.map'
        build system: CMake

I also tried bunch of other blender versions, they all work fine.
My OS is: Ubuntu 20.04.4 LTS (Focal Fossa). My CPU is AMD EPYC 7532 32-Core Processor. GPU is NVIDIA RTX A2000

We can't help with possible bugs as there are no Blender developers here. Suggest you report it using Blender's Help > Report a Bug menu.

Incidentally that command works fine under Windows 10.


text:
view only one transparent object at viewport when overlaping to another object in blender 2.8
i used to do this using blender 2.79 version with no problem .
now i need to do the same work with the 2.8 version , but cant find the way
when i have two objects , one on top of the other , i need to see only through the object that is on top or front, without making the one that is behind transparent. I found the xray mode but it turns all objects on the scene transparent , and as i said , i need to see through the first one and the other needs to remain solid.
this is how i did with the 2.79 version, and now im using 2.8 but cant find how to do it

EEVEE
Use alpha and also change the setting of Blend Mode in that material:

The Blend option need to be set explicitly to make EEVEE know what material need to consider transparent problem. And only alpha blend will give an actual blend process for color.
Related post

Material Settings — Blender Manual

Transparent Materials Workflow from Cycles to EEVEE from 2.79 - General Forums / Blender Development Discussion - Blender Artists Community

How to use alpha transparent textures in Blender - Artisticrender.com


text:
In blender 2.8 I want to set a keyframe_insert at a point of a bezier curve by pythonscript
The animation, that a sphere follows a bezier-path, works as I want. But the sphere needs exact 100 frames to do that.  How can i set keyframes that the sphere has absolved the route from frame 10 to frame 50 ?
I tried the following, but the lines are ignored:
obj.bezier_points[0].keyframe_insert(data_path = 'co', frame=10)
obj.bezier_points[1].keyframe_insert(data_path = 'co', frame=50)

and another try:
obj.bezier_points[0].keyframe_insert(data_path="bevel_factor_start", frame=10)
generates the error:  "bevel_factor_start" not found.
It would be great, if anybody has an advice for me.

I find out that  the line:   obj.data.bevel_factor_start=0                                     before the second try removes the error, but there is also no result.

bezier_points[0] is of type BezierSplinePoint, which does not have any attribute called bevel_factor_start; that's why the second attempt does not work. I don't know about the first one though.


text:
Why Does The Camera Make Weird Angles when animated?
I have a simple animation wherein i show one angle, then switch to another and back. My problem is that the camera makes big angle change. How do you do a smooth transition without adding so many key frames to let the subject stay in frame?
Please see video  enter link description here
I just want the camera to move to Top View without zooming in in between frames.
Thanks

Maybe go int the Properties panel > Data > Shape > Resolution, then increase the Preview U and Render U to smooth your curve. But also note that its shape seems a bit weird but maybe it's what you want

You can add an empty to let camera stick on it (make parent with transform), and rotate the empty to make your camera rotate

You only need two keys for this job with a super stable result.

thank you @hikariztw


text:
Object gets tinted by nearby Object's Color
I'm trying to texturize an exterior scene but I have a problem and I don't know why.
I have a white building and there is another object with orange color under it. I know that it is normal that the white building get some orange color from the orange object.
My question is: Is there any away to avoid an object getting tinted by nearby objects' colors?
It has been happened before in another building, but it got fixed by its own. I'm working on Blender 2.8 Cycles Render Engine now.
Rendered scene:

White material node setup:

Orange material node setup:

Please use the inbuilt tools to add images and not some random web services.

Sorry, and thanks for the help.

The answer for the question is quite simple - Diffuse setting, but the main problem might be the scene light setting, as part Why do this behavior happen? explained.

Diffuse Ray
You can change the diffuse setting in Properties Panel > Object > Cycles Settings >> Ray visibility : Diffuse
The color you see is mainly from the diffuse ray in that orange color, by default it light up nearby objects like it is an emitting material. It is not a mistake but a natural behavior in real world. The most easily way to FIX this problem is to turn the diffuse behavior down. Making the material won't bounces light in the diffuse light path.

Warning:
Turn off the diffuse ray will cause the rendered scene not accurate, making the render image seems to be wrong in some certain way.
Material Node Setup
You can also change that behavior in material node editor as follow:

With the Input > Light Path node, using diffuse value, you can change that material by using a mix shader with is diffuse factor. If you replace it by a white transparent shader, it will work as turn off the diffuse setting I mentioned above.
Why do this behavior happen?
And another issue is that in this scene, you have your light and environment poor set up. Making it too simple from some certain light path, in this case, the orange diffuse bounces.
The main reason of that is maybe you are using point/sun light, and toward a specified angle, which cause the white wall capture a lot of bounces from orange roof top.

You can change the angle of it, or you might also want to add more light around your scene, and object around it, making the light path more balance. Changing the radius of the point light may help as well.

But why this happends? Cant I control with which materials this happens?

It's called ray tracing, simulate the light in real world to get accurate result, you can find a lot of explanation on else where. You can control it in node editor, I edited my answer, hope it will help you.

And another issue is that in this scene, you have your light and environment poor set up. Making it too simple from some certain light path, in this case, the orange diffuse bounces. You might want to add more light  around your scene, and object around it, making the light path more balance.

Thank you very much. I will test with this :)

If it (should) works, please consider to make this answer as accepted one. BTW, an environment light texture might work pretty good in your scene.

I would like to accept it, but i dont know how. I already gave it the tick


text:
Can i make a material move from one point to another with shader node?
I saw it in here . You all probably saw this video before.

Please read: https://blender.stackexchange.com/help/how-to-ask

I guess it begins with this kind of node organization: Texture Coordinate (Generated outp*ut) > Mapping > Gradient Texture > ColorRamp > Diffuse >* Material Output. Then play with the Mapping Location value to move the colors.

file here:

Yah.   It make sense . Can you make it happen?

2 sec animation?

On a place or a cube

On. A plane or cube

I've added the file if that's what you want

I got a downvote....i dont know what will happen

Is it bad for something?

I don't know why  ;)

i didn't see the file befoee. I will check it out ..

I know why i got a downvote.. cuz am a noob..i did ask a noob question...and the why is genius didn't like it...i hope..someone give him a hug...before he did something worse

Bo i think it's because you should show a picture to make it clear what you're talking about

Ohh..ok..i am sorry...i am new in here...as you can see..i will definitely give a picture in future.


text:
How to get rid of fireflies caused by glass material?
I'm using cycles render for glass shader. I'm using GPU compute for faster rendering in the viewport. I have bumped the samples to 100000, and still getting fireflies on the glass. I have tried various set ups from YouTube tutorials, but the fireflies insist showing on the glass sphere.

Q: How to get rid of the fireflies in this case?

Related or dupe: How to reduce fireflies in Cycles?

Increase your clamping values.
Within Blender's render settings tab, there are two values: Clamp direct and Clamp indirect. In essence, a higher value for these will reduce fireflies at the cost of realism by lowering the values of very high intensity pixels. With your samples already at such a high value, a slight amount of increasing the clamping could definitely reduce your fireflies.
(side note: some of your fireflies appear to be a result of noise, you can try using the new denoise node in the compositor.)


text:
How to get angle chrome in orthographic view EEVEE?
Months ago I asked how to make angled chrome texture: How to create a chrome texture? Since I use EEVEE, I'm using the option @Robbin Betts recommend. Remaining issue is that in orthographic view that typical chrome-like angled look disappears.
So I tried to slightly tilt the X axis to get proper reflection (on my text) but if I use the image texture in orthographic view its more visible. During the animation when it rotates it looks kinda fake:

Q: Is there a way to improve the chrome nodes, or animation to give it a more realistic appearance? I also have a Blender file to share the animation if someone wants to have a look at it.

Please ask a specific question in the title and add any specific goal to your question -> Makes it useful to others (searching for the same subject in the future) too. Short reminder: This is no regular forum, please read: https://blender.stackexchange.com/help/how-to-ask

Added the link to your previous question otherwise your question is incomprehensible to others. However, the second paragrpah: "(on my text) but if I use the image texture in orthographic view its more visible. During the animation when it rotates it looks kinda fake..." is still a mess. What text are you talking about? What animation are you talking about?

Here's a brief animation: https://streamable.com/leb261

Hello :). Environment reflections are very limited in orthographic view (they're basically just one color) which does look a bit fake (orthographic view itself also can't be achieved with a real camera).

Ok Jachym, thanks for the information!Kind regards.

@JachymMichal has nailed the reason.. I wonder if there's a get-around?

Related: Faking HDRi Reflections with an orthographic camera

Related: Chrome Reflections On Flat Surfaces

Here are 2 examples, one is using the texture and the other one is using Node for angel chrome material @robinBetts had shown a while ago. But the image texture shows in orthographic view, so it has to do with the difference of using images vs nodes. https://ibb.co/LpPst5J

Just checking.. the object Z-axis runs flat-to flat?

Yes, its Z axis. I took your Node set up from a previous post: https://blender.stackexchange.com/questions/168180/how-to-create-a-chrome-texture


text:
How to use an animated spiral as mask to reveal other objects?
I'm trying to use a complex shape as a mask to reveal what's within it. I tried using the Build modifier, but for this complex shape its not working, its just starting from from random vertices.
So I made my curve and animated it and works fine as it animates from starting point to the end point.
I tried using it as smart Boolean but its not working, the spheres just disappear. Is there a way I can use this curve as a mask since the animation works well for what I need?
https://streamable.com/4xz1xn

can you provide the blend file?

Here's the file:

i a "normal" case i thought you just have to sort elements in mesh and then the build modifier would built it in that way. But weird enough - it does not work :( i have no idea why.

I tried it with the build modifier but there method is way to complex for me to understand having to use some sort of code or other way which seems very complex for me.

I've tried another method which is tedious. I made the usual cube and scaled it, and gave it loop cuts, then I selected the Sort elements method so when
adding the build modifier the animation starts from the selected point. then I placed it horizontally and starting to deform it trying to make it a spiral
grabbing each section of the vertices rotating them in a circular  direction. Then added the solidify modifier and made the smart Boolean operation
and the masking starting to reveal each sphere in a sequential mode.
But I'm sure there's a better approach to this method.

https://ibb.co/1s4Qs4G
https://streamable.com/ggq0yi


text:
How to get rid of the name overlay on this vector control?
I can draw the control shown below on a panel using:
col = self.layout.column(align=True)
col.prop(bpy.context.scene.display, "light_direction")

But, the minute I try and add any sort of param, the whole control disappears. How can I remove the "Light Direction" label on the sphere?

Set the text argument.
As with all properties in blender, can set the text argument to display something other than the property name, (the default)

def draw(self, context):
    scene = context.scene
    col = self.layout.column(align=True)
    col.prop(scene.display, "light_direction", text="")

Also note the usage of context as passed to the draw method, rather than using bpy.context

Thanks so much! Is context.scene different from bpy.context.scene ?

Thankyou. Re context: No. It is generally the case that the context passed is same. IMO simply good practice to use the argument provided, just  in case there are  changes in the future.  Outside scope of this question, the possibility for future as I see it is , can pass an overridden context to an operator. Would  be handy to know from within the operator what is "real" context and what is "fake".


text:
How to load and assign an image to a specific image node in the compositor?
Background: I am importing (appending) a new scene to an existing .blend file. The new scene has only compositing nodes and is only used for compositing renders created by the original scene.
What I want to do is to specifically address an image node in the compositor node tree, and then assign an image to it. That's it. So, for me, pseudo-code would look something like:
set the context to the compositor node tree
set the filename of the image node "Fred" to "E:/myimage.jpg"

I've been referred to: How do I edit an image node in blender using python? but can not get it to work properly. How to load and assign an image to a specific image node in the compositor?

Hello and welcome. If you feel a post was incorrectly closed as duplicate please state so in the comments section and politely edit your original question stating how you tried the suggested solution and why it didn't work for you, so it can be reopened. Antagonizing people trying to help you will only lead to other users avoiding your posts in the future

What have you tried and what has failed? What part of the python api are you familiar with?

Just starting. Don't know Python that well but am very familiar with other languages. I don't know anything about the Blender API and it seems very difficult to know how context works. The docs are definitely resource materials, not so much teaching materials. So, I end up asking for help. I'm a quick learner and need some basic help, Pointing to a link somewhere which is 'sorta' like it really does no good. Perhaps if SX is too sophisticated, you might point me somewhere where people can help newbies.

This is the perfect place for asking such questions, really. We are all willing to help for sure. But... there are some rules (which you can read up in 5minutes) as already suggested 100 times before. So please take the time and read: https://blender.stackexchange.com/help/reopen-questions

OK. Read and understood. I did submit a new and now properly edited thread. I've read the lectures and have tried to abide. Now, how best to go about getting an answer to what I think should be a simple question? If the question is not clear, then what else can I do to make it clearer?

Edit your original question and try to explain (as best as you can) why the answer of the dupe does not help in your case, that's it. Cheers

Re-added the link for context. As you probably can see now, it's the same principle (to assign the image), the reason why I added "loading the image" to your question title (makes it different as well).

Load your image using the path, add or get the image node in the compositor, and then simply assign your image data in memory to the image input of the node.
import bpy
from pathlib import Path

img_path = r"C:\MyDirectory\MyPicture.png"
if Path(img_path).is_file():
    img = bpy.data.images.load(img_path, check_existing=True)  # Load the image in data

    node_tree = bpy.context.scene.node_tree  # Get the current scene's compositor node tree

    img_comp_node = node_tree.nodes.new(type='CompositorNodeImage') #  Create a new image node
    # img_comp_node = node_tree.nodes.get('MyImageNodeName')  # Use this if your node already exists
    if img_comp_node:
        img_comp_node.image = img
else:
    print(f"The file at {img_path} doesn't exist")

Read: Controling compositor by python

Hi @Gorgious
Thanks!
so the try structure replaces a file exists call?
how do I specifially address an existing node? IOW, if I have an image node named "fred", how do I reference it?

Yeah, actually you should use the file_exists method, and avoid using try/excepts like I did because the RuntimeError could be caused by other lines in the code inbetween. Another solution is to wrap all this in a method and put the except just after the bpy.data.images.load call, and return there

would I use
img_comp_node = node_tree.nodes.get('fred') to reference the image node named "fred"?

@chippwalters That's correct, the node's name has to be fred. Not the label, not the image file name/path, just the unique node editor name, which you can access via the ui as well.

@chippwalters Yes, but be careful because the image node's name can be different than its label, which by default is the name of the image file. To be sure, you can access the "Item" properties by typing N to get the right hand side panel, and check the node's name there. A node name is unique, but several nodes can share the same label

Thanks everyone. I'm careful to set the nodes name and not the label. Much appreciated! I'll let you know how it goes. Most helpful!

I updated the answer for a safer and cleaner approach. Thanks for the heads-up @brockmann


text:
What are good practices when retopologizing text?
I am trying to add proper topology to text so I can do a beveled edge and a boolean extrude from a shape later on.
I am following this video, however I find it pretty confusing when it comes to applying the steps to my file.
In the video, the shapes always have the perfect amount of vertices on each side for quads to be generated, but in my project that is not the case:

What I am doing doesn't look right, some faces are triangles, some are quads, the distribution of which is irregular, and I can't really understand what I could be doing differently except adding a bunch of extra vertices randomly, for which there doesn't seem to be a keyboard shortcut in my version. Simply put, it doesn't look good.
From one letter to the next, I have either a lot of faces or very few, which might create inconsistencies later on.
Do I want to keep the amount of vertices low, or should I add a lot of them? How can the shapes have the same amount of vertices on each side of the shape to create quads without deformation?
Given the examples in the screenshots, what am I doing wrong and what is a fast workflow to create correct topology inside these letters?
I have been looking it up for a few hours, and the major changes from Blender 2 to Blender 4 make it difficult to find relevant answers. I do not want to use a Remesh modifier.

Ian McGlasham has a mini-series about Advanced Text Retopology.He uses a Shrinkwrap modifier to equalize the number of vertices on each side of the letter. You can add vertices by subdividing an edge (menu: Edge > Subdivide). Right-click the menu entry to assign a shortcut. In the "Adjust Last Operation" popup in the left bottom corner you can increase the Number of Cuts to add more than one vertex.

"What am I doing wrong"-- you're making 5-poles (sometimes, 6poles) on the edges of your shape, which are 90 degree angles.  Don't do that: follow the flow of the mesh edges with your internal loops.

@Nathan I'm not sure I clearly understand, could you expand on your comment?

Sure, just did.

There's nothing special about it being text.  You're showing us solidified planes.  They happen to be in the shape of letters, but that doesn't matter.

The actively selected vertex is a "non-planar 5-pole": it connects five different faces, and those faces do not all lie in the same plane.  This will affect C-C subdivision, giving us the divot we see, and, depending on how it gets triangulated, it will affect smooth shading.  This is the error you are making in your pictures.  (Sometimes, you're making non-planar 6-poles instead, which are even worse.)
Instead, we can do this:

All of the non-planar bits are now 4-poles.  I've added some 3-poles: naturally, places where only 3 faces join at a single vertex.  3-poles are not great either, when they're non-planar.  But these 3-poles are planar, so it's fine.
Another way of saying this: I've created a control loop.  A third way of saying this: my edge flow here follows the edges of the mesh.
Generally speaking, I'll do this by selecting all the connected faces in a single plane and using an 'i' inset faces operation.  This will often require a bit of manual cleanup to get as much inset as I desire, without creating any overlap; a loop tools/relax operation is usually a good, quick fix for overlap fixes (loop tools is an addon bundled with Blender but not enabled by default.)
This single loop is fine if I am smooth shading or subdividing, but not necessarily if I'm doing both.  If I'm doing both, I want two control loops for each plane:

Why?  Because the subdivision will take the vertices of the first loop out of plane, so I need the second internal loop to keep my 3-poles planar.
Once I have these control loops, the rest of the plane no longer matters, except that its faces remain convex (concave faces can screw up subdivision.)  I can pepper it with convex triangles and ngons and 42-poles and the render will never, ever change:

So: follow the edge flow.  Use 1 or 2 control loops to hold mesh edges, depending on your needs for the mesh.  Do as little work as necessary to make anything interior convex, but otherwise ignore the topology of the interior of planar surfaces.
We can look at this, in practice, on a solidified K if we want:

I am subdividing and smooth shading, so I have two loops that follow the shape of the K.  We can see that doing things this way, I create no non-planar poles, and so the subdivision and shading never do anything I don't want them to.


text:
Can I select and bevel the top edge of the letters in this model?
I spent several hours retopologizing the letters for this model, and then doing a Boolean Difference extrusion onto a block.

However now the top edge of the letters is creating a weird geometry and I am unable how to select it to make it beveled.

How can I do this?

Object Data Properties > Geometry Data > Clear Custom Split Normals Data and no you cannot because of the poor topology.

Ah thanks this is great and solved the weird geometry issue, but now I'm trying to select the edge to bevel it and it's proving harder than I thought

you need to retopologize it like this: https://snipboard.io/ISPpgQ.jpg . have you tried Quadriflow Remesh? the screenshot is using the paid addon Quad Remesher. then you can smooth the vertices with Ctrl+V > Smooth Vertices

@HarryMcKenzie ah thanks... unfortunately I'm getting paid a quarter of the price of this addon for this job so it's not immediately worth it to get it :/

can you provide the blend file with the rectangular border being sharp edges? it's better to have it sharp before the remesh

@HarryMcKenzie ok I just did

@MicroMachine sorry the mesh is too complicated I don't think you can do a bevel on it. the letter outlines have angles that are too sharp to allow it due to the pointed parts of the K and the N letters and the density is too high at those parts

I have simplified your mesh here https://blend-exchange.com/b/qSw24rEl. And all that had to be done was just to inset the mesh but unfortunately as you can see here in this screenshot it's not possible due to the pointed nature of the K and the N letters. If you can adjust to reduce the density on those parts then you could successfully inset and then bevel the edges. You could inset and then manually fix the mesh at those parts. then you can bevel

@HarryMcKenzie Thank you so much! I ended up using the free demo of Quad Remesher and will be keeping an eye out for free remeshing tools until Blender's own becomes decent

You could redo the topology this way:
Select the faces facing upwards with ShiftG (Select Similar) > Normal:

Only keep the top faces, press X > Limited Dissolve to simplify and separate the mesh as a new object:

Fill the letters (F or AltF):

Extrude the mesh twice to get this:

Now you can bevel, it will need some re-rework though as the bevel faces will overlap on some parts:


text:
My animation didn't migrate well to Blender 2.9
I have this animation of spheres inflating that I made in Blender 2.79, which looks like this:

Spheres inflate as they fall
When I open it with 2.9, this is what the animation looks like:

Balls move up and down but don't fall and mostly hover
How can I repair this animation in 2.9 (or higher)?
PS: I cannot upload to blend-exchange because of a "All uploaded files must be in the blend file format" error.
Blend file.

You can upload to https://pasteall.org/blend/ if Blend-Exchange doesn't work.

@JohnEason Thanks John! I've added them file.

Ok. Hopefully someone who knows more about changes between the Blender versions than I do can have a look at your file and see what's going on!

This is a softbody simulation... have you simply tried deleting the bake and rebaking the simulation? In my Blender version 3.1 it works as your old version.


text:
2 bones, 3 leg pieces. Middle piece is deforming. Why?
I'm trying to rig a robot leg that has 3 different pieces (thigh, knee & shin), but I would like to use the standard biped armature, so the leg has only 2 bones.
All fine, it moves nicely, but the knee piece is deforming when I move the bones, it gets squished the nearer the bones are:

The middle piece is 0.5 weight for each bone, maybe I shouldn't do like that, but I'm not sure how would be the best way to do that. I tried adding constrains instead of using the armature deform, but it is very mad lol.
Any tips?
Thanks

Can you upload your file please ?

How do you want the knee piece to behave when moving the bones? An example of what you want to achieve would be very helpful for us to guide you to the right direction.

I want the knee to look like a solid metal piece, not deforming. The movement is exactly like it is, an angle in between both bones. And I added the .blend on the post.

1. Armature Modifier Settings
Check Preserve Volume in the Amature Modifier.
2. Method using an additional knee bone

Add a Knee bone. Shift+A
Parent the Knee bone to the Thigh bone (connected). Ctrl+P
Go into pose mode.
Add a Copy Rotation Constraint from the Thigh to the Knee bone.
Add a Copy Rotation Constraint from the Shin to the Knee bone.
Set the Influence to 0.5 on the second Copy Rotation Constraint.
Create the correct Weight Groups for the knee with the new bone.
The knee will be orientated wrong. Apply the current orientation as the rest pose. Ctrl+A

The .blend file of the second method.

Strange... I've seen this preserve volume option and had tried it before asking here, but it didn't work. Now I tried again and it works fine. I think it's the easiest way to do that. Thanks!

Could be sufficient to add a small knee-bone between the others, which is the only one to move the knee?

If I do that, I will not be able to use normal biped animations.

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


text:
Caps on a screw
I am trying to make caps for a circle mesh that I modify into a screw. I'm very new to blender and have watched a few videos but either the version is old or I'm doing it wrong.
I also tried to add a bevel circle to a spiral but the circle mesh does not appear in the possible bevel list.

Could you provide some screen captures or your blend file in order to understand better your question ? To share a blend file you can use : http://blend-exchange.giantcowfilms.com/

Thanks... could you also indicate what you means by "caps" here ? Or a link to the videos you are talking about ? Or do you want to close the "tube" ?

I am a bit surprised, but it seems that closing the tube is not possible. Can you give a link to the videos ?

I figured it out. I was not applying the modifier, so I did not have the faces and vertices available in edit mode. once I applied the modifier to the circle I was able to select the vertices around the openings and use F to fill

ok. Thanks for the information. Just to know : the screew tool in the tools panel (edit mode) allows to screw closed faces and so the result is caped

Enter object mode
Apply the screw modifier
Enter Edit mode and select your screw
Push F to fill

Frank answered his own question in the comments : to cap a shape constructed with the "screw modifier", you have to apply this modifier and cap the extremities manually.
But I allow myself to post an answer because the "screw modifier" behavior is a bit strange (at least I did not expected this).
Here from top to bottom :

A open circle : all is normal but not capped
A circle with one face (select all then F) : the face does not appear, and the smooth does not work anymore
A circle with n faces (select all then extrude, scale to zero and remove doubles) : the edges are extruded by the modifier

For information, the screw tool of the tools panel in edit mode does not have the same behavior and allows face extrusion. So you can screw a plain circle and obtain directly a caped spiral.


text:
Why do I have a single vertex connected to 2 edge loops?
In a UV Mesh I have a single Vertex connected to '2 Edge Loops'
One on the top of a cylinder, and one on the bottom.
I have to remove either the top or the bottom Edge Loop, Then I delete half of the other Edge Loop.
I can not determine where this lone Vertex is located, because "it moves"
Video demonstrating the problem

I do that a lot in Blender and it always says "0 Vertices have been removed" even though there is are 2 vertices in the same spot.

Could you post your blend file so we can look at it? I might have a solution for it but I am not sure I understand the problem entirely

Of course. How do you do that exactly?

Use this to upload your file and then update your answer above with the generated link http://blend-exchange.giantcowfilms.com/

It's not a single vertex, non of your top and bottom of the barrel faces have UV coordinates.
If you move that "one single vertex" in the UV Image editor you will find that there are actually several overlapping vertex in the 0,0 coordinate, in fact if you move more of them you will start seeing faces appear which correspond to the bottom and top of your barrel.
In other words you have to unwrap the rest of the mesh also

Alright, thank you for your time, and have a nice day.

Did this solve your problem? Is this the solution? If so please consider marking the answer as correct, or at upvoting if it helped you