text:
Python - How to create capsule from sphere via Bmesh?
I want to make a capsule by changing the distance between the two halves of the sphere to a certain depth

import bpy
import bmesh

bm = bmesh.new()
bmesh.ops.create_uvsphere(bm, u_segments=8, v_segments=9, radius=2)

name = 'Capsule'
mesh = bpy.data.meshes.new(name)
bm.to_mesh(mesh)
mesh.update()
bm.free()

object = bpy.data.objects.new(name, mesh)
bpy.context.scene.collection.objects.link(object)

create_uvsphere now takes a diameter argument rather than radius despite what the manual claims.  EDIT: From the comments, what you want to do is move the top half of the sphere up an increment and the bottom half down the same increment.  Here's code to do that:
import bmesh

bm = bmesh.new()
bmesh.ops.create_uvsphere(bm, u_segments=8, v_segments=9, diameter=2)
delta_Z = WHATEVER_YOU_WANT
bm.verts.ensure_lookup_table()
for vert in bm.verts:
    if vert.co[2] < 0:
        vert.co[2] -= delta_Z
    elif vert.co[2] > 0:
        vert.co[2] += delta_Z

name = 'Capsule'
mesh = bpy.data.meshes.new(name)
bm.to_mesh(mesh)
mesh.update()
bm.free()

object = bpy.data.objects.new(name, mesh)
bpy.context.scene.collection.objects.link(object)

where scale_Z is how much you want to scale the result by.

I don't want to stretch the sphere, I want distance between the two halves of the sphere as shown in the image above

@Karan I changed the code to what you want.


text:
How to toggle a modal operator via BoolProperty?
I am working on a modal operator which is How to maintain the ratio of the gizmo while zooming in and out?.
I want to run the modal operator via BoolProperty
Is it possible?

Hello, could you add some more details please ?

Does this answer your question? How to create toggle button use python in blender

This answer was pointed out by pyCod3R in the comments and only needs two trivial changes to provide the solution to your problem:

It doesn't follow the naming convention for operator classes, but that would only generate a warning.  In the example, change SomeModalOperator to STRING_OT_modal_operator replacing "STRING" by a prefix of your choice.

event_timer_add now requires the window = keyword for its second argument: event_timer_add(0.01, window=context.window)

That said, the answer gives a step by step guide for what code to add to your operator but it doesn't really explain how it works and it doesn't deal with the case where a modal operator also uses the event information it receives.
For this code to work for you, you need to do these things:

Modify your modal operator to set up a timer in the invoke function.
Modify your modal operator to check the Boolean in the modal function.
Add the Boolean property
Add a panel entry somewhere that make the Boolean property available to be toggled.

Here's a very stripped down version of the kind of code you need to add.  You should be able to use the original answer plus this answer plus this code sample to add the changes you need to your own operator.
import bpy
from bpy.types import Operator, Panel

class TEST_OT_modal_operator(Operator):
    bl_idname = "test.modal"
    bl_label = "Demo modal operator"

    def modal(self, context, event):
        if not context.window_manager.test_toggle:
            context.window_manager.event_timer_remove(self._timer)
            print("done")
            return {'FINISHED'}
        print("pass through")
        return {'PASS_THROUGH'}

    def invoke(self, context, event):
        self._timer = context.window_manager.event_timer_add(0.01, window=context.window)
        context.window_manager.modal_handler_add(self)
        print("modal")
        return {'RUNNING_MODAL'}

class TEST_PT_side_panel(Panel):
    """This is the parent of the whole mess"""
    bl_label = "TEST panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "TEST"
    bl_options = {"DEFAULT_CLOSED"}

    def draw(self, context):
        label = "Operator ON" if context.window_manager.test_toggle else "Operator OFF"
        self.layout.prop(context.window_manager, 'test_toggle', text=label, toggle=True)

def update_function(self, context):
    print("invoke modal")
    if self.test_toggle:
        bpy.ops.test.modal('INVOKE_DEFAULT')
    return

classes = [
    TEST_PT_side_panel,
    TEST_OT_modal_operator,
]

def register():
    for c in classes:
        bpy.utils.register_class(c)
    bpy.types.WindowManager.test_toggle = bpy.props.BoolProperty(
         default = False,
         update = update_function
    )

def unregister():
    del bpy.types.WindowManager.test_toggle
    for c in classes:
        bpy.utils.unregister_class(c)

if __name__ == '__main__':
    register()

How It Works
The Boolean property is an ordinary Boolean, except that it has an update function that invokes the modal operator when the Boolean toggles to True. This is what jump starts the modal operator by invoking it.
The invoke function of the modal operator adds a timer and sets up a handler for it.  The timer allows the modal operator to periodically sample the value of the Boolean to determine if it should keep running.
The modal function of the modal operator checks the Boolean to determine if it has finished.  Arguably it could return {'CANCELLED'} rather than {'FINISHED'} depending on what the modal operator required at a toggle.

source: Stack Exchange

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

sort: votes


text:
Custom Area in python
I guess every year or so there is someone asking the same question: How to create a custom area in python.
I need to create a Properties-like area for inputs to automate functions for fast renders. This is for non-3D users, so a very basic UI for specific purpose.
There is a custom node editor code online and conversations on creating new areas in C. But, within Python, is there way of creating a new editor with the Properties UI (buttons and panels and slides)
Thanks,
Charles

Hello ! The short answer is still no. I've seen some very hacky things done like in the Scatter 5 addon which monkeypatched an area in the preferences to display a custom interface, but it's not supported at all.

Thanks for the reply.

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


text:
Live Unwrap is turned off but adding seams unwraps the whole mesh (blender 2.93.4)
As I wrote above live unwrap feature is turned off but adding or deleting seams causes mesh to instantly re-unwrap. Can someone explain to me how to fix it?

Even turned on, live-unwrap shouldn't do anything when you add/remove seams. Do you use any addon (like UV Toolkit, Textools or whatever) ?

Yeah, I use them

Ok so maybe the problem is related to one of this addons. I may be wrong, but I can't see nothing in vanilla Blender that can cause this behavior.

When you are in Edit Mode, on the Properties Editor > Active Tool and workspace settings, under options is there a Live Unwrap checkbox. This is not synced with the UV Menu > Live Unwrap checkbox. So make sure both are turned off.


text:
Background image does not appear on mac
I am trying to insert an image in the 3D View (Background image, Dropped image, Images as planes).
Whatever the technique, I get an empty yellow rectangle.
I know there has been lots of posts on this subject: I already tried to change the views, and to toggle between Perspective and orthogonal view, but neither succeed.
I have to specify that I am working on MacOS.
I tried today on a PC and it worked very well.
Does anybody have a suggestion?

please provide your blend file. I have a mac. I can check it out.

This may not be your issue but,  in your example, at the top right,  in viewport shading you have solid shading. You must select the material preview, or rendered mode.

I tried his, but still not works. Thanks anyway.

I was working in the layout workspace. By changing to the modeling workspace, I can finally see my images.


