Script to render one object from different angles I'm new to Blender. I'm currently working on a 3D reconstruction project using neural networks. I need to create my data set. Therefore I need to render a 3D body scan from different angles and save the images separately. I can render creating cameras manually but once i create a loop for the cameras my output is black images.
this is the code i used:

bpy.ops.object.camera_add(view_align=False, location=[0,10,20], rotation=[0.436,0,pi])
bpy.ops.object.camera_add(view_align=False, location=[10,20,30], rotation=[0.436,0,pi])

for ob in scene.objects:
    if ob.type == 'CAMERA':
        bpy.context.scene.camera = ob
        print('Set camera %s' % ob.name )
        file = os.path.join('/home/fotofinder/Downloads/tryrender/images', ob.name )
        bpy.context.scene.render.filepath = file
        bpy.ops.render.render( write_still=True )

If anyone can help to define the proper parameters for the cameras in order to always have the object in the image I would be grateful.

Could you take an approach something like this?

Create a mesh whose vertices are the desired viewpoint positions, around your body scan. (It's the sphere, in the illustration, named 'Viewpoints')
Create one camera, and assign it a 'Track To' constraint ('To': -Z, 'Up': Y) with the body scan as target

Run a script which keyframes the camera to each of the vertex locations in successive frames

import bpy

vp_obj = bpy.data.objects['Viewpoints']
cam_obj = bpy.data.objects['Camera']
vp_vs = vp_obj.data.vertices

bpy.context.scene.frame_start=1
bpy.context.scene.frame_end=len(vp_vs)

for (f,v) in enumerate(vp_vs,1):
    cam_obj.location = vp_obj.matrix_world * v.co
    cam_obj.keyframe_insert(data_path="location", frame=f)

.. and render the animation?


Restore / Show Outliner again When I start Blender, I am shown the Outliner on the right side:

Somehow I very often manage to hide it. I think it happens when I unwrap and have the "UV Edit" window shown on the left side of Blender.

Can anybody tell me how to restore / show it again?

Thank you.

The shortcut for the outliner window is ShiftF9.

For the shortcuts to other windows see this


Blender game engine, shape key driver i want to create a character with differents shape keys for modify things like if the character is big or small, if he smile or not... and i want to modify values or shapes on blender game engine.

To do that i create my character i create the differents shapes, i add driver to every shape and i connecte driver to cuve or plane or empty.

It work great in the 3d view but when i play standalone or embedded game the driver don't work.

I try to create a cube and make the empty parent of the cube to se in the game,
the cube move well but not the shape:

In some forum they say that from blender 2.5 the driver is not compatible with blender game engine but at this  forum:
www.elysiun.com/forum/showthread.php?320528-Drivers-in-BGE&p=2535731&viewfull=1#post2535731

somheone arrived to create what i want:

But i do not arrive to reproduce that to my .blend, i copy the code, i don't know verry well the python but i understend, but i don't unserstend why create bones to apply the shape smile, or eye, why and how does it work?
If somehone can explain me step by step how it work?
Thanks.

Sorry for my bad english i'm french.

It's not done with drivers. In the script I see:

  own.channels["eye"].location = 0.0, own["eye"], 0.0
  own.channels["smile"].location = 0.0, own["smile"], 0.0

channels is a list of the bones in the armature.
I think he has parented the vertices to the bones and moved the bone channels.
Or maybe he has bound the bones to the drivers.


How do I Download an External File from URL and Display Progress in a Panel without blocking the UI? I've read the following answers already on SE, but I cannot yet seem to replicate the end result I need in Blender 2.71.

https://stackoverflow.com/questions/13485720/blender-python-scripting-trying-to-prevent-ui-lock-up-while-doing-large-calcula/16744008#16744008
Blender not responding while running my script
Blender UI Multithreading Progressbar

I'm running a panel script that uses an operator button to download a file from an external URL. I've not yet found a way to do this without blocking the UI.

I've tested modal operators and used multithreading, no luck yet. Can anyone demonstrate that this is actually possible?

If it is possible, I would then use a modal operator timer to check on the progress and update a label in the ui panel.

Here's my attempt via a modal operator timer similar to the first link in the list.

import bpy
import sys
import urllib
from urllib import request
from urllib.request import urlretrieve

def reporthook(blocknum, blocksize, totalsize):
    readsofar = blocknum * blocksize
    if totalsize > 0:
        percent = readsofar * 1e2 / totalsize
        s = "\r%5.1f%% %*d / %d" % (percent, len(str(totalsize)), readsofar, totalsize)
        sys.stderr.write(s)
        if readsofar >= totalsize: # near the end
            sys.stderr.write("\n")
    else: # total size is unknown
        sys.stderr.write("read %d\n" % (readsofar,))

class ModalTimerOperator(bpy.types.Operator):
    """Operator which runs its self from a timer"""
    bl_idname = "wm.modal_timer_operator"
    bl_label = "Modal Timer Operator"

    _timer = None
    _updating = False
    _download_done = False

    def do_download(self):
        print("starting file download")

        #actual url and local path removed for privacy
        urlretrieve("REMOTE_URL", "LOCAL_DEST", reporthook)

        self._download_done = True

    def modal(self, context, event):

        if event.type == 'TIMER' and not self._updating:
            self._updating = True
            self.do_download()
            self._updating = False

        if self._download_done:
            self.cancel(context)

        return {'PASS_THROUGH'}

    def execute(self, context):
        wm = context.window_manager
        self._timer = wm.event_timer_add(2, context.window)
        wm.modal_handler_add(self)
        self._updating = False
        return {'RUNNING_MODAL'}

    def cancel(self, context):
        wm = context.window_manager
        wm.event_timer_remove(self._timer)

def register():

    bpy.utils.register_class(ModalTimerOperator)

def unregister():
    bpy.utils.unregister_class(ModalTimerOperator)
    bpy.utils.unregister_module(__name__)

if __name__ == "__main__":
    register()

bpy.ops.wm.modal_timer_operator()

Okay, I think I've found the solution to this issue.

Instead of calling a single download file command with urlretrieve, I opened a remote urllib.request using the chunk size argument, as well as opening a local file for writing. I used a modal operator to read a new chunk from the URL and write the chunk to the file. Keeping the chunk size around 16kB seemed to work well.

In order to get the download size progress updated to a panel label, I needed to use a second modal operator running to get the label to update.

Curiously, in the Event.Timer statement of the second MO, I needed to update any random property in the scene context to get the Status Label to really update properly. Perhaps someone could explain that bit further.

This is what I used to trigger the update in the second MO:

bpy.context.window_manager.name = bpy.context.window_manager.name

Here's my code sample, feel free to comment:

import bpy
import sys
import urllib
from urllib import request

scn = bpy.context.scene
fileDwnProgress = ""
url = "REMOTEFILEURL"
theFile = "LOCALFILEPATH"

def strMsgLabel_Get(self):
    global fileDwnProgress
    return fileDwnProgress

bpy.types.Scene.strMsgLabel = bpy.props.StringProperty(
    name="Status",
    description="Message Label",
    get=strMsgLabel_Get,
    set=None)

class OBJECT_PT_TESTPANEL(bpy.types.Panel):
    bl_label = "DOWNLOAD TEST PANEL"
    bl_space_type = "NODE_EDITOR"
    bl_region_type = "UI"
    bl_context = "object"

    def draw_header(self, context):
        layout = self.layout
        layout.label(text="", icon="INFO")

    def draw(self, context):
        layout = self.layout
        row = layout.row()
        row.label(text=scn.strMsgLabel)

class mdFileDownload(bpy.types.Operator):

    bl_idname = "wm.md_file_download"
    bl_label = "File Download"

    _timer = None
    _transferring = False
    _download = False
    _chunkSize = 16 * 1024  #(16kB seems good chunk size)
    _fileSize = 0
    _fp = None
    _req = None
    _chunk = None

    def modal(self, context, event):

        global fileDwnProgress
        global url
        global theFile

        if event.type == 'TIMER' and not self._transferring and not self._download:

            self._fp = open(theFile, 'wb')
            self._req = urllib.request.urlopen(url)
            self._transferring = True

        if event.type == 'TIMER' and self._transferring:

            self._chunk = self._req.read(self._chunkSize)

            if sys.getsizeof(self._chunk) < self._chunkSize:
                self._fp.write(self._chunk)
                self._fileSize += self._chunkSize
                self._transferring = False
                self._download = True
                self._fp.close()
            else:
                self._fp.write(self._chunk)
                self._fileSize += self._chunkSize

            progress = str(round((self._fileSize/1024/1024),1)) + " MB"
            fileDwnProgress = progress

        if self._download:
            fileDwnProgress = "Download complete!"
            self.cancel(context)

        return {'PASS_THROUGH'}

    def execute(self, context):
        # print(var)
        wm = context.window_manager
        self._timer = wm.event_timer_add(0.01, context.window)
        wm.modal_handler_add(self)
        self._transferring = False
        return {'RUNNING_MODAL'}

    def cancel(self, context):
        wm = context.window_manager
        wm.event_timer_remove(self._timer)

class mdDownloadMonitor(bpy.types.Operator):

    bl_idname = "wm.md_download_monitor"
    bl_label = "Download progress monitor"

    _timer = None

    def modal(self, context, event):

        if event.type == 'TIMER':
            #this is required to trigger the update
            bpy.context.window_manager.name = bpy.context.window_manager.name

        return {'PASS_THROUGH'}

    def execute(self, context):
        wm = context.window_manager
        self._timer = wm.event_timer_add(0.01, context.window)
        wm.modal_handler_add(self)
        bpy.ops.wm.md_file_download()
        return {'RUNNING_MODAL'}

    def cancel(self, context):
        wm = context.window_manager
        wm.event_timer_remove(self._timer)

def register():

    bpy.utils.register_class(OBJECT_PT_TESTPANEL)
    bpy.utils.register_class(mdFileDownload)
    bpy.utils.register_class(mdDownloadMonitor)

def unregister():
    bpy.utils.unregister_class(OBJECT_PT_TESTPANEL)
    bpy.utils.unregister_class(mdFileDownload)
    bpy.utils.unregister_class(mdDownloadMonitor)
    bpy.utils.unregister_module(__name__)

if __name__ == "__main__":
    register()

bpy.ops.wm.md_download_monitor()


How to color node wires in node editor? Is there any way to color wires in node editor? If not, are there any add-ons for coloring wires based on the body color of the output node? It seems like it should be pretty simple to do and I've downloaded textures with colored wires but I have no idea how it was done.

If you are trying to achieve an effect similar to the one you get with the Blender internal renderer, you can use the Wireframe node to separate edges from the rest:

The white (1) regions are at the specified distance from the edges, and the black (0) regions are not. You can pass these values to the mix shader to use separate shaders for these two regions:


Why are add ons not installing? The add ons I’m using work fine in Blender 2.7 but if I try to install them in 2.8 or 2.82 nothing happens. It seems no add ons at all work for me.

If I install from file the Blender log says the modules have been installed but they don’t show up in Blender or in the add ons folder.

Also, the method of just putting them in the add ons folder itself doesn’t work either.

Any help would be much appreciated.

Due to API changes all Add-ons need to be updated for 2.8x:

  Blender 2.80 is an API breaking release. Addons and scripts will need to be updated to run on 2.80, both to handle the new features and adapt to changes to make the API more consistent and reliable


Objects with negative mass? I'd like to simulate balloons floating up, while other objects are falling down, which I cannot fix by reversing gravity. Is there any way to simulate this, simulating Archimedes' Law?

This is more of a general question about Blenders physics, but for the scene at hand I'm working on about a hundred balloons rising, and confetti and serpentines falling. The balloons have numbers on 'm, so these were generate through a script. It is not a particle system.

Another solution using RigidBodies, Zero gravity and a Texture Field:

Note that all the balloons here are single user object instances all with RigidBodies.

turn RigidBodies World Gravity to 0.0
Add a texture field which uses RGB values of the texture to determine the force (using a Color Ramp). R or G or B values of 0.5 correspond respectively to 0.0 force in the X, Y or Z axis. 0.0 R, G or B values correspond to +1.0 force and 1.0 R, G, B values correspond to -1.0 X,Y or Z force. Its means that a downward Z axis force of -1.0 corresponds to R=0.5,R=0.5,B=1.0, and an upward Z axis force or 1.0 is R=0.5,G=0.5,B=0.0. Thus the blueish/yellowish texture below. See https://docs.blender.org/manual/en/latest/physics/forces/force_fields/types/texture.html for details

Also note that I am using a Clouds texture here which is 3-dimensional which explains why the balloons are sometimes switching direction, when they pass through a 3D space where the 3D texture is changing color. May be using an image texture or tweaking how the texture is build would prevent that.


How to highlight parts of my scene - strategy for materials? I have a scene that looks like this...

The renderer is Cycles (probably obvious from the screenshot :) ). Blender 2.78.

