What's the relation between Cycles' sampling pattern and the pixel filter? In Cycles' render settings, there is a setting for a sampling pattern (default Sobol), and there is a setting for a pixel filter (default Gaussian).

  What is the link between these settings?

More specifically, this is my understanding of what the two settings mean:

Sampling pattern: indicates a pattern of points within a pixel where rays will be cast into the scene
Pixel filter: used to filter the rendered image (post-processing, if you will), much like a Gaussian blur in Photoshop; this effectively adds to every pixel some contributions from neighboring pixels

I hope my understanding about these is more or less correct.
Now my question, more precisely, is:

  Could one use a sampling pattern that goes outside of the pixel boundaries to combine the sampling pattern and filtering into a single procedure?

Simple Answere

  What is the link between these settings?

The Pixel Filter randomly changes the coordinte of every sample with the given distribution, meaning for example: When the Sobol Sampling Pattern samples near the edge of the pixel, the neighbouring pixel might be lit instead with a rather high probability. This is used to get rid of aliasing on the sharp edge of very bright objects, like mesh lights.

Look at these examples with a mesh light with a strength of 100. You can see the noisy Gauss distributed white dots during the whole sampling process.

Gauss with width of 0:

Gauss with width of 2:

Gauss with width of 10:

With more samples the last two would both result in a smooth image. The higher the width of the Gauss the less antialiasing you get, but at the cost of loosing some sharpness.

  Could one use a sampling pattern that goes outside of the pixel boundaries to combine the sampling pattern and filtering into a single procedure?

Actually, this is a not a bad idea, but I never heard of any renderer doing this. Convoluting the Sampling Pattern with the Pixel Filter and using the resulting function as the new Sampling Pattern should result a render that converges to the same image.

This is however not desired probably because being able to separately choose these two functions rather than from a huge list of all possible convolutions is better. And the common Pixel Filter functions are used in other type of renderers, where sampling is done over the whole image rather than pixel-by-pixel, and one sample really lits multiple pixels, which is not stochastically sampled but fully calculated, like LuxRender.

Mathematical Explanation

First Possibility

Given the i-th columns k-th pixel indexed from 0, the Sobol Sampling Pattern gives a uniform pseudo random 2D vector (x, y) inside the [i, i + 1) x [k, k + 1) set, which is the mathematical notation for the square of the pixel. The rendering engine traces the related direction and returns with the color. The Gauss Pixel Filter samples a Gaussian distributed pseudo random 2D vector (dx, dy). The pixel containing the (x + dx, y + dy) vector gets lit with the traced color.

Probably this is done in Blender.

Second Possibility

Given the i-th columns k-th pixel indexed from 0, the Sobol Sampling Pattern gives a uniform pseudo random 2D vector (x, y) inside the [i, i + 1) x [k, k + 1) set, which is the mathematical notation for the square of the pixel. The Gauss Pixel Filter samples a Gaussian distributed pseudo random 2D vector (dx, dy). The rendering engine traces the (x + dx, y + dy) related direction and returns with the color. The original pixel gets lit with the traced color.

Why these result the Same

For every x, y, dx, dy where (x, y) is contained in the i-th columns k-th pixel pixel and (dx, dy) is a possible outcome of the Pixel Filter, the events below have the same probability:

First Possibility: The Sampling Pattern sampled (x, y) in the mentioned pixel and the Pixel Filter sampled (dx, dy).

Second Possibility: The Sampling Pattern sampled (x + dx, y + dy) in some pixel and the Pixel Filter sampled ( - dx, - dy).

These events have the same probability because all Sampling Patterns have uniform distribution and all Pixel Filters have a symmetrical distribution.

This means that both possibilities converge to the same image.


How to reduce thousand of faces of an already low poly object Let me ask you a little question.

I have an object, a 3D already low poly unicorn that has 183,159 faces and I need it to make it on paper (via pepakura) . I usually use MeshLab to reduce any number of faces I need, but in this stl file I can not figure out how to reduce the faces to the right amount of faces that the low poly shape is showing.

Please, please, how can I reduce the thousand of faces in that low poly object in Blender or any other program(s) you know? I´ve been searching in english and spanish, and get nothing referencing a low poly object with thousands of faces.

Thank you for reading and for any info you can provide. Thank you.

Best regards.

Brianna

p.s. Attached you will find 2 pics (one with the unicorn in general view and another showing thousands of faces on the surface of the low poly).

use Decimate modifier with planer option

you need a little cleanup depending on complexity.


Why doesn't the circle have a face like the plane? A circle (Mesh object) only shows the outline. A plane (mesh object) showed up properly.
How can I make this circle look like a plane?
When I switch to the edit mode, the circle is shown with vertices unlike a plane.
Please advise me how to fix this issue so that a circle will show up properly.

By default blender doesn't fill the circle. There are two types of fillings for circle. You can do it either manually or select it from the pop-up menu that appears when you add in the circle. The two types of filling are:-
1. Ngon-
In this type of filling it'll just add in a single face.
You can manually make it by switching to Edit Mode, select all vertices and press F or select it as shown in the image: The disadvantage of ngon filling is that you wont be able to add in loopcuts .

2. Triangle Fan
In this filling, there is a center vertex which is connected with all other outer vertices.
In this type of filling you can easily add in circular loopcuts to add more geometry if needed.
You can manually model it by selecting all vertices in edit mode with A fill it usually with  F and navigate to Face > Poke Faces OR select it from the pop-up menu.

Selecting between this two fillings depend on when and where you use it.


How to get rotation of constrained object? So let's imagine I have a gun pointing at a target. Gun has copy location constraint to locate to another object that rotates around the same axis as the gun. Gun has track to constraint to keep it pointing towards the target (just up/down movement, rotation around its y axis which is x axis in world space). On it's 0-position there is an initial angle of about 10 degrees of up (measured by hand).
How do you actually get the gun rotation so I can set its allowed range to -55 to +55 deg? How do I even get the gun rotation value at all? The gun object rotation in the n.menu transform panel is 0 and never changes no matter how I move the target. I've tried using limit rotation constraint but it is totally broken and just set's the object rotation to its max value
Here is a sample file:
http://www.mediafire.com/file/c4x62lx6kmil7nu/constraints.zip/file
The rotation of the rectangle object causes the "gun" to go outside of its rotation limits. The cylinder should point towards the target as long as its angle is inside its local rotation limits. These rotation limits come from the rectangle object.
In other words the angle limit is for the angle between the rectangle and the cylinder. Cylinder moves with the rectangle (rectangle just rotates) and cylinder points at the target as long as its angles are inside its limits.