text:
I want to Transfer Weights from a Vertex or Multiple Vertexes one VG to Another in the Same Mesh Object using Python
I have a model that I want to move vertex groups or a vertex from one group to another.  I almost have the code down, but I'm running into a problem.
This is the code I have so far (I'm only learning and there is probably an easier to code it, but this is code I can understand at my level of experience)
import bpy
vgname1 = 'Leg_L'
vgname2 = 'LegD3_L'
vgi1 = -1
vgi2 = -1
vvgi1 = -1
vvgi2 = -1
verts=[]
vWeight=[]

Get current mode and name for active object
mode = bpy.context.active_object.mode
obname = bpy.context.active_object.name
print(mode, obname)

Walk through Vertex Groups and determine if the New Group
already exists, if not, create the new Group Also Get the
index numbers for the 2 Groups in question

for ob in bpy.data.objects:
    if ob.name == obname:
        for vgn in ob.vertex_groups:
            if vgn.name == vgname1:
                vgi1 = vgn.index

            if vgn.name == vgname2:
                vgi2 = vgn.index

            if vgi2 == -1:
                ob.vertex_groups.new(name=vgname2)
                for vgn2 in ob.vertex_groups:
                    if vgn2.name == vgname2:
                        vgi2 = vgn2.index
Test the results
        print( ob.name, vgname1,vgi1, vgname2, vgi2)

Put the object into Object Mode and get the
vertexes that are currently assigned to the group to be removed
Put the vertex indexes to be moved into a list

        bpy.ops.object.mode_set(mode = 'OBJECT')
        for v in bpy.context.active_object.data.vertices:
            for vg in v.groups:
                if vg.group == vgi1:
                    print(vg.group, vg.weight)
                    verts.append(v.index)
Ignore            vWeight = vg.weight

Now add the vertexes to the other group

                    vg2 = ob.vertex_groups
                    for vga in vg2:
                        if vga.index == vgi2:
                            print(vga.index,vga.name)
                            vga.add(verts, 0, 'ADD')

This is where I go astray.
The new group is added and the vertexes are assigned, but what if the new vertex group already exists and I just want to add the missing vertexes? I don't want to create another instance of the new group. (which is what this code does if I run it twice)
I went to the Blender Python documentation and this bit on Vertex Groups doesn't tell me anything
add(index, weight, type)
Add vertices to the group

Parameters:
•index (int array of 1 items in [-inf, inf]) – Index List
•weight (float in [0, 1]) – Vertex weight
•type (enum in ['REPLACE', 'ADD', 'SUBTRACT']) –
Vertex assign mode
◦REPLACE Replace, Replace.
◦ADD Add, Add.
◦SUBTRACT Subtract, Subtract.

I see types for add, replace and subtract, but no append...
I understand what add and subtract will do, but what the devil does Replace do?
I'm setting the weight to 0 in the vga.add(verts, 0, 'ADD') statement because using a variable seems to set it to 1 by default.  I can add another routine later to reset the weights on the vertices in the new group before removing the old group.
I'm stuck right now on when the new vertex group already exists in the object and I want to add vertices to it without creating a .001 instance of the new group name.
Help???
Thanks

Thanks cegaton, repaired the post as you suggested and removed Solved from the title.  I did not see the Write Answer button when I edited the post and The Add more info selection looked like the proper way to add more to the discussion.

Solution:
This code is clunky and really inflated. I know that actual coders out there will tell me that there are much better and more efficient ways to write this, but as I said, I'm just learning.
After playing with this abit, I found that this new code does just what I need it to do...
import bpy
vgname1 = 'Leg_R'
vgname2 = 'LegD_R'
vgi1 = -1
vgi2 = -1
vvgi1 = -1
vvgi2 = -1
verts=[]
vWeight=[]
x = 0
y = 0
z = 0
mode = bpy.context.active_object.mode
obname = bpy.context.active_object.name

for ob in bpy.data.objects:

    if ob.name == obname:

        for vgn in ob.vertex_groups:

            if vgn.name == vgname1:
                vgi1 = vgn.index
                x=x+1

            if vgn.name == vgname2:
                vgi2 = vgn.index
                y=y+1

        for vgn in ob.vertex_groups:

            if vgi2 == -1:
                z=z+1
                ob.vertex_groups.new(name=vgname2)

                for vgn2 in ob.vertex_groups:

                    if vgn2.name == vgname2:
                        vgi2 = vgn2.index
                        print(vgi2)

        bpy.ops.object.mode_set(mode = 'OBJECT')

        for v in bpy.context.active_object.data.vertices:

            for vg in v.groups:

                if vg.group == vgi1:
                    verts.append(v.index)
                    vg2 = ob.vertex_groups

                    for vga in vg2:

                        if vga.index == vgi2:
                            vga.add(verts, 0, 'ADD')

                    for v1 in bpy.context.active_object.data.vertices:

                        for vg1 in v1.groups:

                            if vg1.group == vgi1:
                                    print(v1.index, vg1.group, vgi1)
                                    vWeight = vg1.weight

                                    for v2 in bpy.context.active_object.data.vertices:

                                        if v2.index == v1.index:

                                            for vg2 in v2.groups:

                                                if vg2.group == vgi2:
                                                    vg2.weight = vWeight

            bpy.ops.object.vertex_group_set_active(group=vgname1)
            bpy.ops.object.vertex_group_remove()

If you wish to leave comments on how this code "should" be written, please go to the posting I made on here https://blenderartists.org/t/solved-trying-to-move-weights-from-one-vgroup-to-another-in-the-same-mesh-object-using-python/1156842/2 and post there.
Thanks


text:
why this face is always black?
I unwrapped the whole mesh, but one face is always black, I tried CtrlN and ShiftCtrlN but there is no change.
in the 2d editor "View > UV Local View" isn't selected
you can get the blend here : http://www.pasteall.org/blend/37300

Are you sure nothing is overlapping this particular face.
I would suggest for you to unwrap this separately.

The black face's normal is flipped so you have to recalculate the normals (Toggle into Edit Mode Tab > Select All A > Recalculate Normals Ctrl+N)
and also move the light source to see that the texture is there and it's just bad lighting causing the black face.

damn! the light... I din't check that! thank you

I would suggest to check your Vertex Color layer.

While working in Textured shading mode with the Blender Render engine, vertex color layer is overlayed on the texture with a sort of "multiply" blending mode. So if one of your faces is panted with black (rgb=[0,0,0]), its vertex color will completely overwhelm the face texture.

If you don't want vertex color to be shown while working with texture, but you don't want to lose that vertex color layer, you can create a new, all white, vertex color layer and set it as active.

I don't use vertex color, you can check yourself in the .blend

There are many reasons why the face can be black.
I think we should take a look at what material is assigned to that face. That is not visible in your screen shot. Different faces can have different materials.
To assign a material to all faces, select all while in edit mode. While still in edit mode, go to material tab, select desired material, and click "assign" button

I tried that before posting. I added a link to the blend.

Ah I see the problem was the normal of that face. I was going to suggest that first, but I figured you would have seen that when you flipped normals back and forth. Always try the "recalculate outside" method of calculating normals first. Cheers!

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


text:
Updating a 2.7 script that uses frame_current to work with 2.8+
There's a script I find very useful that works in 2.7x that is no longer working in 2.8x, 2.9x. I want to update it to work with current Blender versions. The script takes an object and makes a duplicate of it where it would be at each frame, applying mesh deformations. It seems it stopped working because of these Python API changes that came with the new Collections system.
The script that works in 2.7x was authored by CodeManX:

import bpy

scene = bpy.context.scene
frame_current = scene.frame_current

r = range(scene.frame_start, scene.frame_end + 1)
l = len(str(len(r)))
obs = []

for f in r:
    scene.frame_set(f)

    for ob in scene.objects:
        if ob.type == 'MESH' and ob.name.startswith("model"):
            me = ob.to_mesh(scene, True, 'PREVIEW')
            new_ob = bpy.data.objects.new("%s_frame%0*i" % (ob.name, l, f), me)
            new_ob.matrix_world = ob.matrix_world.copy()
            obs.append(new_ob)

scene.frame_set(frame_current)
for ob in obs:
    scene.objects.link(ob)
scene.update()

I messaged the author of the original code last week, but it appears he is not so active on Blender SE these days, so I'm not holding my breath for a response. Besides, maybe in the process of trying to fix this I can learn more about how the API works.
According to the API changes, I replaced scene = bpy.context.scene with layer = bpy.context.view_layer and that resolved one error. But now I am trying to resolve this one:
AttributeError: 'ViewLayer' object has no attribute 'frame_current'
This page of the Blender Manual still references scene.frame_current. Is this manual page outdated? Or am I misunderstanding and we can still use scene in certain cases?
This is my work-in-progress modified script, partially fixed for 2.8+:

import bpy

layer = bpy.context.view_layer
frame_current = layer.frame_current

r = range(layer.frame_start, layer.frame_end + 1)
l = len(str(len(r)))
obs = []

for f in r:
    layer.frame_set(f)

    for ob in layer.objects:
        if ob.type == 'MESH' and ob.name.startswith("model"):
            me = ob.to_mesh(layer, True, 'PREVIEW')
            new_ob = bpy.data.objects.new("%s_frame%0*i" % (ob.name, l, f), me)
            new_ob.matrix_world = ob.matrix_world.copy()
            obs.append(new_ob)

layer.frame_set(frame_current)
for ob in obs:
    layer.objects.link(ob)
layer.update()

Any help would be greatly appreciated. And if it can explained in a general way that may apply to others having problems updating a 2.7 script, or specifically those wondering about how frame_current has changed, that would be great.
Finally, one possible hint of new syntax is in this answer where the author has crossed out frame_current = 1 and replaced it with frame_set(1) ...unfortunately my logic of trying frame_get() did not work.

Updated script.
All changes here have been well documented.
Getting the updated mesh has changed.
How do I get a mesh data-block with modifiers and shape keys applied in Blender 2.8?
Scene update has been replaced.
What is the replacement for scene.update()?
Setting the frame is still done the same.  (frame_set is not a member of ViewLayer.)
Linking object to a scene has changed.
link new object to scene with python in 2.8
View layer objects has no link method.
revised script.
import bpy
context = bpy.context
scene = context.scene
dg = context.evaluated_depsgraph_get()

frame_current = scene.frame_current

r = range(scene.frame_start, scene.frame_end + 1)
l = len(str(len(r)))
obs = []

for f in r:
    scene.frame_set(f)
    #dg = context.evaluated_depsgraph_get()
    for ob in scene.objects:
        if ob.type == 'MESH' and ob.name.startswith("Cube"):
            ev_ob = ob.evaluated_get(dg)
            me = ev_ob.data.copy()
            new_ob = bpy.data.objects.new("%s_frame%0*i" % (ob.name, l, f), me)
            new_ob.matrix_world = ob.matrix_world.copy()
            obs.append(new_ob)

scene.frame_set(frame_current)
for ob in obs:
    context.collection.objects.link(ob)
context.view_layer.update()

Note haven't tested this thoroughly, re how often to evaluate the depsgraph, uncomment #dg = context.evalua.... to see if result differs when it is evaluated on a per frame basis.

Tested the script and it is working as expected. I'm wondering what is the purpose of the last line in the script ? It seems if I comment it out, it behaves exactly the same. Also, why can't we link the objects to the context collection inside the main for loop ? Blender hangs when I try to...

@Gorgious To emulate the old scene update.  Which as pointed out as last line of script, or for this one is most likely not required.   Often an update is not required in a script,  can get in the habit of sticking one in, just in case. Changing object matrices in a loop then looking at value later would often fail without an update... similarly with adding modifiers.  (A recent post looking  at mesh count before and after adding a modifier using method above required a new depsgraph either side)

Thank you batFINGER, you genius Python ninja! thanks for providing those links. I will have to study up to try to understand the why of it. Can you please elaborate a bit re your note about the depsgraph? Because it looks to me like it is getting evaluated every frame, and I don't see a difference when that line is uncommented.

Put in as an after-thought.  Relates to this https://blender.stackexchange.com/questions/196990/number-of-vertices-and-edges-report-no-changes-after-adding-boolean-intersect-mo/197091#197091   where it was required for getting the evaluated mesh before and after adding another modifier.  Because of all the weird and wonderful ways blenderers animate thought would add. In my simple tests with animating modifier props with #frame driver it worked as expected without too.  @Gorgious re linking in loop adds objects to loop ... prob making an infinite loop.  for ob in scene.objects[:]:

would stop this, or as I like to do obs = [o for o in scene.objects if o.type == 'MESH' and o.name.startswith("Foo")] to make a list to then iterate over.

@batFINGER I thought so too but it still hangs with the list comprehension...

Oh Ok.  What about if you make a new unlinked to scene collection, link objs in loop and then lastly link collection to scene. Twiddled around adding that since it is a bonus (IMO) to be able to deal with N x frames objects in one fell swoop without them being splurted into the scene.  Which can do by remembering to make an approp collection context before running script.

@batFINGER Makes sense. Thanks


text:
have a problem with syncing object in the texture paint
I am beginner in blender ,
In the texture paint, the object is not syncing with the other side(I do not know what is the name of that side!)

 I am using blender 2.81
thanks for your guide(s) :)
+the problem has been solved :)

This is weird. Can you provide the .blend via http://blend-exchange.giantcowfilms.com/ - and then edit and paste the code bit into your answer

@Manu Järvinen  the problem has been solved :)
thank you :)

Great great! :)


text:
problem with weight paint
I am beginner in blender,
I want to make grass and move them in one side of the plane with weight paint but it does not work and sometimes it works but it painted the both sides of the plane.