I'd like to be able to highlight components, such as the gearbox, in a highlight color such as a slightly emissive orange. This would be for stills and for animation; and for animation it would be cool to be able to fade from current materials to highlighted material over a few frames.

The main question I have relates to materials strategy. Currently, I've got materials such as aluminum, shiny_steel, powder_coat, etc. So this means that if I want to highlight, say, the gearbox, I need all the objects in the gearbox (which are more than one material) to change color, without affecting everything else in the scene that also has the same materials.

At this point, I don't have a handy hierarchy as these meshes were imported more-or-less flat; but I'd be happy to parent all the gearbox parts to an empty called "EMPTY_gearbox", for example. Then maybe the ideal thing would be to add a custom property to the parent that allows me to fade from assigned materials to highlight material, perhaps through a driver (I'm kinda guessing here - I'm not an expert yet... :) )

What's the best strategy for achieving this? How do I get my head around material slots, mix shaders, etc.? I'd rather not have to have several different aluminums, such as aluminum_for_gearbox, aluminum_for_manifold, etc. But if this is what it takes, I can do it, but it seems like a clunky approach.

Thanks!

Dan

I'm answering my own question as none of the answers was quite what I was looking for, but there were gems in there that let me figure it out. Thanks to all those who answered!

My solution:

I forked local copies of materials, e.g. Aluminum is now Aluminum.Gearbox, Aluminum.Manifold, etc. Thankfully, no component has more than 4 materials, so this was much less painful than I was thinking it might be.
I created my orange highlight material (some glossy, some diffuse and some emissive), using a node group to make it easy to place in all the materials where I want it.
I added a mix shader node before the output of these forked materials, and hung the orange color on the other input.
I added an empty, such as "EMPTY_gearbox_highlighter" with a custom property of "Highlight_Strength", going from 0.000 to 1.000.
I added simple drivers on the Fac of the mix shaders for all the materials in the gearbox, to be directly controlled by the Highlight_Strength property on the empty.

I'll repeat this for each highlightable component, and then all I need to do is to animate the Highlight_Strength properties on my empties, and it'll fade all the materials in the gearbox (or other component) to orange, which is exactly what I want!

Thanks to all who gave me the stepping stones to get here!

Here's the gearbox unhighlighted:

And here it is highlighted, just by taking that single custom parameter to 1.000:


count down on button press in blender game engine In game when I press a button on my keyboard it will start a countdown on a timer  until it hits zero. Is this something that is possible to make in blender game engine?

Yes, easily through logic bricks and using a text object.

In this example, the property start rules if the countdown is started. When Spacebar is pressed start becomes True, then the Text property gets decreased each 60 frames (that is, 1 second).

Example blend file provided below.

Example file:


How to deal with 45deg angles and sqrt2 multiples? I'm trying to make modular walls. It's working fine, except that I wanted to make 45degree angled walls too. If my wall is X units in size, the 45 degree wall, must be square root of 2, times X (as it is the hypotenuse of a square with side X units).

What can I do about that? I'm very afraid of using floating point numbers, as they introduce errors, that can add up and misalign the grid.

Select the edge from where you want to have a wall at an angle. Extrude along one axis by pressing E then the axis you want to extrude along and typing the distance. Press Enter. Then move along the other axis by the same distance. In the GIF below, I used E -> X -> 2 -> Enter to extrude by 2 BU along the X axis then G -> Y -> 2 -> Enter to move the new edge by 2 BU along the Y axis.
If the wall gets its normal in the wrong direction, select the face and press CtrlN to point the normals outwards or ShiftCtrlN to point the normals inwards.


Using the Camera Data Node In the blender manual the options for camera data node are explained like this:

  View Vector

  A Camera space vector from the camera to the shading point.

  View Z Depth

  How far away each pixel is from the camera

  View Distance

  Distance from the camera to the shading point

So, what is the shading point? How is each of these options different form the other, and in which cases should one be used instead of the other?

Shading Point

is the nearest point of intersection of the camera ray with a visible object, which the render engine is currently calculating the color for (these calculations are referred to as shading)

The real View Vector

it is a vector (or a ray) in the camera space, starting from the center of the camera (or the view) and reaching the shading point

View Vector

it is a normalized view vector (magnitude = 1 or unit vector) in the camera space, starting from the center of the camera (or the view) and pointing at the shading point (it doesn't necessarily reach it )

View Z Depth

it is the Z component of the view vector (the non normalized)
it is the shortest distance from the shading point to the camera's XY plane (the is not normalized Z-depth, it is not from 0 to 1)

View Distance

it is the magnitude of the non normalized view vector, or simply the distance from the shading point to the camera's center

where to use each one: well you know enough now to decide where to use them!


Object alignment between Viewport and Render are different I am loving learning to use Blender for visualization of biological samples.

However, I have run into a problem. In the Viewport, my models are aligned with my input data, as below:

In the rendered image, the models are misaligned, as below:

The pink model (red arrow) should coincide with the grey circle (blue arrow) in the 2D image.

I have almost no experience with rendering and have no ideas about where this discrepancy comes from, which makes getting started with troubleshooting very challenging.

I'd appreciate any input that would point me in the right direction.

Thanks!!
Sam

My guess: the misalignment is caused by perspective and different viewing angles. You look at your objects in the Viewport and in Render Camera from different sides, so what looks like "alignment" in the Viewport may actually be a perspective illusion. The best way to check it is to upload your .blend file for examination.


Adjusting dimensions in one axis affects the size on other axes I have a mesh and when I try to scale it by adjusting the dimensions (X dimension for example) in the N panel, the rest of the dimensions (Y,Z) decrease in size. How do I make this stop? I've already done Ctrl + A  and apply scale.

Scale with X then press X  and only X axis will decrease in scale.


How to arrange objects in outward facing circle? I'm trying to mimic the look of soundproofing but on a cylindrical object - this pattern:

All the pyramids need to face outwards. I followed some tutorials on arranging things in a circle but the direction isn't correct and depending on scale they overlap:

How can I make this pattern?

You can model this shape quite easily with just two modifiers.

First add a Cone, set the Vertices to 4 so that it is a pyramid, and lower the Depth to 1.

Set the origin at the bottom of the pyramid. Now Rotate the pyramid so that it is pointing towards the negative Y axis.

Add an Array Modifier, and a Simple Deform Modifier. For the simple deform modifier set the Type to Bend, the Angle to 360, and the Axis to Z.

Use the Count in the Array modifier to change the diameter of the cylinder.

Last add another array modifier to the ring of pyramids, to get more then one row.


Extrude with Proportional Editing I didn't find a way to combine the two tools, extrude and Proportional Editing.
Is it possible?
My goal would be to model something like basalt columns easily...

Not directly, but extrude works like this: when you press E, blender

creates new connected geometry
immediately enters "grab" mode (but not using Proportional)

If you cancel(ESC or right click), you cancel only the last "grab" action, thus leaving the new geometry where it was before entering the "grab mode", and still selected.

You could issue this as a bug or a feature request, though, imho.

So, you can just enter "grab mode" again (eg pressing G) but now your enabled Proportional Editing will work


Append Not Working - Copy and Paste between files not reliable I have used append many times, but recently it refuses to work. I suspect I know why - it's a bug related to animation and/or armature.
I would love to know if anyone has any secret workarounds. The problem is 100% reproducible here - I cannot append any collections with armature and models in them. They all return "nothing indicated" as the error message.
It may also have to do with collections...I can sometimes get the project to open in append (in order to choose items) but selecting the relevant collections returns with the error.
Also, very often simply choosing any other item from the append list - cameras, or mesh say, there is no error message and nothing is brought in.
Copy and pasting of collections never works as expected. If I select the collection, and paste it in to the scene collection on my view layer, the collections are not pasted, but parts of their contents (not all), and never organised into their collection. The only work around I have atm is to go into the source file and delete everything else before copying.
We might suspect a corrupt file, but this is in multiple files including brand new ones. It also occurs both on Linux and Mac systems (I am running 3 systems), and the problem occurs there as well. I'd love to know what the problem is and if there are any work arounds. It's a really big problem.

I discovered what the problem was - it's very simple and is just a result of a slightly confusing UI.
On choosing the file to append, the blue append entry field remains blue while it loads up the file...but to me it looks like nothing is happening. That's because it takes a while to load up the file - sometimes 15 to 20 seconds. I am hitting the append sign because I am not being given any feedback that Blender is working, and it is trying to append when I have not made a selection.
It was bound to be something simple.


Greeble Cube Microdisplacement - how to prevent edges from opening up and becoming black Hi I am trying to create a greeble cube with hi res texture. But when I use microdisplacement it make the edges open up and create unsightly dark border - I have tried using bevel but then the edge is rounded and not crisp.

I can also use a pointiness texture to mask the edges but then there's border which does not look natural.

Does anyone have a solution to avoid such dark edges?

Here is a screenshot of what I mean:

Here's the blend file in case anyone wants to examine it:

And here's the greeble texture:
https://i.imgur.com/G29bdCI.png

I can't replicate your problem with Blender 2.79.6 as I don't have access to 2.79.6 and I can't load your file into 2.79.5 since I don't have a 'safe' environment that I can risk loading "foreign" blend files). I did try loading into 2.79b but without success (from your file I couldn’t get any displacement working - even after tweaking the material to remove the unsupported nodes).

