text:
Best way to paint same Material with different mask?
My question is to have an alternative way if it exists.
So my problem is the following:
As you can see from this image, I have 2 materials, the first in the top row, uses vertex paint, so white and black decide how to mix green and red, so everything is ok here.
In the row below, there is a material practically the same, but which uses a mask (Always black and white) for vertex paint which is absolutely more detailed, as it does not need to have a high subdivision of polygons (As in vertex paint) .
But there is a problem in Texture paint, unlike vertex paint, that is, the possibility of painting the same material on many objects, without these being modified all together, let me explain better,
The vertex paint refers to the colors of the vertices of the object, but is very limited on the final results, due to the triangulation that is very visible, but remains independent (If the object is not an instance)
The texture paint is very nice, but it does not remain independent, so if I paint an object, the other object with the same material will suffer the same fate, therefore I will have 2 objects with the same mask.
I'm trying to approach this to understand which way to go, without having to create a new material, but probably my knowledge stops here.
Basically, I would like to have only one material, with the possibility that it can be masked independently on objects.
I would also like a vertex paint solution, if this were not so "Squared". I have a lot of confusion right now and I would like to know an answer on this, which will guide me to a "Logical" but intelligent choice, always keeping the single material

Post Bounty Note:
Based on Splize's answer , however, I thought that this method could contrast with the real use of Index pass? but actually it seems a very useful answer, and it works very well. At this point I would like to understand if there are further way that can be taken. Taking into account also a hypothetical more detailed vertex paint, because the vertex paint is much more "comfortable" as it does not require an additional Mask and "Smart Projection" to make the correct mask mapping

Unfortunately, Vertex paint requires geometry subdivision to work well with smoothing the paint. You only get the detail you are willing to have geometry for, as the Subdivision Surface and Multiresolution modifiers do not allow you to paint after the result of the smoothing. You could however look into combining the texture paint solution and UDIM paint schemes for allowing multiple textures to be used in the same material.

Indeed there seems to be no alternative solution, as vertex paint, as the word itself says, refers to the color of the vertices. It is a pity that there is no trick to overcome this problem of resolution. But I understand the limitation and it also makes logical sense. I don't understand what you mean by: quote "You could however look into combining the texture paint solution and UDIM paint schemes for allowing multiple textures to be used in the same material."

Can you be more specific what is the reason to keep it in a single material? To better understand what alternative can fit to your needs. Thank you

UDIM allows one to have multiple UV map positions and it could be possible to use UV Warp Modifier to change the position of the UV across multiple UDIM mapped image, though I am not skilled enough to fully realize it given the unknowns in your project use case.

@vklidu The specific case could be a very complex material, and the fact of not wanting useless copies of Material.001 etc

Complex material stored in Group is possible (in general), but if you want to keep listed only one material ... OK. BTW If you want to attract more visitors I would suggest to revised the Q description, that is unnecessarily long and a bit confusing.

You could use the "Object Info" node for that purpose. It has an output slot called "Object Index", which actually refers to the render pass index found under "Object Properties" -> "Relations":

You can give each object an unique "Pass Index" and then identify it in the node editor with a math compare node that will output "1", if the input "Object Index" (same as "Pass Index") matches the value specified underneath and "0", if this is not the case:

These outputs can then be used in a "MixRGB" node to attach the appropriate mask textures to the objects.

This technique looks very very interesting! I have to delve into this example to better understand how to manage it

I gave the bounties to your answer, as it is the most faithful to my question, as there is no need to create further materials.
Although it would be nice for peter to access a custom property instead of object index. But it seems that this is not possible

You will have to specify some kind of "mask" at some point of process for any object. So I'm not sure if the shared material is key for you.
If you want just be able to change node-tree shared by multiple objects from one place you can use Node Groups. Place all material node-tree into a group (Ctrl+G) only "mask" node and Material Output place out of this group.

Once created, the node group can be placed (Shift+A > Group) everywhere and managed from any of its copies. This way you can completely change node tree into totally different look without touching material with mask specific to object.

I find this very interesting, but I would like to keep the same material (as in my question), although I think this is a good alternative


text:
Particles per face are either too many or not enough
I've set up a particle system that needs to have exactly one particle emitted from each face on the emitter mesh. However, the "Particles/Face" setting is apparently not working. When it's set low there are many faces not emitting particles, yet when it's set high enough that no faces are without particles there are also many doubled-up particles overlapping.
The particles are bricks, so they are not animated, but I don't want holes in the wall or doubled-up geometry. Is there a problem with the "Particles/Face" setting, or am I misunderstanding what it does? How can I get just one particle per face?

You could emit the bricks from vertices, make sure that you emit exactly the same number of particles as the emitting mesh has vertices (121 in this case):

from verts

Emitting from faces with the grid option selected creates a box of emitted particles.

from faces

Thanks! Emitting from vertices worked for me. I found that at some vert counts one brick would be missing from its proper place and instead overlapping somewhere else. If I upped the particle count to just one more, the hole got filled. There would still be one extra brick overlapping somewhere but that's much more acceptable in a render than a missing brick.

source: Stack Exchange

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

sort: votes


text:
The anatomy of a Cycles render?
What processes comprise a Cycles render?
I was watching the top of the render view and watching the progress messages:

Synchronizing Object | ObjectName
Updating Mesh | Computing Normals
Updating Scene BVH | Building BVH
Packing BVH Nodes
Path Tracing Sample 1/xxx

There were a couple others I missed because they happened so quickly.
But this got me wondering what actually is happening underneath the hood and I thought you guys might know.
I am especially interested in finding out what BVH is, since I've heard of BVH data being imported/exported between 3D applications.

"What is happening underneath the hood?" a lot!  Read this and this on the BVH.

Related: http://blender.stackexchange.com/q/5820/599

I can't provide explanations of all the steps, but I can explain a few and do some research of my own.
BVH:
BVH stands for Bounding Volume Hierarchy.  It is a method of grouping up the parts of your scene into bounding volumes so that Cycles only has to be concerned with objects within a BV that the current ray intersects.  This speeds up render times by eliminating unnecessary collision checking.  It does add a very small amount of extra time at the beginning of the render though to build
the BVH (i.e. split up the objects).
For more on BVH check out this answer.

Path [Ray] Tracing:
Ray tracing is the actual rendering, all the previous steps are simply getting the scene ready to render.  Ray tracing is the process of calculating the paths of light photons (called rays or sometimes paths) through the scene.
Cycles is what is called a backwards ray tracing engine.  This is because instead of tracing the rays trough the scene starting a the light source, cycles traces the rays backwards starting from the camera.  This eliminates having to waste time calculating rays that never hit the camera.
To visualize how this works say we are rendering a 16 x 9 px image.  Now imagine that a 16 x 9 pixel grid is overlaid over the camera view.  The way cycles computes the final render is by shooting a ray at the center of each pixel.

The path of this ray is then traced through the scene, interacting with the surfaces or volumes of the objects in the scene according to their shaders.

The path will stop when either 1. the ray has hit a lamp or emission shader, 2. the ray will not hit any more objects on it's current trajectory, or 3. the ray has completed a maximum number of bounces.  Cycles will then compute the color of that pixel based on the emission strength and color of the final medium it hit, the colors of the mediums it interacted with along the way, and the length of the ray.
However, if cycles only shot one ray per pixel you would end up with a pretty terrible looking result.  After all, if a surface is 50% diffuse and 50% glossy, that one ray can't act both ways, it has to choose one.  Not to mention more complicated shader node trees, or even the fact that many shaders (like diffuse) introduce a random element to the bounce of a ray.  This is solved by sending multiple rays per pixel and averaging the RGB values of each ray.  You can change the number of rays cycles shoots per pixel by changing the number of samples.

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


text:
How to distribute overlapping objects?
Let's say we have many overlapping objects. Why are they overlapping? Could be any number of reasons, but most likely because they were generated from a script and the script put them all in the same spot. They are each a little different, so rather than generating new objects we need to clean up our existing ones.
How can we write a script (or use some other method) to distribute these objects in a straight array-like line?
Sure, we can select any individual object by Alt-RClicking, but we would still need to place each one manually.

In the end we want something like this:

Not so difficult to manually place a few of these, but when you have hundreds of objects that's a different story.
There is a question similar to this one, but the answers provided did not work for me. One answer was to use a particular add-on (Oscurart Tools), but when I tried it the Distribute button did not work, so I suspect the add-on is not functioning properly in more recent versions of Blender. The other answer was basically "repeat the last thing you did using Shift R" but obviously that only works at the time of creation, and is of no use when faced with an existing heap of overlapping objects.
Any help appreciated.

Afaik Distribute function is still working but the objects between which others will be distributed have to be located in different places, so if you grab one conus out of all others by X axis to 5 units away, select it and all others then those will be distributed in these 5 units. There is some general difference in object as active but not in this case I think

@MrZak Spot-on, mate. It worked! Thank you. If you want to post that as an answer I'll accept.

Ok while I feel this is a duplicate of the linked question. Probably there could be better description of how operator works as I found only video tutorial about that, no "text-aka-wiki" one.

The Distribute operator from the OscurArt Tools addon works fine, however it expects one object from those to be distributed put at the end of the distribution area. This means one should select one object of those overlapping ones, move it away as desired, then select all the others, make the standalone one as active and run Distribute.
There are 5 monkeys overlapping in one spot in the first frame on the image below; one is moved to the right on the second, and then the rest of them are distributed with addon.