I use blender2.81
and I instaled the last version of blender , but it does not work.
what is wrong?

do you have enough vertices?

yes but I have problem with the weight paint mode.

If you have modifiers on that plane, please add a screenshot and it would help if you could add a picture of the weight paint.

as you can see in the pictures , it is in the weight paint mode.I do not understand the first sentence.

Ok, my bad, but i was expecting some coloration on the plane, though now i wonder more about which object you have selected at the time of the picture, since the outliner does not show any active object. The first sentence is regarding a possible modifier on the plane with the particle system. That said, if you do not mind, i'd suggest to share the file using Blend-exchange so a closer look could be taken to easier find the issue.

ok.I added the blend file.maybe the number of vortices are few.sorry my english is not my first language:)

the problem has been solved :)

I updated my answer based on the file you shared. If you found a solution, i would though in the future encourage you to share that if others solutions did not solve it. That way the question can be considered closed and others with similar situations can follow the answer to hopefully solve their situation too.

Updated based on the shared file:
I believed your grass had the origin in the middle and thus when distributing it on the plane made them stick through the plane to the other side, using the file shared as source, here the first two problems:

(marked red, the origin in the center as mentioned already, BUT also the not applied scale, which will always result in unwanted results)
The resulting grass looking like what i believed before i got the file to work on:

Solution:

Select the grass object
Press Alt+G to reset the position to origin, making the next step easier

Go in edit mode and select all with A

Move the vertices of the grass so that it's lowest vertex sits on the origin (on meaning in the same z/height coordinates)

To ensure that the grass object is scaled correctly we also apply the rotation and scale with Ctrl+A -> "Rotation & Scale".
Finally there is the need to generate the weight map, but for that to be possible, you need to have some subdivisions on the plane, as otherwise the entire plane can only have each corner weighted.
Subdivide the plane with the particle system on by pressing RMB and choosing "Subdivide", now you can either press Shift+R to repeat that a few times, or open the little pop up at the bottom left and adjust the amount of subdivisions in one go.

Now with enough subdivisions, go in weight paint mode and paint the area the grass is supposed to be:

After those steps and activating the visibility of the particle system, i get the following:

That said, you may have wanted smaller grass, you can scale it down in object mode.

Though i would recommend to scale in edit mode or at least to apply the scale afterwards again, having the origin at the right place then also makes sure that the grass scales properly.
Happy Blending

no it does not work.

What exactly does not work @amirka?

@brockmann thanks to your comment i found out that there was a file shared. Updated my answer corresponding and even though my answer already pointed to one of the problem, it sure was not the only one. Hope it's now more encompassing for similar cases.

This because of normals, in edit mode press shift + n to recalculate them.
edit:then try extruding your plane very slightly and remove all weight paint except for the upper plane.

no it does not work.

What exactly does not work @amirka?