I tried replicating your situation afresh in 2.79.5 using the default cube, adding Subsurface modifiers (one set to '6' and the other set to '3' - so 9 subdivisions) and with the following material :

This produced the following result :

I don't see any dark gaps and the edges all seem to displace correctly without splitting.

Can you try following these steps in a fresh file to see if you get the same results? - or identify anything that you have done different that may have resulted in the issue.


How do I move keyframes on multiple frames? v2.8 In 2.79 I have keyframes between 40 and 50 and I box select those frames then I grab 1 of the selected keyframe and drag them all to the left or right where I want them.

In 2.80 I have keyframes between 40 and 50 and I box select those frames then I grab 1 of the selected keyframe and it deselect all keyframes except keys on the same keyframe number.

So what is the 2.8 method to dragging multiple keyframes in the same manner as 2.79?

Select the keyframes you want to grab, then press G and move the mouse, confirm with left click. After pressing G you can enter the value of frames of the movement, then press enter to confirm. The new behaviour is consequence of the new general left click approach.


After having converted the grease pencil strokes to a mesh I can't add any texture in texture paint mode I've watched this tutorial about grease pencil in blender 2.8 by Paul Cageggi and I've got the idea to apply over the car a texture of a real car found on internet using the projection painting tecnique.

In Object mode, with the stroke object selected I hit the W key and then I selected the option "convert to mesh",as suggested in this post.

As soon as I have converted the strokes to a mesh,I have switched from layout to texture paint and then I tried to add a texture,as suggested by this tutorial,but surprise,I can't do that. I have no "texture paint" option and I can't add any texture,as you can see below. Can you explain to me why ?

I don't think you can directly paint onto the GPencil object that you are converting to mesh. I include a picture here of converting GP to bezier and then to mesh once closed.

Texture paint mode is only available for Mesh objects, so that is why the option doesn't appear.


Animation transfer from one rig to another I have a large set of animations on one rig and would like to transfer them all to another rig. The rigs are different, the one with the animations is more complex than the one I'd like to transfer to. Though they are both bipedal rigs. What's a time efficient way to accomplish this?

All the animation data refer to the bone's names, so if you give to your new rig the same bone names it will work. Data with different names will be ignored.


free editing a rigged character's pose similar to editing bones in edit mode I have modeled, rigged, and weight painted a base character to build all my other characters from. I'm wondering if there's a way to freely move bones in pose mode the way you can mode bones in edit mode, this way i can freely restructure the skeleton and have the mesh update with it

You can pose your character, then apply the armature modifier, so your deformed mesh will become a base mesh. Then you can select the armature and choose "Apply pose as rest pose", then add a new armature modifier to the mesh and select your armature in its "object" field. In this way the deformed mesh and the posed armature will act as "base mesh" and "rest pose", without having to rebuild the weights.

If you need to unparent a bone from another you have to do it in edit mode.

If you add new geometry to the mesh you will have to give some weight to the new vertices, in weight paint mode or directly in the vertex group tab of the properties panel.


Eeevee Light Path, how to make transparent to camera In my tests, Light Path -> Is Camera always seems to be 1.0, and Ray Depth always seems to be 0.0.
I'm trying to have an object be invisible to the camera, only appearing through a glass object in the scene.
Background: This is because the scene has a background video, handled with motion tracking, and I need some semi-realistic refractions through a glass within the scene.  I placed an object, matching the motion-tracked ground, under the object, with a frame uv-mapped to it, but it's obviously in 3-space and won't match the background properly, so I was trying to use only the refracted "light" through the object, and the rest be transparent to the camera (thus showing only the background video there).  You can safely ignore my messy shader experiments in this screenshot -- but it does show the oddly-shaped mesh object on which a frame is uv-mapped

Ray depth 0?

Eevee has no real concept of rays. But in order to ease the workflow between Cycles and Eevee some of the outputs are supported in particular cases. This node makes it possible to tweak indirect lighting in the shader.
Only a subset of the outputs is supported and the ray depth has not exactly the same meaning:

Is Camera: Supported.
Is Shadow: Supported.
Is Diffuse: Supported.
Is Glossy: Supported.
Is Singular: Not supported. Same as Is Glossy.
Is Reflection: Not supported. Same as Is Glossy.
Is Transmission: Not supported. Same as Is Glossy.
Ray Length: Not supported. Defaults to 1.0.
Ray Depth: Indicates the current bounce when baking the light cache.
Diffuse Depth: Same as Ray Depth but only when baking diffuse light.
Glossy Depth: Same as Ray Depth but only when baking specular light.
Transparent Depth: Not supported. Defaults to 0.
Transmission Depth: Not supported. Same as Glossy Depth.

See https://docs.blender.org/manual/en/latest/render/eevee/materials/nodes_support.html
In your specific case you could use the compositor with multiple view layers to achieve the same results.


How to blur background image.? I am rendering a image in cycles.The question is how to blur background in blender cycles?

There are many ways of doing this, here is how I would do it.

First, go to the render layers tab of the properties view and enable an environment pass under the passes rollout.

Then make sure you have checked transparent under render properties > film rollout.

Then you can blur just the environment pass in the compositor and mix it into the render using a mix node based on the alpha.


Why solidify modifier extrude extra edges With the reference video Im making the sofa. I have made the handles and when im trying to add the solidify modifier. I have add the images 1st image is the normal without solidify and 2nd and 3rd image with red mark are the images after solidify is added.  I have align the vertex also. Yet to not get the better result. The handle not solidify outer side like offset as seen in the video. Whats wrong with my basic mode.

enter image description here

You model as duplicate geometry and overlapping faces at the bottom.

Either:

Enter edit mode and press W > Remove Doubles. You may have to increase the Threshold value in the tool shelf, or
Manually delete the duplicate faces at the bottom of the mesh, then close the gaps.


Tracing object with rotation constraint I tried making a gun turret that would be pointed at the empty , and that part works so far but the limit rotation does not work at all and the barrel goes up too high:

The constraints are shown there, I tried changing the order and using locked track and track to but the results are the same.

Put the Limit Rotation after the Damped Track and it will work fine:


How to assign different scenes for workspaces in Blender 2.8? In 2.79 I could select a workspace, choose any scene and easily switch between workspaces - for example I had one scene for modeling and another one for VSE.

But in 2.8 I can't find a way to do so. It seems like scene selecting is now a global thing and switching between workspaces shares the same scene.

As you can see green highlighted part is a scene created specifically for Video Editing, but if I switched to workspace Layout - I'd still be viewing this scene.

I used to this so much, cause Blender doesn't allow to use same scene as strip in VSE.

Just to clarify (or what I think the problem is):  It's annoying to constantly change the active scene when switching between Video editing and any other operation.

The workaround is to use "Window->New Main Window" and use the first window for 'Video Editing' and the second window for everything else. I realize the convenience when you change the scene for Layout/Modeling/Sculpting/Animation etc. But this becomes an INconvenience for the 'Video Editing' workspace. It seems it takes another monitor to go smoothly.


How do I make it so the object will stick to to my character's hand while posing it? I am trying to make it so when I move my character's arm the drumsticks will move along with it, I connected the object to my character's hand before it was rigged, but the drumsticks were made as a separate object. Any suggestions?

One way to do this is as follows (assuming you want to keep the drumsticks separate from the character).
In edit mode on your character's armature, create two more bones, one in each hand where you'd like the drumsticks to be held. Name them say, handL and handR. Make sure they are parented correctly to the arm bones.
Next enter edit mode for the drumsticks and select all the geometry of one of them, doesn't matter which. Press P and choose "Separate by Selection". Now your drumsticks should be 2 separate objects.
Go back to your armature and select one of the hand bones you made. Press Shift + S and select "Cursor to Selected". Exit the armature and select the drumstick on the same side as the bone you just selected. Press Ctrl + Alt + Shift + C and select from the menu "Origin to 3D Cursor". Now the origin (pivot point, the yellow dot) should be where the hand bone is for that side of the body. Do the same process in this paragraph again for the other hand and stick.
Select one of the sticks and enter edit mode. In the side panel choose the tab that has the triangle icon and create a new vertex group, naming it the name of the hand bone the drumstck is on the same side of (i.e. the left stick in this example should now have a vertex group named handL). In edit mode select all the stick's geometry and in the Vertex Group side panel click the Assign button. Exit edit mode and repeat the same with the other stick.
The last thing to do us for each stick go to the Modifiers tab on the side panel and give them each one Armature modifier, choosing the Armature of your character in the box and making sure the Bone Vertex Groups checkbox is marked. If done correctly the sticks should now automatically move with your character's hands. If you want to disable the tracking at any time to control the location of the sticks manually then for each stick simply disable the Armature modifier.


