text:
How to create a generic texture using python?
I tried bpy.ops.texture.new() to create a new texture using python, however it does not work. I have seen another post here, but couldn't get this to work either. Ideally, I would like to give it a name as well:
bpy.ops.texture.new()
bpy.data.textures["Texture"].type = 'VORONOI'
bpy.data.textures["Texture"].noise_intensity = 10
bpy.data.textures["Texture"].color_mode = 'POSITION_OUTLINE'

Does this help? Otherwise please add an example what kind of texture (node based, generic...).

I've edited my post to clarify

Name is no guaranty as another texture with the same name may exist. Use bpy.data.textures.new() and just pass a name as well as the modifier type:
import bpy

# Get the object and context
C = bpy.context
ob = C.object

# Generate the texture and set the attributes
voronoi_tex = bpy.data.textures.new("displace_voronoi", 'VORONOI')
voronoi_tex.noise_intensity = .5
voronoi_tex.noise_scale = .5
voronoi_tex.nabla = .05

# Displacement modifier
disp_mod = None
for modifier in ob.modifiers:
    if modifier.type == 'DISPLACE':
        disp_mod = modifier

if not disp_mod:
    disp_mod = ob.modifiers.new(name='MyVoronoiDisplace', type='DISPLACE')

# Assign the texture
disp_mod.texture = voronoi_tex
disp_mod.strength = .5
disp_mod.vertex_group = "Group"

It works perfectly in creating new textures, thank you. The only thing is that it doesn't link up to my displace modifier. In the modifier itself you can select the texture, the python code however does not select it yet..greatly appreciate this.

@MichaelTeiniker, little bug. Corrected above and should work now

Should use disp_mod.vertex_group = "Group" as last line of the code above. Will edit it. In general, bpy.context needs a context in which you are sure that the good object is selected. That's why you should avoid it when possible.


text:
How to move multiple objects into another collection?
I am using this code which works very well for one object. I select Object_A and it moves to the collection MyCollection. If I select two or more objects, how would I change the code?
bpy.data.objects['Object_A'].select_set(True)
obj = bpy.context.window.scene.objects['Protrusive']
bpy.context.view_layer.objects.active = obj
A = bpy.context.object
A_old_coll = A.users_collection
terrain_coll_name = "MyCollection"
if terrain_coll_name not in bpy.data.collections:
    terrain_coll = bpy.data.collections.new(name=terrain_coll_name)
    bpy.context.scene.collection.children.link(terrain_coll)
else:
    terrain_coll = bpy.data.collections[terrain_coll_name]

terrain_coll.objects.link(A)

for ob in A_old_coll:
    ob.objects.unlink(A)

You just have to .unlink(object) each object from all linked collections and then .link(object) each object to your target collection.
Example on how to move all objects in selection to MyCollection:

import bpy

C = bpy.context

# List of object references
objs = C.selected_objects

# Set target collection to a known collection
coll_target = C.scene.collection.children.get("MyCollection")

# Set target collection based on the collection in context (selected)
#coll_target = C.collection

# If target found and object list not empty
if coll_target and objs:

    # Loop through all objects
    for ob in objs:
        # Loop through all collections the obj is linked to
        for coll in ob.users_collection:
            # Unlink the object
            coll.objects.unlink(ob)

        # Link each object to the target collection
        coll_target.objects.link(ob)

Sorry, I can't seem to get it to work. I have selected a few objects then run the code and nothing happens.

Make sure there is a collection called MyCollection as a sub-collection of the scene collection -> add a print(coll_target) before the check @MichaelTeiniker Btw: Wouldn't write an asnwer without testing it. More importantly try to understand the principle.

recommend coll_target = context.collection

@brockmann this case is if the "MyCollection" belong to the Scene Collection, but how to make it work if the "MyCollection" is a child of some other collection?

@JuanCarlos just use the following statement for a collection named "CollectionXYZ":
coll_target = bpy.data.collections["CollectionXYZ"]

source: Stack Exchange

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

sort: votes


text:
How to write rotation data of all objects to txt-file?
I want to export the rotation of all objects to a .txt file, but I dont know the actual python ommands in Blender. Made some try with google's help:
import bpy

ob = bpy.context.object

for ob in bpy.data.objects:

     f=open('output.txt','w')
     f.write(ob.rotation.euler[0])
f.close()

How the output should look like? Have a look into Templates > Python > Operator File Export.

It should be a table with the rotation factor for every object. Thanks for help ;-)

No problem @Steffen. Text files can not contain tables. Ascii table? What exactly do you mean by "factor"?

I mean the rotation (for xyz) which defines the mesh object. There are the Location and the Rotation to define every object. And what i need is a export file (maybe txt) where every angle is in. Because i need it for 1000 objects after a rigid body simulation, i dont want to make it by hand (click every object and write down ist from the 3D viewport)

Ok, I get it. Please add that to your post (edit button below) and ideally also add how the text file should look like at the end @Steffen.

Thank you very much....with the script you gave as hint it is working

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


text:
How can I get a Viewport render using GPU's connected to the internet?
I'm trying to get a viewport render of my .blend file by connecting to an external GPU online but so far the only solutions I found were for rendering entire images instead of rendering a quick preview of the scene on the blender viewport. Are there any ways to make this happen?


text:
push_pull operator not working using bpy scripting
I'm procedurally placing objects (XY dimension only) around a central object, with some randomness to their distance/angle relative to the central object. Occasionally, this results in overlap between these placed objects.
To detect and remedy this, I'm using a cheap and easy method, of simply finding the distance between these objects, and comparing it to a known value, based on the size of the object being placed. If the objects are too close, i want to move them both directly away from each other. From the blender documentation, the operator "push_pull" looks perfect for this, and works just as I want to when using the GUI. Unfortunately, I cannot get it working using BPY python scripting. This is a demo version of what I'm trying to do:
    import bpy
    from math import sqrt

    def dist(a, b):
        dx = a.location[0] - b.location[0]
        dy = a.location[1] - b.location[1]
        return sqrt(dx*dx + dy*dy)

    min_dist = 4 # minimum centre-to-centre distance for follower placement (prevent overlap)
    bpy.ops.mesh.primitive_cube_add(
        location=(0, 0, 0), scale=(4, 4, 1)
    )
    Cube1 = bpy.context.object
    Cube1.data.name = "C1"
    Cube1.name = "C1"

    bpy.ops.mesh.primitive_cube_add(
        location=(1, 1, 0), scale=(4, 4, 1)
    )
    Cube2 = bpy.context.object
    Cube2.data.name = "C2"
    Cube2.name = "C2"

    cubes_distance = dist(Cube1, Cube2)
    if cubes_distance < min_dist:
        print("TOO CLOSE")
        bpy.context.view_layer.objects.active = None
        Cube1.select_set(True)
        Cube2.select_set(True)
        bpy.ops.transform.push_pull(value=(min_dist-cubes_distance))
        bpy.context.view_layer.objects.active = None

Is this a problem of object selection / context? When I run this script in GUI, it doesnt return any errors, and the two cubes are selected in the viewport, but no push is applied

Think I worked it out with some trial and error & reference to the (not particularly detailed) docs for push_pull.
I think you have to set the value argument to NEGATIVE if you want to push the objects away from each other, whereas positive values are "pull". IMO this is the wrong way round, but at least it works now!


text:
How to specify specific x and y FOV angles for a camera in Blender 3.6
I am currently working on a project where I am using the camera FOV to place objects visible within a scene, using the view_frame (How to get camera view bounds on 2D plane, not Viewport limits). The images are rendered in a square, 1:1 aspect ratio. When I create the camera, I specify the X & Y FOV angles as so:
lens_angle = 40 # degrees
scn = bpy.context.scene
cam = bpy.data.cameras.new("Camera")
cam_obj = bpy.data.objects.new("Camera", cam)
cam_obj.data.angle_x = math.radians(lens_angle)
cam_obj.data.angle_y = math.radians(lens_angle)