text:
Tools not working
I apologise for posting the same question, but nobody seems to be active. I have nowhere else to look but my rotating tool isn't working. I'm trying to make this an efforted question but I really don't know what to do. My rotation tool is doing this:
https://gyazo.com/e7639bcb68cb1c6a57ed61ffab05f9c8
when I try to move an object up it just goes in these directions.    <---->
thanks. (oh and im a complete noob so I don't really know what these tools are.)

From what you offered it seems to be your pivot point. If you select the top edge with xray mode enabled to grab the whole outline, select shift s, cursor to selected In edit mode. Then in object mode Select set origin to 3d cursor. Also make sure your axis is set to global.

I'm a complete beginner so I don't even know what this stuff is. I feel bad admitting it :(

Hi. Instead of asking the same question twice you should address the problems with your first question. If you need to add more details you can use the edit link below it. Thanks.

How to upload an image to a post

sir I have nowhere else to look what else am I supposed to do??

My first question was that my rotation tool wouldn't go up! It moves left to right no matter the color I click. For example, If I drag the white circle to tilt the head, it just goes <-->. Im a young beginner and I don't understand the concepts of this! Can you please be more reasonable and HELP me? I am stressed out and I've been struggling with this for- hmm.. 2 DAYS? There are NO videos online and I can't find anything. So if you want me to stop duplicating my questions, why don't you sit down and take the time to actually answer them.


text:
Desaturated video after rendering
I use Blender's video editing capabilities and noticed that the resulting video seems to have less intensive colors:

The one on the left is the original, the right video was rendered with Blender.
The original video is in a mov container and  ffprobe says this about the video stream:

h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p(pc, bt709)

I added the original video in a new video editing project, and did the following:

defined a rendering range
set this in the output properties:

container: Matroska
video output quality: Lossless
encoding speed: Good
audio codec: AAC

Is there a way I can avoid losing the color intensity?

Here's a link the original video.
Blender version is 2.82, running on Arch Linux 5.6.12.

Following Leander's suggestion, I created some PNGs from the original video file with ffmpeg -ss 00:30 -i MV* -t 00:01 images_%03d.png.
Then I imported one of those images into Blender, and exported it again. Color was set to RGB, 8 bit color depth, compression was 15%:

Left: extracted with ffmpeg. Right: imported and exported with Blender.

Set the colorspace to sRGB (not filmic)

Thanks @susu. In "Render Properities" → "Color Management", sRGB is the value for both "Display Device" and "Sequencer". "View Transform" is "Standard". When selecting the video strip of the original movie, I can see in its properties under "Source", that the color space is sRGB. Is there another place where I can and should set the color space to sRGB?

Just to be sure, can you try converting the video to PNGs, importing the PNGs into Blender and export them as PNGs as well? You can use a small sequence with a length of 1. Just to make sure that the color change doesn't happen because of encoding or format specific settings.

can you provide the file?

I provided the original file and also the comparison of PNGs.

How are you comparing the two video files?

@Pullup: I opened them both in VLC, side-by-side. My window manager is Sway.

It is likely that the decoding and re encoding in blender is faulty. But also, who knows how  vlc is decoding and what kind of color management it has. Codecs are far from perfect. Each one introduces new problems.Open both videos in blender in side by side windows of the video clip editor and compare. To find out if they are different overlay them in the compositor (or any other compositing app) and use a difference operator. If the image is exactly the same you should get a black image. Any difference would show there.

Additionally you can check the vectorscope and wave monitors for both video clips to assess changes.

Since all outputs and original video opened in QT and Blender is "desaturated" in the same way, I would say that it is more like wrong interpretation of colours in VLC. There is also noticeable contrast in VLC that totally flatten black parts (hairs) = loose all the rest of details that wasn't destroyed by camera and compression already.

Original video and rendered VSE PNG inside Blender ...

... they perfectly match (top row on bottom row with blend type - Different). I used curves to bring contrast in extreme values to see result better. Completely black.

BTW also your screen of PNG's match perfectly.
But result differs when the same data (video and render is opened in VLC.

Rendering into QuickTime H.264, opened in QT, produce differences only due compression artefacts.

I think this is a valid answer. It is hard to account for all the variables, other than to know that there is no perfect way to keep the information intact across different compression-decompression-recompression schemes. Compounded with different methodologies to display and decode depending on the particluar app.

I'd much prefer if you didn't delete your answer. Knowing that the cause of desaturation lies with VLC and not with Blender is valuable to me (and others, I assume). Optimally, we could find a way to make Blender produce video that VLC shows with the same colors as the input file. But your post is the next best thing.

I can keep it, I just didnt want to take your bounty without solution (it happens like now because of upvotes), also I dont want to take Leanders credit¨(from  my side it started as comparison so others can get another step). Later I noticed only VLC is different, and it doesnt has to be the reason. Anyway what I tried to say is - blender represents colors same as Quicktime (that is like creator of MOV file type). It seems to me like VLCs fault. So it is not about find a way generate better video from blender, but how to display your original MOV file correctly in VLC.

When in doubt, ffmpeg is mostly the correctest. When still in doubt, use exr-sequences (I know, overkill for many situations.)

@Matthias You know, VLC also has color correction. Maybe you can research about how vlc interprets certain formats or if there are color correction presets.

Correct answer I believe. The problem is, as Leander noted wisely, extremely nuanced and complex, covering essentially: 1. Lack of tag acknowledgement in decoder, 2. Lack of tags in encoding, 3. Broken encoding in subtle ways, 4. Broken decoding in subtle ways. Try a different wrapper might resolve the issue, such as MOV. Not all wrappers provide all required tags, and the surface of proper decoding that would honour them is complex.

check the color management perhaps filmic is active here altering the colors.
https://docs.blender.org/manual/en/latest/render/color_management.html

I already had a look. Here's a comment of mine in response to user susu: In "Render Properities" → "Color Management", sRGB is the value for both "Display Device" and "Sequencer". "View Transform" is "Standard". When selecting the video strip of the original movie, I can see in its properties under "Source", that the color space is sRGB. Is there another place where I can and should set the color space to sRGB?


text:
Voice over in Blender
When my character speaks, I use shape keys to move the mouth, just up and down.
If I wanted to add a voice, do I need to record this separately and then insert as audio?
I'm asking if Blender has a voice sync or lip sync feature.

You can move objects (and use hooks as shapekeys) which can be driven in synch by audio.  I've forgotten the exact term now but it's done in the graph editor.  I'll get back to you but in the meantime if anyone does recall that function's name, feel free to fill us in.

Further to the above - You use an external audio file and in the Graph Editor, use the feature called - "Bake Sound to F-curves".  Just comment a request for more info if you're stuck.

what does this mean? f curves. what does this do?

To drive lips from an audio file -
For this exercise both lips are simply curve-paths bevelled with a small diameter oval and left as curves.
The animated gif pic below is the Graph Editor and where these "f-curves" are created.  They are simply graphs measuring time (frames) against amplitude or degree of movement.  They can be most useful in that they can be dragged and reshaped to affect animation.
Please note that what you're seeing here is the (speech) audio file after it's been 'baked to an f-curve'  The green waveform is that f-curve.
We use that to drive the yellow sound bar (a plane) to expand in the Y axis with the audio's amplitude.  The louder it is the further apart the lips go.

The lips are simply curve paths and we drag each lip's center vertice up or down using a 'Hook" empty for each.  The upper lip's hook is parented to an empty that's stuck on the upper corner of the yellow sound bar. (parented to)  The lower lip's hook is parented to the lower empty at the lower corner of the sound bar.
As the sound bar is expanded and contracted by the audio, the two hooks are dragged
up and down to follow the two empties attached to the sound bar.

Details -  How to achieve this...
In Edit mode, add a hook to each of the lips' center vertice.  (CTL-H --> Hook to New Object)
With the view set to TOP & Ortho, place the cursor to the right of the lips and add a plane.  This will be the sound bar.  Proportion it as shown. (stretched in the Y axis)
Scale it's Y axis to the max length that you want it stretched to by the audio.  Bear in mind that speech may only get to about 30% of the maximum amplitude most of the time, so scale the Y axis to be at least 2 or 3 times that required.
At the upper end of the sound bar, place an Empty inside it and near to a corner vertice.  Parent it to the plane.   (CTL-P -> Vertice)  (child=the empty)
Do the same at the bottom corner or near to it.  Parent that to the plane/bar also. ("vertice") (child=empty)
Select the upper lip's Hook and parent that to the Upper Sound bar empty. (Child=hook)
Do the same with the lower lip's hook. Parent that to the sound bar's lower empty.
This setup will force the Hook Empties to follow the sound bar's expansion and contraction in the Y axis and drag the lips' centers according to the sound level.
-=================-
---> POINT A <---  (Return to here if the sound bar (plane) needs rescaling)
Driving the Sound bar's Y axis scaling from an audio file -
In the 3D window, take the timeline cursor to frame 1, select the sound bar and insert a "Scale" keyframe. (Hover in the scale slots at right and press i )
With the sound bar still selected go into the Dopesheet and delete the sound bar's other two axis' keyframes.   In this case that would be the X & Z axis.  We only want the Y strip.
Select and highlite the one remaining keyframe. (Y axis)
Go to the Graph Editor and you should be seeing the Y axis scale F-curve.  That's a graph that draws frames (time) against scale. (size)
At the bottom center of the window, expand the "KEY" menu, select "Bake Sound to F Curves".
A file explorer window will open up.  Browse and select the audio file.
Blender will automatically sample this and convert it to a waveform.  (Press Home to see it properly)
If it doesn't, try converting the audio to a wav file.
Back in the 3D window press play. (ALT-A)  to see the sound bar's size expanding and contracting to the sound's amplitude.  The lips should also be curving open and shut.
-==================-
If the sound bar isn't expanding enough, remove it's keyframe by selecting that axis strip's name in the DOPESHEET at extreme left and pressing X.  Check the graph editor to see that the F-curve has indeed disappeared.
Go back to "POINT A" above...
-===============-
Information -  Sound can also modulate lateral movement, rotation and even colour and brightness, the last two requiring some manual trickery because with most audio, it won't drive it bright enough.

Note: the "Bake Sound to F-Curves ..." menu entry is in the "Channel" menu of the Graph Editor for Blender 3.x. It's no longer in the "Key" menu as mentioned in the answer above.


text:
Add contrast or saturation to render?
When I render something, as image or video, is there any option to change the contrast or saturation of the image without having to use any external software?
Thanks in advance.

Compositing is the best way.

An often overlooked feature is blender's colour management options that can be found in the scene properties.
If the simple exposure and gamma controls aren't enough you can enable Use Curves to get more control.

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


text:
Normal map not applied to selected faces
Following:
Blender text not being properly applied onto cylindrical object
I've created a normal map with text that I tried to apply onto a cylindrical shape:

Strangely, what happens is:

parts of text appear onto faces onto which the texture (material) has not been applied to
the UV map of the central selected faces seems to extend way outside the map
moreover, the selected faces are not scalable on X (height never changes; they can only be scaled on Y); no matter for how long I scroll the selected faces (line) over the map does not seem to have an "end"

Why?

Added map to .blend:

Text appears mirrored on the cylinder:

Fixed! Text had to be remapped and rescaled to X -1:

Seems to be due to the UV map. But as several "strange" issues, you'd better upload your file. https://blend-exchange.giantcowfilms.com/

@lemon Thx! Done!

Well... all is scalable (but from some ortho point of view, this is not visible). About the UV map, redo it for the part you want to set the normal map. Select the faces where you want the text to be and UV unwrap it. The normal map is not included (packed) in your file, so I can't show anything here.

Additionally, as the other material is also based on a UV map, you may want to create a second UV map for the text part.

as Lemon says you need to unwrap again, but before, make a U (Unwrap) > Reset

@lemon I did; almost there (the text is mirrored and applied to a few different (unselected) faces. How do you pack the normal map into a .blend file.

@lemon Done! Reuploading in a second.

to pack the UV map, in the UV editor (with the map shown) go to the menu "image/pack"

@lemon Yes, I have a separate UV map for the text; I unwrapped it as a cylinder and now the text is applied onto it but it's mirrored.

As you have already a UV map used for the other part of the mesh. Create a second one and for this one select only the mesh part where you want the text to be and unwrap it.

If mirrored: scale the UV on X of -1 (and about the file, still no image in it)

@Sebi, so you did it! Great!


text:
Loop cuts break subsurf
How can I sharpen this subsurf (without creating a separate object and parenting it to the current one)?
I'm trying to model this tank :p:

What I tried:
Adding loop cuts to the mesh but they cut vertically creating ngons (I only want the lower thread "fenders" to be sharpened).
Increasing the crease creates an ugly, broken, deformed mesh.
Is there a better way than creating a separate mesh and parenting it to the current one?
Right now, I'm insetting the lower faces of the fenders and extruding them; the end result is an extruded elliptical plane.

I'm having a hard time determining what you want to harden, exactly. Are you trying to make those oval/cylinder shapes more like rectangular panels?

Yes. Managed to fix it (added loop cuts over the whole mesh and increased the crease on the outer edges). For some reason it looks ok now.


text:
How to remove duplicate verts after spin tool?
I'm trying to reproduce tank wheels ("ITALIERI" (LEAST PERSPECTIVE)):

But there are too many vertexes and merging can lead to ngons.

Edit:
Second file:

Edit #2:
Made some progress with the topology; overlapping faces/edges as described here:

but there are still highlighted faces that seem separated from the mesh (on the tip of the spokes).
Can't dissolve certain edges
Edit #3:
If there are two or more overlapping faces with the same normals the resulting face appears "brighter".

Your topology is a bit messy, to quickly fix it you can:

Only keep one portion:

Fix the topology, give it a Mirror modifier:

Create an empty at the current origin of the object:

Give your object an Array modifier, deactivate Relative Offset, activate Object Offset with the empty as Object, rotate the empty 37,72° (as you want 11 iterations), enable the Merge option then the First and Last option:

Keep a copy of your object and empty. Apply the Mirror and the Array modifiers, then Merge By Distance to remove any overlapping vertices:

Edit:
Your topology is still bad, your faces are overlapping, etc:

Once you'll be good, you can extrude, use the LoopTools to make sure that you have nice circles, bevel the angle so that it will sharp when you'll have the Subdivision Surface modifier, etc...:

Also you may need to keep only 1/11 of your object again and use the same Array modifier around an object, it allows you to work precisely on a portion of the object without having to repeat the operations all around.

Thanks! I still have overlapping edges and am unable to select the center edge loop (circle) to be extended. I'll keep trying.

Ok. I get something roughly similar but only when not applying the subsurf modif.

what do you mean? Maybe share a second file

Ok. Edited (reuploaded).

The inner vertexes do not form a face (cannot create a loop cut for the rest of the wheel; the mesh now looks like a crown :))

your topology is still not good, I've edited my answer

I still can't seem to get to pciture #5; how do you apply the array modifier so that you have no face overlap in the end result?

look at picture #2, you need to make sure that the shape is 1/11 of the whole ring and that you have quads with no overlapping vertices/edges/faces. You need to continue working on this part until it works fine, then you can apply the modifiers

I've made some progress but now the tips of the spokes are highlighted and behave differently when selected; one face is selected if any of the four faces making up the spoke is selected, but Alt + LMB behavior if any of the lower faces (beneath the spokes) is clicked.


text:
Make edges parallel in blender 2.8
Is it possible to select a number of edges and change their orientation with respect to one of them?

Please provide a visual example.

"change their orientation with respect to one of them" is my question. Align them to each other? Align them to one of them in particular? Align them to a specific measurement?

@AlexanderESmith Make the middle edge (from selected faces) parallel to the edge either to the right or left.

GG on a loop  followed by E to make the slide even does this. F flips which side the loop is made even to.

in edit mode select the loops you want to move, hit the "G" key twice will allow you to move the loop together.
Also, Propositional option while using the translation gismo

Maybe you could expand this answer to include the 'E' and 'F' options of the slide tool, which will make the moving loop parallel to an adjacent loop, 'F' flipping which one.


text:
Blender 2.8 frame window scaling
I have an animation (transform + rotation) that takes a 100 frames:

This is a trivial example, but in more animations, can I extend the frame window so that there is more time (e.g. from 100 frames to 200) to display detailed key shape animations. In this case moving either frame (at mark 0 and 100 offsets the other).

Move the cursor to the timeline window and Press the Home key to show the whole range of frames.
Else click and drag on the bottom of the lighter gray bar at the bottom of the timeline to enlarge or shorten the amount of frames being displayed.
To extend the animation, select only the last keyframe and move it from frame 100 to whatever frame you want.

The whole range of frames is from 0 to 100 (in my case). I want to extend it so that the animation is "slower".

Select only the last keyframe and move it from frame 100 to whatever frame you want.


text:
Is a set of connected vertexes that do not create a face an ngon?
Is there a chance for artefacts to appear if a part of the mesh has more than 4 vertexes that do not form a face; e.g. plates stacked on each other where the bottom has no face.
There is a small wedge between the cube and initial mesh:

Hello :). That's called non-manifold geometry. What kind of artifacts do you have in mind?

maybe give a try and show and share the result?

@moonboots Edited. Is the base of the mesh an ngon or not since the vertexes don't form a face

An ngon is a face, with more than 4 verts.

@batFINGER Ok. So it's ok to put another cube beneath the selected mesh and merge it to it? Since it's not an ngon it can't be messed up during rendering, right?

Hello @Sebi :). Have you noticed n-gons being somehow 'messed up' during rendering? They might cause some artifacts with Subdivision Modifier or when they're non-planar. But flat n-gons? These are usually fine. Also, such n-gon would be trivial to turn into quads :).

Since no one has answered, consider updating question with "merge cube below" details. Posted XY Problem link earlier where it prob wasn't a case, a bit gun shy, but feel this is the case here.

@Jachym Michal  In this case not (yet) but I don't want to apply the modifier to the entire mesh. If I create a face from the corner vertexes of the bottom rectangle the mesh is closed and the modifier applied. It's not flat as I'd like but beveled. Now, I want to create parallelepiped as a separate mesh and move it close to the bottom vertxes and then apply the modifier in the first mesh save it and merge it to the second?

@batFINGER Done. Added details + blend


text:
Creating partially rounded meshes
In the image, I want to create the axis parts (red circle):

I tried creating separate meshes with no modifiers (Cube.001 and Cube.003 (attached blend file)) but I wanted to make the top rounded by adding modifiers, but when applying the subsurf modifier to a disjointed mesh (more "isles" of connected vertexes the modifier is applied in reference to the geometric origin of the whole mesh (and not each submesh ("isle")).
Questions:

is it a good idea to have multiple separate meshes (either individual meshes of subsets of vertexes within a mesh) and place the close together so that it looks ok? and not create ngons

related to first, is it ok to split the mesh up into individual meshes, apply modifiers on these and then remerge?

You don't say what's your final purpose, is it for images, animations, close-up shots or not, 3D printing, etc? In my opinion it's always better to try it as one object; if it's too hard, use boolean and then apply and correct the topology, etc... If you are in a hurry and it's just to give illusion, you can quicly make separate parts

Animations; I'm trying to create parts of the rims that would need to spin (and turn on other models). Is it ok to have multiple meshes with modifiers closed to each other that are merged into a single mesh but not topologically?

The important thing at the end is that you can't see that it's made of seperate parts when it is supposed to be one part. You can join them all (ctrl J) to make one object, or, if they all need to keep their own modifiers, you can parent them to the main object


text:
Interpolate mesh surface between curves
Suppose I'm trying to model a curved surface: the roof of a car is a perfect example. Many tutorials suggest creating a plane mesh, which I should subdivide via loop cuts, and then proceed to model the mesh in two dimensions (say from the top, so X and Y). After that, I switch to a front or side view and I move the outer vertices along Z.
Here comes the tricky part: I end up with two "edge curves", two outer profiles of my surface. Say we're looking at a side view, so the Y axis is along the horizontal axis of the screen. How can I move a "row" of vertices (vertices that share their X coordinate) or multiple rows so that they fit the smooth transition from the "back" profile to the "front" profile?
I know in a sense this sounds like lofting - it probably does, but I'm not sure I get the concept fully. However, I'm looking for something that I can apply at will, not only when creating and developing a surface. In other words, if I move a vertex of one of the "profiles", I want to be able to reposition the inner vertices smoothly based on the new position of the outer vertices.
EDIT
Here are some screenshots to help you understand what I mean.

Here's a plane mesh, with subdivisions in (supposed) key points. I move the outer vertices to match the surface I'm modeling. This is still a flat surface, but you can already see what I mean: I want the inner vertices (those still lying on the square grid) to be moved so that the rows transition smoothly from the curve of the top row to the curve of the bottom row. The "columns" should do the same.

In this second screenshots, the outer vertices have also been moved along the Z axis. You can see what I mean by "smoothing the surface": the inner vertices should follow a curve so that the surface is smooth.

I should also add that this is similar to what the loop cut actually does. But I need to do it "after": I already have the inner row of vertices, I want to move them in the position the loop cut would put them into. I hope this is clear.

Maybe add a few screenshots?

You can hold the (Alt) key and then select a vertex and whole edge through out all the mesh (depends on how good your topology is) will select

Kinda like the Loop Cut tool does. In this two screenshots (https://i.sstatic.net/47xzY.png https://i.sstatic.net/Ax8hu.png) you see the edge the toold would add in different positions. Notice how the position of the new vertices is interpolated based on the nearest edges.

It seems you're looking for Proportional Editing (press O in 3D View window) feature. You can also set up its editing modes after turning it on

I know Proportional Editing, and I've been using it. However, if I use it to move vertices I can't have it influence the next row - not without influencing also a part of the second next and maybe a couple of vertices of the third next. Also, I'd rather have something that adjusts the vertices a posteriori, like a "smooth" operator but with a curve transition rather than making it quasi-flat.

Did you try to adjust Proportional Editing falloff and size?

Yes @MrZak. The problem is exactly that PE acts inside a radius, and it doesn't take into account the shape of any edge it acts upon. It's a great tool for other situations, but it doesn't meet what I need here.

If you aren't happy with position of these vertices then you simply use Smooth Vertex from toolshelf (T). Also, such shape can be created by using PE with different size on each step (I smoothed vertices only once). If that's not the problem then either I completely misunderstand or you don;t use appropriate technique

@MrZak, don't get me wrong, I may be using it wrong, but as a matter of fact PE is not helping me. It makes a few vertices (or too many of them) "follow" the one I'm grabbing, and it in no ways helps me define a shape. Also, I'd like to have a way to act after modeling the edges. What you suggest works as I model, but what if I decide later to move one of the outer vertices? I wish I could "smooth" the mesh again and be done.

If you are looking to move an edge, they refer to this as Edge Slide. Press the G key twice while that edge loop is selected. Then you'll be able to slide it. Also, Ctrl+R key will add a loop cut. You can use scroll wheel at that point to add multiple loops.

Thanks, @JeffG, we're almost there! Edge Slide is a great tool, but look at my second screenshot. If I select the second edge from the right and Edge Slide it towards the rightmost edge, the Z position of every vertex is interpolated between that of the rightmost one and that of the third one from the right. Is there a way to Edge Slide them all, between the leftmost one and the rightmost one? I tried selecting them all but it comes out a mess.

I think what you want here is the Grid Fill tool.
Make your two profiles (make sure they have the same number of vertices), then fill them in with Ctrl+F > Grid Fill.
Make sure you have Tools menu opened (you can toggle it on and off with the T key, it shows up on the left of the 3D viewport) or press F6 after command execution and you can fiddle with the settings; I recommend you using a very low setting and then use loopcuts.
The cuts will have the right shape, so all you have to do is push them up or down the opposite axis from your main profile shapes. (If it was a floor or roof, this would be Z, a wall would be either X or Y.)


text:
Bake image into texture as if it was a sticker
I'm creating a livery for a car model, and I want to do this in 3D using Blender. I have the mesh loaded into a Blender file, and I can paint on it fine.
Once I have defined a base livery, I create another image to use as a "decals" layer. This layer should contains logos, numbers, names and all the other stuff you usually see on race cars. Currently, I simply draw them on the "decals" image, and I use 3D objects as a reference for the position of the stencil (place a cube, scale it so it matches the aspect ratio of the image, place it so that a face of it shows where the stencil should be placed), but then I have to manually place the stencil, and to do it again on the other side.
While this is enough for the image resolution I need, it is still time consuming and makes it hard to "just try" and experiment.
I thought about making my decals using actual 3D objects, texturing those with the decal images and baking them into the result, but I can't change the UV mapping of the car mesh, and matching the UV mapping of the decal objects with the UV mapping of the car object would kinda defeat the point of painting the livery in 3D.
Is there a better way?
EDIT
This is what I use now:

The grey blocks' small sides represent a decal. If I go into orthogonal side view, I can manually line up the stencil and paint on the car. Once I paint, if I wanted to move it or resize it I'd have to erase it and paint it again.
Instead, this is what I would like to have (or something similar):

The plane is textured with the decal image (here a simple checkered image), and it can be moved around.
Ideally, I'd like a way to "project" the plane's texture onto the car's texture, but in a non destructive way, so that I can move the plane around or resize it and "regenerate" the car's texture.
AFAIK, in order to bake I'd need to join the meshes and re-UV-map the joined mesh, but I can't alter the car's UV (it's an asset of a game), and I don't know how to "burn" the plane's texture on the car's texture in a different way.

for decals the best is probably to create a second UV map for the decals you want to project, create a UV Map node in the material and put it before the Image Texture that has your logo loaded, mix the Image Texture with the rest of the material, use the Alpha output as a factor in the Mix Shader

I'm not sure I get how I would "project" the UV of the decal onto the UV of the car. What I would like to get is a 3D object that I can move, and the decal moves on the car accordingly...

could you please show some screenshots so that we understand what you're trying to do and why it doesn't work?

I've added pictures to clarify what I mean. I hope it's clear

I'm not sure I understand your need, I hope someone will understand better than me, but would something like this (decal controlled by an empty) satisfy you? https://zupimages.net/up/21/41/mye3.gif

It would help a lot! How is that done?

You could create an empty as controller:

Here is the Shader Editor. Create your logo, keep the background transparent, load it into an Image Texture node. Use the Texture Coordinate "Object" output, then select the empty at the bottom of the Texture Coordinate node in order to control the location/rotation/scale of your logo. Set the Image Texture node to Clip instead of Repeat. Mix the logo with the rest of your car texture in a MixRGB, use the Alpha output of your Image Texture as a factor:

This method will project the exact same image on both the 2 opposite sides. If you need a logo to be reversed on the opposite side, assign to these faces a copy of the same material, except you need to rotate 180° on the correct axis in the Mapping node, here is what it gives:

EDIT BY OP
To answer my last question (how can I get a reversed version of the logo without duplicating the empty or the material?), here is the node I used - only the part of it that contributes to the Mapping node:

Thanks a lot! This is a great answer! Just one more thing: I have a wide image, but it is mixed as if it was square. Do I need to scale the empty so that it matches the image's aspect ratio?

you can either scale the empty on the axis you want or play with the Mapping node values

Finally, can I have a mirroring on the X axis? If I place "LOGO" on the left side I get "OGOL" on the right side...

oh yes you're right so maybe you need to give another material and empty to the opposite side?

I guess I could do something with the Geometry's X value, but I'm not sure how to do that. I'll give that a try, since I'd really like to be able to use the same empty. Thanks a lot for now!

Ok I've edited my answer, for a logo you need to assign a copy of the same material to the opposite side, and in the Mapping node rotate 180° on the correct axis


text:
EEVEE: material preview displays nicely glossy with default world, but fails with scene world (screen space breaks everything)
When I display my glossy object with viewport shading in the default world, the result is quite nice (works also with scene lights):

However, if I use my scene world (which is basically the final render) then it becomes ugly (note that I enabled and baked the irradiance volume):

If I enable screen surface reflections, the result is not amazing (and it even breaks the result without scene world), and it's also slower:

Any idea why the default lightning gives great results, and do you know how I could apply it to my setting?
Here is my material and scene:

https://blender.stackexchange.com/questions/128499/how-to-use-2-8s-default-hdris-in-renders

@scurest, I'm not sure to see how it helps: why EEVE can render perfectly worlds with HDRI, but fails dramatically when there is no HDRI? Does that mean that I can't use metal in EEVE if want to reflect anything else than HDRI?

Was a response to how to get the default world. Does a regular glossy sphere show your world correctly? Are you sure its not mostly gray just because your world is mostly gray?

Your object looks different in material preview than in your final render because you have a highly reflective glossy surface and in material preview the preview HDRI is contributing things for the surface to reflect, but with just your scene lighting there's nothing to reflect.
The object is much darker with world lighting because the HDRI from material review is contributing more light to the scene than your lighting panel.
The comment pointing you to the other question was meant to point out that if you used an HDRI in your world, you would not have this problem.  Here are some examples.
material preview:

Mine looks different than yours because I have a different HDRI in material preview.
world space, low lighting, no HDRI:

world space, high light, no HDRI:

world space, different HDRI:

In the last I selected film->transparent in render properties.
Without transparency:

Lighting matters a great deal in what a material looks like when it is rendered.
You add an HDRI to your world lighting by going to the node editor, selecting "World" rather than "object"; selecting "Use Nodes"; and then adding something like this:

Then open up an HDRI in the orange box and that applies that HDRI to your world lighting.

Thanks a lot for your help, and for pointing me towards HDRI (+1). However, it does not actually solve the problem in the good way because it does not add the good reflection (the reflection added is the one from the world, and not from the neighbouring objects). I finally found how to solve my issue, cf my answer. Thanks for putting me on the right path!

Ok, I understand what's happening now. Marty Fouts, is partially right, but it does not provide a way to actually solve it in the correct way (or actually not the way I want). But it definitely helped me to understand the problem, thanks a lot, and using HDRI may be enough for simple worlds. The problem was not the luminosity (I could add as many sun as I wanted, the problem was still the same), and adding an HDRI first was not enough, and more importantly it does not solve the problem the way I want because it may not reflect the appropriate content.
So I had actually two problems:

The first problem is that when you add new things, like an HDRI image, you need to re-bake the luminosity (I'm using a plan emmiter to keep compatibility with cycle). Once I was doing that, it was slightly better, I could indeed see some sort of reflection with the HDRI, but it was not doing what I wanted, i.e. reflect the plane on the sphere as cycle was doing...
The second problem is that EEVE has a strange way to deal with reflection (either in metal or in glass): by default it takes the world, even if an object is in between (that's why HDRI gives you some sort of reflection, but not the one you want). The solution in fact is explained greatly in this tutorial: for any surface that reflects stuff (which is the case of our cube) and for glass objects, one must put a reflection cubemap (shift-A > light probe > reflection cubemap), around the precise object that must reflect the light, and bake the cubemap (you can also click "auto bake", it does not rebake always, but sometimes it is enough). This cubemap (as I understand) will basically take a photo of what is around, and consider it as a local "world". For that reason, if you have multiple objects, then you must add one cubemap per object, otherwise they will not reflect each other. To take this "photo", EEVE will also scan what is around it... and if it finds nothing, then it just puts the world (HDIR...). But this scan may not be far enough, in that case you will reflect the world instead of the object. Anyway, all these details and more are explained here.

Here is now the same result, after adding a cubemap:

and here is my setup:


text:
Is it possible to write a script relocating the "auto keying" button to Graph editor?
How would I go about adding the Auto-key toggle button to the Graph Editor? The only reason I use the Timeline editor is because that button is located on it.

It can be done, but I don't have the time to work out the details.  Basically, you need to create a MT class and append it to the graph header.  It'll end up at the end of the header; but it's doable.

My personal workaround is to keep the whole Timeline window as tiny as possible.

Alternative is to add the autokeying toggle as a quick favorite and not have the timeline visible at all.

Both are good workarounds, thanks guys.


text:
Bevel an inset face with resulting clean edges
When I bevel this Edge (which is parallel to X-Axis)

I always end up like this:

But actually I want this (without the faces that I colored blue)

I extruded the inset face without further scaling and moved it inwards the x-axis After extruding it a second time.
How can I achieve the beveling results in proper edges/faces?
Link to my .blend-file:
https://www.file-upload.net/download-14584958/bevel_problem.blend.html

can you provide your blend file?

I added a link in the question.

question: how did you get the edges smooth? did you apply a modifier?

I selected some (not all) faces and Set Face>Shade Smooth. I then added Loop-Cuts where needed to get a prettier result. (No modifier)

Here's a somewhat shorter solution, but it still requires a bunch of work.
Create the bevel:

Use the knife tool to replace the missing edges:

Select and delete the edges you don't want, using dissolve edges:

and there you go:

This leaves you with all quads in the replaced area, but a concave quad can be just as bad as an n-gon.

Nice! Always forget about the knive. And finally adding an edge to Split the Face into 2 triangles should then bring up a perfect result regarding rendering etc, right?

I'm not sure if two tris or 1 concave quad would be worse.  Either way don't forget to set auto smooth in the object's properties.

I think my workflow is similar to @Chris's, but because I'm working to a Subdivision Surface, there's less topology. I did this on your model, but have reproduced the moves on a smaller one to illustrate more easily.

All with Snap set to 'To: Vertex' and 'With: Active'...
I deleted your existing extrusion, filled the hole, duplicated it out along its normal axis. Then CtrlShiftB, bevelled it in place, away from the rest of the model.
Because Subdiv. is coming, 2 segments will do, in the bevel. Now to prepare a hole for it...

(Left) A couple of horizontal loops were needed to create edges for a hole with a nice even margin all the way round the bevelled face. Then, (Middle,) loops were cut and snapped into place along X and Y axes to match the bevel vertices. (Right) The hole was deleted, and the bevelled face snapped flush again.
The original loops from the rectangular face were dissolved away, leaving matching vertices in the hole and the new face.

Now, since I have the shipped add-on 'F2' activated, I can fill one face in the gap, and, having selected the leading edge, hold down F, to fill the rest. You can cut a loop through the new faces, and GG .. Evenly slide it (with F to flip if necessary) to make a neat isolating rim around the new face.
The rest is extrusions and insets, or bevels, whichever you prefer. I cut extra loops near the corners to hold the edges straight.   After Subdiv:

Maybe this way is just my habit, rather than 'the best'.. but I personally find it easier to work to a hole in situations like this, where you need a partial bevel. You don't want the consequences of the bevel propagating over your nice clean mesh.

P.S. If you did want to work to subdiv, you would need to reduce the number of segments in the moulding around the rims of your case. 1/3 of that would do.

ok, i don't know a better solution, but it works ;)
I am sure, moonboots will provide a two click solution ... ;)

select these 2 edges

x -> delete edges

select this edge and bevel your edge as you want

reconstruct your old mesh by selecting these two guys -> F

select these guys -> F

select that guy -> copy y coord

select that guy -> Shift-D -> escape -> paste y coord from 7)

...and so on until your mesh is closed again

Thank you, pretty hacky but seem to work. Thinking further about the Problem which, on first look, seemsled actually simple, I thought the desired solution may end up in some dort of Triangel-faces. Like a Quartier of a cylinders Triangel-fan at the beveled Front Face.

i am pretty sure the pros are coming up with better solutions...just wait ;)


text:
Snap isn't working properly
I can't understand what's going on. I used snap to face with project individual elements, and I used proportional editing to stretch the vertices; but it doesn't work. Here are screen grabs showing my issue.

as you can see in object mode the view is awful and horrible. I managed to fix that in sculpting where I was able to stretch the icing but that's not what I saw in the tutorial. Can anyone explain to me what's the problem? How can I fix it?

Snapping is working, but you don't have enough geometry for the icing to completely conform to the donut.  So when you snap one of the lower vertices to the face of the donut, the icing has to "dive into" the donut to reach the face.
I suspect you are able to "stretch" the icing in sculpting mode either because you don't have snapping on there or because you have one of the sculpting modes that is adding geometry.
You can accomplish the same thing in editing mode simply by turning snapping off temporarily and pulling the vertex away from the donut.

The icing offset is -1 and it should be +1.This might be partly the problem.

Hi, thanks for the post. This site is not a regular forum, answers should be substantial, stand on their own, and thoroughly explain the solution and procedure. One liners and short tips rarely make for a good answer. If you can [edit] your post and provide some more details about the workflow and how it works, feel free to restore it, otherwise it may be converted to a comment. Perhaps add a few images illustrating some steps and final result. See How to write a good answer?


text:
Why adding subdivision surface modifier solid object like this and loop cut not adding?
Why my object is solid like this after adding subdivision surface modifier? I am trying to add more loop cuts for refining but unable to add them on soiled positions.
I have tried adding more loop cuts and also merge vertex by distance I mean remove the doubles.
1st image is after and before applying the subdivision surface modifier and the 2nd image is after I tried adding more loop cuts and details into my mesh.

UPDATE:
I have tried and make changes as you instructed. I tried to clean my topology but my result is not clean. Where I am wrong now? Also uploaded the updated file.

The simple answer is that your topology is bad and you need to find better way to make your object

But if you actually don't care about your topology at all and still want easy solution to make this work then select all edges that need to be sharp and use Shift+E to make them purple, when they are purple, subdiv recognize them as those who need to stay sharp

You should redo your topology:

Simplify your shape, boolean the cylinder:

Rework the topology, symmetrize:

Bevel the edges:

Give it a Subdivision Surface modifier, shade smooth:

Edit: Here is a bevel from your current file. Also, before that, make sure the normals of your faces are correctly oriented, select all in Edit mode and press ShiftN:

I tried to make my topology better several time but don't know what to do and how I do that. Now I am going to try this. Thank you!

How to add vertices after bolean the cylinder? In 2nd image as you showing.

use tools like knife (K to activate) or join vertices (J), dissolve edges (Ctrl X), etc...

I have tried and make chages as you instructed. I tried to clean my topology but my result is not clean. Where I am wrong now? Also uploaded the updated file. Please review the question.

you need to bevel the edges as seen in my third picture, select the edges and press Ctrl B in order to create these bevels. Maybe look for tutorials on the basics of modeling, your shape is a bit hard if you are a total beginner

I did bevel before adding the modifier.

I've checked your current file and the edges weren't bevelled, please see my edit

Can you suggest some tutorial. I have watched many tutorial this month, Started from the donut and then an anvil. Then udemy and then a robot from Ryan King Art youtube channel. Now I am on your youtube channel. Also subcribed. Can you suggest something from there or anywhere else?

There are a lot, I think Grant Abbitt has some pretty good tutorials, look for his beginners tutorials: https://www.youtube.com/watch?v=98FkRIbihyQ ... If you speak french, join us on the Discord I link in the description of my videos

I could make a tutorial from your question by the way, as the shape is interesting

Very well, I will be very thankful for that. Let me know if you do so. I am trying design a robot and this one is the bottom part.

well if I make a tutorial it will be basically what I explained here  ;)  simplify your topology, use boolean (or knife project tool), rearrange the topology, bevel, etc