Connect Hip Bone to the Tail of Backbone Hi so I know how to connect bones but in this case I'm not sure how to get it working. I want to be able to be able to drag the whole mesh along an axis, but can't because the hips are not connected to the backbone. The armature kind of splits up. I want to parent both hip bones to the end of the backbone. If I try parenting the child bone the regular way, I get what is shown in the picture below. Anyone know how to solve this?

File Link:

Like Sambler eluded to, parent the hip bones to the backbone without being connected.  This is also known as 'Keep Offset'.

Get into Bone Edit mode.
Select Hip_L/Hip_R bone.
Select Backbone.
Hit Ctrl+P and from the menu select Keep Offset.

Here's the result of the above steps, repeated for both hips.


2.81 Transparent Background Shadow Catcher I have a fairly simple setup in Blender 2.81a.

A model, light source, camera, and a simple plane beneath it. I am attempting to render an image which renders the plane as a transparent background, but also has the shadow of the model cast onto it. In prior versions of blender this was do-able simply by allowing shadow casting onto the object and then making the object transparent, but this seems insufficient now that I have updated.

I have tried Eevee, and Cycles, but neither worked the way I'd like.

Currently I am messing around with a Mix shader comprised of a Transparent BSDF and a Diffuse, but while setting the Fac to 0.1 gets a "close" result, it still brightens the background slightly (since my diffuse color is white), which ruins the effect that I'm going for.

Any help would be appreciated. I am still very much a beginner with Blender.

There is a "shadow catcher" option in the object visibility properties. It works only in cycles. Actually I don't know of a simple easy way to do it in Eevee.


Blender game normal mapping I have a ground tile for which I use a normal map, it reacts good when facing light, but looking in the Sun lamp direction kills the lightning. I'm using nodes, have a look at the pictures.
Can somebody tell me what's wrong with my setup ?
(connecting the texture normal output straight to the material gives the same result)

You could try advanced material node. This can be  found under the input menu. Otherwise you could just add the normal map in the texture panel and enable normal map at the bottom.


Airbrush and Soft Pencil always black, regardless of material chosen (2D, 2.8) When using 2D animation in 2.8, my airbrush and soft pencil tool always produce the color black, regardless of material chosen.  The other drawing tools are accurate. and draw/paint what I've selected.  Any idea what I may be doing wrong, or missing?  Thanks so much.

I've figured it out. Airbrush and Soft Pencil are Dots material. If you have only Line materials, blender will switch to the default "Dots Stroke" material, which is black. Change the color of this material.


Constraint to move objects along Local z-axis while following bone? I am trying to rig a series of valves which are pushed down by a lever:

Currently, I have a Copy Location object constraint on the valves which copies the z-location of the bones at the end of their respective levers. I know this is technically an approximation, but it's close enough for my purposes.

The problem is, I can't figure out how to set this up so that it works when the valves aren't aligned with the global z-axis. I need to be able to replicate this behavior for the other valves, which are at arbitrary rotations relative to the global axes. I also need the rigging to remain intact when the entire armature is moved or rotated.
What do I need to change the Target/Owner settings of the constraint to in order for this to work?
Do my valves need to be parented to anything specific within the armature?
Is there a better way entirely to rig this kind of set-up?

This was done without bones and only 1 (track-to) constraint for each rocker-arm push-rod.  (Blend file below)

It's only necessary to build and animate one rocker assembly to begin with and that's described below...
The method used to move the valve and only on contact with the rocker-arm is firstly to set the valve's origin point to it's very top center vertice.  An Empty is added at that location to give us a reference point to return the valve to after the parenting process, described immediately below.
The rocker's animation (rotation) is manually keyframed.
It's then stepped a frame at a time until it comes into contact with the top of the valve rod.
The valve is parented to the rocker at that frame (CTL-P) so it's locked to the rocker contact point.
(Child = valve)
Once played the valve's derived action can be then be baked from the frame of first contact up to the frame where it's rising again and parting from the rocker, inclusive.  (in the bake panel tick all option boxes).
The bake leaves us with no parent constraint and a set of keyframes at our disposal.  The X & Y axis' channels can be removed, along with all the rotation and scaling channels.
The only animation channel remaining is Z axis LOC and with the frame range already limited to those of physical contact, the valve will only move straight up and down when in contact with the rocker-arm.
Note -
Blender can introduce extraneous interpolation curves when keyframes are close to each other and these can cause the valve rod to penetrate the rocker's surface slightly. If that's happening noticeably, simply remove the intermediate keyframes between peaks in the Graph editor. That will smooth things out and should leave you with a clean, U shaped curve.  There's only a few KF's to worry about.
Now to the rod that pushes the rocker-arm -
Actually it doesn't do that.  The yellow rocker is keyframed to rotate back and forth and the push-rod is parented to the rocker at the hinge pin.  The push-rod's origin point is set to the hinge-pin's center.
To keep it's other end pointing at a stationary target, it's given a 'Track-to' constraint.  The target is an empty which is sitting directly below but slightly offset along the X axis to prevent it wanting to spin 180 degrees with each half cycle.

To hold it all together so the whole thing can be moved/rotated and even scaled without ill-effect, a
'Nav(igation) Empty'  (the large circle)  acts as a Master parent for the rocker, valve, and 'track-to' empty, along with the main shaft that will support all the rocker-arms.
It's the Nav-Empty that's pulled around the scene, rotated etc. not the components.

Once the first assembly is working, it's duplicated and their timing and locations offset to suit.  Make sure you DON'T include the Nav-empty or main shaft when duplicating


How can i wrap an array grid onto a different object without the objects "collapsing"? I was interested in how to get geometrical bumps on this grip and thought it would be easy to do, but the problem with the shrinkwrap modifier is that it collapses all the faces onto the shape also,  .
Is there any way to keep the geometry of the bumps, while also wrapping them around the geometry of the face?

You can do this by using a lattice to proxy the shrinkwrap modifier.

Add a lattice at the same position as where you want your objects to intersect.

Add a shrinkwrap modifier set to your cylinder.

Add a lattice modifier to your array

sources :

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

https://youtu.be/UfhJ0mBUqr8


How to import uv animation from blender to unity? I'm animation uvmap in blender just fine using animall adon. When I import it into unity it totally ignores my animation.

Any suggestion how to solve this?

I don’t think this is possible at all on Unity, not in the way Blender allows it with AnimAll (very quick search brings solutions based on scripting, in Unity).

In any case, there is for sure absolutely no standard way to directly export UVMap animation from Blender, FBX does not support such feature afaik, and it’s one of the most advanced and best supported exchange format (Collada does not support this either, see this post…).


"Cutting" a logo into a rounded shape? I'm new to Blender but not 3D modeling. I'm struggling to translate what I know to this interface, but I'm getting there thanks to all the tutorials and efforts this great Blender community has created.
Thank you! It's amazingly helpful.

I need some help with how I should approach this model (if you point in the name of the tool, I can go find the resources on it, I'm really looking for the term of what I'm trying to accomplish).

I have an SVG logo. I'd like to shape this logo to a sphere or other roundish shape and give it a look like it was "router cut" into the face of the shape.

I would like the logo to be about 2mm recessed on all sides.

I was thinking I could

Extrude the logo
Make an inner shape
Make an outer shape
Use the outer shape to "cut" the extruded logo to the face of the
rounded shape. (Boolean)
Use the inner shape to "cut" the extruded logo depth (boolean) to
give me a sliver the side I'd like to notch out of the rounded shape.
And then Boolean again on duplicates of the shapes to remove the
junction of these two.

Seems like there should be an easier way to do this.

If you're able to convert your logo into a curve/mesh outline, you could then use Knife Project to cut it out of your base object. Then you would simply need to extrude the cutout area to the desired depth.


Blender Bump Map Not Working/Applying! I've been searching online for 3+ hours trying to figure this problem out, I finally have to post my problem to search for an answer.

When I apply my bump map to an object's texture, the map doesn't read the non-color height information coming from the image. I thought this was a software problem so I did a fresh install of the latest release of Blender (I did not install the beta version). I did the same steps as last time and it still did not work.

Also, note that when I apply a bump map the texture of the image does change to show a collection of cubes on the surface of the texture. Look at the images below to get a better idea of my situation.

I checked all of my drivers and they are all up to date. I'm stumped and I could really use a helpful solution to this problem. Thanks.

Updated Blender File

Image of what the texture is supposed to look like

texturenotworking

As a general rule, always use non-color data instead of sRGB when using maps. sRGB is only for color image textures.


How do I animate the scaling of a texture? I have a B/W pattern on a torus and I wanted to make it slowly move down so it gets the effect of coming out of the hole in the middle.

I am working in UV mapping right now, and I'm scaling the raster up and down over my texture, which gives me the desired effect. How would I animate this?

One way I do this is through creating multiple uv maps.

Create the first UV map as usual.
In the Object Data panel click the "+" to add a new UV Map.

In the UV/Image Editor the new UV Map will now be active. Move the UV Map (G) to the new desired location.

In the Node Editor create two "UV Map" nodes from the input submenu, selecting one of your UV Maps on each.
Plug them into a color, Mix RGB node.
Use this as the input for the Vector value on your image texture node.

The Factor (Fac) value is now the value for going between the two UV maps.
Animate this value by pressing i while your mouse hovers over the fac field. You should place the first keyframe when the slider is at 0 and your time cursor is at the beginning of your animation, and the second when the slider is at 1 and your time cursor is at the end of the animation.