The bpy documentation for cameras lists angle_x and angle_y as separate parameters (https://docs.blender.org/api/current/bpy.types.Camera.html), and to me this heavily implies they should be separately settable, independent of each other. However, I was consistently getting objects placed outside the FOV, so I checked what the actual FOV angle is for each angle later in the script as so:
cam_angle_x = cam_obj.data.angle_x
cam_angle_y = cam_obj.data.angle_y
print(cam_angle_x)
print(cam_angle_y)

With the result:
0.9994651675224304
0.6981316804885864

This seems like very poor API practise, to have 2 exposed parameters that do not actually set the thing that any user would assume they set.
Am I misunderstanding how blender deals with camera angles here (and is there a good reason for this way of doing things that I am missing?). Most importantly, how can I set-up a square aspect ratio camera to use for my object placement code (all within bpy scripting)?

Field of view depend of lens focal distance and sensor size, and in 3D output case the image resolution. I don't think you can arbitrarily set horizontal and vertical fields of view independently without changing output image size

Setting angle_x and angle_y directly to create a square camera does not work as you have experienced.
Quoting you (emphasis mine):

The bpy documentation for cameras lists angle_x and angle_y as separate parameters (https://docs.blender.org/api/current/bpy.types.Camera.html), and to me this heavily implies they should be separately settable, independent of each other.

Well, this may be a valid first assumption, but it's not. Do not forget that we deal with an Blender object and the attributes you see are Properties, in the angle case it's FloatProperties. You can verify this with
for p in bpy.data.objects["Camera"].data.bl_rna.properties:
    print(p)

which gives
...
<bpy_struct, FloatProperty("angle_x") at 0x00007FF656F3BF70>
<bpy_struct, FloatProperty("angle_y") at 0x00007FF656F3C0B0>
<bpy_struct, FloatProperty("angle") at 0x00007FF656F3C1F0>
...

Now, the thing is, the getter/setter of Blender properties can be custom functions doing more stuff behind the scenes. If you're not interested in a source code dive, skip to section 2.
Section 1 In Blender's source code the getter/setter definition for angle_x is
RNA_def_property_float_funcs(prop, "rna_Camera_angle_x_get", "rna_Camera_angle_x_set", nullptr);

with RNA_def_property_float_funcs declared as
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)

Don't care about the C++ syntax, what you only need to see is that there are a custom getter rna_Camera_angle_x_get and setter rna_Camera_angle_x_set implemented. Looking these up gives
static float rna_Camera_angle_x_get(PointerRNA *ptr)
{
  Camera *cam = (Camera *)ptr->owner_id;
  return focallength_to_fov(cam->lens, cam->sensor_x);
}

static void rna_Camera_angle_x_set(PointerRNA *ptr, float value)
{
  Camera *cam = (Camera *)ptr->owner_id;
  cam->lens = fov_to_focallength(value, cam->sensor_x);
}

with two helper functions
float focallength_to_fov(float focal_length, float sensor)
{
  return 2.0f * atanf((sensor / 2.0f) / focal_length);
}

float fov_to_focallength(float hfov, float sensor)
{
  return (sensor / 2.0f) / tanf(hfov * 0.5f);
}

Now we have all together to see what Blender does internally.
Section 2
What Blender does in the custom setter/getter is when setting angle_x it just recalculates the the focal length and thats it! When you retrieve angle_x, Blender recalculates it with the current focal length.
The general relationship for focal length $f$, sensor size $s$ and field of view $v$ is $ v = 2 \cdot \arctan{(\frac{s}{2f})} $, so when you write
anglex = 40
cam.data.angle_x = math.radians(anglex)

Blender does
cam.data.lens = (cam.data.sensor_width / 2.0) / math.tan(anglex * 0.5)

and when you write
print(cam.data.angle_x)

Blender does
print(2.0 * math.atan((cam.data.sensor_width / 2.0) / cam.data.lens))

The behaviour is analogous with angle_y, just using sensor_height instead (note that Blender keeps the focal length in cam.data.lens in Millimeters. Changing the Lens Unit to Field of View only changes the UI presenting the Field of View in degrees. This is only a convenience for users).
So, when you do
# update focal length such that angle_x fits the given value
cam_obj.data.angle_x = math.radians(lens_angle)
# update focal length such that angle_y fits the given value
cam_obj.data.angle_y = math.radians(lens_angle)

you're actually adjusting the camera's focal length two times in a row! angle, angle_x and angle_y will be recalculated after that, therefore your prints will not show the same values, but the newest ones.
Section 3
The logic behind all this is that Blender takes the sensor width and height as given physical properties which don't change when you want to change the angles. Physically you would realize a change in horizontal/vertical field of view by adjusting the focal length and that is what Blender emulates. Changing the sensor values is like saying: hey Blender I got a new camera for you! Setting the angle is just indirectly adjusting the same camera.
So, how to get angle_x and angle_y the same? You just need to align sensor_with and sensor_height. If you set them equal, the angles will be too (because of the formula above). And luckily, you don't need to do anything of this!
Although Blender mimics physical cameras (thats useful/necessary for a lot of people) it's still a virtual one, which means it can render more than a real camera could capture. Just set the render resolution square and you get your square aspect ratio rendering, no matter the sensor settings!
In the screenshot you can see that the rendered image is always the same (orange border 400x400) but the sensor width and height are different (grey border). The field of view has always been adjusted to $70°$ again after changing the sensor values (note that the focal length values when selecting Millimeters must not be the same!).

TL;DR To make a square camera just make the resolution square. If you need for whatever reason a physical square camera, make the sensor width and height equal too and calculate the focal length from the field of view.
cam = bpy.data.objects.new("Camera", bpy.data.cameras.new("Camera"))
sensorsize = 40
cam.data.sensor_width = sensorsize
cam.data.sensor_height = sensorsize
fov = 70
cam.data.lens = (sensorsize / 2.0) / math.tan(math.radians(fov) * 0.5)
bpy.context.collection.objects.link(cam)

I also suggest to read this great and informative posts:
Blender camera sensor size physical equivalent?
Relationship between the sensor size and focal length
How to set camera horizontal and vertical FOV
What is the point of Blenders camera sensor width?


text:
Modal Operator - LEFTMOUSE Event
I'm new to using Python in Blender and I would really appreciate some help with understanding Modal operators. I copied some code from the Blender documentation and tried changing some of it to do what I need. The original code moved an object using the MOUSEMOVE event and then placed it when you left clicked.
I'm trying to make a program that lets you build the shape of a house or building out of planes, and then eventually, replace them with assets I've sculpted (different types of walls, windows, etc.). I'm not quite at that point yet. The gray plane is supposed to be one of the placeholder walls. The green plane is meant to be clicked on to create another gray plane, and then move to the left of the new gray plane. (Eventually I'll have green planes all around the original gray plane so you can build out walls in whichever direction you like.
Maybe there's a better way to do this, but the best option I can see so far is using a modal operator. I'd like to create a new gray plane when I click on the green plane.
I changed some of the code that I copied from the documentation. The part I'm interested in is the LEFTMOUSE event. I didn't delete all of the old code, because I wanted to change as little as possible, in order to not mess everything up. So the green plane moves when I run the script. But nothing happens when I click. Part of the problem is, I don't have much experience with modal operators. I've watched several tutorials and read the documentation, but I'm still confused.
If someone could explain how this code works, and the difference between the execute, modal and invoke functions, I would really appreciate it. And, if you could help me figure out how to create a new plane when I click on the green plane, that would be really awesome!
[![enter image description here][1]][1]
import bpy

class ModalOperator(bpy.types.Operator):
    bl_idname = "object.modal_operator"
    bl_label = "Simple Modal Operator"

    def __init__(self):
        print("Start")

    def __del__(self):
        print("End")

    def execute(self, context):
        context.object.location.x = self.value / 50.0
        return {'FINISHED'}

    def modal(self, context, event):

        if event.type == 'LEFTMOUSE':  # Confirm
            if bpy.context.view_layer.objects.active == 'greenplane':
                print("working")
                bpy.ops.mesh.primitive_plane_add(size=2, enter_editmode=False, location=(0, 0, 0))
                return{'FINISHED'}
            else:
                print("not working")
                return{'CANCELLED'}

        elif event.type in {'RIGHTMOUSE', 'ESC'}:  # Cancel
            context.object.location.x = self.init_loc_x
            return {'CANCELLED'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        self.init_loc_x = context.object.location.x
        self.value = event.mouse_x
        self.execute(context)

        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

bpy.utils.register_class(ModalOperator)

Related https://blender.stackexchange.com/questions/80565/add-an-uv-sphere-on-mouse-click

Strongly recommend going to the python console and get some basics down, to test code first. Contend that context.view_layer.objects.active == 'greenplane' will never be true.

Ahh, that looks very helpful. I will look through that code. And I think you're right. It looks like what I actually needed was bpy.data.objects["creator"].select_get == True. Thanks!

lol, bpy.data.objects["creator"].select_get == True  will never be true either.  Go to blender's python console type in bpy.data.objects["creator"].select_get then press TAB.

My bad, I meant bpy.data.objects["greenplane"].select_get() == True, haha it's getting a little late here :)


text:
Plane Canopy from two paths
I am trying to make a canopy for a plane / space fighter (you know, something like this) and I am struggling to get the basic shape right. My latest attempt was using two paths:

These map out the basic shape, but I still need to connect them in a cylindrical shape. Is that possible and am I going about it (-> the making of the canopy) about the right way or is there a better alternative?

Join the curves into one mesh object (I started with 2 separate curves)
make sure top profile and side profile have the same amount of vertices before the next step
TAB to enter Edit mode, A to select all, CTRL+E > Bridge Edge Loops
play around with the settings, in my crude example I just changed the number of cuts and changed Interpolation to Blend Path
add mirror modifier with Merge on


text:
What are the files in the /tmp folder and can I delete them?
I know that by definition "tmp" means "temporary" and that therefore, these files might not be necessary for blender to function.
I can see that some of them look like automatically saved copies of my projects because of their naming.
However, certain files such as the one with a little "forbidden" sign seem to hold some kind of importance so I thought I'd ask...

I believe some of them can help you restore the last session in case of crash.

To expand on cegatons answer - /tmp/ is the default location for some data paths unless you change them.
The main one is the render output, unless you change the output filepath before rendering, your renders will be saved to tmp. Changing the output path before saving your startup file will prevent any renders going into tmp.
Simulation cache files can also be saved in tmp. While most prevent saving of external cache data until the blend file is saved, the fluid simulation will save it's cache files to tmp if you haven't saved the blend file first. If you then save the file, the path will still point to data in tmp instead of moving the data to where you saved your blend.
The ocean modifier is another that will store it's data in tmp if you haven't saved the file before baking the simulation.
If you save your blend file to disk before starting any simulations then the data will first get saved within the same folder as your blend file.

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


text:
Particles emitted from video layer
I am trying to compose a shot that combines video layers and 3D.
In the shot, there are two video layers, one is the background and one is an alpha layer of a ghost floating around.

They are both .mp4 / H.264 video layers shot with a DSLR, one of them made transparent with an alpha layer. They would both be 1920x1080.
They could be imported in Blender as "planes as images" but any other way that works is good.
I am trying to make the Ghost layer emit particles, from the border of the object (not the edge of the frame) resembling green smoke or steam. The particles should come from the edge (all around) of the ghost layer.
I looked into doing this in other software (After Effects with Particular), but haven't found a way to get the results I'm looking for, which have more to do with curls of smoke than particles.
Here is an alpha video with a ball instead of a ghost you can use to help solve this question.
And here is a .blend file where the video was imported already

Can you specify what "video layers" are you referring to? Are they planes with animated video textures in the 3D environment, or VSE strips, one of which is smaller, overimposed and moving (and how)?

Ok, thanks for the comment, I edited my question. I'm not sure this is possible, and I'm still between beginner to medium level in Blender, but smoke billows and curls much better in Blender than any other program I've tried, so I'm hoping this can be done...

ok, I see the edit. If they are "images as planes", then, you can make the "planes" to emit particles, or maybe use another (parented invisible) object to emit particles following the plane motion, perhaps?

When you say that particles should come from the edge, is that the frame borders or the ball borders?

@lemon the ball borders! I will edit to make clearer

Another question (just for the principle): do you need the effect comes from edges or from the whole surface?

The whole surface :) an option to do from the edges could be good to play with too!

I've failed to use a movie as direct texture density input for both particle system and smoke simulation. It seems that this information is still right or simply my setup is wrong somewhere.
So, as a workaround, I used the following modifiers, starting from a subdivided plane:

Vertex weight edit: this allow to color a vertex group depending on a texture (and this allows to use an animated texture or video)
Mask: the mask of the previously create vertex group keeps vertices of the mesh depending on the vertex group. We could use the vertex group directly but keeping vertices allows to round the geometry in the next modifier
Subdivision surface: to round a bit the remaining vertices corners
Smoke simulation

Vertex weight edit

It is based on the movie texture and adjusted (default weight, add threshold) so that the plane's vertex group are assigned depending on the alpha channel of the texture. The vertex group has to be created before with no vertex assigned to it.
The texture itself is defined as follow:

This first modifier give this result (weight paint mode):

Mask

The mask simply uses the previously defined vertex group, so that the plane geometry is restrained to this:

Subdivision surface
Not really useful, depending on the base subdivisions given to the plane. It rounds a bit the corners of the remaining geometry.
Smoke

Smoke flow:

Nearly the default settings, except for the smoke color:

Smoke domain:

A cube surrounding the previous plane. The resolution has been adjusted using 'smoke high res' and 3 divisions (if you don't do that, the smoke will appear crenelated). The dissolve/life time is set to 5 here.

Note
From the same base setting we could use a particle system, producing itself the smoke. But when there is no geometry (full alpha image), it seems that particles want to appear anyway from the plane origin. So if you want a setting using a PS, place the origin outside of the camera view.
Blend file
You may have to bake the smoke before usage.

Additional note
MicroMachine indicated in the comments that it was not an obligation that the flow comes from the circle edges and could be from the whole surface. Nevertheless I've tried to do it using 2 vertex weight edit modifiers: the idea was to create a kind of surrounding mask from the circle. But I failed to do it correctly.

This looks really good, thanks for the efforts!

The basic setup you are asking for is quite simple. You could just arrange the planes accordingly in 3d space (although I would render on a transparent background and later composite your 3D particles + ghost layer on top of your plate).
The part with only emitting particles from visible parts of the ghost layer could be resolved using a particle texture (just feed the transparent video into the particle system using the "Textures" panel under the emitter/particle system settings; a ramp could be used on the texture for additional transparency control).
On the behalf of the smoke I would try to utilize a low-res smoke simulation (source of which the particle system would be). That generally tends to look better than just faking it using particles.

Hi @Paul B., thanks for the answer and sorry for the delay. Could you add a screenshot of a suggestion of nodes? I'll try this soon. Thanks!

This answer doesn't respond to the OP's need for smoke emission from the keyed edge.

Tested it and that does not work (or you should explain a bit more). But for now, I think this issue is still true https://developer.blender.org/T34063

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


text:
Can I map a vector image on a mesh?
I often run into a situation where I create Image Maps in Illustrator, export them as PNG, and when I apply them into my mesh and zoom in, pixelation from the PNG appears. This annoys me a lot in 3D and games (see this model imported from a Wii U game, which gets pixelated as soon as you zoom in)

Wouldn't it make more sense to be able to import an image map as a vector format, since Blender accepts (in some instances) SVG files?
I haven't been able to do this...
EDIT: There are a lot of great answers which are also very tedious and can't really be incorporated in a regular workflow. The question was more about mapping SVG like this one on a cup object like this one to show a client an idea quickly, etc.

Vector textures would be cool, but if you want a quick solution to your specific problem then you can export higher resolution .png files from Illustrator by using the "Save For Web" option instead of exporting to png.

Yes, ideally i would, and i totally agree and have thought of that. Only (1) Illustrator has limits in size when exporting pixels for screens and (2) sometimes I think I've exported large enough and I move the camera super close and... see pixels (for example if mapped object is particle and falls close to camera or close up). So I have to redo a PNG export  and remap on each object the map is linked to, which is tedious and counterproductive.

Raster will always pixellate if you get close enough, but it's not an issue if you limit how close the camera can get. If it gets close enough to see the pixels, then modelling the geometry instead of using textures is needed anyway.

Related: https://blender.stackexchange.com/questions/23627/using-svg-to-put-label-on-bottle There is a plugin: https://www.blender.org/forum/viewtopic.php?t=12870 but I have no idea is this still working, it's for Windows only.

Yeah, no I totally agree on your comments @dixiepig . But since Blender can import a SVG, I would only find it normal that these (flat) SVGs would be able to load into the UV image editor to map them without losing vector data (or maybe turned into vertex paint data?)

@cegaton do you have a link to explain your suggestion?

This is not about mapping? I know how to import svg and use them as planes. I would like infinite sharpness when mapping

@MicroMachine This doesn't answer the question, but if you use Cubic interpolation, it gets rid of the bad looking pixelation, and makes it look blurrier. https://blender.stackexchange.com/a/90660/26640

@ScottMilner looking at this link, it makes blurs out of low-res pixels, not quite the same thing as the perfectly sharp at any resolution solution I'm after

@MicroMachine Again, why I included it as a comment, not an answer. It does look a little better, though.

One other thing you could do is enable the SVG import plugin, which will let you import your vector images as curve geometry. From there, you can create actual meshes with the shapes you want (which from your example, might actually be more desirable, because you might want an actual model of the laptops).

@TaviKohn thanks for your comment! Could you try to expand it as an answer? The bounty will expire soon

You can plot every graph with formulas. If you like maths, you could create a script which converts your curves to node graphs. For fun I recreated the keyboard base layout with nodes.

@Leander This is a very exciting direction... Would you mind detailing the process, maybe in an answer? It might be close to what I'm trying to achieve

Upload your example svg for testing purposes, please.

For testing purposes here is a free SVG of a keyboard (click the blue arrow under the thumbnail) - you can try to reproduce the image in the original post.

The requested feature doesn't natively exist within Blender, hence recreating the behaviour is very complex and tedious.
Download the accompanying blend file with various node setups.

Creating shapes with material nodes
If a shape can be recreated with mathematical functions (plotted shapes) it can be created with cycles math nodes.
Let's create a procedural rounded rectangle group. (If you know Blender and math, skip to step 3.)

On a large plane, add a material with an Object Texture Coordinate input.

We're going to focus on the X, Y positive area (marked blue) first.
Let's by defining the bounds for the rectangle, separate the XYZ channels and add two greather than nodes for X an. Add them together clamped.

The black is the interiour of the rectangle in the XY positive area. Make sure your object's scale is applied as we're using local coordinates. Strangely enough, we don't need these nodes, discard them!
Create a circular shape using the unit circle functions.
In our case it is simple: radius^2 = x^2 + y^2
This means, that for every point inside the circle, the following is true: `sqrt(x^2 + y^2) < radius.
In nodes, add a Power node for each x and y, then an add node to add them together, then another Power node for the square root. Finally a greather than to determine if the point is outside of the circle (= if the radius is to great).

The 2nd power node with a value of 0.5 is missing in the image.
Don't forget, the effect of the nodes is seen in material view and rendered view only.
Offset the X and Y coordinate by rectangle-"radius" minus rounded corner radius.

Regardless of the value of the CornerRadius, the circles bounds are clamped to the RectangleSize bounds.
Clamp the values left and below of the circle respective X and Y diameter.

These are the desired areas. To get the red area we multiply x < rectangleRadius - circleRadius with `y < rectangle radius, and for the blue area switch the inputs. Then add both results together.

This is the node graph, after multiplying this rectangle restriction onto the circle, a neatly rounded corner.

To make the rounded corner XY symmetrical, add an abs node each to the X and Y outputs form the separate RGB node.

Before the abs node, add a subtract node, to be able to shift the x and y coordinates.

Make the end result influence a color mix node.

Make it a group with an input for inputColor, Vector Coordinates, offsetX, offsetY, Size and CornerSize.

Nodegraph before grouping
But wait, add support for a different height and width. Figure it out yourself or download the blend.

Go wild, this is rather slow.

Creating shapes based on functions with nodes
Let's recreate this easter egg.

The first function will be converted as we did with the first example. I will interpret
(x-10)^2 / 300 + y^2 / 600 = 1
as

I added some arbitrary sine functions.

Creating a shape with OSL
The open shading language enable us to use a custom script node. Knowlegde of C and Python is required for the following part. (Since I don't really know any C or Python, the code samples are messy.)
You might want to head to BlenderSushi and complete their OSL series.
We'll create a stop sign polygon octagon.

I'll hard code some coordinates. Store the points in a string and convert them to a c style array with this python snippet. I just manually copied and pasted the coordinates separated by spaces and commas and the manually copied and pasted the generated code. Execute the snippet in any python interpreter.

pts = "-1,2 1,2 2,1 2,-1 1,-2 -1,-2 -2,-1 -2,1"
pts = [[float(n) for n in m.split(",")] for m in pts.split(" ")]
pts.append(pts[0])

pt_array = "point pts[" + str(len(pts)) + "] = {"
for pt in pts:
    pt_array += " point(" + str(pt[0]) + ", " + str(pt[1]) + ", 0),"
pt_array = pt_array[:-1] + "};"

print(pt_array)

This generates the following output.
point pts[9] = { point(-1.0, 2.0, 0), point(1.0, 2.0, 0), point(2.0, 1.0, 0), point(2.0, -1.0, 0), point(1.0, -2.0, 0), point(-1.0, -2.0, 0), point(-2.0, -1.0, 0), point(-2.0, 1.0, 0), point(-1.0, 2.0, 0)};

In Blender, create a new text block and start off with a basic osl shader
shader simpleColor(
    point Vector = P,
    output color col = color(0.0))
{
    // insert our custom point array here
}
Select the textblock in a script-node in the material nodes. Activate Open Shading Language in the Render Settings.

Now we got our polygon in our osl shader. To detect if a point lies in the polygon, we are going to implement a simple version of the Ray Casting algorithm. There are plenty of resources on point-in-polgyon topics on stackoverflow. I'll cast a ray from the y minimum and check with how many polylines it intersects. If the number is a multiple of two, the point must lie outside the polygon.
Create a simple function, which will take two points of a linear mathematical function and an x value and return the corresponding y value.

float linear_function(float x, point p1, point p2) {
    float x1 = p1[0];
    float y1 = p1[1];
    float x2 = p2[0];
    float y2 = p2[1];
    if (x1 == x2)
        return 0.0;

    float m = ((y2 - y1) / (x2 - x1));
    float n = y1 - m * x1;

    return (m*x+n);
}

7. Now, we'll add another function to detect if a point lies above a polyline. First we'll check if the x coordinate is inbetween the two points of the line, then we'll compare the y value of the function between the two lines with the y value of our point.
int hit(point p, point p1, point p2) {
    float x = p[0];
    if (p1[0] == p2[0])
        return 0;
    if (p1[0] < p2[0])
        if (p1[0] > x || p2[0] < x)
            return 0;
    if (p1[0] > p2[0])
        if (p1[0] < x || p2[0] > x)
            return 0;

    if (linear_function(x, p1, p2) > p[1])
        return 1;
    return 0;
}

With these two functions added, the shader can be tested with 2 points. Note, that osl shaders are only visible in rendered preview mode.

We can also use our stop sign coordinates.

Notes on svgs
With these tools you are equipped to start writing your svg plugin. The hit function has to be implemented for curveto, smooth curveto, quadratic Bézier curve, smooth quadratic Bézier curveto and elliptical Arc and the python script has to convert all types of the svg path. It's actually not that hard to compute further intersections, but parsing the svg is going to be a lot of work.
The final goal is to write a python script, which parses an svg (with python's xml parser) and converts is to a osl shader script. The points and curves would be hardcoded in the shader.
Unfortunately, we have to first implement the most basic collision detection for beziers (see the previous link), because most svgs will use them, and possibly for all other svg elements (see the previous2 link).

I like the answer a lot but I don't think it could be incorporated in a regular workflow. The question was more about mapping SVG like this one on a cup object like this one to show a client an idea, etc.

@MicroMachine Did you actually go through the answer, do all steps and read all links? No, because the blend file is broken (I just noticed and will fix it: OSL is disabled and the code is wrong). You've also supplied three different svgs. My answer works well with the images in the question. If I extend my answer to supply an easy way with the next sample svg, will you change it again? (Read the last two links! This answer isn't the solution, but the path to the solution: your own addon to import svgs.)

@Leander no prob, I'll go through it in detail again and get back to you!

@MicroMachine I have recreated this svg and will start writing the converter myself, as soon as I find time. The script mentioned in the edit at the end, will still be easier to create than altering the source code and creating your own build with svg support.

@Leander thanks for the time and effort you put into this, it's way beyond my skills but I'm excited to see the converter you make! Keep me posted. I accepted your answer based on your dedication and the potential of that converter

One option is to import your SVG using the SVG import addon.

We'll use this test image.

Select File> Import > Scalable Vector Graphic

In my case, not a lot appears to have changed, but I have some curves now in the outliner.

If I zoom in, I can see the image I imported, but there are some problems. Note that blender has automatically created a set of basic diffuse materials (called "SVGMat.001...") for each color in the image. Editing these can be used to change the look of the final result.

I'll start by increasing the scale of all of the curves by 100, then applying that scale with ctrl + a.

Right now all of the curves are intersecting with each other, because they all have the same Z position. I'll go through each curve, and move it up or down by 0.001 or so, to keep them from clipping. In my case, all the layers were imported in order, so it was pretty easy to tell which should be on top, because it showed up last in the outliner.

To keep all of these curves together, first I'm going to add an empty, then parent all the curves to that empty.

There's still one more major problem that needs to be fixed: Cartman's eyes and mouth are not filled in. This is because Blender automatically filled in his feet, but not the other shapes on the same layer. We can fix this by entering edit mode and adding polyfaces for each shape that isn't filled. press tab to enter edit mode with the eyes/mouth/feet layer selected.

Select and single vertex.

Press ctrl + L to select all the vertices on the same curve.

Then press F to fill the shape. Repeat for all of the shapes in the layer.

This now gives us a final image that can be moved around and scaled normally by the empty, that has no pixel aliasing.
You might notice that some of the larger curves (such as Cartman's face) seem a bit low resolution. For these curves, we can adjust the curve resolution to make bezier curves and arcs render more smoothly.

To do this, select the curve you want to change, and increase the resolution value (when Render U Resolution is 0 it copies from the Preview U Resolution, so I changed that value, but pick whichever you want).

One final note: the lines on Cartman's chin and jacket will not show up in a render without some more tuning, or using freestyle rendering. This is because they aren't actually faces, just lines, which have no thickness, and therefore don't show up when rendering.

This is great, thanks! Would the elements stay in place when you use it against a mesh? Can you detail the mapping process? It seems this technique would work best with some manageable vector images (no gradients, limited nb of elements...)

Yeah, this is not sustainable for anything particularly complex. There is no (UV) mapping technique because the imported objects are curves, not meshes (curves can't have UV data). It's basically the same as creating objects and applying materials to the entire thing, rather than creating UV maps and applying textures. The elements are all children of the empty, so as long as you just move/rotate/scale the empty around, all the layers should stay in place.

I'm just wondering why it's possible to interpret/import SVG data into blender as editable objects, but not possible to import them as a 2d image in the UV mapping tools (without editing the data). Would make more sense for UV Mapping than limited bitmap data. Something similar is how InDesign handles an Illustrator image that you place into it.

UV maps are for mapping pixels to mesh faces. Because Vector graphics don't have pixels, the UV mapping workflow doesn't really apply. You could consider this a limitation of Blender, but I don't really blame them for not wanting to implement this functionality; it sounds difficult.

I see, so basically vectors would have to be interpreted/rendered into pixels in real time (the way illustrator or after effects do), for this to be possible. Sounds difficult but not impossible!

Curves are converted to flat polygons for render in Blender anyways.  Keeping these as curves may be the more memory-efficient way to store some data, and may be easier to edit than textures, but there will still be pixellation until you edit the curve to have sufficient resolution for your render-- just like there will be pixellation from a texture until you change the texture to have sufficient resolution for your render.  To eliminate pixellation fully, you either need 4 vertices per render pixel or 4 texels per render pixel, your choice.

Make curves in the keyboard in shape of all keys, modifiers>solidify. Move slightly above all the base layer textures. Done. Crisp and detailed because it will be a mesh. To make it a "constant" color, use an emmissive node directly to surface on the shading tree, and check intensity. You´re ready to go.

Your answer only works for the keyboard situation, not to put eyes on a character in a videogame for example


text:
Why do the hair particles go crazy when rendering?
I have created hair on a character I am making for animating. I combed the hair and it looked good in the 3D viewport.

I then rendered it and got this result.

I then went back to the 3d viewport, and everything looked normal until I right clicked to rotate and then the hair was crazy there as well.

I loaded a previous save and combed the hair again a few times with the same results every time I rendered it, so I'm thinking it's got something to do with my particle system settings, so here are all my settings for the particle system.

Any help in resolving my hair problem would be great, THANKS!

Might be a duplicate of this: http://blender.stackexchange.com/questions/58541/problems-rendering-hair-in-cycles-render/58571#58571 . Look at my answer there.

That worked, I had the preview at 0 and the render at 3.  if I put the preview at 3 it works fine, however it makes editing everything much slower, is there not a way I can have the preview lower so as to keep everything working faster while editing?  Also, add your answer and I'll mark it as correct.

I rearranged the modifiers and put the subserf after the particle system and it works after rendering with the lower number in the preview than the number in the render.

That is probably because your modifiers are in wrong position.
If the mesh with hair particles has a subsurf modifier it should be in the bottom of them.


text:
Where are the outliner toggles in 2.8?
The selection toggle arrows in the Outliner disappeared. Is there some preference in the settings that has to be turned on?

These are now hidden by default to provide a cleaner and easier UI for beginners while still presenting enough functionality for most common use cases.
For more complex projects or advanced users Outliner Restriction Toggles can be turned on or off and customized according to personal preference from the Filters pop-over in the Outliner header.
There you can choose which restrictions columns are visible in the outliner by default.
You can still control collection visibility restrictions if the columns are off from the context menu by right-clicking an object and accessing the Visibility submenu.

If the outliner view's space isn't wide enough, you might need to either scroll over or widen the view.

this is a great example of keeping existing functionality while hiding it for beginners <3


text:
Blender eevee everything looks foggy
I have no idea why it happens, I open a old 2.79 file in the blender 2.82, and it looks like that

I found that if I change the volumetrics end to very low it seems solved, but I dont think that's the correct way to solve that, something must be wrong in other place

Finally I found that I use volume scattering in cycles and that caused the condition

Please use the answer section to add an answer.


text:
Alternate mode menus in viewport by context
Starting on v2.92 after 2.79. Almost zero familiarity with Blender, only occasional usage. Attempting to follow Blender EEVEE: Glass Tutorial(Refraction) tutorial.
@0:45, the author seemingly uses Ctrl-Tab to bring up a circular Pie Menu is showing Rendered, Wireframe, Solid and Material Preview options.
However when I try to do the same, my Pie Menu instead displays: Object Mode, Edit Mode, Sculpt Mode, Vertex Paint, Weight Paint and Texture Paint.
How do I make my menu match the author's menu under those workflow circumstances?

That menu that you discribed:

"Rendered," "Wireframe," "Solid," "Material Preview."

It is actually the shading menu, that appears on Z

That works.  Thanks!


text:
How do you get the UV Mapping to show up on my texture?
I'm new to Blender and was watching a tutorial on how to texture meshes, but I saw that one of the videos had the UV mapping showing when they were painting the mesh, but I can't seen to get the mapping to show up. How do I do it?

When you create a new Image, you can choose a color grid or a UV grid, maybe that's what you mean?

Does this answer your question? Texture missing

Select your object, switch to Edit mode, select all, it should display the UVs in the Image Editor.


text:
Texture won't show up
I have two meshes and one has a texture on it. For the second mesh with the leaves, I followed the same instructions I did for putting the flower texture on, yet the texture doesn't show up. The leaves are supposed to show green. I checked texture mode and it doesn't seem to be registering my texture because the leaves are purple. What am I doing wrong?

Hello could you please pack the image (File > External Data > Pack Resources), save your file and share it? https://blend-exchange.com/ (or workupload)

@moonboots I packaged the files but I'm not sure where to find them. I'm quite new to blender so I haven't figured out everything yet
Nvm I figured it out

you need to share the link

@moonboots Ok got it uploaded

No material has been assigned to the leaves, you've only created a new slot, you need to create a new material in the Shader Editor, enable the Node Wrangler addon, select the Principled BSDF, press Shift T, in the Image Texture node select the image called PlumeriaLeaf

@moonboots I tried that but it doesn't seem to be working. Maybe I did something wrong?

maybe share your new file, I've tried and it works

@moonboots here

You've created a second material slot and you have assigned this slot to your leaves, but you haven't assigned any material to this slot yet, so select this slot and click on New:

Enable the Node Wrangler addon, in the Shader Editor, select the Principled BSDF, press CtrlT, it will create a chain of nodes, in the Image Texture node, select your green image:

I did that but for some reason, Shift + T isn't creating the chain of nodes mentioned above

have you enabled the addon called Node Wrangler? If it still doesn't work, create this chain manually

My bad, it is Ctrl T  ;)

Ok so I managed to get that chain, but I had to do Ctrl + T instead of Shift + T

It's fine! It's working now


text:
Texture won't show up in parts of my mesh
Trying to make a hat with a flower on it, so I imported a flower that I made earlier, but for some reason, the leaves are showing as white. They're supposed to be green as shown on the UV map and texture. How do I fix this?

Hello, didn't my answer helped? If not, please pack your images and share your file

@moonboots here

Select a leaf with L, in the Material panel, you can see what material is assigned to it:

Check the material you've assigned to your leaves, it's just made of a white Principled BSDF, you need to plug an Image Texture as explained in my previous answer (or change the Base Color to green, or assign it the other material but I couldn't test it as you didn't pack your images):


text:
Auto apply different material on each objects
Let's say I have a lot of different objects in the scene, over 1000, is there a way to automatically give each of them a different material? I need to get different colors on id map

Hello, could you please elaborate, tell what kind of object, what kind of material, etc?

This sounds like the XY Problem, What exactly are you trying to achieve? There are multiple ways to get different colors on objects that don't involve thousands of materials, like cryptomates or random color materials

@DuarteFarrajotaRamos I need different materials so that when baking ID maps, there are different colors on the maps so that I can conveniently texture the model in the Substance Painter

I have always manually assigned the material to each object, and thus got what I need, but in this situation I have more than 1000 objects, and I think it will take a very long time. so I wanted to make sure if there could be a way to automate this process.

Sounds like a duplicate of https://blender.stackexchange.com/questions/233856/assigning-random-material-color
The answer contains a very detailed process of how to accomplish this using python scripting to automate the whole thing


text:
Combining .blend files
I'm new to Blender and recently downloaded several free pre-rigged models to practice with. However, they are all separate files (being created by multiple authors). What is the most painless method of importing them into a master .blend file?

Open up a second instance of blender (just double click the icon again), delete the default cube, camera and light, then copy (Ctrl+C) the object from it's own file and paste (Ctrl+V ) into the empty blender project. Copy the models from each different file into the "master" (formerly empty) one. You can add each new object to it's own collection if you want/need to.

You can also use the File > Append function


text:
Mesh clipping through itself when posing
https://drive.google.com/file/d/1JjNyxda5UV30k6mR2PuABnHGE-zigrHs/view?usp=sharing
This is the link to the blend file, I think I figured out most of my issues when working with it but when I pose the mesh with its aramature the arm clips through the clothes and I don't know if I am did something wrong or if thats normal?

Could you please share the blendfile over blendexchange, https://blend-exchange.com/ , that way it will not get lost and is safer to access for everybody. On the note of the question, I would take a look at weight painting

I was looking at the weight paint but I still don't know what I am doing wrong


text:
Exporting mirrored animation
Animations that work in blender are lost in gltf format, presumably because the mirror modifier is no longer applied dynamically during the animation.

These are animations where I move around in the timeline, not just rotations. The obvious workaround is to just make each moving mesh its own object and manually mirror all animations, but is there a better way?


text:
smoke simulation from different frame rather than from 1 to 250
(I am a beginner in simulations) When i tried to simulate the smoke simulation from 100th start frame rather than 1, the smoke simulation behaves weird. When the animation reaches the 100th frame instead of forming slowly it suddenly creating the smoke around the emission object like a cube.
how to changing this from happening?

many of the physics simulations should include all frames; for example a fluid simulation that doesn't include frame 1 will render a solid, obscuring volume within the domain for frame 1.   Generally, try to include all frames, and just animate "Use Flow" when inflows are enabled; set a disabled frame 1 (and click the white dot to the right), and then enable and animate that frame when you want it to contribute.  Liquid animation is even more arcane: has to provide at least one active source for each frame to avoid obscuring the volume!


text:
Weird behavior trying to pan in 3D Viewport
Hello I'm recently getting back into Blender after a very long break.
One of the issues I'm facing is weird behavior trying to pan in the Viewport.
When use the following command to pan: Shift key + Middle Mouse Wheel, it will exhibit the expected behavior of paning and not orbiting. However there are times it seems the Shift key is "toggled" and while not holding down shift it will still pan instead of orbiting when I use the middle mouse wheel to orbit. This "toggle" appears to activate seemingly at random. I've included a screenshot that shows in the bottom left that shows options that appear as if I'm holding Shift key, despite not pressing down. I've also tested my shift key to make sure there wasn't a hardware or external error.
My question is: Can I remove the toggle option that appears to happen when pressing Shift? Or is this the intended behavior?

It might be you have a faulty middle mouse button (assuming that with "middle mouse wheel" you mean the button, which is default behaviour).

I will post this because someone may find this useful in the future. Try going to settings menu on Windows, Sticky Keys and turn on block keys which are pressed twice.


text:
Topology and Shading Issue - Need Help with Redirecting Flow
I need help in correcting the edge flow of this Antique piece model TV. I have added that antenna Geo inside that face. After Connecting them Im now facing Shading issues and corners are NGON.
I've to solve 2 issues:

Optimize the Geo of overall Mesh on that face I:e the geo thats connecting whole mesh
I cant really understand the Edge flow of this

Hello please share your file: https://blend-exchange.com/

@moonboots I have attached the file.

it happens because the faces are not co-planar, therefore this shading between faces and this bad artefacts, it doesn't seem easy to make them co-planar as your topology is not very good, maybe you should simplify a lot, then select all these faces and flatten them on their axis, at the end use the Weighted Normal modifier, here a quick try, it still needs some cleaning etc:

Can you give me some suggestion how to improve the topology? Also I'm Observing its not quad based any more. Should i be concerened about it?
Thankyou for your contribution.

It's a bit hard to give suggestions, just make sure that the ngons are co-planar with the adjacent faces, it will prevent any bad shading, ngons are ok as long as they are co-planar

Thanks Moonbots. I've readjusted the topology and re-model internal geo with less detail. Its fine now

Oh OK great then   ;)


text:
VFX: compositing a 3D scene with a green screen video
can someone explain to me how to composite a scene (setting) in 3D with a green screen video? I've already done the tracking and the mask but from there on I don't know how to go about it and I can't find a tutorial that does it all in Blender!

Green Screen is mostly a compositor/vse workflow. Ryan King did a good tutorial on that topic:

https://www.youtube.com/watch?v=KBBkgoDPnZE


text:
How do I get rid of these odd ray shaped shadows-- or at least figure out what's causing them?
I'm seeing these really weird shadows all over my mesh in Object and Edit modes and while in the render:

They only appear up close, but I'm worried that there's something I'm doing wrong. Can anyone explain to me what's causing this?

hello, maybe overlapping faces? Could you please share one of these objects?

Do you have Shadows enabled in the 3D Viewport? Try disabling those and see if it fixes it. The Viewport shadow effect struggles with large objects made of a bunch of disconnected elements.

I do have shadows enabled with a bunch of disconnected objects. I'll give that a shot, thanks.

It is a bit of speculation without more detail, however you could try:

selecting ALL in Edit Mode and then Mesh > Merge > Merge by distance.

Then In the lower left an operator panel will appear.

Decrease the accuracy (possibly to 0.1 depending on how large this model is) and see if that helps. Then recalculate normals under Mesh > Normals > Recalculate Outside.
Other actions your could try:

Check the clipping distances on your camera and viewport.

Shut off all scene lights and use an HDRI to see if one of your lights is problematic.

Go into the Render Tab and scroll down to Shadows;  increase the cube and cascade size, and also turn on high bit depth.

Lastly, the scene may simply require higher samples, in the viewport and renders.  Render out one frame at a very high sample rate and see if it persists.

Thanks! I'll try these and get back to you asap.


text:
Problem applying rig modifier
I'm a Blender newbie, and I'm taking a course on Udemy. I've been following along with the instructor, and when he applies the rig modifier his mesh stays where he posted it. But when I apply it, my mesh reverts to the a-pose. What am I doing wrong?
Before applying the modifier...

After applying the modifier...

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

I don't know if this helps, but move the Armature modifier to the top and then apply it. The modifier stack works from the top down. If you apply a modifier below the top, you may get unexpected results. For example, if you have a MultiRes + a ShrinkWrap modifier and you apply the ShrinkWrap modifier, the result will be stored in the MultiRes modifier. Maybe that happens here too.

Thanks Blunder, that solved my problem!


text:
How to apply a displacement modifier to one area of an object from an image?
Say I have a trapezoidal prism (a six-sided object with 4 trapezoidal faces and a rectangular top and bottom) like this one here.

I need to apply a displacement modifier to one trapezoidal face using an image containing the texture/normals, such as this crude example.

In other words, I need to take an image that is the same shape as the face and use it to create the actual 3D texture using a displacement modifier (the resulting object will be 3D printed).
I know how to do this on a simple plane/surface, but I'm running into trouble in this scenario.  The main problems seem to be:

How do I apply the displacement modifier to only one selected face, without affecting the rest of the object, and
When I apply the image, how do I force the image to fit correctly onto the surface, as they have the same proportions but may not be the same size?

Edit: This has been flagged as a possible duplicate of this question.  I did see that question before posting mine, but it did not help me.  It does not cover how to apply displacement modifiers to only one face without altering the object, and does not touch upon the second part of my question at all.

Possible duplicate of Apply subsurf modifier to only part of an object or Is it possible to prevent a Displacement modifier from affecting certain parts of a mesh?.

I think you'll need to use a UV map here as using a vertex group does not seem to give a good result.
As you want to use a displace modifier you'll need to subdivide your shape a lot. But, whatever the subdivision level is, the precision of the displacement will be limited by the texture resolution itself.
So, if the model is to be 3D printed, both resolutions (subdivisions and texture) will matter.
First, make your UV map :

Select your face in edit mode
Go to front view (or more generally in front of the face)
UV unwrap : U then choose "project from view (bounds)"

Adjust your UV map

Note : you may also UV unwrap all the faces and / or make your texture after the unwrapping (so, or adjust the UV geometry to the texture, or make a texture adapted to the UV geometry)

Set your texture as displacement
And use UV as texture coordinates

Subdivide your face (a lot)

Adjust the displacement

Note
If you need to do this on several faces :

UV unwrap each face and eventually use the vertex group option of the displace modifier (a vertex group per face, but taking care of the border vertices). Alternative : use several UV maps.
I also suggest to apply the subdivision to all faces at the same time.

Again, I am not sure that the precision will be good enough for a 3D printed object.

Awesome!  This answer is exactly what I was looking for.  Thanks for your help!


text:
Convert polygons or ngons to quads using bmesh
I have imported an SVG keyboard layout into Blender (2.83), which arrives as filled curves in the XY plane.

For each key, after converting the curve to mesh, I have managed to dissolve some edges with bmesh.
    # tris to ngons, separating the bottom from the top
    edges = [e for e in bm.edges if e.verts[0].co.y != e.verts[1].co.y]
    bmesh.ops.dissolve_edges(bm, edges=edges)

This leaves each key with a quad and a polygon, or ngon, with either 5 or 6 vertices/edges.

I want to subdivide the ngons "vertically" using the existing vertices to make quads (2 quads if 5 verts, 3 quads if 6 verts).
I have worked out how to find them, or delete the ngon and keep the edges but am no closer to a solution.
    for f in bm.faces:
        if len(f.verts) > 4:
            bmesh.ops.delete(bm, geom=[f], context='FACES_ONLY')

In one version of the SVG I manually added extra vertices at the bottom to help create the required edges, but wonder if this useful or pointless (bad pun).
How do I convert these polygons (ngons) with more than 4 sides to quads, adding only vertical edges?

Verts of non-boundary edge.

Assuming the white keys are the mesh, where there is an ngon is at the ends of a non boundary edge
Test script below, finds ngons, bisects using YZ (keys aligned along x axis) plane at boundary edge vert coordinates, removes doubles, and repeats until there are no more ngons.
An additional test to make sure the other two connected edges are at an angle of around 90 degrees has been added. (See below)
import bpy
import bmesh

context = bpy.context
ob = context.edit_object
me = ob.data
bm = bmesh.from_edit_mesh(me)

ngons = [f for f in bm.faces if len(f.edges) > 4]

while ngons:
    f = ngons.pop()
    def test(v, edge):
        if len(v.link_edges) == 3:
            e0, e1 = [e for e in v.link_edges if e.is_boundary]
            ev0 = (e0.verts[0].co - e0.verts[1].co)
            ev1 = (e1.verts[1].co - e1.verts[0].co)
            return abs(ev0.dot(ev1)) < 0.1
        return False
    # find verts of non boundary edge
    verts = [v for e in f.edges
            if not e.is_boundary
            for v in e.verts if test(v, e)]
    print(len(verts))
    for v in verts:
        geom = bmesh.ops.bisect_plane(
                bm,
                geom=[f] + f.edges[:] + f.verts[:],
                plane_co=v.co,
                plane_no=((1, 0, 0)),
                )
    bmesh.ops.remove_doubles(
        bm,
        verts=bm.verts,
        dist=1e-5
        )
    ngons = [f for f in bm.faces if len(f.edges) > 4]

bmesh.update_edit_mesh(me)

This works for one bisect if I dont use the while loop, but if I use the loop I get  infinite loops. Still probing...

Allow me to apologize for my uncalled for upvote comment. I have removed it. Using is_boundary found me the answer and you deserve a point for it, rather than me adding a similar answer. And dozens of your answers have helped me in the past Having eventually figured out my issues it wasnt worth uploading a blend and I thought I should share my findings for future readers.


text:
Is there a method to align 3D cursor's axes with selected vertices?
Is there an option to first line up an axis of the 3D cursor to be parallel to an imaginary line passing through two selected vertices, then without losing that relationship to line up a second 3D cursor axis with another set of selected vertices.
I want to find a method to setup an arbitrary coordinate system quickly at any moment.  Take the picture below for example.  I snapped the 3D cursor to the vertex I wish to move.  Is there a way to set the cursor's rotation so that one axis is parallel to an imaginary line that passes through the vertex closest to the 3D cursor and the last selected vertex while another 3D cursor axis is set parallel to an imaginary line that passes through the other two vertices?
[

Personally, I find it essential to have 'Create Transform Orientation' in a quick menu / shortcut. (It's the little '+' sign in the Transformation Orientation dropdown of the 3D Viewport Header) Once you've done that, you can quickly create a transform orientation from any selection of 3 vertices. That might be enough.

But if you want to put the 3D cursor into that orientation, you can use the Cursor Tool in the T tools region of the 3D view, and set the cursor's orientation to 'Transform' (or 'Geometry') in its tool settings on the other ( N) side:

@Sander Thank you for the update /  improvement! :)

This sounds needlessly complex. This problem can be solved with moving a point on the line and selecting it when it is needed.
You want the cursor on any point P on given line L.

in vertex select mode , select line
right click > subdivide line, you will have point P now.
move point P by pressing g twice , this will move it along the line (And make the line yellow), place this on the line where you need the cursor to go. If you need exact number you can use .5 and -.5 to go 1/4 or 3/4 of the way on the line from the middle.
Shift +S snap cursor to selected
(optional) select point P , then one of your line vertices, F3> Merge > at Last , this will merge your vertex in when you are done with it.

If you need other "imaginary lines" you can use this method , build temporary (2 verts then f ) lines, and then delete the temporary lines when you are done lining up things.


text:
Drivers breaking down after model transformation
I am currently modelling a complicated gearbox and I am using drivers to model the relations between the parts. There are multiple gears turning in different ratios and to each gear, a few parts are attached. I used drivers to couple the rotation ratios of the gears and then parented all parts that turn with the gears to those respective gears. The rotational axis of all gears are in the y-direction. This all works completely and looks great. However, if I rotate the model around the z axis for 90 degrees, all rotations glitch at a certain point and jump for a few degrees.
The really weird thing is, if I rotate the model 90 degrees in 5 degree increments at a time, everything is back to normal again and the model works in every direction.
Is this some kind of weird glitch? Is this a known bug?
Is there anything I can do to fix it?
Minimal example

When 90 degrees flags an issue in drivers it is almost always caused by gimbal lock      Simple example  https://blender.stackexchange.com/questions/164765/rotation-driver-skipping-backwards-after-90-degrees

I also thought about gimbal lock but the issue occurs as well if I rotate only by 45° and it does not occur at 90° if I use 18*5° individual rotations :O

Is there any reasonable way to explain this? best would be a video... Thing is, although there are multiple drivers depending on each other, the first relation already shows this problem. I already re-parented everything to be as simple as possible.

Can I upload a minimal example blender file somewhere here?

Let us continue this discussion in chat.

Bad choice of WORLD space.
To test Added a simple driver #frame - 1 to the drive shaft to get it spinning.
As suspected the issues are caused by a
i) Using rotation transform driver type, with WORLD_SPACE

Parented the whole set up to an empty, rotating the world space of the parent changes the world space of the children and causes irregular results.
Recommend either. Lesser
Change all to local space.  Here is a script to select all parts and will change transform  type driver targets to local space.
import bpy
context = bpy.context

for ob in context.selected_objects:
    if not ob.animation_data:
        continue
    for d in ob.animation_data.drivers:
        for v in d.driver.variables:
            if v.type == 'TRANSFORMS':
                for t in v.targets:
                    t.transform_space = 'LOCAL_SPACE'

After which

Note The outer gear is driven by the stationary  hidden object, No idea why it worked at all.
However as mentioned in comments Eulers are prone to gimbal lock and since it's local could simply use the property.  (Also makes sure the rotation is not restricted to (-180. 180) which can be the case in constraints and can be difficult to diagnose if not aware)
Finally, would contend that all gears could be driven directly by the rotation of the drive shaft. For most cases a custom property "drive" could be added to the gear and the driver could be
self["ratio"] * drive

where drive is a single property variable pointing to the shaft Y rotation, or in the case shown (enable Use Self in the driver)
self["ratio"} * (frame - 1)

since I set that as the drive shaft Y rotation.


text:
Fluid disappears on the first few frames

I can't figure out why the fluid just completely disappears on the first few frames. It's happened on the last 3 tries for a beach project I'm working on.
Here is the file:

Also I have tried deleting the cache, but it did not fix the problem.

I tried you file and can't reproduce your problem. Try to delete the cache folder (it's in the same folder as your file) and bake again.

Clearing the cache helped. Thanks a lot


text:
Cannot set value 'RGBA' to color_mode in Blender by script (Python)
I use script to split render scene to smaller pieces (tiles) - by setting use_border = True. Then "tiles" are rendered, and after process finishing, I join "tiles" to final image. To make it easier, I use RGBA setting during render process. It works fine. But sometimes (for some input files) I get error: bpy_struct: item.attr = val: enum "RGBA" not found in ('BW', 'RGB')
I set value RGBA by command: bpy.context.scene.render.image_settings.color_mode ='RGBA'
I get the error message during rendering demo file "Barcelona Pavillion" from this web page: www.blender.org/download/demo-files/
In Blender GUI I can change to RGBA mode for this file - even if I set border (by Ctrl+B) and render part of scene.
Do you have any idea how to set RGBA for this file by Python script ?
I use Blender version 2.79b
Runnable example:
import bpy

bpy.ops.wm.open_mainfile (filepath="pavillon_barcelone_v1.2.blend", load_ui=False)

rndr = bpy.context.scene.render

rndr.use_border = True
rndr.use_crop_to_border = False

rndr.border_min_x = 0.3333
rndr.border_min_y = 0.3333
rndr.border_max_x = 0.6666
rndr.border_max_y = 0.6666
bpy.context.scene.cycles.device = 'CPU'

rndr.image_settings.color_mode ='RGBA'

result = bpy.ops.render.render (write_still=True)

Little mistake :-)
I haven't set output format. There was set JPEG and it has no transparency.
When I put this line (before RGBA assignment):
rndr.image_settings.file_format = 'PNG'

script works.


text:
Different output image when I set "use_borders = True" - in python script
I try to split render process (by python script) to several tiles and after finishing render process, join sub-results into one image. I set use_borders to True and I set min_x, min_y, max_x, max_y:
bpy.context.scene.render.use_border = True
bpy.context.scene.render.use_crop_to_border = True
bpy.context.scene.image_settings.file_format = 'PNG'
bpy.context.scene.image_settings.color_mode ='RGBA'

bpy.context.scene.border_min_x = computed_min_x_for_tile
bpy.context.scene.border_min_y = computed_min_y_for_tile
bpy.context.scene.border_max_x = computed_max_x_for_tile
bpy.context.scene.border_max_y = computed_max_y_for_tile

But ... I get slightly different image than I expected.
I rendered the same scene in Blender GUI and via python script (splitting into tiles). Outputs are different.
You can see tiles borders - in image generated by python script.
I tried to set another properties (before render process), for example:
bpy.context.scene.render.use_compositing = True
bpy.context.scene.render.use_save_buffers = True
bpy.context.scene.render.use_full_sample = True
bpy.context.scene.render.use_render_cache = True
bpy.context.scene.render.dither_intensity = 1.5

No one helped.
Do you have any idea how to reach the same outputs ?
What property should I set or what sequence of steps should I do ?
Image rendered in Blender GUI:

Image rendered by python script (split, render, join):

Do you use a denoiser?

Markus von Broady, as you can see, it was demo file - classroom. It uses many nodes in compositor - there are several Blur nodes. I implement steps I described below and they work. I have correct output now.

It is caused (probably) by compositor. If I render part of image, compositor change only this one piece (tile) - without affecting another tiles. After joining them, seams can be seen.
To reduce seams I will render scene by scene (without using compositor - I will set bpy.context.scene.render.use_compositing = False), tile by tile (saved to erx-multilayer format) and then join outputs. Then I will change inputs in compositor (render layers will be replaced by images).
I hope it will work.

Do you happen to have the python script for this working solution?


text:
How can I make boundaries for a numerical value in the node editor?
I am trying to make a node setup where:

If the input is 0 or anything less it outputs 0
If the input is 5 or anything greater it outputs 5
If the input is between 0 and 5 it outputs the input

I can't figure out how to do this because 'greater than or equal to' and 'less than or equal to' are not options for the math node and the minimum and maximum nodes are only boolean and don't allow me to output the original number (if it is allowed).

What if the input is between 1 and 5 ?

@thibsert Sorry, my bad I got mixed up. Its if the input is between 0 and 5

Greater than and Less than  return Booleans, but Maximum and Minimum return values,no?

Maybe there is a better/more efficient way to do that, but the Clamp parameter should do the job :

Maybe the clunky approach, to avoid floating-point ops and errors...


text:
Why doesn't my simple mesh wall "difference boolean cut" the door away?
I am new in Blender. I have basically done mesh walls, and I want to cut away doors.
So I select each wall, take boolean "difference" and select the red rectable (that should represent a door)..
But something weird happens. I can see the wall has been slightly changed at the door, but no cut out.
What I am missing?
Download link to .blend file
https://www.dropbox.com/s/apv7gx2394jtu0d/blender.blend?dl=0
I have also done a video
https://youtu.be/hIt52h4-bRs
I can upload the Blender project if needed.

Please upload the blender project. It would help a lot.

Ive updated the question with the file https://www.dropbox.com/s/apv7gx2394jtu0d/blender.blend?dl=0

BMesh solver (the one used by default by the boolean modifier) don't like when two faces are coplanar, like the lower faces of your wall and door.
You can move down your door a bit (or just move down it's lower face).
You can also change the solver used by the modifier. In Solver, instead of BMesh, select Carve.

It worked, thank you!


text:
How can I remove the lines around the edge of an object?
I got a Minecraft rig which I want to have as a transparent image for a thumbnail. I always get these weird lines around the head (and sometimes on the rest of the rig as well), but I want to get rid of them as they don't look nice. I tried removing the lines in Photoshop, but that takes a lot of time.
Please have a look at the screenshot which has been attached to this post. How do I get rid of the lines around my Blender Minecraft rig? I'm a Blender beginner, so please send very clear and detailed instructions if you know the answer! :)
Thanks!
Problem occurs with:
- Windows 7 Pro 32-bits
- Windows 10 Pro 64-bits
- Blender 2.75a (also had the problem in previous versions)
Download link for .blend file:
https://mega.nz/#!LV4zAJ6a!SYgFytB9C92YXd5gNaH8C7m2fWys2e0AetcRpmFeTwc

Is it possible to see the .blend file?! I assume that your edges are not correctly align/ that you have doubles (doubled vertices laying on top of each other)

Hey, I just added a download link for the .blend file to the post :)

Thanks, I changed the URL so now it should be saved correctly and you can download it :)

