Can't Keep Loop Cut & Slide Where I Want With Measurements Whenever I'm adding loop cuts to my model, I drag the cut to the edge of the model and type in a value (such as 0.5 meters) and it goes back to the center and works from there..?

I'm pretty sure I'm doing it right, I just want to have exact measurements since I'm making building models and I have a set of guidelines for them all, such as 0.5 meter thick walls, 1 meter wide doorways, 2 meter wide windows and so on. How do I get it to stop A) Snapping the loop cut back to the center when I add one, and B) When I do create loop cuts then it will change how big the rest can be. I want it to just keep loop cutting based off the original face size, not the new faces create by adding the vertices, and I need it to not snap the cuts back to the center, but from the side I drag them to. Sorry if I didn't explain properly, I'll try to explain further if required. Also the shortcuts to work faster would be nice :D
https://www.youtube.com/watch?v=rAZ9KEGjSUk&feature=youtu.be <- If you skip to around 5 minutes you'll see him start creating a building, I want to build like that but yeah xD

The loop cut tool or Loop Subdivide as it may be called, is a two step tool that subdivides the chosen edge loop and then starts an Edge Slide.

In the first stage you can use the  MW or numpad-/+ to increase/decrease the number of cuts being made. You can also press E to keep a single loop parallel to the next edge loop and F will flip that to the other side.

In the second stage you are sliding the new edge loop/s along the edge that you are subdividing, the value you enter is a factor relative to the edge being cut with 0.0 being in the centre and 1.0/-1.0 moving the new edge loop to either end of the edge being cut.

For more precise placement of vertices you want to use other tools that allow movement based on global position. The snapping tools make it easy to align items to each other.

When moving vertices and objects you can restrict movement to an axis and enter a distance to move. eg GX0.5 will move the selection 0.5 units on the x axis.

In the mesh display panel which can be found in the properties region N of the 3DView you can display the length of selected edges while editing.

The scene settings allow all sizes to be shown using metric or imperial units rather than an arbitrary unit.

As you are modelling buildings you might be interested in the Archimesh addon which you can download here - this addon has recently been added to the standard addons and will be included in the 2.78 release.


How to perform trig functions on a vector element-wise? I'd like to get the cosine of all elements in a Vector in Blender's python. Should I just use numpy for this?

Edit: I was tired when I wrote this and kind of mis-posed the question. What I actually meant was that I have a list of all the blender Vectors containing x, y, and z, and I want to do things like calculate the cosine of each x. But this answer does a good job of addressing the question that I actually wrote and it put me on the road to solving the problem I was trying to solve so I'm accepting it.

You could use the map list functionality

new_vector = Vector(map(lambda x: sin(x), list(vector_variable)))

maybe even better

new_vector = Vector(sin(x) for x in vector_variable)

see here


How to set specific location as an object's default (0,0,0) So, my specific problem is the following:
I have a scene setup with multiple cameras in it.
When I add a new object like a cube, I would like it to have the camera's position as it's default location (0,0,0). Or in other words, I'd like to have the location coordinates of the object being relative to the camera position.
I can instantiate the object at the camera position using the 3D cursor, but that still gives me the world coordinates as the object's location.
I thought that "apply" does set the transformations to 0,0,0 at the current position, but turns out it doesn't.

I couldn't find a way to do it, but I might just not be searching with the right key words.
So any help on how to achieve this is much appreciated.
Thanks a lot!

I'm not exactly sure what you want to achieve, but if I understand it correctly, you want the camera to be the origin of an object? And the position of the object should be relative to the cameras position? If that is the case, use an empty at the cameras position, set it as a parent to the camera and all the corresponding objects. I'm not at my computer at the moment, so I can't try but it probably works if you set the camera as parent as well. All the best Marco


Invalid texture dislplaying I'm using Blender 2.83.2 and I tried to create a carbon fiber texture, following steps shown in this video. It definitely worked when I applied it on a simple meshs (plane, cube, sphere etc created in object or edit mode):

But when I try to change something in a mesh, texture goes distorted and sometimes even loses different colors. For example:
I created a plane in edit mode and it has normal texture. Then I just extruded one of its edges and moved it away so it can be illuminated. But its texture is the colors of the edge (it was extruded from) that are stretched along it. Then, in the same mesh, I created another plane and deleted one of its vertices and created a new face using "New Edge/Face from Vertices" (triangle on a picture below). And it has only the color:

I tried deleting the material (in the object properties and even in the .blend file) and applying it again; restarting Blender and computer; switching shading from textured to solid and back; rendering a picture using camera (textures didn`t change). All normals are directed properly.
I am not professional in Blender yet (i don't even know how shader editor works, I just repeated all from that video). So I wonder why this happens and how can i fix it and not to get this problem again.

When you change things about the mesh the UV for the textures doesn't actually update. To do that, you just need to click "u" on your keyboard and choose unwrap. You can also open the UV editor and make more complex changes from there.


Finger Isn't Flexing OK, I am new to rigging, so hopefully this is an easy question to answer.  I've got a finger rig, which I made by following a book, to be specific, the Second Edition of Oliver Villar's book, Learning Blender.  Here's a picture.

The big bone, called C_Finger_1, is the bone I use to control the finger.  When I rotate it, it rotates all the fingers, as it should.

However, when I scale it down, it should flex the finger, but it doesn't.  The fingers do nothing, except they flip when I scale the C_Finger_1 bone past -1.

I am very much a beginner to this sort of thing.  Could anyone point me in the right direction?

You need to:

Deactivate the IK's rotation option (don't know what is for, it's off by default):

Bend the bones a bit in Edit mode so that Blender knows how to flex it.

Once bent, correct the Pole Angle of the IK bone:


How can I get the bottle glossy W/O the label too? Having a little trouble with getting the bottle glossy and not the label. As you can see there's a glass node... so the bottle should have some gloss anyways --right? When I use the diffuse node (instead of the glossy node) the label has the nice matte finish (as it's supposed too) but the bottle has no glossyness. But when adding a glossy node instead of the diffuse that makes the label glossy and yet still does nothing to add gloss. What am I doing wrong? Suggestions?

There is nothing wrong with your setup other than the lights and the surroundings of the bottle... Remember, glossy materials reflect the environment. So make the environment something worth reflecting...

Instead of adding a bunch of point lights, create large light sources...

Since you are so invested in creating bottles, take some time and study how most images of glass and alcohol and beverages are lit. You'll find out soon enough that when dealing with glass most photographers have big light sources and interesting patterns to be reflected on the shiny surfaces.

One more thing to try in your setup is to use the yellow letters as a mask for  the glossy shader, so that the purple part of the label can be diffuse and only the writing has a reflective surface


How do i make shape key driver only show up when it rotates backwards in the x axis I created a corrective shape key for a quadruped leg, for when i move it backwards. I want the shape key only to appear when the leg rotates backwards in the X axis, but it shows when i rotate the leg frontwards too. i tried limits and restrict frame range, but i didn't get any results.

You can duplicate the Bone.046, set a copy rotation of the original in local space, followed by a limit rotation constraint, and use it as source for the driver.
As it is a copy it will inherit every parenting options.
Limit rotation must be last in the stack.


Can I create Walk throughs from external designs Can I create a design(house) using Sketchup, import the design into Blender and then create a walk through presentation using Blender?

Regards,
Dion

You may try to press shift+f in the viewport, and then tab to turn on gravity, this let's you walk around scene using WSAD and space for jump. Additionally, you have "height" and "jump height" settings in bottom left part of preferences/input tab pref_pan http://www.pasteall.org/pic/show.php?id=86222


HDRI / Spherical Images display in view port? I have seen a video where it look like you can take an HDRI spherical background and use it as the background in the view port. It even rotates with the camera.

The question is how do I set this up? I have even gone as far as pause the video but I do not seem to have the right "Nodes." Where is this world node? Where is this texture coordinates node? I am using cycles engine. Is there a step by step for version 2.73 that shows how to set this up and show in the view port?

The exact same can be accomplished by selecting the world tab in the properties editor, clicking use nodes, and setting the color to environment map. You will still need to open the file location.


How do I hide objects in the final render? I just finished a character model, and I'm trying to render T-Pose shots of it for my portfolio. The character looks fine in the rendered preview in the 3D viewport,

but the render itself ended up looking a bit different.

I found out that this was because everything in the file appeared in the render. Is there a way to hide objects from the render without having to delete them from the file?

Make a new collection and move the other objects to it. Then when you want to render, disable (not hide) the collection.

Alternatively, you can enable the "Render Disable" icon in the outliner by first selecting the "Filter" tab and clicking the render toggle icon (the little camera)

After this, the camera icon will appear in your outliner next to your objects (where the viewport hide "eye" is). Click it to toggle whether or not the object will be hidden in the render:


How do I force objects to follow another object? I'm trying to add a ring of diamonds to a character's wristwatch in a game, and it all works well until I get to testing it in-game, where the diamonds don't really follow the path of the watch at all. I've tried various forms of placement and functions I thought would solve my problem, but nothing has worked so far. Is there a specific blender function that let's me pin and object to another object so that it moves in tandem with it?

Hmmmmmm. Can't manipulate the model at. Try making a base mesh that fits the models shape, parent THAT to the model, add the watch and ring to that base mesh.  Delete the mesh but keep the accessories. This should. .."SHOULD" fix the axis problem as if the base is positioned properly, the watch and ring should inherit is rotation, scale and all that jazz from the mesh when you delete it but keep the watch and ring "IN" the initial mesh object.


Textures always show up in pink I am really new to Blender, and by the title I mean that when importing/creating a new texture, blender always says that there are missing textures, I have succeeded in painting/importing textures on this same file before, but now it's not working anymore. I have tried the report and find missing files feature, but that does nothing. Any help would be appreciated.

Select your object and go to the shader editor, add an image texture by pressing shift>A and then connect the image texture node into the base colour. In the iamge texture node press open and select your file or just open the dropdown menu and select the file from there. Now go to the texture paint workspace and check. It will not be pink.


A problem about bevel after bool modifier I created a plane and extruded it to a cube. I added a bool modifier and a bevel modifier. Then i saw wrong result happening as the image shows. I tried to find out why and turned out that a cube(not a plane extruded one) with the same modifiers worked fine. So i'm wondering what's the reason causes that.

With your lower object (the cut one) selected, click on the Modifiers Tab in the Properties Panel, and check the order of your modifiers in the stack. I have confirmed that when your bevel modifier is above your boolean modifier in the stack, the result is your picture above. When the boolean modifier is moved above the bevel modifer, the bevel then goes all the way around, as it should. You end up with triangles at the corners of the resulting surface, however. But this may not matter, depending on your project. If you don't want triangles at the corners, consider a different approach: Do the boolean only, and apply it. Then in Edit Mode, select the face that makes up the new surface, and press i to inset it. After initiating the offset, but while the tool is still active, press Ctrl to allow the newly resulting face to be extruded in the direction of the face normal. The end result is that you will now have a bevel that doesn't consist of any triangles. The flip side is that the resulting bevel will only exist for this one face, instead of all faces.


Can the areas of an object in shadow be accessed in Cycles In Cycles can I use the amount of shadow cast onto an object as a Fac. input of a mix shader?

This would be useful for setting up a Frost / snow material that is visible in shadowed areas but has melted in lit areas.

I know I could do it by baking shadow maps for the various objects, but I wondered if there was a procedural way to do it.

Maybe if I could create a vertex paint layer using the shadow info this could be used and would save the texturing (my scene is already quite complex - several hours per frame)

Any thoughts?

No, this is not possible in cycles.

As a workaound, you could render a diffuse pass in a different renderlayer and then use that as the mix factor, see Is it possible to use the output of a Renderlayer in the material nodes of another RenderLayer?


Subdivision Surface Artifact with Creases I'm currently in the process of modeling the nose section of an aircraft. I started by creating the outlines of the cockpit windows, which need to be straight so I creased them. Then I connected this outline with cross-sections of the fuselage. To obtain the rounded shape of the fuselage I added the Subdivision Surface Modifier. This is where I ran into a problem. I cannot get rid of the artifact shown in the picture below.

I tried to add more support loops and played around with the crease settings. It looks like due to the Subdivision Surface Modifier the mesh gets bent in a weird way. I suspect this could be a topology issue.

Does anyone have an idea how to solve this artifact and/or give me a pointer on how to improve my overall topology? Thank you in advance for your help.

EDIT: Added .blend file

Your geometry is not exactly flat. If you look at it from the top, you will see this.

I suggest moving your vertices like this:

But your main problem is that the creases end inside the mesh. If you extend them all the way to the end of your mesh, it will be without artifacts. Like this.

You can also clear the crease and insert two edge loops. I find it slightly easier to control the exact bevel this way. Use ctrl + R to create a edge loop. Click on the faces where you want it. Slide it up where you want it. Left click to finish placement.


Can't make my animated object follow a path I made a spider with a walk animation. I would like to make it follow a path, so I made a bezier curve and tried to do what I've seen in tutorials, but nothing works. In fact, I don't know which part of the spider I have to use: spider, armature, bones...?

Here is the link of my blend file :

Just parent the main parent object to the curve. Select the large circle then Shift select the curve. Now CtrlP then choose "Object".

And... voilà:


Problem with matrix_parent_inverse of childs of bones I am trying to move around objects by manipulating their transformation matrices with Python. If the objects are in a parent/child hierarchy you have to step down this hierarchy using the object's matrix_parent_inverse element. My code works fine with one exception: In case an object is a child of an armature's bone the child has a matrix_parent_inverse I do not understand.

Say, we have a cube as child of a cone as child of a cylinder, i. e. the hierarchy cube -> cone -> cylinder. bpy.data.objects["Cube"].matrix_parent_inverse gives me the inverse matrix of the cone at the time of parenting. Fine.

Now we have the same situation (at least in my opinion) when the cube is the child of a bone. The hierarchy is in this case cube -> bone -> armature. bpy.data.objects["Cube"].matrix_parent_inverse should give the same result as in the first situation but it does not. So my question is: What is the meaning of matrix_parent_inverse in this case or how can I get the correct one?

Sample code showing the different results (Blender 2.71):

import bpy

#------------------------------------------------------
# Make a parent hierarchy
# cube -> cone -> cylinder
# "->" means "is child of"
#------------------------------------------------------

# Delete the scene:
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete()

# Create a cylinder at location (2, 3, 4):
bpy.ops.mesh.primitive_cylinder_add(location=(2, 3, 4))

# Create a cone and make it the cylinder's child at the same position:
bpy.ops.mesh.primitive_cone_add(location=(2, 3, 4))
bpy.context.scene.objects.active = bpy.data.objects["Cylinder"]
bpy.ops.object.parent_set(type='OBJECT')

# Create a cube at (0, 0, 0) and make it the cone's child:
bpy.ops.mesh.primitive_cube_add(location=(0, 0, 0))
bpy.context.scene.objects.active = bpy.data.objects["Cone"]
bpy.ops.object.parent_set(type='OBJECT')

# Print the cube's parent inverse matrix:
print(bpy.data.objects["Cube"].matrix_parent_inverse)

#------------------------------------------------------
# Make a parent hierarchy
# cube -> bone -> armature
# "->" means "is child of"
#------------------------------------------------------

# Delete the scene:
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete()

# Create an armature at (2, 3, 4), a bone is created automatically as child:
bpy.ops.object.armature_add(location=(2, 3, 4))

# Create a cube at (0, 0, 0) and make it the bone's child:
bpy.ops.mesh.primitive_cube_add(location=(0, 0, 0))
bpy.context.scene.objects.active = bpy.data.objects["Armature"]
bpy.ops.object.mode_set(mode='POSE')
bpy.ops.object.parent_set(type='BONE')

# Print the cube's parent inverse matrix:
print(bpy.data.objects["Cube"].matrix_parent_inverse)

# => output:
#<Matrix 4x4 (1.0000,  0.0000, 0.0000, -2.0000)
#            (0.0000,  1.0000, 0.0000, -3.0000)
#            (0.0000,  0.0000, 1.0000, -4.0000)
#            (0.0000,  0.0000, 0.0000,  1.0000)>
#
#<Matrix 4x4 (1.0000,  0.0000, 0.0000, -2.0000)
#            (0.0000,  0.0000, 1.0000, -5.0000)
#            (0.0000, -1.0000, 0.0000,  3.0000)
#            (0.0000,  0.0000, 0.0000,  1.0000)>
#
# Both matrices should be the same but aren't.

Thanks to mont29's hint I have found a solution:
A bone seems to have two representations:

bpy.context.active_pose_bone.matrix_basis
<armature>.data.bones[x].matrix_local

Dependant on the context (pose mode/object mode) one sees the one or the other. There is a rotation by pi/2 around the x-axis and an offset of 1 in the z-axis between them. Here is the sample code from above again, the correction to make the second matrix equal to the first is added at the end.

import bpy
import mathutils
import math

#------------------------------------------------------
# Make a parent hierarchy
# cube -> cone -> cylinder
# "->" means "is child of"
#------------------------------------------------------

# Delete the scene:
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete()

# Create a cylinder at location (2, 3, 4):
bpy.ops.mesh.primitive_cylinder_add(location=(2, 3, 4))

# Create a cone and make it the cylinder's child at the same position:
bpy.ops.mesh.primitive_cone_add(location=(2, 3, 4))
bpy.context.scene.objects.active = bpy.data.objects["Cylinder"]
bpy.ops.object.parent_set(type='OBJECT')

# Create a cube at (0, 0, 0) and make it the cone's child:
bpy.ops.mesh.primitive_cube_add(location=(0, 0, 0))
bpy.context.scene.objects.active = bpy.data.objects["Cone"]
bpy.ops.object.parent_set(type='OBJECT')

# Print the cube's parent inverse matrix:
cmpi=bpy.data.objects["Cube"].matrix_parent_inverse
print("cmpi:")
print(cmpi)

#------------------------------------------------------
# Make a parent hierarchy
# cube -> bone -> armature
# "->" means "is child of"
#------------------------------------------------------

# Delete the scene:
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete()

# Create an armature at (2, 3, 4), a bone is created automatically as child:
bpy.ops.object.armature_add(location=(2, 3, 4))

# Create a cube at (0, 0, 0) and make it the bone's child:
bpy.ops.mesh.primitive_cube_add(location=(0, 0, 0))
bpy.context.scene.objects.active = bpy.data.objects["Armature"]
bpy.ops.object.mode_set(mode='POSE')
bpy.ops.object.parent_set(type='BONE')

# Print the cube's parent inverse matrix:
mpi=bpy.data.objects["Cube"].matrix_parent_inverse
print("mpi:")
print(mpi)

#------------------------------------------------------
# The correction to make the second matrix equal to
# the first
#------------------------------------------------------

ri=mathutils.Matrix.Rotation(math.pi/2, 4, 'X').inverted()
ti=mathutils.Matrix.Translation(mathutils.Vector((0,0,1))).inverted()
mpii=mpi.inverted()
mpiiriti=mpii*ri*ti
mpiiritii=mpiiriti.inverted()
print("mpiiritii:")
print(mpiiritii)

# Output (some formatting added by hand):
#
# cmpi:
# <Matrix 4x4 ( 1.0000,  0.0000,  0.0000, -2.0000)
#             ( 0.0000,  1.0000,  0.0000, -3.0000)
#             ( 0.0000,  0.0000,  1.0000, -4.0000)
#             ( 0.0000,  0.0000,  0.0000,  1.0000)>
# mpi:
# <Matrix 4x4 ( 1.0000,  0.0000,  0.0000, -2.0000)
#             ( 0.0000,  0.0000,  1.0000, -5.0000)
#             ( 0.0000, -1.0000,  0.0000,  3.0000)
#             ( 0.0000,  0.0000,  0.0000,  1.0000)>
# mpiiritii:
# <Matrix 4x4 ( 1.0000, -0.0000,  0.0000, -2.0000)
#             (-0.0000,  1.0000,  0.0000, -3.0000)
#             ( 0.0000, -0.0000,  1.0000, -4.0000)
#             (-0.0000,  0.0000, -0.0000,  1.0000)>


CLI How to render last frame of hair dynamics sym? I have a script that generates random hair
I want it to play animation from 1st frame to 250th, and then output a rendered image of 250th frame, or simply give me the 250th frame without playing animation (that would a be better option)

Here's my code to play animation:

# Animation Frame Timer
def stop_playback(scene):
    if scene.frame_current == 250:
        bpy.ops.screen.animation_cancel(restore_frame=False)

bpy.app.handlers.frame_change_pre.append(stop_playback)
bpy.ops.screen.animation_play()

bpy.data.scenes["Scene"].frame_set(250)

I have 2 scripts. One for generating hair, and one for rendering my output image.
I use this command in terminal to execute it:

#!/bin/bash
frames_cnt=#needed number of images
output_frame_path='BlenderRepository/RenderedImages/LongHair'

for (( i=1; i<=frames_cnt; i++ )); do
  echo "Rendering frame ${i}/${frames_cnt}..."

  (
    cd /home/ds/Documents/blender2.80/
    ./blender --background una.blend --python BlenderRepository/Scripts/Config/LongHair/LongHair.py --python BlenderRepository/Scripts/Config/LongHair/RenderLongHairImage.py -- "${output_frame_path}/frame_${i}.png"
  )

  echo "Frame ${i}/${frames_cnt} has been rendered"
done

When I executing my script via terminal, I suppose it gives me the 1st frame as output. Well, formally its 250th frame, but it looks like 1st frame, as you can see here:

And here's example when I manually execute my scripts via blender one by one:

You can see that the animation has been played, and its 250th frame, as hair lay down. I executed my 1st script for generating hair, wait for animation to run from 1 to 250th frame, and then executed the 2nd script.

So my question is how can I make it work automatically? Is it possible to make it work that way in the --background? I mean I want my second script wait for 1st script to end animation run, so I can get the right image of 250th frame.

2 Particle Systems code:

psys = ob.particle_systems[-1]
psys1 = ob.particle_systems[-1]

pc = psys.point_cache
pc1 = psys1.point_cache

print(pc.frame_start, pc.frame_end)

bpy.ops.ptcache.bake({"point_cache": pc}, bake=True)
bpy.ops.ptcache.bake({"point_cache": pc1}, bake=True)

Bake the Pointcache

Here is a test script that bakes the first particle system on context object to first point cache.

import bpy
context = bpy.context

ob = context.object
# assume we have a particle system
ps = ob.particle_systems[0]
pc = ps.point_cache

# match bake to animation
print(pc.frame_start, pc.frame_end)

bpy.ops.ptcache.bake({"point_cache": pc}, bake=True)

Have a look at the PointCache members in the API, and will see that among others it has

pc.is_baking
pc.is_baked

Now to test this in bg mode.

Confirmation

Can confirm that, with script above named test.py the command blender2.8 is an alias to my blender version 2.8

blender2.8 -b test.blend -P test.py -f 250

when run on blend that is no more than  default cube, with default hair particle system, (with dynamics) produces following output

Read blend: /home/batfinger/blender/test/test.blend
1 250
bake: frame 1 :: 250
bake: frame 2 :: 250
bake: frame 3 :: 250
bake: frame 4 :: 250
...

bake: frame 248 :: 250
bake: frame 249 :: 250
bake: frame 250 :: 250
Fra:250 Mem:182.13M (0.00M, Peak 183.09M) | Time:00:00.33 | Syncing Cube
Fra:250 Mem:182.17M (0.00M, Peak 183.09M) | Time:00:00.38 | Syncing Lamp
Fra:250 Mem:182.17M (0.00M, Peak 183.09M) | Time:00:00.38 | Syncing Camera
Fra:250 Mem:182.18M (0.00M, Peak 183.09M) | Time:00:00.41 | Rendering 1 / 64 samples
Fra:250 Mem:182.17M (0.00M, Peak 183.09M) | Time:00:00.77 | Rendering 26 / 64 samples
Fra:250 Mem:182.17M (0.00M, Peak 183.09M) | Time:00:00.97 | Rendering 51 / 64 samples
Fra:250 Mem:182.17M (0.00M, Peak 183.09M) | Time:00:01.07 | Rendering 64 / 64 samples
Fra:250 Mem:124.26M (0.00M, Peak 183.09M) | Time:00:01.30 | Sce: Scene Ve:0 Fa:0 La:0
Saved: '/tmp/0250.png'
 Time: 00:02.24 (Saving: 00:00.94)

/tmp/0250.png


Jittering cloth when simulating I have this problem where when the cloth plane falls onto the object (A smooth edge square)it jitters a lot similair to how elastic reacts when pulled and released. Im not sure what to do. Any advice?

So Im sorry it took a while to get back to this question, I solved it by adding a ton of subdivisions which for whatever reason stopped the jittering.


Can not edit only a part of my object in edit mode blender: 2.90.1 I am fairly new to blender, so please don't assume I have tried to do something that seems obvious to you.
Blender: 2.90.1
I am trying to make an airplane in blender, I am following a tutorial (its a two part tutorial, this us the part I was on), when I go into edit mode, it allows me to edit almost any part of the object (there is one object and 3 empties, which are pictures), but it does not allow me to edit one specific part of the object. it allows me to select that part of the object using the face select and edge select, but for some reason not the vertex select, it also does not allow me move or resize that part of the object (I tried both with the shortcuts and with the side-bar), but it does let me delete.
Here is a picture of my blender in object mode:

Here is a picture of my blender in edit mode with vertex select (the red circles are indicating the parts that are not select-able):

There is a reflection (I forgot the exact terminology), so whatever is edited on this side of the plane will be replicated onto the other side.
It is very probable that I pressed the wrong short-cut at the wrong time, I have done that many times, but I couldn't find a correction for this anywhere, so here I am.
Thank you in advance :D

while you may think there is one single object, I suspect there are child objects, expecially since your object is named Cylinder.002 (implying there might be other Cylinder objects.  Try expanding the Cylinder.002 object to reveal the children.

Be sure to exit the Edit mode of the parent before trying to select another object.
Also, you can recover File: Recover from a previous session or Auto Save.


Odd unselected/light-colored face when UV unwrapping torus? Whenever I unwrap a torus in Blender (2.92), I always see a single face that appears unselected (i.e. appears plain grey rather than orange tinged) despite its vertices being selected:

I see a similar effect in both the UV Editor and the 3D Viewport.
I don't see this effect when e.g. working with a UV sphere or a cube.
It doesn't seem to affect anything but I'm wondering what Bender is trying to tell me with this light-colored or unselected face?

That's the active, not unselected. Active is usually the last selected face/edge/vert. Sometimes it's very useful for example if you want to copy modifieres to the selected objects from the active or bake textures from other objects to the active, or merge verts to the last selected's position, or if you want to use UV wrapping by "Follow Active Quads"
https://docs.blender.org/manual/en/2.80/scene_layout/object/editing/transform/control/pivot_point/active_element.html


How can I display the "length" of selected keyframes (number of frames in-between) Sometimes in the Dope Sheet, I want to find out quickly the number of frames it took to get from one pose to another. I'd imagine some kind of tool to let me specify a start frame and then an end frame and it would tell me how long was that in terms of number of frames. But so far it seems there's no such tool. I tried Googling and can't find anything there either.

Does anyone know of such a tool or plugin to let me do this? And if not, can anyone direct to as to which part of the Python API to look into to start getting into creating such a tool?

So I ended up trying to make an add-on by myself. It works, but the code is a mess, since it's been years since I last did anything in Python, and I know little about the Blender Python API. But it works.

Source code is here (MIT license): SelectedKeyframesLength.py


Creating an object out of other objects I was wondering if I could make an object out of other objects.
Example: The surface area of a cube will be made out of small hexagonal prisms.

I was wondering because I would like to create an armored suit made up of small triangular prisms. Also I want for the triangular prisms to be part of the mesh so that when I add an armature to it, it will move with the mesh.

1) Duplifaces (or dupliverts)

After creating the object to duplicate (hexagon in this case) and parented it to the armored suit, you should enable in the parent's Duplication panel (in the Object tab) the option Faces.

By enabling the Scale option, the hexagon will be scaled accordly to the face's size, so in the part of the mesh where the quads are more dense, you'll have more dense hexagons too.

Till you don't Make duplicates real, the hexagons will be attacchet to the mesh. This can be really helpful in animating meshes with shape keys, or transfer cloth simulation from the parent to the child without involving all the duplicated geometry.

Note: that you can study the hexagon pattern in a way that can cover the whole suit without leaving spaces, in order to completely replace the base mesh, but a more suitable way to do this is:...

2) Tissue add-on

As stated by the creator:

  Tessellate tool allows the user to copy a selected object (Component) on the faces of the active object (Generator), adapting its bounding box to the shape of quad-faces.

There are a few option that can help you in the modeling, such as automatically vertex merging, proportional Z-scale. I think that is currently the best option to repeat a pattern on a surface while adapting the geometry to the face scale and get an organic look.

I was in hurry and I didn't used hexagons but octagons because the pattern was easier, but I'm sure that with some time you can get the effect you want.

The add on is currently in develop, so it still doesn't support shape keys, uv,... but they are working on.

Here's the blender artist thread about it.

The add-on include also another feature, called "Dual mesh" that:

  ... modify the selected meshes creating dual meshes. Dual Mesh output is a polygonal mesh derived from the triangular mesh. Quadrangolar meshes are automatically converted to triangular before.

Balsically youll'get a pattern of hexagonal N-gons from every mesh, which you can extrude.

Triangulate your mesh, that simply run the command and you'll get:

Than you can extrude individual faces to get an invincible-dragon-scale armor:

Credits:
Armor suite model from blendswap made by simitron


Help with smoke simulation scaling and appending I am putting together a preset pack of different types of smoke simulations (explosions, candle flame, after burner, exhaust etc... )

I would like the user to be able to append any of the smoke scenes to their scene. The only problem is if their scene is not to scale, when they resize the smoke sim to fit their scene it will drastically change what it looks like.

Is there some sort of Simulation scale feature they can use?

Or can anyone think of a creative way to help the user be able to scale the smoke sim and have it look the same at any scale?

Here are some examples:

Let's say this is the original sim that I always want it to look like.

This is a brand new blend file with the smoke scene appended, with the smoke sim copy and pasted to the new scene and scaled down (or up doesn't matter), the scaling has NOT been applied.

This image is the same but WITH the scaling applied.

In these examples there is not much of a difference between the NON-applied and applied samples (but even between these there are differences, especially with some of my other sims).

I understand that the scale affects how the smoke looks. The solution I am looking for is to have my original smoke sim to look the same no matter what scale the user uses.

I am using openVBD.

You need to adjust the density for how much you scale the smoke. If the original scale was 1.0, the new density is:
$$
density' = density / scale
$$
If you want exactly same render result (from scaled camera closer/further from smoke), you will also need to adjust the Volume Sampling Step Size under Properties > Render Tab > Geometry:
$$
stepsize' = stepsize * scale
$$

The density can be adjusted by a driver from the material node tree. I added extra node, so the user still has the option to manually adjust:

The driver looks like this, I chose the Z axis as input:

The others can be locked from user input and their value copied from Z axis with drivers:


Is there way to make an object gravitate or lock to the surface of another object? For example, if I want to make an controlled object move on the surface of a sphere (or a cube, or whatever else) and not fall off, what should I do?

I don't need it to jump, so I don't need "sphere gravity", just to "glue" it (but if there's a simple way for sphere/cube gravity, you can tell me).

As far as I know, there is no way to specify the force of gravity per object. However, in world settings, you can set the global gravity to 0, and then you can apply whatever forces are actually required (to simulate desired gravity effects) via python.

For example, if I wanted to attract physics-enabled objects to the faces of a cube, I could do it with the following script, running on that cube:

def apply(cont):
    cube = cont.owner
    for o in cube.scene.objects:
        normal = o.rayCast(cube, o)[2]
        if not normal: continue
        g = -normal * 9.8
        o.applyForce(g)

As you can see,  I iterate over all objects in the scene, and I cast a ray from the object to the cube, in order to get the normal vector of the intersected face, which, when negated, represents the direction of the desired force I wish to apply.

After that, it's just a matter of scaling that vector, and passing it to applyForce.

Here's a .blend that shows this script in action: custom_gravity.blend


Object animate and deform follow path not working I hope you are having a great day.

I am following a tutorial to make an object, in my case something that will eventually be modeled into a bendy bus or tram, and at one point I followed the tutorial and it worked, even in 2.79b and 2.8, but I have since been unable to get it to work.

What is happening is that as I set up the triangles using the offset and then creating single user out of each, when I click play, they all return to their origin. In the video, they stay where they are.

I have watched the linked video many times, but I cannot get it. I have linked to a blend file to show what I am getting at.

I am aware there is a similar question, but I only want the object to deform in specific places.

Thank you very much.

The video tutorial

The blend file

I figured it out. I had a serious middle-aged moment. As each new triangle is added, it needs to be keyframed in. Doh!


Add-on not showing up in Blender 2.82 Today, I downloaded Blender 2.82 and attempted to install an add-on that would allow me to export models in a format compatible with the program MikuMikuDance (MMD for short). After doing my research, I attempted to install the add-on while all the files were in a ZIP folder. However, no matter what I try - changing the add-on directory in the Preferences, getting rid of excess dots in file names - the add-on won't show up even though a message indicates it was successfully installed. I've tried looking at other questions regarding similar issues, but nothing seems to help, and I'm at the end of my rope here.

(I don't have the reputation to comment this: Powroupi's latest version of Blender MMD Tools works through version 2.90 (my version). Download it here.)
As mentioned by Kisracora, the plugin needs to be unzipped before the mmd_tools folder can be inserted into the addons folder. (If you're on Windows, you can simply enter the zip folder without unzipping and click-drag the mmd_tools folder in.) If doing that and enabling the plugin in Blender DOESN'T get it to show up, you may want to try rightclick > Properties > Unblock the zip (checkbox near the bottom of the Properties window).


Screen one shader onto another? I have two shaders. One with highlights and one without. Is there any way to make the highlight layer pure black and white, then screen (blending mode) that onto the other shader so that I only get the white portion of the shader.

I've tried several methods, but have failed. I want to make sure the hilight shader is pure black and white too, because otherwise, when I boost the environment color it polutes the shadows.

Here are my two shaders I wanna use:

I know I could accomplish this with render layers, but I'd like to solve it all in one material if possible.

Any help would greatly be appreciated.

I eventually found the answer through trial and error, here was my solution:


Why does vertex merging cause non manifold geometry? I am having issues with some non-manifold geometry.. I understand there are a few types or a few sources of non-manifold geometry, but I can't find the exact issue with my model..
I noticed most of it, if not all, was located where I merged vertices together. Why would this cause non-manifold geometry? I thought the goal of the merging process was precisely to make sure I had a unified mesh?
Here is the file in question, maybe I missed something:

Your mesh contains flipped faces, which is considered non-manifold geometry.
It's probably not caused by merging vertices, and it's easy to repair

Select all faces
Go Mesh > Normals > Recalculate Outside
Done.

After this, there are still some non-manifold vertices on the outer rim, because the mesh isn't 'closed'.


How to make the ocean become increasingly dark? I aldready have a ocean shader and it looks like that:

but how can i make the ocean become increasingly dark like that "without" ocean modifier?  :

sorry for my english, and thanks for advice :)

Use a volumetric shader plugged into the volume output of a material.

Add you flavor of surface shader to your liking like a glass, refraction, or mix of transparency and glossy.

Then add a Volume Scatter or Volume Absorption to the Volume socket of the material and adjust both its color and density to your liking.


How to sculpt and move that figure around I am kind of new to blender and am just getting use to making things that remain in one position. This question might not make sense but I was wondering if there was anyway, once you've finished modeling say a human body could you put it in a different position, (say in a bath tub with legs up on tub) without sculpting a different thing. Like could I grab parts of my first model whos just standing straight and put them in different positions without messing up the whole mesh? Every time I try and move a body part the whole thing gets messed up. I hope that makes sense... thanks!!!

In Sculpt Mode there's a relatively recent addition called the Pose Brush.  It attempts to move parts of your model as though you had rigged it with a skeleton.


Set background color: always black despite horizon color? The documentation here says

So I followed, setting mine as follows

However, the rendered background is still black instead of white, as below.

What might've gone wrong here? Many thanks in advance.

If you would like to view the background in the viewport, in the Properties Tool Shelf (Shown by pressing the "N" key) and under the "Display" tab, check "World Background"


Help me understand Renderers, especially in 2.8 I was struggling to follow a 2.79 online tuts in 2.8 until I found this thread 2.8 Adaptive Subdivision

So now I see that Adaptive Subdivision and MicroDisplacement are part of the Cycles Experimental Renderer.  As a new user and beginner of Blender this was confusing to me, I thought the difference was due to the version not the Renderer. (please don't waste our time by criticizing my choice to use 2.8 to follow 2.79 tuts, it's not helpful)  Here are some specific questions that might help me understand better.

Why does Blender have several renderers? {Workbench, Cycles, Eevee}
(2.79 had BlenderRender and why did it go away?)
What criteria should I use to determine which one to use?  (I was struggling to find Adaptive Subdivion in Eevee as I expected it to be part of Blender, not tied to a specific Renderer)
What other items should I be aware of that will differ from Renderer to Renderer and might contribute to my choice of Renderer?
Since Eevee is newer than Cycles, is it a BETTER Renderer?  If so, why doesn't it support Adaptive Subdivision or is it simply baked in by default?
Can you point me to any educational material that explains and compares these?
How long will Adaptive Subdivision be 'Experimental' - I've found videos that go back a bit and would have expected Adap Sub to have moved out of experimental into core
My main goal is to texture terrains generated from heightmaps .  What is the BEST Renderer for that task?

Thanks in advance, this is always a helpful site

Thank you for stating your question so clearly.
1.) Many different representation engines in Blender 2.8 will allow you to navigate, differentiate, represent volumes (smoke, fire, etc), heavy dense scenes and realistic light bounce materials and environments. You´ll learn in time how to use them to the best of the representation for each case.
2.) Workbench: when you want to see lot of objects inside an archviz scene, EEVEE: if you want to see the completed materials/textures in real world light conditions), etc..
3.) Eevee doesn´t support adaptive subdivision like in cycles at the moment. No further notice have been given about this, don´t know if it will be implemented, as the engine per se, is different than Cycles (EEVEE is screen space based effects only)
4.) Right not there isn´t a specific tutorial, but upvote me as answer and click on the left side checkmark icon of this post because:
1. When you model: Work in workbench using wireframe
2. When you sculpt: Use workbench in solid mode
3. When you create your materials/textures: use look and dev mode (flat light or Hdri or Studio light)
4. When you´re lighting: Use look and dev
5. When your're ready to render switch to EEVEE or CYcles.

There are some nodes that will only work for eevee, not for cycles, and backwards.
The only way to know what to use is to ask around or watch tutorials. No guides specifically filtering those nodes have been created up until this moment.

4.) To answer this you need to search for "screen space effects". Which in addition "What the camera sees is computed into a 2D space, takes the info of any normal or UV space around it, and applies a certain code to "compile" a result of light calculation".

5) There are many tutorials. I´d bid you to search for "eevee light reflection probes" to start with.

6) Experimental only means not every user has a necessity to use them, so it´s best for the system to have it "dormant" until this function is needed. Blender makes a "wake up" call to many functions in it´s code. They are activated at the time of need. This is the reason why you open Blender, loads up necessary components and starts up in less than 5 seconds. Compare that to a larger (fully loading .dll applications that can take up to 1:30 minutes to load up).

7) World machine is superb. Just keep generating procedurals using Cycles. The only way for now. Unless you bake a high poly displacement and THEN take that huge poly count into EEVEE. But this is just a work"around" method.

BFCT_Schiller


Blender 2.77 Motion Vectors I am new to Blender and trying to render out motion vectors on animated objects.  I animated a cube and did what I thought was correct and it rendered nothing.

See video: http://www.knottypixel.com/BlenderMotionVectors.mp4

Would appreciate any help.  I am sure I am missing an obvious step.  It crossed my mind that the speed output of the render layer node could possible not be in the range of 0-1, 0-1, 0-1.  Does it require a conversion?

Thanks!

Some times vector passes like depth or motion can't be displayed directly because they are 'out of range' of displayable values (I think , not really sure)

Anyway all you need to do is to bring these values within range by using a Vector > Normalize node

Have in mind that to actually use the vector pass the original 'non displayable' values are sometimes the correct ones that will produce the desirable outcome even if they can't be displayed correctly directly.


Game Character walk through wall, even with Dynamic physics Recently, I was developing a 3D Maze Game using Blender Game Engine. I set my character and maze walls physics to Dynamic with Convex Hull collision bound. when I test my game, my character walked through and sometime pushed the wall!. Using Static physics will give an unsolid wall. My character are controlled using Simple Motion by keyboard.

Actually, the maze itself was created inside a box and the box itself has been solidified (using Solidify Modifier). The maze wall are a big single object so there is no reason to use collision bounds option other than using Convex Hull or Triangle Mesh.No Ghost option checked in this project at all.

I had followed all advice and tutorial from Youtube and other Blender Forums, but what I got is still not a solid wall, and even made the maze wall being pushed by my character. Is there any workaround to make the maze wall fully solid so the character couldn't get through wall?

Blend file here : Google Drive - main_lite.blend (Removed textures and sounds to make it smaller)

Unfotunately, I don't have enough reputation to add more links here.

I'm indonesian after all, sorry if there's bad english.

You Character needs to be dynamic, and the walls/scenery static.
Don't use the "simple motion" part of the motion actuator either. Put it into servo mode (drop down box) or set the linear velocity of the player. (The object needs to be dynamic for these options to appear).

Try playing around with the physics and motion in a completely seperate blend. Try making a prototype with just cubes - this way you'll learn what the various physics options do far better than if someone tells you.

For reference:

Static: It stays still when things collide with it. It will not collide with other static objects
Dynamic: position influenced by collisions and forces, but will not rotate
Rigid Body: position and rotation influenced by collisions and forces.


How to remove the dark, sharp outlines in this water splash simulation? I made a simulation where two oranges fall diagonally into the water.
In the rendered animation, when the water splashes, dark sharp outlines are revealed.

I do not want those weird formations in the simulation.
How can I remove the outlines, while still maintaining a pure white background?

Water material:

World properties:

Edit: For clarification, I do not have denoise checked, and smooth shading is turned on.

As you can see in the screenshot, this happens for the drops that aren't round, but rather triangular. If you set the default cube to smooth and give it a glas material it will look similar. There is not enough geometry to support proper transmission behaviour. 3 solutions.
Set it to auto-smooth. This is a hack, while it will save you RAM it's bound to flicker in an animation and might cause strange artefacts, worth a shot though.
Use a subsurf modifier after the water, quick fix, will increase render times.
Increase the simulation detail. The latter will increase your simulation time and render time, but also will yield more precise results.


How to find find all possible arguments to classes in bpy.types.*? I know I can use something like print(dir(bpy.types.FModifierLimits)) to find all possible "attributes". But what about arguments?

bpy.types.FModifierLimits(arg)

How would I print arg?

To answer your question directly.

An existing instance is always passed into classes from bpy.types, however this is not common usage when creating new classes in the Blender Python API.

Blender/Python types aren't instantiated by calling the classes.

To create a new object for eg:

obj = bpy.data.objects.new("name", None)

not:

obj = bpy.types.Object()

There is one use-case for calling a class, and that is to create a new instance of existing data (however this is quite esoteric and not normally useful in practice).

This example creates an instance of a subclass of bpy.types.Object.

>>> class MyObjectSubclass(bpy.types.Object):
...     def my_helper_function():
...         print(42)
...
>>> obj_a = bpy.data.objects.new("name", None)
>>> obj_b = MyObjectSubclass(obj_a)
>>> obj_a is obj_b
False
>>> obj_a == obj_b
True
>>> obj_b.my_helper_function()
42


Random black line appearing on glass texture from interaction of noise & fresnel node Removing noise makes it go away somehow.

Without noise

Glass nodes

The background is HDRI

How about something like this :

The Bump node uses the Noise to generate a Normal for the shaders. The 'bumpiness' can be adjusted via the Distance of the bump node. The Layer Weight node can be adjusted to vary the amount the angle with the glass affects the bumpiness (so shallower angles appear more bumpy while 'straight on' viewing is effectively flat).

Note that this is obviously a non-physically based material (since the bumpiness is directly affected by the viewing angle).


Cycles normal input relative to object's rotation In continuation to this questions:

Visualise texture based on direction a surface is pointing using Cycles

Mapping the XYZ colors to faces based on their normal orientation works great. But if I rotate the object, the normal values change. This is even the case when the object is parented to an empty.

Is there a way to lock the normals to the local rotation of the object? Or is this always calculated based on te global values?

Thanks to Mr Zak for the pointer, I started fiddling with the vector transform and that gave me the desired result.

This is without the vector transform:

And this is with vector transform:


Reduce number of edge rings I have a tube that has too many edge rings. I would like to reduce them with a 10:1 ratio or something similar. When I try and use a decimate modifier I get bad topology. Is there a non-manual way to do this?

In the upcoming 2.71 release there is a better way to achieve this.

Select edge ring (Ctrl+Alt+RMB)
Checker De-deselect, See note below!
Select -> Edge Loops
Mesh -> Delete -> Edge Loops

Note:

In 2.71 support has been added to deselect alternate edge-ring, See: https://developer.blender.org/T40324
This is detected automatically.

Previous answer, obsoleted by the method above

This is possible but a little cumbersome

In vertex mode select a loop running along the length
Select -> Checker De-seelct
Hide
Set edge mode
Unhide
Deselect the vertical loop
Select -> Edge Loop
Mesh -> Delete -> Edge Loop

Footnote, it may be worth adding a skip option to edge-ring select, which would make this only 2 steps.


Why is the texture mapped differently in these Two Cuboids? The left is default cube with one half removed using a Boolean Modifier. The right one I got using a second default cube and moving the bottom 4 vertices up a meter/unit. Both seem to have the "same" origin. Still, when using ProWood, the two give different results.

What am I getting wrong here?

In your image it looks like the texture mapping is created on the mesh prior to changes made by modifiers (whether it is generate or UV or whatever doesn't matter here). This is causing the texture to appear to be split in half on the one with the boolean.

If you clicked apply on the boolean modifier they should look the same.


How to get wind to affect hair particles with group or object render I am using a group to get more variation in grass stalks as per this tutorial. Unfortunately that tutorial was for a still image so did not cover wind or other force fields.

From various other tutorials I set up a wind force field. If I set the render of the grass to "Path" as can be seen, the effect is very strong.

However, as soon as I change the render to "Group" the wind effect disappears.

While beginning to write this, I noticed a question Why does not wind force field affect grass field made with hair particles?

In that case the user had used an "Object" render and had the same problem. I checked and sure enough, if I change "Group" to "Object", the wind also has no effect.

So my question is: Is there some way to have a hair particle system affected by wind if using object or group render, or is it limited only to path render?

For reference, here are my particle settings:

Finally I understand what @Brenticus was getting at when he kept using the word "deform"! If you use either the "Object" or "Group" methods to render the particles, you can in fact affect the rotation and/or location of the objects. Here is a video showing that much:

But what is missing is (in this case) the grass stems deforming along the hair particles. Here is the comparison:

So the answer to my original question is outlined below in my previous answer. I only need to add that you must rotate the object(s), generally 90 degrees along the y-axis because "hair particles use the global +X axis as 'up'". That is the case for either method.

That method works if it's not important to deform the object(s) along the hair particles, and you get the benefits of "Group" options, which are quite powerful. However, in making the comparison videos I noticed that the render time was considerably longer using that method, which is another thing to keep in mind.

If it's important for the objects to deform along the hair particles, then I strongly suspect Brenticus is right and that using a particle instance modifier as per this post is just not the best but the only way of doing it. I spent several hours looking for a way to get group objects to deform and could not.

Previous answer (for Group and Object render method)

The first part is the "initial orientation" which I had set to "Global Z" so that the grass grows straight up. Changing this to "Velocity Hair" was one necessary change.

The second part is in the force field wind settings. Under "Effect point", I had deselected "Location" because I only want to affect the rotation of the grass stems. I guess that thinking was faulty. Selecting "Location" got the grass moving.

So I now have the wind affecting the grass.


How to invert gloss on a procedural texture? How can I make the upper layer/exposed part glossy. Currently I have the
opposite, the lower part/holes is glossy, while the more exposed outer part is
rough.
What I want:

What I have:

I suppose it's glossy because it starts melting sooner.

In your node setup, the roughness (a.k.a. glossiness) comes from a color ramp:

So the simplest solution seems to be replacing black with white and white with black on that color ramp. At least if you properly diagnose your problem as being the opposite to what you want - because inverting those colors will invert the roughness.


Is there a method to create bl_info using variable? I have noticed that when creating addon, if the bl_info is create with variable. The script will break the addon system. Causing disappear tab after restarting blender:
desc = 'Run script in any space with given name of script'
import bpy

bl_info = {
    "name": "Run specified script in all context",
    "description": desc,  # Here, a variable. (And WTF is this code highlight?)
    "author": "hikariTW",
    "version": (0, 1, 0),
    "blender": (2, 80, 0),
    "location": "TextEditor",
    "support": "TESTING",
    "category": "Interface",
}

Is there any workaround or this is normal when dealing with static examine of script when Blender try to list them out?
The test is done in Blender 2.83.4

Further testing which also break addon:

f-string and str.format
formatting with const-like 15 'foobar' without variable.
Conditional Expression: "foo" if True else "bar"

No
Sure this is a dupe, have searched and searched,
For want of a better reference

https://developer.blender.org/T53617
bl_info must be declared in the module.
This is because bl_info is extracted without executing code.

ie the bl_info dictionary is grepped out of the addon module top level file (foo.py or foo/__init__.py) as a string where the  locals will not be available.


Blender script Python check the rotation is change, or active Hi im not a python master... im a really  noob.
Is possible determinate if a object rotation on pivot point and if false or true
assign a value for example 0-1 or 1-2?
i dont work  in game engine.

The following python script will iterate through the "areas" in the current window to find 3D views and print what the pivot point is set to.

import bpy

for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':
        print(area.spaces[0].pivot_point)

One thing I have noticed is that if you change the pivot_point in one 3D view it changes in any other 3D views you have open.  This leads me to suspect that the information exists elsewhere in another data structure, but I have not figured out where.

See also How to set cursor location, pivot_point in script?


How would you model this led strip? I'm quite new with blender, so this might be a stupid question.
I want to model and render something like the attached image, but I'm not able to keep the light normal to the helix curve. It keeps twisting in a weird way.
I tried with the screw modifier and with the curve modifier and I was not able to model it.
And how would you add the straight end to the strip?
How would you do it?

Here’s one way to do it:

Start with a profile mesh for the strip:

Add a Screw modifier with 0° for the angle and a suitable number of iterations:

Add an Archemedian Spiral curve with the appropriate parameters to get the rough shape, and in the curve properties, set the Twist Method to Z-Up.

Add a Curve modifier to the strip object with the Deform Axis set to Z:

The trickiest parts of this seem to be getting the normals correct on the extruded mesh produced by the Screw modifier and getting the twist right on the curve. Checking the Calculate Order box in the Screw modifier options seemed to help with the normals, and using the Z-Up twist method for the curve produced the right twisting.


parent an object to a bone in python I'm trying to parent an object to a bone in python without using operator
So I did this :

object = bpy.data.objects['object']
armature = bpy.data.objects['Armature']
bone = armature.pose.bones['bone']

object.parent = armature
object.parent_bone = bone.name
object.matrix_parent_inverse = bone.matrix_local.inverted()

the object is on the tail of the bone it must be on the head
What should I do?

I have been having a similar problem and using bone.length only works if the head of the bone is on the origin.
A more general solution is to find the vector from the tail back to the head and add that to the parent_matrix_inverted.
This function appears to work for bones regardless of their orientation. Note the rig must be in pose mode for this work otherwise rig.pose.bones will be empty.
def parentBone(rig, boneName, geo):
    bpy.context.evaluated_depsgraph_get().update()
    bone = rig.pose.bones[boneName]

    geo.parent=rig
    geo.parent_type = "BONE"
    geo.parent_bone = boneName

    vec = bone.head - bone.tail
    trans = mathutils.Matrix.Translation(vec)
    geo.matrix_parent_inverse = bone.matrix.inverted() @ trans


Can I run a Python script step by step in Blender? Can I run a python script step by step with normal blender, a build, external software or an addon?

I'm developing a script (town generator) and I want to  to execute the code step by step like a debugger. Is this possible?

Edit: it's possible with the eclipse software check this link

Launch blender from a terminal emulator.
Add import pdb; pdb.set_trace() to your code where you wish to start debugging from.
Run your code and you'll be put into the Python debugger, where you can use sEnter to step through the code.

See the pdb documentation for more info on usage. Also for the nicer ipython debugger (features syntax highlighting and tab completion), you can use ipdb.


Thick Cyan lines on edges on export - import mesh? When i enter Edit mode with my object i have thick cyan lines on every edge. I made my model with blender and the exported it to .obj without saving cause i wanted to import it in another project. Then when i entered edit mode in the project where i imported it there are cyan lines on every edges of the mesh. Here's a print screen of what's happening.

What are those? And how to get rid of them?

Thank you.

EDIT:

Ok, i tried random Things, and apparently is some "Sharp" stuff. So if you go in CTRL+E and select "Clear Sharp" it should disapear.

Those line represents the "Make sharp", there seems to be a bug that create those make sharp edges when exporting meshes. To remove them go to edit mode, edge selection mode. Hit A to select all edges. Then Hit Ctrl + E and select "Clear sharp" from the drop down list.


How do I remove the line gap things after separating some meshes? (apple peeling) I'm trying to turn this apple into a monster like thing. I've marked 4 parts that are showed in the images, which are the parts that will peel off and the apple will move on 4 legs during my future animation. Problem is, when I separated by selection for the meshes, the black lines around the areas appeared, they are not needed and I have no idea how to fix it.

Using the Data Transfer modifier to transfer vertex normals from an uncut whole apple to an apple that has been cut up into several seperate objects, (slices).

To the whole uncut apple object, apply any modifers.
Open up the Object Data Properties panel and enable the Auto Smooth option.

Give this apple object the name apple_whole.

In Object mode make a copy of apple_ whole.

Hide the "apple_whole"object.

Give the newly created object the name "Slice"
Add a Data Transfer modifier to the slice object.

The Source Object will be apple_whole.

Enable Face Corner Data and select the Projected Face Interpolation option.

Select Custom Normals.
In Edit mode selected the different slices and separate them into separate objects.

The the apple should now be sliced up into a number of different objects and each of these objects should have the Data Transfer modifier.

If you look carefully in the screenshots below you should be able to see the difference between a sliced apple without the Data Transfer modifier(on the left) and the sliced apple with the modifier (on the right).

Note; Thankyou to BGibonus (model) and AGF81 (texture) on Blend Swap for providing the Cylcle_compatable apple, free of charge, that was used in this post.


Render only has gray textures The "rendered" viewport in the editor shows my model just fine.

But once I actually render it it doesnt render the materials with it, instead everything has a gray texture.
It doesnt render any lighting either.

I am using the cycles renderer.

Here are the nodes:

You have a material override set in your Scene>Layer panel. (Where it says 'Material'). Hit the cross in there to deactivate it.

EDIT:

Newer versions of blender don't use layers, but "collections" so the override function is in the scene>View Layer section.

Additional info:

Where is the Layers panel in Blender 2.8?

2.8 - Is it possible to assign (override) a material to a whole collection?


Deform camera path to the shape of ground surface I have a landscape plane and a camera following a path. I would like to deform this path so that the camera stay a constant distance to the landscape. This is to simulate the effect from the view of a car that moves on a road. What could be a good way of doing that?

You could use the shrinkwrap constraint on the camera with the distance set appropriately to keep it a fixed distance above the surface. If you place this constraint below the follow path constraint on the stack it should work fine. This won't deform the path itself, rather it will modify the distance above the surface that the camera is after its position is set by the path.


How can I make a simple volumetric light on Cycles? I'm trying to do a volumetric light on Cycles, and I've followed tutorials, but nothing has worked yet. How can I make a proper volumetric light in Blender, like the following one?

But to leave the light in the middle, like, almost a star, is this possible? I'm at the point to use an image plane besides the light which would be better... I need to use it moving the camera.

I'm actually trying to do this because I want to simulate the brightness of the Sun.

I tried the effect, but it still gave me an error:

That kind of effect is easier to do in the compositor using a Glare node. Is not as computationally intensive as dealing with volumetrics.

If you absolutely want to do it with volumetrics you can try this:

Around a sphere that works as the emitter, place an object that will give you the shape of the rays.

Give it an opaque material and make it invisible to the camera.

Add scattering and absorption to your world's volume settings.

Keep in mind that when dealing with volume scattering and volume absorption your lights might need to be much, much brighter, and you'll be dealing with increased noise and possibly more fireflies. So you'll need a lot more samples and maybe and play with the settings for clamp indirect.


How to serialize simple materials? I have a bunch of Blender files with similar content. The files share a lot of common objects with identical names. I would like to propagate materials between the files. I plan to achieve this with a script that maintains a database of materials and associates them with objects based on their names.

All the materials will probably be simple - just diffuse and specular components. Some of them will perhaps also have a texture. However, it seems that rna2xml does not work on such a simple material:

for o in context.scene.objects:
    for m in o.material_slots:
        rna2xml(root_node="Material", root_rna=m.material)

Here's the output:

<Material>
  <texture_paint_images>
  </texture_paint_images>
  <texture_paint_slots>
  </texture_paint_slots>
  <texture_slots>
  </texture_slots>
</Material>

Looks a bit too empty (no diffuse, specular components).

Moreover, it seems that Material does not have _ _dict__ attribute nor an _asdict() method, and _ _slots__ appears to be empty. Well, theoretically could look through the attribute list provided by dir(), but I'm probably approaching this issue from the wrong side already.

Edit: For completeness, I also verified that pickle produces identical output for materials with different diffuse colors.

Except for hard-coding material parameters (which should be simple in my case - because I just need simple materials anyway), are there any ideas or suggestions?

I'm using Blender 2.76 on Windows 7 x64.

Decided to try the dir() approach until someone proposes a better solution. Seems to be working for simple materials without textures, as well as some modifiers, etc. To me this looks pretty dangerous, tho.

In order to later update Blender objects based on the generated dict, I had to skip read-only properties.

def bl_to_dict(bl_object, ignore_getters=True):
    """Generic Blender object to dict converter."""
    skip_attributes = ['__doc__', '__module__', '__slots__']
    supported_basetypes = [
        "<class 'bool'>",
        "<class 'int'>",
        "<class 'float'>",
        "<class 'str'>",
        "<class 'list'>",
        "<class 'set'>"
        ]
    # TODO:: Add support for more types for which casting helps.
    supported_casts = {
        "<class 'Color'>": 'list'
    }
    # TODO:: Figure out how to support bpy_prop_array, bpy_prop_collection, etc.
    # TODO:: Perhaps recurse on members of more complex classes.
    d = {}

    attributes = [x for x in dir(bl_object) if x not in skip_attributes]
    for name in attributes:
        # Get attribute value.
        val = getattr(bl_object, name)
        # Ignore getter properties.
        if ignore_getters:
            try:
                setattr(bl_object, name, val)
            except AttributeError as err:
                continue
        # Check against supported types.
        type_str = str(type(val))
        if type_str in supported_basetypes:
            d[name] = val
        elif type_str in supported_casts:
            d[name] = eval(supported_casts[type_str])(val)
        #else:
        #    print("Type {} of attribute {} not supported yet.".format(type(val), name))
    return d

def dict_to_bl(bl_obj, bl_dict):
    """Update a Blender object from a dict."""
    for key, val in bl_dict.iteritems():
        setattr(bl_obj, key, val)
    return bl_obj

# From here on it's easy to either convert the dict
# to a string, to pickle, json, p-code or whatever it.

Disclaimer: The code is provided as-is. It's not guaranteed to work or anything. Getting and resetting random properties (basically what this code does) might seriously mess up stuff in Blender.


Strange vertical black stripes I'm new to Blender fluid simulation and want to fill a cylinder with water.

As you can see in the following image, it fills up the cylinder, but on the rendering result, there are strange black stripes.

I tried to increase the fluid resolution to 300, but it didn't resolve this issue.

The skyblue background is composed of 3 planes. I thought open space in other three axis could be a cause, so I put that cylinder in a cube, so that it resides in a closed area.

Unfortunately, it didn't solve the problem neither.

Does anyone have an idea what causes this problem? I would really appreciate your help.

Your container is not properly scaled:

CTRL + A with your Container object selected, then apply Scale: no more black stripes.

Please note: in the image below I turned off object FluidDomaain for more clarity.

Sorry for poor english


Mirror modifier creates new vertices in weird ways I'm a Blender newbie and I'm trying to use it to make a simple model for a 3D project. I'm trying to edit a cube with a mirror modifier to make a symmetrical shape, but when I drag some vertices to a side in edit mode it creates new vertices on the other side instead of moving the symmetrical equivalent:

What am I doing wrong?

The Mirror Modifier, unless it's configured differently, mirrors a mesh around the Object Origin. It duplicates any geometry on the other side.

Usually you shouldn't cross the mirror glass. But when you add the default cube, 4 verts are left of the O.O. and the other 4 are right of the O.O. So it's not the best place to start.

Here are the 4 stages, shown with cubes:

Every vertex is on the left side of the middle, everythings fine.
4 verts are left and 4 verts are in the middle. That's where clipping comes in. It will glue any verts to the middle that try to cross it. It doesn't repair any tresspassing. Be careful when you do that with a cube. It will trap a face in the middle which can lead to unclean topology.
That one's not too healthy: most cubes are on the left side but one is on the right side. You can do that but it requires more attention.
That one causes sort of bad geometry. the original and the mirrored mesh intersect, edges are crossing the line. z-fighting can occur when the faces are parallel to the mirror axis.

Now, technically you can do any of that, you just have to be careful not to cause unwanted effects.


Re-Polygonize a tessellated / triangulated mesh? I have this mesh:

As you can see, the faces are triangulated. I want to know if there is a way to re-polygonize the entire mesh (make use of NGon support in Blender 2.63+), or a modifier or something else

Assuming you have no way to access the original (non-triangulated mesh), there's no way to get the exact polygons back, which may have existed at some point in some other application. But you can try several things in Blender, to get some polygons from any triangulated or tessellated model.

You can try the Limited Dissolve operator (X), which removes less important geometry using an angle to determine the importance (a subdivided plane will turn into a single quad using an minimal angle of 0.001°, since it's flat).There's also a modifier, that acts the same, but non-destructive: Decimate set to Planar.
Less automated, but potentially better results are achievable with Dissolve Edges. Switch to edge select mode, select the edges you wanna get rid of and execute the operator (X).
You can also select multiple triangles and try to join them using Make Edge/Face (F).


what's the use of edge made by 'f'? As you know, edge made by 'f' shortcut across a face do not divide the face.

I don't know why this type of edge is necessary in Blender.

Is it not sufficient only one type of edges(dividing face) exist?

Please tell me the case in which 'f' type edge should be used.

One case where I've used F on a face is when I want to create a new object starting from some of my pre-existing geometry. By using F then P, you get an edge that won't affect original mesh when you separate it out. In the case that you just added a new object, you would've had to snap the vertices onto the old object to line things up. While it doesn't save a lot of time, the little things do add up.

Also, trying to create a check for "don't fill in the edge if the two vertices are part of the same face" can become problematic very quickly.

Take this example below: I want to fill in an edge between these two vertices. They're all part of the same big n-gon and I clearly want a new edge, but a blatant, "don't fill in an edge if the vertices are part of the same face" block would prevent me from adding the edge entirely.

There are many cases where it's better for the devs to design Blender in a way that helps prevent users from making mistakes. However, in cases like this one, it's probably better for the user to avoid making mistakes rather than having the devs try to do the thinking for you. It's more likely that the devs will introduce bugs, and it isn't worth the time to implement when there are many other bugs and features that they could/are working on (in my opinion).


Jagged Edges in Eevee I am getting jagged edges in the rendered view. In viewport the edges are smooth.
Using Eevee render engine.
Can someone help.

This appears to be an issue with the resolution of your render. Try going to the Output Properties tab under the "Dimensions" section and increase the resolution of your render. Also ensure that the resolution % is set to 100 to achieve the maximum quality.
When moving around in the viewport, resolution is mainly limited by your monitor or computer screen, but when you render a scene, the resolution of the camera is now the limiting factor to how sharp your rendered image will appear. Increasing it should help produce a higher quality image and reduce how much you are able to see the jagged edges.


How to force a node group input field to display a slider? I have created a couple of node groups with some "group-inputs-sliders" (The one called "Roughness" in the bottom picture). I would like it to have the blue-bar slider like the blender native ones. Thanks (:

You cannot change a field to display a slider once it has been initialized as a non slider. But it works both ways, if you initialize a field with a slider (Such as a factor input in a mix RGB), and then change the input to something else, the input will keep its slider.
Explanation :

CTRL + G to group several nodes.
You can get rid of the Mix RGB afterwards.
To remap the min and max values of the slider, when inside the node group, open the "N" panel with N or click on the left facing arrow in the top right of the screen and select your slider input. You can then change the min and max values.

Note : It also works for colors for instance. In this case the RGB channels will get replaced by the factor value. Although it is considered bad practice to link different colors inputs/outputs.


Switching a bone's head and tail I was trying to set up IK on a model I'm using for animation, when I noticed the foot was trying to bend the hip rather than the knee:

I think this is because the thigh bone is facing the wrong way (the head should be at the hip, and the tail should be at the knee).  If that is what is causing this problem, is there a way I can switch the head and the tail without deleting the bone?  If that isn't the problem, what is the problem I am having and how do I solve it?  Thank you.

I figured it out.  For anyone trying to figure this out in the future, select the bone in edit mode, press w, and click switch directions.


Marking Seams with Mirror Modifier? As you can see the mirrored part has solidified, and when I press z the geometry is lighter and not selectable. Is it possible to mark seams? :/

In the modifiers tab, any modifier that's in use has 4 buttons: Visible in Render, Visible in Object, Visible in Edit, and Vertex selectable in Edit mode. Press the last one, the one with the form of an inverted triangle. That should make the mirrored part be selectable in edit mode. Anyways, whatever you select there will also automatically be selected on the other part of the mesh that's the original mirrored and vice versa, because they are mirrored. Making seams on whichever of them will make the seam on the other, even if you did not select the mirrored vertex to be visible in edit mode.


Weight painting issues with Rigify? So I made this character but every time I try to rig the clothes it doesn't work, the base, hair, eyes and pupils work fine but everything else wants to pull on itself....how can I fix it? Thanks!! This is the file:

The simplest way to get decent weights on clothing, especially tight-ish clothing like you're showing, is via a data transfer modifier from your body.  Select vertex data, vertex groups, from nearest face interpolated, nominate your properly weighted body as the target, hit generate data layers, apply the modifier, and then ctrl-p parent it to your body's armature using (no-description) armature deform.

A very good alternative to this is to use a surface deform modifier instead.  Nominate your body as the target, bind, and you should be good to go, even without parenting to the armature.


Temporaly set an Armature to Rest Position i need to do some calculations which only work in Rest pose. So i tried to do:

pose_position = arm.data.pose_position
arm.data.pose_position='REST'

# Do some calculations on the mesh objects bound to the armature

arm.data.pose_position=pose_position

But this simple idea does not work.

However, when i select Rest Position from the Blender User Interface before i call my script, then the script creates correct results. So the question is what does pressing the Rest Position Button in addition and how can i do that from Python as well?

You don't need to switch pose_position, because tail, head, matrix and so on are not affected by keyframed poses if you access the Armature data (Object.data.bones[#]).

If you access the pose data however (Object.pose.bones[#]), the properties will change based on the current frame.


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

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

In other words, I need to take an image that is the same shape as the face and use it to create the actual 3D texture using a displacement modifier (the resulting object will be 3D printed).

I know how to do this on a simple plane/surface, but I'm running into trouble in this scenario.  The main problems seem to be:

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

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

I think you'll need to use a UV map here as using a vertex group does not seem to give a good result.

As you want to use a displace modifier you'll need to subdivide your shape a lot. But, whatever the subdivision level is, the precision of the displacement will be limited by the texture resolution itself.
So, if the model is to be 3D printed, both resolutions (subdivisions and texture) will matter.

First, make your UV map :

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

Adjust your UV map

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

Set your texture as displacement
And use UV as texture coordinates

Subdivide your face (a lot)

Adjust the displacement

Note

If you need to do this on several faces :

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

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


How to connect/bridge those edges most efficiently? How to connect/bridge those edges:

without nonsense like this:

thanks for your help :)

You can't really do it "without nonsense" since the other side has way more vertices than the other. You would need to either add some vertices to the farther side or remove some on the closer one. You should tell how you want it to end up so it would be easier to fix your problem.


I pressed alt+f to change the camera view and I do not know how to revert to the original camera MOVEMENT My camera movement (the viewport camera) in blender has become strange after pressing alt+f (and possibly other keys). When I scroll in with my mouse, the camera moves toward the origin instead of where my viewport is 'pointing'. The camera also rotates around the object that feels different than the original setting. I've already tried moving the cursor to center and pressing (.) on numpad but this hasn't worked. How do I completely reset camera movement?

Just found the solution: Messed up zoom navigation, need help! (somehow I locked the view to the object which can be changed in the panel where you press N to hide and reveal it)


How do I copy selected faces on a rigged character to a new file? I want to copy to another file selected faces from a mesh.

This has always been a pain and I assume that this is the the only way to do it.

You CTRL-C the selected object that has the faces you want to move, open a new file, hit CTRL-V, then start removing everything it took with it, such as the skeleton, the unwanted parts of the object, etc.

Is there a way to just copy faces and paste them on a new file?

Go into Edit mode, select the faces you want to separate
Duplicate the faces, separate them into new object with P
In Object mode select object with the separated faces. Rename it accordingly
Save your file
In a new file execute Append from file, choose the renamed object from the file you saved before


Can't make BGE to accept the string "\n" string in exptression to activate an actuator I'm actually using Blender 2.77 while reading Game Development with Blender.

In an example it's being used the string "quit\n" in an expression controller
to make the user press the sequence of keys: q   u   i   t   ENTER to exit the game ones it's started.

I've tested the logic and everything seems fine, but the escape sequences, indeed as an example if I set the string to be "quit" only as I press the sequence q   u   i   t the game quits.

The book I'm reading is been written for use with Blender 2.66 so things may have changed since then.

What I'm asking is how do I make the BGE interpret "\n" as the in-game RETURN key pressure in my expression?

Link to the file:

https://1drv.ms/u/s!AtGBzQ7WE96SiQdyBaATCPbQfocY

CR is no printable character. The keyboard logger does not do anything with it (tested in 2.76).

Better use the  (measured by a separate keyboard sensor) as event to evaluate whatever the keyboard logging already measured.

Typically on such an event, you:

evaluate whatever was entered
clear the log buffer
process whatever the evaluation resulted on

This also means you do not need to evaluate while entering the string (but you still can).

Here is a demo:

logging: logs printable keyboard input to property "Text"

evaluate: input confirmed on CR

help: evaluate if "help" was entered

toggle help: send a message "toggle help" when help was requested

reset input: clears the input field, allowing to enter a new phrase

I hope it helps


How to configure which Blender version opens when clicking on a .blend file? If I double click a recent blend file icon, the version of Blender that it calls is an old one.

The file was created using 2.76, but if I double click it it runs inside 2.72b.

If I right click it and navigate to 2.76, it still opens with 2.72b... or at least that is what I think it did. Am I imagining things? (I have just tested and that is what happens)

If I double click the 2.76 .exe it opens 2.76, but if I go to the file icon, right click and then navigate to the 2.76.exe it opens in 2.72b

I have 2.72b in a completely different folder called ART.
2.73 and 2.76 are in the normal Blender Foundation folder right next to each other. So what is causing the system to jump to another folder to open 2.72b?

This isn't a problem, but seems bizarre.

EDIT: Windows 10.  Yes, it is probably the O/S that is doing this, but it may mean that others have downloaded updated Blender, not overwritten the old install and are using the old version without noticing it. (It was a few weeks before I realised what was happening).

The thing to remember is to open Blender directly, check the splash screen and then File>Open.. the blender file. But finding the right version's icon is also hard because they don't include the version number in the icon. Perhaps it would be better if the icons change with each stable install the same way the splash screen changes.

I think I may decide to uninstall the old versions and see what happens.

For Windows:
On windows 7 right click on any .blend file and select open with and choose default program . Then use the browse button to navigate where the version you want of the blender program is on your hard drive, and select blender.exe as your default program to open this kind of file. To make the selection permanent check the box that says  always choose the selected program to open this kind of file.

On Windows 10 right click on the file and use choose other app:

Then on the next screen navigate all the way to the bottom and click on look for other app on this PC

On Linux it's basically the same procedure:
Right click on the blend file and select Open with other application

then from there navigate to the folder the blender version you want to use:

On OSX
Ctrl Click on the icon and select open with->Other and select the blender executable you want to use.


Passing float texture to fragment shader returns incorrect value in Blender 2.8 I am trying to pass image texture to fragment shader and read it back. But it only works if the color of the pixel is set to 0.0 or 1.0. The value returns to the buffer if the value is set to, for example, 0.2, is incorrect. I am using blender 2.8 with python script. I am totally new to Blender, so any suggestions are appreciated. Here is my code so far:

import bpy
import gpu
import bgl
import random
from mathutils import Matrix
from gpu_extras.batch import batch_for_shader
import numpy as np
from math import *
# from gpu_extras.presets import draw_circle_2d
import time

IMAGE_NAME = "Generated Image"
WIDTH = 4
HEIGHT = 4

vertex_shader = '''
    in vec2 position;
    in vec2 uv;

    out vec2 uvInterp;

    void main()
    {
        uvInterp = uv;
        gl_Position = vec4(position, 0.0, 1.0);
    }
'''

fragment_shader = '''
    uniform sampler2D image;

    out vec4 color;

    in vec2 uvInterp;

    void main()
    {
        vec4 result = texture(image, uvInterp);
        color = result;
    }
'''
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
batch = batch_for_shader(
    shader, 'TRI_FAN',
    {
        "position": ((-1, -1), (1, -1), (1, 1), (-1, 1)),
        "uv": ((0, 0), (1, 0), (1, 1), (0, 1)),
    },
)

# print(buffer)
# push buffer to blender image
if IMAGE_NAME in bpy.data.images:
    image = bpy.data.images[IMAGE_NAME]
    if image:
        bpy.data.images.remove(image)
        bpy.data.images.new(IMAGE_NAME, WIDTH, HEIGHT)
else:
    bpy.data.images.new(IMAGE_NAME, WIDTH, HEIGHT)

image = bpy.data.images[IMAGE_NAME]

#FIXED: set data
for i in range(0, WIDTH*HEIGHT*4, 4):
    image.pixels[i] = 0.2
    image.pixels[i+1] = 0.3
    image.pixels[i+2] = 0.1
    image.pixels[i+3] = 0.4

print(list(image.pixels))
# load to gpu
if image.gl_load():
    raise Exception()

offscreen = gpu.types.GPUOffScreen(WIDTH, HEIGHT)
# at the beginning:
start_time = time.time()
with offscreen.bind():
    bgl.glClear(bgl.GL_COLOR_BUFFER_BIT)
    bgl.glActiveTexture(bgl.GL_TEXTURE0)
    bgl.glBindTexture(bgl.GL_TEXTURE_2D, image.bindcode)

    shader.bind()
    shader.uniform_int("image", 0)
    batch.draw(shader)
    buffer = bgl.Buffer(bgl.GL_FLOAT, WIDTH * HEIGHT * 4)
    bgl.glReadBuffer(bgl.GL_BACK)
    bgl.glReadPixels(0, 0, WIDTH, HEIGHT, bgl.GL_RGBA, bgl.GL_FLOAT, buffer)

    # at the end of the program:
    print("glReadPixels: %f seconds" % (time.time() - start_time))
offscreen.free()
print(buffer)

Somehow, I figured out myself, this is quite a newbie mistake. The generated image should be created with float_buffer.

from:

bpy.data.images.new(IMAGE_NAME, WIDTH, HEIGHT)

to:

bpy.data.images.new(IMAGE_NAME, WIDTH, HEIGHT, alpha=True, float_buffer=True)

One more thing is that the alpha value should be 1.0 since it will be used as masks for other. Ref from documentation


High count particle conversion I have a hair particle system (basically a hedge with a lot of leaves).  I can't render because there are too many leaves.  Will converting them to mesh make blender run more efficiently?  Is there a better way to make this hedge with 1000 leaves x 100 children x 40 polys per leave work better?

Thanks
JS

The usual way to improve efficiency in such case, would be to use planes with leaves texture as leaves particles (this way you already have 40 times less polys for your comp to process). You could also restrict particle emission to the part of hedge, that is actually in the camera view to avoid too big number of particles. Creating branches with leaves on them and then using this branches as particles would be some solution too. By converting praticles to objects and joining them into one mesh you will also achieve better efficiency.


Cylinder has small wierd bumps when using Subdivision Surface Cylinder has small weird bumps when using Subdivision Surface

This is how subdivision works with faces that are created by that many vertices.
You'll see that on other parts of the cylinder, particularly the quads, that this effect does not happen. It's less of a problem, and more of just how the modifier works.
To fix this I suggest two things:

Delete only the face on top and extrude the edges left behind inward a couple times.

Keep the face on top, but create an edge crease along the top of the cylinder, (and use Auto Smooth if needed)

Creating an edge crease is done by hitting Shift + E, and you'll have to scroll your mouse out to get the full effect. The Auto Smooth is located in the Data tab and controls which parts of the mesh are shaded smooth or not depending on their angle respective to another/other face(s).


How to extrude X and Y axis on a traced object (flatten) Newbie to blender here. I'm trying to take a curve or traced object and essentially make it wider all the way around. I'd also like to do the same, later but make the same object thinner all around. I'm trying to make a cookie cutter for my daughter and I want to make the object below porportionally wider, then drop a copy of it (only thinner) on top and join the objects together, this will be the "stamp" or cutting edge. Am I thinking about this correctly?

I'd like to make the copy of this object much thinner and drop it on the top.

Thanks in advance!!!

which vertex are you referring to?

Not sure I understand you correctly, I am assuming you want a wider on top, narrower on the bottom section for the cookie cutter, one cutting side sharper edge, and one wider side to make pressure, is that correct?

If so, I'd say it would probably be easier to design the section you desire as a separate curve object, then use it as bevel object in your chicken curve.

It would probably work best if your chicken was a "single stroke curve" instead of a double curve with a designed stroke width.

Otherwise if that is not possible (I see bifurcating strokes in there) you may achieve a similar effect using a "half section" instead. Just make sure the wider part of the section is always narrower than half the with of the chicken stroke to avoid self intersections and artifacts.

EDIT

Here is an example file. Have in mind that if this is for 3D printing or other Computer aided manufacturing process, there may be geometric issues with production. Shape cleaned up and slightly altered to reduce some of the self intersections. Edit the "Chicken Cookie Cutter" object to control the shape of the section to your liking.