In the end, your final result should look like this:

Please note: this method works for scaling, and translating. Small rotations (< 90 degrees) will work okay, but any larger will start to cause larger distortions and other methods should be use.

I hope this was helpful.

Thank you,

Uncle Snail


How can I pull two objects together without scaling them It might seem like a trivial question, but I do this a lot when modeling, and I always have to manually move each part instead of pulling them together or pushing them apart because doing so would scale them down or up.
For example, imagine you have two cubes that have a scale value of 1, and you want to pull them together equally, but without changing their size. Is there a way to move the cubes without scaling them?

In the 3D View header, open the Options overlay and toggle Locations on


Object origin/pivot point perpendicular to an object how can I make the origin/pivot point perpendicular to the object like the second image? Thank you...

Your question is a bit wrong and unclear, imho, for a few reason, I try to explain why:

You wrote "Object origin/pivot point" as to be "not perpendicular" but a point has no dimensions, and thus it can't be "perpendicular" or not to anything.

What you mean is "the three axis" that come out of the pivot/origin point. And this makes a big difference, because there are different "sets" of those axis, depending on the coordinate systems you refer them to. And they are specific of that 3d view area.

Those are known as "transform orientations", because they help you, pointing in the possible transform operations you can perform on the object.

By default you see the "global" orientation, but you can choose from a set of predefined orientations.

Here you see the same object, at the same time, shown in two different 3d view areas, with two different "transform orientations": note the effect on the pivot/origin axis

adding to this, in the properties panel (right side pressing N) at the bottom there's a dedicated panel, where you can also switch them, but here you can create a "custom" orentation, at your taste, too! Look at the small "+" button in the lower right corner:

In object mode those axis are always "cast" from the object's pivot/origin point but, in edit mode, that pivot is where the "selected" (average) part of the mesh/curve/other is:

Adding another example the "view" orientation makes those axis always "perpendicular" to your view:

in edit mode, you can spot the difference that the "normal" orientation can make:

here you see both orientation at the same time, again, but in edit mode

When you tranform the object, in object mode, or its mesh, in edit mode, you can be helped by those axis, because both the 3d manipulator (grab, rotate and scale) and the "visual guide" you get when you put transform constraints (pressing the axis letter).

see how all of the manipulator modes adapt to the selected transform orientation:

And, if you choose to grab a face - in edit mode - along X along "normal" transform coordinates

if you have this ("local" transform orientation mode) in edit mode:

when you press G, the transform start without contraints (you can grab it anywhere)
if you then press X a "visual guide" appears, locking the movement along "global" X, always, independently from your "transform orientation" choice in that 3d view area

if you press X again, the visual guide, and locking, is now bound to your choice...

eg: if you choose "local", pressing XX will guide and lock your transform along "local" X

The blender manual has a whole chapter dedicated to this argument, explaining every single bit: https://docs.blender.org/manual/en/dev/editors/3dview/object/editing/transform/control/orientations.html

Now, learn how to "correct" them, imho you should keep in mind (and specify) which orientation you wish to manipulate. A comment above points you to another similar question, with a solution. Try that and, if it doesn't work, improve this answer adding more details or open a new one, if it is a too different case. Hth


Spotty Lighting Showing From Sun Light The sunlight is emitting spotty light. Why is this? I've attached my node set up for the window where the light is emitting through

A refraction shader with an IOR of 1 should do very little, but I think refraction shader by itself messes with light paths just a little.  I also seem to remember Transparent BSDF working better with an Add Shader.  From the reference:
Transparent BSDF.
The Transparent BSDF is used to add transparency without refraction, passing straight through the surface, as if there were no geometry there. Useful with alpha maps, for example. This shader affects light paths somewhat differently than other BSDFs. Note that only pure white transparent shaders are completely transparent.
I would start out with a reduced node setup, and you can add to it and verify the effects.  You could go to the principled shader if you feel more comfortable there.

If you use the color picker you'll see the light spot on the floor and the edge of the plane both top out around .68 Value, so I don't think this is doing anything too inaccurate.  The light hitting the camera from outside the window is around .88.

This should work fine for thin panes of glass.  For more complex pieces this may produce lighting that is too bright, such as in the following example where the transparent bsdf is set to .6 (.9 is pretty much unreasonable):

https://blenderartists.org/t/how-do-i-make-glass-cast-transparent-shadows-in-cycles/650692/5
Here's a thread from blenderartists where user theoldghost suggests the node group used in the following image where the transparent bsdf is set to .9:


Update child coordinates relative to parent I'm facing an apparently well known issue with Blender that was already described here.
Basically, when I create a new object at world level and then make it the child of another object, its coordinates stay coherent with world and there's no easy way to update them relative to the parent. I need positional data of my objects in relation to how the hierarchy is organized because I have to plot them outside.
A pratical example is when I generate bounding boxes for one or more objects. I used this add-on by sambler to make the BBs, though they get created at world level by default, whereas I'd like to create them as parents of the related items, just one level up, regardless of where they're found in the hierarchy. If I make the BB then manually move it to the desired position in the hierarchy, I come across the "freezed" coordinates issue described above.
Do you have any suggestion? Thank you!

Insert a bounding box as parent.
Does a child object inherit the matrix from the parent?
Can slip in a new parent

Copy the object, clear modifiers, constraints and animation data
Make the copy the parent
Set the copy matrix local to identity, in this case with basis and parent_inverse both identity.  As shown in link above when calculating the world matrix by chaining the matrices up the parents, an identity local matrix does not contribute to the result.
All local transforms that were on input mesh are now transferred to the bbox parent.

Test script, select a mesh object, run script.
import bpy
from mathutils import Matrix, Vector

def bbox2mesh(ob):
    bbox = ob.copy()
    bbox.constraints.clear()
    bbox.modifiers.clear()
    bbox.animation_data_clear()
    faces = ((0, 1, 2, 3),
             (4, 7, 6, 5),
             (0, 4, 5, 1),
             (1, 5, 6, 2),
             (2, 6, 7, 3),
             (4, 0, 3, 7),
            )
    me = bpy.data.meshes.new("BBox")
    me.from_pydata([Vector(b) for b in ob.bound_box], [], faces)
    bbox.display_type = 'WIRE'
    bbox.data = me
    return bbox

context = bpy.context
ob = context.object
coll = context.collection
bbox = bbox2mesh(ob) # make a copy
ob.parent = bbox
ob.matrix_basis = ob.matrix_parent_inverse = Matrix()
coll.objects.link(bbox)
context.view_layer.objects.active = bbox


How to animate a character walking around? I've rigged a character and started animating it, but I've had problems trying to re-use poses after the character has walked around and is facing a different direction (or even the same direction, but after rotating 360°)

Should I parent the rig to an empty and do the rotating/whole character translations with the empty? How will I prevent the feet from sliding around then?

What is the best way to do this?

Rigify and MHX use a bone called master. In order to apply poses independently of position and orientation the master bone which must not be added to the poses.
Parenting the rig to an empty might also work.

When the feet start to slide around the walkcycle is too slow for use with the movement. In this case you can select the walkcycles keyframes and scale them until it looks right.


How can I calculate the pixel size for each direction of my rendered image? I have rendered an image of size 150*120,
I think the amount of pixel size is related to the sensor size, isn't it?
But I have the sensor size just for the horizontal direction which is 32.
How can I calculate the pixel size for each direction of my rendered image?
Thanks.

Here is an illustrative code fragment to show how to compute the pixel sizes in each direction (u is horizontal, v is vertical):

scale = scene.render.resolution_percentage / 100
pixels_in_u_per_mm = resolution_x_in_px * scale / sensor_width_in_mm
pixels_in_v_per_mm = resolution_y_in_px * scale * aspect_ratio / sensor_height_in_mm
pixel_size_in_u_direction = 1/pixels_in_u_per_mm
pixel_size_in_v_direction = 1/pixels_in_v_per_mm

By experimenting with blender, I found out that by default (camera sensor fit set to "auto") the sensor width is fixed, the sensor height is effectively changed with the aspect ratio settings.

The current Blender GUI only specifies the sensor width by default, but there is a variable for sensor height in the internal camera data. It is used if the camera's sensor fit is set to something other than "Auto", which I don't currently cover in this answer (see next paragraph for another answer where I cover these).

The above code is based on the Python code in my answer to What is blender's camera projection matrix model?. You can find details on how to get the relevant parameters there, and also how to deal with other sensor fit settings.


How to position an object in the middle of of two parts of another object How would I place the circle in between the top and bottom of the box? The box is all one object.

Select the top and bottom edge of the area you want to place the circle in the middle of. Press Shift+S and select "cursor to selected". As long as you have your Transform Pivot Point still set to "median", this will place the cursor in the center between the two selected edges.

Now when you add the circle, it will be placed at the point of the cursor (the middle).
From there, just rotate and scale the circle to your desire.


Node editor, pick random Image Texture from set? If have a bunch of (procedurally generated, converted to mesh) rocks. I have four  image textures (both color and bump).

Is it possible automatically pick a random image texture from the set of four image textures in the node editor, such that each object would randomly get one of the four image textures assigned?

This Randomizer Node Setup should work for what you want to make. If you want you could also switch up the mix shaders for mix color nodes to only randomize the images but I would suggest randomizing the shaders because 1. you only have to do this setup once and 2. you can individually control for example the strength of the bump map and the mixing factor of glossy and diffuse and so on...

Just to explain whats going on here: I have that Random number from the Object Info Node and multiply it with 4 to have a Number between 0 and 4. Then I split that range in half by checking of it is greater or less than 2. Then repeating the same procedure splitting that ranges in half but checking greater 1 and greater 3 if that makes sense.


combining two slow motion videos in split screen I have used the speed control effect to slow down two videos. Now I want to show the slow motion versions simultaneously in a split screen.

I am able to create the split screen using the transform effect on the original videos, but not on the slow motion videos. Any tutorials available on how to do this?

Thanks,
Jigyasu.