text:
Hide the UV layout while in Texture Paint Mode?
Is there a way to hide the UV layout while in Texture Paint Mode?
I understand the logic behind being able to see the texture you're painting on (and its UV layout), but sometimes I want to look at a reference image while I paint on my texture image. Having a bunch of lines covering the reference image is distracting.
Here is a related question, but I want to do the opposite.

If the mesh object is selected in Object Mode it is still possible to view the reference image without the UV layout over it. But upon switching to Texture Paint Mode, the UV/Image Editor switches back to the texture image and even after re-selecting the reference image the UV layout lines remain.

Just uncheck this option in the view menu:

Exactly what I needed. Thank you! I need to read menus more carefully...

I have had the luck to find myself using a 3d view window that is unchecked for "Use scene's active camera and layers" with an Image Empty in front view. I then can change the image associated with the empty and still paint in the other 3d view, with none of the mesh UVs in my way.


text:
How to not distort pixels?
I am working on a low poly model and I would like to texture it with pixelart. The problem is that whenever I aply the textures, most of the pixels get distorted, stretched or compressed. Is there any way that I could get something like this?

Currently I am using this model that I made:
https://skfb.ly/PyuC

The top picture is rendered in Orthographic View.

Most likely because you modified the shape of the UVs.

The question about blurry textures has been asked countless times before, it has to do with the used texture sampling.
See this answer for more details https://blender.stackexchange.com/a/47643/19307
As for distorted (as in stretched or compressed) textures it all as to do with the way you UVMap your textures.
Fix your UV's so as not to cause distortions, evenly scaled islands and proportionally unwrapped faces will help. If possible use the UV Map > Cube Projection which will cause minimal distortion, or UV Map > Project From view
Alternatively consider using generated texture coordinates where possible instead. This may not work in the viewport or exported models.

I think your issue is that you are rendering in Perspective View, rather than Orthographic View, which is what is shown in the top image. When you look at something in real life that contains parallel lines, you can notice that they don't look parallel, but like they will intersect. Consider this image of train tracks:

This is how your police car looks. The truck is rendered in Orthographic, where parallel lines look parallel. Consider the same tracks in Orthographic View:

Above images from the Blender Reference Manual
To render in Orthographic, select the camera and go to the Properties panel > Camera Object data tab > Lens dropdown and click on Orthographic.


text:
Can't crop image's size in Blender 2.8
Hi I want to make pixel art from my 3D renders and I found that scaling render result in compositor and pixelating it with node gives better result than rendering with low resolution.

Problem is that I can't crop it in blender and it's still big image with small pixelart in center

So I want to get rid of this transparent area. Thanks.

You can add an Output->File Output Node

When you render the image a full render will happen, then the Compositor will crop it

But at the same time a file will be saved that is just the result of the crop.

That's exactly what I was looking for, thank you so much :)

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


text:
Any workflow recommendation for 2.5-D pixel art style?
I am working on a little project that requires me to create a lot of low-resolution artwork on various sort-of basic geometry. For example a house would be just a cube with a triangle on top for the roof. Now I want to paint my pixelated texture tiles onto the surface of this object.
What I am doing right now is unwrapping the UV coordinates of the given object onto a map of sufficient size and then use the stencil texture painter to project my 2D artwork onto the surface of the object. This however is very tedious and although Blender 2.8 is a giant leap towards a more user friendly interface I am not satisfied with the workflow I'm currently following.
For instance, I would like to project the stencil already aligned with the given face normal instead of using the screen space for that. Is this possible? I could not find any option or documentation on this. This is also especially annoying when the mapped texture isn't aligned to the XYZ grid at all.
I'm also having trouble with the preview image of the stencil (the transparent one that is projected to the viewport). Because I am doing 8-bit texture mapping I really much don't want any kind of texture interpolation as it destroys the effect intended. I found out how to actually paint nearest-neighbour interpolated textures, but the preview itself is very much blurred. I am avoiding this in a way by using up-scaled images, but that complicates the drawing process even further.
Last but not least I am struggling with tile alignment. I did not yet find a way to easily align stencil tiles next to each other without any kind of distortion or gaps. Is there some kind of grid or snapping tool I can use while painting? I couldn't find any.
Perhaps I'm doing it completely wrong. In this case I would love to read some suggestions on how I could achieve this kind of task in a more straight forward way. I'm also very much open to try plugins, both free and commercial, or anything that might help increase productivity.
Thank you for any advice!
EDIT:
As requested I've attached a couple of images to demonstrate the problem.
First off, this is how i am painting the textures (obviously from screen-space):

Well, this is not actually what I am doing but it demonstrates the issue as I really like the texture not to project from screen space but rather aligned with the normals of the surface which would allow me to draw "across the edge" without any gap or distortion.
The next one shows the issue with the stencil itself:

As you can see its really hard to draw pixel perfect as the stencil is interpolated smoothly. I like this to be nearest-neighbour if possible.
EVEN MORE EDIT:
There seems to be a similar mode in sculpture painting called "Area Plane". From my understanding this is allowing sculpturing on the mesh surface instead from view projection. If that would be true this is exactly what I am looking for in terms of texture painting. Why is this option not available there?

Can you show some screenshots of what you mean so that we can respond correctly? First thing in my head is that if you want pixelated texture, you should really use small images that will naturally appear that way.

Thank you Craig for commenting my question. I've attached two screenshots to hopefully describe the situation.
As for small images: Yes, I agree. The reason I am not doing this is because of the blurred stencil effect demonstrated on the second image. I did not find a way to get around this. (By the way the stencil source image on the screenshot actually is an unscaled 1:1 version)

Probably not available -yet- because the paint system was designed around the Image Editor first, and not for the 3d view until a GSOC project over a couple of years brought us the 3d viewport texture painting. I have to ask why you can't just select the faces you intend to paint and then use the stencil in the UV Image Editor on the corresponding face? Or just map the image to UV and use it as a texture?

Sorry, but still not sure to understand what you want to do... well was about to write nearly the same as @CraigDJones just commented.

No need for being sorry, I guess I'm just not great at explaining this stuff. Anyway, allow me to try another explanation of what I'm struggling with
Imagine the tileset in the screenshots would be parts of a building instead. In the good old days i would pick a wall and place it many times on a grid next to each other, maybe a window here, a door there... I'm sure you know what I mean. Now in Blender i don't seem to have any grid or axis to lock my tiles to, so i have to be very careful not to create gaps. Also I don't want any distortion in perspective, just a plain mapping on the surface

@CraigDJones I may be able to use the UV editor directly, but as far as I can see this may be way more complicated than just painting on the surface itself. This is why i was hoping to use the Texture Painter. Maybe is this something I'm misconceiving here?

Painting them on as they are there is too complicated - UV mapping an image to a plane is easier imho. Is that a sprite sheet? Have you looked into the UV modifiers?

Thank you very much for helping me out! Yes, that is a sprite sheet indeed. It's not the exact one I'm using, I just picked this one from Google to give you a better idea of what I'm after.
I have some experience with manual UV mapping, yes. That was how I used to do it in 3D Max back in the days. Would you recommend that I do my texturing on the UV mapped image inside PhotoShop (or image editor of choice) then? If so, how would I be able to achieve a planar mapping? I mean, I could do this by hand I guess if this is the preferred approach, but I'd like to keep things simple really.

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


text:
Freestyle without anti aliasing for pixel art (2.8)
I've got a simple question that likely has a very complicated answer.
Simple enough, I need to know how to make these freestyle lines completely sharp. I'm trying to make pixel art. By default, freestyle has some hefty anti aliasing. I don't know which settings to change in order to make the lines totally solid, and I haven't been able to figure it out.

I think AA is a property of the renderer rather than freestyle? Have you tried rendering with samples set to 1?

One option could be to pixellate a higher resolution render using the compositor.

I figured it out!
Set the sampling to 1, and it will get the effect extremely close, I might have to touch these up a little bit in a 2D art tool, but the effort will be minimal.

This is a great way to make 2d pixel art.

Can you show your shader nodes for this flat shading?

Doesn't work when the freestyle line is thin and/or the output is small (32px). Well, it "works" but the black outline bleeds horribly in unexpected pixels everywhere and the result looks very bad.

Seems you can't switch off antialiasing for Freestyle, and you'd be better probably with separating the rendering twice - once with freestyle but with layer material override set to emission white.
Then you can use thresholds in the compositor to Make the freestyle pass completely black/ transparent (use math node - larger than). It seems the render itself is pixelated enough, so there won't be a problem.
Read more about View layers here:
https://docs.blender.org/manual/en/latest/render/layers/layers.html#view-layers
And material override here:
https://docs.blender.org/manual/en/latest/render/layers/layers.html#override

It looks like material override isn't available in the new blender 2.8, I did a lot of digging and just couldn't find it. I did manage to get the render layers separated though.

it's there, just tested and added a picture here too.

OH! Gotta be in cycles render. The option isn't available for eevee.
Oh no :c I'll have to remake all of my materials, wont I?


text:
UVs button is missing
I want to export the UV layout of a mesh but I can't seem to find the UVs menu in the image window to save the UV face layout (according to the blender wiki). I could of course use the plain command but that seems like a bit of a workaround, and there is also a lot more in that UVs menu that I'm not able to acces.
edit: the switch to edit mode did it