I get an error when I try to download your .blend file. Please upload it here: http://blend-exchange.giantcowfilms.com/

It appears to be a UV layout problem - not enough margin between the UV islands, so color data is bleeding over. From what I can see of the UV texture on the right everything is just packed way to closely together. But maybe you can fix this by scaling the UV islands in a little, one-by-one.
Instead of this...

More like this:

Also, to fix triangles like that one on the arm, enable Auto Smooth in the Mesh Context.

Update:
I looked at your .blend and it does appear that the UV layout is the problem.
Note how there is no margin between the islands.

In addition to that, there are parts of the layout that are doubled-up. This may or may not be intentional, but it means a texture in that region will show up on more than one place on the mesh.

Hey, I just added a download link for the .blend file to the post :)

If you can fix the problem (and if you want to), can you send me the .blend file? :)


text:
Scientific visualization - How to replicate instances around a sphere?
I want to replicate a protein structure around an icosahedron. Basically a vesicle of protein structure is what we want:

When I am instancing the protein structure using each vertex of the icosahedron it looks like:

However, the tails are supposed to be directed towards the center. How can I make that work?

Globally dupli works on the convention that normals (vertex normals) correspond to the Y axis of the dupli.
To orient the protein:

First apply rotation and scale CtrlA so that we start with something we can work with
Then rotate it to the Y axis
And apply rotation again