That is what I don't uderstood. I did simplify my topology as I can, you can see in the file. Where I was wrong? Let me know that.

Ok perhaps I'll do a tuto on this  ;)

Thank you so much!

Thankyou so much! I just saw the tutorial on your channel. Very very helpful.

oh ok I was wondering if I would do it in english as well, fine if you understood in french

I don't understand french, but subtitles works.

To give more answers to my comment, Your first way should be to remove extensive vertices to make your mesh clean so that it can work in a less destructive way without using booleans...
If you actually don't care about topology then just select all of your sharp edges like me and press Shift+E and drag it to full pink till it is sharp like this:

Solution depends on your needs because with this you will still end up with some bad topology and it will be bad if you want to change it even more:

I tried to make my topology better several time but don't know what to do and how I do that. I want to make topology better. Thank you!


text:
Blender API. Access face coordinates on image texture and UV map
What I have:
Model with texture atlases inside material slots
What I need to do:
Iterate over faces of my mesh (done)
Find what texture atlas (material slot index) face using (done)
Get pixel coordinates on image texture corresponding to UV of this face.
Like this in pseudocode:
for face in faces:
    for vert in face.verts:
        vert_texture_coordinates = UVMap.get_coordinates(vert)
        # And here I want to get something like (13, 37)
        # representing pixel on my image texture

