text:
What does 'Cube Size' mean when using Cube Projection UV unwrapping?
I don't understand how Cube Size is handled when doing a Cube Projection.
Here is my example scene: my cube is 1m by 1m, applied rotation & scale, so its just a clean, perfect and beautiful 1m cube.
Let's say we have a perfect tiling texture where the correct mapping scale is 1m.
So I apply my cube projection... but I must set 2 to have the correct scale. Why not 1, like 1m?

here the .blend if someone wants it http://pasteall.org/blend/index.php?id=44724

http://blend-exchange.giantcowfilms.com/ is the preferred upload method for blends as the links won't expire. You can then add the embed code to your question using the [edit] link below it.

Cube projection iterates over the mesh faces and for each does the following:

It considers the dominant normal axis of the face, and keeps the coordinates around this axis. For example if the dominant normal axis is X, the considered coordinates will be Y and Z. This is the 'cube/cube projection' aspect and this cube is fixed along the global axis (we'll have a flat projection on the world's axis).
Then it calculates U and V from the center of the UV Map (0.5) and adds 0.5 * (the parameter 'cube size') * (the object's location + the corresponding vertex location)

The code is the following:
luv->uv[0] = 0.5f + 0.5f * cube_size * (loc[cox] + l->v->co[cox]);
luv->uv[1] = 0.5f + 0.5f * cube_size * (loc[coy] + l->v->co[coy]);

So the result will depend on: the cube size parameter, the object's location (at 'object level') and the vertices location (at 'edit level').

BUT for the first vertex of the face, it calculates a rounding which will offset all the vertices of the mesh, using:
if (first) {
    dx = floor(luv->uv[0]);
    dy = floor(luv->uv[1]);
    first = 0;
}

And after that using the following for all the vertices of the face:
luv->uv[0] -= dx;
luv->uv[1] -= dy;

So the result may appear erratic as the way the rounding of the first vertex works does so, depending on the way the faces are organized (shared vertices between faces), some UV faces will overlap or not.
Once this calculation is done, the operator considers the two other parameters which are 'clip to bounds' and 'scale to bounds'.


text:
"No layers in render result" - please help :(
I'm at my wits' end. I did an animation which was quite a lot of work, then rendered it, disliked it repaired the mesh cause it was all out of shape. Next time I tried to render the animation, I got the "no layers in render result" message and Blender hasn't been able to render even a single frame ever since. First they were all black, now they're all empty. I checked other files which render without problem. I went back to factory settings but still no render so I guess the file bugged out. How can I rescue my mesh, rig and animation? Can I export them somehow?
I have v 2.76 and it never had a problem like this. When I rendered the animation, I followed this tip: How to save animation as a video format
Help please. :(
Ok, I uploaded the file. For some reason, the date doesn't get saved properly. I edited it yesterday and today but the date is still March 6.

Make sure that you didn't disable any of your renderlayers.

I feel your pain Kaffeeteria.  Regardless of what your doing in your .blend, I strongly suggest you render out to image sequences first, and then assemble those images in either the Sequencer (in a new .blend) or any program that can turn image sequences into videos.  Rendering straight to video is only ok if you know 100% what the render will look like, but even then, encoding is a tricky thing to get right.  Especially WRT Blender's FFMPEG dependent library.

Thank you! But that is what I did, following the link above. I rendered the images and put them together. But when I tried to do it a second time, everything broke.

I didn't put it together in a new file though. I used the original one.

That was it? I just couldn't figure out what I had done wrong. Blender has SO. MANY. OPTIONS. Thank you!! And I'm not the person who posted that other topic. This is the first time I ever posted here. And I'm very grateful for the help. :)

Yes export your file as obj, you have options available to include the animations and other datas

Hm, I tried that but now I have 78 obj files... I guess I'm too noob for this cause I don't know how to do it right. :( But thank you!

I'm just telling you what to do, doesn't mean I can do it better than you ^^, There is a way around if you have issues exporting (like I do too), you need to add your horse and armature (and anything you want to save) to a group, then from a new blender file 'append' the group from your original file, I tested it workd with your file without destroying the animation. cheers

OMG it worked!! The mane is all over the place but I can render again! Thank you so much! And thanks to all the others who replied!

source: Stack Exchange

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

sort: votes


text:
Why does my frame range start automatically revert back to 0 after I set it?
I want to do as described here: How Do You Start Animation At A Specific Frame?
Whether I use the setter below the timeline, or the one in the render panel, immediately after I set it--clicking anywhere else--it goes back to 0.  Also trying to set it via the arrows, you can't get past 1, and that also reverts to 0 as soon as you click elsewhere.  Even if I type it in the render panel and the next thing I do is click the anim button (while the typing caret is still there), it has gone back to 0 before the render begins:

Is there some context in which this is normal behaviour?  If so, how can I change it?

So, the number in the panel changes back to zero once you start animation? Does do it if you don't type the number in, but use the arrows to increment/decrement?

Can you give a small screen cast of the unexpected behavior? (See http://meta.blender.stackexchange.com/questions/963/what-is-the-process-for-creating-gifs-for-questions-and-answers/1056 for help with that, or just add some screen shots of what you're doing)

@Noidea once I do anything whatsoever, including start animation.  Yes, arrows make it jump 0/1/0/1 only.

@tschundler done, added an anim.  Thanks for the suggestion.

Never mind, I forgot to mention I'm using an add-on, and with that disabled, this doesn't happen.  So it must be overriding it.

Which add-on? That's definitely strange behavior. Noting it in your answer here could help people that run into this in the future.

Well, it's CoaTools, but it may actually be intentional behaviour, I'm not sure.  I already went and opened an issue in its tracker to ask.  I think the takeaway for others can still be "check your addons", because it's not core blender behaviour.

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


text:
Need help with generating colour id map!
I'm trying to find an easy way to generate Color ID maps in blender to use in Quixel, Substance painter or designer. But there doesn't seem to be any sure shot easy way. I don't have access to Maya or 3ds max but I do have substance bundle, zbrush and 3D coat.
I do all my modelling and UV mapping work in blender, So It would be really helpful if I can easily generate quality color id maps for my assets before putting them in substance for texturing. I've tried assigning different emissive materials on the mesh and trying to bake textures in cycles. But its really time consuming for complex meshes.I also tried using this addon with a low poly mesh with red, green and blue materials applied on different faces but it gives a black and white result something like this.

Please help me with this.

Wow, duplicate??? Have you even read the complete details?

authors: Максим Михеев


text:
Displacement texture same size across different size of cubes
I have two cubes of different sizes where I want to displace a texture on.  In this particular case a brick wall.  I want the bricks to be of uniform size on the small cube and on the bigger cube.  Yet on the bigger cube everything is scaled up together with the cubes scale.  How can I make the bricks uniform size on both cubes ?  I'm using UV unwrap so I only displace the front of the cube.  I found a few questions that seem to relate to my problem but they don't talk about displacement but just adding a texture.  I don't care about texture or color, I'm trying to make an STL for 3D printing.

Edit: I tried the project from view as suggested and they look to be the same size now, however now I get these big bricks.  Which is not my desired result either.

The displacement is reading the UV.  Change the UV.  To make them the same size, enter edit on both, u->project from view.  You are dealing with textures here, and looking at texturing tutorials will help, even if they're talking about things you don't want to do-- good tuts teach about how things work below the surface, and sometimes, those tuts teach you by telling you about things in a domain that seems unrelated to your goal.

I tried the project from view, and I don't understand it do I need to resize the texture, cause if I resize the face on the UV, I get the same result as I had the first time.  Also what texture tutorial are you explicitly talking about ?

The problem I'm having has it something to do with Texel Density ?  I'm reading and watching on this at the moment

Hi :). As you probably know by now, yes, a uniform texel density is what you need. There are addons to help set it to uniform values across multiple objects.

So the problem I was having was not understanding Texel Density. For those who will encounter the same problem and come across my question. The following tutorials taught me all I needed to know to get everything to work. https://www.youtube.com/watch?v=xp61tSQljz0 https://www.youtube.com/watch?v=crnqlSR_ML8 I also needed following tool to get it to work in Blender. It's all explained in the youtube video's https://github.com/mrven/Blender-Texel-Density-Checker

I got it to work now I'll post an answer to my question with all the resources I used to understand the problem

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


text:
Importing image texture with python
I'm trying to import an image texture (in image texture node on shader editor, not as a plane) after removing the previously existing one using a script in text editor. The file path of image texture would be the output from geometry nodes (string).
If anyone knows how to do that please let me know.
Thankyou.

{"Is there a way to get the "image_name" from geometry nodes output?"} — highly likely - yes, it's possible. But the way of retrieving this name would differ depending on your node-setups. If you share your .blend file – I can try to do this. You can upload the file here: [blend-exchange.com]. After adding the file – write a message under my post - this way I will get notification about your message.

I have added the file. It is not completed yet. So added a group node that says "Math" in those places. The script that you shared worked and i have tweaked it a bit as well. In that file the output can be float or integer but if it is possible use string for "image_number" with an explanation so that i can use it in the future if needed. If both string and float is possible then please give me a demonstration on the script to update "End Frame" from geonodes value using float value. Float because i can change it to integer, string if needed using script and can use the decimals. Thankyou.

I've examined your file and nodes in there – though I was not able to recognize the way your nodes generate texture image (IF they do so). Unfortunately I give up on this case. **I hope, my previous answer will help to achieve your goals since it shows how to plug images into the texture nodes by using scripts. From now I'm leaving this case. The best of luck.

I've wrote the script for you :
It gets the texture by it's name (*with extension) and inserts it into the Image_Texture  node replacing the previously used texture (if such existed)
Note: this works correctly only if you have a SINGLE texture node in your material.
HERE:

import bpy

from bpy.types import ShaderNodeTexImage

image_name = 'texture.png'

for img in bpy.data.images:

    if img.name == image_name:

       image=img

       break

shader_nodes = [a for a in bpy.context.screen.areas if (a.type == 'NODE_EDITOR')][0]

with bpy.context.temp_override(area=shader_nodes):

    bpy.ops.node.select_all(action='SELECT')

    nodes = bpy.context.selected_nodes

    for n in nodes:

        if type(n)==ShaderNodeTexImage:

            texture_node = n

            break

    texture_node.image = image

Thankyou for the reply and sory for the delay. Is there a way to get the "image_name" from geometry nodes output?

Just realised i wrote a message under my post instead. Anyway, I have added the file. Not complete yet though. Developed the script from yours. Please use string for "image_number". If string can't be used use float instead. Both string and float if possible. Use the "End Frame" updating script for float. From those 2 i can convert it into anything like integer if needed. Give an example so that i can use that in future if needed. Thank you

This post was initially supposed to be to import image texture using script and thanks to your script i was able to do that. I will create a new post asking how to import geonodes output into a script. Thank you soo much.

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


text:
How i can bind the transformation from a armature to a mesh
Hi I'm trying to create 3 models for a game, everything is good until i realised that when i deleted the Armature from the model it make the meshes big, this is because in game it makes the model big enough for u to see it, now that im doing the mesh it it's small and i don't know how to do it big, but when i add the scale from the armature make it automaticly small

Also i have a doubt about the outliner and how the parentings i think work, what does the chopped lines indicate?

If you want to remove the parenting while keeping the transformations, select the mesh object(s), and run Object > Parent > Clear and Keep Transformation. You may need to apply the transforms afterwards by running Object > Apply > All Transforms or Rotation & Scale based on your needs.
The chopped line indicates which objects are children of the object at the top of the chopped line. In your case, Armor, Backpack, BackwardsCap, Balaclava, Bandana, Beanie, and Beard are children of Armature.

I want to do the reverse i want to do a big object into a tiny one, also thx –

You're welcome, but I don't quite understand what you mean. If you follow the steps I listed, your objects should have the same size after removing the parent. This way, you won't need to scale down big objects, because they won't become big to begin with.


text:
Instancing python output
I've managed to make a random name generator in python that output the result in a geometry node. But now i was wondering how can i generate multiple strings thanks to that script and instance them on points on my scene ?
Right now when i plug the string node in a instancing node, it instances the letters separately.
Thanks

Can you provide more information, like your scripts and screenshots?

my bad, i've just uploaded a screenshot of the whole setup

i know - it is not a nice way, but until now GN cannot handle string arrays or arrays at all - but this tedious workaround works:


text:
Does anyone else have this problem when trying to open a .BLEND file?
Whenever I try to open a .BLEND file, instead of opening the file like it should be doing, It instead just opens a new scene? For example, you save a large cave scene, but when you open it by clicking on the file it just opens the default 'New Scene'.
Edit: Ok this just happened,
I went into regedit to make sure things are correct and they are, so I have absolutely no idea what's going on.
Edit again: for some reason the program became unknown in the associated file types. So that is fixed, but it is still just opening a new scene.

And if you try open blender.exe, file > open?

It will open the scene normally.

are you sure you don"t try to open a .blend1 or .blend2... autosave file?

can't open those, it just gives me a prompt to look online for a program or to delete it.

Is it possible that because I downloaded the zip rather than the installer that it could of messed how .blends open through blender? It's a long shot but it seems possible.

yes, that could cause it. Use the MSI installer if you want .blends to be linked automatically

My fundamental inclination is to vote to close this question as "off topic", because it's about a Windows operating system issue, not a Blender one. But I recall having seen the same question asked multiple times previously, and it seems expedient to provide at least one answer.

That was kind of my thoughts too, it is somewhat related because of how Blender is distributed, so I think it falls within the grey area.

Yeah, I agree, This isn't a blender problem (for the most part). Thank you, I have more insight on this issue.

I have the same issue, and I suspect that your notion that you downloaded the zip file rather than the installer is, in fact, the cause of the problem. It appears to me, that you are using a recent version of Windows. In which case, you can try clicking on "start", and in the menu interface, click on "Default Programs" (in my installation, in the right hand column, directly above "Help and Support"). In the resulting menu, click on "Associate a file type or protocol with a program", which will bring up a list of most of the file types present on your system, perhaps after a period of time to load. In the list, right-click on the Blend extension, and in the upper right hand corner, click on the "change program"
In my installation, when I do this, there is no option to associate the file with Blender, despite the fact that I have about a dozen versions of Blender present on my machine. But each of these is in a separate folder on the desktop of one particular user (I have a half dozen set up, each associated with a particular activity), so that it might be that Windows apparently does not see that the executable programs in those files. It might be that if the unzipped folders containing the various Blender versions were in the root directory of the drive on which they are located, instead of the desktop folder of a particular user, that Windows might be able to see them.
My workaround is to open an instance of Blender, and open new projects from there, and use "open" from the Blender menu to open existing files, and if it's a project I have previously worked on, to use the "open recent" option.

I've done this multiple times, even reconfigured the Registry Key and played around with directories, properties, administration access, etc to see if that is the cause of the problem. But otherwise, I agree with brasshat, this is a windows issue for the most part and shouldn't be here. Thankfully I at least know the root of the problem.


text:
Blender App opens in worst resolution and the info bar is invisible
Blender opens on a worst resolution, the the info bar isn't visible and edges of the app overlaps on the screen, I have attached the picture below.
Drivers are updated. Here are my machine specs

Windows 10 Pro 64 bit
Core™ i5-7200U
Integrated Intel® HD Graphics 620
8GB RAM

EDIT:
I have Intel HD 620, and i real dont have a clue what drivers version works perfect with blender as for The "Info" bar on top disappeared and the mouse pointer is misaligned, its the (Intel HD 530 version 15.45.19.4678) that was causing problems.

The message at opening Blender from console shown above is a low priority warning which isn't related to the problem you have. If you really want to fix it then see https://blender.stackexchange.com/questions/77857/error-al-lib-updatedeviceparams-failed-to-set-44100hz-got-48000hz-instead-wh. As to the top part of Blender window see https://blender.stackexchange.com/questions/82130/the-info-bar-on-top-disappeared-and-the-mouse-pointer-is-misaligned.

Also see https://blender.stackexchange.com/questions/77857/error-al-lib-updatedeviceparams-failed-to-set-44100hz-got-48000hz-instead-wh

@MrZak i kinder thought the error might be related, by the way, its not a big deal so i wont bother, so i think now the issue might be on the graphics drivers, and this is different with the one i have (Intel HD 620)  i am not quite sure if rolling back would solve the problem! any suggestions on that?

It's hard to tell specifically. This can be related if Blender was working normally and suddenly stopped once drivers were updated. Other than that this is only to try and see as the similar case was about drivers. One way to check is download OpenGL dll from https://blender.stackexchange.com/questions/60236/blender-cant-detect-3d-hardware-accelerated-driver and put it in the Blender's folder (not permanently). If everything starts normally then the problem is graphic drivers

@MrZak thanks buddy for the clues you gave me, seems the problem was caused by the custom manufacture drivers, of which i have managed to solve it :) .

So after some time spent troubleshooting, i figured out the customer Lenovo updated Intel HD 620 Driver is the one that conflicting with blender, i am not quite sure if its the same thing happening to  The "Info" bar on top disappeared and the mouse pointer is misaligned (Either with Lenovo or Other Manufactures).
The easy quick solution to this is uninstalling the Manufacture maintained Driver and installing the Generic Intel Driver.
Or rolling back to same previous Manufacture maintained Drivers (Of which it might take a lot of trials and not guaranteed to solve the problem since you might not have a clue on which one was working perfectly with blender).


text:
Why does the second notification popup before the first notification?
Is there another way to write this python code where it popups sequentially? For some reason Second Notification is popping up out of order before First Notification :-/
import bpy

class WM_OT_myOp(bpy.types.Operator):
    """This is the tooltip"""
    bl_label = "Blender Project Information"
    bl_idname = "wm.myop"

    mytext: bpy.props.StringProperty(name= "Enter text", default="")
    def draw(self,context):
        layout = self.layout
        row = layout.row()
        row.label(text=self.mytext)
    def execute(self, context):  #This runs on click
        return {'FINISHED'}
    def invoke(self, context, event):
        return context.window_manager.invoke_props_dialog(self)

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

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

if __name__ == "__main__":
    register()
    bpy.ops.wm.myop('INVOKE_DEFAULT',mytext="First Notification?")
    bpy.ops.wm.myop('INVOKE_DEFAULT',mytext="Second Notification?")

Updated Question:
Thanks @scurest which cleared my first thought, and both are opening at the same time with the last one on top of the first.  How can I instead have the 2nd notification wait for the first to be clicked?

Actually they're both open at the same time (try dragging the second one; the first once is revealed underneath it). The most recent one is on top.

@scurest Haha Thanks!!! Would it take a big modification to wait for the 1st notification click before moving on in code to the 2nd?


text:
Finding the 8 outer corner vertices of an object
What might be the best or easiest way to find the 8 corner vertices of an object (usually cube in shape with more vertices than 8) and then selecting them.
Example Image:

I am starting off this code with just selecting the top 4 but receiving an error when I add:
from bmesh import from_edit_mesh
import bpy

def select4vertTop():
    bpy.ops.object.mode_set(mode = 'EDIT')
    bmT = from_edit_mesh(bpy.context.object.data)
    i=0
    a=b=c=d=e=f=g=h=vPrev=vSelCoord[0] #hold first vert coords to compare with next
    print()
    print( 'vPrev %f %f %f\n' % (vPrev.x, vPrev.y, vPrev.z) )
    for vert in bmT.verts:
        print( 'v%i %f %f %f\n' % (i, vert.co.x, vert.co.y, vert.co.z) )
        if  vert.co.x >= a.x and \
            vert.co.y >= a.y and \
            vert.co.z >= a.z:
                a=vert
        if  vert.co.x >= b.x and \
            vert.co.y >= b.y and \
            vert.co.z <= b.z:
                b=vert
        if  vert.co.x >= c.x and \
            vert.co.y <= c.y and \
            vert.co.z >= c.z:
                c=vert
        if  vert.co.x >= d.x and \
            vert.co.y <= d.y and \
            vert.co.z <= d.z:
                d=vert
        if  vert.co.x <= e.x and \
            vert.co.y <= e.y and \
            vert.co.z <= e.z:
                e=vert
        if  vert.co.x <= f.x and \
            vert.co.y >= f.y and \
            vert.co.z >= f.z:
                f=vert
        if  vert.co.x <= g.x and \
            vert.co.y >= g.y and \
            vert.co.z <= g.z:
                g=vert
        if  vert.co.x <= h.x and \
            vert.co.y <= h.y and \
            vert.co.z >= h.z:
                h=vert
        i+=1
        #a,c,f,h are the top vertices

    print("a%i,c%i,f%i,h%i" % (ai,ci,fi,hi))
    bpy.ops.object.mode_set(mode = 'OBJECT')
    obj = bpy.context.active_object
    bpy.ops.object.mode_set(mode = 'EDIT')
    bpy.ops.mesh.select_mode(type="VERT")
    bpy.ops.mesh.select_all(action = 'DESELECT')
    bpy.ops.object.mode_set(mode = 'OBJECT')

    obj.data.vertices[ai].select = True
    obj.data.vertices[ci].select = True
    obj.data.vertices[fi].select = True
    obj.data.vertices[hi].select = True
    bpy.ops.object.mode_set(mode = 'EDIT')

if __name__ == '__main__':
    select4vertTop()

I apologize I rarely use python.

How do you define the outer?

@HikariTW, I've attached a sample screenshot.

If the center of the mesh is also center of the cube (origin is the mass center). And there is no other noisy vertices around corner. You can determine it by the distance to origin. which is the sum of the three axes square value. Sort them in order and retrieve the first 8 vertices.

@HikariTW, that actually makes sense. Most of the time the origin will be the center of the cube and there won't be other noisy vertices around the corners.Now I have to figure out how to do that in python. I guess it's not simple to do what you said in python :-/

KDTree and the objects bounding box.
Each object has an axis aligned bounding box giving the 8 coordinates of the cuboid the object fits into. If a cuboid is perfectly axis aligned the bounding box corner coordinates exactly match those of the corner verts.
A KDTree can be used to quickly find the closest element to a coordinate
Putting it together in a script, run with object of interest in edit mode (vertex select mode)
Note, this method assumes the mesh is axis aligned

Result of running on default UV sphere
import bmesh
from mathutils.kdtree import KDTree
from bpy import context

ob = context.edit_object
me = ob.data

bm = bmesh.from_edit_mesh(me)

kd = KDTree(len(bm.verts))

for v in bm.verts:
    kd.insert(v.co, v.index)

kd.balance()

# get closest to 8 bbox corners

closest = [kd.find(tuple(c))[1] for c in ob.bound_box]
print(closest)
#select

for v in bm.verts:
    v.select = v.index in closest

bm.select_flush_mode()
bmesh.update_edit_mesh(me)

Ordering the result
The bounding box is "wound" in a consistent order. Looking at the default cube
>>> bbox = [tuple(b) for b in C.object.bound_box]
>>> for i, v in enumerate(bbox):
...     i, v
...
(0, (-1.0, -1.0, -1.0))
(1, (-1.0, -1.0, 1.0))
(2, (-1.0, 1.0, 1.0))
(3, (-1.0, 1.0, -1.0))
(4, (1.0, -1.0, -1.0))
(5, (1.0, -1.0, 1.0))
(6, (1.0, 1.0, 1.0))
(7, (1.0, 1.0, -1.0))

Hence the front y=-1, top (z=1) , left (x=1) vert is index 5. The 4 verts that make up the top corners are at indices 1, 2, 5, 6
The closest list has the same order.
If a definite 8 corner cuboid
In a cuboid mesh the 8 corner verts are only linked to 3 edges, whereas all others are linked to 4.  Can use this.
import bmesh
from bpy import context

ob = context.edit_object
me = ob.data

bm = bmesh.from_edit_mesh(me)

for v in bm.verts:
    v.select = (
            len(v.link_edges) == 3
            )

bm.select_flush_mode()
bmesh.update_edit_mesh(me)

If this is also axis aligned then the "order" could be determined by looking at the components of the vertex normals.  For example, the normals of the corner verts of default cube would be equivalent to their normalized coordinates

What if the cube is rotated in edit mode?

Thanks @batFINGER, that seems to be for the most part what I might need. I ran a couple tests so far. Not sure if I'll be having any objects rotated in edit mode but I'll have to watch out for that and consider that if it happens.

Part 1 answered but I didn't mention that I wanted to extend on this, how would I get the "coordinates" of a single side using your answer to the next step like I tried to find the top 4 in my original post.

In bbox method bbox has a consistent order [tuple(b) for b in C.object.bound_box] in python console on default cube, all those with z = 1 are top. closest is in same order.  For second method could look at vertex normals. Any with an up component v.normal.angle((0, 0, 1)) < pi / 2 will be top verts.

The naive solution is easy enough to do in Python:

from bmesh import from_edit_mesh
import bpy

def select4vertTop(k: int = 8) -> None:
    bpy.ops.object.mode_set(mode='EDIT')
    mesh = from_edit_mesh(bpy.context.object.data)
    # Define a helper function that we calculate distance, using Euclidean distance.
    get_distance = lambda v: v.co.x ** 2 + v.co.y ** 2 + v.co.z ** 2
    # We sorted our verts using the helper, reverse flag is set to true.
    verts = sorted(mesh.verts, reverse=True, key=get_distance)
    bpy.ops.mesh.select_all(action='DESELECT')
    # From the first k vertex, set select to True.
    for v in verts[:k]:
        v.select_set(True)

if __name__ == '__main__':
    select4vertTop()

Although non of the exception and situation is properly handled by counting on distance.
See the @batFINGER's answer for more general approach.

I might use this for another situation. The one test I ran at first is creating 2 cubes a few units away from each other then I joined them. but the result using this sample only selected the 2nd cube vertices which was further from the world origin. (Hmmm maybe because I didn't center the origin between both cubes) Maybe you need code to account for that.

You can modify the get_distance function to make it compare with object mass center.

I just had to add:     bpy.ops.object.mode_set(mode = 'OBJECT') and bpy.ops.object.origin_set(type='ORIGIN_CENTER_OF_VOLUME', center='MEDIAN') and I got it to work :-) Thanks

Suggest could directly use v.co.length_squared or v.co.length


text:
Relationship between global vertex coordinates and mesh object's matrix attributes
How do a mesh object's matrix attributes relate to the global position of its vertices:
matrix_basis
matrix_local
matrix_parent_inverse
matrix_world
And what is each of these used for (practical examples, if possible, would be helpful)?

There are some related questions, but some of the information I'm seeking here seems to not be present on BSE currently.

Practical examples

Object.matrix_basis - If you want to modify the loc/scale/rotation directly, as a matrix - without having to worry about what kind of rotation is used - (Euler, Axis-Angle, Quaternion).
Object.matrix_local - Exporters where you want to write out parent relative transformation.
Object.matrix_parent_inverse - Any tools that handle the transformation relationship between parents and children. (Not used often)
Object.matrix_world - Any time you want to know the final transformation of an object after animation, drivers, constraints and parenting are applied. You would want to use this for example - if you are writing to a format like OBJ which doesn't store object transformations.

In python-ish syntax this is what I have deduced:
obj.matrix_basis == ( Matrix.Translation(obj.location)
    *obj.rotation_quaternion.to_matrix().to_4x4()
    * scale_matrix(obj.scale) )
# replace rotation_quaternion with rotation_euler if you are using Euler mode

obj.matrix_local == obj.matrix_parent_inverse * obj.matrix_basis

if obj.parent == None:
    obj.matrix_world == obj.matrix_local
else:
    obj.matrix_world == obj.parent.matrix_word * obj.matrix_local

# if vertex_local is the location of a mesh vertex
vertex_world = obj.matrix_world * vertex_local
# assuming no modifiers are doing interesting stuff

The strangest element of this chain is matrix_parent_inverse.  Usually it is an identity matrix, but if you parent something using the Ctrl-p menu, this matrix_parent_inverse gets set so that the location and rotation properties appear to still function in their previous reference frame instead of in the reference frame of the new parent.
I haven't dug around to figure out what operators I can use to manipulate (or preferrably reset-to-identity) the matrix_parent_inverse without resorting to python.

Blender is quite tricky about bases changes because it uses unusual frames (the frames Si in the notation below) attached to the objects. Traditionally, mathematicians or physicists use only intrinsec frames (the frames Ri in the notaion below). I took quite some time to understand the behaviour and took some notes for myself. Sorry this is in French, but I hope it can help.
A comment asked for a summary:  I give precise mathematical definitions of the matrices with the introduction of the adequate frames to give these definitions. I also analyse a precise definition of Matrix.decompose() in mathematical terms. Finally, we cand define only two matrices on the four matrices because there are two relations. If one matrix is changed, how do the three other change ? I report my experiments and my understanding on this point .
Again, I apolgize for the language, but I was too lazy to translate my personal notes, and I thought it was better than nothing, since I have not found this information on the Internet.
The part you'll be interested starts with : "Donnons nous n Objets ... "
Bon courage !
Chaque objet est muni de 4 matrices: matrix_basis,
matrix_local,matrix_parent_inverse, et matrix_world.
Ces matrices servent a placer l'objet par rapport au parent et par
rapport au monde exterieur. Bien sur, il va y avoir des relations
entre toutes ces matrices puisque si on sait positionner un objet par
rapport a son parent, et si on sait positionner le parent dans le
monde exterieur, on sait placer l'objet par rapport au monde.
Les matrices dont on parle sont des matrices 4x4 associees a des
changements entre de reperes. Techniquement, ces matrices
4x4 sont construites de la facon suivante. Un deplacement est une
transformation affine, qui se prolonge en une
transformation projective et la matrice du deplacement est la matrice
4x4 de la transformation projective.
Comme la transformation est
affine et que ce n'est pas une transformation projective generale,
la matrice 4x4 ne contient que 12 coefficients significatifs ( le
groupe des transfo affine est de dim 12) :  La sous-matrice 1x4  du bas
est toujours [0,0,0,0,1]. Le groupe des transfo affines est produit
semi-direct des transfo vectorielle et des translations, ce qui
signifie concretement que le deplacement se decompose de facon unique
sous la forme d'une transformation conservant l'origine suivi d'une
translation. La transformation vectorielle se lit dans la matrice 4x4
utilisee par Blender: c'est la sous-matrice 3x3 en haut a gauche.
Le vecteur de translation est la sous-matrice 3x1 en haut a droite.
On peut donc acceder facilement a ces informations.
La commande  Matrix.decompose()) permet non seulement d'obtenir le
vecteur de translation, mais aussi des informations sur la partie
vectorielle de la transformation affine. Donnons nous une
transformation affine de matrice P de taille 4x4, de partie
vectorielle M de taille 3x3 et de
translation de vecteur t de taille 3x1 .
La decomposition polaire du groupe GLn permet de representer
M sous la forme M=OS, avec O=matrice orthogonale et S=matrice symetrique
definie positive. Soit v le vecteur des valeurs propres de S
(defini a permutation des termes pres).
Alors P.decompose()=(t,O,v)
Donnons nous n Objets O1,...On de sorte que O1 est le pere de O2, qui
est le pere de O3... Chaque objet Oi est initialement place' dans un
repere Ri. Ici un repere affine est la donnee de 4 points non
coplanaires de l'espace. Puis on peut bouger l'objet dans son repere
local par un deplacement di et representer ce deplacement par une
matrice Mi. Ce deplacement definit un nouveau repere Si=di(R_i).
Je note M(R1,R2) la 4x4 matrice de la transformation f telle que
f(R1)=R2. Ou si on prefere, un point de coordonnees co1 and co2
dans R1 et  R2, alors f(co2,1)=(co1,1). Avec ses conventions
O1.matrix_world=O1.matrix_local=01.matrix_basis=M1
O1.parent_inverse=1
et pour i>1
Oi.matrix_basis=Mi=M(Ri,Si)
Oi.matrix_local=M(S(i-1),Si)
Oi.matrix_parent_inverse=M(S(i-1),Ri)
Oi.matrix_world=O(i-1).matrix_world*Oi.matrix_local
En termes intuitifs, matrix_basis est la matrice decrivant le
placement de l'objet i dans son repere local, matrix_local decrit le
changement entre le repere Si attache' a l'objet i et le repere
attache' a l'objet i-1, matrix_parent_inverse sert a decrire comment
on a attache' l'objet i a son parent i-1 et matrix_world agrege
les matrices precedentes pour avoir des coordonnees globales.
On voit que sur les 4 matrices de Oi, seules deux sont necessaires,
les 2 autres se determinent par calcul puisqu'on a deux relations,
la relation de la derniere ligne et
matrix_basis*matrix_parent_inverse=matrix_local
Quand on change une matrice, les donnees ne sont plus coherentes
entre les differents changement de repere au sens ou elles
ne satisfont plus les relations precedentes.  Blender doit
recalculer pour
reproduire des matrices coherents et il le fait a l'occasion de
l'appel de fonction scene.update. Le probleme est qu'il y a plusieurs facons de
respecter cette coherence.
Apres essai-erreur, j'ai remarque' que Blender faisait les calculs de
la facon suivante:

si on change matrix_basis ou matrix_world, cela revient a bouger
l'objet dans son systeme de coordonnees locales : Blender prend en
compte la matrice qu'on a modifie', laisse inchangee la matrice
matrix_parent_inverse, puis recalcule les deux autres matrices en
fonction de ces deux la.
si on change matrix_parent_inverse : cela revient a bouger la facon
dont l'objet i est attache' a l'objet i-1. Blender prend en compte la
nouvelle matrice parent_inverse, conserve inchangee la matrice
matrix_basis, puis calcule les matrices restantes a calculer.
on ne peut pas changer seulement matrix_local, ca donne des
reslutats incoherents au sens ou apres update de la scene, les
matrices ne satisfont pas les relations qu'elles devraient. Il semble
qu'il y ait un bug ici.

Google-translated (with no checking by any human who knows French):
The part you'll be interested starts with : "Let us give ourselves n Objects... "
Good luck !
Each object is provided with 4 matrices: matrix_basis, matrix_local, matrix_parent_inverse, and matrix_world. These matrices are used to place the object in relation to the parent and in relation to the external world. Of course, there will be relationships between all these matrices since if we know how to position an object in relation to its parent, and if we know how to position the parent in the external world, we know how to place the object in relation to the world.
The matrices we are talking about are 4x4 matrices associated with changes between benchmarks. Technically, these 4x4 matrices are constructed in the following way. A displacement is an affine transformation, which extends into a projective transformation and the matrix of the displacement is the 4x4 matrix of the projective transformation.
As the transformation is affine and it is not a general projective transformation, the 4x4 matrix only contains 12 significant coefficients (the group of affine transforms is dim 12): The bottom 1x4 submatrix is always [0, 0,0,0,1]. The group of affine transforms is a semi-direct product of vector transforms and translations, which concretely means that the displacement is decomposed in a unique way in the form of a transformation preserving the origin followed by a translation. The vector transformation is read in the 4x4 matrix used by Blender: it is the 3x3 submatrix at the top left. The translation vector is the 3x1 submatrix at the top right. We can therefore easily access this information.
The Matrix.decompose()) command not only obtains the translation vector, but also information about the vector part of the affine transformation. Let us give ourselves an affine transformation of matrix P of size 4x4, of vector part M of size 3x3 and of translation of vector t of size 3x1. The polar decomposition of the group GLn makes it possible to represent M in the form M=OS, with O=orthogonal matrix and S=positively defined symmetric matrix. Let v be the vector of eigenvalues of S (defined up to permutation of terms). Then P.decompose()=(t,O,v)
Let us give ourselves n Objects O1,...On so that O1 is the father of O2, which is the father of O3... Each object Oi is initially placed in a frame Ri. Here an affine reference frame is the data of 4 non-coplanar points in space. Then we can move the object in its local reference frame by a displacement di and represent this displacement by a matrix Mi. This displacement defines a new reference frame Si=di(R_i). I note M(R1,R2) the 4x4 matrix of the transformation f such that f(R1)=R2. Or if we prefer, a point with coordinates co1 and co2 in R1 and R2, then f(co2,1)=(co1,1). With its conventions O1.matrix_world=O1.matrix_local=01.matrix_basis=M1 O1.parent_inverse=1 and for i>1 Oi.matrix_basis=Mi=M(Ri,Si) Oi.matrix_local=M(S(i-1) ,Si) Oi.matrix_parent_inverse=M(S(i-1),Ri) Oi.matrix_world=O(i-1).matrix_world*Oi.matrix_local
In intuitive terms, matrix_basis is the matrix describing the placement of object i in its local frame, matrix_local describes the change between the frame Si attached to object i and the frame attached to object i-1, matrix_parent_inverse is used to describe how we attached the object i to its parent i-1 and matrix_world aggregates the previous matrices to have global coordinates.
We see that of the 4 matrices of Oi, only two are necessary, the other 2 are determined by calculation since we have two relations, the relation of the last line and matrix_basis*matrix_parent_inverse=matrix_local
When we change a matrix, the data are no longer coherent between the different changes of reference in the sense that they no longer satisfy the previous relationships. Blender must recalculate to reproduce coherent matrices and it does this during the scene.update function call. The problem is that there are several ways to respect this consistency. After trial and error, I noticed that Blender did the calculations in the following way:

if we change matrix_basis or matrix_world, this amounts to moving the object in its local coordinate system: Blender takes into account the matrix that we modified, leaves the matrix_parent_inverse matrix unchanged, then recalculates the two other matrices according to these two the.
if we change matrix_parent_inverse: this amounts to moving the way in which object i is attached to object i-1. Blender takes into account the new parent_inverse matrix, keeps the matrix_basis matrix unchanged, then calculates the remaining matrices to calculate.
we cannot change only matrix_local, it gives inconsistent results in the sense that after updating the scene, the matrices do not satisfy the relationships they should. It seems there is a bug here.

Can you please provide an English summary? Stack Exchange tries to keep all questions and answers in the English language. It will facilitate translation endeavors in future, and makes it much more consistent.

As a summury: I give precise mathematical definitions of the matrices with the introduction of the adequate frames to give these definitions. I also analyse a precise definition of Matrix.decompose() in mathematical terms. Finally, we cand define only two matrices on the four matrices because there are two relations. And I comment the three other matrices  change when I change one matrix. Sorry for the language, but I was too lazy to translate my personal notes, and I thought it was better than nothing.

+1 but plz someone translate :(


text:
How to set a principal point for a camera
Pinhole camera model includes a principal point (just to be clear, it appears here: http://en.wikipedia.org/wiki/Pinhole_camera_model)
Is there a way to set these camera param s.t. it will be used for rendering an image?
Thanks,
Alex

I'm not entirely sure what you're looking for, but it sounds like the lens's Shift properties.

Here's the default settings:

And here's the same camera with an X-axis shift of 0.2:

Note that this is not the same as simply rotating the camera - adjusting the Shift doesn't change the perspective. You can think of it as if you had a larger image and you cropped a side of it off.

Do you know how to achieve this in blender python?

Dumb follow-up question: Does anyone know the units for this? The docs don't indicate anything: https://docs.blender.org/manual/en/latest/render/cameras.html

It's answered here: https://blender.stackexchange.com/questions/58235/what-are-the-units-for-camera-shift

The Cycles render engine is so realistic, you can create your own pinhole camera (http://bensimonds.com/2013/03/04/cycles-experiment-pinhole-camera/). While this is cool, what I think your really asking is how to set the center of the image(or maybe the exposure):

A point R at the intersection of the optical axis and the image plane.
  This point is referred to as the principal point or image center.
  (Wikipedia)

You can set the center of the image by positioning the camera (use ShiftF to fly the camera).
If you're talking about exposure (how much light is allowed to touch the film), you can change that in the Cycles render panel under film:


text:
How to handle the huge point cloud with Geometry nodes?
I am working with the geometry nodes to handle some amount of points generated.
However, blender becomes very slow when the points amount is big.
I am thinking if I can handle the points batch by batch. For example, by applying the geometry nodes for part of the points and start another geometry node to repeat the process. However, it is not quite effective and I wanted to do it within one geometry node or automatically by the geometry nodes. Is there a way to do this?

It's hard to advise anything, considering how laconic your question is. See https://blender.stackexchange.com/a/291820/60486

Hi. There is very little information here. What do you mean by "huge point cloud"? 100,000 points? 1 million points? 10 million or 100 million? What becomes slow? The viewport? The render time? Or is the processing of the geometry nodes slow? How do you display/render the points? Have to tried to reduce the number that are displayed? What does your GN with the point cloud? How do you handle them batch by batch? Sorry, this question can not be answered...


text:
How can I make same orientation for bones in edit and pose modes?
How could I rotate axes in pose mode to align them with axes in edit mode?
When I did armature for a model, I ended up having bones with local space axes pointing in different directions in edit mode at compared to pose mode. Have a look at the screenshot below please.

I suspect this may have happened because I inaccurately applied a position in pose mode as Rest Pose.
But now I'm experiencing issues during animation with local axes when I export it to Unreal engine.
Looks likes, edit mode axis positions is correct because it matches global axes. I would like to make them point in the same direction.
UPD The file with armature is https://drive.google.com/file/d/1Z1x5DKVVjRK3SzPkSMHeFob0xiCBnI0_/view?usp=drive_link
UPD2 As @moonboots said in the comments below, bone in Edit mode displays Armature orientation. In Pose pose, the orientation of a particular bone is displayed. It doesn't seem to be an issues here anymore. As to my problem with animation in Unreal Engine. I've figured out it is not big issue and decided to leave it as is. I'm doing animation sequences with 2 ways in the Unreal: manually with mouse or adding coordinates with Python. I've found out I can switch to World space(or set with Python to world space) and axes are looking straight for every control in that case.

Hello, could you please share your file?

@moonboots please see my first post. I've updated it

I'm not sure there's anything abnormal here, if you are in Edit mode you see the armature orientation, if you are in Pose mode you see the bone local orientation

If it is armature orientation in Edit mode, then I think I misinterpretted something. In that case it is good and I need to think how to align control rigs in Unreal instead of Blender... Thank you for the clarification.

Note that you can display the bone orientation in the Data panel > Viewport Display > Axes

What you see in Edit mode is the armature's axis, not the bone axis. In Pose mode you'll see the bone axis, but you can also display it with the Data panel > Viewport Display > Axes option:

Yep, I think everything is oriented naturally. I thought edit mode displays local axes of bones not armature. It confused me. I will mark this answer as correct one.


text:
How to render metall elements with Ctrl F12 rendering
I want to create sprite sheet in Blender 3.6 from 3D animation. When I try to create frames(Ctrl+F12), metal parts of my character is not rendered correctly. I was wondering if it is possible to fix it in blender?

Edit
My question was associated with similar one by the link Why does an object with a glossy shader render in black? But it doesn't answer my initial question. It is also a bit different question. Let me explain why.
Author of the post Why does an object with a glossy shader render in black? is saying that a text becomes black when glossy shader is applied to the text. I understand it like the author cannot see glossiness of a text in blender at all.
I am able to see metal glossiness of my object in blender. It works as expected. My issue is related to Render Animation tool. So, while I see my metal object in Blender Layout, the same metal object is black-ish at images which I get when press Ctrl+F12. The output images don't reflect metal object properly.
Regardless of this, I read answers of this post. They suggested 2 fixes. Apply proper lighting and add surface to be reflected on my object. It doesn't do any effect in my case.
Edit2
I added HDRI image to world environment and it helped to fix the issue

Related question: https://blender.stackexchange.com/q/128499/107598

if you are in Material preview, you'll see a default HDRI image reflected on the surface of your metallic object, but this HDRI image won't be used for render, if you want something else than your background color to be reflected in your render, you need to give an HDRI image to your World. You would have seen that if you have switched to the Rendered preview mode (as long as its Scene World option is activated).

Can you please elaborate, what you mean by "give an HDRI image to your world"? I need only sprites from my animation which will be used in flipbook in Unreal Engine. I'm not going to use it Blender eventually.

Ok, I read post https://blender.stackexchange.com/questions/48659/why-does-an-object-with-a-glossy-shader-render-in-black and I think get what you mean here. I need to add an object to be reflected. I will try it...

It didn't help. The author of the post asked about an issue when he applied a glossy shader to an object and It doesn't work. In my case it works good. I see glossiness/metallicity in blender. The issue will come when I try to run Ctrl+F12 tool. I don't see glossiness on images which I get in the end. But it is still good in blender

Have you given an HDRI image to your World? Maybe share your file (pack your image: File > External Data > Pack Resources)

I eventually did it. I did wrong attachment of image to World and it didn't work. Now I added it right and see glossiness. Thanks for the help!


text:
How to fix pixelated painting in Substance Painter on model from Blender
I have downloaded a mesh from the internet and make some changes in Blender. When I export it to FBX from Blender and open in Substance painter to create some textures, there is not sharp painting. Image below.

But if I create UV sphere in blender from scratch with almost equal number of polygons, the painting is sharp.

How could I fix the mesh in Blender to get sharp painting?
I tried the Shade Falt and Reset Vectors in Edit mode. Neither helped.
UPD1. Attaching .blend with mesh which is pixelated in Substance Painter when I try to paint something. https://drive.google.com/file/d/13AzCBw_Hqjx8waYkMNTghnQz8Z27XDIm/view?usp=sharing

Hello, the image resolution has nothing to do with the amount of faces. Maybe the problem is the image resolution?

@moonboots Hi, thanks for your response. Not sure what you mean by image resolution. I've set 1024 textures size for both. Yes, when I change 1024 to 2k or 4k, the pixelated image is getting better, but not good enough. It seems just pseudo improve. The root cause is something else...

Could you please share the object with its image texture?

@moonboots I've updated my post above. Please find the link. It is blend file. I don't have any materials yet. That's why I'm asking about mesh. I'm exporting this mesh as .FBX from blender and open it in Substance

See your UVs in the UV Editor, they are very small, scale them up and paint again, you should have a better resolution  @Dron4K

@moonboots wow, it's helped. Thank you very much man

Also maybe you should unwrap again, choose the Smart UV Project option

See your UVs in the UV Editor, they are very small, scale them up, or unwrap with the Smart UV Project option so that you have less face distortions, and paint again, you should have a better resolution:


text:
How to script an animation based on 3d joint data?
I have looked at the other questions that have been posted here and I am very sorry that this is such a similar question AGAIN but none of the issues solved it for my issue.
I am working on an application that converts 3d joint positions into an animation with the goal of saving the deformed mesh at certain points.
What I have right now is a mesh, an armature that is properly parented to it (I checked in pose mode) and all the 3d joint positions. What I would like to do now is "just" move the heads and tails of the bones (in edit/object/pose mode, whichever gives me a deformed mesh to export) to the correct position with a python script and then export the deformed mesh.
However, while I can change the armature in edit mode by positioning heads and tails of the edit_bones, the mesh stays the same (duh) and in pose mode I can only set the location of the entire pose_bone, heads and tails are read only. I would like to avoid the hassle of computing translation matrices, rotation matrices and scale factors for every joint - am I missing something?
It feels like I am so close to the solution and yet I can't progress.

Code version 1
Code with pose mode (the way I understand it this should move all bones randomly but the actual result is it just moves the root node and and therefore the whole mesh, all joints stay in the same relative position to the root node. If I try to move only the nose for example nothing happens but the pose_bone.location changes, maybe I am missing the bpy.context.scene.update() from the example but it causes an attribute error for me) as per this solution on stackexchange
import bpy
import numpy as np
import mathutils
import random
from bpy import context

bpy.ops.object.mode_set(mode='POSE')
armature = bpy.context.scene.objects['Armature']

for pose_bone in armature.pose.bones:

    print(pose_bone.location)
    x = pose_bone.location[0] + random.uniform(-0.2, 0.2)
    y = pose_bone.location[1] + random.uniform(-0.2, 0.2)
    z = pose_bone.location[2] + random.uniform(-0.2, 0.2)
    pose_bone.location[0] = x
    pose_bone.location[1] = y
    pose_bone.location[2] = z
    print(pose_bone.location)
    print('changed' + pose_bone.name)

Instead of directly assigning the coordinates i also tried this bone.location = armature.matrix_world.inverted() @ bone.bone.matrix_local.inverted() @ v in case there was an issue with coordinate systems but the result is the same, I cannot independently move individual bones.
Update on the pose mode solution: it seems like the issue was setting the location, this only works for my root node, the location change is ignored everywhere else (why is the functionality provided for non root bones then ?).
What does work is setting the rotation of individual bones but that brings me back to the problem that i would have to compute the rotation matrices (and potential scaling) for every frame of my data, which will probably result in errors at the ends of the limbs because of accumulating errors.

Code version 2
This version is in Edit Mode and changes heads and tails of the armature bones but the mesh remains unchanged (per this solution)
import bpy
import numpy as np
import mathutils
import random as rd
from bpy import context

bpy.ops.object.mode_set(mode='EDIT')
obj = context.object

for bone in obj.data.edit_bones:

    random_vector_1 = mathutils.Vector((rd.uniform(-0.2, 0.2), rd.uniform(-0.2, 0.2), rd.uniform(-0.2, 0.2)))
    bone.head += random_vector_1
    random_vector_2 = mathutils.Vector((rd.uniform(-0.2, 0.2), rd.uniform(-0.2, 0.2), rd.uniform(-0.2, 0.2)))
    bone.tail += random_vector_2

My data is not true mocap but .cdf (nasa, not wolfram alpha) so I have just raw 3d positions. Links to the similar issues: 1 2 3 4 5 6 7

Please post the code you have so far as well as how the data look like and the links to all the other questions you've mentioned. Thanks

Consider setting up constraints pose bones to empties. Eg a forearm bone could track to the wrist joint.

Related https://blender.stackexchange.com/questions/30835/convert-a-c3d-and-trc-files-to-bvh

@batFINGER unfortunately my data is not true mocap but .cdf (nasa, not wolfram aplpha) so i have just raw 3d positions. i will however look into the issue, thank you

@batFINGER i have not used constraints yet, how could they help me to move the heads and tails of the pose bones to a specific 3d location ? would it be like this (https://blender.stackexchange.com/questions/79344/move-bone-tail-to-a-certain-location) ?

See the link posted above.  The input data was hierarchical empties from a c3d or trc file. Both answers explain how the constraints are set up.  Your question code is all about moving pose bones (or edit bones).  What is prob of more interest to solve this is the data and its format. Are they just globally located empties or is there some parent structure to them?

@batFINGER My data is basically just a very big float matrix of shape [numbarOfFrames, 93], for each of the 31 mocap points 3 coordinates. Unfortunately I cant share any of it as it is part of the Human3.6M dataset and not allowed. The reason i am going this route is that initially i just wanted to take the mesh they provide, rig it and then animate it by just transforming the pose bones so they align with my 3d data points. But I guess maybe it makes more sense to go the route like the dog example, build the armature based on the initial 3d positions and then fit a mesh around it somehow.

@batFINGER i have repurposed the dog example and it seems to be going well, thank you very much for the help. only thing that remains now is adding a mesh and exporting it somehow.

I have been able to do this. Perhaps the problem is that you need to persist the changes by switching to OBJECT mode.


text:
Dashed line and Wireframe
I'm trying to render a cube with 2 additional vertical edges on a one of the faces.
I use the wireframe modifier for making faces transparent and freestyle for making the dashed edges.
The issue is the fact that these 2 dashed edges become non-dashed in render.
Can I somehow make the edges to be dashed while the wireframe modifier is applied?

Using the Wireframe modifier and Freestyle seems to me to be using two conflicting tools to do the same job, The modifier doubles up existing edges, which overlap in the Freestyle output.
At first sight, unless you have special reasons, an option would be to remove the wireframe modifier, and leave the transparency to Freestyle.

Here, the cube's material is set to be transparent so no faces are shown, and the 'Visibility' selection criterion is removed for  the solid Freestyle Line Set, so it can be seen through the cube.

For the face transparency to be effective in EEVEE, the Alpha has to be set away from 'Opaque' in the material's Settings panel.
As @Gorgious has commented, for EEVEE, it's probably better to set Alpha than Transmission on the material.
If you need to see one object inside another, and have it occlude the Freestyle lines (while they are not occluded by the containing object), this is one possible logic:

In order not to have the internal object display Freestyle, separate the Freestyle objects into a different Collection, and add a 'Collection' constraint to the Line Set selection criteria.
To have the outer object's Freestyle occluded by the inner object, you can use a QI range, which makes the display of a Freestyle stroke contingent on the number of surfaces between the edge and the eye point.

Can you tell me, please, how can I set up the transparency of the material?
I changed the transmission from 0 to 1, but for some reason any object placed inside the cube is not visible.

Have you changed the blend mode of the material in the settings foldout ?

@Gorgious Yes, I've selected 'Alpha Clip'.

Try changing the "alpha" value to 0 instead of the transmission value

@Gorgious Now it works fine, but the issue is the visibility of some edges. The back edges of the cube are overlapping an inner figure.

@MikhailNono .. see edit..


text:
How to let softbody assume default shape again
Yo wassup,
I dealt a lot of time in the past few months dealing with softbodies, but I still couldn't figure the following out:
Why is a softbody unable to go back to its default shape when previously deformed through shapekeys?
I included an example below - while it looks like it's back to the original shape, you'll notice a tiny offset between the baked and original shape. No matter what I tried, that offset doesn't disappear.

The green object is the original object deforming from a flat plane to this mess with a shapekey - the mess-shape however is the Basis-shape and the flat-shape a shapekey, not the other way around. The red object is the same but with a softbody modifer.

My current understanding is that when working with shapekeys, the goal-property tries to get the softbody into the shape of the currently active shapekeys (or modifiers), while the edges-property only pays attention to the original shape (Basis-shapekey - or probably just the vertex spring-distances towards each other at that Basis shape) and sees the goal as exterior forces trying to deform that shape. This explains why, when using both goal and edges with shapekeys, the bake will look different to what it looks like at the original.
Knowing that would mean that if you actually want your object to go back to the Basis-shape after some deforming, you just need to set all shapekeys to 0 at your last bakeframe and have both goal and edges active (edges in case you're still working with collision objects), since both the edges want to have the basis-spring-lengths again and the goal wants to assume that shape anyway, since no shapekeys are active. But I don't get that, instead I get a shape which looks almost similar but still isn't actually the same (as shown in the pictures). They both want that shape, but it still doesn't fully appear. Why is that and/or how do I fix this?
Cheers.

(It also still doesn't work if you turn off all field weights and set the weight to 0kg, and setting the goal to 1 will make it completely ignore the edges and thus also collisions - I only want it to fully deform if there are no collision objects preventing that. If you let it bake for some more frames after all shapekes are all already inactive it will only get a bit better, and that only until a certain point after which it won't change at all anymore.)

Alright figured it out myself, you need to tweak the goal damping value. Not too low and not too high.

Used a value of 1 for this one and it now looks exactly like the original. You can see that the original is also still there, since there's a small shading intersection where the green shines through on the right.
Small update: I only made a few tests but it seems that the scale of your softbody also influences if and how fast it can assume the default shape again: The bigger the better.


text:
Trouble with separating a mesh : "Error: Nothing selected"
I am new to Blender Scripting and I want to do this :

I am using Blender v2.80.75 and I have the following code :

selectTopOfBuildingFaces(bm)
for f in bm.faces:
    if f.select == True:
        print("Selection is not empty.")
        break

bpy.ops.mesh.separate(type='SELECTED')

My method successfully select the top part of my building as the for loop prints my text
But the console output shows an error :

Selection is not empty.
Error: Nothing selected
Traceback (most recent call last):
File "C:\Users\admin\Documents\building.blend\building.py",
line 123, in
File "C:\Program Files\Blender
Foundation\Blender\2.80\scripts\modules\bpy\ops.py", line 201, in
call
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Nothing selected
Error: Python script failed, check the message in the system console

I don't understand because I am making sure that faces are selected before calling the operator.
Is it a bug or do you have an example of separating mesh ?
Thanks for your time

maybe show what you're trying to do with some screenshots and share this part of your file? https://blend-exchange.giantcowfilms.com/

Thanks for your input. I added pictures of what I want to do and my whole blender project. I am aware that the code is far from being perfect. Anyway the line that fails is line 123 : bpy.ops.mesh.separate(type='SELECTED')

You are making your selection on the bmesh not the actual object.

I do want to separate the top of the Building, but in Python script. What is this Y you are suggesting ?

If your goal is to select and separate the top part you can do it with Y, is it what you want to do? Actually all your faces are already separated.


text:
I'm having an issue in sculpting where an item becomes invisible but is still physically there
At the moment I am working on the blender guru's level one tutorials. I have gotten to part 5 and have run into an issue: Whenever I switch over to the sculpt tab, the doughnut disappears. I know it is there because it shows up in the collection tab, and if I move my cursor over it, it will show along the surface of it, and if I select it, it has an outline.
So far, I have tried alt + H on both the sculpt tab and layout tab with no results. I've hit the / key on the sculpt tab, though it did not seem to do anything (I might be using it wrong I've only been using Blender for about a day).
I've pulled up an entirely new blender project and went to sculpt immediately with the same result a blank screen with the object being invisible, but I can still interact with it. I will try to clear any confusion up if you are trying to help me. Maybe this image can give some further context.

Each Workspace has different View Settings under the "N" menu.
Maybe this is a clipping issue?

@TreyHarper the clipping start is set at 0.1m. is this what you were meaning?

Hmmm...  Doesn't seem to be a clipping issue.  You should upload your .blend file so others can take a look at it.  https://blend-exchange.giantcowfilms.com/

@TreyHarper ok here is the .blend file. hopefully, this will help.

Opened the file and it looks fine.  I see the image correctly.  Played around with every setting I can thing of- Sorry!  Maybe someone else will have an idea.

thank you for trying @TreyHarper you did what you could.

@TreyHarper could it be any thing to do with the mask?

Just saw this. Might be related?  https://blender.stackexchange.com/questions/159809/object-completely-disappears-in-sculpt

@TreyHarper I can't say that it worked due to the factor I just updated to V1.83 and it fixed the problem so I couldn't try anything on the post. thank you for the help that you have provided. Also, how do I compensate you for the assistance?

Stay active on the site, learn as much as you can, and pay it forward.


text:
Blender crashing during the execution of a script processeing moderatly to large graphs from graph_tool
Summary
Code which works outside of blender for any sized graph works in Blender for small-sized graphs but causes Blender to crash for moderately and up sized graphs.
detail
I'm trying to write an Addon which lets users manipulate Graph_tool (https://graph-tool.skewed.de/) Graphs in blender. I've been trying to achieve this using Icospheres as vertices and beveled NURMS curves as edges which have constraints on them to get them to stick to one vertex and stretch to another vertex. I've been attempting to save on memory by sharing mesh and curve Datablocks (I think thats the correct word although I am still a noob to blender python scripting).  I've got a basic class  working which lets me do this. I've got graphs of around 300 nodes and 400 edges working. It takes about half a second to setup all the icospheres and curves and Blender reports it's using less than 50MB of memory once it's finished. However If I go much bigger than this Blender starts to crash during the execution of the script. I get errors such as terminate called after throwing an instance of 'terminate called recursively or terminate called after throwing an instance of std::bad_allocWriting: /tmp/testing.crash.txt .  I've run the code outside of blender and everything seems to work fine (I set bpy to a dummy module), even for much much larger graphs (tens of thousands of nodes, hundreds of thousands of edges). I'm managed to find the line of my script which seems to be causing the issue when I run my script in blender. It works out a layout for the graph and can take quite a long time.
Does anyone have any idea what could be causing this or where to look? Is there any way to memory profile my script as it is run inside blender?
Here's my main class and how I use it:
import bpy
import graph_tool as gt
from graph_tool.draw import sfdp_layout
from graph_tool.generation import lattice

class Graph(gt.Graph):
    def __init__(self,g=None,directed=False,prune=False,vorder=None):
        super().__init__(g,directed,prune,vorder)

        self.pos = None

        self._vertices = Vertices()
        self._edges = Edges()

        self.n = self.num_vertices()

        if g != None:
            self.non_empty_setup()

    def non_empty_setup(self):

        #This is the line blender freaks out on for large graphs:
        self.pos = sfdp_layout(self,C=5)
        #It computes x,y position for each vertex in the graph

        self._vertices.update(self,self.pos)
        self._edges.update(self)

g_ = lattice([200,200]) # an inbuilt graph_tool function to generate a graph of a lattice

g = Graph(g_)

I can post the other helper classes (Vertices and Edges) If that would help.
For reproducibility, I've found the easiest way to install graph_tool for Blender is to sym-link the site-packages directory of Blender's internal python installation to the site-packages directory of a conda python installation of the exact same version and then install graph_tool using https://git.skewed.de/count0/graph-tool/-/wikis/installation-instructions#conda.Please let me know if you think my strategy of using icospheres and curves is a dumb idea. I'm trying to find the most efficient approach which doesn't look ugly.
Edit
I've realized that my issue can be reproduced by running the following from the text editor:
g = lattice([20,20])
pos = sfdp_layout(g) #  blender crashes here

This occurs even if bpy is not imported. This led me to believe my issue is in fact with how I've set up my python interpreter. I've outlined how I set it up above. Is there a better way? Installing graph-tool is a pain. I've only worked out how to do it using conda.

After much messing around I found I was doing two things wrong.
The first was I should have been importing graph tool with from graph_tool.all import graph_tool as gt instead of import graph_tool as gt.
The second problem I was having was not symlinking correctly. Instead of symlinking the whole site-packages I found that only symlinking what I actually needed worked.
I wrote the following bash script which will do all the necessary sym-linking given the name of the blender installation folder(this is so it will work for different versions of blender). You'll have to change the paths specifying where your conda installation is and what folder your blender installation directory is.
#pass it the blender installation directory. You will have to change $Blender_folder_directory to wherever you installed anaconda.
#Also make sure the anaconda environemnt is called blender
condaInstallation=/home/ben
Blender_folder_directory=/home/ben #which directory your blender installation folder is in.
name=$1
version=${name:8:4}

ln -s $condaInstallation/anaconda3/envs/blender/lib/python3.7/site-packages/graph_tool $Blender_folder_directory/$name/$version/python/lib/python3.7/site-packages
ln -s $condaInstallation/anaconda3/envs/blender/lib/python3.7/site-packages/scipy $Blender_folder_directory/$name/$version/python/lib/python3.7/site-packages
ln -s $condaInstallation/anaconda3/envs/blender/lib/python3.7/site-packages/cairo $Blender_folder_directory/$name/$version/python/lib/python3.7/site-packages
ln -s $condaInstallation/anaconda3/envs/blender/lib/python3.7/site-packages/matplotlib $Blender_folder_directory/$name/$version/python/lib/python3.7/site-packages
ln -s $condaInstallation/anaconda3/envs/blender/lib/python3.7/site-packages/dateutil $Blender_folder_directory/$name/$version/python/lib/python3.7/site-packages
ln -s $condaInstallation/anaconda3/envs/blender/lib/python3.7/site-packages/mpl_toolkits $Blender_folder_directory/$name/$version/python/lib/python3.7/site-packages
ln -s $condaInstallation/anaconda3/envs/blender/lib/python3.7/site-packages/gi $Blender_folder_directory/$name/$version/python/lib/python3.7/site-packages

ln $condaInstallation/anaconda3/envs/blender/lib/python3.7/site-packages/pyparsing.py $Blender_folder_directory/$name/$version/python/lib/python3.7/site-packages
ln -s $condaInstallation/anaconda3/envs/blender/lib/python3.7/site-packages/pyparsing-2.4.7.dist-info $Blender_folder_directory/$name/$version/python/lib/python3.7/site-packages

ln $condaInstallation/anaconda3/envs/blender/lib/python3.7/site-packages/cycler.py $Blender_folder_directory/$name/$version/python/lib/python3.7/site-packages
ln -s $condaInstallation/anaconda3/envs/blender/lib/python3.7/site-packages/cycler-0.10.0.dist-info $Blender_folder_directory/$name/$version/python/lib/python3.7/site-packages

ln $condaInstallation/anaconda3/envs/blender/lib/python3.7/site-packages/six.py $Blender_folder_directory/$name/$version/python/lib/python3.7/site-packages
ln -s $condaInstallation/anaconda3/envs/blender/lib/python3.7/site-packages/six-1.15.0.dist-info $Blender_folder_directory/$name/$version/python/lib/python3.7/site-packages

ln $condaInstallation/anaconda3/envs/blender/lib/python3.7/site-packages/kiwisolver.cpython-37m-x86_64-linux-gnu.so $Blender_folder_directory/$name/$version/python/lib/python3.7/site-packages
ln -s $condaInstallation/anaconda3/envs/blender/lib/python3.7/site-packages/kiwisolver-1.2.0.dist-info $Blender_folder_directory/$name/$version/python/lib/python3.7/site-packages


text:
How can I fix the weight painting?
What's going on here?

I had done all my weight painting but I ruined it by using symmetrize. As you can see in the pic, the selected bone is moving the other arm too. I already made sure it's not weight painted and I fixed the vertex group to not include that arm. What else do I need to fix?
Also, can anyone give me a quick way to mirror weight painting already applied to one side to the other? I asked it here a while ago:
https://blender.stackexchange.com/questions/47671/how-to-mirror-weight-painting-already-applied-to-one-side
Thanks

It was a simple solution. I had to remove the weight painting from areas connected to the upper arm too, not just the upper arm. When I symmetrized, it copied all the weight painting on my right to left but kept it assign to the same bone/vertex group.

Glad you found a solution.  If you found that symmetrize copied the weights from one side's bones to the other side's geometry, it could be that the naming convention of your bones wasn't conducive to right->left conversions.  Best bet is to re-examine your bone naming convention for future symmetrize operations.

@MikeBelanger Really? I used riggify with automatic weights (which I then modified with weight painting). I believe that does make it conducive to right to left conversions, correct? Maybe it's the way I used symmetrize? I already had a full object with both sides, but lost symmetry in one area so I thought I could use symmetrize to restore it. It did but it ruined the weight painting it seems. Thank you. (I learned a better way to restore symmetry using shape keys)

I don't think riggify re-names the initial bones you target, does it?

I used the bones that riggify gives you. The metarig. The all have the "L" and "R" at the end if that's what you mean.


text:
How to make the Howlaround effect in blender
There’s a effect called the Howlaround effect where you take a camera, plug it into a tv and display a infinite path, kind of like a mirror in front of a mirror. when you get closer it makes blobish abstract effects and I wanna find out how to make them because I don’t have the proper equipment on how to make its, and I doubt there are any tutorials that show it.
For more reference look here: https://www.youtube.com/watch?v=oQVtfh677Kk&t=17s
And here: https://www.youtube.com/watch?v=vqh9i10FDkA&t=4s

Hello and welcome. While files, images, and external videos or links may be helpful additions they should not be the only way to obtain information about your issue. Don't make understanding your question rely on downloading a file, watching a video or visiting an external site. Use the builtin tools to upload images or gifs, along with thoroughly explaining the problem in written form so it can be indexed and searched for thus helping future visitors with similar issues.


text:
Image strip not using alpha channel
im using a image strip that uses the alpha channel (transparency) but the transparency is black and opaque. i have the blend mode set to alpha over and have the alpha color management set to straight. here are my settings that maybe related to this issue

Could you please show the image sequence (or one image) how the transparency is supposed to look like, what it looks like in the sequencer and what you have below the strip that should be showing through the transparency? Also show the strips in the editor?

Hi, Bludus .. I  have to agree with @Gordon, here.. anything you can think of, please,  that can help us help you.

@GordonBrinkmann i added another image, the black part of the preview is supposed to be transparent but it is not.

I think it would be simpler if you could pack the original image file you are using in your 'blend and share your file with us . AFAIK the settings you have should work for a transparent image, unless the image doesn't have anything to show transparent, or there's something else in the blend file preventing you to see transparency.

@Bludus You have made the strips so thin that I see any labels on it... but it looks to me as if the image sequence is at the bottom of the stack. So there is nothing to see below the transparent gap. Therefore it shows black (since video files - with very few exceptions - do not allow transparent backgrounds).

@GordonBrinkmann i did add another image strip to the bottom layer and added the one i showed on top and the alpha channel didnt work

@Bludus Well, in the screenshot the strip is in channel 1 and there is nothing below it. I also cannot see if the alpha channel or the image settings are okay so it is probably best if you would upload the file.


text:
Remove parts of object, which are inside of another object
I want to remove the inside parts to retopo this model (made in nomad) properly:

The hair wrapping around the body is also inside the body:

I want to remove the parts of the hair inside the body.
What I tried:

Merge by distance (removed about 2500)
Select All by Trait -> Interior Faces, which looks like this:

The vertices overlap and and aren't connected between the body and the hair. I guess that causes a problem. Sadly most of the posts I found on the internet were about more simple models, like a cube inside of another cube.
What method can I use to select the inside hair (or the inside parts of the eyes etc) and remove it?

If you're doing this to retopo the model, I suggest to use the Voxel Remesher. It is found under Object Data Properties > Remesh. The most important parameter is the Voxel Size which you need to make as small as possible without producing a mesh that's too dense for your PC.


text:
Normal/Bump maps causing flat shading
Whenever I add a normal/bump map to a smooth object the shading goes flat. Even on a UV sphere the issue remains. The shader is only using procedural textures so I can't change anything to non-color like a lot of posts suggest. I've used these exact same nodes in previous projects and haven't had this issue before.

Hello could you please share an object that has the problem?

Hi moonboots, I've added an image for reference to the post

Yes that's weird, I can't reproduce the problem, could you please share your file? https://blend-exchange.com/

Added the blend file under the reference image

I don't think that there's any problem, it's the Metallic at 1 plus the Coat that makes it look like it's flat because of the reflectivity, it may be not very realistic though

The file is a basic node setup to display the issue. When setting the values to less than .1 in the test file there are still lines visible so I don't think this is the solution.  The original shader in another file had more appropriate values in the normal map but that was when I noticed the issue. Weirdly enough, the shader was appended from another project and was completely fine in that file.

could you please share the other file you are talking about?

Also, remember that it is a bump map, not real 3D, if you subdivide your object and give it a Displace modifier it won't look flat, bump and normal map are limited in terms of realism

Unfortunately I can't post the other file as it's too large and also work for a client.
I understand that this is a bump map. The shader in this image is for test purposes to display the issue I'm having. Even when I subdivide the mesh further it is still flat if there is a normal map applied. I've never had this issue before when using normals and I can't figure out why it's happening.

Subdivising the mesh won't change anything for the bump map, I was talking about giving it a Displace modifier, here you see that it won't appear flat

Make it slightly less black and it will work better

This isn't flat shading, it's just wrong shading.  You are sending it normals that don't make any sense-- not normalized, no relation to existing tangents-- and so when you use those colors as a normal map, you end up with normals that don't make any sense.  The edges become visible because tangents change at edges.  If you want more info, I'd recommend learning more about how tangent space normals work.


text:
RayCast seems to sometimes hit mesh in Blender 2.69
I would like to check if my camera has line-of-sight of an Empty, and I need to use Blender 2.69 although I only have 2.78 on my own system. I'm using ray_cast to determine line of sight, and it appears to work in 2.78 but not 2.69! Here's my process.
For Blender 2.78 I open up my .ply file and import the mesh, and then load in both where I'll put my camera (camera_location) and where I'll put the empty (empty_location). I don't actually create any objects just yet. Then, I use the following code to detect line-of-sight.
direction = empty_location - Vector(camera_location)
(ray_hit, location, normal, index, obj, matrix) = scene.ray_cast( camera_location, direction )

And it will hit the mesh and return the expected values.
Now in Blender 2.69, I use a the same process, but invoke ray_cast differently because it is parametrized differently:
(ray_hit, obj, matrix, location, normal) = scene.ray_cast( camera_location, empty_location )

And sometimes it returns the expected values. Other times it seems to miss the mesh altogether and just returns ray_hit=False, location=<Vector (0.0000, 0.0000, 0.0000)>
Does anyone know why this could be and ideally, a solution?

I suspect that the problem is that the cast ray stops at end. In some cases, precision errors might cause the ray to stop before actually hitting the mesh. In my case, making the ray go twice as far solved the problem. Use
direction = empty_location - Vector(camera_location)
(ray_hit, obj, matrix, location, normal) = scene.ray_cast( camera_location, empty_location + direction )

for Blender 2.69


text:
How to get the pitch of a point relative to the camera's plane of rotation with Python API
I'd like to get the inclination of a point from the camera's plane of rotation (defined by the local y-axis).
The code I currently have to works sometimes, but not always. It works when the camera is at the global origin, but not always otherwise. Here I have a point of type Vector, and a camera.
import math
camera = ...
point = ...

point_in_local_coords = ( camera.matrix_world.inverted() * point )
angle_to_normal = Vector( (0,1,0) ).angle( point_in_local_coords )
angle_to_plane_of_rotation = math.pi / 2. - angle_to_normal

In particular, I have
point = Vector( (-1.8580, -0.9115, 3.6539) )
camera.location = (0.104775, -2.752501, 1.390733)
camera.rotation_euler = Euler( (1.5293482542037964, -0.022381655871868134, -0.09930113703012466), 'XYZ' )

yields pitch=42.5164 degrees.
I tested whether this is correct by creating an empty at the location of point, and varying the camera's field of view until the empty is in frame. Since the empty is not in frame when the camera's FOV is 96 degrees (> 42.5 * 2), I know the true pitch must be larger than the one I calculated.
My question is, what is the correct way to calcualate the pitch of a point relative to the plane of rotation defined by the camera's Y axis. Bonus points if you explain where I went wrong :)
Version info:
Blender 2.78 (sub 0)
build hash: 0b13b7a

--------UPDATE---------------
Problem solved. I didn't consider that the elevation of a point from the camera's plane of rotation is constant, but that the apparent pitch will vary as the camera rotates. In my case, the FOV can shrink as the camera approaches the point, and must grow as it rotates away. This is a 'duh' thing, but that's what I forgot about. So my testing procedure was the problem :o
Both the suggested method, the initial method, and a myriad of other ways work - so I've accepted the proposed answer. Thanks for your help!

Compute the distance between the camera and the point projected onto the plane, i.e. d = point_in_local_coords.xz.length. Then compute the angle using a = atan(d, point_in_local_coords.y).
For bonus points: where you went wrong is the assumption that the angle you want to compute is unaffected by the point's local x and z coordinates.
PS: I'm typing this on my phone, without Blender to test, so I might have a typo in my math somewhere.

Thanks for pointing out point_in_local_coords.xz! I did not know about that, and it's a good tip. Testing this out yields the same answer of 42.5, but the FOV method suggests the true answer should be something between 43.5 and 44 degrees.
However, I assumed that you meant a = atan( point_in_local_coords.y / d ).


text:
Displacement inverted with Cycles and Eevee with a regular Displacement node
Eevee and Cycles inverts the Displacement.  It didn't do that before. I suspect there is a setting somewhere that fixes this.

Take any displacement map and displace it in Cycles.

Now if you go into Eevee its reversed.

If you turn it around it looks normal.

Displacement doesn't work for Eevee, only for Cycles, also it's not supposed to be plugged into the Surface input of your Material Output

@moonboots I guess he uses the Surface output as a kind of viewer node (which does work if he does it like that). However, I cannot reproduce it, in my Blender 3.2.2 they both look the same. Only that in Eevee nothing gets displaced of course.


text:
I need help with the lighting of my project!
My scene lighting works fine in the render preview but as soon as I go to do my final render it comes out as being too dark. I've tried everything, I've looked through all the lighting settings and my shaders! This has never happened in any of my previous projects. Will share file if it makes it easier to solve the problem!
This is an image of render preview

This is an image of the final render

Finally this is an image of a cube in the same exact blender file, the point light's lighting along with other lights seem to work. The only lighting in my scene is that of a HDRI which isn't showing up in the post render.

finally (the part that confuses me the most) is that when I add a point light near my ocean modified object the lighting doesn't work which makes me think there is something wrong with my shader

There is quite literally a light next to the water at 10000w but it is still dark, also finally finally when I turn off HDRI in render preview the point light doesn't work which really confuses me!

Hello and welcome. As it stands this question is unanswerable and was put on hold for lack of essential details to understand the issue. Risking stating the obvious, only you have access to your scene, so unless you describe it thoroughly you alone know your exact setup, settings and what steps you took to arrive where your are now. Describe the issue in detail, add images of relevant settings and user interface, with the [edit] button above. Don't post comments or ask a new question, editing will automatically queue it for reopening review.

Yes, a file might help or at least some screenshots of how it looks and the settings etc. There are so many possibilities, starting with objects having different settings for viewport and render, being visible or invisible in viewport and render and so on that simply saying, the render is too dark and you've "tried everything" is not really a good starting point for troubleshooting on our side.

I added some more info, if anyone needs a screen shot of any particular settings just ask and if anyone wants me to share blender file it would be cool if you told me how to and I'll do it

Hello and welcome. Did you actually add an HDRI to your world nodes or are you using the build in HDRIs?  Also, try this https://blender.stackexchange.com/questions/200646/point-light-in-blender-2-90-1-not-working/200652#200652

Oh my god the answer was so simple such a rookie mistake thank you so much it works now!!

@HrishikeshSudheer What was the answer? It would be great if someone could write it here in the Answer section...


text:
Mix pbr materials in texture paint mode
I have two textures, each with an albedo and a roughness.
Let's name them A and B.
i have a source image texture_A_albedo.jpg texture_A_roughness.jpg, texture_B_albedo.jpg, texture_B_roughness.jpg
I'd like to be able to use them in texture paint mode to blend them on an object (stencil mode) and take advantage of all the brush blending modes. Paint where I want texture A and where I want texture B and have it do the same operation on the roughness (with same brush strokes)so that at the end I get a texture_Object_albedo and a texture_Object_roughness.
I haven't found a tutorial on how to do this. Is this possible?
i hope my question is clear enough :)

So you want to repeat the same brush strokes on two separate textures by applying different brush textures as stencils in the process? Please provide some examples of what you want to achieve in the form of screenshots or diagrams. This will increase the chance of getting a correct answer,.

@RumenBelev Yes, I'd like to reproduce what I did with the albedo on a roughness texture so that where I put the albedo_A I can have the roughness_A and so where I put the Albedo_B I can have the roughness_B associated. It's not just a question of mask, as I'm in stencil mode mapping, I can scale, translate, rotate, etc...

Have you considered a stencil image between the two shaders as a mix shader input and starting with texture A as all visible and then paint the stencil to reveal texture B?  This seems to be the only way to do this unless you are painting on an RGB image and using the separate RGB node as a split for stencil.


text:
How do I get all classes of an object / instance via code
As an example for what I mean, the official Blender API says that the "modifiers" property of Objects has two classes:
bpy.types.ObjectModifiers and bpy.types.bpy_prop_collection
Additionally, bpy.types.ObjectModifiers has bpy.types.bpy_struct as its base class, which means the "modifiers" property has three classes in total.
My Question is: What code snippet can I use to find all the classes a specific object/instance has?
I found several different commands to get a class of an instance, but none of those manage to get all classes, which is what my actual goal is.
Simply using multiple of those command lines probably isn't guaranteed to work with every instance.
For reference, these are some of the commands I found while researching, together with their outputs:
>>> mods = bpy.data.objects['Cube'].modifiers

#what I'm searching for:
>>> somefunction(mods)
(<class 'bpy.types.ObjectModifiers'>, <class 'bpy_prop_collection'>, <class 'bpy_struct'>)

#what I have:
>>> type(mods)
<class 'bpy_prop_collection'>
>>> mods.__class__
<class 'bpy_prop_collection'>
>>> mods.rna_type
bpy.data.objects['Cube']...Struct
>>> mods.rna_type.identifier
'ObjectModifiers'
>>> mods.rna_type.bl_rna
<bpy_struct, Struct("ObjectModifiers") at 0x00007FF6C55D5080>
>>> mods.bl_rna
<bpy_struct, Struct("ObjectModifiers") at 0x00007FF6C55D5080>

Also, even if I figured out that it has bpy.types.ObjectModifiers as one of its classes, I cannot get __mro__ to show me the bpy.types.bpy_prop_collection class, only bpy.types.bpy_struct:
>>> bpy.types.ObjectModifiers.__mro__
(<class 'bpy.types.ObjectModifiers'>, <class 'bpy_struct'>, <class 'object'>)

The classes don't actually need to be callable, their names would be enough.

AFAIK you can't access it https://i.sstatic.net/r3h4g.png

but type(mods) does give me <class 'bpy_prop_collection'>
I don't want to call the classes somehow, I just want to find out their names

You can get their names via rna: https://blenderartists.org/t/how-to-rebuild-the-add-modifier-menu-layout/ (Can't find the Q&A right now, pretty sure there is a good one).


text:
Nodes, undesired pixel/glitch effect
Newbie here trying to make floor detailed tiles only using nodes.
The problem is that a certain point I get this effect:

I refer to the squared glitches noticeable overall over the shine areas.
If I disconnect the node Color 2 property, this effect dissappears and all goes fine again:

IMPORTANT to know, this happens only when the Render Engine is EEVEE.
I'd like to continue rendering with Eevee while editing the nodes because is much faster, although in the final render probably I'll use Cycles.
So, what can be the reason of this problem I'm having?
Thanks.
Blend FILE:

@RayMairlot thanks for correcting the tags.

Please upload your .blend file to https://blend-exchange.giantcowfilms.com/ and put the generated link in your question by editing it. Without being able to fiddle around it is more of a coincidence on whether we had and fixed the problem ourselves and remember it or not.

@WhatAMesh Thanks, when creating this question I though about attach the file, but then I tried with the possibilty that this were a common problem, with a fast answer. But yes, I agree always will be better including the file.

I discovered that this is a known issue of Blender 2.81. Seems to happen when 4 or more 3d noise texture nodes are used.
Bug details: https://developer.blender.org/T69776
With Blender 2.82 Beta works properly, at least in my case.

Can you mark your own answer as accepted?

Done, thank you.


text:
How to individually scale more than one face?

I hope the images explain what I want to do, because English is not my language.
Here I have more images:

maybe you're looking for the Pivot Point > Individual Origins option on the horizontal menu bar

Activate the Pivot Point > Individual Origins option on the horizontal menu bar of your 3D view.
On your screenshot, the Median Point was the Pivot Point option selected, which means that the scale will take the median point between all your selected faces into account. Individual Origins will only take into account the center of each face or group of adjacent faces. And so on, if you select 3D Cursor, it will be the pivot point of your operation...

Perhaps some form of  explanation would be handy here. Eg the result in Q is using median point. In the example with discrete unconnected faces each face will scale about its individual center (as I believe desired by OP) however could be worth noting  this changes if the faces are connected.

ok, edited, tell me if it's ok