Edit:
If you want to do that (I had a look at some images on google):

Enter edit mode in the protein object
Select all vertices
Rotate and grab them so that the wanted inner part meets the origin of the object (still oriented along Y) as the dupli start at each vertex of its parent from this origin

The expected setting for the sphere, concerning instancing is the following:

Corrected blend file:

Complement:
To do it from a particle system, you can use this setting for the particle system created for the sphere:

The orientation to Y is the same but can be perturbed if you activate physics, so it is disabled here.
Key parameters:

Set to 'emitter'
Start and end frames set to one (if not particles will appear during animation)
Emit from vertices
Physics 'none'
Render as object
Scale: tune as you need
Use the protein as instance object
Don't use the orientation as you want to emit along normals

Awesome man. That worked!

@RafeequeBinUsman, Surely you will guess I'm not a biologist...!!

What I am doing wrong here?  https://drive.google.com/open?id=1FaDcYhASEieb-tLj6CZq1ZjdDJZUSDPP

@RafeequeBinUsman the video resolution is too low for my eyes... but should be "align to vertex normals" in the sphere property panel in the instancing part.

Don't forget also that the dupli starts at the sphere vertex position considering the origin point of the protein. To move the protein mesh from its origin point, preferably it is to be done in edit mode in this context.

Yes!!! Now all cleared. Thankyou lemon.


