text:
How to get global rotation of a bone with respect to global planes of axis via python?
I'm simply trying to find the global rotation of a bone in pose mode using python
i.e. what angle a bone makes with the global axis?

The closest I've come is:
for pb in context.selected_pose_bones_from_active_object:

    pb_world_matrix=armature.matrix_world @ pb.matrix
    loc, rot, scale = pb_world_matrix.decompose()
    rot= rot.to_euler();

    print(pb.name,"x=",math.degrees(rot.x),"y=",math.degrees(rot.y),"z=",math.degrees(rot.z))

Edit:
let me explain what I mean with an example:

As you can see in the gif above, initially the angles are:
x_glob= 0deg
y_glob= 0deg
z_glob= 0deg

then I first rotate it by 38deg on global y orientation then I rotate by 41.3deg on global x orientation so the final output should be:
x_glob= 41.3deg
y_glob= 38deg
z_glob= 0deg

I think a better way of looking at the problem is finding the angle made with the planes of global axis (I couldn't find the wording to phrase it till now)

In your example you don't show any parenting, so bone's local rotation is also global rotation... Except Y and Z are swapped.

@MarkusvonBroady I didn't want to make the question too complex & confusing so I didn't add that part, but when I meant globally I meant the rotation regardless of parenting

You can't do this.
Why? It is because you have converted rotation from quaternions to Euler angles. That's basically means, that you have dozens of variants to have the same rotation using Eulers. Let me show the example:
Here are 2 figures rotated same way, but, first one has rotation 90,90,0:

second 180, 90, 90

As you see, you can't get initial transforms of the object.
Using rot.to_euler(); gives you one of the variants. But you may get something different, that you have expected.
Of course, you have some initial rotation values, but it's hard to convert them to global without using a transform matrix. And when you put values in the matrix, there is no way to return them back unchanged.

I had a feeling that might be the case, that's why I modified the question and added planes, finding the rotation with respect to planes would achieve what I'm looking for, sorry for phrasing the question poorly initially

It's not really hard, you need to iterate over parents and rotate by negated Euler rotation components in reversed order.

@MarkusvonBroady I'm not sure, you have missed possible scaling.

@Crantisz scaling won't affect rotation, unless of course I don't understand the OP.

Uniform maybe yes, but not uniform affects

Can you show an example of scale affecting rotation?

@MarkusvonBroady https://www.screenpresso.com/=aWOgg

I had a little look into it but I'm not an expert. Discovered you can get the matrix world of the selected bone using pb_mw = pb.matrix. Then using pb_mw.to_euler() you can obtain the euler rotation from the matrix. The only catch seemed to be that a bone at rest position in the interface (x,y,z rotation at 0 degrees in the UI) is actually at 90 degrees on the x axis in the world matrix. Happy for further input on this.
import bpy
from math import degrees

context = bpy.context

for pb in context.selected_pose_bones_from_active_object:

    pb_mw = pb.matrix
    pb_rot = pb_mw.to_euler()

    print(f"pb matrix world: {pb_mw}")
    print(f"x rotation: {degrees(pb_rot.x) - 90}")
    print(f"y rotation: {degrees(pb_rot.y)}")
    print(f"z rotation: {degrees(pb_rot.z)}")

# Test on empty
# empty = bpy.data.objects["Empty"]
# empty.matrix_world = pb_mw

Edit: related answer here... Get bone rotation in pose mode using Python

I don't see how this gives you the global rotation?

The pb.matrix is the matrix world of the bone which has the global rotation in it... you simply use .to_euler() to extract just the rotation part of it.

that does not give me the global rotation i.e. what angle a bone makes with the global axis?

@cakelover you might need give some more details about what angle you are trying to calculate exactly, because the matrix world does give the global rotation as far as I can see?

I've added an example, does that clear it up?

Yes, doing some more testing I can see that the UI rotations in pose mode are different to the matrix world rotations in python which is confusing... bones seem to have an up axis of Y in pose mode (instead of Z, not sure why this is), so the rotations in the UI are calculated different... but the matrix world rotations are correct for the global world space which you can see when it's applied to an empty.

Also keep in mind parenting can modify head/tail positions of bones in Edit Mode.

If you want just the global rotations with Z-up (eg. to apply to an object) than you can calculate them this way... if you want the global rotations relative to the bones Y-up orientation I'm not sure how to convert it sorry.

I think I've found a solution
import bpy
from bpy import context
import math
from mathutils import Matrix,Vector

unit_x=Vector((1.0,0.0,0.0))
unit_y=Vector((0.0,1.0,0.0))
unit_z=Vector((0.0,0.0,1.0))

for pb in context.selected_pose_bones_from_active_object:

    axis, roll = pb.bone.AxisRollFromMatrix(pb.matrix.to_3x3(), axis=pb.y_axis)

    x_angle=Vector((pb.vector.x,0,pb.vector.z)).angle(unit_x) #angle made with x plane
    y_angle=Vector((0,pb.vector.y,pb.vector.z)).angle(unit_y) #angle made with y plane
    z_angle=Vector((pb.vector.x,0,pb.vector.z)).angle(unit_z) #angle made with z plane

    print("angle with plane x:",math.degrees(x_angle))
    print("angle with plane y:",math.degrees(y_angle))
    print("angle with plane z:",math.degrees(z_angle))
    print("self roll:",math.degrees(roll))

added a little roll bonus in there


text:
Denoising kills it all
I have been looking for some smart solution but after couple of hours I am done.
How can I save those grainy details, that in fact are noisy, from being smudged by denoiser? I am working with cycles, SID/Optix - same resultat.
For those renders I have been trying with super denoiser, set up pixel filter on 1.5, then 1.0, then 0.7, then 0.1 and 0.05 finally - it all ends up smudged and blurred, no matter of settings (SID - on the right, grainy texture - on the left).
Have been trying with 4k resolution and with super high sampling (like 3000), but it still gets blurred :/
Do you have any smart ideas of how to preserve textures like that? I mean, those based on noisy/musgrave procedural nodes. I am trying to improve my exterior archviz and those walls turns me mad, as they always end up plastic because of blured and ereased imprefections (like this grainy plaster).
My compositor (SID+color balance) and material(simple PBR + musgrave displacement):

It's tricky because a de-noiser's job is to reduce noise - which includes noisy textures sometimes. If worst comes to worst., you could do a couple of different render passes and stitch them together in the compositor. Use a Holdout node in place of your plaster texture (same material), and render. Then, disable or delete everything but the plaster, re-attach the texture (replace the holdout) and do another render on just those walls. Without the rest, you should be able to render with a sample count high enough that you don't need denoising, without too severe performance issues.

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.

I'd like to see screenshots of your compositor node setup and your material setup if I may.  I think my answer addressed the wrong issue.  Are you're talking about the noise on the window glass, not the building, or both?  Do you want either?

@MartyFouts am gonna uptade post in a moment with my compositor setting and material, but compositor is based mainly on what SID has to offer.  Material on the other hand is basic PBR texture (just a color + sliders) with musgrave node pluged as displacment map.
/ChristopherBennett I am pretty bad into render passes, truly speaking I am barely making my first steps into operating them. As much as I do understand the way of doing that you have described to me, ain't there anything simplier?

source: Stack Exchange

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

sort: votes


text:
I can't use paste flipped in the animation
I imported a Mixamo 3D model to make an animation with the model and rigging ready, but when I try to use paste flipped on the legs, the keyframe stays the same as the original.
Here is a video of the problem: https://youtu.be/lABRgLMQWlg

hello, have you checked the bones name? maybe share your file: https://pasteall.org/blend/

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.

Hi, i'm not sure but i think the bones name is right. I uploaded my file here https://pasteall.org/blend/f655de94f41d4b0ea9c91b65fd80d636
Thanks for the help :D

To Paste Pose Flipped you need to have bones that have the same name but with the opposite suffixe, and you need to use _Left/_Right, or _L/_R or .L/.R.
For example lowerleg_L/lowerleg_R
It's not the case here, your bones don't have the same name and don't have any suffixes.

OMG it worked!! Really needed to rename the bones. Thank you my friend

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


text:
Help i get this error RuntimeError: Operator bpy.ops.wm.alembic_import.poll() failed, context is incorrect
Can't seem to get this script to work please help.
I think it's got some thing to do with opening a blend file and it not being able to carry on with the script.

import bpy

bpy.ops.wm.open_mainfile(filepath="Z:\\Projects\\Test\\blend\\template\\template.blend", filter_blender=True, filter_backup=False, filter_image=False, filter_movie=False, filter_python=False, filter_font=False, filter_sound=False, filter_text=False, filter_btx=False, filter_collada=False, filter_alembic=False, filter_folder=True, filter_blenlib=False, filemode=8, display_type='DEFAULT', sort_method='FILE_SORT_ALPHA', load_ui=True, use_scripts=True)

bpy.ops.wm.alembic_import(filepath="Z:\\Projects\\Test\\abc\\A\\box.abc", relative_path=True, as_background_job=False)

bpy.ops.wm.save_as_mainfile(filepath="Z:\\Projects\\Test\\blend\\A\\A.blend", check_existing=True, filter_blender=True, filter_backup=False, filter_image=False, filter_movie=False, filter_python=False, filter_font=False, filter_sound=False, filter_text=False, filter_btx=False, filter_collada=False, filter_alembic=False, filter_folder=True, filter_blenlib=False, filemode=8, display_type='DEFAULT', sort_method='FILE_SORT_ALPHA', compress=False, relative_remap=True, copy=False, use_mesh_compat=False)

Please add  a screenshot of the actual error message to your question.  Also, if that's only a section of your python code, please include all of the relevant bits.  As a guess, your problem is that you're not escaping '' (backslash) characters.  Either change you filepath strings to have \ everywhere you now have \ or put an r in front of the opening double quote.

Added the image, I can run each line on it's own but the moment I open a scene and the import it gives me issues.

Dupe, different operator, same issue.  Can copy the text of an error message from system console and post as text.  (in a code bleck) https://blender.meta.stackexchange.com/questions/2788/policy-on-posting-code-error-message-etc-as-images?r=SearchResults&s=1|28.0449

Sorry, I wasn't aware. I was read screenshot and did exactly that.


text:
put color to bvh and render

I imported a BVH file, but I can't find the coloring option. How do I add color to it？

And what steps do I need to take if I want to get the image above? Do I just set a white background? I'm not sure how to set a pure white background.
I changed the color and rendered but the there is nothing in the image? Why the bones disappeared？

Does this answer your question? Is it possible to render an armature? -> "Blender doesn't support rendering armatures, this is intentional and there is no plan to add support for this feature."

In this case prob sufficent to  change the pose bone colors, hide stuff like the grid, via overlay , select all armatures, enter pose mode and render viewport   https://docs.blender.org/manual/en/latest/animation/armatures/properties/bone_groups.html#color-set

I followed this link about bone groups and successfully change the color! Thanks!

I also tried the Armature to mesh add-on but it didn't work...

Added an answer to dupe, based on comments above.

@DuarteFarrajotaRamos was a bit twixt and between answering dupe or voting to re-open this one. Ended up answering dupe. VP render may be a viable option here, where as dupe q stipulates no VP render.

@batFINGER Indeed, if it does require shadows, but it is a nice workaround nontheless. Thanks for updating the script on the other answer though, always nasty being pointed to a dupe with code that doesn't work

@batFINGER  I'm sorry maybe I have a problem with my presentation. (My English is poor... I mean I tried to install this add-on but I can't use it. I'm not familiar with how blender works.


text:
Scale object along surface towards pivot for hair growth effect
I am trying to achieve an animation effect of a character's hair growing out to it's final form. The hair is basically a bunch of curved hair card strips and it seemed like the best way to achieve the effect was to make a blendshape and just scale the geometry along their original path. I could achieve the effect I'm looking for by manually moving all the edges of each strip towards the "source" but that would take ages. I have a potential idea for how a script could pull it off, but before I dive into that I figured I should check and see if there's an easier option that I'm just missing.
Here's a simple image to help illustrate what I want to do. I want to "shrink" each polygon along the (poorly draw) curve towards the "pinned" edge

Edit: Here's what the hair I'm using looks like currently

Are the cards 'live' deformed along curves using a modifier, or fixed? Are they UV mapped? Maybe you could use a shader?

It may or may not suit your case simply to use an extrusion of a curve, rather than deformed geometry? You could use the Data tab > Geometry panel > 'End Mapping' of a curve with multiple splines to grow ribbons:

There are other more flexible options, maybe using an actual Hair particle system.. but this is simple..

That's certainly a great idea for the future, but alas won't work in my case as the hair I'm working with is already completed and needing to remain the same in terms of vertices count...

@GiantDwarf010 Is the hair already curved? Could you share a sample?

sure, I've edited the post to have the hair. It's a pretty complex model but other than the skullcap, it's all a series of polygonal strips


text:
Bevel modifier breaking at large angles
I hope someone can help me here. I am a graphic designer and pretty new to Blender. I am trying to mockup a box in blender that I can apply my artwork to. I have imported the dieline in via DXF and added a solidify modifier and a series of bevel modifiers (controlled by vertex groups). I have then added some armatures to the mesh to control the flaps. This is working pretty well until I rotate the flap to 90 degrees, then the bevel breaks. Can someone tell me what I'm doing wrong here?

Upload your blend file here: http://blend-exchange.giantcowfilms.com/

@Luciano thanks for that, I have changed out the link in my original post above.


text:
Why is my bevel modifier tearing my geometry at the corner?
I have been battling a problem which I need some help figuring out. I have been using Blender to fold up box dielines, and I keep running into the same problem. Basically when I add a bevel modifier, it is breaking at the corner of the fold. I've tried a few things including adding more geometry and increasing the distance from another fold and nothing seems to help.
Any tips or tricks would be hugely appreciated.

After some experimentation, it seems that the bevel doesn't like an angled endpoint. I added some extra geometry and squared off the end and it works much better now – not perfect but much better.
Note: blue lines show bevel weight set to "1", all other lines set to "0".

If I understand it correctly, the main goal here is to deform an object with an armature. At the moment you are trying to shape some object to have a realistic form after the deformation by adding bevel after the armature. Consider a more traditional approach of having the topology right for simulating the correct deformation in the first place so you don't need any bevel modifiers at the end. That will require modelling correct topology that can be deformed in the desired way and you will need to paint/create weights correctly. That's a more usual workflow for things like this.

Thanks for your response. I tried reordering the modifiers to have the armature last, but it didn't help. I think the problem I was experiencing was a quirk of the bevel modifier, where it seems to need a square end to work nicely.

You misunderstood what I was trying to communicate completely. I am not suggesting to just switch modifier order. I am suggesting to model the topology required for a more complex deformation. The bends "overlap" in that corner so more complex transition from one to another would happen if something was bent this way, possibly stretching the material or reducing the bend near the corner.


text:
How can I disable texture tiling on the x axis, leaving only the y axis?

Hi. I can't find a solution to an elementary function for 2 days.
Can you help me?
How can I disable texture tiling on the x axis, leaving only the y axis?

it's not clear to me from your sketches what you want to achieve. The way I understand it, after disabling the horizontal tiling, most of your mesh would be solid black, because it would go outside the $x$ ($u$ in the UV space) range of the image.

It depends how your object is mapped. If its mapping is nicely aligned to one of the axes, you would just take some function of that axis to map a range, or a series of ranges, from 0-1 in that axis.

Here, in the simplest possible example, the image fills the 0-1 UV space, is scaled to 0-5, X and Y, in the geometry's space, tiled. The X range from Value to Value+1 is mapped from 0-1, and clamped, so everything to the left is 0 and everything to the right is 1.
Changing Value maps different X-ranges from 0-1:

..moving the column of texture-repeats.
If your case is more complicated, maybe you could share your file on https://blend-exchange.com/

There's no automatic way to prevent that, but you can easily do what you want to do. Select the faces where you don't want to see your pattern:

Then scale down their UVs in the UV Editor and move them until it's over the background and not the pattern anymore:

Unfortunately, this will not solve the problem. It doesn't matter what to scale, texture or polygon. Since the tile is square, the scaling also takes place in a square. I need to get a small drawing and, accordingly, in any case, the repetition of the texture along the x-axis will occur. But I don't need it.
In the case as you advise, you need to split the polygon into another subdivide, and this is also not necessary.

is it possible to somehow disable the repetition on the x axis through the nodes?

Maybe but I'm not able to do it, maybe someone will know

Decision. I used standard stitch tiling on both axes and a vertical mask without tiling.


text:
Text color looks normal until i render it
The text of my intro had a normal color until i rendered it. The color was all of sudden darker than usual.

hi please provide more details, add some screenshots or upload the blend file

if you know how to fix it pls help me

well there should still be more information in the question . search for "Final render looks different than preview" see if you find a solution. also look at questions and what screenshots and details you should add

sorry im using this wbsite the first time i dont really know what should i type and add

its ok take your time. in blender there are some options for previewing the scene . look at the top right corner you see 4 little spheres final render is closest to the last one . from left to right hover over them you see wireframe , solid , material , render , if material and final render are different its because if lighting you need more lights

Hello and welcome. Did you add lights to your scene?

@mma78 how do i add more lights? im pretty new at blender, and what do you recommend to be the file format.

press Shift +  A and from light category select a sun or something ot you can go to to world properties in properties editor usualy at the right of the window and change the entire scene color to a lighter value

yessss finally thank you so much man i appreciate it <3


text:
Planar faces issue
I am designing a climbing wall. I use sketchup mostly and today is the first day I downloaded blender, pretty excited. Here's my questions:
I can't seem to make the faces in my climbing wall mesh of faces from sketchup to be planar. I want to take my messy sketchup mesh of a climbing wall which has too much triangulation of tris that are all on different planes, I want to take the mesh of different angles tris and calculate all of the surfaces that should be single planar quads and not two triangles to be planar quads. Meaning making the faces planar would take the whole mesh and try not to distort it much. I'm not looking to make the whole object planar as one flat plane, just want to simplify the mesh and remove a lot of the triangles. Can you please guide me to the best way of doing this? I know a fair bit about modelling and from my understanding I might not be able to do what I'm asking but I hope it's possible. I just want to simplify my mesh and make more faces planar.
The one face has many triangles, but I want to make a lot of the triangles in general dissapear.

Can you show us some screenshots of that topology you need to change? Because there is a simple command, go to edit mode, select all faces, press F3 and search for Tris to Quads... This will transform all tris to quads but it won't work if your topology is so much triangulated that Blender won't be able to calculate how to make it into quads... that's why we need to see what your problem is

What MikoCG suggests, won't make the internal triangulation of newly formed quads coplanar. That is, Blender doesn't enforce all vertices of a single face to sit on the same plane. In order to makes two triangles co-planar, you need to rotate one of them - which is likely to also rotate and stretch connected triangles, including those you already aligned, by making them not coplanar to their "sibling" again.

Thanks for getting back to me you guys! I need all the help I can get. Yea here are some screenshots. So what I want to do is just make selected faces planar without effecting nearby faces too much and I can go around and make everything planar how I'd like to. Any suggestions for that? The real problem is that I wonder if I make two selected faces planar, if other faces will now be out of alignment, being a constant battle..... I'm not looking to draw this entirely manually, maybe some of it redrawn in blender, because I'm doing all of my drawing in sketchup first and usig blender to clean it

I'm not sure I understand your question. You can certainly select two adjacent triangles and join them into a quad, but if the faces  are at a large angle to each other it won't work. Also if the surrounding vertical aren't close to planar, it'll have to affect them. I feel like there's something missing.  With regards to the one face with lots of internal triangles, you're better off deleting that face, merging the extra verts to the corners, and then use Fill hole to recreate the face.

Ok thanks Dale! Is it possible to create planar meshes from scratch in blender? So I would just recreate this climbing wall in blender as as quad mesh? And when I move the quad mesh in different directions, I would retain quads and not get triangles, or many triangles. If this is possible, creating a planar type mesh I can manipulate in blender, could you link me to a good tutorial!! Thanks so much for your help so far.


text:
Can I get the "total height" of a curve in Blender?
I want to get the cumulative height difference of a curve, preferably using geometry nodes.
For example, if one curve goes from 0→100m Z in a straight line and another goes from 0→100→0→100 (i.e. twice fom 0→100), just getting the bounding box would in both cases give 100m, but the second curve has a cumulative Z increase of 200m that I would like to get.
How would I go about getting this value?
I am thinking to use resampling of the curve to, say, 1m steps and then check for positive Z changes between all the points, worrying about the curve direction later. I am still trying to wrap my head around how to operate on points and do not know where to start, but I suppose it involves comparing consecutive points somehow.
Solved: Adding to the solution provided by Chris. I think I reduced it to the bare minimum without messing anything up. It misbehaves if object origin is below the spline of the curve, but otherwise seems to work perfectly.

did you try using accumulate field node? it adds up all the values within a group and you can take the total.

Thank you for the help! Looks like that method was what Chris also used.

what about this node setup?

of course, depending on your chosen count, your result will be more or less accurate.
result:

Thank you so much for writing that up! It looks like exactly what I want.
What is connected to the first math/add node at the far left?
I have tried to recreate the setup you show but, missing that input, I am unable to recreate the results.
I will go through the node documentation and try to break down the setup so I can understand it, but if you don't mind I'd also be very happy if you could describe the setup. I assume that it is summing the difference in Z value of adjacent points, pair-wise, - but I am currently at a complete loss to understand what is what.

oh, i am sorry, it is just the index node


text:
New Spot Light behavior in 4.0 no longer renders in a volume
I have a model of the Abyss Cab 3 Mini sub. The model has a number of spotlights that cast a beams in a volume. It all works in 3.6 but in 4.0 all my spotlights are broken and don't work like the old spots. How do I get the 4.0 spots cast a beam rather than a circular glow that encompasses the whole fixture. this is not the way spot lights work. They cast a beam in a single direction and virtually no light in the opposite direction. 4.0 breaks every undersea model I have because of this lighting change.

Welcome. Please use a title that matches the content of the question. It should be descriptive but succinct, unique and identifying, summarizing the issue in such way that anyone searching for a similar problem may easily find it. Use the [edit] link above, remove anything superfluous, avoid words like "this","issue with" or "question about". Remember, your title is the first thing potential visitors will see, answers you get depend heavily on how inviting it is. See "What is the problem of asking “How do I do this?""

Well, they seem to have changed the spotlight in version 4.0 as this question came up here before recently > Spot Light size in principled volume Bug in 4.0 and this might be unfortunate but not an issue for this site, because if this is not supposed to be like that it's a bug which should be reported via Help > Report a Bug or - if this behavior is intended by the developers - then users should inform them that this is not desired. But since we are only Blender users ourselves and not developers, we cannot do anything about it.

I originally voted to close this question as rather being a bug or even intended behavior which makes this question off-topic for this site.
In the meantime I found out the spotlight is actually intended to work like that now and at least in the 4.0 Blender versions there will be no change to it. The googd thing about the new spotlight is, it respects the given radius better than the old one.
However, for everyone who wants to replicate/substitute the previous spotlight behavior, here is a workaround:
Instead of using the Spot, change the light to Area instead. Change the Shape to Disk and the size (since this represents the diameter now, not the radius) to twice the size as it was before. Under Beam Shape, the previous angle for Spot Size now needs to be set as Spread for the area light (the default of the Area light is 180°).
Unfortunately the area light seems to be much much brighter than the spot light. In the volumetrics, a Power of 30 - 50 W seems to have a similar effect like a Power of 1000 W on the area light.
So this is not a perfect equivalent of the old spot light, but at least a usable workaround.
Here are some comparison images, first of all the previous spot light in older versions:

And this is what you are experiencing now in 4.0:

This is what you can get with an Area light, as you can see it is much brighter:

This is the same with a reduced Power value of 40 W:

There's also a YT video about lighting in 4.0 here.

@JohnEason Yes, I know the video, but this just deals with how the new light linking works, it's not about how they changed the light objects themselves.


text:
Workflow for 2.5D pixel art texturing
I'm working on a game that is supposed to look like Octopath Traveler. So I need 3D models with pixel art textures. But I'm having a lot of trouble figuring out the texturing part.

I can unwrap the model, export it and paint a pixel art texture on photoshop. I'm sure that would work, but from my understanding, that's mostly used for unique textures (like characters and such). But, for example, let's say I'm working on a "brick castle texture", that is supposed to be used all over the place. I might use the bricks for the castle facade, interior, a bridge nearby, a pillar, etc. If it was just one texture though, it would also be easy, I just make a tileable brick texture and apply it. But I need more than just one image - there should be painted windows, details, like in the image below. For this, I believe the correct approach is to use texture maps/trim sheets, right? There's an example of what Octopath uses below.

Ok, I can do that. But how do I map my unwrapped UVs to something like that? If I manually change my faces to fit into that texture, it'll look stretched. And I won't be able to maintain consistent texel density (or pixel size, let's say). If I use something to set the texel density, then I have no guarantee my UVs will match with the drawing in the texture. And like... let's say I have a brick sample that is sized like in the image above. Do I have to model with that size in mind? What if I just wanna fill a big wall with that texture? What if the face is a bit smaller and won't fit? I had the impression I could just drag and drop a brick texture and have it fill whatever face. But maybe I'm wrong and this is absolutely not how it's done? Or is it? I'm confused. And even then, what's the big idea, to manually drag each face manually to the correct place? I have no idea what this workflow is supposed to be like.
Just making it more visual and clear: how do I take this

And make it so this is a different type of brick

And these having pixel art windows

While using a modular texture map or trim sheet to use them across multiple objects. With the added detail that it's pixel art, and that the pixels need to stay at a consistent size. Or maybe I'm misunderstanding everything and this is supposed to be done in a completely different way?
Sorry for such a long question that might demand a long answer. I'd strongly appreciate any help. Thanks a lot in advance!


text:
Why do my rigid bodies randomly activate?
I just wanted to make a little rigid body simulation where a house explodes. But everything activates before it is ready. I have no idea why this could be happening. I am pretty bad with Blender so it might be something on my part.

please provide blend file so we can check it out

i can't it won't let my put a file

Use the https://blend-exchange.com/ link to upload a file and then past the link into you Question that you can edit.  I usually have to Save As and reduce the file to what needs to be worked on, as https://blend-exchange.com/ has a size limit.

Animate WHEN you want the Active object to start its dynamics simulation.

select frame 1
In the active element disable Dynamic, and click the white dot next to it (hover over it for the help text)

The white dot changes to a white triangle
Set the Playback frame to the point you want the Dynamic simulation
to start (frame where Sphere hits the house)
In the House Active RB, check the box next to Dynamic and again
click on the Animate Property triangle to its right.

Run your Playback -- that should do it.
You might also want to consider using the Object -> Quick Effects -> Quick Explode in the future, where you'd have the front glass window and parts of the house roof each as an object separate from the house, with sub-object faces that would explode.


text:
Trackpad Proportional Editing
Edit: It was because I was using the Lazy Viewport addon. It wouldn't let me change the size for some reason, but now it's working.
How do I change the area of proportional editing on a trackpad? I've searched it up and it says to use the swipe up and down gesture, but that doesn't work. I don't have an extra mouse anywhere so what can I do? I am on Macbook Air and don't have Page Up and Down keys. And I don't want to have to keep changing the size of the editing in a little menu, it will get really annoying.

While moving part of a mesh in proportional editing, you can see the prompts on the bottom of the screen to increase or decrease the proportional influence:

By default these are the Page Up and Page Down keys.


text:
How do I grab the header in an area?
I want to delete a context of an area except the header but there's no header method inside of bpy.context.window.screen.areas.

According to this page I think show_menus method is the header thing but this one also doesn't belong to the areas class. The structure is so bizzare and complex.
Where is the header method?

I find the manual's Window System Introduction a helpful means of discovering the names of the various parts of the Blender Window.  These part names carry over mostly intact to the Python bpy interface as well.
The main Blender window sub-windows are called areas.  Each area is a container for an editor.  The area container is further subdivided into up to 5 regions, only two of which are always visible: the main region and the header region. The other areas include the toolbar on the right, the side panel on the right, and the last operation panel on the lower left.
You can't have a header without the main region and you can't have a main region without a header.
However, the header is a type of menu and you can create menus that mimic it in full or in part.  These menus can pop up in the main region.  Most of the context menus in the 3D Viewport are submenus of the header menu, for example.

Area is the whole editor. The header area is defined in a special header class. There is usually just one for the header area in each editor. And that class is where you place your content of the header then. Menus, buttons, dropdown menus.
So you don't want an area, but simply the name of the header class.

Is that Header same to bpy.types.Header?

@sniffingdoggo  If somewhere earlier in the code there's a line like from bpy.types import Header than yes it is the same.  (In this case there is such a statement.  Areas are subdivided into Regions.  The header is one of the regions of an area.


text:
I can't scale / resize a mesh from python
I have the following code that I obtained from github. I really am very novice and for experimentation purposes I wanted to add some things, but nothing seems to work. I have seen some videos about python and blender; but after many attempts to use those methods or functions, I decided to come here and ask for help:
I would like to modify the Addon: "View3D > Add > Mesh > Add Spring"
Blender Version: 2.93
import bpy
from bpy.props import *
from math import sin, cos, pi, atan2
from mathutils import Vector, Euler

def make_coil(self):

# variables and shortnames
amp = self.profile_radius
n_verts = self.num_verts
n_turns = self.num_turns
th = self.height / n_turns
ipt = self.iterations_per_turn
radius = self.coil_radius
diameter = radius * 2
two_pi = 2.0 * pi
section_angle = two_pi / n_verts
rad_slice = two_pi / ipt
total_segments = (ipt * n_turns) + 1
z_jump = self.height / total_segments

x_rotation = atan2(th / 2, diameter)

n = n_verts
Verts = []
for segment in range(total_segments):
    rad_angle = rad_slice * segment

    for i in range(n):

        # create the vector
        this_angle = section_angle * i
        x_float = amp * sin(this_angle) + radius
        z_float = amp * cos(this_angle)
        v1 = Vector((x_float, 0.0, z_float))

        # rotate it
        xz_euler = Euler((-x_rotation, 0.0, -rad_angle), 'XYZ')
        v1.rotate(xz_euler)

        # add extra z height per segment
        v1 += Vector((0, 0, (segment * z_jump)))

        # append it
        Verts.append(v1)

Faces = []
# skin it, normals facing outwards
for t in range(total_segments-1):
    for i in range(n-1):
        p0 = i + (n*t)
        p1 = i + (n*t) + 1
        p2 = i + (n*t + n) + 1
        p3 = i + (n*t + n)
        Faces.append([p3,p2,p1,p0])
    p0 = n*t
    p1 = n*t + n
    p2 = n*t + (2 * n) - 1
    p3 = n*t + n-1
    Faces.append([p3,p2,p1,p0])

return Verts, Faces

def create_mesh_object(context, verts, edges, faces, name):

mesh = bpy.data.meshes.new(name)
mesh.from_pydata(verts, edges, faces)
mesh.update()

from bpy_extras import object_utils
return object_utils.object_data_add(context, mesh, operator=None)

class AddSpringObject(bpy.types.Operator):

bl_idname = "mesh.spring_add"
bl_label = "Add Spring"
bl_options = {'REGISTER', 'UNDO', 'PRESET'}

num_verts : IntProperty(name="num profile verts",
    description="how many verts in profile shape",
    default=12, min=1, max=30)

profile_radius : FloatProperty(name="profile radius",
    description="Radius of profile shape",
    default=0.01, min=0.01, max=20.0)

coil_radius : FloatProperty(name="coil radius",
    description="Coil radius measured from center of profile shape",
    default=0.04, min=0.01, max=20.0)

iterations_per_turn : IntProperty(name="num segments per turn",
    description="how many profile segments per turn",
    default=11, min=1, max=30)

num_turns : IntProperty(name="total turns in coil",
    description="how many turns in coil",
    default=8, min=1, max=30)

height : FloatProperty(name="coil height",
    description="Coil height measured from first to last profile
centers.",
    default=0.40, min=0.01, max=20.0)

def execute(self, context):

    verts, faces = make_coil(self)
    base = create_mesh_object(context, verts, [], faces, "Spring")

    return {'FINISHED'}

def add_object_button(self, context):
self.layout.operator(
    AddSpringObject.bl_idname,
    text="Spring",
    icon='PLUGIN')

def register():
bpy.utils.register_class(AddSpringObject)
bpy.types.VIEW3D_MT_mesh_add.append(add_object_button)

def unregister():
bpy.utils.unregister_class(AddSpringObject)
bpy.types.VIEW3D_MT_mesh_add.remove(add_object_button)

if __name__ == "__main__":
register()

Basically what it does is the following:

However, I would like to know what I can do to add some option so that the object is scaled in a uniform way. I would appreciate any help.
I have tried to add in the menu the option to scale XYZ but it doesn't seem to work.
not working:

EDIT
ok guys, I was finally able to solve the problem, with something that now seems so silly and simple hahaha.
I'll try to explain it by taking parts of the code, so just add to the "make_coil" function
# scale
# new line add
v1 *= scl

new class
def make_coil(self):

# variables and shortnames
amp = self.profile_radius
n_verts = self.num_verts
n_turns = self.num_turns
th = self.height / n_turns
ipt = self.iterations_per_turn
radius = self.coil_radius
scl = self.scale

diameter = radius * 2
two_pi = 2.0 * pi
section_angle = two_pi / n_verts
rad_slice = two_pi / ipt
total_segments = (ipt * n_turns) + 1
z_jump = self.height / total_segments

x_rotation = atan2(th / 2, diameter)

n = n_verts
Verts = []
for segment in range(total_segments):
    rad_angle = rad_slice * segment

    for i in range(n):

        # create the vector
        this_angle = section_angle * i
        x_float = amp * sin(this_angle) + radius
        z_float = amp * cos(this_angle)
        v1 = Vector((x_float, 0.0, z_float))

        # rotate it
        xz_euler = Euler((-x_rotation, 0.0, -rad_angle), 'XYZ')
        v1.rotate(xz_euler)

        # add extra z height per segment
        v1 += Vector((0, 0, (segment * z_jump)))

        # scale
        # new line add
        v1 *= scl

        # append it
        Verts.append(v1)

Faces = []
# skin it, normals facing outwards
for t in range(total_segments-1):
    for i in range(n-1):
        p0 = i + (n*t)
        p1 = i + (n*t) + 1
        p2 = i + (n*t + n) + 1
        p3 = i + (n*t + n)
        Faces.append([p3,p2,p1,p0])
    p0 = n*t
    p1 = n*t + n
    p2 = n*t + (2 * n) - 1
    p3 = n*t + n-1
    Faces.append([p3,p2,p1,p0])

return Verts, Faces

so just add this line of code to the "AddSpring" class
    scale : FloatProperty(name="coil scale",
    description="how many scale in coil",
    default=1.00, min=0.01, max=30.00)

nueva funcion:
class AddSpringObject(bpy.types.Operator):

bl_idname = "mesh.spring_add"
bl_label = "Add Spring"
bl_options = {'REGISTER', 'UNDO', 'PRESET'}

num_verts : IntProperty(name="num profile verts",
    description="how many verts in profile shape",
    default=12, min=3, max=30)

profile_radius : FloatProperty(name="profile radius",
    description="Radius of profile shape",
    default=1.00, min=0.01, max=20.00)

coil_radius : FloatProperty(name="coil radius",
    description="Coil radius measured from center of profile shape",
    default=4.00, min=0.01, max=20.00)

iterations_per_turn : IntProperty(name="num segments per turn",
    description="how many profile segments per turn",
    default=20, min=4, max=30)

num_turns : IntProperty(name="total turns in coil",
    description="how many turns in coil",
    default=4, min=1, max=30)

height : FloatProperty(name="coil height",
    description="Coil height measured from first to last profile
centers.",
    default=8.00, min=2.00, max=20.00)

##new code line
scale : FloatProperty(name="coil scale",
    description="how many scale in coil",
    default=1.00, min=0.01, max=30.00)

def execute(self, context):

    verts, faces = make_coil(self)
    base = create_mesh_object(context, verts, [], faces, "Spring")

    return {'FINISHED'}

Source Code from github that works in 2.7 or 2.8 blender

You need to modify either the routine make_coil that actually calculates the coil or the routine create_mesh_object or even the execute routine to use the preset scale information you added.

I appreciate your answer but I really do not understand that I have to modify it to make it really work, I would appreciate your help, even more please Thanks

try to use the script addon_add_object in blender template menu.
with a scale property and inheriting AddObjectHelper in the operator, it should work

thanks @UneconscienceUneSource, If it's not too much to ask, how can I do what you tell me "inheriting AddObjectHelper in the operator"

I meant like in the template.
class OBJECT_OT_add_object(Operator, AddObjectHelper):
the class is inheriting AddObjectHelper there. which helps for the object creation...

i solved it guys, thanks to all, and i edit the post. only add this line code: "v1 *= scl" on "make_coil" function, and add "FloatProperty" in "AddSpringObject" class

@blackcall2 please write an answer in the answer section below rather than adding solved to the title. This is not a forum that keeps all information in the question. Posts are divided between question and answer. Please read the [tour] for more on how the site works.

I'm very sorry, thank you @Timaroberts


text:
Mantaflow Several flow source, one domain
I have several flow sources but one domain. I need liquid to flow out all 5 sources. I have set up the flow inflow settings on the flow sources. When I bake it, fluid only comes out of one source. What to do?
File on https://drive.google.com/file/d/17n3GbCdHc3o7waMRrIQ3y3PeACdCqWkS/view?usp=sharing

Provide blend file. Without further info we can just guess …

To add to above comment. You can use https://pasteall.org/blend/ . Post link here in the comments.

@Sorry. already updated it


text:
My image sequence is not rendering as animation when I change resolution
enter image description hereI have a sequence of images already added to Blender in a clean new blend file. Output is saved as Mp4 and the encoder is also FMpeg4. When I render it as animation it works. My images are of a different resolution though(4320*1125). So, I have to change the resolution. When I change the resolution of the render and try to render it as animation, it does not render. What do I do?
Also, when i don't change resolution, it looks stretched because the images are (4320*1125).

Here is the blend file https://drive.google.com/file/d/1wrZCgKGMA3kIxwcHQo2KHnFgVH1HnG49/view?usp=sharing
[

I'm no expert in video codecs, but as far as I know MPEG-4 supports up to 4096*2160 @ 60 fps, and I'm not sure if there are special image ratios accepted. So I guess this is no specific question for Blender.

maybe i don't understand your question...so just to be sure: could you provide a blend file with just 3 sample images and your settings so we can check it out? i think this should work...

@GordonBrinkmann when I upload the file on Sheepit render farm, it renders it as an mp4 video. The only problem is it compresses the files and renders them in lower quality. So now I have to download all the frames individually and render them as mp4 animation on Blender itself which gives me said problem.

@Chris I uploaded a link to the blend file. and images just to see what i mean.

thank you. unfortunately i cannot see the image....can you please do file -> external data -> pack resources, save and upload again?

i inserted "my own" picture in your file - no stretching when rendering

ok, you insert 1125...you have to use even numbers, change to 1126 and it will render. you will get this error here: [1]: https://i.sstatic.net/EYDhN.png

@Chris Oh my. Thank you so much. It worked. I had no idea.

glad i could help

Change the resolution numbers to even numbers, else it won't render.
The error message gives you a hint:


text:
Blender - Problem with Head-less Rendering a Rigid Body Dynamics Scene generated from a Python Script
I’m using Blender 2.9.3 and Python scripting to describe a very simple Rigid Body Dynamics (RBD) scene and then render the scene head-lessly. See python script Basic2b.py and the command line prompt below. When I try to do this, the Rigid Body Dynamics do not ‘activate’ and the scene appears static - i.e the rendered image stays constant. If I however run the same command but remove the -b option so that Blender interface opens, the motion of the RBD appears when I render the same python scripted scene. I don’t understand why. Can some kind person explain how to ‘activate’ RBD in this head-less python scripted scene in a command-line context as I really need to render this heedlessly.
Cheers!
Tried on MacOS 10.13.6 Blender 2.9.3 and most recent Big Sur v 3.0.0.a
#Basic2b.py
#Headless RBD scene setup Sept 28 2021
import bpy

#Blender scene setup
scn = bpy.context.scene
scn.frame_start = 1
scn.frame_end = 100
scn.render.resolution_x = 160 #Set x resolution
scn.render.resolution_y = 120 #Set y resolution

#Add a plane and set as passive rigid body
bpy.ops.mesh.primitive_plane_add(size=25, enter_editmode=False, align='WORLD', location=(0, -4, -0.52), scale=(1, 1, 1))
bpy.ops.rigidbody.objects_add(type='PASSIVE')

#Add a Round cube and set as active rigid body with mass of 20
bpy.ops.mesh.primitive_round_cube_add(align='WORLD', location=(0, 0, 3), change=False, radius=1.5, arc_div=12)
bpy.ops.rigidbody.objects_add(type='ACTIVE')
bpy.context.object.rigid_body.collision_shape = 'SPHERE'
bpy.context.object.rigid_body.mass = 160

Command Line to render this scripted Blender scene:
/Applications/Blender.app/Contents/MacOS/Blender -P /Users/sam/Desktop/Render/basic2b.py -o /tmp/zxz -b -a

However each rendered frame is the same - it seems the RBD in this context is inactive.
If I remove the -b argument and open the python script in the Blender program interface, it renders fine, but I really need to make this work head-lessly in commandline batch mode.
/Applications/Blender.app/Contents/MacOS/Blender -P /Users/sam/Desktop/Render/basic2b.py

Following up with some more research and more questions - 30/09/2021
I have been investigating a bit more and found a partial solution, which is to bake the scene. This means that the Rigid Body Dynamics (RBD) simulation becomes visible (not sure if that's the correct term) to the renderer.
The python command to bake all is:
bpy.ops.ptcache.bake_all(bake=True)

However I've now run into another obstacle - try as I might I cannot get the simulation to run for more than 250 frames. I'm fully aware that its possible to extend the simulation from within the Blender interface - but cannot find a way to do so from within a python script.
The obvious solution is to right click the Simulation End button and see what Blender 2.93 offers, but frustratingly it doesnt offer the full text - part of it is redacted/missing - see below:

I've tried:
bpy.context.scene.frame_end = 402

which is what appears in the python info window but that doesnt work.
I tried permutations of:
bpy.data.scenes["Scene"].PointCache.frame_end = 402

But the blender consol keeps returning errors such as:
AttributeError: 'Scene' object has no attribute 'PointCache'

I'm not sure how to give the scene object a PointCache attribute using Python so can only presume its a contextual thing - but I've no idea where to go next...
I've tried extending my scene to 400 frames, then going to frame 400 and telling Blender to bake up to the current frame
bpy.ops.ptcache.free_bake_all() #remove any stored cache files
bpy.context.scene.frame_end = 400 #set scene end to 400 frames
bpy.context.scene.frame_current = 400 # go to frame 400
bpy.ops.ptcache.bake_all(bake=False) #bake to current frame

but while the command line reports that its baking to frame 400, when I watch the rendered sequence - the simulation stops at frame 250. It's almost like Blender won't allow the simulation space to be more than 250 frames unless you're using Blender interactively in which case you can use the interface to extend the scene. As I'm trying to produce and render Blender RBD scenes solely using python in a scripted, batch file context this isn't an option.
Can anyone suggest which python command would allow me to set the end of the PointCache?

Related https://blender.stackexchange.com/questions/112029/is-there-any-way-to-export-the-last-frame-of-a-physics-simulation-from-command-l

Does this answer your question? Is there any way to export the last frame of a physics simulation from command line?

@brockman - apologies missed your comment - will investigate. I have now appended my followup into the initial question and removed my 'Answer' - hope that conforms to the site rules. Here's what you added to previously which may have got lost when I deleted my reply: Click -> blender.stackexchange.com/a/146829 (already posted before, below your question)... You would have to override the bake operator, I think all necessary information is over there. Doesn't it? brockmann

No problem. Yep perfect. Just let us know what else. Cheers

I may have found a solution: https://blender.stackexchange.com/questions/182780/change-start-and-end-frame-of-rigid-physics-simulation-with-python?rq=1 - This seems to be what I'm looking for: scene.rigidbody_world.point_cache.frame_end = 1000 - going to test a bit more before making this the answer...


text:
how to make an object follow a curve with the same speed as another animated object
Say I have an object which has an animation.

I have another object which is constrained to a curve. I want it to follow the curve BUT I want it to do it at the same speed as the animated object.

here I am manually moving the object to show what I mean. I want the cube to move along the path, but with the same variations in speed that the moving camera has.
Doing this will essentially let me deform a motion path like you would do with a mesh.
I don't know much about coding so if the answer includes writing some kind of script, I would really appreciate it if you gave an example :)
EDIT: batFINGER phrased it well in the comments: "for every frame if Free object moves d units, the path object will move d along the curve"
Also, preferably I would also like to do this live in blender.

To clarify, for every frame if Free object moves d units, the path object will move d along the curve?  Doing it live, is do-able but tricky. Baking it post animation is simpler, eg using a slow empty one frame behind the camera, d is the distance between.  Knowing  the length of the curve, offset the path object.

... noticing your last comment, given you have an animation for the camera,, the empty can be animated via same animation offset via NLA.  Please [edit] any extra details into the question.  See https://blender.stackexchange.com/a/159719/15543 re using array / curve modifiers to give curve dimension.

Bake the displacement.

Given

I used a gltf camera path which I exported from a video game, so Its
just a keyframe animation

Here is a quick baking script,
Whenever the animation of the camera has been changed, run the script to bake some simple physics.

Set scene to first frame of action save the location as previous location
For each frame of camera action
Calculate the distance from frame location to previous location and store
Set the location as previous.

From the data bake in 3 animations on custom properties

"speed"  The amount of distance travelled that frame

"disp" The accumulative displacement

"offset" The frame displacement as a fraction of total

The values of the 3 are keyframed into the camera action

The cube in GIF has a follow path constraint to circle, the relative offset is being driven by cameras custom property "offset" added by script.
Baked in graph editor

Here is a test script, assuming the animated object is scene camera, and it is animated by active action
import bpy
import numpy as np
context = bpy.context
scene = context.scene
cam = scene.camera
action = cam.animation_data.action
frames = np.arange(*action.frame_range)

def gloc(ob):
    return ob.matrix_world.to_translation()

locs = []
scene.frame_set(frames[0])
ploc = gloc(cam)
for f in frames:
    print(f)
    scene.frame_set(f)
    loc = gloc(cam)
    s = (loc - ploc).length
    locs.append(s)
    ploc = loc

def flatten(a, b):
    c = np.empty((a.size + b.size,), dtype=b.dtype)
    c[0::2] = a
    c[1::2] = b
    return c

def fcurve(fcurves, datapath, data):
    cam[datapath] = 0.0
    fc = fcurves.find(datapath)
    if fc:
        fcurves.remove(fc)
    fc = fcurves.new(datapath)
    fc.data_path = f'["{datapath}"]'
    fc.keyframe_points.add(len(frames))

    fc.keyframe_points.foreach_set(
            "co",
            flatten(frames, data)
            )
    fc.convert_to_samples(*action.frame_range)

# per frame speed
speed = np.array(locs)
fcurve(action.fcurves, "speed", speed)

# displacement
disp = np.cumsum(speed)
fcurve(action.fcurves, "disp", disp)
# Offset of total displacement

offset = disp / disp[-1]

fcurve(action.fcurves, "offset", offset)

Note, GIFs shown are not  moving two objects same distance each frame, rather the same offset fraction along their asscociated paths per frame.  To make it 1:1 distance would require calculating the length of the constraint curve

Edit: sorry it looks like I misunderstood your question as your object A follows a curve path. Anyway I leave my original answer.
Let's say the cone is the object A that goes straight ahead and the cube is the object B that is following a curve.
First, you can do it with Curve modifier and Copy Location constraint:

Create a plane, give it a Curve modifier (with the curve as Object) and a Copy Location constraint (with the cone as Target)
Select the cube, shift select the plane, select 3 vertices of the plane and CtrlP to parent the cube to the plane vertices
Animate the cone, the plane will go along the curve and the cube will follow the plane

You can also do it with Drivers:
Give your cube a Follow Path constraint, enable its Follow Curve option, right click on Offset value and choose Add Driver:

In the pop-up panel, choose the object the cube is supposed to follow, in Expression choose a variable, here *-40 -50 (-0 is here so that it begins at the right position), you can right click on Offset to Open Drivers Editor, press V to make a linear curve, rotate the curve, test the animation:

Here is what it gives for me:

Thanks for the reply, I tried using the drivers, and this is what I got: https://imgur.com/i2VVqFV  . The problem is I want it to only progress along the path in one direction. Linking the offset value to the axis-value of object A means it depends on how far away object A is from the origin. Is there some kind of way or expression I can transfer the free movements of object A into the offset value of the constrained object?

oh ok you're right I completely missed that aspect, it may be doable with script, I hope someone will answer. Btw how do you move your object A? If you make it move along a curve it will make things easier but it looks like not...

I used a gltf camera path which I exported from a video game, so Its just a keyframe animation


text:
How to preview in Blender Video Editor?
I'm a complete noob, and I've spent hours trying to find an answer to this question to no avail.
I've gone through a few tutorials and a few blender questions here on this forum but none of the advice was able to help me.
How do you preview your video so you can actually see what you're doing while editing? In After Effects it's called preview. In Blender I think it's called Proxy/timecode, I was never able to find that option though.
Always when I hit play at the bottom I just get to watch the first 8 seconds of my video looping. That's all I got to work. I would like the video to be watchable from any place I scroll and for longer than 8 seconds.
Please help
thx
[
I know the preview window. It's open when I first open the tool. But all I see through it are the places in the video that I scroll through and when I hit play I see the first 8 seconds of it in a loop.

if you open a Video Editor window and switch it to Preview mode you should be able to see the whole sequence, maybe show a screenshot?

I added a screenshot. Hope it helps

This catches me out every time I open a video editor...

The End Frame is set to 250 frames, increase this value (bottom right of your Timeline editor), otherwise it will only play 10 seconds. You can also display seconds rather than frames: enable View > Show Seconds.

oh wow amazing, I'm surprised how fast this preview works.
In AE I'm used to having to wait for things to buffer before I can watch anything. But here it just all works in realtime. De hek is up with that?
I just set it to 1000000000 which works great but will prbly be a worse and worse idea the more complex my project gets.
thx m8, u'r awesome ^^


text:
Skybox is not visible after rendering
Trying to follow this tutorial and create a skybox but in Blender 2.93
Can't find some buttons from the video, e.g. make material shadeless, maybe this is why can't see the skybox on the rendered image.
Question
How to render the skybox?

Update
I was able to render the skybox by going to Material Properties of the container (cube) and setting the Surface property to Emission. Unfortunately, as was mentioned in the comments, it emits light that makes all other objects inside the container shadeless which is still not what I expected...

This tutorial is deprecated since it relies on Blender Internal render engine which was discontinued in the 2.8+ versions. You can however do the same things using Eevee or Cycles, it should work out of the box. To make a material shadeless, you can use an Emission Shader instead of the Principled BSDF node and set the strength to 1. Note that it will emit light, which might not be what you want

In Cycles you can also plug the image directly into the material output without the need of plugging an Emission shader inbetween. By default the image texture then works as if it was an Emission shader set to a strength of 1 and it's shadeless since no "shader" is involved.

@Gorgious Thanks. I found this option and unfortunately it emits too much light. Would be nice if all objects inside the container could still have an alternative source of light and shadows.

@GordonBrinkmann Thanks. I tried to exclude Emission from the chain of nodes in the Shader Editor, but the result is the same, the image itself still emits too much light, making all objects inside the skybox shadeless.

Finally made it work. Mistakes that I made on the way.

As Gordon Brinkman mentioned in the comments Cycles engine renders HDRI texture out of the box. Meanwhile, any scene sets Eevee engine as the default one. After switching to Cycles I was able to see my HDRI texture.

As it was mentioned by Gorgious, even setting the engine to Cycles the light seemed too bright so all objects inside the SkyBox looked like they were floating in the air without shadows. Unfortunately, the solution with MixShader didn't solve this issue, but I found a couple of tutorials that brought me closer to what I wanted. One mentions adding Diffuse BSDF before Material Output in the nodes editor. The second one suggests checking Shadow Catcher in the material properties of the ground plane.

https://www.youtube.com/watch?v=KBCZBsV-GbA
https://www.youtube.com/watch?v=RsAUfQlZH_w

After watching 2 tutorials above I was able to see the shadow on the ground plane, but when I tried to add texture to this plane, it broke again.

with Shadow Catcher enabled entire plane was dark and shadowless
without Shadow Catcher the plane had normal texture, but still shadowless

After reading comments in this question, I realized that instead of adding Diffuse BSDF to the SkyBox, I would rather add it to the ground plane and ... it worked. Now I have all working together - HDRI sphere, lights, shadows, textures.

Material settings of the HDRI sphere

Material settings of the ground plane

If you're using Cycles, this setup (Is Camera Ray output from the Light Path node plugged into the factor of a Mix Shader) applied to the skybox cube will make the material appear shadeless while not illuminating the scene.


text:
Only specific materials apply to model
There are 3 buildings with materials on the screenshot. Buildings 1 and 2 have their own materials and I'm trying to create another material for the 3rd one. For some reason, the 3rd building doesn't show any material assigned to it, except the material used for the 1st building.
Use cases

Create a new material for the 3rd building - doesn't work
Apply material from the 2nd building to the 3rd building - doesn't work
Apply material from the 1st building to the 3rd building - works

Any ideas?
Blend file
https://pasteall.org/blend/8dc2d5c478e04524882269552c02c34f

are you sure you've assigned the right material to the faces?

it would help if you tell us step by step what you did/tried, or make a video of this...or provide your blend file and tell us what object is building 1,2 and 3.

It looks like the two shorter buildings are linked to the same mesh data block. If this is the case, materials will by default be used on both of them. To avoid this but keep mesh data block linking, change the linking from “mesh data” to “object data” in the Material Properties tab next to the material selection pull-down.

@moonboots Yes. As I mentioned, assigning material #1 to building #3 works fine. Building #3 doesn't show only material from building #2 and the new material.

please pack your images and share your file: https://pasteall.org/blend/

@Chris I added a link to blend file and recorded this video https://youtu.be/o0qmBoedhow

@moonboots Added link to blend file https://pasteall.org/blend/8dc2d5c478e04524882269552c02c34f

@Anonymous: your video is private...we cannot see it

@Chris Made public. Could you try now, please? https://youtu.be/o0qmBoedhow

@TheLabCat Not really. The two short buildings are separate objects but I want to make them look the same, so I created material #2 for building #2 and it worked fine (windows on the wall). When I tried to create similar material for building #3 it didn't show up in the rendered view.

you have to tap on assign after you chose the other material....looks like you want just assign some material to some faces, right?

@Chris Yes, I'd like to assign a new material to several faces, but assign didn't work. There is a small catch. These models were generated by OSM addon and by default it assigns default materials to models. To replace default materials I removed them in the blender file, created new one and assigned to the model. That worked for two buildings but not for the last one.

Your building has 2 UV maps, maybe make sure that you are using the one you want, the first one? If it is not your problme, could you please pack your images (File > External Data > Pack All Into .blend), only keep the buildings you are talking about and share your file again?

@moonboots Thank you. You are right. The problem was caused by UV maps. After removing both and performing "Unwrap" and "Assign" I can see material on the model. Could you post this as the answer, so I could close the question?

You have 2 UV Maps and you've selected the bad one, so the texture is not what you're expecting, just select the right one:


text:
Can't Use Quad Remesh On Some Objects
Using: BlenderOctane (2.93.0, the latest I believe)
Specs: RTX 3090, Ryzen 3600, 32 GB RAM, Win 10
Problem: When I try to use the Quad Remesh addon in non-Octane blender in the provided file, I can remesh the door. When I try to remesh it in the Octane version of blender I get the error in the attached image. Tried a fresh download of BlenderOctane, reloading scripts, reloading Quad Remesher, rebooting PC, and praying to my ancestor's God. None have worked, any ideas as to why I cannot use Quad Remesher on some objects in BlenderOctane?
Link To Problem Example:https://drive.google.com/file/d/15b6ibi4Hh-L5IIB4qwb7WYvomfm_bDLe/view?usp=sharing
!!PROBLEM SOLVED!!: Had to remove all materials from the object and then I could remesh and then apply materials.
Lesson learned, do all remeshing before applying any materials or textures.

try settings the material output node to eevee/cycles/all when you do the remesh. currently it's "none" for non-octane blender.

Thank you but sadly no joy. Tried All, Eevee, and Cycles but it still doesn't work.

I had to remove the material all together from the mesh and then I could do it. I also noticed that if I remesh an object that has a material on it (and it lets me do it), the material is changed to a new default one. Is this expected behavior?


text:
How to take meshes and generate objects from them and add them to master collection using python
I am currently working with a script that was originally written for Blender 2.49, the last part of the code is meant to copy a group of objects multiple times in a pre-arranged way
I have upgraded it into 3.0, but I am still stuck on two parts, getting the mesh data, and duplicating the objects.
I think i fixed the first part.
if obj in scndict:
                oolist.append(scndict[obj].getData(mesh=1))
                found = 1

I replaced oolist.append(scndict[obj].getData(mesh=1))with oolist.append(scndict[obj].data) to get the mesh data.
I tried to pass it but the objects.link only takes objects so I replaced it with oolist.append(scndict[obj])
I then tried to pass it to  new_o = scn.objects.new(o) but it got an attribute error, the point of the function is to create new objects, I could not find a replacement in the new Blender API for scene.objects.new()
Therefore, to make due I replacef it with scn.collection.objects.link()
When I run it the code runs but only adds one copy to the master collection and says the object is  already linked  and shows no new mesh.
What I seek is how to pass mesh data into an object and create multiple copies of that object.
Any guidance on this would be appreciated.
Full code below
Updated Code :
import bpy
import os
import math
import mathutils
import re
import array
import itertools
from bpy.props import StringProperty, BoolProperty
from bpy_extras.io_utils import ImportHelper
from bpy.types import Operator
from math import radians
from mathutils import Matrix

extents_re = re.compile(r"^x, y, and z extents")
objects_start_re = re.compile(r"<Objects>")
start_name_re    = re.compile(r"^(\d+)?\s*(?:\\\$([^\s]*))?")
name_re    = re.compile(r"^\s*\\\$([^\s]*)")
end_re     = re.compile("^#\s*")

def make_scndict(scn):
    scndict = {}
    for i in scn.objects:
        scndict[i.name] = i
    return scndict

def read_grid(infile):
    li = infile.readline()
    dim = [int(x) for x in li.rstrip().split(' ')]
    grid = array.array('L', itertools.repeat(0, dim[0]*dim[1]*dim[2]))
    for z in range(0, dim[2]):
        li = infile.readline()
        for x in range(0, dim[0]):
            li = [int(it) for it in infile.readline().rstrip().split()]
            for y in range(0, dim[1]):
                grid[z*dim[1]*dim[0] + x*dim[1] + y] = li[y]
    return (dim, grid)

def read_object(infile, li):
    res = start_name_re.match(li)
    grps = res.groups()
    if(grps[0] != None):
        num = int(grps[0])
    else:
        num = None
    entry = []
##  Apparently, we don't want to use any objects the appear on
##  the same line as the number, so don't use any other groups
##    if(grps[1] != None):
##        entry.append(grps[1])
    li = infile.readline()
    res = end_re.match(li)
    while res == None:
        res = name_re.match(li)
        assert(res != None)
        entry.append(res.group(1))
        li = infile.readline()
        res = end_re.match(li)
    return (num, entry)

def read_objects(infile):
    scenefile = infile.readline()
    objs = []
    li = infile.readline()
    while li != "":
        if(li.rstrip() != ""):
            num, entry = read_object(infile, li)
            print(num, entry)
            objs.append(entry)
        li = infile.readline()
    return (objs,scenefile)

def read_synth(infile):
    ## Look for start of grid (skip until extent warning)
    li = infile.readline()
    res = extents_re.match(li)
    while li != "" and res == None:
        li = infile.readline()
        res = extents_re.match(li)
    (dim, grid) = read_grid(infile)
    print ("Read %d x %d x %d grid" % (dim[0], dim[1], dim[2]))
    ## Look for start of objects (skip until object tag)
    li = infile.readline()
    res = objects_start_re.match(li)
    while li != "" and res == None:
        li = infile.readline()
        res = objects_start_re.match(li)
    (objs, scenefile) = read_objects(infile)
    print("Read %d object groups" % (len(objs),))
    return (dim, grid, objs, scenefile)

def fuse_objects(scndict, objs):

    res = [None]
    found = 0
    missing = 0
    for olist in objs:
        oolist = []
        for obj in olist:
            if obj in scndict:
                oolist.append(scndict[obj].data)
                found = 1
            else:
                missing = 1
        res.append(oolist)

    return (res, found, missing)

def object_array(scn, dim, grid, objs, units):
    for z in range(0, dim[2]):
        for x in range(0, dim[0]):
            for y in range(0, dim[1]):
                current_objs = objs[grid[z*dim[1]*dim[0] + x*dim[1] + y]]
                if current_objs == None:
                    continue
                mat = mathutils.Matrix(([1.0, 0.0, 0.0, 0.0],
                                               [0.0, 1.0, 0.0, 0.0],
                                               [0.0, 0.0, 1.0, 0.0],
                                               [x*units, y*units, z*units, 1.0]))

                for o in current_objs:
                    new_o = scn.collection.objects.link(o)

                    o.matrix_world = mat
        print ("Done with plane ", z)

def read_file(filename):

    infile = open(filename + ".txt")

    scn = bpy.context.window.scene
    scndict = make_scndict(bpy.context.window.scene)
    (dim, grid, objs, scenefile) = read_synth(infile)
    (objs2, found, missing) = fuse_objects(scndict, objs)
    scenefile = scenefile.rstrip();

    if missing == 1:
        print("Blender Scenes/" + scenefile + " is not open.")
        fullpath = Blender.sys.expandpath("//" + scenefile)
        if Blender.sys.exists(fullpath) == 1:
            print("Opening " + scenefile + "...")
            Blender.Load(fullpath)
            print("a")
            scn = bpy.data.scenes.active
            print("b")
            scndict = make_scndict(bpy.data.scenes.active)
            print("c")
            (objs2, found, missing) = fuse_objects(scndict, objs)
            print("d")
            print(found)

    if found == 1:
        unit = 10
        print("Building object array")
        object_array(scn, dim, grid, objs2, unit)
        print("Done")
    else:
        print("The objects required in the example model could not be found in the current scene.Open the file Blender Scenes/" + scenefile + " and run the script again.")

    if found == 1 and missing == 1:
        print("Some of the objects are missing.  Check if the file Blender Scenes/" + scenefile + " is open.")

    infile.close()

class OT_TestOpenFilebrowser(Operator, ImportHelper):

    bl_idname = "test.open_filebrowser"
    bl_label = "Select Model"

    filter_glob: StringProperty(
        default='*.txt',
        options={'HIDDEN'}
    )

    def execute(self,context):
        filename, extension = os.path.splitext(self.filepath)
        read_file(filename)
        return {'FINISHED'}

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

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

if __name__ == '__main__':
    register()
    bpy.ops.test.open_filebrowser('INVOKE_DEFAULT')

Old Code:
import Blender
import bpy
import math
import re
import array
import itertools

extents_re = re.compile(r"^x, y, and z extents")
objects_start_re = re.compile(r"<Objects>")
start_name_re    = re.compile(r"^(\d+)?\s*(?:\\\$([^\s]*))?")
name_re    = re.compile(r"^\s*\\\$([^\s]*)")
end_re     = re.compile("^#\s*")

def make_scndict(scn):
    scndict = {}
    for i in scn.objects:
        scndict[i.name] = i
    return scndict

def read_grid(infile):
    li = infile.readline()
    dim = [int(x) for x in li.rstrip().split(' ')]
    grid = array.array('L', itertools.repeat(0, dim[0]*dim[1]*dim[2]))
    for z in xrange(0, dim[2]):
        li = infile.readline()
        for x in xrange(0, dim[0]):
            li = [int(it) for it in infile.readline().rstrip().split()]
            for y in xrange(0, dim[1]):
                grid[z*dim[1]*dim[0] + x*dim[1] + y] = li[y]
    return (dim, grid)

def read_object(infile, li):
    res = start_name_re.match(li)
    grps = res.groups()
    if(grps[0] != None):
        num = int(grps[0])
    else:
        num = None
    entry = []
##  Apparently, we don't want to use any objects the appear on
##  the same line as the number, so don't use any other groups
##    if(grps[1] != None):
##        entry.append(grps[1])
    li = infile.readline()
    res = end_re.match(li)
    while res == None:
        res = name_re.match(li)
        assert(res != None)
        entry.append(res.group(1))
        li = infile.readline()
        res = end_re.match(li)
    return (num, entry)

def read_objects(infile):
    scenefile = infile.readline()
    objs = []
    li = infile.readline()
    while li != "":
        if(li.rstrip() != ""):
            num, entry = read_object(infile, li)
            print (num, entry)
            objs.append(entry)
        li = infile.readline()
    return (objs,scenefile)

def read_synth(infile):
    ## Look for start of grid (skip until extent warning)
    li = infile.readline()
    res = extents_re.match(li)
    while li != "" and res == None:
        li = infile.readline()
        res = extents_re.match(li)
    (dim, grid) = read_grid(infile)
    print ("Read %d x %d x %d grid" % (dim[0], dim[1], dim[2]))
    ## Look for start of objects (skip until object tag)
    li = infile.readline()
    res = objects_start_re.match(li)
    while li != "" and res == None:
        li = infile.readline()
        res = objects_start_re.match(li)
    (objs, scenefile) = read_objects(infile)
    print ("Read %d object groups" % (len(objs),))
    return (dim, grid, objs, scenefile)

def fuse_objects(scndict, objs):
    res = [None]
    found = 0
    missing = 0
    for olist in objs:
        oolist = []
        for obj in olist:
            if obj in scndict:
                oolist.append(scndict[obj].getData(mesh=1))
                found = 1
            else:
                missing = 1
        res.append(oolist)

    return (res, found, missing)

def object_array(scn, dim, grid, objs, units):
    for z in xrange(0, dim[2]):
        for x in xrange(0, dim[0]):
            for y in xrange(0, dim[1]):
                current_objs = objs[grid[z*dim[1]*dim[0] + x*dim[1] + y]]
                if current_objs == None:
                    continue
                mat = Blender.Mathutils.Matrix([1.0, 0.0, 0.0, 0.0],
                                               [0.0, 1.0, 0.0, 0.0],
                                               [0.0, 0.0, 1.0, 0.0],
                                               [x*units, y*units, z*units, 1.0])

                for o in current_objs:
                    new_o = scn.objects.new(o)
                    new_o.setMatrix(mat)
        print ("Done with plane ", z)

def read_file(filename):
    infile = open(filename)

    scn = bpy.data.scenes.active
    scndict = make_scndict(bpy.data.scenes.active)
    (dim, grid, objs, scenefile) = read_synth(infile)
    (objs2, found, missing) = fuse_objects(scndict, objs)
    scenefile = scenefile.rstrip();

    if missing == 1:
        print ("Blender Scenes/" + scenefile + " is not open. ")
        fullpath = Blender.sys.expandpath("//" + scenefile)
        if Blender.sys.exists(fullpath) == 1:
            print ("Opening " + scenefile + "...")
            Blender.Load(fullpath)
            print ("a")
            scn = bpy.data.scenes.active
            print ("b")
            scndict = make_scndict(bpy.data.scenes.active)
            print ("c")
            (objs2, found, missing) = fuse_objects(scndict, objs)
            print ("d")
            print (found)

    if found == 1:
        unit = 10
        print ("Building object array")
        object_array(scn, dim, grid, objs2, unit)
        print ("Done")
    else:
        print ("The objects required in the example model could not be found in the current scene.  Open the file Blender Scenes/" + scenefile + " and run the script again.")

    if found == 1 and missing == 1:
        print ("Some of the objects are missing.  Check if the file Blender Scenes/" + scenefile + " is open.")

    infile.close()

if __name__ == '__main__':
    Blender.Window.FileSelector(read_file,"Select Model")

Thanks @g-garone, I looked at the the links you provided and found the first one most useful.
I replaced   oolist.append(scndict[obj].data) with oolist.append(scndict[obj]) therefore calling the entire object.
I then replaced
for o in current_objs:
                    new_o = scn.collection.objects.link(o)

                    o.matrix_world = mat

With
for o in current_objs:
                    new_o = bpy.data.objects.new(o.name, o.data)
                    scn.collection.objects.link(new_o)
                    new_o.matrix_world = mat

I added new_o = bpy.data.objects.new(o.name, o.data) what this does is make a new object based on the names  and the entire data of the objects stored in current_objs .
I then linked new_o to the master collection. When I ran the script it worked as intended, except that for some reason the matrix stored in mat did not get applied, I think it has to do with the old code.
Anyway  I now consider the question answered, and again thank you @g.garone for pointing me in the right direction.
Final script below:
import bpy
import os
import math
import mathutils
import re
import array
import itertools
from bpy.props import StringProperty, BoolProperty
from bpy_extras.io_utils import ImportHelper
from bpy.types import Operator
from math import radians
from mathutils import Matrix

extents_re = re.compile(r"^x, y, and z extents")
objects_start_re = re.compile(r"<Objects>")
start_name_re    = re.compile(r"^(\d+)?\s*(?:\\\$([^\s]*))?")
name_re    = re.compile(r"^\s*\\\$([^\s]*)")
end_re     = re.compile("^#\s*")

def make_scndict(scn):
    scndict = {}
    for i in scn.objects:
        scndict[i.name] = i
    return scndict

def read_grid(infile):
    li = infile.readline()
    dim = [int(x) for x in li.rstrip().split(' ')]
    grid = array.array('L', itertools.repeat(0, dim[0]*dim[1]*dim[2]))
    for z in range(0, dim[2]):
        li = infile.readline()
        for x in range(0, dim[0]):
            li = [int(it) for it in infile.readline().rstrip().split()]
            for y in range(0, dim[1]):
                grid[z*dim[1]*dim[0] + x*dim[1] + y] = li[y]
    return (dim, grid)

def read_object(infile, li):
    res = start_name_re.match(li)
    grps = res.groups()
    if(grps[0] != None):
        num = int(grps[0])
    else:
        num = None
    entry = []
##  Apparently, we don't want to use any objects the appear on
##  the same line as the number, so don't use any other groups
##    if(grps[1] != None):
##        entry.append(grps[1])
    li = infile.readline()
    res = end_re.match(li)
    while res == None:
        res = name_re.match(li)
        assert(res != None)
        entry.append(res.group(1))
        li = infile.readline()
        res = end_re.match(li)
    return (num, entry)

def read_objects(infile):
    scenefile = infile.readline()
    objs = []
    li = infile.readline()
    while li != "":
        if(li.rstrip() != ""):
            num, entry = read_object(infile, li)
            print(num, entry)
            objs.append(entry)
        li = infile.readline()
    return (objs,scenefile)

def read_synth(infile):
    ## Look for start of grid (skip until extent warning)
    li = infile.readline()
    res = extents_re.match(li)
    while li != "" and res == None:
        li = infile.readline()
        res = extents_re.match(li)
    (dim, grid) = read_grid(infile)
    print ("Read %d x %d x %d grid" % (dim[0], dim[1], dim[2]))
    ## Look for start of objects (skip until object tag)
    li = infile.readline()
    res = objects_start_re.match(li)
    while li != "" and res == None:
        li = infile.readline()
        res = objects_start_re.match(li)
    (objs, scenefile) = read_objects(infile)
    print("Read %d object groups" % (len(objs),))
    return (dim, grid, objs, scenefile)

def fuse_objects(scndict, objs):

    res = [None]
    found = 0
    missing = 0
    for olist in objs:
        oolist = []
        for obj in olist:
            if obj in scndict:
                oolist.append(scndict[obj])
                found = 1
            else:
                missing = 1
        res.append(oolist)

    return (res, found, missing)

def object_array(scn, dim, grid, objs, units):
    for z in range(0, dim[2]):
        for x in range(0, dim[0]):
            for y in range(0, dim[1]):
                current_objs = objs[grid[z*dim[1]*dim[0] + x*dim[1] + y]]
                if current_objs == None:
                    continue
                mat = mathutils.Matrix(([1.0, 0.0, 0.0, 0.0],
                                               [0.0, 1.0, 0.0, 0.0],
                                               [0.0, 0.0, 1.0, 0.0],
                                               [x*units, y*units, z*units, 1.0]))

                for o in current_objs:
                    new_o = bpy.data.objects.new(o.name, o.data)
                    scn.collection.objects.link(new_o)
                    new_o.matrix_world = mat
        print ("Done with plane ", z)

def read_file(filename):

    infile = open(filename + ".txt")

    scn = bpy.context.window.scene
    scndict = make_scndict(bpy.context.window.scene)
    (dim, grid, objs, scenefile) = read_synth(infile)
    (objs2, found, missing) = fuse_objects(scndict, objs)
    scenefile = scenefile.rstrip();

    if missing == 1:
        print("Blender Scenes/" + scenefile + " is not open.")
        fullpath = Blender.sys.expandpath("//" + scenefile)
        if Blender.sys.exists(fullpath) == 1:
            print("Opening " + scenefile + "...")
            Blender.Load(fullpath)
            print("a")
            scn = bpy.data.scenes.active
            print("b")
            scndict = make_scndict(bpy.data.scenes.active)
            print("c")
            (objs2, found, missing) = fuse_objects(scndict, objs)
            print("d")
            print(found)

    if found == 1:
        unit = 10
        print("Building object array")
        object_array(scn, dim, grid, objs2, unit)
        print("Done")
    else:
        print("The objects required in the example model could not be found in the current scene.Open the file Blender Scenes/" + scenefile + " and run the script again.")

    if found == 1 and missing == 1:
        print("Some of the objects are missing.  Check if the file Blender Scenes/" + scenefile + " is open.")

    infile.close()

class OT_TestOpenFilebrowser(Operator, ImportHelper):

    bl_idname = "test.open_filebrowser"
    bl_label = "Select Model"

    filter_glob: StringProperty(
        default='*.txt',
        options={'HIDDEN'}
    )

    def execute(self,context):
        filename, extension = os.path.splitext(self.filepath)
        read_file(filename)
        return {'FINISHED'}

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

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

if __name__ == '__main__':
    register()
    bpy.ops.test.open_filebrowser('INVOKE_DEFAULT')

here are some tips about your question:

to access mesh data, use data property of the object (you are doing it right):

# get object reference
ob = bpy.data.objects[<ojbName>]
ob_data = ob.data

# now you can access all data related to the mesh,
# for example uv_layers, vertex_colors etc...

to duplicate objects, you should duplicate the object and the data related to it with copy() method, and I suggest you to check these answers:

How to duplicate an object in 2.8 via the Python API
Duplicating a mesh object
Duplicating non primitive mesh with Python

From Blender 2.8x, every object has to be linked to a Collection, not to the Scene:

link new object to scene with python in 2.8

Hope this could help.


text:
Grease Pencil - Can't move 3d cursor with pen tablet, can't specify new hotkey
I am using Blender 2.9 & 3.0 with right-click select mouse button preference and a drawing tablet without pen buttons.
By default, the 3d cursor moves with Left Mouse Button click.
By default in Grease Pencil Draw mode, ⇧ Shift + Left Mouse Button click sets the 3d cursor.
With my left-mouse preference, it changes to ⇧ Shift + Left Mouse Button /  ⇧ Shift + Pen-Click, which draws instead.
This means I have to switch to another mode (edit/object/etc) + switch from pen back to mouse and back every time I move the 3d cursor
I tried changing the hotkey with a combo that doesn't get overridden by existing hotkeys (⇧ Shift + WIN + Pen), however, this only worked when the pen-specific shortcut was set to the universal Set 3d Cursor, overriding the default left-mouse in every other mode.
I tried setting the pen-specific hotkey for Set 3d cursor in 3d View Tool: Sculpt Gpencil, Tweak and 3d View Tool: Edit Gpencil, Tweak, but that had no apparent effect on the default 3d cursor placement in GPencil draw mode.
This thread recommended adding a duplicate hotkey to work simultaneously with the the default universal Set 3D cursor, but I can't find how to do this, and am not sure if it still works in later versions.
Is there any solution for my problem?

could you share the file , please?

https://www.dropbox.com/s/xk8bkzqeltmkt9t/Grease%20Pencil%20Stack.blend?dl=0 Here's a quick thing I made, though the UI problem persists in new projects too.

You can add a hotkey in 3D View section, 3D View Generic. It could be a keyboard key as well as it might interfere less with other mouse functions.
Just go to the preferences(F4 > P), Keymap Tab, and navigate to 3D View, 3D View Generic and click Add New, then enter view3d.cursor3d and choose a hotkey:

This worked perfectly Thank you SO much!!! I spent the entire day trying to get this to work, and was thinking I had to relearn the workflow with left mouse entirely ahhh THANK YOU!!!!

If the answer was helpful, consider up-voting it.

I'm too new for that feature, but I will as soon as I am able!


text:
Understanding blender for 3d modeling
I was trying do model simple box with opened top for 3d print. I added plane, extrude the edges in Z axis and applied solidify modifier.
The model looks fine, however the Cura cant slice it properly (it slices only the bottom). I really dont understand, what I'm doing wrong, because as soon, as I extrude something, it immediately gets unsliceable. Could somebody provide me a hint, on what to focus?
File is here:
Cube

Update: I do use the 3d print addon, you can see it on the screenshot from blender.

Have you checked if the mesh is manifold ? Hard to say since you have X ray enabled

It seems that your walls are too thin. The 3D printer's nozzle is probably wider than the 3D wall, and the slicer is rejecting that part of the model. I'm pretty sure if you thicken the walls, it will work :)

Are you using the 3D printing add on? This will let you prepare your model ready for 3D printing. YouTube the blender 3D printing add on, there are lots of videos.
Also cura has a blender plug-in which is brilliant because you don’t have to export an stl file then reimport it into blender, you can just open the blender file directly in cura. Just make sure you have you dimensions set up correctly so the model import at the correct size.


text:
Why is my bake showing as totally flat?
I'm trying to bake a simple normal map for a tile texture to use in a game. I've set up the bake exactly as in a tutorial but for some reason the tiles aren't baking properly to the plane and the normal map is coming out flat blue. The image shows the details that aren't being baked on the model.

File is here: http://filedropper.com/dH2AJHaT
If anyone can help I'd be very grateful. Thank you.

Hard to tell if you don't share the file...
But check that the high poly is well selected and the low poly active.

I've linked the file now. The high poly was selected and the low poly was active when I rendered. I've double and tripe checked and it's still not recognising details

Your values for Max Ray Distance and Extrusion are too low :

Max Ray Distance is the maximum length of the rays that Blender shoots from the active object to the highPoly mesh, if it's set too low, the rays won't reach the highPoly mesh and it will get no normal information to write on the file, hence the "flat blue" result you see.
Extrusion is used when parts of your lowPoly mesh is "inside" the highPoly one so Blender would inflate your lowPoly mesh by the Extrude value. In your case, you don't need it because your plane is above the tiles so there is no need to inflate it anymore.
I got this result by setting Max Ray Distance and Extrusion to 0 :

EDIT
By the way, a Max Ray Distance set to 0 doesn't mean that the ray length will be 0, it means that there is no limit to Max Ray Distance which basically means that Blender will shoot the ray and won't stop it until it touches something (I said basically, not litterally :D ).

It worked! Great explanation, thank you so much!

Well, I'm glad I helped. Just remember, only use Max Ray distance and Extrude when you really need them. If your bake works fine without them, just don't use them. There is a Blender Guru tutorial (How to bake perfect normals) that explains the case where you need to use Max Ray distance.


text:
UV issue when importing model to Substance Painter
so I just started using Substance Painter and when I import my model as an FBX from Blender the UV's appear fine in the UV window in painter but as soon as I apply any texture it is mapped strangely.

I only have one material on the object, I applied the modifiers and transforms on export, changed up and forward axis and also tried exporting as an OBJ instead of FBX.

Here I just added a random grunge texture to the base colour of a fill layer. No matter what I change I always get this same mapping on the model, even switching to triplaner mapping gives a similar result.

Here is what the generated curvature map looks like from substance.

Here I applied the curvature map as a mask to a fill layer.

May be you have multiple UVMaps.

Hard to see whether your UVs are nice based on the first screenshot. However, if this is all fine in Blender, your issue most likely is that you forgot to generate the mesh maps in painter: https://helpx.adobe.com/substance-3d-painter/using/baking.html

@Emir I just have a principled BSDF as the only shader. How would I add a picture as a comment?

@FFeller I only have one uv map on the mesh.

@brockmann I added a picture of the uv mapping in the post, let me know if thats sufficient for painter. Also I did generate the mesh maps and when I viewed them they looked perfect, however as soon as I applied them they gave this strange mapping.

My sculpt was 9 million polygons, so it seems Substance didnt know what to do with it. Exported out at a lower resolution on the multires modifier and then baked the high poly back on seemed to work. Not sure what the poly limit is in Substance.

It looks like it's 10M triangles (which is very likely to be less than 9M polygons since blender supports Quads and N-Gons) https://substance3d.adobe.com/documentation/spdoc/mesh-and-uv-setup-168198996.html


text:
Hair particles going through mesh
I'm trying to make a little hairy creature walk around with googly eyes. But I have an issue with my hair particles going through the eyes.
The eyes are made out of an animated rigid body "case", and a black rigid body cylinder which acts as the pupil.
I've weight painted the ball, to avoid hair growing in the eyes, but hair above and around still goes through them on movement.

Is there a way I can avoid this?

Thanks in advance.

Try adding a Collision Modifier in the physics tab for the eyes. You might need to tweak the physics settings to get the right result.

As Benus wrote in the comment, just add a collision modifier to your eyes.
Result:

Right eye: with collision modifier added.
Hairs and softbodies do not react on rigid bodies. They need a collision modifier to be recognized as effector objects.
BTW: nice pimp up of Polyfjords model! ;)


text:
Smoke transparency render perfect in blender, but altered after saving
I'm trying to render a cigar with a smoke simulation on transparency alpha png.
In the viewport and the render, the smoke looks perfect,

but when i'm saving the image for composite, the smoke opacity gets altered as you can see in illustrator (png on black background).

I'm using basic render and saving settings (png,16 cdepth,with and without comp) but it is still the same.
It's very frustrating because the render looks perfect in blender.
Thanks a lot ! :)
EDIT : my composition

my save settings

EDIT2 : I found that the alpha canal in the composite render is different to
the color canal. Maybe it can be helpfull to find the problem.

EDIT3 : FOUND THE WAY

Can you share your save options screenshot, on Render window (Fig. 1) > Shift + Alt + S and take screen shot.

I edited the original post ! :)

Sorry, I couldn't reproduce your issue. I also try on Cycle and Evee but it both fine.

I made an edit it may be usefull. Why is it making these line?

Not certain, but it sounds suspiciously like the ancient Blender broken alpha thing. PNG is also a broken format, so avoid it. Blender has had broken alpha encoding for file output forever. Sadly, TIFF should work, but it too is broken. You’ll need to save to EXR to get proper handling.

I got it thanks a lot for your time !

@a33 Would you mind sharing how are your solve this problem?

yes check the edit !

It is very hard to match the render and the png output :/
but after playing with the density and some math node on multiply plus colorramp I have managed to get a decent result. What confused me is the emission that not really showing on the png but very visible on the render.