For now I only have data from bmesh.loops and have no idea what to do with it:
for face in faces:
    for loop in face.loops:
        uv = loop[uv_layer].uv
        # Getting <Vector (0.1116, 0.9408)>


text:
Dynamic Displacement for tracks doesn't appear in the final render?

I use the dynamic paint - brush, for the wheel

and the dynamic paint - canvas for the plane with displacement

This is the preview render animation of the tracks
it looks fine,

and This is the final render in the same frame of the animation.
So why the final render just appears like a flat plane like that?
I need some help here, thanks

Did you bake the dynamic paint?

@JakeD No, I didn't,

You have Subsurf modifier with different settings for render and viewport:

So, then you hit render new plane generates and dynamic paint refreshes.
Set view subdivisions equal to render subdivisions.

Ooooh Yes! it works, so if i use the subsurface, is it always need to set the view subdivision same as the render divisions, right?
this help me a lot :))) thnks i need to learn more hehe :)

@MuhammadFakhriHusaini no, not always. Only if it affects modifiers  below in the stack

oh right, i see, thnks again :))


text:
Documentation for CollectionProperty (CRUD methods)
I cannot find any documentation for the existing CollectionProperty methods.
Regardings properties, generally i find .../bpy.props.html helpful, but it doesn't have any method declarations.
Usually with other properties this isn't necessary, as they just give me a value of a regular python type that I know - like StringProperty which yields a string.
With a CollectionProperty this is different: it gives me some sort of collection, I can iterate over it, but it is not a simple python structure.
There is the official doc of .../bpy.types.CollectionProperty.html, but it lacks documentation for the add and remove methods (it never mentions them).
Related Question:
Remove from CollectionProperty
Apparently there is also a move method:
CollectionProperty - change item's index
Are there anydocs out there?
P.S. digging through the blender source (of some cloned repo, because I like browsign github) I found this:
https://github.com/dfelinto/blender/blob/master/source/blender/python/intern/bpy_props.c#L3029
However I cannot find any hints in there with respect to the existing methods.