text:
Glitch on First Frame of Animation
I'm having a problem with some of my animations. My main character is an ape climbing a building. On frame 1 of the animation, the left leg gets distorted (see image). Not sure why this is happening, I did not design it this way. As an easy fix, in the Timeline, when I click the button "jump to first frame in frame range," it always fixes the problem and the leg returns to the correct position as I designed it. However, when I export the model and armature as FBX and import into Unity, this glitch appears in Unity on the first frame of the animation.

Any advice on how to fix this would be greatly appreciated.

It looks like if you parent the knees pole targets to the toes it doesn't help to bend the right way. If you parent them to the feet controllers it seems to works:

From a friend: The glitch in the leg is due to a dependency cycle (like a feedback loop) in the rigging. The IK pole target (knee control) is dependent on the position of the leg/foot/toe through parenting, while at the same time the leg orientation is dependent on the pole target's position through the constraint. So Blender gets confused about what to evaluate first.
It's a known limitation of the code (the Dependency Graph, specifically) that doesn't exist in other 3d apps apparently, and is supposed to be fixed in 2.80.

I actually had to parent the knee controls to the root bone in edit mode, then make adjustments to them across many animations in pose mode. It did seem to solve the problem. Thanks for the input!

sure you can parent them to the root bone, that's what I do, but it is also possible to parent it to the controller for example, I thought you wanted it to follow the movement of the foot