You can use any effect strip (like speed control) same way like original videos. So, to get the transform effect over the speed control, select the Speed control strip and select Add -> Effect strip  ->  Transform. Or if you already have the Transform strip on original video, select the Speed control strip, then - Transform strip with Shift and then press R (Reassign Input)

Also you can group strips with Ctrl + G and you can use this group like a usual video strip:


How to get Global object location - Python I'm trying to make script which will get object.location but it doesn't works: result of my script is:

Trawa.196 and its location is: Vector (0.0000, 0.0000, 0.0000)>

And every object in my scene has these values

ObjectName = "Grass."
ObjectNameNumber = 1

for i in range(1,200):
if(i<10):
    ObjectName = "Trawa.00" + str(ObjectNameNumber)

    objectTrawa = bpy.data.objects[str(ObjectName)]
    objectTrawa.select = True
    print(ObjectName, "and its location is: ", objectTrawa.location)
    bpy.ops.object.select_all(action='DESELECT')
    ObjectNameNumber+=1
if(i>=10 and i<100):
    ObjectName = "Trawa.0" + str(ObjectNameNumber)
    objectTrawa = bpy.data.objects[str(ObjectName)]
    objectTrawa.select = True
    print(ObjectName, "and its location is: ", objectTrawa.location)
    bpy.ops.object.select_all(action='DESELECT')
    ObjectNameNumber+=1
if(i>=100):
    ObjectName = "Trawa." + str(ObjectNameNumber)
    objectTrawa = bpy.data.objects[str(ObjectName)]
    objectTrawa.select = True
    print(ObjectName, "and its location is: ", objectTrawa.location)
    bpy.ops.object.select_all(action='DESELECT')
    ObjectNameNumber+=1

Thanks @Jaroslav Jerryno Novotny for help: I'm dumb because I forgot to select everything and set origin to center of its surface/volume (every object had pivot in the middle).
But anyway thanks for "objectTrawa.matrix_world.translation" I will use it instead of location
and zfill() function (I didn't even think that this would be so good for my code)

final code

ObjectNameNumber = 1

for i in range(1,649):
        ObjectName = "Trawa." + (str(ObjectNameNumber).zfill(3))
        objectTrawa = bpy.data.objects[str(ObjectName)]
        objectTrawa.select = True
        print(ObjectName, "and its location is: ",     objectTrawa.matrix_world.translation)
        #bpy.ops.object.select_all(action='DESELECT')
        ObjectNameNumber+=1


How to add a face outside a round feature How can I fill in a face and still keep the circle/cylinder open

If I choose make face here the opening in the cylinder also gets covered.

Just adding an answer so it can be marked as solved :).

You can use Bridge Edge Loops for that.
While in Edit Mode select both Loops and go Edge > Bridge Edge Loops
Note that it will create triangles. To make quads, you also need to subdivide the rectangle.


Mixing image texture makes everything transparent I am trying to create a material where I can place in 2 images (one with white space, and one with just an outline) where the outline gets laid over(with alpha cut out) a material/shader, that would be defined by the white space image.

I have both halves working separately correctly, but when I use a mix shader, they mix correctly but become transparent (when I want it solid).

Node Map

Both Together

(First image is the node map used. Top image texture is outline and bottom is white space)

(second image is the output using the monkey head. There is aweful transparency over everything)

The last mix shader on your node tree is just making your shader a 50% mix of two other shaders, but not using any transparency to control the mix.

Get rid of the extra mix shader and mix the two shapes together directly:

(click on the image to enlarge)

I'll break it in pieces so that is clearer:

When you are using an alpha channel you are using a black and white image to control how two things mix. White is used as opacity, black as transparency. Anything in between will be semitransparent.

If you use the Alpha channel to mix shaders, the white portion of the image will be using whatever shader is connected to the bottom socket. The black portions will use the other shader connected to the top socket. In this case Black will become transparent and white a Diffuse shader.

(click on the image to enlarge)

To mix the other image you use the same approach:
Using the alpha channel you just select to use a diffuse shader over a material that has areas that are already transparent.

(click on the image to enlarge)


Having added a Custom Property in Editor, how do we assign an Update function? When creating a custom property via e.g. bpy.props.FloatProperty(), we can specify a user-defined function to be invoked every time the value of said property changes.

Once the property exists, e.g. added via the Properties Editor, how do we assign or re-assign the update function?

The Properties Editor (Blender 2.74) does not offer that, and, in Python, I don't know how to access the property itself, as opposed to merely its value.

I am looking into it myself atm.

some_value = FloatProperty(default=1.0, update=onupdate)

and then I have a function that handles the update

def onupdate(self, context):

it's important that the function handling has self & context as arguments, and returns none.

You can read more here.


How can i change the color/ texture of the coffee foam? I am following a tutorial to make a coffee cup. Here is what it should've looked like https://imgur.com/a/kf9UY7S, I copied the nodes but I think I missed something because my output is way too different (both the foam color and the texture/ feel). Here are my output and the blender file:
oh, the condensation effect is not visible because i used another computer to render the image. do i have to physically have the reference image (the droplets) in the pc when i render the image or it's enough to have it visible in the Shading tab (at nodes)? Thank you.