The file you've linked works as it is supposed to work, you've given a Limit Rotation on the X axis of -30° and 30°, as seen below. 0° on the X axis is a flat axis (in Global axis but also in cylinder's Local axis if you ever switch to it).

If you want the gun to follow the angle you're displaying you need to choose Min -60° and Max 0°.

If you want the angle to be relative to the rectangle rotations, don't use a Copy Location for your cylinder, parent it to the rectangle so that it's new Global orientations depends on the rectangle, not on the world. Also don't forget to limit on Z so that it doesn't flip.


What are adaptive units in Blender 2.8? What does it do differently than centimeters, meters, inches, micrometers, etc.?

Adaptive units will be displayed as different units depending on the size of the values automatically. For example if you enter 1000m to any length input field, the value will be shown as 1 km, however smaller values will be shown as smaller units like meters or centimeters and so on:

This is exactly the same behavior as in previous versions.

The new functionality in Blender 2.80 is that units can be set to one specific fixed unit and then all values will be shown as that specific unit so for example even if you enter 1km to some length input field it will show as 100000cm if you have the units set to cm:


Import 3D model from CityEngine into Blender and edit UV Map I really would like to learn about UV mapping and I presume this is the best community for me to ask about Blender. I have a 3D building model produced from CityEngine and when it was exported into collada (.dae file) -or even .obj file- all its textures are stored in one folder. I mean, there are alot of images stored. I was searching for a means to merge these images into one image file and I have this UV mapping researched. I would like to ask how would I do that in blender. Can somebody help me edit my model and have the UV mapping in blender? I don't know where to start, I have importd my model into blender yet none of the textures were displayed. it's all white. I really appreciate help from you nad God bless.

To UV Unwrap your model, Go to Edit mode of your object and select all the mesh, then press U on your keyboard to open UV Mapping options and select smart UV project,

after change your window mode to UV mapping,

and finally open the texture you want to give to your object in the bottom bar,

once you opened you can scale and move your UV map untill it matches your texture how you want it.To scale press S key, to move press G key


Is there a way to quick toggle cameras? Let's say I have 4 cameras on a scene:

I would like to render with the first camera, see what it looks like, then switch to the "next" camera quickly and see what that render looks like.

Currently, to switch cameras I have to click on a camera and set it as active and finally I can render (I don't have a number pad so I have to go to the menu and set it each time; else I'd use Ctrl+0). What I would like to know is whether there is a way to switch cameras and set it as active all in one step?

EDIT:
I'm not asking how to set a camera as active, that's doable via menu, what I'm asking for is a guide for a "quick toggle" between cameras; a quick way to switch active cameras without an animation.

It's possible with a little addon:

bl_info = {
    "name": "Cycle Cameras",
    "author": "CoDEmanX",
    "version": (1, 0),
    "blender": (2, 65, 0),
    "location": "View3D > Ctrl + Shift + Left/Right Arrow",
    "description": "Switch scene camera to next or previous camera object",
    "warning": "",
    "wiki_url": "",
    "category": "3D View"}

import bpy

class VIEW3D_OT_cycle_cameras(bpy.types.Operator):
    """Cycle through available cameras"""
    bl_idname = "view3d.cycle_cameras"
    bl_label = "Cycle Cameras"
    bl_options = {'REGISTER', 'UNDO'}

    direction = bpy.props.EnumProperty(
        name="Direction",
        items=(
            ('FORWARD', "Forward", "Next camera (alphabetically)"),
            ('BACKWARD', "Backward", "Previous camera (alphabetically)"),
        ),
        default='FORWARD'
    )

    def execute(self, context):
        scene = context.scene
        cam_objects = [ob for ob in bpy.data.objects if ob.type == 'CAMERA']

        if len(cam_objects) == 0:
            return {'CANCELLED'}

        try:
            idx = cam_objects.index(scene.camera)
            new_idx = (idx + 1 if self.direction == 'FORWARD' else idx - 1) % len(cam_objects)
        except ValueError:
            new_idx = 0

        context.scene.camera = cam_objects[new_idx]
        return {'FINISHED'}

addon_keymaps = []

def register():
    bpy.utils.register_module(__name__)

    wm = bpy.context.window_manager
    kc = wm.keyconfigs.addon
    if kc:
        km = wm.keyconfigs.addon.keymaps.new(name='3D View', space_type='VIEW_3D')
        kmi = km.keymap_items.new(VIEW3D_OT_cycle_cameras.bl_idname, 'RIGHT_ARROW', 'PRESS', ctrl=True, shift=True)
        kmi.properties.direction = 'FORWARD'
        addon_keymaps.append((km, kmi))
        kmi = km.keymap_items.new(VIEW3D_OT_cycle_cameras.bl_idname, 'LEFT_ARROW', 'PRESS', ctrl=True, shift=True)
        kmi.properties.direction = 'BACKWARD'
        addon_keymaps.append((km, kmi))

def unregister():
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()
    bpy.utils.unregister_module(__name__)

if __name__ == "__main__":
    register()

An operator to cycle through available camera objects is bound to CtrlShiftLeft Arrow to go to (alphabetically) previous camera and CtrlShiftRight Arrow to go to next camera.


"wire_mat_gui" add-on, how to render wireframe with visible edges only? I'm trying to render a wireframe combined with solid using this addon, but for some reason it shows some edges that should be hidden. I made some research but couldn't find anything as I don't know what to look for exactly. I assume it has something to do with the clipping values, but experimenting with them doesn't seem to change anything, it even happens on a new scene.

Any thoughts?

I wasn't able to produce a satisfactory render using that addon. I'm not sure if it's a bug in how the script was written, or if it's a bug in Blender, but I noticed that the extra edges show up when you move around in the viewport. If you access the material settings, and modify some of the values of the material, the extra lines disppear until you move in the viewport again.

That being said, rendering a mesh with its wireframe can be accomplished using Blender's built-in modifiers. Start with the default scene, and subdivide the mesh a few times:

Next, tab back into object mode, and scroll to the "Modifiers" tab. Click "Add Modifier" and choose "Wireframe":

When you do this, the mesh will change to show only the wireframe. However, you want to have the original mesh and the wireframe, so uncheck "Replace Original" in the modifier panel:

Next, scroll to the "Materials" tab, and add a new material to your object. This material is going to be the material for the wireframe. So now, you should have two materials, the default material, and the material you just added. Change the new material to whatever you want, in this case, I've created a red material:

Finally, scroll back to the "Modifiers" panel, and increase the "Material Offset" to "1". An offset of 1 will mean that the wireframe uses the second material from the material tab. So, if you had a bunch of other materials applied to your object, and the material you wanted to use for the wireframe was the 10th material in your list of materials, you would set "Material Offset" to "9". Now if you render, the wireframe will be rendered using the new material you created, and the cube will be rendered using the default material:

Does that help at all?


How to invert f curves? So I am currently making an audio visualiser and I want it so that when a specific frequency hits the object will be black. Currently, whenever a specific frequency hits it is white. This means I have to invert the f curves. Is there a way to do this?

An alternative to inverting the curve is inverting how the curve affects the material. The curve will remain the same but the resulting colors will be inverted.

Create a value node and create a keyframe for it. Bake the sound curve to it.

After that you can invert the values with an invert node.


Can i create multiple materials for single face Can I create multiple materials for a single face of the thing like circle?

Creating some pattern like square or other circle boxes on the circle to apply different materials on them.

Or can we create  a simple circle with sub meshes (if that's the right with terminology), in a similar way as said for creating a pattern of boxes(square/circles) so that these squares or circles are different meshes so that they can be colored or textured differently?

Complete noob at model making, first question.
Thank you.

While you can't directly apply multiple materials to a single face, you can use a texture map to control how two different materials appear on a face.

Blender Render:

Make sure your object has a material.

Click the Use Nodes button.

Drag out a new panel.

Change the panel to the Node Editor.

Add a MixRGB node...

...and plug it in like so.

Duplicate the Material node and plug it in to the MixRGB node. Make sure to assign both nodes their own materials.

Customise both materials to your liking. Notice that dragging the MixRGB slider left or right changes which Material node the final material uses. 0 corresponds to the top node, and 1 corresponds to the bottom node.

Create a new texture in the data textures list.

Customise the texture to your liking, or import a UV map for more control.

Add a Texture node from Add --> Inputs --> Texture, and plug in the Value output into the MixRGB node. Notice that the black parts of the texture correspond to the top Material (value 0) and the white parts correspond to the bottom node (value 1).

Voilà! Rendering an image shows that it mixes the materials regardless of the faces!

The same concept can be applied to Cycles; just replace the Material nodes with a shader node tree each.


Rendering Colored Texture, but the result is a gray texture I am making an object and look like this

But when i rendered the image, it turns out like this

This is my render properties

This is the material properties

I just want to render the image like the 3d view, can anyone help me please?
I am new at this, and only follow tutorial from youtube.

You need to add some light to the scene: https://youtu.be/FdbnzfjoOJU ; your render is just a dark room right now.
If you specifically need the same image as in the viewport, you to go to View > Viewport Render Image


Replace objects with a group of objects using Python I know how to add an object from another layer into main scene, but how can I do it for a group of objects:
Here's my blend file
https://www.dropbox.com/s/41o9arxmbohsva7/temp.blend?dl=0

What I am trying to do is that as soon as the cubes collide (controls are UP/DOWN/LEFT/RIGHT), I want the original cube to be removed(which already works) and replaced with the group of objects from layer 2 (brokenCube).
The brokenCube is created using cell fracture.

To sum it up, I need to replace Object cube with group brokenCube on collision with player object

EDIT: Here's the new blend where I was trying to implement the idea. It's slightly complicated, but the building should break when the dragon hits it. (Which it will, just don't press any keyboard buttons)

The endObject() seems to be working, but the added object's does not show up at the correct location and defaults to the player_location. (instead of using the collision calling object)

https://www.dropbox.com/s/2guepbfyq6h4tsm/dragon.blend?dl=0

If you create an empty, and set it to represent an instance of the brokenCube group (Properties panel -> Object -> Duplication -> Group), you can then simply add that empty, to add all the objects in the group.

Demo: break_demo.blend

PS: Cell fracture seems to create areas with a very large number of very small parts. I would recommend that you remove most of them (as I did in the demo), if you want to have good performance.


Getting Blender to export .ply files with vertex colors I'm trying to get Blender to export .ply files with vertex colors and triangular faces.

First, I assign my model a material, and change its diffuse color. Then, in edit mode, with my whole model selected, I press Ctrl+T to triangulate the faces. Then, I go to Export > Stanford (.ply), and making sure include vertex colors is selected, I export it.

However, when I look at the file, it has no color data, and the faces are not triangles (The faces consist of a seemingly random number of indices each).

Am I doing anything wrong? I've tried searching quite a bit but can't seem to find anything. Thanks

A few things here:

The diffuse color you assigned isn't part of the Vertex Color content, they are distinct from eachother. If you want to give a single colour to all faces, then go to Vertex Paint mode and masking mode, select all faces, then pick a colour from the colour-wheel and press Shift + K . That will set the vertex colour for all faces. and Save.

For triangulation, you might have to make a duplicate of your model and triangulate, then press save, then export. Else I think the exporter will export the mesh's data from the most recent saved state (that wasn't triangulated yet).


Append function in menu is greyed. What can I do to fix it? I'm trying to add an object from a previous project, but in the File menu bar the append option appears greyed out.
If I press Shift + F1, I can browse between the folder of my PC, but when I click on the file or press Enter that I need nothing happens.

The problem was that I was in Edit Mode where append can't be used ,so you need to switch to the Object Mode and it's done


How Do I Mirror Knife Tool? In blender cycles I am trying to mirror the knife tool but it won't work. I have tried mirroring the knife tool using the mirror modifier and using mesh options as well to mirror.

hope you are working on the mesh which is already mirrored so after applying knife it eidt mode it should mirrored.


Fluid is "too heavy"/doesn't splash I'm trying to reproduce CG Geek's tutorial creating a wine glass and fluid: https://www.youtube.com/watch?v=9bZkivGauxY. While I created the wineglass on my own, I just wanted to focus on the fluid simulation, but Blender 2.9 got that Mantaflow thingy, whilst he was still baking the fluid with the old version.
My problem is that I simply can't make the water splash out of the glass. It just keeps wobbling but that's it. Does someone have an idea how to create that nice splashing effect in Mantaflow and tell me what I'm doing wrong?
Thank you in advance. Here is the link to the Blend file: https://blend-exchange.com/b/sjr35Djb
https://imgur.com/a/7VMr4LY

I have found the solution to your problem that is pretty simple (but unfortunately can be time consuming)  Luckily it doesn't require much work on your part, that's what computers are for.
Anyways, to solve your problem and make your fluid splash upwards like you want, you have to increase your resolution divisions in the fluid domain settings by a bunch  (see image below)

Doing this gives the fluid much more geometry to work with, and enabling it to behave much more like a real liquid.
Here is an example render that I made, using 212 resolution divisions:

As you can see, it looks much closer to your desired effect, it's not perfect, but it's pretty good looking in my opinion.
Now, the downside to doing this is that the more resolution divisions you add, the more time it will take to bake, however, if you just want a still image for your final output, I would only bake the first 50 frames and then find out which one works best for you.  The image above was taken on frame 20, so it didn't take long for me.
Lastly, for some optional settings, if you want your liquid to splash up more, you can play with the gravity Z axis settings in the fluid domain settings. (see image below)

It is automatically set to 9.8, (which is about what earth's gravity is)  if you make the number higher, things start to get a bit more light and floaty.  the render above uses a gravity of -6 on the Z axis.
In conclusion, more resolution divisions on your fluid equals more realistic behavior, I hope this helps you!


How to treat video material with non-square pixels I want to edit video material from a PAL DVD, i.e. 720x576 pixels with a pixel aspect ratio of 1.09...

The final cut is supposed to be rendered to a video file. Therefore I am wondering whether it makes sense to use the "TV PAL 4:3" preset in the project properties, which accounts for the pixel aspect ratio, or whether I should use square pixels and just calculate the corresponding resolution of the output video.

The second one seems safer to "misinterpretation" of the video material by any players. But are there any concerns regarding the quality of the output?

I misinterpreted your question, and I thought you were going to create a DVD. My bad, I didn't read thoroughly.

For simply re-encoding a DVD to a video file, such as an MP4 or an AVI, I wouldn't use Blender at all. Exactly what to use, depends on your OS. If you just need to re-encode, with minor or no filtering, I'd suggest Avidemux, which is available for multiple operating systems and has an easy to understand GUI. If you're comfortable with command line tools, there's always FFmpeg. Both Blender and Avidemux use FFmpeg as a backend to encode video, but neither of them has support for everything FFmpeg can do; most notably not all combinations of codecs and container formats are available.

For the scaling part, I'd say do as little scaling as possible. Especially avoid upscaling. If you use a container format that has native support for aspect ratio settings, you shouldn't have to do any scaling at all. MP4 and MKV are the safest bet, as they have aspect ratio support, and AVI can be made to support it with some trickery, but not all players will understand it. FFmpeg and mencoder can write AVI files with aspect ratio settings.


Render displays solid view objects I am running Blender 2.91.2 on Ubuntu 20.10 'Groovy' using Cycles with graphics card GTX 1070 (driver version 460.32.03, CUDA Version 11.2)
The top Viewport image (in the Animation tab) is meant to be the Material view but reflections have been rendered, the second image is under the Rendered view which displays only Solid properties.  I have not used Blender for years but it seems that selecting 'Rendered' shows 'Solid', and selecting 'Material Preview' shows 'Rendered', and selecting 'Solid' shows 'Material Preview'.
The viewports are not as important as the actual render, which I run from the command-line after closing blender.
$ blender --background 333puzzleArray-6-short4render.blend -a produces an animated solid view, uploaded to https://youtu.be/NPvrTFzeML8

What is happening is that material shading, by default, uses a pre-supplied HDRi image as the world (that is why you see some trees and blue skies reflected on the glossy surfaces).
Rendered shading uses the actual settings for the scene, by default just a flat color.
You can set material view to use the actual scene lights and world.

Or you can set an HDRi to be used as environment texture on the world and that would be used for rendered view and to render the scene as well.


Can you work with homogeneous coordinates in the Python API? If I do this (excuse the transpose, I'm used to looking at matrices the other way round):

import bpy
from  mathutils import Matrix
ob =  bpy.context.object

m = Matrix( ([1, 0, 0, 0],
             [0, 1, 0, 0],
             [0, 0, 1, 0],
             [0, 0, 1, 0] )  )

m.transpose()

for vert in ob.data.vertices:
    vert.co = m @ vert.co

I get a translation of the mesh by 1 in object-Z. Good. So somewhere, vert.co must be understood to be (x,y,z,w=1), otherwise the translation wouldn't be picked up.

However, if I do this:

import bpy
from  mathutils import Matrix
ob =  bpy.context.object

m = Matrix( ([1, 0, 0, 0],
             [0, 1, 0, 0],
             [0, 0, 1, 1],
             [0, 0, 0, 0] )  )

m.transpose()

for vert in ob.data.vertices:
    vert.co = m @ vert.co

.. I'm hoping for a basic perspective transform, in which the w of every coordinate is set to its z, and then, in normalization, the whole coordinate is divided through by its w before using its x,y,z. But, OK, nothing happens.

Is there any way of getting at the implicit 'w' of the homogeneous vector, or do I have to divide it by hand?

Is there a way using matrix multiplication like this to make projections in the API?

It could be my Blender, it could be my math. I don't know....

Make the vert.co 4d

  From Perspective projection of transformation matrix
  wiki

  The simplest perspective projection uses the origin as the center of
  projection, and the plane at ${\displaystyle z=1}$  as the image
  plane. The functional form of this transformation is then
  ${\displaystyle x'=x/z}$ ; ${\displaystyle y'=y/z}$. We can express
  this in homogeneous coordinates as:

  $\begin{pmatrix}x_c\\ y_c \\ z_c \\ w_c\end{pmatrix} = \begin{pmatrix}1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 1 & 0\end{pmatrix} \begin{pmatrix}x\\ y \\ z \\ w=1\end{pmatrix}$

  $\begin{pmatrix}x'\\ y' \\ z' \\ 1\end{pmatrix} = 1 / w_c \begin{pmatrix}x_c\\ y_c \\ z_c \\ w_c\end{pmatrix}$

To emulate above would map the vert co to 4d using w of the result

  Is there any way of getting at the implicit 'w' of the homogeneous
  vector, or do I have to divide it by hand?

yeah suppose I've done that.

import bpy
from  mathutils import Matrix
from math import radians
ob =  bpy.context.object

m = Matrix( ([1, 0, 0, 0],
             [0, 1, 0, 0],
             [0, 0, 1, 1],
             [0, 0, 0, 0] )  )

m.transpose()

R = Matrix.Rotation(radians(30), 4, 'X')
#m = R @ m
for vert in ob.data.vertices:
    v = m @ vert.co.to_4d() # sets vert.co.w to 1

    '''
    # vert.co.w is set to vert.co.z
    v =  vert.co.to_4d()
    v.w = v.z
    v = m @ v
    '''
    vert.co = 1 / v.w * v.to_3d()

If run on default cube, flattens it to the plane z=1.  However others will fail with zero divide error.

The question is how to handle $\ w_c = 0$

  One property of homogeneous coordinates is that they allow you to have
  points at infinity (infinite length vectors), which is not possible
  with 3D coordinates. Points at infinity occur when W=0. If you try and
  convert a W=0 homogeneous coordinate into a normal W=1 coordinate, it
  results in a bunch of divide-by-zero operations:

  This means that homogeneous coordinates with W=0
  can not be converted into 3D coordinates.
  What use does this have? Well, directional lights can be though of as
  point lights that are infinitely far away. When a point light is
  infinitely far away the rays of light become parallel, and all of the
  light travels in a single direction. This is basically the definition
  of a directional light.

Playing around with meshes using above Not sure how useful the answer is. In first example in question above, worth noting m.translation = (0, 0, 1) whereas in second it is zero.  Converting 3d vector to 4d sets w to 1.  Which I assume is done for us since it doesn't spit the dummy multiplying a 4x4 with a 3x1.


how to paint using stencil mode directly in image editor is it possible to paint directly on the image editor but using texture with stencil mode. My object is a cylinder and if i do stencil paint in 3d viewport, i have to go around the surface and because it's curved the texture got stretched/distorted so i think it would be practical just to do the stencil in image editor where the cylinder has been unwarped evenly. But seems i can't do the stencil in image editor , am i correct?

Yes, you can use the stencil in the Image Editor in 2.8 once you confirm you have usable UVs on your object. Good thing is the Cylinder primitive already comes packaged with basic UV mapping. Just be sure to use the Image Editor to paint and not try the UV Editor since they have been split.


How can I automatically move a robot's body to the correct height based on its leg(s) rotation? When I rotate the leg the body or the luggage bag should come down slowly. Which constraint or any other way will achieve this?
 video
Blend File

You can parent the leg to the body so it moves automatically when the body moves, then with the leg selected, in the Numbers Panel right-click on the X rotation, Copy as New Driver, select the body, right-click on the Z location, Paste Driver. The body will now drop down to Z = 0, because that's the current rotation of the leg (at least in my case). Now you may notice the body moves based on the leg's rotation, but not yet correctly:

To properly convert the angle to a vertical offset caused by it, trigonometry has to be used:

In my example the length of the leg is not exactly 1, so I need to multiply that length (2) by the cosine, and the formula, in my case, becomes: 2 * cos(rotation_euler).
With the body selected, right-click on the Z location again, and choose Edit Driver. Change its type from Average Value to Scripted Expression, and update the formula to correctly base the body's height on the leg's rotation:

Effect:

There's some additional problems to be dealt with:

position of the leg lags 1 frame behind, because while it's based (due to parenting) on the cube, the cube is also based on it (due to the driver); the solution is to clear the parenting and copy-paste the driver from the cube's position also to the leg's position;
the formula assumes the leg has 0 thickness; the simplest solution is to put a sphere on the bottom of it and add an additional offset in the formula equal to the radius of the the sphere;
the body can fall through the floor; the solution is to either use a constraint (and because the leg is not parented that means another constraint for it as well), or use max() in the driver to clamp the minimum value, like so: max(1, 2 * cos(rotation_euler))


How would I wrap a texture around a cylinder without it looking off? Im making a chrome exhaust muffler for a racing game but when I try to texture it, i get this ugly line going down the center and when I look at the uv map it seems that one side of the texture is jumping to the other side of the surface, if that makes sense so it looks very off. How would I fix this?

This is because your texture is not "seamless" mainly due to the reflective shine in the middle:

You need a seamless texture and then bake the shine on it if you need it on the texture.
Something like these: https://naldzgraphics.net/free-seamless-metal-textures/
But since you said it was for a game, you'd have to make sure the textures are allowed for use in games and not just personal use.
Alternatively, you could look into "Procedurally Generated Textures" there are lots of tutorials on it. This is a great way to generate seamless textures without the worry of copyright.


Export image as Scalable Vector Graphic Hello,
Does anyone know if there is a way to export grease pencil drawing as pdf or
some other non pixel format?

In blender render,

Goto>render settings

Tick>Freestyle

Then Tick>Freestyle SVG Export

Go back to>output
Choose a file to place your rendered work

Then hit>Render

Your SVG is ready at the specified output location

Additionally,
To prevent some object from rendering as SVG,
On the material tab, just click on Transparency


Is it possible to dock the annotation layers window? I was hoping that it's possible to dock the layers menu somehow. I use the annotate tool quite a lot; drawing where I'm going to place vertices and then build as I'm going.
I use layers for this, different colours for different parts. It's quite frustrating that accessing the layers window requires being in the annotate tool though, rather than being able to switch different layers on and off while modelling.
Anyone know a workaround? Thanks.

The Annotation layers can also be found in the View Panel in the Right hand side panels. (Toggle with N)
You don't need to be using the Annotate tool to access it.
To keep it in place, right click on the sub-panel header and choose Pin. You can also use SHIFT + Left Mouse. Notice the Pin icon in the top right.
Click and drag the 8 dots in the top right of the sub-panel to rearrange it on top of all the others. That way it's always on top of whatever Panel you are in.


Using Vector Curves Nodes for transitions I am trying to use a Vector Curves node to describe a abrupt transition based on a value. In the following figure, I have setup a test case where I am trying to make the material transition from blue to red at .8 to .81 . However the transition happens at .62 to .63 (see Combine XYZ). It appears that the mapping is aprox .2 ahead of its expected value (see the Greater Than node). Does anyone have any advice on what I am doing wrong?

Note material is just an example to illustrate a more general problem I am having. I realize there are other methods of building the transition, but I like the idea of using a curve to describe the mapping.
Thanks!

To achieve an abrubt transition, you only need the Greater Then Node.

It seems that Vector Curves Node had some problem with too close points.
Everything works well when points are more distant.


Export to wavefront always gives white for ambient ka I'm using 2.76b on ubuntu. When I export to a wave front object, it will always set the material's ambiance (ka) as white. I've changed the World ambient color to multiple different colors, and it always exports as white.

Steps I use:

Create new blender file w/ default cube
Click on World tab in properties.
Expand World subsection
Set Ambient to pink or something
File -> Export -> WaveFront

When I go to open up the .mtl file, it will still show as all 1's for the ka component for any material.

Okay, it appears that the export script just applies the ambient property in the shading sub section, which is a single value between 1 and zero that's just a multiplier for how much the global ambience the material receives.  It puts the single value as the component for each of the RGB values for ka upon export.


Why blender splits my imported model in pieces? I created a model in Sketch-Up (Sketch-Up detects it as a solid, a closed hull, where all faces can be seen from outside).
Then i exported it as Collada  .dae.
But Blender splits 5 faces off and converts them into separate objects, each one out of two faces, one face lies flat on the other one.

This is the link to the original-sketchup-object

This is the model in Blender. Main part moved to set the separated objects :

Why does this happen?

Well its pretty unusual workflow, so dont aspect everything to work.
however maybe blender can save your day
make sure to join all loose objects  (border select on screen and join them).

Next in edit mode try verticles remove doubles.. if your lucky itss all connected afterwards
next recalculate normals.


How to create a trace outline animation of an object I have a blender product animation, and I'd like to show animated tracing of the outline of an object, like this:
In the past I've seen this kinda stuff done in after effects. Can Blender 2.9 do this?

General idea is to use Build modifier on Curve object.

If you have a model already, you can ...

Separate Ctrl+P a few loops into a new object
Convert to Curve
and Add Build modifier

Notes:

If you want to let all curve elements be animated at the same time you have to split them into separate objects.
Usually it is better to Separate mesh loops as lowpoly without Subdivision modifier, Convert to Curve, switch curve type to Bezier with Handles > Automatic and manually adjust few end handles, so you have better control over additional curve shape adjustment. But like in this case it was easier to apply Subsurf modifier on separated mesh before Convert to Curve.
if you need more smooth animation increase curve resolution under Curve Properties

Based on TheGreens model.


Custom pie menu: shift in my hotkeys toggles multiselection mode between vertex edge and faces, how to toggle off previous mode? I work as a professional Alias modeler for the automotive industry, i love Blender but after 8 hours using the same program it always take me some time to switch habits and enjoy modeling on blender.

i'm trying to step into Python to address this issue and the first thing i would like to make is a Pie Menu with similar characteristics.

Alias provide 3 pie menu, 1 for each button of the mouse and the hotkey start with SHIFT + CTRL

Anyway, i've started with a basic pie menu for vertex edge face selection that work with SHFT+CTRL+LMB the problem is when switching between selection modes it keeps the previous mode still on.

Example: Pie menu -> vertex = vertex selection active -> Pie menu -> edge = edge selection active and previous vertex selection still active.

i need a code that toggles the selection mode everytime i choose and keep a single selection mode, any help please?

import bpy
from bpy.types import Menu

# spawn an edit mode selection pie (run while object is in edit mode to get a valid output)

class VIEW3D_MT_PIE_template(Menu):
    # label is displayed at the center of the pie menu.
    bl_label = "Select Mode"

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

        pie = layout.menu_pie()
        # operator_enum will just spread all available options
        # for the type enum of the operator on the pie
        pie.operator_enum("mesh.select_mode", "type")

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

    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name="Mesh")
    kmi= km.keymap_items.new("wm.call_menu_pie", "LEFTMOUSE", "PRESS", shift=True, ctrl=True).properties.name="mesh.mypie"

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

if __name__ == "__main__":
    register()

    bpy.ops.wm.call_menu_pie(name="VIEW3D_MT_PIE_template")

import bpy
from bpy.types import Menu

class VIEW3D_MT_PIE_select_mode(Menu):
    bl_label = "Select Mode"

    def draw(self, context):
        layout = self.layout
        pie = layout.menu_pie()
        o = pie.operator("mesh.select_mode", text="Vertex", icon='VERTEXSEL')
        o.type = 'VERT'
        o.use_extend=False
        o.use_expand=False
        o.action='ENABLE'
        o = pie.operator("mesh.select_mode", text="Edge", icon='EDGESEL')
        o.type = 'EDGE'
        o.use_extend=False
        o.use_expand=False
        o.action='ENABLE'
        o = pie.operator("mesh.select_mode", text="Face", icon='FACESEL')
        o.type = 'FACE'
        o.use_extend=False
        o.use_expand=False
        o.action='ENABLE'
        o = pie.operator("mesh.select_all", text="Select All/None", icon='RESTRICT_SELECT_OFF')
        o.action = 'TOGGLE'

addon_keymaps = []

def registerKeymaps():
    wm = bpy.context.window_manager
    if wm.keyconfigs.addon:
        km = wm.keyconfigs.addon.keymaps.new(name='3D View', space_type='VIEW_3D')
        kmi = km.keymap_items.new('wm.call_menu_pie', 'LEFTMOUSE', 'CLICK_DRAG', shift=True, alt=False,ctrl=False)
        kmi.properties.name="VIEW3D_MT_PIE_select_mode"
        addon_keymaps.append((km, kmi))

def unregisterKeymaps():
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()

def register():
    bpy.utils.register_class(VIEW3D_MT_PIE_select_mode)
    registerKeymaps()

def unregister():
    unregisterKeymaps()
    bpy.utils.unregister_class(VIEW3D_MT_PIE_select_mode)

if __name__ == "__main__":
    register()

    #bpy.ops.wm.call_menu_pie(name="VIEW3D_MT_PIE_select_mode")

This would work. But I strongly recommend not to use this since it will mess things up a lot. Shift + Left Click is used a lot in the keymap and it's not a good idea to replace it. It will make things inconsistent and I think you will likely regret it later if you get used to it doing something else in the viewport. Keys 1, 2 and 3 for mode selection are not that difficult to get used to, you should just suffer for a few days and get over it.


Spiral vertices animations How do I animate vertices of a spiral? I can animate location and rotation of the object, but not the movement of individual vertices.

I figured it out!. I had to enable the "AnimAll" Add-on in the user preferences. Then I clicked insert for each vertex I wanted to animate.


Why i cant rotate on axis with 3d cursor Im rotating on x axis. Pivot point and 3d cursor set. Rotation and scale are at 0 and 1. Yet the mesh cant rotate on x axis. I tried to apply rotation scale but it rotate some different angle.

You have "delta transforms":

Set these rotations to zero to fix the issue.


why boolean not working with other modifier I have just a normal mesh and added 2 mirror modifier and 1 solidify modifier and with the boolean modifier its not getting difference. May i know the reason why its not cutting the hole. I check the doubles, normals yet to its not working. Any suggestion or help. Thanks

You have fill "Only Rim" enabled.  This fails to draw anything but the rim.  In other words you're trying to Boolean Difference a single plane.  Difference is calculated based on normals.
See: https://docs.blender.org/manual/en/dev/modeling/modifiers/generate/solidify.html


How to retrieve the groups of an object? How to get all of the groups an object is assigned to in Blender Python?

for obj in bpy.data.objects: # All objects
    # TODO: Retrieve the groups of obj.

Found it myself: Use obj.users_group, e.g.

for obj in bpy.data.objects: # All objects
    for group in obj.users_group: # All groups
        # Do something, e.g. use group.name to find specific groups.


How to properly set domain for fluid simulation? I am trying to create a domain for fluid simulation in blender. But as soon as I apply the domain physics on the (cube) object, it transforms into some fluid like mesh. If I press play, it seems as if the fluid simulation was applied onto the domain cube instead of the circle on which I applied inflow. The shell obstacle works correctly.

This is the blend file.

I am not sure I understand your exact question, so let me rephrase it in my answer to be sure we are talking about the same thing.

If your problem is that it is the domain itself which 'turns into' fluid when playing/applying the simulation, then it's normal.
From what I know looking at the inner workings of another fluid simulation algorithm, The way the fluid is simulated is by creating a grid (65*65*65, in your case), and each cell of this grid 'knows' if it contains fluid, the speed and pressure of said fluid, and sometimes its density, or 'how much' there is.
The goal of the other (blender) objects is to act in a certain way at every frame. Roughly speaking, an inflow 'fills' some cells with fluid with a given speed at each frame, while an obstacle makes sure there is no fluid inside itself, and tweaks the speed of the fluid around itself so it doesn't go inside.
However, from your screenshots, the fluid doesn't seem to be created in the right place. This also happened when I tried to run this simulation, but differently.
After messing around a little, I found out that (at least in this file), an inflow with the "volume" setting needs to have the "Export Animated Mesh" option too to behave correctly.

A similar caveat I found years ago (but might not exist anymore) is that an inflow object half-inside half-outside the domain might cause the simulation to ask for an unreasonable amount of ram (untill the PC I used was unusable, in my case)


how to create a selection group in edit mode? it is pretty annoying to work with different meshes as the same object.

Is there any way I can define a specific numbers of vertex/edges/faces to a group so I could just click that group to all?

I hope I was clear

thanks

Yes, you can define vertex groups per object:

In Edit Mode move to Properties Editor > Data > Vertex Groups
Hit the + sign to create a new vertex group (and rename it to something useful)
Make a selection and Assign the desired vertices to that group

Now by using Select the vertices will automatically selected in the 3d viewport.


How to add a new UV map to all selected objects? I would like to select multiple objects and add a custom UV set to all of them.
My version works for one selected object only but not for multiple selected objects.

import bpy

# Get all selected objects
selected_objects = bpy.context.selected_objects

for obj in selected_objects:
    # Add new UV set
    bpy.ops.mesh.uv_texture_add()
    # Set new UV set name for active UV set
    bpy.context.object.data.uv_layers.active.name = "UV_ao"

What's wrong with my code?

You can get rid of the uv_texture_add() operator by adding a new UVLoopLayer:

import bpy

for obj in bpy.context.selected_objects:
    # Make sure this is a mesh object and that it doesn't already use this UV Map
    if obj.type == 'MESH' and "UV_ao" not in obj.data.uv_layers:
        obj.data.uv_layers.new(name="UV_ao")


How do you pan the nodes viewer? What's the hotkeys to pan the node viewer on Linux, it's not listed in the settings or the docs?
Tried every combination of Alt, Shift, Contrl and Left or Right mouse button in the nodes panel.

There is an option to emulate the middle mouse button, you can enable it from the settings in the Input pane.
After enabling the middle mouse button emulation, you should be able to use Alt+Shift along with the left mouse button for panning the view.
See here for mir information.


How to make a 2D ragdoll I can't find a solution to my problem anywhere on the web.
Maybe I don't know how to search for it.
I have this 2D character that is set up the same way that
those cardboard cutout puppets with pins for joints are.
The idea is to give it a ragdoll behaviour from the neck down, its head being the only thing animated.
I need this character to be on a 2D plane while in a 3D environment, its head floating around, always facing the camera with its limp body following the movement.
I cannot find a way to combine those tutorials I found about ragdoll physics, 2D physics, bone constraints, armature affected by gravity and make it work.
I guess it's a fairly simple issue to solve but it's become clear that I cannot do it on my own.
Thank you for your future help.
EDIT :
Following the comment of moonboots, I did this simple animation on Moho to show you what I mean.
EDIT II :
Following the comment of Rich Sedman, I used hinge rigid body constraints witch works pretty great. The only issue left is rotation constraints for the body parts so I can avoid things like the elbows bending the wrong way.

EDIT III :
I've solved the rotation constraints issue, I think. I use the angular limits of the Z Angle of each hinge point. I wish there were a way to display those limits in the viewport so it wouldn't be so tedious to adjust.
But another issue showed up. I can't find the good way of moving the puppet around.

I tried to parent all puppet parts and hinges to an empty but only the latter move with the empty
I tried parenting the parts of the puppet between them (shoe to calf, calf to thigh…) but the all thing goes haywire
I tried parenting each part to the corresponding hinges but it doesn't work either and the articulation points are displaced

I understand that the hinge points are supposed to stay where they are at frame 0 while still affecting the puppet, wherever it is but it seems to upset my understanding of how to, ultimately, parent the whole puppet body to my already floating around head.

For this kind of work there is amaizing addon COA Tools addon for 2D cutout animation. I just dont see it for 2.8x, but it is still very productive to download blender 2.79 and do it in this version. Tool itself easily creates armature and with simple click you can assign sheets to bones. After riging its easy to open (or Append) in 2.8x project. Just dont forget to convert Blender Internal materials into Cycles (nodes).
Package includes also very helpful script for exporting layers with their positions from Photoshop or Gimp.
To get animation like in your example you can try to use Spring Bones addon.

To get properly rendered animation you have to bake bones animation- search for Bake Action with Visual Keying enabled.


How to model a tessilated hyperbolic dodecahedron? I'm trying to model the Mathematica Spikey (pictured below) for a gift. So far, I have a rhombic hexecontahedron ('rhex') (link is here), as shown below:

Is there a way I can bend the edges of the rhex inward to get the image below? I would like to keep the "spikey" aspect of it. Is there an existing tool to do this? (Pardon my explanation/English)

Thanks!

You can try to use the Subdivision Surface modifier with a high edge crease on the sharp edges to achieve this effect. This will probably not be the mathematically correct surface, but it will give a good visual result.

To make it work, first you have to make sure your Rhex is one single mesh, consisting only of the shell of the volume and make sure there are no double vertices in the mesh (go into edit mode, select everything, press W and select Remove Doubles).
For testing I modeled the mesh by eye. This is what I started with:

Now you need to give the edges you want to make sharp a high edge crease. Select them and press ShiftE to change their Edge Crease. Press 1 on your keyboard and then Enter to give the edges a Crease of 1.0 whih will make them completely sharp when using the Subdivision Surface later. The edges should turn pink:

Tip for easy selection: If you are in edge selection mode (press CtrlTab and select 'Edge' to get there) you can select one of the sharp edges and press ShiftG to bring up the 'Select Similar' menu, and choosing 'Face Angles'. Now all edges with a similar angle between the connected faces are selected. This should be all your sharp edges.

Now that your mesh is set up, you can add the Subdivision Surface modifier. Go to the Modifier tab in the properties panel, click on 'Add Modifier' and select 'Subdivision Surface' (third from the bottom in the second column). Set the subdivision level to something like 4.

The result should look something like this:

One final note: The modifiers are only changing the visual appearance of the mesh, not the underlying mesh itself. If you want the mesh to be altered, click the 'Apply' button of the modifier. But after that you can not make any changes to the modifier anymore, so keep a copy of your unapplied object.

I have uploaded my version of the rhex here for reference.

Edit: For even better visual results you should enable smooth shading and also add an 'Edge Split' modifier to your model.


Cycles - Baking to Image Completely Different to Material I'm completely stuck.  I've spent so many hours trying to find out what I'm doing wrong, but it's the same outcome each time.

I have created some rocks / mountains in Blender that I plan to use in Unity, however the texture looks completely messed up.

I smart uv unwrapped, and created a material using nodes.  I then baked to an image, saved to disk, and imported into Unity.  The model is exported via FBX.

The first image is the material, and that is how I want it to appear.  The second image is texture render (low samples) in the viewport (I added a brightness node, as I don't know how to light something in Cycles (adding a light source didn't do anything)).

As you can see there are issues at the seams, and the colour ramp is messed up.

Edit:  Changed the Bake Type to just "Diffuse", and that solves it.  (Thanks to pycoder for focusing my attention there).

Change the mode to "Diffuse" in the baking panel then enable only color if you want no lighting:


Video texture on blender cube displayed all over the cube, not separately on each faces while using it in unity i don't really know if it's an unity or blender related issue, but i believe this question belongs here (else i'am sure you'll let me know). Also it may seems newbish and that's quite true, i'am new to blender.

I've created a simple cube and done an UV map for it, then i'am importing it in unity so i can use it in my project.

My problem come when trying to apply an Unity Video texture to it: The display is shared across all the faces, scattering the video trought the cube, but with a default unity generated cube each face are displaying the video separately, like they all are independent (and that's what i would like to achieve with my blender cube, and later on, with a 3D custom object).

My question now is why is that so ? Where does this behavior come from ? Is it unity or blender related ? Am i missing something about UV mapping, advanced features i don't know about ?

Well, as i assume many noobs like me will possibly meet the joys of playing with UVs and so will they struggle with this aswell, here is the proper way to achieve this (as i said, i missed something about UVs):

In order to make sure each face is treated as an unique surface, go to blender, switch into edit mode and repeat this process for each and every single face of your cube/object:

Select your face or the ones wich are part of it
Ctrl + E -> make seam
Press "U" -> Unwrap
If you've done that right, the UV editor should show you only the shape of what you've selected.
Redo for the next face until you've done that for each one of them.

Worked for me, spent hours wondering "How" Hopefully that will help peoples out.


How to set up a face rig I am creating an Optimus Prime, based around the model from the movie,but not exact. I have just run into the problem of setting up a facial rig. I mostly need to know what the best approach would be to creating a rig for his mouth.

Well facial rigs can be hard, it's better to learn simpler rigs first. For the model you're attempting, I would recommend joints, they work quite well. Remember that he is a rigid character so apply bones to mesh parts with "Bone" not any others as it wont distort different sections but rotate like using R on the object.

Blender cookie has great tutorials on facial rigging, especially David Ward's tutorials.


How to align and snap objects? Hi everyone!
I have to create this temple on Blender and I have no idea how to snap objects in this precise way. The biggest problem is how to snap the cubes with the green cylinders and cubes with blue ones in the sides of this temple. It seems they are aligned in the center but I'm not sure.
I hope someone can help me understand how to create this since I'm a very beginner with the software

Thanks!

The two answers you already got for this on your previous question are really the most accurate ways I know to do this. but if you're looking for something simpler then here are a couple more options for you.

You can snap everything to Blenders grid by either turning on the snap function here

or by holding Ctrl as you move your objects.

Move objects along axis by entering a value, eg. if you have a cube that's 2 units long along the X-axis and its origin is in the middle and you want to add another flush along side on the X axis, Duplicate the cube and press G, X, 2 to move it along the X


Blender 2.81 Weight painting bug? Just started using blender 2.81, I didn't see this issue with 2.80. I do weight painting on one vertex group, and it somehow ends up affecting another vertex group.
When I change weights of one bone, it changes another bone's weights. For example for low poly hair, I have bones with weights on, and after doing all the hair bone weights, it completely messes up the main head bone's weights on the hair mesh. What gives? Why is one bone's weight changing another bone's weight?

This behavior is normal for Blender including versions before 2.80.

Weight > 0 belongs to new or selected Vertex Group.

One bone can affect different groups with blending by weight by design.


Why video appears in lower left corner when offset is checked in strip transform parameters? In my case I'm creating a movie with the resolution of 1080x1920 (9x16). I have footage that's 1920x1080 (16x9). My idea was to scale it to fit the dimensions of the movie. I thought I could do it with Transform Effect Strip. But the problem is that I need to enable Image Offset first.

When I checked "Offset", the video took its own aspect ratio. Why did it appear in lower left corner?

After I try to change the offset a little bit (just to see what happens), video seems to move a bit and scale up for no reason.

Next, when i play the result, it is actually showing that scaling was not applied.

From this point I'm already confused. I'm stuck because if I add Transform Effect it is scaling my video with the pivot point located somewhere in the center of the preview area, scaling it like this will send my video far outside of the preview area (it makes it nearly impossible to adjust scale with precision). I expected the pivot point to be in the center of the video.
What are the solutions to this problem?
Is it a bug? I heard people are struggling with similar problems since 2016!

Offset and Crop are working in pretty odd ways: https://developer.blender.org/T74323
The best way to deal with them is to use the Transform Tools add-on(until they're fixed):
https://github.com/doakey3/VSE_Transform_Tools
After installing, you'll find the Transform options in the Toolbar in the left side of the Preview:

(Btw. in order to get Transform Tools working, you'll need to update Blender to 2.83)
In the latest beta of 2.90 the bug you mention may have been fixed.


How to create see-through-walls shader, similar to shaders in games when a character stands behind a wall I'm trying to create a shader, that will dissolve a wall on a certain spot (or any object), when I need it to. Here is an example of what I'm trying to do.
unity shader example
Here is what I created. It works pretty well when I use it on a plane with no depth or a cube. However, when I use it on more complex objects, some walls become visible. Enabling backface culling solves a lot of issues, but it is still not ideal.
How can I improve the shader so it completely erases all walls that are under the influence of the Empty object?

Additionally to what you're doing you need to go to the shader editor, press N, go to options in the material you want this effect in, and find "Options > Settings > Back Face culling" uncheck.


How to create a Life Preserver style texture? A friend of mine is creating a mint object and asked me about how I would approach creating the Life Preserver/Mint style texture.

I've done similar things before with striping using a Wave Texture & a ColorRamp node, looking like this:

To go for the life preserver effect I've used a gradient texture instead. This is the setup I have right now:

I'd really like to use math to control the number of stripes instead of playing with the Color Ramp values directly. In the horizontal stripe setup I was able to control the amount of stripes by using the location of an empty.

If I do need to use points on the ColorRamp, thats fine, but its pretty awkward to divide 1.0 by the amount of stripes I want. (in my case I want 6, so I need 12 points on the graph).

In essence, I want to have a robust way of creating these rings via the node editor and have the rings have be the same size.

Since you don't want to correctly unwrap each new object we need a procedural shader which uses the angle from the objects origin.

That way you can easily displace and distort without worrying about the UV.

First we need an atan2 node to calculate the circular angle as viewed from top.

It is show in the red atan2 box in the node overview. You can also find explanations here. I used the nodes in the first answer. Group them into the atan2 group.

(We'd manage with a simple arctangent node from cycles, but it doesn't hurt to have an atan2 in your library and it's not that complex.)

Use the objects X and Y coordinates as input.

Right now the values and in the range [-pi, pi]. Let's normalize them by adding pi and diving by 2*pi.

After that, multiply by the number of intersections you wish, and add the modulo and greather than to get separations of 0 and 1.

At this point, it would be smart to group the nodes into a rings group. That way, when we make this material a single user to change the colors or the amount of sections all materials will use the same ring group.


Only last text block out put in Animation Nodes loop I have an Animation Nodes loop that takes three text blocks and three text objects and outputs them. The debug is showing the individual texts are intact, but only the last text block is output. What am I doing wrong?

At the moment all three text objects use the same underlaying data block. So when you change one, you are changing all.

There are two main ways to fix it:

Enable Deep Copy in the Object Instancer node.
Turn off Copy from Source and switch the created object type to "Text".


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

Thanks!

Marko.

(Full size image)

the model I done in blender

This can be done within 10 secs. I've seen this tutorial two years ago. I'm sure you can speed up the whole workflow with the new powerful tools developed since then. :) My suggestion for step 1 to 5 on this exercise can be seen below in briefly 3 steps. However, if you just want to focus on the exact question, just jump to Step 3:

P.S.: Since you said you are new to Blender, I tried to reproduce every detailed step, so it may look a bit long, but all operations can be done in a flash if you get it then.


Blender eevee emission shadows So still kinda new to blender, and decided to try out 2.8 because of eevee. But I seem to be doing something wrong. Was trying to figure out why the emission wasn't showing a shadow by itself on the two blocks like in the cycles preview.

when you add emission shader you have to do like this....

i hope this help you.


3D printing "be like the 3D view" I'm a newbie learning to use Blender to produce 3D printable objects, since it is the most flexible software tool on the planet for 3D printing.  However, in doing so I realise that I am using only a few percent of its capabilities (e.g. spending all my time in Edit Mode on objects that will never move) and, in particular, creating manifold objects is proving difficult.  My object looks like it should look but it is non-manifold in various ways (non-manifold edges, non-intersecting faces, etc.).  The original Blender file is here:

I realise that I can improve my construction technique to be sympathetic with the ways of Blender and I can use the 3D Printing add-on to slowly and carefully correct each minute mistake but that seems wrong to me: if the object looks correct then software should be able to generate a 3D mesh that is, near as dammit, printable.  Maybe not quite what I drew but corrected to be a printable thing.  A modifier of some form: the be-slightly-fatter-more-rounded-and-more-connected-but-don't-bother-me-anymore modifier :-)?  FYI the "Make Manifold" option in the 3D Printing add-on doesn't produce a sensible result in my case.

Is such a thing possible and I've just missed it in the many very useful tutorials, or do I need to go through very carefully finding the slivers of errors in my (beginner's) work, which is not much more than a cup-shaped thingy with drill holes?  See a acreen shot of the object below, along with one of the manifold-corrected version according to the 3D Printing add-on, the 3D Printing add-on's list of errors and the view of my 'orrible object as seen by slic3r-3d (Prusa edition).

P.S. apologies in advance if I'm the Nth person who's asked this.

The object is non-manifold and the main reason why are these edges holding the top part because technically they aren't holding it:

For now printer won't be able to decide where is the inner part of that, where is outer, just as Blender can't calculate normals for the object correctly.

If you really want to print this object the easiest way to work precisely is to duplicate and separate to another object the outline for those curved extruded parts in order to cut them with Knife project / Boolean once they are part of another object.

First copy the top part of the object with which is the profile of the curved part extruded from the bottom. Then either hide those vertices with Mask modifier or delete them. Then dissolve the vertices corresponding to the ones removed from the top, - they are just going through the bottom part faces and are creating intersecting geometry.

In the end you want to get the bottom part only without any additional loopcuts:

From here on get duplicated curved profile of the deleted geometry, extrude it to get a line of faces in the top and line of faces going down:

Add Boolean modifier to the original object shown above, set it to Difference and use this profile as cutter. Below the cutter is hidden and new geometry create with difference is shown:

Do the same for the other part. Then either extrude top part once more or (as is done in the file below) copy the one from the original mesh, clean it up from doubles and unnecessary edges to get even quads and join meshes (Boolean has to be applied first). Then select both lines of faces and run Bridge Edge Loops.

Here you can convert tris to quads or not - it's not quite important for printer, the geometry here is more or less clean.
What matters for printer here are quads / ngons which might not be flat (in your model this is the case), as well as overhanging faces which might or might not require fixing though this is more printing related question than Blender.

Download the file


How to reset the angle of rotated view without a numpad? I somehow rotated my view a few degrees to the side and I don't know how to reset it.

How can I reset the view?

Note: I don't have a number pad.

Start rotating the view holding the mouse scroll, then press and hold Alt button, while still moving the mouse. It will very quickly adjust the view as desired.


Running blender from the command line My blender will not run and it's been suggested that I run blender from the command line with a factory reset option however I am not familiar with how to do that.

What is the actual command after c:> ?

I'll be describing two approaches, one for the case that you don't know where the blender.exe is located, there other for when you do.

In case you don't know Blender's install directory:

Open the Windows Explorer WIN+E
Navigate to C:\Program Files\Blender Foundation\Blender and verify that the blender.exe is present. If it is continue with step 4, otherwise step 3.
In case you didn't find the blender.exe go back to C:\Program Files and use the search box to search for blender.exe. When it's found right click on the item and select Open File Location.
Click in the address bar that displays the current path and replace the text with cmd. Press enter and a command prompt should open with the working directory set to the path where Blender is located.

If you already know Blender's install directory:

Open a command line WIN+R and type cmd and press enter
If Blender is on a drive that isn't C: you will have to change to the correct drive. You can do this by typing the drive letter and pressing enter. For example if Blender is located in K:\05_Download\blender-2.80-windows64, you would type K: and press enter.
Change the directory to where Blender is located. Use cd to change the directory, for example cd K:\05_Download\blender-2.80-windows64.

Now you can start Blender with the (temporary) factory settings. Once you close and restart Blender without the flag it will load your preferences. This is better than doing a factory reset, when you only need to temporarily disable preference loading.

.\blender.exe --factory-startup

Another flag that is useful in case Blender crashes is --debug which will display debug information on the command line.

.\blender.exe --debug

The full list of command line arguments can be found in the manual.


Get previous value of updated property I have a UIList with a "name" string property, it has an update function, but I need access to the name before and after the update, but as you run name_update() the name has obviously already changed:

name : StringProperty(
        name = "test",
        default = "",
        update = name_update
    )

~~~

def name_update(self, context):
    old_name = # need old name
    new_name = self.name
    print(old_name)
    print(new_name)

    return None

To elaborate on @Hikariztw 's answer

Using the code from https://blender.stackexchange.com/a/141207/15543 as an example.

Update to the property group def.

class MaterialSlot(PropertyGroup):
    def get_name(self):
        return self.get("name", "Foo")

    def set_name(self, value):
        oldname = self.get("name", "Foo")
        self["name"] = value
        print(oldname, value)

    material : PointerProperty(type=bpy.types.Material)
    name : StringProperty(
            default="Foo",
            get=get_name,
            set=set_name)

Note the example code uses the material name in list UI class. Change to show item in draw method to show collection item name instead.

layout.prop(item, "name", text= "", emboss=False, icon_value=layout.icon(ma))

Python console code, added a new scene material slot.  It is given the default name "Foo".  Updating the name to "Bar", in this case via console, same if done via UI, and the setter is called.  Which prints old name "Foo" and new name "Bar"

>>> s = C.scene.material_slots.add()
>>> s.name
'Foo'

>>> s.name = "Bar"
Foo Bar

and again from "Bar" to "Choo"

>>> s.name = "Choo"
Bar Choo

But here is the "rub" re the property default value.  The  PropertyGroup class  already has a name attribute.  When a new item is first added, it doesn't use the name property default of "Foo", but rather defaults to "".

>>> C.scene.material_slots.clear()
>>> s = C.scene.material_slots.add()
>>> s.name
'Foo'

>>> C.scene.material_slots.keys()
['']

ie collection has a material_slots[""] member rather than material_slots["Foo"]  However if we set it implicitly, it picks up as expected... which is usual practice I suppose.

>>> s.name = "Foo"
Foo Foo

>>> C.scene.material_slots.keys()
['Foo']

EDIT re comment

  so when I update the list element's name I need to find all objects
  with the original element name and then change it to the new name

For example above, to set all items with old name to new name, do this on a custom property level too. Add something like below to set_name method above.

if oldname != value:
    same = [s for s in self.id_data.material_slots
            if oldname == s.get("name", "Foo")]
    for s in same:
        s["name"] = value


Issue with UV unwrapping and subdivide I'm having a bit of an issue with my model when subdividing it. I am very new to blender and 3D modelling and have just been trying out various things to achieve what I want but this is something I can't quite solve.

When I have subdivide set to 0, the UV map projects fine but as soon as I increase my sub divide, the checkered texture starts to show. Can someone help me with this or point me in the right direction to solve this issue?

The issue was having multiple textures for the UV Map. It was loading the checkered texture for some sections when I subdivided which was weird. I simply selected all faces, changes the image to the checkered texture and then back again and it seemed to fix the issue.


Realistic vegetable shading How can I have the pepper look more realistic? I have been trying a few different nodes options as shown below in Cycles, but something still looks like a plastic

Node with Subsurface scattering:

If I replace the subsurface scattering with Diffuse shader, then I get the result below

It looks better with SSS but requires longer rendering time and more noise.
I was wondering if there's easier way to make things work better here.

Overall scene looks like:

Ps. I'd be happy to get any recommendations about how to improve rest of the scene, I know stem is way behind being realisting, its just a plastic looking now :(

Try looking at some reference images (google images is often the easiest method) to see what peppers look like.

My observations:

Very irregular shapes, usually with subtle bumps and nicks.
Most peppers seem to have rather rough reflections.
Extremely subtle color variations in the skin.
Little bits of "imperfection", such as tiny specs of dirt in crevices/around the stem

With some hastily slapped together procedural textures, I attempted to simulate these things:

For the irregular shape, I used two displace modifiers. One doing macro displacement in all directions, the other doing subtle displacement along the normals.

To get the subtle variations in color I used a noise texture. For the small nicks I used a bump map. For the rough reflections I used a much rougher glossy shader.

You'd probably be able to get more realistic results with image textures, but perhaps this will give you some ideas.

In my scene I didn't end up using SSS for the pepper, as with my lighting setup the results were indistinguishable from a diffuse shader (and SSS was much noisier). However this might not be the case in your scene, so keep in mind that thickness and inner geometry matter. Peppers are usually hollow with a core running through the middle, so a solidify modifier and a displaced cylinder in the middle should approximate that pretty well.


Is there a way to infinitely make a certain mesh appear in blender? Is there a way to infinitely make a certain mesh appear in blender?
I am animating a production line. I want a mesh to appear at a certain place every 10 seconds, so the longer we run the animation, the more mesh there is in memory.

You can use Animation Nodes to do that without coding.

Create a source collection to pick the object templates from.

Then:

Test if time is reached using a "repeat time" node. "Repeat time" will loop from 0 to a given value over time.

Get a random object from the source collection.

Create an instance when time is reached and keep this instance putting it in another collection.

(have added a little animation, but this is not the point here)


Is it possible to copy and paste vertex weight? Is it possible to copy the vertex weight from 1 vertex on a body mesh, then paste that weight onto ALL the vertex of a selection (basically an accessory that's joined to the body for the purpose of pasting vertex weight), instead of 1 vertex at a time (that would take forever for any object unless it's a cube or something)? I found a copy/paste vertex script by Ivo Grigull but it's only for very old Blender versions (pre-2.4.9).

Also, whenever I manually copy/paste vertex weight (one at a time, was testing it with a cube), then later separate the cube from the rest of the body by selecting all vertices on the cube and press P, the body would get completely distorted (stretched to infinity in all directions).

Anyone know how to paste vertex weight onto multiple vertices, as well as why my weight-pasting doesn't work at all?

In Weight Paint Mode you can set Weight by pressing Shift + K.

Toggle Vertex Selection Masking to select the vertices

Set the Weight (use @joshsanfelici technique to copy vertex value)
Press  Shift + K to set weight


What is the workflow when using Subsurf? My question is what is the best approach to model an object for a realistic cinematic render when using a Subsurf modifier? Because if I may compare Blender to Photoshop, which uses layers, here all we do is not reversible. Even for the "Add Modifier", I need to apply it before moving to the next step. So for example, if I use the Subsurf, what is the best workflow if I want a realistic look? Do I need to push the values to their maximum (view=6+). What is your advice based on your experience?

Here an image to illustrate what I mean:

This sphere is perfect for me but the view (as shown on the image) is at 6. Broadly my question is how do you work? What is your workflow? Do you work with the shading smooth or keep the mesh with polygons to  modeling hard surfaces of your object and only at the end you turn your object into the final rendering with a smooth shading before applying the skin, colors etc.?

Looking at the sphere i see things go wrong.

Your viewport subdivision is set to 6
while your render viewport is set to 2
Normally render is set higher then viewport, so i guess you saw to many facets thus... i'm thinking why.

More is wrong, your highly subsurfing a sphere why ?.
Go te edit mode, select all faces, go to shading/UV make sure to set faces to smooth. now the most simple sphere with a subdiv of 2 or 3 is likely enough.


Orthographic camera mirrored in viewport? I'm trying to render a building using an orthographic camera. The first side of the building works fine, but when I mirror the camera to the other side of the building the camera is in the right position but the view through the camera is mirrored on the Y axis.

I tried different things:

Mirror the camera again and rotate it around 180°. Doesn't work, the viewport is still mirrored on one axis.
Apply Rotation, Location and Scale (doesn't work either)

My question is, how do I fix this behavior?

PS: I fixed it with new camera - but the question, or the answer is still interesting.

This is because the Object mode Mirror tool works by scaling -1. (the same thing will happen if you manually scale the camera by -1.) You will also notice that in addition to the viewport being mirrored, Object Normals appear reversed.

from the wiki about Edit mode mirror:

  The mirror tool in Edit mode is similar to Mirroring in Object mode.
  It is exactly equivalent to scaling by -1 vertices, edges or faces
  around one chosen pivot point and in the direction of one chosen axis,
  only it is faster/handier.

note that using an Orthographic or Perspective camera does not change this behavior. It is the same on both.

(as already mentioned by Polosson),
The solution is to Rotate the camera instead of mirroring it.

Also as already mentioned by Polosson, one way to do this would be to

Select the building, and press Shift+S > Cursor to selection
Press . to change the Pivot point to Cursor
Select the Camera and rotate around the Z axis by 180 degrees. (R+Z+180)


Any Python code examples of bmesh operations on multiple objects? I'm trying to iterate through multiple selected objects and perform bmesh operations. Unfortunately, I get errors such as index 0 out of range when trying to perform basic tasks such as selecting vertex index 0 on the next object in the selection.

I can iterate through objects and perform bpy operations, and I can perform bmesh operations on single objects fine. Unfortunately I get stuck when I try to perform index specific bmesh operations when iterating through all selected objects.

Would anyone be able to give me a basic example that would iterate through selected objects and e. g delete vertex with an index of 0 using bmesh? I'm using Blender 2.8

Thanks.

This is an example based upon batFINGER's link that uses a vertex index.

import bpy
import bmesh

context = bpy.context
mesh_obs = [o for o in context.selected_objects if o.type == 'MESH']
bm = bmesh.new()

for ob in mesh_obs:
    me = ob.data
    bm.from_mesh(me)

    bm.verts.ensure_lookup_table()
    bm.verts.remove(bm.verts[0])

    bm.to_mesh(me)
    me.update()
    bm.clear()


Extrude curve circularly having consulted How can I extrude a dome from a circular face?, I realize I could probably use that method to achieve what I'm looking for (a stool cushion). However I already have a curve with the wanted form and was wondering if there's something like a circular extrusion.

You can try to convert the curve to mesh and then just extruding to the shape you want converting the curve to mesh shortcut is alt+C i think  but maybe there is better way how to do it is long time i use blender


What is the best way to overcome layers limitation in Blender? I am doing an archviz and would like an idea on how to overcome layers limitation.

My workflow

Assign layer 1 - 10 for 10 DWGs of floor/elevation plan
Assign layer 11 - 20 for the actual 3D model for each floor/elevation plan

For a 10-floor building this is fine, or for repeating floors. Now, I have 12 floor plans DWGs that have little similarity to each other. I would then need 22 layers.

What would be the best way to accomplish this in Blender? Different scenes? Different .blend for each DWG?

"The best" is certainly opinion based and bound to personal preference, there are definitely different approaches, workarounds and valid alternatives.

Working daily in archviz in Blender however I end up exclusively using Groups for organizational purposes instead. Haven't really touched Blender's Bit Layers for scene management in quite some time, except for when render layer compositing is required.

I permanently changed my outliner to Groups mode in my startup.blend and use it as an always-open "layer manager" of sorts.

That way you can assign custom names to the "layers", have an unlimited number of them, and do the usual toggle visibility, selectability and renderability from the list.

Only difference between this and actual CAD-like layers is that since they are groups they don't store an actual state per-se, so adding an object to an invisible or unselectable group, for example, will not immediately make said object take on the group invisibility or unselectability state. You will have to manually toggle it again for this to update all new objects freshly added to said group.

For organizational purposes, if you also wish to use group instances along with groups as layers, then things might get messier with a long list of groups. Using some sort of naming scheme to keep groups organized, sortable and manageable is one possible workaround.

I generally prefix all my "layer groups" with the 'Layer' prefix in their name, and then prepend different prefixes for other group types meant as reusable instances, depending on their content.
Something like 'Component' for project specific reusable building parts; or 'Assets Furniture', and 'Assets Decoration' for generic movable objects; 'Assets Vegetation' or 'Assets Trees' for the greens, etc.

You can still have objects belong to several layers at the same time, and if you import DXFs with Blender's standard DXF importer, half the work would already be done automatically, since the importer already matches DXF layers to Blender groups by default anyway.


How To Get Rotation Data Printed Every Frame What would the script be to get the rotation of a cube printed after every frame?

Using a frame change handler

  Application Handlers

  This module contains callback lists

Test script.  After (post) a frame change, print the local euler rotation of the cube in degrees.

import bpy
from math import degrees

def cube_rot_report(scene):
    cube = scene.objects.get("Cube")
    if cube:
        #rot = cube.matrix_world.to_euler()
        rot = cube.rotation_euler
        print([degrees(r) for r in rot])

#clear the handlers
#bpy.app.handlers.frame_change_post.clear()

bpy.app.handlers.frame_change_post.append(cube_rot_report)


Material doesn't appears properly I have a material which looks pretty cool in the preview window however after applying it to an object, it isn't the same the material's preview is. How can I made my object to look same way the preview's object does? Sorry I am a new in Blender so I don't know how to google this problem. I tried find a solution but nothing found.

Here is reference to the file, the file is too big (80mb) for blend-exchange.giantcowfilms.com
And here is reference to the original material in case it helps. A tried the author's recommendations (enable Experimental mode and Subdivision Surface) but that didn't help.
Thank you in advance!

The material uses a displacement and will work only with Cycles rendering.
Also, the displacement scale is relatively low.
So, use Cycles and increase the displacement scale (check all parts in green below):

Additionally, you may need to add some subdivision to the object for a better rendering of this displacement.


Why does Eevee make some meshes glitch and disappear as I move away from them? I don't see any overlapping faces.
Normals are pointing the right way.
I don't know what else to check. What causes EEVEE to do this?

Setting the Clip Start to 0.001 is what caused this.
Setting it to something slightly higher fixes it.


How do I change the mode of perspective? I'm working on a scene that, currently, is much more convenient when the view is.. not the correct perspective.
There's a word for this, but I have no idea how to phrase it and my tries to look it up has all come up with weird results. (usually directions on how to make your view point from a certain direction)
This has probably already been answered here, so please bear with me; I just cannot find anything that has to do with the problem I'm having.
I drew a photo to make it easy: (excuse my crappy mouse-drawing skills)

Thanks!

If this is what you're asking, you can switch from User Perspective to Orthographic by using the Numpad 5 key.  The perspective type is given in the upper left hand corner of the 3D view.

The differences can be found here: What are the differences between Orthographic and Perspective views?

Essentially, Orthographic is a "non-real-world" view in which all dimensions have the same scale... i.e. objects that are farther away appear to be the same size as objects that are near-field.


Have 2 objects act like one I have an apple that is thrown into the air and then sliced in half. Because of this, there are two different objects (the halves of the apple). When it is thrown, I want to use a Rigidbody to get more realistic physics. How can I make the two halves act like one object for a certain amount of time?

Try giving both pieces the same origin, and parent one to the other using the "child of" constraint. Animate it's effect off once it needs to fall away from the other piece.


How do I displace/distort a texture map with another texture map? I want to use a vector map in the node graph to displace/distort a 2d texture map, where X and Y values denote 2d direction and Z denotes strength.
i.e. Suppose I have two noise texture maps from two texture nodes.  I'd like the first to displace/distort the second to "push" or "smear" the resultant texture information.
To visualize, imagine you're using a Noise node and using the distortion attribute.  Now imagine I want to do that to a another texture node based on some other node. Like this:

Use a Vector Math node combined with your Noise (or any) texture to warp the vectors:

As I mentioned above, you can use other textures as well to create different effects. You can also get better control over the "distortion amount" by using a MixRGB node to mix the texture with white before it connects to the Vector Math Node :


How to get random color variation on a single mesh? I am trying to get color variation and to bake it in a single mesh but the Object Info Random only works if i separate the meshes. Is there an alternative way to get the same result with the meshes combined, they aren't attached between them.

Following the several comments, I've thought an addon can be useful to do that and may have a general interest.

What does it do:

Identify loose parts of the object (or all selected objects)
Generate a random color for each loose part
Follow the mesh loops to assign the vertex colors

(can be installed as an addon)

The code is commented below (please comment if needed):

bl_info = {
    "name": "Assign random vertex color to each loose part of a mesh",
    "author": "lemon",
    "version": (1, 0),
    "blender": (2, 78, 0),
    "location": "Properties Editor > Object data",
    "description": "",
    "warning": "",
    "wiki_url": "",
    "category": "Mesh"}

import bpy
import time
import random
from mathutils import Color

def LoosePartsMakeVertPaths( verts, edges ):
    #Initialize the path with all vertices indexes
    result = {v.index: set() for v in verts}
    #Add the possible paths via edges
    for e in edges:
        result[e.vertices[0]].add(e.vertices[1])
        result[e.vertices[1]].add(e.vertices[0])
    return result

def LoosePartsFollowEdges( startingIndex, paths ):
    current = [startingIndex]
    result = set( current )

    follow = True
    while follow:
        #Get indexes that are still in the paths
        eligible = set( [ind for ind in current if ind in paths] )
        if len( eligible ) == 0:
            follow = False #Stops is no more
        else:
            #Get the corresponding links
            next = [paths.pop( i ) for i in eligible]
            #Get the new links as new inputs
            current = set( [ind for sub in next for ind in sub] )
            result = result.union( current )

    return result

def LoosePartsCountIslands( obj ):
    #Prepare the paths/links from each vertex to others
    paths = LoosePartsMakeVertPaths( obj.data.vertices, obj.data.edges )
    found = True
    n = 0
    while found:
        try:
            #Get one input as long there is one
            startingIndex = next( iter( paths.keys() ) )
            n = n + 1
            #Deplete the paths dictionary following this starting index
            LoosePartsFollowEdges( startingIndex, paths )
        except:
            found = False
    return n

def LoosePartGetIslands( obj ):
    paths = LoosePartsMakeVertPaths( obj.data.vertices, obj.data.edges )

    result = []

    found = True
    while found:
        try:
            #Get one input as long there is one
            startingIndex = next( iter( paths.keys() ) )
            #Deplete the paths dictionary following this starting index and append the result
            result.append( LoosePartsFollowEdges( startingIndex, paths ) )
        except:
            found = False

    return result

def RandomColor( rnd ):
    return Color( (rnd.random(), rnd.random(), rnd.random()) )

def RandomColors( rnd, count ):
    return [RandomColor( rnd ) for i in range( count )]

def ColorFromVertexIndex( vertexIndex, looseParts, colors ):
    for c, lp in zip( colors, looseParts ):
        if vertexIndex in lp:
            return c
    return Color()

def RandomVertexColorsByLooseParts( obj, vcolName, useSeed, seed ):

    rnd = random.Random()
    if useSeed:
        rnd.seed( seed )

    mesh = obj.data

    #Create vertex colors if it does not already exist
    if vcolName not in mesh.vertex_colors:
        mesh.vertex_colors.new( vcolName )
    #Update it so that it is available below
    mesh.vertex_colors.update()
    #Get the vertex colors
    vertexColors = mesh.vertex_colors[vcolName]

    #Get loose parts
    looseParts = LoosePartGetIslands( obj )
    #Generate random colors
    colors = RandomColors( rnd, len(looseParts) )

    mesh.loops.update()

    #Follow the loops
    for i, vertexIndex in enumerate( [loop.vertex_index for loop in mesh.loops] ):
        #Assign vertex colors from loop index and vertex index
        vertexColors.data[i].color = ColorFromVertexIndex( vertexIndex, looseParts, colors )

def InitProperties():
    bpy.types.Scene.VertexColorsName = bpy.props.StringProperty( name = "Vertex colors", description = "Vertex colors to use or create", default = "Col" )
    bpy.types.Scene.VertexColorsUseSeed = bpy.props.BoolProperty( name = "Use seed", description = "Use fixed seed to generate random values" )
    bpy.types.Scene.VertexColorsSeed = bpy.props.IntProperty( name = "Seed", description = "Seed for random values" )
    bpy.types.Scene.VertexColorsAllSelected = bpy.props.BoolProperty( name = "All selected objects", description = "Apply to all selected object or only active one" )

class RndVColToLoosePartsPanel(bpy.types.Panel):
    bl_label = "Random vcol to loose parts"
    bl_space_type = "PROPERTIES";
    bl_region_type = "WINDOW";
    bl_context = ""

    @classmethod
    def poll(self, context):
        return context.object and context.scene

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

        layout.prop( scn, 'VertexColorsName', icon='GROUP_VCOL' )
        layout.prop( scn, 'VertexColorsUseSeed' )
        layout.prop( scn, 'VertexColorsSeed' )
        layout.operator( "rndvcoltolooseparts.ope")
        layout.prop( scn, 'VertexColorsAllSelected' )

class RndVColToLooseParts(bpy.types.Operator):
    bl_idname="rndvcoltolooseparts.ope"
    bl_label="Generate random vcol to each loose parts"

    def execute(self, context):

        scene = context.scene
        obj = context.object

        if scene and obj and obj.type == 'MESH':

            prevMode = obj.mode
            bpy.ops.object.mode_set( mode='OBJECT', toggle=False )

            if scene.VertexColorsAllSelected:
                for obj in [obj for obj in context.selected_objects if obj.type == 'MESH']:
                    RandomVertexColorsByLooseParts( obj, scene.VertexColorsName, scene.VertexColorsUseSeed, scene.VertexColorsSeed )
            else:
                RandomVertexColorsByLooseParts( obj, scene.VertexColorsName, scene.VertexColorsUseSeed, scene.VertexColorsSeed )

            bpy.ops.object.mode_set( mode=prevMode, toggle=False )

        return {'FINISHED'}

def register():
    InitProperties()
    bpy.utils.register_class(RndVColToLooseParts)
    bpy.utils.register_class(RndVColToLoosePartsPanel)

def unregister():
    bpy.utils.unregister_class(RndVColToLooseParts)
    bpy.utils.unregister_class(RndVColToLoosePartsPanel)

if __name__ == "__main__":
    register()