text:
How to revolve flat object by twisting it 360 to make it 3D?
I created this shape in Illustrator and imported the SVG into blender. I want to rotate the flat object by 360 degrees over the Z-Axis to make the object round.I would be pivoting the bend over the flat edge.
I tried creating an empty and adding a twist modifier to and twist over the empty. I also tried adding a simple deform modifier.
My blender object

What I want it to look like

Right of the bat, using an .svg for this purpose is not a good idea, because you're creating a lot of unnecessary topology. You should rather create a circle/cylinder and work your way from there.
But since you asked, I recommend the spin tool in Edit Mode:

You can also use the "Screw" modifier set to the "Z" axis and an angle of "360" if you want to go non-destructive. Remember to apply rotation before (CTRL - A).

Can you elaborate on this extra topology you are worried about? Can't both approaches end up with identical models?

@Matt I was refering to using an actual .svg file as a base model. The only way I'm aware of creating/using them is, in short, creating a picture and letting Blender draw an edge between every pixel, thus creating an absurd amount of vertices.

@Zagstrug SVG is a vector format, there are no pixels. I just tested importing a similar SVG to the one in the OP and it only ended up in blender with the handful of nodes that I had originally drawn. I think your excess topology fear is unjustified.


text:
How to invert the Y-Axis control of the camera view when pressing "R" "R"
When I am in the camera viewport and press "R" "R" to rotate the camera. I get this type of cursor.