nah, pardon my french but the example is rather weak. It doesn't show how to remove things from the collection, or how to add already existing instance ...

Bloody French.  This one sums it up well too  Also using autocomplete in py console.  There is no argument that the docs are a little lacking.

thx, but that still doesn't show me, how to add an element to a collectionproperty that already exists - I can only call the add() method and Blender will create some new instance. Also: do you really have to iterate over the whole list to clear it? ... That's not exactly a nice api, if that is all ... isn't there at least a place in the source code that somehow shows me, what methods are really exposed on that type?

Consider. collection.clear() may not have been available at the time of writing that answer.  IMO a  question like "How to copy a collection item?", or something with CRUD in the title...  would be a far more productive route than bemoaning  "The docs aren't perfect"

The documentation is open source too. Submit a patch or ask something we can solve @IARI

I found the docs very useful in some respects and had wrongly assumed, that it was just a matter of looking in the right place.
Also my apologies, the question seems to get across too much negativity, which was not the intent, and i'll edit it to get rid of that.

You are right about the documentation. The Python Console is your friend here. It offers autocomplete "intellisense" when you hit CtrlSpace after a . or a (:

You get the methods documentation from the source if there is one. In CollectionProperty case there is none:

The traceback error gives another hint:

If this does not help you search google, this site, blenderartists or your favorite blender python blogs for the functions you are interested in for more info or code examples. Since you now know what is available and what you are after, this should give better results than searching just for documentation.
If that still fails, chances are that you are after something only couple of people in the world know. You can look into the source code where you find bpy_props.c and then you dig. If you don't get too far the best bet in this case is to contact developers on official channels (mail, IRC) and ask there.

Docs to me are the last resort for when I can't nut it out with the console.  Nice when there are good docs (example) tho.

I haden't used the Blender-builtin console, since I generally prefer to write code in a single place, but I will check that out. seems like a very good solution to the problem of the lack of proper docs.

with your post and some more google I have found this:
https://docs.blender.org/api/2.79/bpy.types.bpy_prop_collection.html


text:
Detect Viewport vs Rendering in Geometry Nodes
I'm trying to scatter some grass on a terrain. With the particle system, you could set different density values for viewport vs rendering. I was wondering if there is a way to do the same in geometry nodes? I looked at the various nodes, and couldn't seem to find one that detects the rendering environment.
This seemed like a pretty essential feature, so I figured there must be a way.
Here are the nodes:

Thanks

yes you can.
There is now a "is viewport" node.


text:
(Solved) Will 2.82 files work in 2.79?
I have a question, if I model an object and I do the materials, the textures, the animations all that is possible is unimaginable on the version 2.82 of Blender, and that I want to copy / paste on the version 2.79 of Blender because I need an addon to export which is not available on version 2.8, will i have issues/error or something? sorry for my english.

What add-on do you need?

it is an addon that allows me to export in .igs and .ia format for train simulator.

Please accept or post an answer if solved.

Project files (.blend) created with newer versions of  Blender generally can't be opened by older versions. Blender isn't designed to be forward compatible.

For .blend files, I know it's impossible to open them, but I'm talking about copying / pasting an object, I managed to do it, and the person who created the addon told me that I could totally do my work on 2.8 and then copied the object on 2.79 to use the addon, that's what I did and it works, the problem is solved

Great that it works in your use case. Copy and paste may work, but it's not guaranteed to function. For instance you will run into issues when your material contains the mapping node. There are many other aspects that could cause problems.


text:
Objects appear normal in material preview but in rendered mode with cycles they're encased in weird material blobs
[EDIT: I'm pretty sure this was just a weird glitch. I switched to 'bump' as the node, then back to displacement, and it went away. Really odd but anyway. Maybe this can help someone else]
I'm new to Blender but I've tried everything I can think of, looked for answers online, and found nothing. The objects I'm using as particles look fine in the internal material preview mode, and when I move to the cycles rendered mode the outline still selects and looks fine, but they object is surrounded and encased in a strange blob structure that is uneditable/unselectable. It doesn't appear to be part of the mesh?? It changes shape slightly when I modify the displacement of the noise texture I have applied to it, but won't go away unless I delete the displacement, so I'm pretty sure it's resulting from that node. Also, it's only happening to the two objects I duplicated from the original one, on the far left.

Please go easy on me, I'm brand new and this is only my third foray into the program.

The 'blob' happens when you set high Midlevel in the Displacement node.
Yours is set to 4,2 (default is 0,5)

The 'blob' cannot be selected, because it's just displaced polygons
It only happens in Cycles preview, because Eevee preview doesn't support displacement
Noise texture only suplies values 0-1, so high midlevel may look weird

Displacement Midlevel
  Neutral displacement value that causes no displacement. With the default 0.5, any lower values will cause the surfaces to be
  pushed inwards, and any higher values will push it outwards.
Blender Manual


text:
Why is my view layer rendering as nothing?
I'm trying to render out some view layers to put into the compositor. Most of them rendered perfectly fine, however the one called 'ocean' renders gray nothing, despite the presence of lights and the fact that all of the relevant objects are visible in the render (if I turn on visibility for 'ocean swell' and 'oceandetail' those objects do end up visible in the resulting render but they're not the ones I actually WANT in the render. For reference I followed this tutorial to model the ocean but I did alter some of the settings for my own purposes). Also, weirdly, while it's going about its business rendering nothing, it still stops in the middle citing that it's out of GPU memory about 75% of the time (I've reduced subdivisions, lowered tile and sample size, checked that persistent data is off, restarted the computer and program, etc. but the chance of it running out of memory is not consistent with or without any of those settings).
Here's how it looks in the viewport:

And here's what it looks like while rendering:

I have tried the most obvious troubleshooting methods to the best of my ability, including:

adjusting the view layer settings ('use for rendering' is checked and I have tried to render it with 'render single layer' both checked and unchecked; both produce the same result of Undesired Gray Rectangle)
ensuring that the visibility settings in the object tab are correct ('show in renders' is checked)
double-checking my node setup (see image below)

Unfortunately I can't share my full project file because it's part of a commission and the client has asked me not to share it, but [EDIT:I'm attaching the file with only the ocean object so you can see my settings.] I'm willing to answer any questions in as detailed a manner as possible, and share screenshots of any of my settings.
Here is the file.
EDIT: the render window now doesn't even do anything, it just shows up as if I've hit F11 to see the render result, but there's nothing there. If I try to do literally anything on this screen or even close out of it, blender crashes. Helpppp

You don't necessarily have to share the exact client file; just generating a simple reproducible setup file for sharing via https://blend-exchange would suffice. Without accompanying sample files or clear reproducible steps, addressing your issue becomes difficult if not impossible. Without such details, we will have to close your question for lack of details.

@HarryMcKenzie Okay, I added it. Let me know if it requires any other changes or things included.

When I opened up your project file and hit render my system started working overtime.  Then I noticed that you have set your resolution to render 4k at 200%.
I lowered this and the render worked fine for me:

Maybe your computer doesn't want to render at 8K.  Have you tried lowering the resolution and seeing if it works?

I can't believe I didn't catch that, thank you so much.

My pleasure, good luck with your project ;)


text:
UV mapping with strange distorted texture
The following image hopefully illustrates my problem better than a textual description:

A part of the mesh which is selected in the UV/Image Editor on the left is bent (the rim of a wooden wheel).
I would generally expect textured faces to contain the part of the albedo-texture that is also displayed in the corresponding faces of the UV/Image Editor.
Consequently, from the way the texture is displayed in the UV/Image Editor, I expect the texture to have the wood grain aligned with the curve.
On the top-right Rendered Preview however, you see that the grain is radially aligned towards some vertex at the bottom of the rim.
Here is a Link to the Model:

What am I missing or misunderstanding here?

As this is Cycles render check that the texture you preview in the UV editor is the one selected in the Node editor. If they mismatch the one from the Node editor will be in the render

Thx. I should have mentioned that: it is the same texture.

Maybe double check that the selected UVs are for the faces you want. Try selecting just the front 4 faces in the 3d view and see if the same UVs are visible.

I wasn't so sure as it has more pronounced cracks in surface and looks like unpolished wood while one in UV editor is fine wood. Check if this is the same material. Check that you have one UV map and if not if you edit the one you see in render. What else to say. You can upload the blend here https://blend-exchange.giantcowfilms.com/ if you want others to look into it

@Brenticus: Thanks, checked that: the selected UVs are for the faces I want.

@MrZak I made sure the albedo texture used is the same.

The blend file you just uploaded is missing all of the textures. Can you try packing them with the file and then uploading again?

I might be about to figure it out ... there seems to be an issue with the normal map.

Just found that out as well. See my answer below.

Your normal map is set to sphere mapping. Switch it to flat and you should be good to go. The albedo texture is fine, it's just that the normal map is so strong it makes it very hard to see.


text:
populate a dropdown (or prop_search) with a string list
I want the user to be able to select a string from a list of possible options.

The value stored in the extra properties data must be the selected string (not an integer id as with EnumProperty)
The list of options is generated dynamically (content depends on the file system).
[It contains file names from one or multiple directories, restricted to certain extensions, but displayed without extension, whereas duplicate filenames (i.e. different extensions) are only displayed once]

I tried to use prop_search, but it doesn't work - see this question.
What is the best way to achieve this?

What content exactly? Just some file names or something? If you would like to display some files of a folder, you can easily populate them by using an UI list: https://blender.stackexchange.com/a/30446/31447

It's supposed to be a list of File names from some directory (might become multiple directories), displayed without extensions, but only certain filters (like only consider certain extensions, and if there's the same file with multiple extensions only show that once)

I would suggest a Menu and Operator approach.  Similar to templates menu in text editor.

You're mistakingly asssuming that an EnumProperty can only hold integers. This works just fine:
import bpy

bpy.types.Object.my_prop = bpy.props.EnumProperty(
    items=[
        ('IDENTIFIER', 'The UI string', 'Tooltip'),
        ('JEMOEDER', 'Je moeder', 'Op je hoofd'),
    ])

For more info, see the bpy.props.EnumProperty API documentation.

Does not work for me - the json data stored in the extra property will not use the ID, but an integer is stored instead :(


text:
How do NodeSockets determine if a link between them is possible?
I have two NodeSockets class SockA(NodeSocket) and class SockA(NodeSocket).
Now when I define a Node class in a custom NodeTree with both A and B inputs and outputs, I can create links between A and B sockets.

Example code:
https://gist.github.com/IARI/fd9957b18689c2e1937233e4fcc284e0
I had instead expected, that it would only be possible, to connect sockets of the same type (or different socket types that define their compatibility somehow).
How can a restriction like this on the linkability of sockets be achieved?
Note:
I have looked through the source of animation_nodes for some time.
it seems to define this restriction with variables on the sockets like this:
dataType = "Color"
allowedInputTypes = ["Color"]

AN source: https://github.com/JacquesLucke/animation_nodes/blob/master/animation_nodes/sockets/color.py#L9
However, by checking the source for these variable names, I could not find any place where this would be enforced by the AN code, so I am left puzzled.

Here's a rough proof-of-concept: https://gist.github.com/Theverat/f6c30469e22e03202dd429fe19b24c83
See my revision for the changes I did: https://gist.github.com/Theverat/f6c30469e22e03202dd429fe19b24c83/revisions
Basically, the node tree offers an update method which does not tell you what exactly happened, only that something happened.
But each node offers an insert_link method, which tells you about a link before it is inserted. So in this method you can not delete the link, or prevent it being inserted, you can only log it in your nodetree as new (or flag it for deletion).
So when the user creates a new link, this is what happens behind the scenes:

insert_link is called on the node the connection is coming from
insert_link is called on the node the connection is going into (Note: the link is the same, so you should prevent a duplicate insertion into the list of new links in the node tree)
update is called on the parent node tree of these nodes

Thank you - I'm going to accept the answer, when I've tryed it out.
Interestingly though, animationNode does not use the insert_link method at all - I still wonder how they achieve it.

You should ask the AN developers about it. Are you sure they actually delete links based on the socket types? In my LuxCore addon I have a similar system, but it just warns the user in the UI if socket types are incompatible, it does not prevent linking them.

Yes, I just double checked it: AN does prevent it. Also there is a problem with your approach: When you drag a node on top of a link, Blender will try to "put the node in between" - apparently this does not call the insert_link method. AN also prevents this

un-accepted, because technically you can still create A-B links with the described technique, so the problem isn't solved

I looked a bit more through the AN code, the way Jacques Lucke does it is by keeping a lot of control over the updates in AN, using all sorts of callbacks blender offers, and then performs validity checks on the whole graph.
One of the triggered checks originates from the NodeTree.update method.
I will again accept this answer, if you just somehow mention, that checking everything in update might be a better solution.

Thanks for investigating, I'm interested in this topic myself.
I don't care if you accept the answer or not.
You can edit my answer yourself by the way, if you want to add information.


text:
prop_search with a custom PropertyGroup
I want the user to be able to select some data from a CollectionProperty
audioFiles = CollectionProperty(type=AudioFileNameGroup)

holding data of a custom PropertyGroup type:
class AudioFileNameGroup(types.PropertyGroup):
    fileName = StringProperty(name="File Name", subtype='FILE_NAME')

To enable the selection for the user, in a panel I'm using prop_search on that:
navStateCol.prop_search(obj, "audioAction", context.scene.frameworkReferences, 'audioFiles', translate=False,
                        icon='PLAY_AUDIO')

but I can't get it to work:
If the obj.audioAction property is a StringProperty
audioAction = StringProperty(name="Audio Effect", subtype='FILE_NAME')

i don't get anything to select from:

This makes sense, as the system has no way of knowing, that it should refer to the fileName StringProperty inside the AudioFileNameGroup.
If the obj.audioAction property is
audioAction = PointerProperty(type=AudioFileNameGroup, name="AudioAction")

it is not editable, and the ui is disabled:

How can I use prop_search on the audioFiles collectionproperty?

As a side note since you are looking at audio files, bpy.path.extensions_audio is a set of audio file extensions supported by the user's blender.

Set the name on the collection
Set the name of the collection item, as this is what appears in the prop search. Simple test script, the collection is populated from a simple list.
import bpy

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

    def draw(self, context):
        layout = self.layout

        obj = context.object
        layout.prop_search(obj, "audioAction", context.scene, "audioFiles", icon='SPEAKER')

class AudioFileNameGroup(bpy.types.PropertyGroup):
    name = bpy.props.StringProperty(name="File Name", subtype='FILE_NAME')

def register():
    bpy.utils.register_class(AudioFileNameGroup)
    audioAction = bpy.props.StringProperty(name="Audio Effect", subtype='FILE_NAME')
    bpy.types.Object.audioAction = audioAction
    bpy.types.Scene.audioFiles = bpy.props.CollectionProperty(type=AudioFileNameGroup)
    bpy.utils.register_class(HelloWorldPanel)

def unregister():
    # fill this in
    pass

if __name__ == "__main__":
    register()
    items = (
        ('FOO', 'Foo', ''),
        ('BAR', 'Bar', '')
    )
    scene = bpy.context.scene
    for identifier, name, description in items:
        scene.audioFiles.add().name = name

One more example with data-set of strips:
import bpy

class StripListPanel(bpy.types.Panel):
    bl_label = "Strip List Panel"
    bl_idname = "UI_PT_StripListPanel"
    bl_space_type = 'SEQUENCE_EDITOR'
    bl_region_type = 'UI'
    bl_category = 'Strip Selector'

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

    def draw(self, context):
        layout = self.layout

        scene = context.scene
        ed = scene.sequence_editor

        layout.prop_search(scene, "selectedStrip", ed, "sequences", text="Selected Strip", icon='SEQ_STRIP_DUPLICATE')

def register():
    bpy.utils.register_class(StripListPanel)
    bpy.types.Scene.selectedStrip = bpy.props.StringProperty(name="Selected Strip")

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

    del bpy.types.Scene.selectedStrip

if __name__ == "__main__":
    register()