Do you see the UV layout in the window? The UV-editor also is an image viewer and editor. It also shows the render result.

Hit spacebar then search Export UV layout. Good luck. However, this menu will only show up when in Edit mode. If you are certain about this, I suggest you at least upload a screenshot or demo file link, to have others convinced.

If you have unwrapped an object and you are in edit mode (so that you can see the unwrapped object in the UV editor) there should be an UV menu. Here a three screenshots to show how it should look.


text:
Draw type stuck on wireframe and no model when rendered
My draw type is not on wireframe but all I see is this:

What can I do to fix this?
Version 2.49b
edit: Link as requested
https://www.mediafire.com/?u93956gqgss45pk

Why are you using Blender 2.4x?

Version we use at my college

I would strongly encourage you to talk to your professor about upgrading to 2.5x or learning that version in your spare time. 2.4x is now obsolete for the most part. The modeling tools are old, the interface is extremely cumbersome and there is no new content (tutorials, updates etc) being made for it.

It's very hard to understand how your models managed to end up like this but the reason they appear like that and don't render is because they have no faces. Blender won't render lone edges or vertices. Tab into Edit mode and select 4 vertices on any of the objects and press F to create a face.
I would recommend recreating the scene instead of trying to fill in the missing faces.


text:
How to align polyhedra face to face in an array
I am trying to create an array that starts from the object's face rather than from its geometric center (to create objects made of tiled polyhedra), here is an approximate example of what I mean:

To make an array I've moved my object's origin to a face and made a custom transform orientation perpendicular to the face:

Yet when I create an array it doesn't behave the way I thought it would:

Looks like the offset occurs from the object's center rather from the face, and the direction of the offset doesn't make sense to me (it's supposed to be X, why is it going upwards?).
How do I get my modifier to start from the specified face along the specified axis?

Well, I found the solution. Although the result does not look like the object on the very first picture, the array elements lined up face to face, which is what I wanted.
The problem is that some non-rectangular polyhedra have no faces being normal to their coordinate axes. Since the array modification relies on the "local" coordinate system of the whole object, you can't produce an array with objects aligned face to face unless you change the object's local axes.
The solution is basically given in the comment above, with a tweak to achieve perfect alignment of the faces. So, once more:

Create an icosahedron and a cube.
Using a plugin ("align by faces", from here), align the face of a cube with one of the object's faces.
Delete all of the cube's vertices.
Join the icosahedron TO the cube (not the other way round) so that the resulting object inherits the cube's axes.
Origin to geometry and create an array.
Create an empty in the center of the icosahedron. At this point you can set the empty as the offset object to check how things are looking.
Rotate the empty so that the "normal" axis (along which the array should be situated), in my case the x-axis, aligns with the icosahedron's axis. I just copied the angle numbers from one to the other.
The result is this:

And of course this can be further tweaked by moving/rotating the empty and changing offsets.

You may consider to use the Align by Face addon, which is already implemented in every blender builds now.

CtrlAltU to bring the User Preferences window, enable Align by Face addon under Addons tab (usage can be found here);
Duplicate one copy to make the first align by face, then CtrlJ to join them.
If you repeat the last step, the array can be done in geometrical progression. Sometimes the final rotation alignment may be inverted, then you can rotate the new aligned mesh with the technique you've already known.
Go to Edit Mode of the fninal joint mesh, select all elements and W > Remove Doubles.

After a few steps, I think you may get the result as you expected, like this:

It is not an automatic way, but may be acceptable with a limited array amount.

Another option is to do this by mirroring along face:

Create the icosphere;
Select one face. Ctrl, (switch to median point); ShiftS > Cursor to Selected; . (swich to 3D cursor);
AltSpace > Normal; CtrlAltSpace, rename this new transform orientation;
CtrlI, ShiftDEnter, CtrlMZZEnter;
Repeat the last three steps, until what's expected;
Remove Doubles after finishing.

Thanks Leon! That's the method I used to produce the first picture in the question. I just wanted to see what can be produced using the automatic arrays.

I see. I'm afraid further coding is needed here.

I like the mirroring along face option! That's a faster way to do it.

You'll notice that the offset is in the direction of the green arrow, which happens to be the LOCAL x-axis ;-) To clarify, the relative offset is using local space, so it will be in the directions that relate to the local axes, not the global axes.
It will help to make your object's axes the same as the world axes. This just makes things a little more intuitive.
It may also help to explore using the "Object Offset," which makes it relative to some other object, like an empty. It can be easier to see what's going on, that way.
Hope that helps!

I see. I thought that if I'd selected the custom orientation the modifier would use it. But instead the modifier is using the local orientation and that's why the center and the direction of the array is not according to the custom orientation ("empty").

Quite right. That's also why you can grab the original object and transform it, and the arrayed objects will follow it around, even if you rotate, etc. If you use another object, like an empty, you'll have to make sure and move the empty with the original object anytime you ever transform it. (A simple solution would be to make the empty a child of the original object)

I've been messing around with empties and it didn't get me very far. It seems to me that the problem really is that you need to change the local axes so that one axis is normal to one of the faces. This thread: http://www.fsdeveloper.com/forum/showthread.php?t=427932 has a mechanism for changing the axes. Accordingly I've created a cube, aligned it with a face of my icosahedron -> delete vertices -> join -> origin to geometry. It worked and the resulting array is doing what I want it to do, except I need to get the rotation right.

I'm glad you found something that worked, but I really think that's the long way around. Without experimenting more myself, I can't be certain, but my spidey-sense is tingling somethin' aweful. I really think a much easier way is very close by.

authors: Александр Дубинин


text:
How do I transform triangle polygons into quads?
I'm trying to learn Blender. I started modeling this "easy" exercise, but I can´t make step 5 in the process, please tell me how do this. I've got everything up to this step.
Thanks!
Marko.
(Full size image)

the model I done in blender

I'm not sure how to help. What are you trying, and how does it "not work?" Are you using the command, but it doesn't seem to do anything, or are you having trouble understanding what steps to take to make number 5 (I can't say that I understand exactly what number 5 means either)?

Hi, first sorry for my english... When try to make the command to triangle like said in step 5 nothing happen... subdivide (W) the edge of triangles but connect vertex tool don´t work to make this... maybe one step losing in the process...

Adding another image to try to explain my question...

Your title is not relevant to your question. I'd suggest change your title. Perhaps, you can consider "How do I transform triangle polygons into quads?" Afterall, that what you wanted to do.

This can be done within 10 secs. I've seen this tutorial two years ago. I'm sure you can speed up the whole workflow with the new powerful tools developed since then. :) My suggestion for step 1 to 5 on this exercise can be seen below in briefly 3 steps. However, if you just want to focus on the exact question, just jump to Step 3:
P.S.: Since you said you are new to Blender, I tried to reproduce every detailed step, so it may look a bit long, but all operations can be done in a flash if you get it then.

...WOW!!! is amazing how easy you show the all process... thank you very very much for your help... I post the final result...

I've updated another choice for Step 1, which is almost accurate, and much much faster. Fyi.

Well finally finished this tutorial, thanks to all to help me to understand the tools to modeling in Blender... Go for the next, some tips?.
.
.

Well, I don't think we should expand the talk here, since it's sort of off topic. But here, two points: You shouldn't do step 8 before step 7; and you have to apply the modifiers before going ahead. If you still got question, welcome to ask as a new one then. :)

I'm not completely sure what the tutorial want's you to do with those tools. However, you can use a few different tools to do create the same topology:

Select each edge of the triangle and subdivide it (W > Subdivide):

Select the face and poke it (AltP).

Turn them into quads with the face tool (F):

Thank you very very much... I sudivide all edges at same time and make another kind of divisions...follow your advise and make triangles to quads like tutorial..thanks a lot.

Do you have another way to do this more "easy"?..thanks again.


text:
Is there a way to show statistic info?
Is there a way to get Statistic info in Blender? Or heads up display? Like when I select a group of vertices, I need a way to know how many vertices are selected and How many polygons "or triangles my scene has.

For Blender 2.79 and older check the header of the Info Window, above the 3D View to the right by default on the factory screen layout.

For Blender 2.8* series check the status bar running along the bottom of every main window towards the right.

For 2.9 series this has been moved into each independent viewport, so it can display relevant statistics for each separate 3D View depending on what is shown/selected in them. You can toggle it on or off from the Overlays Popover in the 3D View header.

There are statistics about the scene's total count of vertices, faces and triangles, in addition to your current selection of objects.
If you enter Edit Mode, it will switch to showing statistics about currently selected objects.
Global scene statistics (not dependent on viewport states) can be found on the status bar, in addition to system stats, like available memory and GPU VRAM.

If you need to see them at the bottom right of the screen you can enable the information using Edit > Preferences > Interface > Editors > Status Bar, and enable the information you want to view as part of the Status Bar.
You can also just right click on them and pick the desired options.

There's no way to have statistics about the selected object? I am working on an object and trying to optimize it, can't see its exact stats, apparently...

Isolate the current object

Is this accessible via python? For instance Triangles for scene?

2.9 still has it where 2.8 did.
Right click the bottom bar and add scene statistics.

Same with Blender 3.2.0 - at the very bottom of the Blender window (you'll see "Select", "Rotate View", etc). Right click, check "Scene statistics"

Same on Blender 3.6.2


text:
Motion tracking: I have a solve. Now how to get the camera position for each video frame?
TLDR: I've solved camera motion for a video clip. How can I export each camera's position and rotation to "real", unconstrained camera objects?

I'm using Blender's motiong tracking tools to reconstruct 3D spaces from still images (from an old game I love). I added in two image "frames", set up a bunch of tracking points, solved it (with 0.20px error, good enough for my purposes) and clicked "Setup tracking scene" to export the whole thing to my 3D workspace. Now I can press the arrow keys to jump between frames so I can see my 3D space from each solved camera position.

But I want to export each frame's camera position to a "real" camera object so that it stays in my scene even if I delete the empties etc. How can I do this? When I look at the properties for the 3D camera object, the position and rotation values don't change as I switch between camera positions, even though the camera clearly did move several meters.
I tried selecting the camera then clicking Object -> Constraints -> Clear object constraints, but this resets to the first frame in the video clip, so I don't see how to get camera coords for subsequent frames.

https://blender.stackexchange.com/questions/76256/bake-follow-track-constraint-to-f-curve and https://blender.stackexchange.com/questions/180912/i-have-a-camera-solver-on-a-camera-how-can-i-delete-the-solver-on-a-duplicate-c/180914#180914 and https://blender.stackexchange.com/questions/170949/connect-points-of-motion-tracks-with-smoothed-lines/175837#175837

When you solve a camera using tracking, blender creates a Camera Solver Constraint.
To clear such constraint, convert the camera motion to keyframes.
Select the camera and use Constraint to F-Curve in the Object Constraint Properties.

More info:
https://docs.blender.org/manual/en/latest/animation/constraints/motion_tracking/camera_solver.html

can I export also track feature points?


text:
Sverchok. A file which worked fine 2.8* no longer works in 2.91.0
With reference to a previous post of mine (Sverchok. Duplicating an object along a path), the linked file at that question (grille6) no longer seems to work in 2.91.0.
I've replaced the 'deprecated' Polyline Viewer with another viewer of the same name, but so far, no luck.
What am I missing?
* the previous version might have been 2.79 - I can't actually remember

Do you need to update to 2.91? Keep in mind that some addons (like the one you mention) might need updating on newer versions. It doesn't happen automatically.

@susu I think I do - in order to take advantage of some other features.

Issues with add-ons are easier to solve by contacting the developers directly. Try downloading the most current version from github.

I have, and the developers hang around here too

reget object in
reget path
switch POLY in viewer
https://yadi.sk/d/li_uYmjR2dLsxA
try this

Thanks - that works - although I can't see what's different from what I tried !?!?! But thanks again.

@Strawberry instead of thanking in comments, mark the answer as accepted.

@susu Don't worry, I will in due course.


text:
Mirror modifier. Mirrored half is not aligned, but rotated

I was working on my character's hand when I realized half of the body was suddenly deleted. I am trying to recreate the other half, but it just won't mirror properly in the center. I tried moving the origin to the 3D cursor while it was completely centered, but the mirror modifier is still applied at an angle.

Has the rotation been applied?

how do i apply rotation? and what to?

Ctrl+A > Rotation

This doesn't have anything to do with your problem, but your normals look like they are inverted.

What you are seeing is caused by not applied transforms, specifically rotation. Since the mirror modifier mirrors along the local axis by default, it is not mirroring as desired. What you can do is apply the rotation using Ctrl+A > Rotation. This will set the local axis orientation the same as the global axis, and should solve your issue.


text:
What is the use of a "Group Input" directly in the Node tree of the material?
What is the use of a "Group Input" directly in the Node tree of the material? Note, not within a nodes group
It can be easily added to the material nodes tree, but I don't understand its usefulness.
Is there any particular function? If so, which one?

Note:
I know what a group inputs node in the node group is for.
So my question is specific what it is for in a node_tree of the material.
If anyone is 100% sure that the "Group input" node in the material node_tree is useless, please explain why

I don't think that it is useful out of the node group itself, it is useful in the node group, if you want to create another set of inputs or outputs

+1 moonboots ... probably they should not be accessible from GUI out of node group or be able to copy-paste out of group at all.

I describe your "within a nodes group" use below.  Unlike Geometry nodes -- where Group Inputs and Group Outputs appear in the GeometryNodes modifier, there is no such access to defined variables in the top level of a material node.  In some ways the shader editor doesn't know that you're inside a group or at a top level.

Semantically node group trees and top level node trees are the same. The information is stored in its user's properties, but any node tree can have an indefinite number of users. I think there is no way to know the information "this node tree is top level" without first having to iterate over all nodes of all node trees of all materials in the scene to check if this particular node tree isn't used as a node group. So the answer would be : "none". But it's computationally expensive to check if this node should be available in the context of a node tree. My 2 cents

@Gorgious I just tested in Python: mat.node_tree.inputs this returns the inputs without having to iterate the nodes in the node_tree, also python recognizes it as a node_tree (Just like in the case of a Node Group)

Yes, but this is a member of all node trees constructs so having an empty inputs collections doesn't necessarily mean that a node tree is top level, only that it has no inputs.

@Gorgious Ok, we agree on this. It would also be nice to have some input on the material, I was looking for that too. But it seems like you can't have access to this input at the top level

In geometry nodes, you can use a top level node tree as a custom group within a node tree. Perhaps Blender devs plan to change material nodes to work in the same way...

Even better is the fact that if you use both GroupInput and GroupOutput (with the surace, volume and displacement outputs), you can reuse complete materials as a node in other materials!!

@Secrop I  can't reproduce it, testing on Blender 3.2. Is it a new feature in Blender 3.3? I think if you can show how to do it, it's worthy of an answer.

If you grab your whole material except the Material Output Node and put it in a group. You can expose input values to that material in the GroupInput, and reuse it in other materials. (In Previous versions of Blender you could even use the material's nodetree directly in a ShaderNodeGroup, but in the current build the parser has changed for worse and that doesn't work anymore)

What do you mean by the "previous versions, @Secrop ? 3.1 and earlier?

@MarkusvonBroady idk exactly when this had changed but it was working around 09/2020 as you can see here: https://devtalk.blender.org/t/how-useful-could-be-a-material-input-node/15104/13?u=secrop

@Secrop so will you write the answer with using the input and output to direct the connections of input and output groups when creating a custom group? It seems like the only usage currently, and would be a shame for bounty being wasted.

@MarkusvonBroady as it seems, noob-cat doesn't care for the correct answer. It's a lame, I know.. such attitudes just make people not wanting to share anymore whatever knowledge they have.

@Secrop maybe OP hoped for a different answer. It is somewhat anticlimactic that those nodes can't be used in a better way.

The reason is simply that there's a bug with the poll function for the GroupInput and the GroupOutput (perhaps because those are now being yielded by a generator).
As this is something that is not checked in the typical tests, and most developers aren't looking for these kind of defects, it's one of those little strange things that finds its way into the final release.
It's not a priority bug and probably nobody reported it, so no developer has picked it and solved it.

Meanwhile, a patch was commited and new versions of Blender should have this fixed.

This is super-quirky, but if make a custom group out of a single node, inputs and outputs are automatically connected, but you can control the order of inputs using the Group Input node - for example, if you want the Scale and Detail of Noise Texture to be last:

Notice how the types of sockets don't matter for this.
Same for Group Output:

When you convert multiply nodes to a group, you can use Group Input and Group Output to make the input/output connections even before grouping, which is very helpful, even though you can't modify the types and names of Group Input/Group Output sockets:


text:
How to save User Preferences With Python without using bpy.ops.wm.save_userpref()?
The question is very short, so it is simply this:
How can I save user preferences, without using bpy.ops.wm.save_userpref()?
I'd like to create a function that would save everything or some part of the preferences, without the use of the operator.
I don't know if this is possible.
The main intention is to save only some preferences, for example some custom preferences in a bpy.types.AddonPreferences pointer property

It's not possible to save the preferences as userpref, that is, in the preferences file, without using save_userpref() but it is possible to write a utility that saves them to a separate file and then restores them before using them.  If that's a suitable approach I can write up an example.

I think it would be interesting, if you are sure there is no other way (And I think so too)

Blender does not export a low level interface to the preferences file, nor is the format of the file documented.  The interface is documented under Preference Operators and the contents, but not layout, of the preferences are documented starting at bpy.types.Preferences.
However, you can use Blender's presets facility to maintain your own settings in files that are stored with your add-on. This mechanism is described in Using Blender's presets in Python and you can find a skeleton add-on that demonstrates presets in my Skeleton github repository
A preset is a Python file containing a collection of settings values.  Here's an example from my skeleton add-on:
import bpy
scene = bpy.context.scene

scene.name_from = 'Alice'
scene.name_to = 'Bob'
scene.message_text = 'whatcher?'

It's just a collection of statements that set the values of properties, in this case three string properties that I've added to scene called name_from, name_to, and message_text.
A collection of related presets is stored in a single directory under you addon.  These preferences are used in a panel, so they're store in skeleton/skeleton.panel.
Operator presets are described to blender by deriving a class from AddPresetBase:
from bl_operators.presets import AddPresetBase

class MT_MyPresets(Menu):
    bl_label = 'My Presets'
    preset_subdir = 'object/my_presets'
    preset_operator = 'script.execute_preset'
    draw = Menu.draw_preset

class OT_AddMyPreset(AddPresetBase, Operator):
    bl_idname = 'my.add_preset'
    bl_label = 'Add A preset'
    preset_menu = 'MT_MyPresets'

    # Common variable used for all preset values
    preset_defines = [
                        'obj = bpy.context.object',
                        'scene = bpy.context.scene'
                     ]

    # Properties to store in the preset
    preset_values = [
                        'obj.show_axis',
                        'obj.show_name',
                        'obj.show_bounds',
                        'scene.world'
                    ]

    # Directory to store the presets
    preset_subdir = 'object/my_presets'

Blender will handle the I/O between your operator and the presets.
Panel presets are created by deriving a class from Panel and PresetPanel:
from bl_ui.utils import PresetPanel
from bpy.types import Panel, Menu

# [...]

class MY_PT_presets(PresetPanel, Panel):
    bl_label = 'My Presets'
    preset_subdir = 'object/my_presets'
    preset_operator = 'script.execute_preset'
    preset_add_operator = 'my.add_preset'

# Now we need to make our actual panel draw the header from the presets panel

class My_PT_Panel(Panel):
    bl_label = 'My Panel'
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = 'output'

    def draw_header_preset(self, _context):
        MY_PT_presets.draw_panel_header(self.layout)

    def draw(self, context):
        # The rest of our panel's code
        pass

You can also use a helper function to copy predefined presets to their starting points, or you can zip your add-on with the predefined presets included.


text:
How to read the properties of an data object into a file.blend without loading it into the current project with Python?
I would like to set some rules before loading a date object, into the current project.
But I don't really know how to do it and if it is possible to do it.
So I give an example:
I would like to import (Then load) an object, only if it has a material in at least bpy.data.objects['object_name'].data.materials[:]
Unfortunately I realized that the bpy.data.libraries.load() method may not do what I have in mind.
Below, I report what I tried to do (which obviously does not work) but forste explains better what I would like to do:
with bpy.data.libraries.load(my_path, link=False) as (data_from, data_to):
    objs_to_load=[]
    for obj in data_from.objects:
        if obj.data.materials[:]: # <--Incorrect example on purpose
            objs_to_load.append(obj)

    data_to.objects = objs_to_load

Clearly in the example above there is an error, I cannot read obj.data.materials, as it results in a string.
The problem is that I don't want to import the object, as I don't want to fill the memory with useless objects for my purpose.
Anyone have any idea how to do it if it is possible?

Unfortunately it seems blendfile.py is the only option (reading the binary file directly). https://blender.stackexchange.com/a/109704/86891 I hope you're ready to learn a new language :)

The module is interesting, but there seems to be no documentation about it. So it turns out unusable, without in-depth knowledge

Yeah that's what I meant in the last sentence...

I think the best option would be to "ask blender to run its garbage collection now", but searching around I don't see an obvious way to do that, the defecto option is to save-loading the project :( https://blender.stackexchange.com/a/75608/3038

One obvious but inefficient way is to run a new Blender process in the background that opens the file and grabs whatever data you need. The data will need to be serialized by the background process, passed back to your script, then deserialized.
Afterwards you can use the data with libraries.load.
Here's a simple example:
import bpy
import subprocess

my_script = """
import bpy
print("$ BEGIN")
for ob in bpy.data.objects:
    if ob.material_slots:
        print("+", ob.name)
print("$ END")
"""

my_path = "Test.blend"

result = subprocess.run(
    [
        bpy.app.binary_path,
        "-b",
        my_path,
        "--python-exit-code", "1",
        "--python-expr",
        "exec(%s)" % repr(my_script),
    ],
    capture_output=True,
    check=True,
    text=True,
)

# Deserialize object names
lines = result.stdout.splitlines()
lines = lines[lines.index("$ BEGIN") + 1:lines.index("$ END")]
ob_names = [line.removeprefix("+ ") for line in lines]

print(ob_names)

Interesting, does it work on all operating systems?

I don't know why it wouldn't (maybe text encoding?), but you'd have to try it. Tested on Linux here.

I've tested it on Windows 10, Everything seems to be fine, and it works great. It only remains to be tested on the Macintosh Which unfortunately I don't have on hand


text:
How to avoid inserting some items in a custom UIList?
I'm trying to compile a UIlist, but I don't understand how to avoid inserting some sockets.
In this example, to simplify things, I want that if a Socket is named "Empty" it doesn't get put in the UIlist, so what I get right now is that in the UIList, I get some "empty" item.
I would like to avoid these empty items in the list. How can I do?
class Node_UL_node_interface_sockets(bpy.types.UIList):

    filter_string: StringProperty(name="filter_string",
                                  default="",
                                  description="Filter string for name")

    def draw_item(self, context, layout, _data, item, icon, _active_data, _active_propname, _index):
        socket = item
        # if socket.name == "Empty":
        #     # I need not to display any "Empty" name lines
        #     return

        color = socket.draw_color(context)

        if self.layout_type in {'DEFAULT', 'COMPACT'}:
            row = layout.row(align=True)
            row.template_node_socket(color=color)
            row.prop(socket, "name", text="", emboss=False, icon_value=icon)

        elif self.layout_type == 'GRID':
            layout.alignment = 'CENTER'
            layout.template_node_socket(color=color)

    def filter_items(self, context, data, propname):
        # This function is really difficult for me to understand, it seems very confusing to me and I can't manage it

        items = getattr(data, propname)
        if not len(items):
            return [], []

        filtered = [self.bitflag_filter_item] * len(items)
        for i, item in enumerate(items):
            if not item.name == 'Empty':
                if self.filter_string in item.name:
                    filtered[i] &= ~self.bitflag_filter_item
                else:
                    filtered = [self.bitflag_filter_item] * len(items)

        return filtered, []

    def draw_filter(self, context, layout):
        # In addition, I want to keep a search by name.
        row = layout.row(align=True)
        row.prop(self, "filter_string", text="Filter", icon="VIEWZOOM")

As in the example above, I tried to do this, but I really don't understand how to handle this filter_items() function
I would also like to keep a search by name, that's why I put the draw_filter function (self, context, layout), it seems to be very convenient, because it replaces the default one.
But the problem remains the understanding of the filter_items(), in addition I do not understand why if I return an empty list [], the UIList, will show all the items equally, Maybe because the list must be filled with what should not be shown, I suppose yes, but it's really frustrating, I have no idea how to continue this.

The usual way to do this is with a filter function.  See UIList for an example in the manual or Amazing UILists in Blender with Custom Filtering for a tutorial.

Excellent example, but very complex. In that case we consider the use of the filter under the UiList menu. I find it hard to understand

it is a bit hard to understand, unfortunately.  UiLists can be very complex to use.  I suggest you try it and when you get stuck on a specific issue, modify your question to cover precisely that issue.

Ok but I'm not sure how to assemble this class. I put a simple example case, if a socket has a certain name, it must never be shown. Without the use of native filters under the UIList

start with this answer.  It does more than you need but not exactly what you need.  Figure out what to do in filter_items to filter on what you want to filter on.  Decide whether you want to allow the filter to be editable and if you don't remove the editing operators and their panel entries.


text:
Normals messed up after applying transform
I have a simple cube that I'm using to make a wall. I had already duplicated the cube to make more walls and cut some doors and windows into them before I realized that the normals are getting messed up somehow. None of my other cubes have the problem, but I'd rather not repeat all of my work if it can be avoided.
The problem comes when I try apply the rotation and scale to the cubes so that I can use the bevel tool on the door hole. It happens on all the walls, even the one that doesn't have any modifications other than scale. The incorrect normals are visible if I switch to smooth shading, I'll see a diagonal shadow line going across the wall where the triangle would be if it were triangulated. I tried recalculating normals, but that didn't fix it.
If I view the normals before and after applying the transformation, I can see the problem. Before applying it, the vertex normals come straight out in the same direction as the face normals. Smooth shading works fine in this case. If I apply the transformations, the vertex normals change and come out at an angle instead of coming out straight. Nothing I do seems to be able to fix them.
The geometry is fairly simple, as I said one of the walls it happens to is just a scaled cube. It's only got 8 vertices. So there are no duplicate vertices, or hidden faces, or anything else I can think of that might cause the problem.
Is there something else I can try to properly rebuild these normals or am I going to have to model all my walls over again?
EDIT: I rebuilt the walls over again and the one that is a plain cube is no longer having the issue. Maybe when I was moving the vertices around for sizing I accidentally added on somewhere or something? The ones with the door cutouts are though. In this screenshot the whole thing is set to smooth shading. An edge split modifier only fixes it if I take the angle all the way down to 5 which no longer smooths the door frame. If I set the wall to flat, and individually set the door frame vertices to smooth, the problem goes away in shaded view but comes back in both Blenders textured view and when imported into Unity (whether I let Unity calculate normals or use Blender's)

Edit2: I just realized that I never applied the transform to the plain cube wall. When I do, the problem comes back. It looks just like the one in the screenshot except the messed up normal goes all the way from the top left to the bottom right.
Edit3: I've added the blend file for those asking about it. When the wall is set to flat shading and view mode is set to solid, the problem doesn't appear. But it does appear pretty bad in Unity whether it is set to flat shading or not and it's slightly noticeable in Blender when set to textured mode as well.
Blend file

Could you add some images or a .blend? I can't seem to reproduce this.

I added a screenshot. It may be a different issue now because I deleted the old walls and started over. The one that is just a cube is no longer having the problem. It persists in the two with cutouts though.

Have you tried the latest build other than the one you're using? Since it would possibly be a bug, and possibly be fixed already. Btw, It's true that "A picture paints a thousand words", but a .blend file is the straightest way to expose the issue to others, if possible.

I just updated the question with a link the blend file. I'm already using 2.69, which is the latest version listed on the site.

I still can't reproduce the problem, even when using the linked file. Scaling and applying scale does not seem to affect the shading either. Tested with smooth shading in solid view.

The problem can also be caused by manifold meshes that have other issues, such as non-uniform normals. I ran into this issue just yesterday. I extruded a single plane into a prism, without realizing that the plane had preexisting issues with its normals.
As an aside: faces don't actually have normals. Each vert has a normal and a face's normal is calculated from its associated verts. One of my verts must have been upside-down, making the plane's normal... weird. As odd as that is to consider, it can happen.
The tricky part was that the resulting prism looked perfectly fine. The problem manifested in OTHER parts of the same object (as invisible faces), but that were not connected to the prism, even though there was nothing actually wrong with the part of the mesh where the issues manifested. It took me FOREVER to figure out, because I thought it was a non-manifold edge somewhere. Once I recalculated the normals on that prism, (because I'd tried EVERYTHING else) everything was fine.
All of which is to say, the problem may actually be in a part of your mesh that looks totally fine.

The most common cause for normals failing to calculate correctly is a non-manifold mesh. Manifold means that every edge has exactly two faces attached to it. Non-manifolds occur, for instance, when there are internal faces connected to the surface.
By pressing shiftaltctrl-m (edit mode, edge or vertex selection mode), you can select all non-manifold edges.
Then remove the "errors" manually one by one.
After this, pressing ctrl-n should give you the desired result.

The OP said that this is occurring on a cube. "The geometry is fairly simple, as I said one of the walls it happens to is just a scaled cube. It's only got 8 vertices. So there are no duplicate vertices, or hidden faces, or anything else I can think of that might cause the problem."

After redoing the walls, the problem is no longer there in the one that is just a scaled cube. The ones with the cutouts still have the problem, but selecting all non-manifold edges didn't select anything so I'm guessing that isn't the problem.

I don't think there is anything wrong with your normals. This is what happens if you set an edge where the 2 adjacent faces have an angle > ~50° to smooth shading. The interpolation fails / is a bit off. If you set a cube to smooth shading it will also not display correctly. I cannot check the blendfile, it is no longer available, but adding a bevel or edge split modifier should solve that problem.

After applying scale, if the normals/shading look(s) messed up, they can be fixed by selecting "Auto Smooth" under the Normals section of the Object Data tab (the icon with three vertices).
Also, if that does not fix it, check out the Normal Edit Modifier (AKA Set Split Normals Modifier). I suggest separating the messed up part of the mesh (unless the whole mesh is messed up) and then adding this Modifier. It will tell you to set Auto Smooth (see above) before proceeding. I did not use this modifier much (I believe offset values must be changed for it to have an effect, though) because my problem was fixed once I enabled Auto Smooth for normals, but hopefully the Modifier will help you.

After having the same issue today, I have found a solution quite simple:
"Clear Custom Split Normals Data"

First Solution : Clearing Custom Split Normals Data

Warning: This is a Mesh operation, so selection will not affect it !

Press the Space-Bar
Search "Clear Custom"
And execute the command
Et voilà !

Second Solution : Sharp Edges

This might also due to sharp edges apparently : blend4web Fixing Normals - Sharp Edges
In case it's going down :

In Edit-Mode, open the side menu with N
In Mesh Display, check Sharp
Check for any unwanted sharp edge and select them
Press Ctrl + V and select Clear Sharp Edges


text:
Jagged and wrong looking shadow on hair particles
The shadow on my smooth shaded sphere with hair particles just looks wrong:

Blender scene with wrong shadow
I use Blender version 2.69, normals are turned outside and there are no doubled vertices. Without hairs the shading is ok.
Thanks for help and suggestion to improve the look.
EDIT: To make the ball look more realistic I further changed the following things:
I made 2 particles - one with "Render -> Strand render" (makes hair really light) and one with "Render -> no Strand render" and less children hair (gives a dark accents to the other particle setting).
I also made a new material for both particles (for more natural looking):

Material -> Diffuse -> Ramp from yellow to transparent
Material -> Strand  -> Root 0.25 (for thin root)
Material -> Strand  -> Tip 0.25 (for thin tip)

Patricles Settings for both particles:

Patricles -> Velocity -> Normals 0.03 (longer hair)
Patricles -> Render   -> Random 0.05 (Shadow really get smoother)
Patricles -> Children -> Render 50 or 300 (less children
also helped to smooth shadow)
Patricles -> Children -> Length 0.7
Patricles -> Children -> Random 0.05 (looks more furry)
Patricles -> Children -> Size 0.01

The jagged shadows arent visible now. Probably the particles aren’t meant to be used with few short hairs where you can see the shadow through.

The hair particle you are using needs better setting for the Children panel, especially the Random value.

@LeonCheung, do you mind posting this as an answer? Makes searching for answers much easier.

According to your setting on the hair particle, the Random value in Children panel needs better tweaking, at least.

@Leon Cheung is almost right.
The hairs are coming out exactly parallel to the normal. Because all the hairs on each face are pointing exactly the same direction, the shading on the hairs is going to change sharply at the edge of each face, even though you're using smooth shading.
One way to solve this "problem" is tweaking the Random value on the children. This will prevent the hairs on one face from all pointing exactly the same direction. Another thing you can tweak is the random rotation. Just add a very small amount of randomness, and this will also keep them from all facing the same direction.
These solutions should work without having to make your hairs longer.

So nice of you to make the detailed explanation on it. :) I think the mesh should be further subdivided in order to dicrease this jagged look.


text:
How to load correctly submodule into __init__.py Taking into account the use of bpy.ops.script.reload()?
I'm building a module that contains only functions, which I named functions.py, it's in the same directory as the addon's __init__.py file.
So I have various solutions:
Solution 1:
from . import functions

Now I can call the functions contained in functions.py module like so:
functions.my_function_one()
functions.my_function_two()
#Etc.

Solution 2:
from .functions import *

Now I can call functions like this:
my_function_one()
my_function_two()
#Etc.

I particularly like the use of the second solution (But I don't know which is the best idea)
Anyway the question is: when I run bpy.ops.script.reload()
Changes made inside functions.py module will not be reloaded, Only by restarting Blender will these take effect.
So I'd like to understand how to go about solving Solution 1 and 2
I want to clarify that I ask this, as it is quite frustrating to have to restart the blender at every minimum change of the modules.

from xxx import * isn't recommended, can lead to problems down the road. you could use import functions as f to make the first solution shorter to write

Hello @wilks I really appreciate the comment, and would love to know why you suggest this. I still don't have the skills to fully understand this (Unfortunately)

Importing * in Python. | Medium. This post explained well, basically it's fine if you know exactly what is imported inside your code. But most of the time, write out them explicitly will be better since most of the packages/modules you used are not written by you. And also, after a month, you will forget what you have written in your functions.py.

@HikariTW Sounds cool, you convinced me to avoid using solution 2, this makes a lot of sense.

https://blender.stackexchange.com/a/158787/15543

It is not that bad to use the second method if you're not collaborate and distribute your project with other. In other words, personal usage is fine if you do take care of naming confliction.
The problem when you reload script is a common mistake that you assume that all object you imported from that module is reloaded by the reload method (imp.reload()). Instead reload all relative script, Python will only reload the required script, which is your module, not the * objects.
You can some how use Python built-in reload function to specify the updated script that you want to use and reimport * again:
from imp import reload
reload(function)  # bpy.ops.script.reload() seems like a sugar macro that handle the dependencies

from functions import *
# This is required since you don't reload e.g. `foo()` and `bar()` in your functions

And also if you want to use Method 1 for correctness:
from . import functions as fn
fn.foo('bar')

or
# You should take care about relative import path issue
from ./functions import (
    foo,
    bar,
    a_very_loooong_name_function,
)
foo("cool")
bar("hello")

each time you reload any module, the from import objects need to be reassign again to update its content

Ok,sounds cool,  but I don't understand how I have to organize, at the beginning of the script, this, so that I can reload everything using bpy.ops.script.reload() . I decided to use my solution 1, as it actually seems much more reliable, so as not to create possible conflicts of variables.


text:
How to get bl_info {dict} into submodule if it is possible?
I have some functions that need to get the version of the addon to stamp in a custom property the version number it was run with.
Beyond that I do not know if it is a correct practice, I was wondering if it was possible to create a submodule with the bl_info (which I have already tried without any success), and call it when needed, or, to obtain in a submodule, the bl_info directly, contained in the __init__.py (i.e. the addon module)
into __init__.py:
bl_info = {
    "name": "My addon name",
    "author": "NoobCat",
    "version": (1, 0, 0)
    "blender": (2, 93, 0),
    "location": "",
    "description": "",
    "tracker_url": "",
    "category": ""}

Or my guess in a submodule, but it didn't work:
into utility.py:
def get_bl_info():

    bl_info = {
            "name": "My addon name",
            "author": "NoobCat",
            "version": (1, 0, 0)
            "blender": (2, 93, 0),
            "location": "",
            "description": "",
            "tracker_url": "",
            "category": ""}

    return bl_info

Now at the start into __init__.py
from . import utility

bl_info = utility.get_bl_info()

However, this does not seem to work
It seemed like a convenient idea to write bl_info in 1 place, and have access from any module easily. But I have recently been working with modules and am still very confused

Related https://blender.stackexchange.com/questions/195656/is-there-a-method-to-create-bl-info-using-variable

bl_info is read out from __init__.py's AST (abstract syntax tree). IOW it has to be found just from parsing the code, without executing it. The code is only executed when the addon is enabled, but bl_info is needed even for disabled addons.
You can access bl_info defined at the top of __init__.py from utility.py with
from . import bl_info

I didn't know this, and it's really what I was looking for.


text:
How to rotate UV and preserve the correct aspect ratio?
Based on this answer,
Rotate UV by specific angle e.g. 30deg in Python script in backgroud mode

you can do a rotation of the UV mapping, then enter the rotation angle, so far everything is ok.
The problem arises when working with images of rectangular and non-square proportions.
This function will not take into account the appearance of this image, so the rotation will deform the image.
Obviously this does not happen in the uv editor.
It seems that this can be compensated for by obtaining the aspect ratio of the image. But I think it is an incorrect or inconvenient practice.
The question is therefore whether it is possible to obtain a correct UV rotation without knowing the aspect ratio of the image.
Here I attach the .blend example of the problem

UV editor uses the aspect ratio.

Closing the image in the UV editor on LHS demonstrates that the UV editor is using the aspect ratio of the image when rotating.  The LHS rotation result is equivalent to running script result in question, or with unit aspect ratio below.
Instead of our normal 2D rotation matrix,
$$R=\left[
\begin{array}{ccc}
 \cos \theta & \sin \theta& 0 \\
 -\sin\theta & \cos\theta & 0 \\
 0 & 0 & 1 \\
\end{array}
\right]$$
can allow for a non uniform aspect ratio $\rho$
$$R=\left[
\begin{array}{ccc}
 \cos \theta & \dfrac{\sin \theta}{\rho } & 0 \\
 -\rho  \sin\theta & \cos \theta& 0 \\
 0 & 0 & 1 \\
\end{array}
\right]$$
Here is a an object mode script using numpy and the $XY$ dimension of the object (for example, if imported using image as planes) to calculate $\rho$ which will emulate the rotation as shown on RHS of gif.  Setting p = 1 will be same as shown on LHS.
import bpy
from mathutils import Matrix, Vector
import numpy as np

ob = bpy.context.object
me = ob.data
uvlayer = me.uv_layers.active

pivot = Vector((0.5, 0.5))
angle = np.radians(30)
# aspect ratio
p = ob.dimensions.y / ob.dimensions.x
# aspect rotate
R = Matrix((
            (np.cos(angle), np.sin(angle) / p),
            (-p * np.sin(angle), np.cos(angle)),
        ))

uvs = np.empty(2 * len(me.loops))
uvlayer.data.foreach_get("uv", uvs)

# shear rotate about origin, translate to pivot
uvs = np.dot(
        uvs.reshape((-1, 2)) - pivot,
        R) + pivot
# write the new UV's back
uvlayer.data.foreach_set("uv", uvs.ravel())
# update mesh to display changes.
me.update()

Result on image imported from "Images as Planes" addon. Note positive rotation is clockwise, where-as blender uses CCW (simply change sign of angle to change)

This answer is great and works great. Really a useful answer

This deserves a  'wow', if you ask me. Missed it.  Trying to work it through.. you can call np.dot on a mathutils.Matrix? Should I not be surprised by that?


text:
A set of shader nodes and lights to separate the background from the foreground on a set of videos
I'm trying to create a cut out animation with ebsynth + blender. I've got some footage from a scene of a movie and I've recolored the frames where a man is walking and a black man is moving a little bit while he is sitting on a sofa.
I've recolored only the first frame of the scene and I've used it as the frame that ebsynth should use to copy the graphic style from.
As you can see from the images below, the new graphic style stuck on the body for the first steps of the men. But then, when he walks close to the door / window, the brown color of the jacket blends with the brown color of the door, and the grey color of the floor blends with the grey color of the pants.
You can see what happens very clear giving a look here :
https://drive.google.com/drive/folders/1Tx3b85RGyPWUDZOrNgXJ2SejZ4Fv7Ybi
(I don't know why,when I have recompressed the images produced by ebsynth,the video started playing very slowly)
So, I need to fix this wrong fusion of colors.
I've got an idea to achieve this goal. What about to "play" a little with the blender lights to give more contrast to the colors of the floor and of the door / window? or even to the pants or to the jacket of the man? Maybe I can place two lamps on the scene,the first one that gives the right light intensity to the floor and the second one to the door / window.
Or I should create a set of nodes that do the same. I'm not sure if I should to this only for the first frame, the frame used by ebsynth to copy the style from or to each frame of the original movie. I can do that,but my scenario is not so easy. In fact, I'm using 3 planes. On the first one I have projected the texture of the interior of the house, on the second and one I have projected the alpha image of the white man, and on the third one of the black man, as you can see below :

So,the lights and the set of nodes should take care of the alpha images of the bodies. Take in consideration that these bodies overlap perfectly over the old ones. When I have created more contrast between the background and the foreground (the alpha images of the bodies), I can separate them easier.
I imagine that for this matter I have also need to another set of shader nodes. That's all. I'm waiting for your precious suggestions. Thanks.

I'm confused as to why you need shaders. Are you using images as planes? This could be done in the compositor and there you would have control on background and foreground. Just do some form of color correction for the different elements.

yes,I'm using 3 images as planes. two of them are in the alpha channel,the 3 is the house not. Can u be more specific ? which kind of color correction do u have in mind ?

https://blender.stackexchange.com/questions/206305/how-to-color-correct-an-image-that-i-have-projected-on-a-plane-with-the-alpha-ch


text:
How to have a custom floatproperty based on the selected face? (Knowing that it is not possible)2.8
Reading here and I saw that there is no possibility of having a custom property based on a selected face, but in blender I think you can do "Hackerate" and fly over this problem. I think for example, creating a FaceMap,or a temporary vertex group and to base the properties on these objects bpy.types, I am probably wrong, but I would like to have an opinion from some fan of these experiments. I would create different problems with these methods I believe, has anyone got to try it?
Have float property registered in a class like:
class MY_PT_Panel(bpy.types.Panel):

bl_label = "blah"
bl_idname = "blah"
bl_space_type = "blah"
bl_region_type = "blah"
bl_category = "blah"

def draw(self, context):
    ob = bpy.context.active_object
    ###how to get property ?
    layout = self.layout
    row = layout.row()
    row.prop(##??##, 'my_float', text="")

class Myproperty(bpy.types.PropertyGroup):
    my_float: FloatProperty(default=0)

def register():
    from bpy.types import ##best type##
    ##best type##.faceproperty = bpy.props.PointerProperty(type=Myproperty)

I read about bmesh method but not understand if that information they are right for me : https://docs.blender.org/api/blender_python_api_2_78_release/bmesh.html
I have also seen looked at among the bpy.types. in the python console there is also bpy.types.SelectedUvElement
and bpy.types.UVLoopLayers
Assuming there is a uv, would I have the ability to customize the face property based on an uv layer?
Edit:
I would like to clarify that the use of the selected face is clearly useful in edit mode and on the use of a FloatProperty slider, so I would like the values on each face to remain recorded once interacted
To make me understand better, I would like to get this property as you would with a bpy.types.Object
like to in register:
from bpy.types import Object

Object.example_property = bpy.props.PointerProperty(type=Myproperty)

Mesh data layers
Mesh components, faces, edges and vertices, can have custom data layers. A float can be assigned to each face in a mesh with custom face float layer
In object mode the index of the active face is me.polygons.active  and in bmesh the active face is bm.faces.active, which will be None if no face is active.
Here is a simple test script.  Run in object mode. Adds a custom float layer, and sets the value of the active face to 5. Switches to edit mode, prints the layer float value of the active face.
import bpy
import bmesh

context = bpy.context
ob = context.object
me = ob.data

# add a float layer to faces
float_layer = me.polygon_layers_float.new(name="float_layer")

# set the value of the active face to 5.0

float_layer.data[me.polygons.active].value = 5
bpy.ops.object.mode_set(mode='EDIT')

bm = bmesh.from_edit_mesh(me)
# get the float layer
float_layer = bm.faces.layers.float.get(float_layer.name)

af = bm.faces.active
if af:
    print(af[float_layer])

UV is also a mesh layer, associated with face loops (each uv face has its own set of 2d coordinate verts, whereas mesh faces, if connected,  share verts with other faces at edges)  For an example see Text Editor > Templates > Python > Operator Mesh UV
Property and Panel
Since the property attains to a mesh, possibly a good idea to make it a bpy.types.Mesh property.
Have made an edit mode bmesh property on the panel. The poll method will set it, and clear it when in object mode.  The mesh needs a "float_layer" as explained above. Run the code above to add a face float layer to the active mesh object
The poll method is required to attach a live edit bmesh to the panel when the object enters edit mode (polls).

import bpy
import bmesh

class HelloWorldPanel(bpy.types.Panel):
    """Creates a Panel in the Mesh properties window"""
    bl_label = "Hello World Panel"
    bl_idname = "OBJECT_PT_hello"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "data"
    ebm = dict()

    @classmethod
    def poll(cls, context):
        if context.mode == 'EDIT_MESH':
            me = context.edit_object.data
            fl = me.polygon_layers_float.get("float_layer")

            if fl:
                cls.ebm.setdefault(me.name, bmesh.from_edit_mesh(me))
                return True

        cls.ebm.clear()
        return False

    def draw(self, context):
        layout = self.layout
        me = context.edit_object.data
        layout.prop(me, "float_value")

def set_float(self, value):

    bm = HelloWorldPanel.ebm.setdefault(self.name, bmesh.from_edit_mesh(self))

    # get the float layer
    float_layer = bm.faces.layers.float.get("float_layer")

    af = bm.faces.active
    if af:
        af[float_layer] = value
        bmesh.update_edit_mesh(self)

def get_float(self):
    bm = HelloWorldPanel.ebm.setdefault(self.name, bmesh.from_edit_mesh(self))

    # get the float layer
    float_layer = bm.faces.layers.float.get("float_layer")

    af = bm.faces.active
    if af:
        return(af[float_layer])
    #bm.free()

def register():
    bpy.utils.register_class(HelloWorldPanel)
    bpy.types.Mesh.float_value = bpy.props.FloatProperty(get=get_float, set=set_float)

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

if __name__ == "__main__":
    register()

Script designed for 2.8 can confirm also runs in 2.79

Ty batFINGER,so thanks to you I realized that you can do it but i not understand how to register floatproperty in classs with bpy.types in register, and how put in ui panel row.prop(##your_example.faceproperty##,'my_float', text='Ty bat') like to edit mode, if i understand well only bmesh in edit mode?

I edited the question, because my problem is also how to handle this with a ui panel and a float slider, I have no experience on the faces and I am completely unable to get the necessary information correctly.

So I thank you for this interest, I didn't think it was so complex and I understand very little (I have no confidence with this method at all)
I already have a panel that must always be visible, so I suppose I'll have to change something, but I know that in blender 2.8 this doesn't work and in blender 2.79 it reports an error that I can't identify (im poor knowledge of the method) error Text in line 17, 52 and 44

Can the @classmetod be avoided?

No, needs the poll.   There was a cut-n-paste error on line 17.  Can confirm (via gif) working on both 2.79 and 2.8  Polls in edit mode. Could be modified to also work in object mode.

I apologize if I insist, I copied and pasted, but nothing appears, if gate fl = me.polygon_layers_float.get ('float_layer') the 'q marks' the float appears, but rightly give error 'name'. Isn't that your class has been recorded and is that why it works properly for you?

I can open a new file in either 2.79 or 2.8, with the cube active,  run the two scripts  above (either order)  and it works as expected (as displayed above) . I have no idea what you mean re q marks and classes being recorded.

So if I just run the second  code it doesn't work, if instead I run the second code and  then the first code  works. I apologize but I'm using google translate and sometimes I think it misleads my concepts

So batFINGER, this script work fine,but i already have a panel, and the @classmethod poll no longer allows me to view it. I can create another class that automatically assigns float_layer = bm.faces.layers.float.get (float_layer.name)
and give me back what the classmethod does?
I was thinking of hiding the menu under a Bolean button, so this script will execute it only if the Bolean button is active,
I think this is another question, do you advise me to post it as a new question?


text:
Is there a Blender api to fill a color to a certain vertex_colors?
Taking a cue from this question, I'm testing to make a one-color fill to a vertex_colors.
Works fine, but is very slow on meshes with many polygons.
ob = context.object
color = (0,0,0,0)
vertex_color = ob.data.vertex_colors['My Vertex color']

i = 0
for p in ob.data.polygons:
    for idx in p.loop_indices:
        vertex_color.data[i].color = (color)
        i += 1

I also found an operator,bpy.ops.paint.vertex_color_set() (It seems to be twice as fast)
but I don't really like the idea, plus it's an operator with no input apparently
Is there any blender Api that do this directly?
After a good answer:
The code above is code that doesn't make sense in this case.
My tests moved to this method (Not very fast):
for d in vertex_color.data[:]: #Slow method
    d.color = (1,0,0,1)

In any case, given @batFINGER answer, and @lemon help, the code is now 4 times and more, faster than before.

You can use "o.data.vertex_colors['Col'].data.foreach_set( "color", colors )" where "colors" is a flatten array of all the rgba colors.

Sorry @lemon RuntimeError: internal error setting the array

the array needs to be flatten: [1, 0, 0, 1, 0, 1, 0, 1, ...] not [(1, 0, 0, 1), (0, 1, 0, 1), ...] and its length is so each vertex is considered for each face it belongs to. So for the cube, there are 24 vcols.

Set all loop vertex colors to one
Use foreach set method. Example of use here creating bezier curves https://blender.stackexchange.com/a/180184/15543
import bpy
import numpy as np

context = bpy.context

name = "Xxxx"
r, g, b, a = (1, 0, 0, 1) # red

ob = context.object
me = ob.data

color_layer = (me.vertex_colors.get(name)
               or me.vertex_colors.new(name=name)
               )
ones = np.ones(len(color_layer.data))

color_layer.data.foreach_set(
        "color",
        np.array((r * ones, g * ones, b * ones, a * ones)).T.ravel(),
        )

me.update()

Could also simply
np.array((r, g, b, a) * len(color_layer.data)).T.ravel()


text:
How do you copy an object including all its properties, and make it single user?
I specify that I know how to copy an object but I haven't found an answer for some time.
I want to copy an object and its date, then its vertex groups, including all the custom properties of that object, without it being linked to the original object anymore.
First example, copy entire object:
copy_ob = bpy.data.objects['ob'].copy()
bpy.context.scene.collection.objects.link(copy_ob)

Good solution , but have a problem, he object is still linked to the first, and any changes will also occur to the second object and vice versa.
Second example:
#This is a small function that I am using at the moment:
def copy_object(ob,new_name):
    copy_data = ob.data.copy()
    copy_ob = bpy.data.objects.new(new_name,copy_data)
    copy_ob.location = ob.location
    copy_ob.rotation_euler = ob.rotation_euler
    copy_ob.scale = ob.scale
    return copy_ob

new_ob = copy_object(context.object,'New Object')
bpy.context.collection.objects.link(new_ob)

The second solution is proposed many times in many sites, but it presents a very big problem, which hardly anyone takes into account.
Loss of any property related to the first object, loss of positions, locations, rotation, vertex group, and any other property that is not contained in the ob.data.
How can you do to avoid this?
The first solution, if you could make it "Single User" would be the best. But I really can't find an answer about it.
I am trying at all costs to avoid bpy.ops
Definitely:
Thanks to Andrey Sokolov's answer, I have finally come to a conclusion on how to copy an object without it being linked to the First. Here is my little code, with a function that does this copy. I leave it here, so those who need it can easily use it:
import bpy

def copy_object(ob,new_name):

    copy_data = ob.data.copy()
    copy_ob = ob.copy()
    copy_ob.data = copy_data
    copy_ob.name = new_name
    copy_ob.data.name = new_name
    return copy_ob

ob = copy_object(bpy.context.object,'New Object')
bpy.context.collection.objects.link(ob) #context collection is the collectionin which you are working

In the first case it is not unlinked because it continues to use the same mesh data block. So all you need to do is copy object, copy its data and assign the new data to the new object like this (with default cube):
import bpy

obj = bpy.data.objects['Cube']

new_mesh = obj.data.copy()
new_obj = obj.copy()
new_obj.data = new_mesh
for col in bpy.data.collections:
    if obj.name in col.objects:
        col.objects.link(new_obj)

Here, you said well, it was a passage that I assumed was wrong. Instead that's the exact one, I thought ob = context.object.copy () always kept everything linked. Instead it is not so. I have finally solved this mystery once and for all. My vote is also my thanks


text:
Too much RAM after load scene textures in high resolution
My current project contains many object with 2K and 4K textures. I don't have problem with RAM during render, but only when I open this scene. It take more than 20GB and it take long time to display. I understand that Blender need load all textures, but is there some method to optimize it? I even don't need see these textures in the viewport. I tried several things:

Viewport textures limit size to 2048 had no effect
Change Image Display method had no effect
Show object only as viewframe had no effect (object restriction)

It would be nice to have some solution for proxy (low res) textures for viewport and high res textures for render, because I can not use smaller textures during render.
My last option is a make some script to rename folder with textures, so Blender will not find it and show it pink :) And before render repair paths back.

https://blender.stackexchange.com/questions/137121/whats-the-most-lightweight-format-for-textures/137129#137129 and https://blender.stackexchange.com/questions/33206/view-memory-usage/67039#67039

So my solution to complete this project was:

I prepared same lowres textures in the different directory for example:
D:\MyProject\MyTextures for highres and D:\MyProject\MyTexturesLow for lowres
I used simple script for change name folder from MyTextures to MyTexturesLow and opposite
I renamed textures folder with script before open scene and switch back before render

It is only solution which save my project :) You can rename folder without script of course.

Do you mind sharing the script in order to help future visitors?

Of course, it was simple "os.rename" command from python, something like this:
import bpy
import os
os.rename( "highres path", 'highres path_TMP' )
os.rename( "lowres path", "highres path" )
os.rename( "highres path_TMP", "lowres path" )
where path is "D:\SomeTextures"