There are a few things happening, I think.
First, your objects are not scaled to match real-life size, so (assuming Price's models are scaled) your settings will be different due to a different coordinate space.  At this point scaling your objects down would mean going back and adjusting your arrangement and all of your textures and lighting, so it's probably best to just solve these last issues, render and move on with the knowledge for the future.
The voronoi textures can be scaled up something like 10x and then when you look at the output you get something much closer to tiny bubbles as seen here.

You may not see that, however, because you are using viewport denoising.  It's a great tool but you have to understand that at low sample counts it's going to smear away any fine detail.  You need more samples to give the algorithm enough information to preserve the detail, and even then there are some patterns that just don't denoise well.  You can use a render region to render a small area of your screen much faster.
For the color of the foam, I felt a little more comfortable when I turned it more orange and lowered the saturation a little.  Tbh color is not my strong suit, but my main advice would be that brown is just dark orange.

To your last question, a blend file can act as a container for all the necessary files but you have to enable that option.


Can Cycles physically mix colours? I was trying to recreate a so-called CMY cube, which is a translucid cube where opposite sides are coloured cyan, magenta, and yellow. When looked at from an angle, these colours mix, e.g.

(More pictures here).
The naive approach (namely, a cube with different shaders on each face) does not work:

Is this something Cycles can handle? (I mean, in a natural/physically realistic way; although if this is not possible, a "fake" solution would be interesting too.)

You should be able to do it rather easily. Just do what you already did (make each face a different color/material) - just make the material a Glass BSDF. Don't forget to turn the roughness down. You may also need to play with the individual IOR's to get the effect you need.


Optimizing Face Count by Combining Faces For demonstration purposes, let's say I'd like to minimize the number of faces for this object.

Obviously, there are countless ways I can join faces. There are countless combinations of rectangles I can combine to end up with the same shape.

I'm wondering, though, if there's an algorithm to find the best organization of shapes. An organization of rectangles that has the fewest number of faces possible while still maintaining the same shape.

This sort of stuff should be fairly common in modeling. Is there an "official" term for it?

The term is basically "retopology" and I'm afraid you usually do it manually.
There are some algorithms for quick&dirty retopologies for preview purposes, but those genereally tend to be targeted at organic retopology, not your issue of efficiently optimizing a mesh of any kind.

The general techniques for retopoly work on any mesh and there are plenty of tutorials around.
Typically, when retopologizing the focus is not to reduce the poly count as far as possible but to get a clean topology that can easily be subdivided without any nasty edges or artefacts while still keeping a workable polycount that is within your limits. When a mesh is supposed to be animated, the focus is on achieving a clean edgeflow that enables the mesh to bend smoothly when following the rig.

So, for most meshes, don't think too much about minimizing the face count at any cost and more about the topology itself and what topology is required for the next steps in your workflow (animating, rigging, subdividing, etc.).
If you, for whatever reason, do need to minimize the face count as far as possible without loosing the shape and the quads then I'm afraid I wouldn't know any algorithm in Blender that does that automatically.


Is it possible to use inverse kinematics and Quaternions in Blender? Is it possible to use IK bones to update quaternion rotation values in Blender?

Yes, you can insert a keyframe and use 'Visual Rotation', this uses the pose with constraints applied, to set the rotation of the pose bones.

Note that if all you want is the quaternion values (without applying keyframes), Python can get the final matrix can calculate them.


Mech Fingers mesh folds into itself I'm having a problem with the hands with the Rigify generated rig(using the deformation rig) as this is a mecha robot, the fingers are clipping into itself too much. I tried fixing the vertex groups on the hands and nothing. As I can't seem to find any answer for this, is there a way I can have more mechanical fingers that won't deform as much like that of a human finger would with Rigify rig?

If you reparent With Automatic Weight it will works rather fine, so the solution may be to make hands separate objects, parent With Automatic Weight, then if necessary join back to the rest:

If you don't want to reparent With Automatic Weight for some reasons, then you need to give some manual corrections in order to extend a bit the influence of each bone. First thing, display the layers with the bones that deform your mesh and the ones that command:

You need then to extend a bit the influence of each phalanx, before:

After:

It will work better:

Use the Paint Mask option to make it easier to paint on the right faces, also make sure that you enable all the options that allow to paint through (in the N panel):

You can also do all the corrections through the Vertex Groups list and Assign button, which may be quicker:


I've somehow got rid of my navigation bar so that it no longer appears in layout mode, which is a pain I've had this happen a few times, and I can't work out what I've pressed. Now any time I want to use the navigation bar I have to switch over to a different workspace (I think I mean navigation bar: it might also be called the "properties bar"? It's where you go to do stuff like turn down the intensity of your light).
Does anyone have an idea what I might've done?
Thanks in advance, I'm really new to Blender and I couldn't find anyone having the same problem.

Click on the little arrow icon to show the Navigation Bar for the Properties. You've likely dragged the properties area (edge marked in blue) when you wanted to resize the entire area. Instead you should drag with the cursor placed at the green line for the intended result.


Parts of mesh Rendering White This is my first blender project. I am creating an ad for a phone. Everything looks OK in object view but when rendering in cycles there are white patches where it should be black. I thought the subdivided was causing it but  I removed the subdivide and I am having the same issue still. Here is a screenshot and the blender file. If anyone could help that would be great.

There is a white phone that is not visible in viewport but active for render.


I can't select or delete a bone and this blue circle keeps appearing? https://postimg.org/image/m00rul0vp/

When I left-click in edit mode, a black outlined-blue circle appears with a red line. What I'm actually trying to do is simply to select a bone, left-click the coloured arrows to move it and delete some bones. Now, I can't even select a bone in edit mode.

You have enabled Skeleton Sketching. You can disable it in the properties region N


Coil Mechanism for Vending Machine I'd like to make an animation of a vending machine.  I'm looking for some pointers on how to make the coil turn and drop a snack.

I've made the coil from this link.  The coil is on a hard surface and there are two walls on either side of the coil.  I don't know how to approach the problem of getting the coil to turn and getting a box to move forward and then fall.  Any tips would be appreciated.

Once you have the coil, you need to set it in motion by adding keyframes.
Go to the first frame press I and select rotation.
Move to a different frame, rotate the coil and set a new keyframe by pressing I again.

Now set the coil to a passive rigid body.

Add the object on the vending machine and the rest of the collision objects. Set all of them, except for the box to be dispensed, as Passive rigid bodies.

Then set your dispensed object as a Rigid body but make it active.
The big problem, as you'll soon see, is that the coil does not work correctly as as rigid body to interact with the dispensed box. The box goes out flying out at at the beginning of the animation.

The issue is that the physics for collision objects and rigid bodies is far from perfect and does not follow the real geometry of the object, but creates like a bounding box: The Coil becomes almost like a big solid object with no gaps in between.

The solution is then to turn the dispensed object into a rigid animated object for part of the interaction to force it to follow the turns of the coil, thus simulating the real motion of a vending machine.

Animate the object so it follows the movement of the coil.

Now all that's left is to animate the animate button. To do that go to a frame where the dispensed object has reached the edge of the dispenser. Hover with the mouse over the animate box and press I to set a key frame, Then move one frame in the time line, uncheck the animate button and press I again to add another keyframe. What you are doing is deactivating the animation settings for the rigid body and letting it act just with the physics engine. Press AltA to cache the physics and watch a preview of the object falling over the edge of the dispenser.

Here's the .blend file


Insert keyframe through python and set its properties i'm trying to set some keyframe values programatically after its creation, and for now, i didn't find a way to return this keyframe properly, i have to loop through the entire fcurve which is not very efficient...
For example, i would like something like that :
# add a location x keyframe on frame 1
new_key = object.keyframe_insert(
    "location",
    index = 0,
    frame = 1,
    )

# set keyframe left handle type
new_key.handle_left_type = "VECTOR"

# set keyframe value
new_key.co[1] = "10"

But the keyframe_insert() method only return a Bool for succeeding or not in keyframe creation.
Do you guys know a way to get the keyframe the proper way ? Really stuck here !
Thanks in advance, cheers !
But the keyframe_insert() method only return a Bool for succeeding or not in keyframe creation.
Do you guys know a way to get the keyframe the proper way ? Really stuck here !
Thanks in advance, cheers !

Found a solution using this related thread https://blender.stackexchange.com/a/32540/31246 and this How do I add keyframes to a newly created action with no associated objects? (thanks @batFinger)
Here is the resulting code where i already have a bunch of variable (frame, value, data_path, array_index, handle_left_type) :
# parent is the object/node_tree ... containing the animation_data
# get_unique_name is(collection, base_name) is a function to ensure name is not used,
# and if so iterate by adding numbers

# find fcurve
if parent.animation_data is None:
    parent.animation_data_create()
a_d = parent.animation_data

if a_d.action is None:
    new_name = get_unique_name(bpy.data.actions, parent.name + "Action")
    a_d.action = bpy.data.actions.new(new_name)

fc = a_d.action.fcurves.find(data_path, index = array_index)
if fc is None:
    fc = a_d.action.fcurves.new(data_path, index = array_index, action_group = group_name)

new_key = fc.keyframe_points.insert(
        frame,
        value
        )
new_key.handle_left_type = old_handle_left_type

Cheers !


No "Denoising Data" checkmark in View Layer Properties A few days ago, I posted a question here asking why the Render Layers node didn't have sockets for denoising, and the answer was that I did not have "Denoising Data" checked in View Layer Properties > Passes.  However, this time, that checkmark is not there.  How do I make it appear?

Denoising data is for the cycles render engine, not for eevee.


How to Copy and Paste Vertex Coordinates? I have two meshes that are almost identical to each other. Mesh 1 is a human head, and Mesh 2 is the same head but cut in half. (think no mirror modifier) Both have the same topology where it would be.
I decided I want to adjust a couple vertices on Mesh 1, then I want to copy the coordinates of the vertices (to be clear: not the whole mesh, just the vertices I decide to select) and paste (or transfer?) that coordinate info to the identical vertices of Mesh 2.
How could I go about doing this?

If they are in the same position, you can select both objects and tab into edit mode.  With x-ray view it's possible to select both of the vertices and perform the operation on them at the same time.


Blender 2.82 Eevee smoke problem (density) I use Blender 2.82 for 2 days now. I have real problem to get nice results with smoke. I cannot generate dense smoke. I tried everything. Nothing helps. I had no such a problem with previous version (2.81).
The smoke is very weak, thin (not dense). Changing density in Principle Volume Shader DOES NOTHING. I tweak it from 1 up to even 1000000. The smoke is still weak and very transparent. I checked once more similar situation in earlier version and density (in volume matarial) changes a lot. Even with small values. I cannot make the visual change in 2.82

blend file

I had a same problem until I tried to solve yours one.
I have found that the most helpful is decreasing Volumetrics End Distance or increasing Volumetrics Samples amount.

For some reason I couldn't make the smoke render with OpenVDB cache. So I changed it to modular Uni Cache and made a full bake.


What does seed control in force fields? I've been working with and fooling around with the magnetic force field. I noticed the seed number slightly change depending on the size of the force, but I wasn't sure what it did or what it controlled. Knowing that would likely help!

Various data that is generated for things like simulations will use random numbers to get their results. In reality, we don't get true random numbers, we get pseudorandom numbers, which is a reproducible way of generating a sequence of numbers that resemble random numbers, with the random seed "defining" the sequence of numbers we get.

For simulations this is helpful as we can use the same random seed to always get the same sequence of numbers. This means every time we play the simulation we see the same result. When we don't like the result we can choose a different seed to get a different result.

The seed in the force field should not change when you alter the size. You should expect the seed to be different for every force field you add. If you don't like the way particles move with the force field you can try using a different seed.


.obj file imported on 2.82 doesn't consider separated meshes, while blender 2.79 does as the title says, version 2.82 sees the .obj file as a merged mesh, while if i open it with blender 2.79 it divides it correctly in the different meshes that compose the object and i can select each one of them.
Is there a way, a parameter to set, in order to see the .obj divided structure also in 2.82?
Or is it a not fixed bug?
Any suggestion is appreciated,
thank you very much.

If the imported object consists of disconnected mesh parts then you can use Mesh > Separate > By Loose Parts (P > By Loose Parts). In order to move the origin to each separated object use Object > Set Origin > Origin to Geometry.


Blender - How to taper a bevel? I am trying to mimic the design of this piece but I am stuck at creating the corners of the model. How would I bevel an edge in such a way so that the bevel tapers in like shown in the picture? How would I achieve this whilst keeping the shape of the base square?

Highlighted:

I think I found an answer whilst playing around after reading @mma78 answer.
I can snap the 3D cursor to the bottom vertex and then bevel the edge. I can then set the Pivot point to 3D Cursor and scale the bottom vertices back in. This way the bottom is tapered while keeping the shape of the base unchanged.
While this works, it is not very efficient as I would have to repeat the process for the other 3 corners. If anyone knows of a quicker way to go about this that would be great.
Still, I hope this helps someone.


Intersecting transparent object causing artifacts in cycles When two objects -one of them transparent- intersects it creates some artifacts visible even in the alpha channel. Even with 1024 transparent bounces the artifacts remain.

In the example file there are two cubes in the same position, one transparent and one emission.

What is causing this? Any way to get rid of this artifacts?

This is a limitation of many render engines. In OpenGL/DirectX applications it is typically known as z-fighting. The simple answer is to not do this - don't put two surfaces in the exact same place. This is a scenario that's impossible in real life (no two solid objects can share the same location) and therefore typically not taken into account when designing render engines.


Blender model adds extra materials when imported to Unity My model is made up of a few other models I made before, I combined them using Ctrl + J, in Blender it tells me I have 1 Material, but once I import it into Unity It gives me extra Materials from those models I joined together.
How do I keep it as 1 Material when I import it into Unity?

Without files hard to say for sure, but my guess would be that this is because of blender's way of storing a set of polygon texture references separate from materials and in some cases also exporting that. This happens usually when you select texture in uv view while having faces selected; blender links the texture to only selected faces.

There's (at least) two ways to fix this:

Blender way: select your object, while in edit mode hit A to select everything, go to uv view and select everything there as well. Then at bottom of the view select texture. (this way every face has the same texture and as result there should be only one material named after texture you selected)
Unity way: I prefer this way and am pretty sure this would be the better for your situation as well: in unity, open model import settings, find second last item Material Naming and set it to From Model's Material. This way should make sure no other than explicitly created materials are imported.


Is it possible to limit the "Cycles Shadow from Transparency" per Object? There is an option in the properties panel, Render > Light Paths > Shadows that toggles "using transparency of surfaces for rendering shadows" for the whole scene.

I like to render architectural stills or short films. When I uncheck this option the rendering speed greatly increases, but some parts such as fences and curtains don't work very well, although the quality of shadows of trees, grass and so on is sufficient.

How is it possible to change this option per-object?

There will be a "Transparent Shadows" option per material in version 2.68 and the latest Blender builds.
Using a Light Path node to disable transparency helps and achieves the same visual result, but it still needs to execute the shader to find out, which costs some performance.
Update:
This is now accessible in materials > settings:


Shadow terminator artifacts issues I work with Blender 2.81a and I have a problem with some artifacts in the shadows of objects with smooth shading. Based on the release note of Blender 2.81 ,(https://www.blender.org/download/releases/2-81/), I expected this problem to be solved. There’s a note with a comparative screenshot saying: “Reduced shadow terminator artifacts for bump mapping with diffuse BSDFs.“

There’s no detail about the issue. There’s a mention about “bump mapping”. I have another scene with bump mapping and the problem is the same as in my test shown below. Here’s a screenshot of my test below.

The only solution right now is to increase of the number of polygons with a “Subdivision Surface” modifier. However that makes a crazy amount of polygons and the modifier cannot fit all situations.

Another element of solution is about the light. I noticed that happens particularly when there’s one directional light in the scene like a sun light. Increasing the “Angle” parameter creates a smoother effect. Too much of this becomes blurry and unrealistic. My screenshot shows a sun with the angle 6.4 degrees.

These artifacts only happen in Cycles. Eevee seems to be correct.

I expected this problem to be solved. However it is still present. Am I missing something?

In blender 2.9, a Shadow terminator offset parameter has been added under Object Properties \ Shading. It is set to 0 by default, increasing its value fixes the problem.
Thanks to this, it is not necessary anymore to increase poly count by adding subdivisions.
Demo and explanations in this video.


How to model connection between tables? I'm very new to Blender and I try to model a database (tables and connections between them), but I'm having problems with the connections. What's the "easiest" way to create those lines? A visual representation of what I'm talking about (replace the "red line" with the "blue line", so the 1st table is connected to the 4th one without crossing the 2nd table):

I'm creating the model by creating an .obj file in python then import it in Blender. Plus Kudos if you can show me a code for this problem, because currently I'm just creating a cube between the tables (the 4-4 vertices is at the center of the tables), but it's "aligned" only on the Y axis (if I rotate the connected table around the other table, making it aligned on the X axis, the cube becomes a plain because of the vertices' coordinates).

I know/think I have to use armatures, but I couldn't make it to work.

Thanks for the hints/help!

One rough way could be using two empties for every "connection" shape, each hooked at one of the shape ends. Ten set a "copy location" constraint for each empty to its "column", it works like this:

Edit:
as you noted, the shape of the mesh (cylinder above but also cube has same issue) is stretched by its movement.

I found another way that seems to work without this issue: using a a curve to make the connection and a bezier circle to give it a "solid" shape:

It is made much like above but you create a hook to a new empty selecting one of the curve (2 control points, shape straightened before, and set to handle type "vector") end, then using again CTRLH to make the hook menu appear, then selecting "new empty object".

As above, the empties have "copy location" constraints to each cube, but this time the "connection bar" is not stretched anymore, whatever the columns movement...

Of course it works also with scaling (here using a convenient transform pivot mode: cursor)

note: if you prefer a "squared" connector, just model the bezier circle to a square shape (or whatever), the connector profile is immediately updated

edit2:
since you are missing some step, I tried a complete workflow (I hope it's not too long for this site):

start with the two "columns"

then in top view, place the cursor between them, and add a bezier

you will get this

edit the bezier

select both control points and scale them to zero over Y axis with SY0

(this will make the bezier a straight line)

then in object mode rotate 90° over Z with RZ90

note: here I also edited the bezier to have identical and symmetrical handles (it could be not necessary...), and then made both control points as "vector": select both, press V then choose "vector". This is needed.

now in front view you see

or (object mode):

now you need to add a hook to a new empty where each control point is, so select one of them, and press CTRLH and choose "hook to new empty object"

you'll get this

repeat for the other control point: now you have two empties hooked bt each bezier's control point

select one empty, and add a "copy location" constraint

with one cube as target

as you see instantly the empty copies the right cube position (object origin), and the bezier's control point follows (hooked to the empty)

now do the same for the other empty

as you see this is already working... but the connector is "invisible", because it's just a curve...

you need to bevel this curve with another "curve", so add a "bezier circle" in top view

you get this

if you set this object as bevel object of the "connector" bezier

the "connector" become solid, a visible cylinder shape

since it's quite big, scale the original bezier circle to your taste

and now is prettier

should you wish a different bevel profile (eg: a square) you always need a curve object, so you could transform the bezier circle into a bezier square: in edit mode, press V and select "vector"

you'll get this

and as you see the connector is now squared!

Here is the test file:

Have fun!


Weird Geometry I Can't Even Select I'm getting weird geometry i don't think i ever even created (I've been sleepwalking lately tho and sometimes bad things have happened to my projects over night...)

anyway this stuff just appeared a day or so ago.  I can't even select it in object or in edit mode, and nothing is "unselectable" in the outliner, afaik...  I would try the L or ctrl L thing but i cant grab any vertices.

anyone able to help?
Thank you all!

OK, Solved by Duarte... Thank you!

It was a solidify modifier.  The glossy geometry seems to be the solidify being pushed out of a subdivision in the middle of the rectagular cubes.  The other piece of "mysterious" uninvited geometry just behind the silver, vertical cylinders was a plane in the now joined object...


How to define diagonal directions? I recently ran into an issue when applying forces to an object. I was working with this question. I am trying to add forces to my character as certain keys are pressed. Here are the keys and their direction of force:

W = forward

S = backward

A = leftward

D = rightward

As I hit any of the keys, a force is added to its direction. However, a problem arises with diagonal movements as a different technique would be needed to define direction. I am having trouble with defining diagonal directions. For instance, (10, 10, 0) would add the force 10 on x and y. This will not work. I need to add 10 to a new direction; this direction will be the diagonal consisting of the two directions combined. I will add the force to this direction. I am puzzled on how I would define such a direction with the (x, y, z) format. How could I define a diagonal direction?

As I hit any of the keys, a force is added to its direction.

This makes them separate. But you say you want them combined.

So combine them. Don't apply them immediately, but gather them together, then apply a vector with the length you want.

The easiest way is to just add together the different impulses, normalize the resulting vector, scale it to the desired size, and apply the scaled result to the object.

Example:

from mathutils import Vector

combined_force = Vector()
vector_length = 10.0

if is_forward_key_pressed:
  combined_force += Vector((1.0, 0.0, 0.0))

if is_backward_key_pressed:
  combined_force += Vector((-1.0, 0.0, 0.0))

if is_left_key_pressed:
  combined_force += Vector((0.0, -1.0, 0.0))

if is_right_key_pressed:
  combined_force += Vector((0.0, 1.0, 0.0))

combined_force.normalize()
combined_force *= vector_length

game_object.applyForce(combined_force)

This calculation would occur at most once each frame, instead of repeating it for each key pressed.

A more complex way would be to track the direction as Euler angles, Quaternions, or Matrices, and calculating a final vector from those.


Animated displacement of rigid body does not collide with other rigid bodies I am playing with rigid bodies in 2.79 and I'm having the following problem.

I have subdivided a plane a few times, then added subsurface and displace modifiers. I animated
the displacement with a cloud texture and an animated null.
A rigid body physic was also added to the plane (with 'passive', 'animated', 'mesh', and 'deforming' selected).

This creates an animated pseudo ocean surface.

I then add a few icospheres in the scene, on top of the plane. They are simply active rigid bodies.

When I do the Free Bake of the Rigid Bodies, the Icospheres instead of interacting with the animated
and displaced plane, they simply rest on the original flat plane.

Am I doing something wrong or displaced animated objects cannot be rigid bodies in Blender?

Many thanks for any comment and advice.

many thanks for your help.

I actually did it in an indirect way, a few days ago, by using arrays of passive/animated rigid bodies and connecting them to the animated plane by using Shrink Wrap. This created a moving floor (up-down motion), that interacted with the active/rigid icospheres, giving the result I wanted. Many thanks for your help and I will try the suggested methods to see if they work too.


Where is cell fracture in blender 2.8? Where is cell fracture add on in blender 2.8 ?
it is no longer available or have another name?

Check the Preferences > Addons. On my build the addon was present twice, which was indicated by an info bubble in this section (see pic below). There will be listed two paths, one of which you'll have to delete.


How do I Make a Spot Lamp Parented to my Character Cast Shadows? I am making my first video game in the Blender Game Engine. My game is a zombie survival game where you have a gun and shoot zombies and try not to die. The game has a character which has a dim flashlight which is parented to the camera. In the viewport the spot lamp casts shadows but when playing the game the lamp does not. It is very unrealistic and makes the game feel a bit fake. Could anyone help?

I just had to move it down. Apparently you can't see the shadows if the object lines up with your camera exactly! Thank you bertmoog!


How do I copy vertex groups from one object to another? So, I decided that a previous project contained exactly what I needed to expedite a new project, so I appended the appropriate objects form the previous project to the new one. This was great, because I didn't have to define new materials, &c.

Regrettably, though, I found out that when it came to vertex groups, where it would have been as helpful to be able to copy vertex groups from one object to another as it was to copy materials, I couldn't figure out how to do so.

Am I looking for a feature which does not yet exist?

NOTE: I did not expect the vertex groups to have assignments in the target objects, but it would have been handy not to have had to retype 25 names.

Vertex groups are object data, so they will be copied by ⎈ CtrlL> Object data.
However, this will link all other object data as well.

For a onetime copy of only object data, you might want to try the bundled Copy attributes addon.

Once it's enabled, call it with ⎈ CtrlC (warning, this conflicts with object copy/paste):


Using Blender on a windows 10 tablet with no keyboard? Is there any software (in exception of Tablet Pro, which is quite expensive and overfeatured) to create some virtual buttons or shortcuts on the screen to use blender in non-keyboard mode?

Or maybe some lightweight wireless hardware, like a mini-keyboard with a dozen of keys?

I'd like to use my Surface 2017 for sculpting and drawing, but it is almost unusable without some vital shortcuts.

Thanks for your replies, folks. I decided to stay on TabletPro with the only ArtistPad feature activated. It seems to be a good option despite it's quite complicated customization.