When looking around, my control is inverted (up goes down, down goes up). How do I change this?

i also have a mac but i never saw this type of cursor and i cannot reproduce that. What add-ons did you install?

@Chris My mistake, the first part is irrelevant to my question. Alt+Command+0 on my Mac will set the camera view to the current 3D Viewport View. I do not believe this is 3rd party or a changed preference. Once in camera view, pressing R R with the camera selected will let you move the camera around based on it's location. It's good for making small changes.

@Chris To reproduce it go into camera view, select the camera and press R twice. It's the "trackball rotation" cursor, you also get it if you have any object selected and press R twice. Blender Manual > Trackball Rotation


text:
Cut Custom Shape into Side of Cylinder
I am trying to model a British Sterling L2A3 & I'm having serious issues with modeling the ejection port. The main body of the weapon is a cylinder with many different types of cuts, and I normally approach them with Knife Projecting the shape into the cylinder, then bridging the vertices and adding a few edge loops. In this case I end up with a lot of distortions.
With the cut I am also trying to add that half-cylindrical shape on the right end of the ejection port, as shown in the image. I have been at this for days and I simply cannot find a solution that ensures neat and clean topology.
.blend File


text:
How to convert blender scripts bpy to python scripts py
I am new to Python and Blender and would like to know:

How to convert Blender scripts (bpy) to Python scripts (py)?
What is the difference between Blender scripts and Python scripts?

