text:
Principled BSDF via Python API
The title is general: how can we use the API to edit Principled BSDF properties?
More specifically, I have a mesh that has vertex colors in it. The colors are fine, and I can use the mouse to have vertex colors as base color using the Shader Editor. Likewise, I can use the Material Properties and select "Vertex Colors | Color" for the base color of the material assigned to the mesh. This is all fine and both are equivalent ways.
However, how to accomplish that programmatically, via the API? I could do that in 2.7x but don't seem to be able to do the same in 2.81. Any idea?
EDIT: here a minimal example that works with 2.7x:
import bpy
mat = "MyMaterial"
bpy.ops.material.new()
setattr(bpy.data.materials["Material"],"name",mat)
setattr(bpy.data.materials[mat],"use_vertex_color_paint",True)

Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
AttributeError: 'Material' object has no attribute 'use_vertex_color_paint'
```

The concept remains pretty much the same in 2.8x. Perhaps you can add your current script for 2.79 to your question and explain what particular part you have trouble implementing in 2.81.

Thanks for the suggestion. I've just added above. The "use_vertex_color_paint" has been removed from the current API, according to the release notes.

This post on Stack overflow https://stackoverflow.com/a/36194568/808940 just use "ShaderNodeVertexColor" instead.

Thanks. It seems this would also work. The one below is straight to the point and very general, so I'm taking it as 'the' answer.

Add and link the vertex colour node.
Adds a new material using mat = bpy.data.materials.new()
Recommend: almost never use bpy.ops.materials.new() The material bpy.data.materials[mat] in script in question is confusing and varies dependant on pre existing materials "Material" and "MyMaterial".
Notice I used the index of the io when making links. Could use vcol.outputs["Color"] for vcol.outputs[0], however if the user is using a different language, then "Color" will be in that language.
The principled bsdf base color is input 0. A simple test in python console to save counting by eye.
>>> for i, o in enumerate(bsdf.inputs):
...     i, o.name
...
(0, 'Base Color')
(1, 'Subsurface')
(2, 'Subsurface Radius')
(3, 'Subsurface Color')
(4, 'Metallic')
(5, 'Specular')
(6, 'Specular Tint')
(7, 'Roughness')
(8, 'Anisotropic')
(9, 'Anisotropic Rotation')
(10, 'Sheen')
(11, 'Sheen Tint')
(12, 'Clearcoat')
(13, 'Clearcoat Roughness')
(14, 'IOR')
(15, 'Transmission')
(16, 'Transmission Roughness')
(17, 'Emission')
(18, 'Alpha')
(19, 'Normal')
(20, 'Clearcoat Normal')
(21, 'Tangent')

Script to add material, add vertex colour node, link it to base color of bsdf.
import bpy

newmat = bpy.data.materials.new("VertCol")
newmat.use_nodes = True
node_tree = newmat.node_tree
nodes = node_tree.nodes

bsdf = nodes.get("Principled BSDF")
'''
# alternatively

output, bsdf = nodes
'''

assert(bsdf) # make sure it exists to continue

vcol = nodes.new(type="ShaderNodeVertexColor")
vcol.layer_name = "VColor" # the vertex color layer name

# make links

node_tree.links.new(vcol.outputs[0], bsdf.inputs[0])

This worked perfectly. Also, looping and providing all indices comes in handy, many thanks. I've upvoted but because my rep is still <15 it seems it won't appear public yet. Thanks!

Now checked! Thanks!

For people coming after Blender 4.0 update, here's the updated version -
(0, 'Base Color')
(1, 'Metallic')
(2, 'Roughness')
(3, 'IOR')
(4, 'Alpha')
(5, 'Normal')
(6, 'Weight')
(7, 'Subsurface Weight')
(8, 'Subsurface Radius')
(9, 'Subsurface Scale')
(10, 'Subsurface IOR')
(11, 'Subsurface Anisotropy')
(12, 'Specular IOR Level')
(13, 'Specular Tint')
(14, 'Anisotropic')
(15, 'Anisotropic Rotation')
(16, 'Tangent')
(17, 'Transmission Weight')
(18, 'Coat Weight')
(19, 'Coat Roughness')
(20, 'Coat IOR')
(21, 'Coat Tint')
(22, 'Coat Normal')
(23, 'Sheen Weight')
(24, 'Sheen Roughness')
(25, 'Sheen Tint')
(26, 'Emission Color')
(27, 'Emission Strength')

You're welcome!


text:
Edit mode bug, everything does not move in one piece
https://www.youtube.com/watch?v=749BKifmRC4&feature=youtu.be
The problem is that when I move my mesh in edit mode, half of it on axis X moves as if it was mirrored, though the mirror modifier is not applied. One plane of the vertecies remains still on the same axis of origin of the model.

Hi. Please describe the problem fully in the question body itself. If that link goes down at some point this question will become very unclear. This site isn't just for the people asking the questions, but for the people in future who have the same issue as you and will search this site. If the question is unclear they wont know they're having the same problem as you and whether any answers you get could be of use to them.

Please provide some context and explanation, don't just post a video

You've hidden the Tool Settings Header which contains the mirror editing options while you're in editing mode.
Right-click on the top header and go to Header > Show Tool Settings. Then you can disable the mirror editing shown below.

Wow, didn't know about this feature. Quite useful :). It's also in Sidebar > Tool > Options.

source: Stack Exchange

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

sort: votes


text:
I can't get nodes to work, wondering if it's a glitch or I'm doing something wrong
I can get nodes in Blender to display the image/movie clip I'm trying to display in the backdrop and it plays when I press the play button, but there's no sound and it doesn't display in the preview. I tried putting multiple types of viewers at the end of the sequence of nodes and even tried putting only one movie clip into the node editor, and attaching it to the view node. Still didn't make a difference. Does anybody know if this is just a glitch or is there something I'm doing wrong? (My blender version is 2.8.1, if that helps) After about a day of trying to work it out, I am still having the same issue, and even after re-adding in the "Render Layers" and "Composite" nodes, the render doesn't show the composite, it only shows the video-editing preview. (Edit: I solved it, I just forgot to attach the final image to composite as opposed to having render layers attached to composite.)

Hello :). I'm glad you solved it by yourself. Please post your solution as an answer, for others with the same problem. Thank you and have a great day.

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


text:
Why isn't my animation moving when played?
I keyframed the propeller so that, every 5 frames, it spins around the local x 360º. However, when I play the animation, nothing moves at all. I'm starting at frame 0, so I'm not sure why it isn't working.
Before I parented the propeller to the fuselage, the propeller would spin, but on the global axis instead of the local axis. I read that the problem could be solved by simply parenting the prop to the fuselage, so that's exactly what I did.

EDIT: I figured out that it wasn't moving since it just thinks it has to get to the point at which it has revolved completely, so it just doesn't move. This creates another question: how do I make it so that the object does exactly what it's supposed to between keyframes, instead of just aiming for the end result?

Insert more key frames.
For example:
at frame 0 :   0 degrees rotation
at frame 2 : 144 degrees rotation
at frame 4 : 288 degrees rotation
at frame 5 :   0 degrees (360 degrees) rotation
Be aware also that 5 frames is just 1/5th (0.2) of a second at normal animation rates, so your prop is going fully rotate 5 times a second.


text:
Why isn't my sea texture appearing transparent/translucent?
I have the alpha on my sea texture set to 0.375, blend mode to Alpha Blend, and backface culling and show backface are both checked. I need the sea to be transparent to the point where you can kind of see through it, but dark enough to the point where it looks like, well, the sea. Kind of like most common low-poly sea models out there.
Also, the points where you see the sea floor through the sea are the point where the sea floor plane ends. I don't know if that helps or not, but there ya go

EDIT: turns out I was in eevee. it worked as soon as I just changed the render engine to cycles

if I was able to solve your issue, please dont forget to mark as solved. If not, please post additonal information/questions.

It's likely just the blend mode that needs to be changed on the material tab.
On Opaque, it's telling the renderer that this is a solid object, but when changing the visual properties to something like Additive, you should be able to get the expected results.


text:
Rigify Only made the Face rig
So I aligned a rigify meta-rig with my character's entire body (including his face) but when I generate a rig it only creates a facial rig and none of the rest of the body, I have no clue why, thanks.

On closer inspection the face rig doesn't appear as it should, it has made a bunch of empty circles around every vertex in the bones but none of the standard controllers that I notice in tutorials

Are you able to update the post with screenshots of the results your getting?

Okay, I hope that helps to clarify my problem.


text:
Blender Bones don't effect mesh
It's my first time rigging something and it just won't work. I made the mesh, joined all objects together and cleaned the mesh up. I made a standard human rig and parented it via automatic weights to my object. If I go to the pose mode tab and rotate the bones, nothing happens. I also put a link to the Blendfile here, if you want to look into it. Thanks for your help and suggestions.
Blendfile: https://workupload.com/file/krJRfGdJ

Hi. Please expand on "it just won't work". What won't work? Where in the process does it go wrong vs what you were expecting?

Please provide some context and explanation, don't just post a link to a file


text:
Disabling UI while in a modal (Python API)
I think I have seen this in another add-on but I have been unable to actually find it again when trying to reproduce the effect. Basically, when I enter my own custom modal operation I want to darken everything but what is contained within the viewport. My hypothesis is maybe they grab the ui and make .active to False across the board?
I don't think I want 'BLOCKING', or 'GRAB_CURSOR' (no mouse wrapping). I just want the buttons to be un-pressable.
This screenshot shows what I mean (just imagine you entered a modal operator lol).

Any help is appreciated.


text:
Editing an origins rotation based on a given quaternian using matrix math
I was wondering if there was any way to change the orientation/rotation of an objects origin without changing the actual mesh?
I've got this bit of code, which gets the rotation value I want the object to inherit... but I have no clue how I would actually go about applying it to the object.
    import bpy, bmesh

    ob = bpy.context.object

    bm = bmesh.from_edit_mesh(ob.data) # Only works in Edit Mode
    bm.faces.ensure_lookup_table()
    bm.edges.ensure_lookup_table()

    active_geo = bm.select_history.active
    if active_geo is not None:
        _loc, rot, _scl = ob.matrix_world.decompose()
        rot_matrix = rot.to_matrix().to_4x4()

        direction_vec = rot_matrix @ (active_geo.verts[0].co - active_geo.verts[1].co)

        normal_quat = direction_vec.to_track_quat('Z', 'Y')
        normal_euler = normal_quat.to_euler('XYZ')

        bpy.ops.object.mode_set(mode='OBJECT')
        bpy.ops.object.empty_add(type='ARROWS', align='WORLD', rotation=normal_euler, scale=(1, 1, 1))

The empty that gets added is representative of the orientation I want the cubes origin to have while keeping the mesh the same.

Below is an example of how I can brute force the same effect I am looking for by enabling Affect Only Origins, and using Align Rotation to Target with snapping.
https://i.sstatic.net/6MCsx.jpg
Any help is appreciated, thank you.

You do know about object rotation, right?

Yes, I do. My question is about changing the objects rotation without actually rotating the mesh.

bpy.data.objects[“CubeThing”].rotation_euler

without rotating the actual mesh, I want to change the pivots orient so the local space can be set up properly.
https://blender.stackexchange.com/questions/230321/rotate-origin-only-to-match-other-object-rotation
I found this example, but the use case is different and I had trouble applying it in this specific context.

The object rotation does not rotate the actual mesh within the object space. If you want to change where the origin is, you either have to translate the mesh within the object space, or you have to parent the object to an empty and use that as an “origin” instead.

Apologies, I updated my last comment to include an example.

Does this work? (1) Apply the current transform, if any (2) Set the object's transform to the inverse of the one you want (3) Apply the current transform (4) Set the object's transform to the one you want

It seems what you need is as simple as:

Save current vertex positions in the world space (multiply local coords by ob.matrix_world).
Do whatever you want to do, it seems you figured it out because you can align the empty the way you want, but also apply that to the object.
Since changing the object's transformation matrix will move vertices in the world space, restore their positions to the same world space as in p. 1. - so set local coords to saved copy of world space, multiplied by ob.matrix_world.inversed().

import bpy, bmesh
from bpy import context as C

ob = C.object
me = ob.data
bm = bmesh.from_edit_mesh(me)
mat = ob.matrix_world

# an error is better than the script failing silently
co0, co1 = map(lambda x:x.co, bm.select_history.active.verts[:2])
direction = co1 - co0

_loc, rot, _scl = mat.decompose()
rot_matrix = rot.to_matrix().to_4x4()
direction_vec = rot_matrix @ direction
normal_quat = direction_vec.to_track_quat('Z', 'Y')
normal_euler = normal_quat.to_euler('XYZ')

bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.empty_add(type='ARROWS', align='WORLD', rotation=normal_euler, scale=(1, 1, 1))

# save in world space
coords = [mat @ v.co for v in me.vertices]

# maybe you want to position your empty
C.object.location = mat @ (co0 + co1) / 2

# easiest way to apply new rotation
ob.rotation_euler = normal_euler
C.view_layer.update()

# restore to old world space
mat_inv = ob.matrix_world.inverted()
for v, prev_co in zip(me.vertices, coords):
    v.co = mat_inv @ prev_co

I don't understand everything you're trying to do, so maybe the code could be improved - for example, you multiply direction by only rotation matrix - but what if the scales aren't uniform? Why not simply multiply it by mat?
V2
Less readable but faster code:
import bpy, bmesh
from bpy import context as C
from mathutils import Matrix

ob = C.object
me = ob.data
bm = bmesh.from_edit_mesh(me)
mat = ob.matrix_world

# an error is better than the script failing silently
co0, co1 = map(lambda x:mat @ x.co, bm.select_history.active.verts[:2])
normal_quat = (co1 - co0).to_track_quat('Z', 'Y')
normal_euler = normal_quat.to_euler('XYZ')

bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.empty_add(type='ARROWS', align='WORLD', rotation=normal_euler, scale=(1, 1, 1))

# maybe you want to position your empty
C.object.location = (co0 + co1) / 2

# make local space = world space
me.transform(mat)

# a faster way to calculate new matrix - without refreshing the View Layer
t, _, s = mat.decompose()
T = Matrix.Translation(t)
R = normal_euler.to_matrix().to_4x4()
S = Matrix.Diagonal(s.to_4d())
ob.matrix_world = T @ R @ S

# now apply the inverted matrix on the mesh
me.transform(ob.matrix_world.inverted())

V3
The below solution never exits Edit Mode and applies only a single transform:
import bpy, bmesh
from bpy import context as C, data as D
from mathutils import Matrix

ob = C.object
me = ob.data
bm = bmesh.from_edit_mesh(me)
mat = ob.matrix_world

co0, co1 = map(lambda x:mat @ x.co, bm.select_history.active.verts[:2])
normal_quat = (co1 - co0).to_track_quat('Z', 'Y')
normal_euler = normal_quat.to_euler('XYZ')

t, r, s = mat.decompose()
quat_diff = normal_quat.rotation_difference(r)
mat_diff = quat_diff.to_matrix().to_4x4()
T = Matrix.Translation(t)
R = normal_euler.to_matrix().to_4x4()
S = Matrix.Diagonal(s.to_4d())
ob.matrix_world = T @ R @ S

# add empty without going to Object mode
# https://blender.stackexchange.com/a/51291/60486
empty = D.objects.new("empty", None)
C.scene.collection.objects.link(empty)
empty.empty_display_size = 2
empty.empty_display_type = 'ARROWS'
empty.empty_display_size = 1
empty.rotation_euler = normal_euler
empty.location = (co0 + co1) / 2

def slow():
    """possibly slower, but stays in edit mode"""
    bm.transform(mat_diff)  # transform only once
    for f in bm.faces:
        f.normal_update()
    bmesh.update_edit_mesh(me)

def fast():
    """possibly faster, but switches modes"""
    global bm  # to write to it
    bm.transform(mat_diff)  # transform only once
    bmesh.update_edit_mesh(me)
    bpy.ops.object.mode_set(mode='OBJECT')
    bpy.ops.object.mode_set(mode='EDIT')
    bm = bmesh.from_edit_mesh(me)

def best():
    """Probably the best of both worlds"""
    bm.transform(mat_diff)  # transform only once
    bmesh.ops.recalc_face_normals(bm, faces=bm.faces)
    bmesh.update_edit_mesh(me)

# if it really is slow or fast probably depends on the amount
# of geometry and for small geos doesn't matter
best()

Yeah apologies, I don't really know much about matrix math so my code example is more or less what I scrounged up from the internet. The new empty was created for visualization of the rotation I want the object to inherit, but it may have been confusing.
This solution works for my needs so it's probably worthy of confirming as the solution, but it also seems particularly slow? Is there a more efficient solution than saving the global vertex positions? Based on this I assumed there may be a method that just involves inversion of the applied transform? Thanks again.

@razed you have to modify vertex data if you want the vertices to stay in words space while moving their container. There are faster ways to modify the vertices, like the one I just added, there's also a possibility to use numpy.

What does container mean in this context? Is it the origin? Also, this code seems to get the wrong location for the empty, and the wrong rotation if you don't decompose the matrix before getting direction_vec. Image example here (this example is on an object with un-applied location & rotation)

@razed see updated code.

I've marked it as the answer as its everything I need... But I was wondering why the switch to object mode is required? (besides for creating the empty). I tried using it without the mode switch and the me.transform() stuff seems to not work.

@razed me.transform() modifies the mesh data, however bmesh creates a temporary copy of that data and operates on that. Once you go back to object mode, the bmesh copy is saved back to the mesh data. Think of that as a = Vector((0, 1, 2)); b = a.copy(); a *= 2; a = b - whatever you replace the third statement (a *= 2) with, doesn't matter, because a will be overridden with the temporary copy.

So would you say its possible to do this operation without the context switch? I tried using bmesh.update_edit_mesh(me) in various locations without the context switch code and it didn't seem to work. Maybe the wrong function to use or something.

@razed you certainly can do that without going to Edit Mode, though if you want to select an edge in edit mode, then you can't use the transform method. Since bmesh also doesn't have foreach_set, I don't think you can make a fast transformation there (well, there are ways, but nothing trivia,l I think). And apparently, since you complained on the speed, there's too much geometry to just use a Python's list comprehension.

Sorry I mean while IN edit mode, this hypothetical operator is based on being in edit mode when it is used.

@razed you can use bmesh.transform(), but then you will have to recalculate normals...


text:
Boolean on Objects with smooth surfaces?
Everytime I try to subdivide or use a boolean on an object with a smooth surface I get ugly artifacts as seen here. Is there a way to punch a hole through a smooth object while keeping sharp edges?

Without Edge Split modifier (left) and after applying Edge Split modifier (right).

If not sticking to semi-automated solutions like using AutoSmooth or EdgeSplit modifiers no matter what geometry is underneath, no, there isn't. Fix the Ngons and long tiny tris/quads appeared after Boolean and you'll get more decent shading at the edges

Add edge split modifier

Select the model Go to edit mode and press w and Remove doubles
Select the cylinder and add one subdivide
Now with the boolean modifier selecting the difference select the object.

what is a subsurface and no just adding edge split modifier does nothing at all: https://www.youtube.com/watch?v=b_1Uif7kvQU

sorry i mean boolean modifier and can u send the file to seen whats going wrong

Check the answer i have edited it

Sorry but you can still see the bad artifacts at the end of your gif. And why subdivide? It's supposed to be lowpoly.

There is no need to use the blend file. Look the 3rd picture in my question I have edited. I cannot get it done in a brand new project

I had to get on with the project so this is how I fixed it: http://www.bilder-upload.eu/show.php?file=6c144a-1507746076.jpg It's a waste of polygons, in this case it doesn't really matter but I'm still hoping for an answer. Thanks for the help though.

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


text:
What is the difference between a Billboard and a Plane?
I seem to have missed out on something. What is a billboard?

are you talking about the BI material settings?

That's the thing, I have no idea what I'm talking about while everyone around me is talking about billboards.

from that picture it does look like you are talking about material setting. Is that right?

Probably Yes. The people in that forum were discussing how crappy Billboard Grass looks like.

In CGI, billboards are images/textures mapped onto a flat plane to approximate 3d object. They are usually used for particles or distant objects in games. They are also typically setup to always face the camera, so the flat side is never visible.
So basically a billboard is a plane used in a specific way, but not all planes are billboards.

In general terms a billboard is simply a plane with an image on it, usually setup to always face the camera.
In blender a billboard is a type of particle, which is a plane that by default faces the camera. Note that billboard particles are not supported in cycles.
Besides foliage, a large crowd could also be created using billboards.
The main thing that makes billboards look bad is the lighting, as they are flat planes you get flat lighting over the entire image, which just emphasises the lack of detail. Recently there was a tutorial that shows a process of creating the tree images with a matching normal map that makes them look much more realistic.

the billboard is a plane that rotates on the z axis (automatically) always offering the face to the observer (the camera) and never the edge excellent as support for png images.

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


text:
Blender using wrong GPU for 3D View (This is not about Rendering)
I'm using two graphic cards in my system. I have recently replaced an old AMD gpu with a GT 710. Now blender is using the GT 710 instead of the much more powerful GTX 760. Blender now is painfullly slow and already stutters at 100k verts.

Anybody knows how I can choose what GPU Blender should run on?
Blender GPU settings as requested:

EDIT
All my programs start in Monitor 1. Blender starts in Monitor 4. Don't know why, but they are all connected to the GTC 760

You should be able to use them both.  https://blender.stackexchange.com/questions/31764/is-it-possible-to-use-different-cuda-capable-graphic-cards-to-render-simultaneou

Possibly similar to : https://blender.stackexchange.com/questions/76740/how-to-set-which-graphics-card-is-used-by-opengl-render-active-viewport

Viewport uses your system's primary GPU, the same your OS uses. The setting is probably inside Bios.

Blender & Substance Painter are the only programs that use the GT 710. All other programs (Photoshop, Unity, Games) use the GTX 760

Monitors are connected to both gpu's

What you want to do is control which GPU the OpenGL context is created on. Luckily the latest Nvidia Driver has a way to do that.
Open the Nvidia Control Panel, and navigate to this setting:

Since this: https://superuser.com/questions/1294720/windows-10-set-default-gpu is pretty much a duplicate of the current Question, feel free to post the same answer over there and collect the 2nd bounty.

If you have your primary monitor attached to the GT 710 then Blender (and any program creating an OpenGL context) will be using that instead. Make sure that the GTX 760 is set to drive your primary monitor.
If you have only one monitor attached to your machine, make sure it is attached to the GTX 760.
If you have multiple monitors attached to your machine, make sure at least one is attached to the GTX 760, and make sure that this display is set to be your primary display.
To change the primary display right-click on the desktop and select Display Settings

Note though that when you set the GTX 760 as your primary display adapter and you use it as your Cycles compute device you will run into stuttering display for entire Windows while rendering.

I have done all that. I have edited my answer. See: https://superuser.com/questions/1294720/windows-10-set-default-gpu Sorry to be stretching this out to two questions and making such a mess. Didn't expect this to get so complicated

Try to switch place on the two GPU, the problem is most likely that the GT 710 do have a lower address value and blender find it before the 760. If that isn't enough it might help reinstalling them and in the worst case you can try to uninstall the 710 and hope that blender prefer a GPU with Nvidia/AMD drivers.
If you are really unlucky it can be that the serial number or address name is screwing with it and can't be solved without editing the code.
I'm more or less 100% on that it is a problem caused by the address name because the GT 710 is GPU 0 in task manager and is more likely to be used than GPU 1.
I have actually never had this problem but the solution is to make the better GPU the one with a lower number.
(You might be stuck with how it is depending on what motherboard you have and how windows react on changes, it is possible that windows will keep calling the 710, GPU 0 because it is registered as it once)

I have a PCIEx16 slot and a PCIEx4 slot. The 710 uses one lane, the GTX760 uses 8 lanes. It would be daft to switch them. Also, it is only 2 programs that access the 710 instead of the GTX760. All other programs, including games, run on the GTX760

I would try this http://www.nvidia.com/object/performance_group.html
I've never used it but it looks like it might be what you're looking for.

While there are many different factors that can be contributing to this problem, I highly recommend changing your default graphics card in the Nvidia control panel. If you right click on the desktop, you can access it there. Go to "Manage 3D Settings" on the left side, choose the "Program Settings" tab in that window, and select Blender (or other programs you're having issues with, too" and change the settings in the drop-down box below it to "High Performance Nvidia Processor."


text:
Reset Normals after Data Transfer?
I set all the normals on the leaves of the tree to point upward using Data Transfer. Unfortunately I forgot to deselect the trunk when I applied the Data Tranfer. There has to be some way to reset the normals on the trunk:
Edit: File upload. Not the original file because I can't give away hundreds of trees for free..

Recalculate Normals doesn't do the trick.

Could you please attach your .blend by uploading it with https://blend-exchange.giantcowfilms.com/?

Done.............

Seperate the trunk from the leaves as a new object. On the trunk clear Custom Split Normals Data under Mesh/geometry data. Join the meshes.

Custom normals are per-split-vertex normals and not face or vertex normals. Tools that deal with those will not work on per-split-vertex normals. Information about these normals are stored on a seperate data layer that usually doesn't exist on a mesh.
In Maya there is a possibility to "lock" normals. That is not possible to do in blender (yet?) but the current system seems to be solid and predictable in its behaviour.


text:
ParticleSystem reduce Object Count
I'm using Hair Particles to spawn grass on hills. Unfortunately I cannot convert more than 10 000 grass particles to mesh because every single particle gets converted into a separate object. Any  more than 10-20k and blender will crash or take extremely long. Is there way to Convert all the Particles into a single Object or just somehow reduce the Object count? The Poly count is not high at all.

Does joining them together afterwards with Ctrl J do what you want? From my experience, Blender struggles with selecting large numbers of objects, but a single object with the exact same detail is fine. Otherwise grouping the converted objects and then linking them to a new file  as a group will treat them all as one object.

Yes joining them together with Ctrl J is what I do. However I can only do 10 000 objects at once and that already takes 30 seconds. I have scenes with 200 000 Grass Planes. So for half an hour I do nothing but Convert to Mesh and Join over and over until the desired density is reached.

How long does grouping take? Try Ctrl G. If that works, just save the file and link the group into a new file and go from there. What's your end goal here? Why won't leaving them as particles work?

I need to export them as fbx. Joining is not the problem. Converting them to Mesh is what takes very long.

OK. I don't have blender in front of me right now, but on a hunch, try enabling Only Render in the properties panel. This way blender won't draw all the origins and selection outlines so it should be way faster.

You mean Properties>Particles>Display>None? Not sure what you mean

In the properties panel (open with the N key in the 3d view) there is a section titled display, and an option for "Only Render". This will make it so blender won't show anything that will not be rendered. Since you have so many objects, blender has to draw all the object origins and outlines when the objects are selected, and turning this off may speed things up enough to select all the objects (or at least a lot more).

The 3D view is somewhat less laggy, but it still takes equally long to convert

@AzulShiva As I described in my answer, using Particle Instance Modifier will make whole lot of difference in term of viewport performance - try it.

The solution is to use Particle Instance Modifier to instantiate the grass object, instead of Dupli Object option found in the particle system settings.
https://docs.blender.org/manual/en/latest/modeling/modifiers/simulate/particle_instance.html

Benefits of using the modifier to instantiate an object:

much better viewport performance (especially in 2.79)
no need of pre-rotating the models to use random Z rotation (useful for vegetation)
fast conversion to a single mesh by AltC -> Mesh

How to:

Select your (single) grass model and hit AltG to move it to 0,0,0
Add Particle Instance Modifier to this grass model
In the modifier's options, pick the ground object and it's particle system
The grass should now be instantiated similarly like using Dupli Object (if not, check if your particles are alive, or just tick all of these checkboxes under Show Particles When)
To convert the instantiated grass to single mesh, make sure you have the grass selected and press AltC -> Mesh

There are also some disadvantages though, like using vertex groups for particle size (length) doesn't seem to work (maybe there are some more, but nothing important for me - you will have to find out).

This is actually easy. Thank you for stating your question clearly.
1) Select your ground. Duplicate it. (The later is to have a copy of your originalin case something fails) Enter EDIT mode. Switch to vertex mode.
2) Select vertex in your ground similar to:

You will want to make different Vertex Groups, because...
3) On your particle system go to DENSITY. And choose (first) Vertex group A:
Then your particles will be "FILTERED" only to the selected vertices of VERTEX GROUP A.

Once the vertex group A area only contains your particles, you can convert them to objects without Blender Crashing on you (because now there are fewer particles on viewport).
Remember the dubbed ground mesh? Select it again, duplicate it again (and since it still contains group vertex B,C,D) you will repeat step 3, selecting Vertex group B. Filter your particles, convert them to objects.
Repeat the same for all other vertex groups until you have all your particles converted to objects.
ALSO: Please: When you convert your particles to objects, send them to a different layer so they will not all be existing into 1 single layer at a single time. You´ll slow down the viewport performance. While using this method (convert, switch to other layers) will allow you to only show the portion where you need to work.
Thank you if you vote me for answer.
Happy Blending.


text:
Is there a way to put this bent leg straigt?
So I have this little fox leg as a mesh, and I want it to put it straight.

I tried using bone or curve modifier, but the result was not very satisfying.
The bones simply split a big curve into two smaller curves, which is not nice enough for me.

I see that there are many ways to bent a straight object real nice, but it seems difficult for me to find a good way to put a bent mesh straight. Any advices?
P.S: Here is the .blend file, should you be interested.

Try using proportional editing! (Blender docs)
This requires doing some work by hand, but it might be worth a go when your needs are very specific and you're confident you could eyeball it.

Always back up your work before making big changes, of course!

In this case, start with a head-on camera angle, because it's an easy way to make sure things don't move along the wrong axis. I chose Front Orthographic.

Go to edit mode, and enable proportional editing, which is this bullseye looking icon near the top middle:

Select a portion of your mesh (just pick randomly at first to play around!) and move, rotate, or scale it. Before you click the mouse button to confirm your movement/rotation/scale, use the mouse wheel to adjust how strong the proportional edit is.

Try out different sections until you start to reach the intended result!

My janky result from one attempt...

Depending on your use case, you could use sculpting tools, such as "Smooth," to even things out.

P.S. Don't forget to turn proportional editing off when you're done.
P.P.S. That's a cute fox!

Thank you for your attention, and it works! Guess who's cuter than this fox? That's you~

You can ty (not already so new) Sculpt brush > Pose

... and polish with Smooth brush.

BTW ... would be more efficient to simplify or retopo your model it saves you a lot of process headaches :)


text:
How to apply a geometry node to multiple objects?
I have many objects in my scene (hundreds) and want to apply a Geometry Node that I have made. I have named it "to_curve".

I am looking to attach and apply this modifier to every object in my scene. That is
for o in bpy.context.scene.objects:
# apply modifier "to_curve" on `o`

To copy GN modifiers, select all objects, and set active object with GN modifier (by selecting with Shift if it is not active). Then press Ctrl+L → Copy modifiers
To apply modifiers, (with objects selected) press Ctrl+A → Visual geometry to mesh
If you want to apply a specific modifier that's already placed on some of the objects, here is the Python code:
import bpy
from bpy import context

def apply_modifier(obj, mod):
    with context.temp_override(object=obj):
        bpy.ops.object.modifier_apply(modifier=mod.name)

for obj in bpy.context.scene.objects:
    for mod in obj.modifiers:
        if mod.type == "NODES":
            if mod.node_group.name == "to_curve":
                apply_modifier(obj, mod)


text:
How to slide a mesh into another

Hi everyone. I'm trying to make a groove inside a sphere shape. I would like to enter the tiny circular faces inside the sphere. I tried to extrude but the axe doesnt correspond. I mean the axes I tried are not orthogonal to the faces. Thanks

I found this link https://www.youtube.com/watch?v=b9Tteap4HBc

So... did the video answer your question?


text:
I can't insert a new edge loop
I can't select all the faces even if they are on the same plane. I don't understand. There are no double edges, vertices or faces. I want to insert a new edge loop (Ctrl+R) but can't create one all around.

Upload your file to http://blend-exchange.giantcowfilms.com/ so we can look for ourselves.

Thanks to both of you. I realized there was a double edge on one of a vertical edge. So there was a disconnection between the edges. I 'm surprised because I used the fonction to Remove Doubles. Surely my mistake.

@Grobby, it would be good for you to type that up as a well-written answer and accept it, so that someone else who has the same problem knows to look for double edges. (It's okay to answer your own question ;-) )

I realized there was a double edge on one of vertical edges. So there was a disconnection between the edges. I used W > Remove Doubles operator however it didn't solve the problem so I should have deleted those vertices manually.

Remove doubles does not work if the vertices don't overlap in terms of occupying the same 3D space. When edge loops don't work when they should, it has almost always to do with geometry errors. Normally the edge loop stops around the area where the problem is located.

authors: Борис Гетько


text:
How can I smooth this surface?
I would like to render this surface smooth like a natural curve but don't know how I can geometriccaly transform the mesh. Thanks for your help. Maybe I could add one edge between each segment but I don't know how to do that geometrically.

Depending on your interpretation on "smooth" you might need to rebuild the shape with better resolution (the outline is a bit jagged, consisting of 5 segments) or use subdivision surface modifier that divides the mesh into smaller and smoother polys everywhere. Also I see the edge split modifier has small enough angle to cause the sharp line along the curve where you see the border between light and dark grey. If you increase the angle in the modofer or disable it the sharp line will be smoothed.

By "smooth" I mean a surface without edge. I agree I have no choice but rebuild the shape. I thought I could add one edge or more between each segment. I don't know how do do that.

You could add loopcuts to the segments but that won't smooth the shape automatically either. The amount of work you'd put into rounding by resizing the new segments around a common center point would totally exceed the effort to rebuild such a simple mesh with more segments from the start.

@ metaphor_set. What is the more efficient way to build this shape? Because to obtain it I have copied faces from a sphere but I'm sure there is another way to build it.

You could add a loop cut in-between each of that triangular faces.
You can do that by selecting these 3 edges and subdividing them.

Select the new vertices on the corner edge and the vertices on the triangle at the bottom. Press J.

Afterwards, remove the original edges

The subsurf modifier will work much better now!

How do you subdivise the 3 top edges?

Edited answer. Look again


text:
How can I fix this SubSurf Modifier issue?
I'm trying in vain to reproduce the following image. I tried all I know to maintain the straightness of the edges by applying a crease of 1 and by adding edges but as I apply a SubSurf it's a 'disaster' . Idealy I would like to have the edges not too sharp as we can see on the image.
Thanks for you help.

Have you tried beveling? You can use the modifier, or you can use Ctrl+B in edit mode, with the desired edges selected.

I forgot to mention that this is a part of a sphere. I need to apply a Subsurf to smooth the surface of the sphere that's why I use (try to use) the crease to keep the edges sharp.

Bevel still should work

I don't know how to solve the issue of the angles. Why the crease doesn't work nor the insert of edges?

That kind of geometry looks a lot more suited for actual hard-edge style modeling, not Subdivision modeling. Geometric shapes and hard surfaced mechanical stuff don't usually play well with subdivided

Are you trying to copy the object in the picture, which is flat, or are your trying to create a square hole into a spherical/round object?
For a square into a sphere, the following method has the advantage of adding no edge loop around the sphere (which can mess up the topology) and no pinching on the corners:

This looks like the sort of thing that is best modeled using hard edge surface modelling, with manual placement of edges instead of using a subdivision surface modifier that will round everything off, then keep constantly fighting against it to try and keep sharp corners and tight edges.
Anyway, edge creases seem to work, all you need is an extra inset, then set edge crease to 1 on all corner diagonal edges.

Or alternatively you could instead use full control-edge-loops all around the sphere to keep smoothing from propagating too far.
Select the four edgeloops limiting the indented area and bevel them with the bevel tool Ctrl + B.

Select the relevant parts and extrude them inwards by vertex normal

Now add control edge loops with Ctrl + R around every sharp edge so smoothing won't propagate too far

Repeat for all necessary corners inside and outside where the edges must be sharp

thanks but could you detail the way you do the grooves on a sphere?

Certainly, edited the answers above, see if its clear enough now.

authors: Олександра Хоміченко


text:
How to transform a plane into a honeycomb?
I would like to make all the convex plane shown by the red  arrow as a honeycomb surface.
I tried to use the add-on Honeycomb after having the addon Extra Objects enabled ( File > User Preferences > Addons, in the Add Mesh category).
In the Add Object menu > Mesh > Extra Objects > MiscObjects > add a Honeycomb. But i don't know how I can stick it on the surface I want to transform.
Or maybe there is another method?

The best result (in my experience anyway) is achieved with the Tissue addon's tesselate function. The mesh isn't perfect and you need to remove doubles, but it's still much nicer and easier to use than a shrinkwrap based workflow.

What you need is a basic mesh tile that will repeat nicely, like this one:

And hopefully a fairly evenly spaced and uniform mesh, comprised of pretty much equally sized quad faces (you can generate such a mesh with the Remesh modifier).
I would suggest separating the piece you want to convert into a hex grid from the rest of the mesh, tesselate, remove doubles, then re-join with the original.
To generate the tesselation:

Select your hex tile.
Then select your target object (the one you want to generate a hex grid from).
Go to the Tissue tab in the tools panel.
Click on the "Tesselate" button.

You could use a procedural texture to render the surface as a honeycomb such as described in this answer : https://blender.stackexchange.com/a/78003/29586

This can be achieved by importing the material (using File/Append) from the Blend file provided in the above answer and assigning it to your surface. Use a Mapping node to adjust the orientation if necessary.


text:
What is a good topology?
This question might sound basic but I really can't find the answer to it. Here few examples. Should each mesh be connected together or be loose parts. I see sometimes in tutorials geometries that are floating and are not connected to other parts of the object, they simply go through a face without being connected to it. What should a clean topology be? Thanks.

Here some parts are floating.

IMO loose parts, especially for mechanical parts that don't deform.

It really depends on what you're going for.
For example if you end up wanting to 3D print your object it won't be possible because your mesh is not a solid.
If it's for in-game or fast rendering purposes you could easily let the parts float.
Do you want to render High resolution close-ups, then a solid model is preferable.
Could you elaborate your question a little more? What is the purpose of the model?

I was wondering what is the best workflow to obtain a clean model. I understand now that it depends on the final use. For example to render a realistic object with hard surfaces in high resolution, is it better to connect all the parts of the model? This is the case for all visual models used in  features? The first image shows that all the parts of the model are disconnected, they are like the layers of an onion. I understand it's better to build a model without floating parts for high reolsution but what about the connection between each part? Thanks.

Related- http://blender.stackexchange.com/questions/3305/when-is-acceptable-to-have-disconnected-geometry

If anyone answers, it would be nice if they could explain what topology is the best when using each process that @Delagone mentioned


text:
Can I use a Shrinkwrap Modifier for this shape?
This is the extention of the question posted previously 'How can I join these two meshes together?'. I'm trying to tranform the face surrounded by a red border into a honey comb face. So I am wondering if applying a Shrinkwrap is possible because I tried in vain (I can't select the face as the target). I could move the honey comb manually but it's defininitely tedious and unperfect. Thanks

The Shrinkwrap modifier uses two separate objects. your meshes seem to be submeshes of one object. 2. Since it only works with meshes, you won't be able to choose a single face of one object as the target.

So what is the best way to replace the smooth face of the mesh with a honey comb face?

Consider using a texture. If this mesh shape won't be a part of physics simulation, there is no need  to add geometry, when texture will fix the look.

I didn't understand quite well what you want to create :/

I am trying to make a grille honeycomb like the air vents you can see on the sport cars bumpers.

authors: Максим Козарь


text:
How can I soften these edges?
I would like to soften the hard edges of this shape (the edges selected). I tried to extrude the edge and scaled it down but because edges are not on the same plane it doesn't work. Can't add loopcut too. Thanks .
PS this question is the following of "How can I keep hard edges with this shape?"

@Neil Giliomee thanks but unfortunately I cannot add a Loop Cut. Here what happens. Loop Cuts don't reproduce the shape of the edges.

The result after having applied two Loop Cuts.

True, but by clicking once, you can drag your mouse up and down to change the shape.

I'm sorry Neil Giliomee 1 but it really doesn't work. I let you look at the image I add in the post.

I created a rough remake of your shape

Start by adding a loop cut as shown

Add another loop cut here

The SubSurf modifier will work much better now

Thanks but unfortunately doesn't work. I updated the post.

With the edges selected, Hit CNTRL_+ B and drag to bevel them.

I tried this method but the bevel doesn't work here. I suppose because edges are not on the same plane.


text:
How can I copy an edge with the knife tool?
This is the following of my previous question 'Why can't I add an edge loop?'. I put an edge loop and extended the edge on the last quad with the knife tool (shortcut K). How should I do to keep the line created with the knife tool parralel to the point of reference i.e. how can i have the blue line the same length as the red one. Thanks.

Try to use the Knife tool when subdivision modifier is disabled.

Afaik you can't do that easily (well, you could use either View or Custom Transform Orientations but that's may be quite cumbersome task, depending on the case), it's just that it could be done in another way / easier. Why don't you cut that edge with Loopcut if there's a quad ?

I don't know why but when I add an edge loop the last quad is not included. The topology is surely bad but I didn't manage to find the reason. So i was wondering if there is a way to measure an edge and make a copy or a tool to keep the edge parallel.


text:
How can I have a smooth rendering?
I would like to obtain a realistic rendering with edges not too sharp and smooth surface. I tried adding a crease of 1, but edges are too sharp. Marking edges sharp is too soft. It seems there are some artifacts in the rounded corners...what can I do?

are you talking about the pink edges or the blue edges?

About the indent shape (with the sharp edges marked in blue)

Smooth shading?

you can select loop and bevel by "CTRL+B". With size and profile (press P) you can control sharpness better than using crease. It is almost the same as add support edges.

I tried and bevel works perfectly here but I don't understand what you mean by "with size and profile (press P)". When I hit P the panel 'separate' appears.


text:
How can I render these edges more realistic?
I would like to have a realistic rendering with this hard surface. These edges appear too soft to look realistic, so I applied a 'Mark Sharp' but they appear with the same rendering as if I didn't apply any Mark Sharp. What am I doing wrong?

I tried many things. On the middle crease of 0.44 and on the right, a bevel with two edges. Is there a better way or if not what is the more realistic option?

Both threads complement each other. Should i delete one? Which one? – Grobby 12 mins ago

You can edit the edge sharpness by increasing the 'Mean Crease'


text:
How to edit a whole keyframe axis
I was creating animated camera and wanted to rotate the z-axis in 90 degrees.
I don't want to do the whole animation again, so is there a way?

You can parent Camera to Empty and rotate the empty :)

thanks that worked!


text:
How to Voronoi-fracture with Chebychev, Manhattan, or Minkowski?

My question relates to Blenders Voronoi or cell fracture feature.
How to fracture with a different algorithm?
I would like to get polygons fractured with the Chebychev, Manhattan, or Minkowski algorithm.
Procedural shading may work for some shading, however I wish to do it polygonal.
In the screenshot there is the procedural shading node for it to get some idea what I refer to.

So you don't need fracture it in volume. You want to split plane by procedural texture, right?

yes exactly what I would like to do

It is not possible natively. And there isn't an easy way ...
You can try create black&white image. I wanted suggest to use newly implemented Trace to GreasePencil, but it didn't work without issues for this kind of image.

So probably would be better to use other app to vectorise (trace) image as Line Art and import as SVG back to Blender, Convert to Mesh, Delete by Limited Dissolve - angle 35°in this case (or dicrease curve resolution to 1 before convert to mesh), Merge by Distance.

Add Plane, select both objects, switch to edit mode and use Knife Project to split plane into parts.

There was a script FractureMe2d with this feature - split plane by image. It was a part of FractureMe file from pildanovak for Blender2.49 that worked at glance. Abandoned.

I think this is the solution to get it done. MANY THANKS for your time explaining this.

I gave you credit over at DAZ - again THANKS

I dont know what does it means, but sounds like something good :) So thanks :)


text:
Bad shading by "active" boolean (GeoNodes)
My "Boolean" operator uses the "Integer" value in GoeNodes, it's all in animation and I can't just fix it. My problem is that when applying "ShadeSmooth" my Shading is very bad.
I tried adding more geometry , but it didn 't lead to anything.

FileLink

Try Split Edges node with Selection socket feed by Mesh Boolean node > Intersecting Edges socket ...

It doen't seems to be right way, but it worked in this case.

I just can't find how to invert selection correctly ... I expected Math Boolean node > Not type should do the job, but it didn't. Hmm ... so someone probably gives you a better idea ...


text:
Model Cell Culture (HeLa)
I'd like to procedurally model a cell culture of, e.g., HeLa cells, as if they were observed through a light-microscope. See the following image for reference:

I want to use the images for machine-learning training, where I want to create a model that learns an instance-segmentation of the cells. So what I need is a way of procedurally generating large number of images with such cells, with randomized number, shape and density of cells. And then I also need a way to retrieve (or render out) an instance mask, where each instance has a different color.
I guess starting with a voronoi shader would be a way. But the resulting cells are too "low-poly". If they were of geometry, I would add a subdivision to smooth them out, but how to do that in a shader?
Or should I do it all in geometry-nodes?
Any hint would be good! I am quite experienced with blender in general, just have never really done anything procedural so far :(
Cheers!

Great! Can you please explain one thing? What do you exactly mean by low-poly? I'm quite sure the solution is simply to use an RGB curves node in blender.

When creating a voronoi map, the individual instances have sharp corners, each instance consists of about 3 - 5 faces. If you look on the cell image above, you see that some sort of bevelling / smoothing would be required, to have smooth cell outlines.
Does that make sense?

Can you provide a picture of that low poly voronoi?

You can see plenty of examples here on the blender documentation page:
https://docs.blender.org/manual/en/latest/render/shader_nodes/textures/voronoi.html
And indeed, at the very end, there's an example of how a bevelled voronoi can be achieved :D

So, that solves your problem, right?


text:
Material Has Dark Areas that Move as Object Moves When Rendered
I'm rendering video of a tress of hair moving. The issue I'm having is that when rendered as the tress moves from side to side there are darker areas that seem to change when the tress moves. I don't know if they are shadows or the actual material though. The top of the tress is also an orange-ish color
I'm also having an issue with the 3D view not looking like the material preview but I don't have any light in my scene to cause this.
Attached are the material node, 3D view, and the final render.

Please attach blend file via https://blend-exchange.giantcowfilms.com

I pressed "flag" as needs more details from author, but it jumped under "close" section. Hmm

@vklidu for some reason I cant upload the .blend file

From your description I can't say why, so I can't help with that. Use any servis you know (without need to register) so I can try to upload here for you (or somebody, because Im leaving for a week tomorrow).

This is a very old Blender, and Cycles has been reworked since then.


text:
How to have editor panes in the workspace be different editor types
I am using Blender 2.8 (Windows 10).  I have now been able to create two editor panes in the same workspace (see this Q/A).  The new editor pane(s) is set to the same editor type as the existing pane.   Trying to change one pane's editor type changes the other pane's editor type.  How can you set them to different editor types?  A tutorial suggestions this is possible (screenshots attached).

Editor panes in my blender seem to be locked to be of the same type.  Changing one type changes the other's type to the same type:

Screenshot of splash screen with version:

Hi @AJP, those screen grabs are for v2.78 ... but you say you are using 2.8x ... oh wait ... I see you are comparing what you used to be able to do

Hi @Merlin thanks so much for checking.  I think I'm using v2.8 (attached another screen shot).  "I see you are comparing what you used to be able to do", um, I didn't mean to say that.  I've only started using blender since Thursday :)

Ok this isn't possible.  What's being show in the video is opening a different Editor Type which is possible.  What the question is asking for is opening the same Editor Type but with a different Editor Mode.  And this isn't possible: perhaps because the contextual interface on the right would be confusing as it would depend on which editor pane you were in.

Concretely, blender only supports a single context per workspace, so it can only be in one mode at a time.  You can have something else going on in another workspace ( top tabs ) it would seem.


text:
Roblox Hat Retexturing
So I wanted to retexture Roblox hat Scoobis. I got the original mesh obj. which looks like this:
And original texture of it which looks like this:

And i dont know how to attach this texture into mesh in Blender to make it look like original (first link) so i can modify it in Blender. When i try to do it, the result is something like this:

Do i need to "unwrap" mesh properly to match texture or what?
Edit:

The answer is yes, you need UVs.  Where did you get the mesh from, and also how did you apply the texture?

As Dale says you need to unwrap your mesh to get a UV, and also plug an Image Texture node (with your image loaded) into a Diffuse. But the UV you'll have will probably not fit with the image, maybe share your file so that we can test? https://blend-exchange.giantcowfilms.com/

I got mesh from mesh library from creator of this hat. (creator profile ->scroll down -> meshes). I added textury by simply unwraping mesh (default: U -> unwrap) and thats how it looks like:
https://imgur.com/a/qXmR9ly
You may wonder why I won't create my own texture from scratch. The problem is that first I want to match the original texture to the mesh, because hat textures in roblox works in a way, when at example, if original texture got eye in top left corner, then top left corner of image is always assigned to be placed in place of eyes on the mesh. I uploaded blend file in post


text:
Attaching Glasses to Model Rig
I've attempted to parent the glasses specifically to the head bone by going into object mode, selecting first the glasses, then the armature, and then switching into pose mode and only selecting the head bone. I got a box that came up and the only option was "connected". Thought I was on the right track, but the glasses still wouldn't move when I posed the character.
I am on mac and could possibly be hitting the wrong buttons on my keyboard? I'm not really sure. I used to be able to attach a hat to a character earlier this year, but nothing I remember seems to work and I can't find anything online that works either.

First select the glasses, then select the armature.
Instead of pose mode, press Tab to go into the edit mode and select (only) the head bone.
Press Tab again to go back to the object mode.
Ctrl+P to bring up the Set Parent menu, and select Bone.
Done!


text:
How to snap Origin to selection instead of closest element?
I've been trying to get Blender's pivot to work more like Maya's with snapping. What I'd like to do is snap the pivot point of my selected object to a vertex of a target as shown below:

However, when I turn on vertex snapping this is the result I get, which looks to me like it's snapping the closest edges to the selection:

However, the result I'd like to get would be this one (this is eyeballed but I'd like to be able to do this with snapping to get precise results):

if in Blender 2.83, .. set 'Snap To' to 'Vertex' in the snapping panel, and in Object mode, the object origin should snap to vertices.. Have I missed the point?

@RobinBetts That is the setup I'm trying on 2.83, but unfortunately it works the way it does in the 2nd image for me. Don't know why it's that way, but I can't get the actual pivot to snap no matter what. EDIT: Seems to work with the center of the object in Edit Mode, but nothing seems to make it work with custom pivot. Strange

@RobinBetts I also had no idea you can snap vertex to vertex in Object node, until I tried it :).

Ahhhh... Should have been: to: 'Vertex' AND with: 'Active'.  ( I nearly never have mine set to anything else).. does that help?

I think your question is focused to "Origin" (orange point) not pivot point that can be cursor, bounding box or center of several selected objects. If so, can you change naming in your Q? Thank you

To snap the Origin Point (orange dot) choose to snap with Median
It's in the Snapping Menu, second from right.

This is what I needed! I assumed that median just always means the center of the object, but it seems to be the Pivot.

Yes, it's a bit confusing :). To snap with the center of an object, choose Center.

If I skip naming part, Median and Center works the same for me. In Object mode both snap Origin in Edit mode snap to center of geometry. Can you confirm that? I used rectangle with origin out of center.

@vklidu Oh, you're right! And it seems that Active snaps origin too (which makes sense) :).

Yes Active snaps in edit mode like active vertex etc, in object mode if you have selected more objects it snaps active (brighter) one from its origin, that make a sense, yes.

@vklidu Center refers to the Transform Center.. (see below)

Well, this exchange got me looking stuff up and trying things out. (TL;DR)
What's the difference between Median and Center?

Median is the vector-average point of the current selection. In Object mode, that's the vector-average of the selected object origins - if you have only one object selected, that's its own pivot. In Edit mode, that's the vector-average of selected vertices, whether selected as vertices, edges, or faces.
Center refers to the current Transform center, as set in the Transform Pivot Point dropdown. For example: if in Edit Mode, that's 'Bounding Box', the snap source  will be the center of the bounding box of the verts in the object's orientation, not the average position of the vertices. If it's '3D Cursor', the snap source is the position of the 3D cursor with respect to the selection before the move started, which can be very useful. If you can put the 3D cursor at any point with respect to your geometry, (often using ShiftS,) you can use its location as your Snap source.

What I don't get is why, in Object Mode, 'Center'+'Bounding Box' still snaps the object's pivot, not the center of the object's bounding box.
There's also the A feature, which lets you select the weighted average of multiple snap targets. If Snap is locked on with the magnet, you can hit A to add the current hover-target to an accumulation to be averaged. This means, for example, you can hit A twice at one end of an edge, and once at the other, to snap to a point 2/3 of the way down it.

Great explanation, thanks :). I had no idea about the average feature.

@JachymMichal       Nor did I! I really think 'Bounding Box' should work in Object mode, though... unless I've missed something.


text:
Why the simulation I made in Blender has a different behavior by changing only the size of element?
I premise that is the first time I use Blender.
I would like to simulate a Cubipod installation by a construction crane, for my Master Thesis project in Coastal Engineering . First of all, I should simulate the fall of this element by hand (Cubipod is a rock armour unit deployed to defend ports and shores from wave attack) , using the size of Laboratory rock armour unit (= 3,5 cm). The problem is that with this dimension I've an unstable simulation, unlike when using a bigger size of the element (scaled 50:1). The only parameters I've to implement are in the rigid body, using Mesh as shape collisions. Apart from the mass of the element (which varies with size), the other features are the same for both the Lab size and the model 50:1.
The Cubipod file I imported is Collada (.dae); I've also the .stl version, but has a worse behavior.
Thanks for your help!

In the Scene Settings under Rigid Body World you can change the number of Steps per second and the Solver Iterations. This will make the simulation more precise at the expense of longer calculation times.

I've tried to do what you said, but there is still the same problem (the Cubipod pass through the plane mesh when falling). I don't know if could be a problem due to the format file.

Check the Meshes for non-Manifold faces/edges and fix them, in Edit mode from the Select menu. Also try thickening your plane. If all else fails post the file (or a sub set) here https://blend-exchange.giantcowfilms.com/

There is still the same problem also after fix the meshes; anyway I've just uploaded the file. Thanks for your help.

you need to edit your question to include the link

Start with setting the Physics to Convex Hull rather than Mesh and set the Origin to Geometry. That gets the simulation at least stopping the Cubipod from falling beyond the base, but it is not perfect. You can also alter the Grid physics to have a non 0 Sensitivity Margin. I tried to Apply Scale transforms and it went a bit haywire so I guess that is were the root problem lays.

Previously I had set the Physics to Convex Hull, but with this setting the adjustment of Cubipod after hitting the ground don't represent what happens on the construction site.


text:
Cube Emitter: the cubes emitted pass through the ground plane instead of rest on it
I would like to animate a great number of Cubes, falling from a surface at a determined height one after the other. The problem is that in doing this, the cubes emitted pass through the ground plane instead of stick on it. Also I would translate this surface, in order to create a sort-kind of grid with the falling cubes.
Has someone a tip how to do it? Thanks.

This answer is just regarding your ground plain and having objects stick to it. I am assuming that this is a particle system. For your ground plane will need to have:

A collision modifier added, then
In the physics field to make them "stick" an option is that you could set Damping to 1 and Friction to 1. However, play around with the fields.

Note, this image is just using default particles with no mods.

After downloading your blend file I did the same and it worked as expected. Again noting this is only the getting the cube to 'stick' the other part is a bit vague for me.

I've just uploaded the .blend


text:
How can I make objects fall at steady speed?
I have two objects (same size, same geometry) falling from different heights; obviously the object in the higher position speed up and has a different behavior when hitting the ground, compared to the other object.
How can I keep the velocity constant at all times, until they hit the ground?

All object fall at the same weight, regardless of mass or size. The force that slows different objects down is friction.

Height, not weight...I could modify the damping value but I don't want to act on rigidbody dynamics; are there other methods to achieve the result?

Speed, not weight. Sorry.

@Nate_Sycro27 you mean rate, not speed ... i.e. acceleration ( or rate of change of speed ).  The only thing that changes speed is a force, at or near a massive object this force will be the gravity.  Blender fakes gravity by default for earthlings.  To stop this you turn the gravity off in the scene properties.

Set gravity to 0 and give them both same initial velocity
(also make sure to give em a lot of solver iterations/steps per second so physics calculate nicely)

how can I do this showed in the panel below the animation? I can't change the interpolation mode.

Are you refeering to Graph Editor?    If that's so, I changed interpolation by selecting the keyframes and pressing T

Turn off GRAVITY (no gravity at all), than add WIND with say value of 100 (with an arrow pointing down). All object will fall at constant rate (with no acceleration).


text:
Simulation of objects falling one after another
I would like to animate a great number of Cubes, falling from a plane located in a determined height, one after another. Each cube should be placed close to the cube placed before.
What I've want to do is deploying a sort kind of barrier (in several horizontal layers). To simulate the real life implementation I simply moved one element higher than the other, but in this way (obviously) the simulation gets affected by the gravity. I know how to through the element at steady speed, but it could be more realistic if each element appears after that the previous one has already reached the ground (it should be simulate a "crane" that places these elements on the building site).
Has somebody advices how to do it?
Thanks.

do you want to use physic or not?

any suggested idea is welcome

so maybe take a look at a basic tutorial about cube falling on a plane with Physics, the cube are Rigid Body > Active, the plane is Rigid Body > Passive

do all cubes need to be there at the beginning? maybe you could toy around with a particle emitter.

no they don't; the particle emitter could be a good idea, but how can "emit" cubes instead of particles?

So if you want to test physics, here what you could try:

Create 3 objects, a cube, a funnel, a plane.

Make your funnel and plane Rigid Bodies, Type > Passive (they are obstacles), Shape > Mesh (the topology will be taken into account).

Make the cube a Rigid Body, Type > Active (it will fall), Shape > Mesh (not necessary in that case I guess). Duplicate the cube. If all your cubes are ready and different, just give the Rigid Body to one of them, select all, then the one with Rigid Body and in 2.8, Object > Rigid Body > Copy From Active (in 2.7, T panel > Physics > Copy From Active).

Start the animation, the cubes fall.

If you want to keep them close to each others, create a Force Field > Force with a negative Strength.

thanks, but actually I want to place them in order to create a sort-kind of grid, like a barrier

ok so maybe edit your question to give a full explanation of what you want, maybe show a drawing etc...

I attached the .blend file; what I've want to do is deploying a sort kind of barrier (in several horizontal layers). To simulate the real life implementation I simply moved one element higher than the other, but in this way (obviously) the simulation gets affected by the gravity. I know how to through the element at steady speed, but it could be more realistic if each element appears after that the previous one has already reached the ground (it should be simulate a "crane" that places this elements on the building site)

ok I'll try to find a solution when I'll have time, maybe don't mark my answer as good so that someone else has the curiosity to check your question  ;)

great, thanks!!

so you want each cube to fall on each other? with a small bouncy effect when they hit? or no physical effect at all? but they don't fall, they just stack up?

Sorry it's not easy to understand, if you don't want Physics, have you tried just to move your object from position A (top) to B (bottom)? If you want to use Physics, maybe use some invisible narrow funnels so that each cube ends precisely on the previous one? If you have a lot of cube it might be the solution, you'd avoid tedious animations... Just suggestions, I'm not sure it's what you want...

Also invisible narrow funnels could be an idea. But what I was searching for, is a method like explained in this link, probably I should use the particle emitter; but how can I do this using a Cube and not particles? https://blender.stackexchange.com/questions/60865/animation-falling-object-one-after-the-other

Your emitted objects can be whatever you want, so yes it might be the solution, except your cubes bottom doesn't seem flat so I don't know how you'll make them stack up, that's why I was talking about funnel that ends as narrow pipes so that it creates stack. You could also look into Animation Nodes, but it's a bit complicated for me.

yeah it's not properly a cube, it has some protrusions; thanks for the help!

also you could use cubes following path with various offsets, maybe a bit tedious though

mmmh doesn't seem easy to do with Physics, the cubes jam in the pipe...


text:
UV wrapping brushed steel hard-surface models
So I have one today I hope really can be found by others and learned from! I am really trying to create some high quality models and I think the area I am having the hardest time with is proper UV wrapping. I am working with a brushed steel material from Poliigon.com and I want the angle of the brushed lines in specific directions.
First, here is the model and texture:

Now, despite my best efforts, and hours on YouTube this model is still loaded with imperfections. Here are just a few examples:

Lastly here is the desired flow I am wanting for my brushed lines:

So, I am really just curious if anyone has any pointers, or ideas as to how I can get really tight clean UV wraps or even point me in the direction of a paid course, etc. I have learned a lot about seams, marking sharp, and even the general process of UV wrapping and it's interface within Blender. However, wrapping these lines in a seamless and flawless manner, that point in the desired direction, is beyond me at the moment and ANY help would be incredibly appreciated!
I hope this also can help others who are struggling with intermediate level UV stuff.
Let me know if someone wants the .blend
THANK YOU ALL !!!

consider this: you first brush the metal then you bend it into shape. your uv maps should look like the piece of metal sheet before bending.

well the texture I have is just horizontal lines, and since I want these lines to go in several different directions I am not sure what you mean by wrap

I request for the blend file

I posted the file for you Shantanu. Thank you very much for your interest! I stripped down the file and even the textures a little bit but feel free to use another brushed style texture if you have one similar.

Some of the texture files were missing so I used the waves texture instead.

wow.... Can you provide a brief explanation ( or a detailed one if you feel generous ) of the magic that you laid down on this file ??
Really impressed!!
Would you use some sort of a blend in your shader tab to make sure there is no visible seam ?

@CameronT0101 to blend the seams you can use a similar approach: https://youtu.be/Ebx2qbBlvh0?t=563

Ok funnily enough I was actually watching this video for this problem, so I will certainly watch it once more! Ok my last question would just be:
Was there any technique or tool that you used that I should know about in order to execute this process in the future?
I will also download the blend and TRY to learn as much as I can!
Thank you again, and I will give you the answer mark :)


text:
Blender 2.8: How to select multiple object with the same diffuse color in principled shader?
I have to import various fbx file scenes , bringing in a large amount (>10.000 Objects) into the scene with each single import. Each import scene stands on its own. Imported fbx files will not be combined.
Each object has its own material assigned, and each single material is a material with a principled BSDF. But there are only a few different colors (for example, 10.000 Objects have 10.000 unique materials, but 3333 green ones, 3333 red ones, 3334 blue ones). All of them have the sample principled shader material, they only differ in the diffuse color setting.
The materials in the imported scene are named as follows:

the first digits are always the RGB value channels of the diffuse color of the principled bsdf. The suffix after the "." is the number of copies of the material.
the overal number of materials will differ from scene to scene, as this is just an example for one scene. Other scenes that will be imported will differ in number of objects, as well as in number of materials.
Is there a way to merge all shaders with the same settings, so that in the end there are only three materials instead of 10.000? In simple words: Merge aller materials with the same diffuse color.
means 3333 object share one green shader, 3333 objects share one red shader, and 3334 objects share one blue shader? (The numbers are just examples, not the actual amount).
In the end, the number of materials will be drastically lower.
I found a similiar topic here, but this one works only for Blender internal and causes an error in Blender 2.8.
Thanks for help!

import bpy

for obj in bpy.data.objects.keys():
    bpy.context.view_layer.objects.active = bpy.data.objects[obj]
    activeobj = bpy.context.active_object
    try:
        if "." in activeobj.active_material.name:
            mat = bpy.context.object.active_material.name[:-4]
            activeobj.data.materials[0] = bpy.data.materials[mat]
    except:
        pass

for mat in bpy.data.materials.keys():
    if bpy.data.materials[mat].users == 0:
        bpy.data.materials.remove(bpy.data.materials[mat])

Try this out and let me know

Dear Arthur, your script solved the problem. Thank you very much for your help! The script reduced the amount of materials from 7.800 to 37. One thing i had to modify: for some materials, there were more than 1000 copies. Means that the code line mat = bpy.context.object.active_material.name[:-4] has to have a "5" instead of a "4" at the end. Then, the modified script has to be started again to eliminate the material with more than 1000 copies. Again, thank you very much for your support!

Didn't think of that! But glad you got it working in the end :)


text:
Trace visualisation in 3D - how to wrap curves onto a 3D mesh
Dear Stack Exchange Community,
i'm trying to achieve the following effect with curves:

Source of this image is here:
https://www.behance.net/gallery/57143191/Visualizing-Concepts-in-Houdini-Personal-Practice
I tried to achieve this effect by following this question:
How to achieve this spline and particle effect
i tried to achieve the desired result using the animation nodes setup from the thread listed above, doing the changes marked "A" and "B":
But the curves do not wrap around the suzanne object ("C").

The Blend file with the animation node setup is here

What is the mistake? some advice would be fine. Thank you!
EDIT 1.1 - Final Node Setups for AN 2.0 with Blend files
Here are the final node setups for AN 2.0, created on the discussion listed below.
General Curl

Implicite Form

Mesh Surface Curl

I suggest a) adding an image of the result you're currently getting, b) explain a bit more the effect you're trying to get without solely linking to your previous question and c) Uploading a blend file to here with your current node setup, so people don't have to recreate it themselves.

First of all, I suggest you do what @RayMairlot suggested. While I don't know exactly what you want to create, here are some points regarding your setup above: 1) The curl in 3D is computed from a vector field and not a scalar field, so forget about my previous answer, it was only for the 2D case. 2) You can not by any means edit the resulting curl trace because that will render it non divergent, any editing has to be on the field and only the field. Just do as suggested for now and we will discuss this in details later.

Hi Ray, Omar, sorry for the bad Question syntax. I edited the question. If there has to be more information, please let me know. Thanks for support!

@pixelpoems.de I will research this in couple of days and hopefully write an answer then.

The General Curl
The Theory
The image you posted above is trace visualization for what is known as a divergence free vector field. To understand what that means, consider particles that move along the lines you see above (the field represents their instantaneous velocity), if the field is indeed divergence free, those particles will never collide. That's what gives those visualizations their beauty, the lines never intersect.
Mathematically, a vector field $F$ is divergence free if $\nabla \cdot F = 0$. It is hard to compute a random vector field that is divergence free proceduraly, so we use some math to aid us. In vector calculus, the Curl of any vector field is divergence free. The curl is an operator that operates on a vector field and returns another vector field that represents the infinitesimal (microscopic) rotation of the input vector field. The infinitesimal rotation of a vector field can be understood using this intuitive interpretation from Wikipedia1:

Suppose the vector field describes the velocity field of a fluid flow (such as a large tank of liquid or gas) and a small ball is located within the fluid or gas (the center of the ball being fixed at a certain point). If the ball has a rough surface, the fluid flowing past it will make it rotate. The rotation axis (oriented according to the right hand rule) points in the direction of the curl of the field at the center of the ball, and the angular speed of the rotation is half the magnitude of the curl at this point.

We are not interested in what the curl represents, we are only interested in the fact that the curl of any vector field is divergence free. For our artistic use, the input of the curl operator $F$ can be a simplex or perlin noise-based vector field, that is, $F = (F_x, F_y, F_z)$ where $F_x, F_y, F_z$ are different perlin or simplex noise functions.
Let us now look into the curl operator that will take $F$ as an input and returns a divergence free vector field, the curl of $F$ denoted by $\nabla \times F$ is equal to:
$$
\nabla \times F =
\left( \frac{\partial F_z}{\partial y} - \frac{\partial F_y}{\partial z} \right)\mathbf{i} +
\left( \frac{\partial F_x}{\partial z} - \frac{\partial F_z}{\partial x} \right)\mathbf{j} +
\left( \frac{\partial F_y}{\partial x} - \frac{\partial F_x}{\partial y} \right)\mathbf{k}
$$
Where $\mathbf{i}$,$\mathbf{j}$ and $\mathbf{k}$ are the fundamental vectors of the rectangular space. Don't worry if you don't understand those equations, we shall understand them soon. The notation $\frac{\partial F_z}{\partial y}$ represents the partial derivative of $F_z$ with respect to the $y$ axis, similarly, $\frac{\partial F_y}{\partial z}$ represents the partial derivative of $F_y$ with respect to the $z$ axis, and so on. A partial derivative measures how much a function changes along an axis. Take a brief look at derivatives before we continue, you don't have to study it, just recognize what it represents. To compute the partial derivative, we use what is known as the central finite difference method or Symmetric Derivative which states that the partial derivative is equal to:
$$
\frac{f(x+h) - f(x-h)}{2h}
$$
Where $h$ is some arbitrary small number and $f$ is the function in question. The same equation applies for the $y$ and $z$ axis. For instance to compute $\frac{\partial F_z}{\partial y}$, we add $h$ (a small number) to the $y$ component of the the vector, evaluate the $F_z$ noise at that vector, subtract $h$ from the $y$ component of the vector, evaluate the noise and take the difference between the two evaluated noise values, and finally divide them by $2h$.
To understand how the central finite difference method work, consider this intuitive interpretation:

Suppose one is standing on a mountain blindfolded, one was asked to report the steepness (slope, partial derivative) of the point one is standing at, one might move a step to the right and identify whether one ascended or descended and how much did one ascend or descend by, another might move a step to the left and identify whether one ascended or descended and how much did one ascend or descend by. Now consider the situation where one is at the very top of the mountain, at that point, the slope is zero, one is not ascending or descending, but both persons will report that they are descending, because if one move to the left or the right one will be descending. We conclude that to get an accurate result, we have to move a step to the right, observe, move a step to the left, observe and then determine if you are ascending or descending. In our case, if one move both to the left and to the right, one will understand that one is at an even surface (at the top). So when we say $f(x+h)$ we simply mean that we observe after we move a step $h$ to the right and $f(x-h)$ means to the left.

Once we compute the curl of the vector field, we can do what is known as advection using Euler's integration. When treating the curl vector field as the instantaneous velocity of some particles in space, Euler's integration approximates the location of the particles after one second by adding the curl vector field to the original particles location. So to get the whole trace of a particle, we evaluate the curl, add it to the location of the particle, evaluate the curl at the new location, add it to the new location, and so on.
Implementation
Simple Curl Implementation
The first step is to make a group that generates the vector field by initializing its components with different simplex noises $(F_x, F_y, F_z)$:

The next step is to compute the partial derivatives. This can be done using the formula for the symmetric derivative:

Take your time to understand this node tree. It can be hard to grasp at first. Having all the partial derivatives, we can now compute the curl easily using the equation above:

And by advecting some initial vectors along the curl vector field using Euler's integration and creating splines from the output points:

We get something like this:

Optimized Curl Implementation
While the previous implementation works, it is very slow because it requires a lot of noise evaluations and noise is expensive to compute. Thankfully, the noise functions in Animation Nodes v2.1 is implemented using SIMD instructions, which means it can somewhat be executed in parallel for CPUs that support Advanced Vector Extensions (AVX) which is pretty much every modern CPU. This result in a speed up of up to 600x the original implementation. SIMD requires the input data to occupy a contiguous memory block. So to utilize SIMD instructions and optimize this setup, we should combine all our data into a single big vector list, evaluate the noise at it, segment the output, and process it. The following implementation is hard to understand, so it is better to do it on your own, my implementation looks like this:

Euler's integration loop stays the same:

However, notice that we are appending a list of vectors and not a vector, so the output will be of length $n \cdot m$, where $n$ is the number of iterations and $m$ is the number of input initial vectors. We have to do another segmentation before creating splines from those points, so the spline loop will include segmentation and spline creation:

And what we get is a fully functional, fast, curl trace generator:

Blend file for study and practice:

Surface Curl
Now that we have an understanding of what the curl is, we can go ahead and finally answer your question.
Theory
Let us define the problem as follows:

We want the output vector field of the curl operator to always be tangent to the surface of our meshes, that is, the curl should always be perpendicular to the vector field that represents our mesh surface normals.

If our initial points were on the surface of the mesh and the above condition is satisfied, then we will get the result we are looking for. The above condition is satisfied only if $(\nabla \times F) \cdot \vec{N} = 0$, where $(\nabla \times F)$ is the curl and $\vec{N}$ is our normals vector field. The problem is now to compute a vector field $F$ so that the dot product between its curl and the normals vector field is equal to zero.
By some analysis we get, $F$ is equal to $\vec{N} \cdot p(x,y,z)$ where $p$ is a perlin or simplex noise function just like we used in the general case, the curl in that case becomes:
$$
\begin{aligned}
F &= p(x,y,z) \begin{bmatrix} N_x \\ N_y \\ N_z \end{bmatrix}\\
(\nabla \times F) &=
\left( \frac{\partial F_z}{\partial y} - \frac{\partial F_y}{\partial z},
\frac{\partial F_x}{\partial z} - \frac{\partial F_z}{\partial x},
\frac{\partial F_y}{\partial x} - \frac{\partial F_x}{\partial y} \right)\\
&= \left( N_z \frac{\partial p}{\partial y} - N_y \frac{\partial p}{\partial z},
N_x \frac{\partial p}{\partial z} - N_z \frac{\partial p}{\partial x},
N_y \frac{\partial p}{\partial x} - N_x \frac{\partial p}{\partial y} \right)
\end{aligned}
$$
And the proof:
$$
\begin{aligned}
(\nabla \times F) \cdot \vec{N} =
&N_z N_x \frac{\partial p}{\partial y} - N_y N_x \frac{\partial p}{\partial z} +\\
&N_x N_y \frac{\partial p}{\partial z} - N_z N_y \frac{\partial p}{\partial x} +\\
&N_y N_z \frac{\partial p}{\partial x} - N_x N_z \frac{\partial p}{\partial y} = 0
\end{aligned}
$$
Notice that if the normal is $\vec{N}=(0,0,1)$, you only end up with the equation that Robert Bridson proposed in his paper "Curl-Noise for Procedural Fluid Flow", which is:
$$
\frac{\partial p}{\partial y}\mathbf{i} -\frac{\partial p}{\partial x}\mathbf{j}
$$
So now you know where my other answer came from. Since the curl have zero z component, we shall call this special case the 2D Case.
Implementation
The implementation is much easier because we only have to differentiate a single function. You should by now know how to implement that. Here is the non-trivial implementation of the surface curl; notice how there is an extra input called normals now:

Lets consider the simple example in which we use a sphere as our mesh, the normal of the sphere at any point on its surface is equal to that point normalized, so the normal is simply the point locations normalized. After the curl is computed and the the points advected, we can project the output onto the surface to make sure the splines always lie on the surface of the sphere since we are merely performing a finite approximation. We won't need this step for sufficiently small step sizes for Euler's integration which is in our case decided by the magnitude of the normal vector field or the amplitude of the noise function. To project any point onto the surface of a sphere of radius $r$ we normalize the vector and multiply by the radius, so the advection loop looks like this now:

The result are those magnificent and beautiful splines:

Blend file for study and practice:

Since the 2D case have two zero normal components, let's implement the 2D case using an optimized setup. We simply remove anything that got multiplied by zero to get:

This gives:

Blend file:

Ok, I have given you an example where the mesh is defined implicitly, but how do we use an actual mesh? Well, we can use a BVH tree:

We approximate the normal field by the Nearest Surface Point node Normal output, and we change the generator to be the location of the nearest surface point. Why? Because this is the projection of the point on the surface, which is a step we have to do to make sure we get accurate results as we discussed before. Make sure to reduce the step size, because BVH trees are not as accurate as the implicit definition of our sphere.
It should be noted that constructing BVH trees from objects directly won't apply modifiers, so such node tree can be used:

And finally, here is the result of both setups:

Inviscid Boundary Condition
An inviscid boundary condition required the dot product between the curl and the surface normals around the boundaries of objects to be zero, in other words, it requires the curl to be orthogonal to the normals of the object around its boundaries. Ensuring this condition in the surface curl case is easy, while it is somewhat challenging for the general 3D case, so I shall only introduce the surface curl.
Looking back at the equation for the 2D case:
$$
\frac{\partial p}{\partial y}\mathbf{i} -\frac{\partial p}{\partial x}\mathbf{j}
$$
We notice that the curl is actually orthogonal to the Gradient, the gradient vector being, in simple terms, a vector pointing in the direction of the greatest change. The gradient is computed by:
$$
\frac{\partial p}{\partial x}\mathbf{i} +\frac{\partial p}{\partial y}\mathbf{j}
$$
Can you see the similarities? So we can implement the boundary condition by making sure the noise field have a gradient tangent to the normals of the object around its boundaries, in other words, the noise field should increase the most when moving in the direction of the surface normals. We actually know a field that satisfied this condition everywhere, that is, its gradient is tangent to the surface normals. This field is the Signed Distance Field (SDF). An SDF is, for every point, the distance to the closest surface point, having a negative sign if it is inside the surface and positive if outside (However, the sign is redundant in this particular application). So the condition can be implemented by modulating the noise field based on the SDF of the surface using a ramp. As Robert implemented it, the noise field should be multiplied by the ramp:
$$
\begin{cases}
      1 & r > 1 \\
      \frac{15}{8}r - \frac{10}{8}r^3 + \frac{3}{8}r^5 & -1 \leq r \leq 1 \\
      -1 & r < -1
\end{cases}
$$
Where $r$ is the SDF divided by a scalar defining the modulation width. Which we can implement as follows:

What we did is replace the noise node with the above subprogram and add a BVH tree as an input.
Using Older Animation Nodes Versions
The only node used in this answer and does not exist prior to Animation Nodes v2.1 is the Vector Noise node which provides us with the perlin or simplex noise functions.
To make the node tree work for older versions, you simply have to replace the Vector Noise node with the built-in blender noise functions that exists in the mathutils python module. To do so, we can use the expression node:

With this code:
[mathutils.noise.noise(x) for x in vectors]

Aside from noise.noise, there are other functions that give you more control, which you can find in the API.
File for study:

This answer deserves an award.

This can help students to learn some part of mathematics. Very good answer.

Holy crap Omar, I agree with cmomoney, amazing answer.

Wow congratulations on this stunning answer, it is the height of BStack answers!

I can only repeat myself regarding your participation and help in matter of providing answers to very tricky questions.. Thank you Omar for your work and bringing knowledge to the users

This is a brilliant answer! you saved me hours of research. I'm really deeply impressed and a huge thanks for sharing

Awesome answer, Omar! Where does one get Animation Nodes v2.1?

@JeffLange I don't think there are compiled addons for that version as it is under development. You can either compile it yourself, ask someone to compile it with you or use an older version as I explained in my other answer.

Hi Omar,thank you very very much for your detailed answer. But i also struggeling with the adaption of the solution to a AN Version < 2.1. I tried to use the expression node using mathutils.noise.noise(x), but it seems that i am doing something wrong with the node itself. Please refer to "EDIT 1.0" Above. Thank you.

@pixelpoems.de Edited the answer to take into account older versions.

@pixelpoems.de Your input vectors in the expression node is called Vectors while it should be vectors (lower case v). I will edit the answer to add file for you to study.

@OmarAhmad Meanwhile i managed to get the General curl and the implicit version of the the curl working. But the combination with the BVH tree still does not work. I uploaded my version here:  How can i combine the "Get Random list Elements" Output with the Splines Subprogram Iterations input correctly? Some advice would be nice. Thank you for your patience!

@pixelpoems.de 1. The construct BVH node doesn't apply the subsurface modifier, you can either construct it from polygons or just apply the modifier. 2. The get length node should be connected to the itterations of the splines subprogram. 3. The normalize node at the end of Euler's Integeration loop is a part of the implicit method, so it should be removed in this method. I will add another screen shot to show the process.

@omarAhmad Dear Omar, it is finally done! all Versions are now running on AN 2.0. I really thank you for your patience and support. Without your help, i never would have manage it. As soon as i have some beauty renders done, i will leave you a link with credits here. Again, thank you very much for your great support! I'll edit the answer and post all three Version - general curl, implicit form and the surface curl - so that others don't get confused.

That is described: "Because this is the projection of the point on the surface, which is a step we have to do to make sure we get accurate results as we discussed before. Make sure to reduce the step size, because BVH trees are not as accurate, as the implicit definition of our sphere." So where to reduce the step size? I didn't find this value in the graph.

@Prag The Amplitude controls the step size.

That's... a freaking... answer...


text:
Light an object with an inner light and volumetric world
I have a set up where there's a box with holes (dice) with a point light inside it, with volumetric settings, so that the rays coming out of the cube are visible.
The problem is, you can't barely see the cube itself.
Is there a way to add another light that faces the cube which is not affected by the volumetric settings?
I thought of doing it in [two different passes][1], but I was curious if this is achievable, by say, setting that new light to ignore any volumetric effects.
Similar question:
Lighting specific objects in cycles with volumetric atmosphere


text:
Sun and other lighting isn't working in blender render
I am trying to add lighting to this scene but whenever I put a sun, etc, the sun does nothing. Please help.

Welcome to Blender.SE! Could you add more information about the task are you would like to achieve? Are you referring to the material/textured view or the render? Are you able to see them in the default scene, or every scene you try have this problem?

Is it possible that the camera is inside a wall, and therefor cannot see anything?

I added the download