Hi and welcome! I did revert your edit because the context got lost for future visitors. How this site works: https://blender.stackexchange.com/tour. If you have another question, please ask a new one, Thanks.

Scripts written for Blender are Python scripts (*.py). The difference is that they may use Blender's API through import bpy which is not available to a regular Python interpreter out of the box. If the script is using anything from the bpy namespace it can't be executed outside of Blender, that is unless you build and install Blender as a Python module. In this case you get (limited) access to Blender's Python API to functionality that does not require a UI. As long as a Python script does not use Blender's API, then it can be executed by a regular Python interpreter without any modifications.

How to convert Blender scripts to Python scripts?
You don't. If it uses Blender's API you can either execute it in Blender or you have to install Blender as Python module for your Python interpreter.
What is the difference between Blender scripts and Python scripts?
The use of Blender's API is the difference. Other than that they are just regular Python scripts, the programming language is the same.


text:
Where I can find the filepath to a texture used in the Image Textue node?
I'd like to edit the textures coming along with a packed blend file. I already did the 'unpacking' and set the paths to absolute using *External Data -> Make all paths absolute. However, I can not find the textures on my disk.

Q: Is there any way to see the filepath of a texture used for a certain Image Texture node to locate it on my hard drive?

Click on the Image Texture node, hit N to open up the Properties Panel on the right side, go to Item > Properties and you'll get all image properties like the path, size, color space etc.:

See: https://docs.blender.org/manual/en/latest/render/shader_nodes/textures/image.html

thanks very much :)


text:
Does anyone know if blender 2.8 has a zbrush clip brush?

In ZBrush you are able to clip a mesh clean off instantly, no trimming that creates rough meshes everywhere. Is that possible in blender too?

Added your comment and a link to zbrush manual. Again, please read: https://blender.stackexchange.com/help/how-to-ask

Thanks Brockmann for helping.


text:
Using "Material Preview" HDRI in Renders?
I know that I can use default HDRI maps in Rendered mode in Blender right now, but the problem is when I wan to render the image by F12 (or render movie), my settings are changed to use "scene world". Is there a hidden button somewhere in rendering tab or somewhere else? If I have HDRI correct in rendered mode, why I can't have the same result after F12 render?

I think this is what you’re asking for https://youtu.be/eMKST_ddg6s check out 3:40

This is why I asked, because in viewport everything is correct (as it is in the video you posted), but after rendering, Blender ignores this setting, and uses node-based settings.

This is possible, but at the time of writing it's not a one click solution.
First you need to setup your world to use an environment texture and then load the same HDRI that is used in Look Dev mode. The HDRI can be setup either in the World tab or in the Shader Editor using nodes.
Blender 2.80

Blender 2.81 and later

The HDRIs can be found in Blender's installation directory:
[Install dir]/2.80/datafiles/studiolights/world

In Blender 2.81 you can use the same HDRI from Material Preview mode (formerly called Look Dev) for lighting in the Rendered preview mode in the viewport. Switch to the Rendered mode by clicking on its icon, then open the Viewport Shading options and disable Scene World to ignore the settings from the World tab. One of the HDRI presets can then be selected.

However for the actual rendering you will still need to set it up as described above. In case you've already done that, the Viewport Shading options can be left at their default values with Scene World enabled.

I am using blender 2.81. This works, but how do I hide the hdri image in the background?

@MVTC In the Render Properties open the Film tab and check the Transparent option.


text:
How to get curve to twist with the hooked object?
I have a curve using a "squared" circle as a bevel object to get a square-profile tube.
The two last control points of the curve are hooked to an object.
When I rotate that object around Y and Z axes, the "tube" follows nicely:

but around X axis the "tube" does not follow the object's rotation completely (it does not twist around X axis):

Is there a way to get the curve twist along all three axes together with the object it is hooked to?
There is an option to tilt curve control point (Curve -> Control Points -> Tilt) but that has to be done manually. Maybe somehow tying that tilt to the object ...?
I am open to all sorts of solutions as long as it allows moving and rotating the hooked object and the "tube" follows it.
Here is the file I used for the example screenshots:

You can add a driver to the Tilt of the point.
Select the desired point and add a driver to it's Tilt.

Then go to the driver editor and do ass follow:

Now when you rotate the object the curve rotate too.

Wow! For my case the driver has to be added to both of the last two control points to get the desired behavior, but that is it! Thank you!

Well, it is not 100% accurate - it does not follow the rotation completely. It can be seen in the animation above (half of the bottom wall "sinks" in the surface of the block). And it becomes exponentially larger as the rotation around Y or Z axis gets larger. It is OK for smaller angles, though.

@spacer It is because we used the x rotation only,We will have to do some math to include the rest,Let me see what I can do.

Thanks! I noticed that Type does not have to be Scripting, i.e. it can be Maximum Value and it still works.

Omar, did you have time to figure out how to prevent that unwanted rotation? I am trying to figure it out but cannot understand why would rotation on Z and Y axes influence rotation on X axis ...

@spacer Sorry,I couldn't find it out,The vector (location of the spline) affect the Z and Y rotation but not X,what we did is just including X as the 3rd dimension,The problem is that we didn't put in consideration the effect of he vector on the X rotation,Thee have to be a relation that bind them together,We just can't find it,I will try to find a solution by studying the rotation transformation matrix.But i don't promise finding a solution.


text:
How to select part of a mesh by using a helper plane?
I would like to select part of a mesh using a plane as a "boundary indicator".
In the screenshot below that would be the mesh part above the plane:

I can get the desired selection by using Bisect tool (Bisect, hide, select a vertex, select linked, unhide):

however, this is visually not as convenient as using a plane (this is only one step in a longer workflow which has to be simplified). Beside that, Bisect cuts trough the whole object, what is inconvenient (notice the bisect-line cutting another part of the mesh in lower right).
I know I can use Boolean modifier to get only the part above the plane, but I do not want to cut it off - I just want to select it for editing.
The "transition line" does not have to be straight (i.e. adding vertices and edges), it can use existing edges (resulting in a jagged "transition line").
Edit:
What I meant is to use the plane in a similar way it would be used in Boolean modifer, just not to "cut off" but to select that part of the mesh.
The goal is to automate the process, e.g. operator positions the plane and clicks on a button (to run a script that does the rest; I can write the script once I know the steps).

I have actually found a solution myself (thanks to @Mr Zak for inspiration) using the Boolean modifier to get two halves then joining them back. Will post the answer in couple of minutes.

Inspired by this and other questions like thus, i wrote a (free) add-on, build on bisect, if i may point to https://blender.stackexchange.com/questions/143100/cut-object-into-two-objects-with-a-plane/158682#158682

I was able to do this using Boolean modifier to get two halves then joining them back.
This is the procedure (assuming a Plane is already in place):

Duplicate the original object
Add Boolean modifier to the dupe, Operation: Difference, Object:
Plane, and Apply it (this leaves the part above the plane)
Switch to Edit Mode, select all
Add new Vertex Group, Assign it
Switch to Object mode, select original object
Add Boolean modifier to the original object, Operation: Intersect,
Object: Plane, Apply it (this leaves the part below the plane)
Do Shift + select to add the top part to selection and join them (Object -> Join)
Switch to Edit Mode, select all
Do the Tools -> Remove Doubles (this "fuses" the halves but leaves
one face between the two halves)
Do the Select -> Non Manifold to select the edge of the extra face
Do the Delete -> Face
Go to the Vertex Group assigned above and Select it

The result is this:

It may be a lot of steps but it is fully automatable.
Note that selecting non manifold edges and then deleting the faces may not be an option for automation if you have non manifold edges elsewhere.

1. Lasso Select:
You can use Lasso Select with Ctrl + LMB.

Here a related Post for types of selection.
Limit selection to visible should be disabled to select all vertices in the Lasso area.

Image by iKlsR♦ answer

2. Object as Camera:
This solution involves a 2nd Object which is perpendecular to the Plane and use it as a Camera. That makes it easier for a Border Selection and the 3D Cursor is used for the orientation.

Position the Plane at the desired Location.
Dublicate the Plane with Shift + D in Object Mode
Rotate the duplicated Plane by 90° around the local X-axis. R + 2xX + 90
Translate the rotated Plane along the local Z-axis with G + 2xZ.

Select the first Plane and press Shift + S > Cursor to Selected.
Select the second Plane and press Ctrl + Numpad 0 to make the Plane the active Camera.
Select your Object, toggle to Edit Mode and Border Select B the desired Vertices. The 3D Cursor helps where to stop with the selection.

Vertices selection successfully

thank you for this, I learned couple of new things, but this uses the plane only for orientation. I may have not emphasized the need for automation enough - I am updating the question now.

Use Clipping Border to hide everything except for the desired part of mesh.

Select any face which is directed roughly under the same angle as you'd like your selection to be.
Enter front or side ortho view regarding that selected face via Shift+Numpad1 or Shift+Numpad3.
This is done to ease the process of finding correct angle for selection.
Enable Clipping Border tool with Alt+B and draw desired area which will be the border of the selection.
Select with Border or Circle Select tools. Once selection is done disable Clipping Border with the same command, Alt+B.

shift + numpad1 is very useful. i knew it that there is an easier way, but didn't know how. thx for sharing.

@Mr Zak, thank you for this, I also learned couple of new things from you, but this uses the plane only as a visual guide. I may have not emphasized the need for automation enough - I am updating the question now.

@spacer I see now and I think this isn't possible by default and without scripting. Every method I can recall assumes cutting object first, like Mesh > Faces > Intersect or this addon.

@Mr Zak, I was actually able to use Mesh -> Faces -> Intersect to select a part of the mesh in a similar way as with Bisect, but I cannot add an "independent" plane to the mesh (the added plane gets "glued" to the mesh and moving it drags the mesh around too). Also, the same issue as with Bisect (operator must select something in the mesh part to select linked) is a bit inconvenient. Anyway, your comment about cutting objects gave me an idea with Boolean modifier that just might work - I'll try it out and get back with results.