How would I animate this but not move the other side of cube? I am sure this is easy but for some reason I can't think how to do this correctly.

I need the monitor to go straight up, not at an angle.

The 1st gif is exactly what I am after, the 2nd gif is what I currently have. I have parented my pieces. Do I have to use bones instead? Thanks in advance.

Just add a Limit Rotation constraint to the piece in blue, provided the following pieces are parented in chain.

Make sure you set it to World Space coordinates, so it reads the absolute value instead of the parent.


Basic topology & bevel help - How to fix beveling issue? I'm trying to model a hangboard and I'm having a hard time getting my bevel to work. Can someone explain to me how to correctly bevel the top edges of this? Below is a couple images of it, followed by my attempt.

So my issue is the sloping parts on the top. I don't know how to correctly model them so that I can smoothly bevel them without artifacting. I don't know how else to block out the shape other than what I've done already. Obviously there are vertical faces whose edges meet at that top horizontal edge, but I don't know how to fix it. See my issue below:

Any advice is appreciated!

I've reworked your topology to get a more clean bevel, Try this:

By adding a little bit of thickness to the back face, you can allow more room for the bevel to run before it overshoots. But keep in mind there will always be artifacts if you push the bevel too far on any kind of geometry.
If you want a thicker bevel and more control over the mesh, you can always take a subd approach. But for this piece I don't think it's necessary.
Here's the blend file with the reworked topology:
https://blend-exchange.giantcowfilms.com/b/D2ZXy03E/
Hope this helps!


How to automate high resolution renders in bulk I have to render a large number of images at 8k resolution.
but blender takes a very long time to render a single image.
If I split an image into different parts then it renders one image with in minutes.
  But the problem is I have to render these images in bulk. Is there a quick and efficient way to handle this problem?

Rendering at 8k should not be problem for blender.

Rendering several small samples first is not faster than just rendering the whole thing.

A solution for your large amount of 8k renderings could be sheepit https://www.sheepit-renderfarm.com/index.php you can use it to have other people render your projects, or you could check the setting that allows only you to render it. All you have to do is upload your blend files and click a few buttons. (I'm not going to provide a step by step tutorial because there are thousands of easy to find tutorials on youtube like this one https://www.youtube.com/watch?v=0M8hO6k8Kqs)


Materialize app and realistic texture i used the materialize app by bounding box software to create the textures and it works great in the app the textures really look good but when applying them to the mesh the texture don't look realistic anymore.
The texture's when combined in the materialize app look like this:
But when i apply them to the mesh they look like this :
and the node setup i use for the textures :
Please and Thanks

Looks like your material setup seem to be wrong.
Check my example image for creating PBR setups in Blender. It maybe helps you:

You can read my short article for this topic, if you like:
How to setup PBR materials in Blender


Animated CopyLocation bone constraint delay problem I have set my rig with IK where I am trying to copy location of Bone of different armature (Sword) to my main IK bone (LeftHand) using Copy Location Constraint.

It works well but when it is animated there is always 1 frame delay at least it seems for me(maybe more). Means that target bone is 1 frame ahead compared to bone that copies the location. When I export animation via Fbx to UE4 the delay is clearly visible unless I change "Sampling Rate" 0.8 or less but then the exported animation contain a lot of unnecessary frames and exported file is a lot bigger... Thanks for any advice

The workaround for this problem is to bake animation of IK bone then move all baked keys 1 frame back and disable "copy Location" Constraint. Then the animation is perfectly smooth but it's very unpractical so when I change a little detail in animation, I have to rebake...


The right way to create a rectangle hole with rounded corners on some surface? The right way to create a rectangle hole with rounded corners on some surface?

I have this one, but my example working pretty bad with subdiv mod.

Solution like this seems well, but without subdiv mod it haven't rounded corners. I want nice corners with and without subdiv.mod.

If you're working with subdivision, something like this is all you need:

As you can see, you can loosen or tighten the curve by bringing internal holding edges closer to, or further from, the corners, or dispensing with them altogether.


Is it possible to use an image to edit a mesh to the image's size? I wanna make it so that the mesh i have is cut out in accordance with the transparnt png. So, i have a png with a drawing on it, and a transparent background, is it possible to change the mesh shape so that the background is gone, and the mesh changed shape in a way that its the drawing.

Its not possible, but if i have a vector image i can import it as a curve, and then convert it into a mesh

There are two methods I'm thinking of.

The first is using an SVG of the image contour.
Loading the image in Blender Using Import Images As Planes.
Import the SVG.
I converted the SVG to Mesh and applied the same material of the image.

The second try is using the Knife topology tool ( K ) direct to the imported image to cut the subject. No need for a vector-based program. Delete the unwanted faces.
This method was faster because all is done inside Blender.
Note we have to do short cuts to smooth corners.


Shortcuts do not work on the dope sheet. (2.8version) I am using version 2.8 of Blender.

The following shortcuts do not work on the dope sheet.

Is there a solution?

Ctrl + Shift → : next marker

Ctrl + Shift ← : previous marker

Shift + ↑ 10 : frames forward

Shift + ↓ 10 : frames back

Try Alt + mouse scroller

PS: I'm trying to fix my screencast keys but I was pressing Alt + mouse scroller


It is a mission impossible to edit a video My laptop is not the fastest one, and I created a blender project. There are a few stretched blocks. I unwrapped them and added a realistic texture.

I want to make a video with the length of 20-30 seconds. This video clip is decorated with a background music. But my problem is that I can't really edit the video, because the audio runs normal but the Video lags (~7fps).

I tried to look the preview only with materials or only with the objects. But nothing helped. I use Blender 2.8 alpha 2 (EEVEE).

In the later render everything is great but its a horror to edit. Any other ideas to show in the preview because even in wireframe mode it lags.

This has been a problem in blender for quite a while. Definately not a 2.8 problem. Not quite the optimal solution but it works is to turn the video into an image sequence and then import it as an image sequence. I usually use ffmpeg to convert the video into an image sequence but I don't know how easy that is from a non unix pc. You can always just import it into blender and export it as an image sequence. I did recently see what I think is a big improvement in the 2.8 video editor where I think this problem is fixed allthough I can't conferm because it crashed 1 second later.
A different problem which I don't think you are describing here would be just a framerate mismach so make sure your render settings fps is the same as that of your source video.
(If the fps counter is red the problem is probably the first one I mentioned, could still be both though)


Offset between rig and some mesh objects So I am learning blender through the tutorials and been going through the Mr. Squeegee one on https://cloud.blender.org. I have been playing with the rigs and somehow I made a mess and trying to figure out how to solve this.
How I got there: After following the tutorial, everything looked good, besides the fact that they did not IK the foot properly in the tutorial as they did not use the copy for the foot and so the foot would get detached if I transformed the body object too much or made him jump.

After I got the whole rigging going how I wanted it, somehow I messed up while toggling between pose mode and edit mode. Now some of my mesh objects are getting offset by the rig. If some one can point me in the right direction on how do i go about fixing this and what did I do wrong here, I would really appreciate. See attached blender file.

Here is the file:

You can simply set the rig in the center, select one by one the objects in the wrong position and Alt P "clear parent". Then, when everything is in place, re parent again with the right bone.


Array with Size Increment / Decrement I am trying to make a step-pyramid with hundreds of steps and it is far too tedious to size one step at a time.
My first instinct is to make an array with reference to a scaled object but this yields results with a curved slope.  For example, scaling by .9 produces:
100 x .9 = 90
90  x .9 = 81
81  x .9 = 72.9 ...

Where as what I am trying to simply subtract a value at each step:
100 - 10 = 90
90  - 10 = 80
80  - 10 = 70 ...

The above calculations apply only to the X and Y dimensions while the Z remains constant.
Here is a screenshot.  The pyramid on the left was generated with an array and has a curved slope.  The one on the right is the desired result with a straight slope and was made by hand.

Is there an easy way to generate the pyramid on the right?

The Add Mesh: Extra Objects addon has a step pyramid mesh. However, it has a maximum of 20 steps. That can be fixed though, by editing the script file.

The location of the addon's initialisation script is shown in the User Preferences window (see the image below, the part marked in green; this shows the location in my installation, and it may differ depending on what OS you're running). The script for the step pyramid is called add_mesh_pyramid.py, and it should be located in the same directory as the __init__.py file.
Open the file, locate num_steps and simply change the max value to something that works for you. With hundreds of steps, you may also need to change the min value of reduce_by to something lower.

To activate it, CtrlAltU to go to user preferences. Click the Add-ons tab, then Add Mesh, then the little check box to the right at Add Mesh: Extra Object. If you want the addon to remain after you close Blender, also click Save User Settings.

I haven't been able to get screenshots from Blender to capture the menus, so I can't show you, but the step pyramid will be available under Add > Mesh > Misc Objects > Step Pyramid. Here's the available settings to tweak it.


Is there a way to hide/remove parts of a fluid sim mesh so they won't show in render? I have my fluid simulation beneath a floor plane, and I only want the splashes that rise above the plane to be visible in the final render. I've been trying to find a way to make the pool of fluid below the plane invisible, but applying a boolean to the domain didn't work. I don't think an outflow object would work either, as I do need the fluid to be there in order for it to splash.
Is there any method out there for doing this?

In case of Particles System type Fluid, there is not a direct way to hide part of particles. You would have to convert sim to mesh.
In this example I used Metaball as particle (because Icosphere object keeps particle system after export).

export into Alembic format
import back and use Boolean Modifier

EDIT
OK I got it, you mean particles generated by Fluid Simulation (Mantaflow) - Liquid and Spray.

Yes, particles are not affected by Boolean Modifier.

So there does not exist a way to hide a part of released particles. So only way I know is to use Mball as particle and export-import it as Alembic and use Boolean.

Note: In theory - to exclude some particles from render you can influent particles size by Texture, so classic particle system can do this, but fluid sim particles doesnt have such feature.


Rendering a 2.79b file in Blender 2.80 I have created a shockwave in Blender 2.79b. I used 2.79 as it was easier for me to follow the tutorial. Now when I open that blend file in 2.80, the render results are not the same as 2.79b. I tried with both eevee and cycles. It seems 2.80 isn't recognizing the material and the compositing I did in 2.79b. Is there a way around this? Thanks

Danny

You got a Blender Internal render engine setting. It is not for Cycles, they don't use same material system(although they are all using node).

You will not able to directly import this material into Blender 2.80 and further version. Since they've discarded the old BI system and adopt EEVEE, which share the same material system, instead.

You might find out that node setting in 2.81(newest one) could probably do the same effect with more elegant node setting. Keep on keeping on.


Reflection "ghost" when using EEVEE Reflection Plane I'm trying to set up a nice looking partially reflecting glass plane in EEVEE. To test this, I just used a solidified plane, two Suzannes and a reflection plane.
What bothers me is the fact that the Suzanne nearest to the camera is reflected twice: Once seemingly correctly and a second time faintly and about half the expected size.
What am I doing wrong?
(Blender 2.91 on Linux with Nvidia drivers)
Edit: Here's the blendfile:
(Btw. anybody else having problems uploading blendfiles from firefox?)

Depending on what you consider to be the ghost reflection, you can use one of the following for the glass material:

Both use "backfacing" from the geometry node. To eliminate the ghost, we choose only one reflection (either back or front facing).
On left, the backface is reflective (as front face is transparent).
On right, the backface is transparent (and front is reflective).
0.25 is the alpha value.


Does Cycles support all (relatively new) CUDA GPUs? Are there any limits on the CUDA GPUs that Blender will support (besides really old ones)?

I thought I heard somewhere that Blender doesn't support workstation class (NVIDIA Quadro) GPUs.  But I have a couple friends with Dell m3800 laptops, and Cycles renders fine on it's Quadro k1100.

Are there any certain specs or features which I should look for to make sure Cycles will support it, or is CUDA enough?

Note: personally I am really just interested in workstation class GPUs since I want to be able to run other software (AutoCAD, Inventor, SolidWorks, Photoshop, etc.) which demand workstation class.  But for the sake of generality I'd like to leave the question genral.

GPU Rendering Page: https://www.blender.org/manual/render/cycles/gpu_rendering.html

Blender supports GPU rendering of CUDA cards with computing power 2.0 and above. (See chart here: https://developer.nvidia.com/cuda-gpus)

So as long as the GPU is on the NVIDIA CUDA chart with a processing power of atleast 2.0, you are good to go. If it not on the chart you are running a gamble whether it will work or not. (Unless of course your friend confirms specfic GPU will work because he has tried it.)

As for what to Specfically look for, I am not exactly the expert but I can say that Blender cannot render a scene IF the size of the scene is larger than the memory of the video card. For example:
A scene that is 2.5 gb will not render on a 2gb video card.
A scene that is 2.5 gb will render on a 3gb video card.

And obviously try to shoot for a higher porcessiung power when buying. Here is a 'blenchmark' sheet for GPUs: http://blenchmark.com/gpu-benchmarks

I personally use the GTX 970.


"Updating Objects Flags" -- Best ways to get around long rendering times? I'm currently trying to render an animation that taking 15 minutes to render one frame. Whilst watching the render, I can see "Updating Object Flags" stage seems to be the main culprit. The scene is not that complex but has two particle systems.
Q: Could anyone give me some tips on the best ways of getting around this and reducing render times?

There are a couple of things you can do to try to decrease render time.  For example, you could try decreasing the number of volumetrics by using the glare node rather than volumetrics to create glares around lights, by faking clouds with textures or images, by replacing 3D explosions with 2D explosion special effects, by creating hazes with planes that have a transparent cloud texture on them, or by simply eliminating some or all of the volumetrics altogether.  It all depends on what you were using the volumetrics for.  Of course, it won't look as good as with volumetrics, but that's the price of shorter render times.
Another thing to try is using the denoiser node and reducing the number of samples you use (and the number of light bounces).  For best results, check "Denoising Data" under Properties -> View Layer Properties -> Passes -> Data.  However, you're still beauty for time.
Whatever you try, there's ultimately no solution for long render times except progressing Computer Science research and render farms (hundreds or thousands of high-end computers working together to render animations).  Actually, 15 minutes is pretty good, even for an animation.  It takes Pixar about twenty-four hours to render each frame for their animated films.  The only way they can render the entire animated movie in a reasonable amount of time is by using huge render farms of thousands of computers working together.
The good news is that there are several online render farms that you can use.  The bad news if that they cost money.  However, they're still a viable option (better than half a year of rendering for you).  You can read more about some of those options here:

https://www.blendernation.com/2019/09/06/8-blender-render-farms-compared/
https://renderpool.net/blog/best-online-render-farm/

Hope that kind of helps, and sorry I can't give you a better answer.


Microdisplacement rendering at an angle I have a simple setup, a plane with a subsurf modifier set to 1 level of subdivision and adaptive subdivision, with a basic node tree to get a microdisplacement effect.

Now what I would expect to get is this:

but what I get in reality is this:

The normals of the microdisplacement seem to be rotated -45 degrees in the x axis and then 45 degrees in the y axis, because I got the correct result by doing just that to the plane.

I did test this with various older builds and got exactly the same results.

Any why this is going on, and more importantly what the fix is?

Looks like you're using a nightly build of Blender with vector displacement support. In that case, you'll need to translate the map with the new "Displacement" (displace along normal) node. Add Node > Vector > Displacement. That node can also replace your math nodes if you like, use the "offset" value instead of the subtract node and the "scale" value instead of the multiply node. They do the same thing, just built-in functionality. Plug your displacement map itself into the "height" input.

See also: What value does the Displacement input of the Cycles Material Output node expect?


Turning a ring of vertices into a plane I've got a ring of vertices. How can I add an edge from a newly added centre vertex, to every other vertex in the mesh (and then add faces between all of the new edges)?

Another method to create a face with a vertex at the centre.

Select your vertices:

Make Face F, this'll create a ngon:

Poke Faces Alt+P, this'll create a single vertex at the centre:


Where are the many tris located in this model? I have downloaded a Blender model which I like very much.

This model seems to have a really wise geometry, there are not more triangles than necessary. I can judge by switching to Edit mode and having a look at the few triangles.

Now I'm using this Blend file directly in Unity.
Unity shows that the mesh consists of 21K triangles.

I'm really surprised by that because in Blender, there seem to be really few triangles.

However, even Blender displays that there are 21K triangles.

I'm now trying to investigate where exactely the many triangles are.

When I select "slider" in object mode, Blender shows: 21.742 triangles.
When I then try to see where exactely they are, I switch to Edit model.
Now Blender shows "457 triangles":

How could I find out where these 21K triangles are located?

Thank you very much!

I have found out that there's a subsurface modifier attached to the model.

When I delete it, the tris go down to what I see.


Why is Blender separating every face of this model when I unwrap it? I have a problem with unwrapping this chair model.
I didn't mark any seams, then when I unwrapped the model, blender separated every face of the model as single island on the UV map. The same happened when I marked a seem all - mesh faces are split on the UV map
Any ideas how to unwrap it properly along the seams?

The faces of your object are all ripped apart, you need to select all, merge by distance, then mark seam and unwrap again.


how should i do, to get output file name in order? when render animation with frame end 20 and step 4,
will get  5 output file name like this:
0001.png,0005.png,0009.png,0013.png,0017.png

it possible to get output name like this ?.
0001.png,0002.png,0003.png,0004.png,0005.png

After render.
If you have set the render file path such that it only contains the rendered images with that file extension, can run this script, from within the blender text editor,  after rendering.
import bpy
from pathlib import Path

op = 'RENAME' # to rename
#op = 'CLEAN' # to remove

context = bpy.context
scene = context.scene
render = scene.render
ext = render.file_extension

rfp = Path(render.filepath)
fldr = rfp if rfp.is_dir() else rfp.parent

for f in sorted(fldr.glob(f"*{ext}")):
    if op == 'CLEAN':
        f.unlink()
    elif op == 'RENAME':
        print(f.name, end=" -> ")
        num = int(f.stem) // scene.frame_step + 1
        f2 = fldr / f"{num : 05d}{ext}"
        if not f2.exists():
            f.rename(f2)
        print(f2.name)

Output after rename.
0001.png ->  0001.png
0005.png ->  0002.png
0009.png ->  0003.png
0013.png ->  0004.png
0017.png ->  0005.png


After import to Unity, back faces are transparent I'm trying to add thickness to a mesh, but the tris count is increasing. How can I fix it without tris count increasing?

There are a few different things that might be causing your problem.

Firstly, there's no way to add thickness without increasing the tri/poly count. Polygons only have one face, so if you view them from the "wrong" side, they are invisible. There is no way to avoid this. If you want to see both sides, you have to have another polygon that is facing the other direction.

The first step is to make sure that when you add thickness in Blender, that you're adding REAL thickness, instead of using a modifier. If you do use a modifier, you need to "apply" before you export to Unity (there's a way to apply on when you export, but I won't talk about that right now). Either way, they have to be "real" polygons that get exported, not just the result of a modifier.

The next step is to make sure that all of the normals of your polygons are facing the right way (outward). If you select all of your polys in Blender and press ctrln then it should recalculate all of your normals "outside."

Once you've done these two things, try exporting to Unity again, and see if that helps.


Smooth Realtime-Audio Reaction in Animation Nodes? I am animating certain objects in a scene using audio in animation nodes. The current setup makes my models react in a very aggressive way to the audio.

Is there a simple way to smooth the reaction to it? I know that for some this might be a simple math problem but I haven't been able to wrap my head around a solution yet.

Thanks.

Edit: I have played around with the attack and release settings but they're not working as I would expect them to.

As you have guessed, the Attack and Release are the values that controls the smoothness of the visualization. But there are couple of things to note:

An attack or a release value of 1 doesn't mean maximum smoothness. It means the values will nearly never change. So use the values responsibly, don't just enter values arbitrary and expect things to work. Usually, a release value around 0.6 and a low attack value works best.
In order for Animation Nodes to compute the spectrum at a certain frame, a number of preceding frames have to be computed in order to perform the smoothing. The number of frames computed is exposed in the Advanced Node Settings as the Smoothing Samples option. Higher values means more accurate smoothing, however, all values higher than a certain value converge to the same result. So don't increase this value too much, it will needlessly increase the execution time.
There is a theoretical limitation on the smoothing capabilities of the node. So you may not always get the result you are looking for. This is especially apparent in songs with a high tempo (BPM).

To have a better understanding of the inner workings on the node. I present a somewhat messy explanation. The names Attack and Release come from the concept of ADSR Envelope in music synthesis, which is short for Attack, Delay, Sustain, and Release. When you press a key on a piano, the Attack of the note is the time taken to reach the peak of the note, so a small attack value means the note reach its peak faster and snappier while a high attack value means the note reach its peak slowly and more smoothly. Similarly, the release is the time taken for the note to stop after the key is release.

In the context of music visualization, the attack and release usually have different interpretation. Lets say at frame zero, we computed the spectrum to be 10, and at frame one we computed the spectrum to be 3. This is a decrease of 7 units in just one frame! This certainly won't look good! So, instead, we give the user a "smoothed value", this value is a linear combination between the computed value and the value computed at the previous frame. The factor of the linear combination is the attack or the release value depending on whether the value increased (attack) or decreased (release). Since the value in our example decrease from 10 to 3, then the release values is utilized. And instead of giving the user 3 which implies a decrease of 7, we give the user $10 - 7(1 - \delta)$ where $\delta$ is the release value. A high value of $\delta$ translates to an output closer to 10 (Which we interpret as smoothing because it is a lower decrease) and a lower value of $\delta$ translates to an output closer to 3.


Very low GPU usage while rendering My GPU usage is at around 5 to 9 percent.

I would like to know if it is normal? And why?

If you have a NVIDIA GPU and would like to see the real GPU usage, you have to use the CUDA tab in Windows Taskmanager. If you are on Windows...


How to bisect a circle to a vertex I want the circle to keep the distance from the outside circle but it has to bisect to the point I marked in the image. in the gif image, it looks like almost same angle but I'm pretty sure both sides are not the same angle. Is there any way to do that?

Thank you

Use Snap To. Remove the diagonal edge after you positioned the red hexagon on it.


Contraints & Camtrack I am trying to get a camera to follow a point in the X,Y,Z plane.  It worked yesterday, but I can't get it to work today.

I was able to follow the Book Tutorial, where he shows the setup steps: Add: (i) Camera, (ii) Empty [Camtrack], and (iii) [Ctl T] Track to Constraint.  No matter what I try today, the camera will not follow the Camtrack point?

Can someone tell me what I'm doing wrong.
WFR

Track To Constraint

In order to use Track To Constraint, follow these steps:

Add your camera
Add the empty
Select the camera, then hold down SHIFT and select the empty -- this will make both the camera and the empty selected at the same time. You can tell if they are both selected because they should both be highlighted at the same time
NOTE: The order you select these in is very important: first select the camera, then hold down SHIFT while selecting the empty
Then press CTRLT -> Track To Constraint
Here is a demonstration:

Here is a second, alternative method you can use once you have added your camera and the empty:

Select the camera
In the Object Properties panel, under the Constraints tab, set Target to the empty, as shown here:


How to achieve a 3D warp field effect in blender (2.81) I'm after a way to create an effect such that when an object is placed inside the volume the verticies are displaced based on the localised field value (thinking of it like a density field in physics where the local distance between atoms decreases as density value of a region increases)?

The current model I would like to use it on is spiral column that I need to gradually flare out at the top and displace randomly along its length in order to create a solid tornado funnel - but I'm sure I could come up with lots of uses once I know how to do it.

Thanks to the comments I finally found out about the Lattice modifier system which when you take away the physics speak is exactly what I was thinking of when I posted the original question - below is a proof of concept 'Tornado Susan' using the stock Susan model with a lattice modifier applied to flare the top and give the length a bit of a flick
And the Lattice Modifier that was applied is shown below which takes no time using proportional editing


How to prevent 2 seperate meshes that have soft-body modifiers from clipping into each other and glitching, even if collision is turned on? What I want to achieve : 2-5 meshes all of which have soft-body modifier. I needed them to bounce onto each other, flop off each other, etc.
What I have done so far : Created 2 meshes. Have a plane right below them acting as a surface to bounce on. All 3 of them have a collision modifier. The initial 2 meshes have a soft-body modifier in addition. Soft-Body self-collision has not been enabled, as this itself took an hour to bake. I'm planning to apply this to 5 meshes, rather than just 2, so bake times are crucial for me
Problem : Even when I delete every bake in the scene, re-add a collision modifier + soft-body to the 2 meshes in the scene, the sim starts off with the 2 meshes wrapping around each other, intersecting and clipping into each other, all whilst remaining in the same place, not falling to the ground.
Here is a link to my file : the file
Here is a video of my issue, apologies for bad video trimming and quality :

As with all simulations, start by ensuring you have ‘applied scale’ on each mesh and that the Normals are pointing in the correct direction.
Next, check the ‘cloth and soft body’ settings on each collision modifier - turn the Inner and Outer right down. If you still get intersections, turn the Inner up slightly until it is resolved (but not too high).
Also, you should avoid starting the simulation with intersecting meshes since this can cause very large forces at the start of the simulation.


How to get rid of this poles? How do i get rid of this pole? I tried to redirect edge flow using the knife but it distorts the curved surface. Is there a way around this?

This is the shape I'm trying to model.

I've used a topology similar to yours and it seems to work fine with almost no artifacts. I just used and applied a Shrinkwrap modifier with a cylinder of the same radius as Target in order to correct the topology a bit and make it stick to a nice cylinder shape:


Make hair in Blender Internal, but render in Cycle, realistic skin in blender render? Even though I have made a character and applied material and some lightning effect, I still can't get somewhat skinny color - somewhat red as like real one.

In this video by Andrew Price, the object is not so real, but when rendered it gives very realistic image!

And I want to make hair for my character. I found every one using Cycles. But when I do Cycles render it takes forever, about half an hour for an image. So I want to make hair in Cycles and later choose Blender Internal. What will happen if I do so?

Assuming you don't change any of the particle settings, then there would be no problem rendering the hair in cycles and blender internal. Note you will need two different materials, one for the internal, and one for cycles.
See this question for how to use materials in blender internal and cycles.


Cycles advanced shader ball? Is there an official cycles material preview ball to compare the shader with 100% white? I could only find the following image here. Except of the inner material this looks like what I'm looking for:

Image by David Zerba

The Blender Material Preview Scene (BMPS) was included in the 2.61 demo files, which you can download here:

Blender 2.61 demo files: Cycles & Dynamic Paint

Just open the bmps.blend file to find the material shader ball scene.


How to reset position on all keyframes? I need to reset the position of some bones in an animation, how do i do it to all keyframes at one?
Trying to port a model to a game, I used the bones from other model and because my model is shorter, I adjust some bone positions to match the model. Now i imported animations the legs and some other part are stretched, so i need to reset position on those bones.

In pose mode, select the bones you wish to reset.  Use a "hide selected" operation (shift h for me) to hide all other bones.

Open a graph editor view.  Make sure "only show selected" is enabled, in the upper right corner of the graph editor.  Click on the "filters" button and enter "location" (no quotes) in the "f-curve name filter" field, which has a magnifying glass icon in it.

Now you only have location keyframes of your selected bones.  In graph editor, select all and delete.

In 3D window, use a "clear pose location" operation (alt g for me.)

Optionally, keyframe at the beginning and end of your animation.


How to create this extruded piece from a rectangle? I have to solve this problem. How can i extrude that extra piece in the middle. Thank you!

I would probably start with an "Inset" operation (I) to create the geometry for the center hole, then move it slightly on the Y and Z axis and then eventually remove the face in the middle of the inset. Further detailing steps (such as solidification and bevelling) are of course necessary but that should give you a starting point.

If that's not what you were after, please clarify the question. I'm assuming you want to model the pictured piece in Blender.


Is it possible to switch from 2D Animation context to General context in Blender 2.8? I have been looking around the new Blender 2.8 interface now that it is approaching a finished state, and I've noticed that in order to to use the 2D Animation context, you have to actually create a new file specifically in that context. Further, it doesn't seem to be possible to switch from the 2D Animation context to the Modeling, Sculpting, UV Editing, etc. Should I take that to mean that if I wanted to create an animation that blends 3D and 2D--say, a 3D scene populated by 2D characters--that the best way to do that is to create a "General" file and just deal with not having the 2D animation tools quite so easily at-hand?

If you click the + icon at the end of the row of available workspaces, you will get a drop-down menu with all the other workspaces not currently in the menu.


Simulate a split washer getting tightened down I was hoping for some advice on how to animate a split washer being screwed down tightly. I've modeled the thread, nut and split washer and animated them. However, I need to split washer to flatten against the surface as it gets tightened down. The meshes thickness shouldn't change but it should no longer bend in the z-axis.

The method I'm using is very easy to animate; however you have to model the washer using the screw modifier.
This is the mesh for my washer. It is just those selected edges on the right in the image below. Notice the placement of the mesh relative to the object origin (it's the orange dot in the red box).

It is the screw modifier that actually generates the whole washer (it is displayed in wireframe in the image above.)
The most important setting is the Screw, think of that as the offset. The bigger that number the farther apart the beginning will be from the end. Set it to whatever makes your washer look correct, mine is ¼ of an inch.

Now to animate this thing
It is the "Screw" value that gets animated to squash the washer.
To set a keyframe, hover over the Screw value in the modifier and press I. Or you could RMB  on the Screw value then choose Insert Keyframe.
Now move ahead in the timeline, set the Screw value to 0 (the washer will be flat) and insert another keyframe, same as the first one.


Make particles face outwards of object center? I created a planet (deformed Ico Sphere) that I added a particle system to. The particles are supposed to be trees, and so they should face the sky (outwards of center). However I am unable to make this happen.

Here is an image showing the problem:

My current rotation settings:

EDIT: To clarify, all trees should face outwards of planet center, like so:

Unfortunately you are not able to do that simply with particle system, but there is a workround:

Go to Modifier stack, clock Convert button on Particle System panel to convert these particle trees to real duplicates. Then disable the renderability and visibility button, or delete the particle system. (You may want to then deselect the earth, then group all selected trees for easy control in the following steps)
Select one of the trees, add a Track To constraint, set the "earth" as target (or use an empty object that shares the same origin location).
Use Copy Constraints To Selected Objects operation to copy the constraints to all trees. (You can find it in Objects > Constraints menu, or simply search it by hitting specebar).


Objects showing up in render I have a smoke domain showing up in my sampled render. I'm not sure if it will show up in rendered or is just in sampled.

As long as the camera button is un-clicked(as you have it now) It should not appear in a render, it will however be visible in the 3D view unless you un-click the button that looks like an eye. Also, because you're in cycles, you can just do a light render with like 10 samples and easily see a low quality image of what your creation looks like so far.


Changing Default Checkered Background UI Color I was wondering is there anyway to customize the checkerboard color? I'd like to lower it's contrast since it is very distracting for me. I can't seems to find the one attribute in theme preference. I wanted to know if it's possible to change it before filling bug report to blender devs.
Note that I'm not asking adding custom background for rendering, it's more UI color customization. I do want it to be rendered in transparent, I just dont want it to be showed in lookdev mode.
Thanks.

Now the checkerboard color are changeable in theme preferences
under Preferences > Themes > User Interface > Transparent Checkerboard.


Proper time to bevel? I am working on a simple monitor with some thin extrusions that follow the outer rim, If I bevel first before extruding the rim I get weird geometry once I start insetting and extruding.

If I extrude the rim first I lose the ability to bevel the corners as much as I need. What is the best way to do this?

This is an add on question to
this.

This is what I want

This is my bevel being restricted because the holding lines that I will eventually extrude out a little.

This is the weird mesh I get when I bevel first and then extrude and inset to layout the screen of the monitor.

This is what the image looks like, the outer gray part is slightly extruded out.

This is the geometry of the mesh, I know its not good, hence this question.

I am just asking what is the correct way to model this so it has good topology?

One way would be to start with a plane.

I like to work with the 'Mirror Modifier' so in Edit Mode press W and Subdivide. Then select 5 vertices and hit X to delete them.

Add a 'Mirror Modifier' and check 'Y' and 'Clipping' in the Modifier pane ('X' is checked by default).

Add two 'Loop Cuts' by pressing Ctrl+R. Approximately where the monitor would be (They can be move later with Ctrl+E > Edge Slide). One horizontal and one vertical.

Select the corner vertex and press Ctrl+B then V. Adjust with mouse and roll the mouse wheel to add vertices/smooth. Keep the number of vertices to an even number in case you want to add geometry later.

Select the outer vertices and press E+S to extrude scale.

Now you have a simple base mesh to work with. Possible result below with some additional extrusion:


filling a polygon with holes in it with one single face Sorry to ask such a stupid question, but is there a way to fill the polygon in the picture with one single face to avoid strange edge behaviour when putting up bevel modifier afterwards.

First select the verts and make the faces.

Next select the faces and press X and select dissolve faces. Do it part by part

But there is a limit of amount you can merge.


Why does EEVEE take More time when it is rendered from the button than viewing in the actual viewport? Why does EEVEE take More time when it is rendered from the button than viewing in the actual viewport? I mean when you pan around in the rendered mode in EEVEE it takes no time to render it to the viewport but when you hit the render button from the menu, it takes some time and renders it frame by frame.
Other than that im loving 2.8 and EEVEE...

Because viewport sampling is lower even with eevee. Also, viewport has lower resolution.


Particle Color based on where the particle is emitted? Is it possible to change a particle's color to the color of the face/texture part it comes out of in cycles?

I want it to be the color of the face after shading and all that other stuff

Texture coordinates from Dupli

You can make your particles materials inherit the Emitting Object's UV Coordinates to project the texture onto your particles.

You can simply unwrap the parent object (particle emitter in your case) and with the Texture Coordinates node set as in the picture, you'll be able to acces to the coordinates of the UV map of the surface point where the particle is born.

By assigning the same material to the Emitter an Particles and using the texture as a shader mask you'll be able to achieve a perfect correspondecy between the objects:

Above you can see a plane initially emitting diffusive blue particles, than some areas of the surface switch to glossy-pink shading and particles follow this change because the material is the same.


How to get accumulated render time of animation When rendering an animation in the render window on the top right you can see the render time of the last frame. But where can I see the sum of the render times of all frames?

There's an add-on called Render Time Estimation that will do that for you.

Full disclosure, I wrote that add-on.


How to make a window brighter without changing light of other objects in the room? How to make window area brighter (almost white) without changing the light of other objects inside the room? My work:

I'm using HDRI

You can control the brightness of the HDR with the slider for the World>Surface>Strength.

See:

How can I create a silhouette using HDR in cycles?

To use two different light intensities in the same image used for the background, one to light the scene and one that is only seen by the camera you can use a light path and use "is camera ray" to control the mix of two different background nodes

Read:  Increase brightness of HDR to light the scene, but keeping the background at a lower exposure


Lighting not working/Final Render is is not lit I'm trying to make a sword with a heavy amount of refelction (seen below) but when I try to, it doesn't seem to react at all in the final render. It just looks like clay. I put a spot light above it to show how light just doesn't seem to react. I'm trying to make the final render look identical to what is seen in lookdev mode.

This is what it is meant to look like.

This is what the final render looks like.

Looks like you are using Look Dev, Look Dev uses an HDRI to light the scene, so you need an HDRI for your final render to get something close to it.

Hope that helps.

Good Luck


How to fix peak/pinch in one vertex (after subdivision) I am very new to 3D work, but I have hit a snag in my learning.

I have been researching (google and forum searches) about how to fix this "peak" or "pinch" issue. I thought it was double vertices, but that only fixed the issue on a couple. I have dissolved the vertex and then added the edge back in, which works, but shifts the peak/pinch to another vertex. I have not learned to make curves, so I am guessing that maybe I should do that instead of using planes, extruding, and moving everything.

Could someone offer a recommendation?
Thanks

Try the following and report back:

Verify no duplicate verts
Verify Normals Outside & In
Verify Normals are not bugged by doing the "Set From Faces" Normals (use F3 to search)
Checked for Clear Edge (Sharp Edge)
Try smoothing Object
Loop cut and added additional loop for potential topology issue...

And as a final check, adjust your Auto Smooth Angle...

Edit I'm adding another check on the list. Sometimes Recalculating normals is not enough and you need to force all normals to be perpendicular (YES THEY WILL VISUALLY LOOK FINE)

Set From Faces in the Shading tab of the Tool Shelf.

What's happened is your normals have got bent out of shape in a weird way that the usual Ctrl + N make normals consistent doesn't see as a problem.


How can I call the individual parts of the position attribute vector (X, Y, and Z) as values in geometry nodes? When working with geometry nodes, I know that Separate to XYZ can be used to separate vectors such as Object Info > Position Vector into its three individual components, but I'm unsure how to separate the attribute Position vector into its three component values.
I can split the position attribute vector x,y,z into x,0,0, 0,y,0 and 0,0,z using attribute math's multiply, but these are still in vector form. I need the values x, y, and z.
I am using Blender 2.92

Instead of Attribute Vector Math multiplying position with [1,0,0], to get the X component alone, you could take the Attribute Vector Math dot-product of position and [1,0,0]. (Likewise for Y and Z)
However, I think you'd be a lot better off using 2.93 alpha, to get into Geometry Nodes.. you can see what you're doing a lot more easily:


Is there a tool to remesh an object such that it contains a specified number of vertices? I am currently making a classifier for 3-D objects that uses vertex data as input, and I am using Blender to create a dataset of 3D objects. For the classifier, I need all the objects to have equal amounts of vertices. Hence I want to know if Blender has a tool for remeshing any object such that it has a specific number of vertices?

Soooorrrttt oooff.  It will require some math on your part.  And it only works one direction (down, removing verts).

You can tweak the Decimate modifier to collapse to a ratio of vertices kept.  If you know the number of vertices you want and the number you have is look-up-able, then you can directly calculate the ratio:

for target vertex count $t$, vertex count $v$, and ratio $r$ , it is simply
$t/v=r$ .

Remember, Blender can remove vertexes all day, but it can't add any.


Control camera movement with mouse in bge? Is there a way I could make the mouse look actuator use translation values instead of rotation?

The idea is to move the camera left and right instead of just rotating it.

You can probably edit the python script found here

http://www.tutorialsforblender3d.com/Game_Engine/MouseLook/blend/MouseLook249.txt

follow the tutorial
http://www.tutorialsforblender3d.com/Game_Engine/MouseLook/MouseLook_First_3.html

just change this part:

# set the values
act_LeftRight.dRot = [ 0.0, 0.0, leftRight]
act_LeftRight.useLocalDRot = False

act_UpDown.dRot = [ upDown, 0.0, 0.0]
act_UpDown.useLocalDRot = True

to :

# set the values
act_LeftRight.dLoc = [ 0.0, 0.0, leftRight]
act_LeftRight.useLocalDLoc = False

act_UpDown.dLoc = [ upDown, 0.0, 0.0]
act_UpDown.useLocalDLoc = True

Hope it works.


How to adjust object geometry to enable bevel of two edges leading to a pointed corner of a triangle? I can't get either the bevel tool or the modifier to bevel the two selected edges. How can I modify the object geometry to enable bevel on these two edges?

Many modifiers and other tools in Blender are designed with quads in mind. This is why creating n-gon free and triangle free topology has become a serious domain of craftsmanship on its own. Some people hate that about 3D modelling, some love it. It reminds me of figuring mathematical problems or solving puzzles. There are many guides on creating the best topology, here's an example: Topology Guides
Looking at your mesh, it requires cleanup:

But also it requires dealing with the triangle, as your problem still happens after the cleanup:

Originally I thought you mean something else, as the stretching above is to be expected when the topology has triangles or n-gons.
Considering, how simple the shape is, it's best to just start over instead of fixing it. What I learned to do, is to to think of triangles as unnatural, as very often a triangle will produce a perfectly sharp corner, which just doesn't happen in the real world. Therefore I try to replace triangles with quads having one very short edge. In your particular case, you could start with an octagon:

Decreasing every second of its edges to almost 0, Then selecting a pair of corners on the opposite sides, pressing J to join them (creating an edge and also dividing the face this edge goes through into 2 faces). Then the same for the other pair of vertices, then creating a perpendicular loop cut with CTRL + R, then two more loop cuts, this time parallel, then selecting 2 vertices and moving them up, and finally selecting two inner vertices and scaling them so they move underneath the other two. This is still not perfect technique, but I tried to make the technique easier at the cost of worse result.
The result should be a "triangle" that actually is a quad upon closer inspection:

You can now bevel the edge without problems:

If you now create triangles by moving those vertices together:  , the bevel will still work - but only until you decide to remove doubles (merge vertices by distance) - then creating new bevels will malfunction again.


Freestyle Background color not white? I'm following this tutorial and I've set my compositor up in the exact same way as he did, except my background is like a slightly light grey and I don't know why.  In his video's he's getting a bright white as his background and I can't see where I'm going wrong.

Here's the render:

Here's the compositor window:

Here's the blender project file.

Please help! I really want to know why it's not happening.

This is due to the filmic color management option. If you switch back the view transform to default, you get full white as background.

Filmic allows values higher than 1.0, so 1.0 is not displayed (and exported) as full white.

Another way is to crank up lighting or emission values, to reach about 16, which is where filmic outputs pure white.


How do I skip animation between 2 keyframes? I want to skip the animation between keyframes 100 - 200. So once playback reaches keyframe 100 it jumps straight to keyframe 200.

If you're just making a video, add the scene of the animation into the blender VSE and cut out the 101-199 frame range of that animation strip. This will allow you to preview and render your animation without those frames. Additionally, the keyframes will not be affected. If you eventually wish to go back and include the frames again, they will still exist.

Alternatively, you could do as Mr Zak suggested and move all the keyframes from the 200th frame and onward back 99 frames. This would make animation appear as though it is skipping all the frames in the 101-199 range.

To do that, go to drop down menu of blender layouts found in the top left and select the animation layout.

In the dope sheet editor found in the top left, check to see if there are any keyframes in the 101-199 frame range. If there are any, delete them. The range should be made empty.

After the frame range is clear,

Set the vertical bar at the 200th frame and press ] to select all the keyframes to the right of the vertical bar.
Press G to grab your selection, type -99 to move the keyframes back 99 frames and press enter.

The keyframes that were at the 200th frame mark should now be at the 101th frame. Now when you cycle from the 100th frame to the next frame, it should act as though you were cycling straight to the 200th frame.


Origin moves instead of object When I grab an object I move the originpoint of it, instead of the object itself. What has happened and how can I change it back?


Why does the guard of my sword glow when it shouldn't I am working on a final render for my little sword project I have been working on, but this issue perplexes me.
Essentially, when I render the scene in cycles, the guard of the centre sword glows. Initially, I thought perhaps there was accidentally emissions on the material, then I thought maybe the metal was reflecting light inwards, creating a glow effect, but I have disproven that too.
I know I could change the lighting setup to make it less obvious, but my overall goal was to get four shadows as if there are four ceiling lights, and increasing the strength seems to remove the shadows.
Here is the file: https://we.tl/t-FPs1yar0nu
Here is a reduced file:

This is what the render currently looks like:

Everything removed except the guard and lights:

Everything removed except for the guard:

Node setup for metal inside the guard (the glowing grey part):

Node Setup for the Green of the guard:

Blue light:

Red light:

Lighting setup:

Light from only underneath:

Any help is appreciated!
EDIT:
Here is the result after implementing the solution

Very difficult to say from the description. To track down the cause you can do something like the following :
Remove all the lights and world illumination, does the glow disappear? If not then there must be emission somewhere - hide everything then switch them on one by one in the outliner to narrow down which mesh is causing the problem.
If disabling the lights also disables the glow then the problem is with one of your lights or you have a material that’s effectively amplifying the incident light - disable each material until you find the one causing it and then post details and we can try and point out the cause.


How do I get objects with visibility toggled off in a file saved in Blender 2.79 to be visible in Blender 2.8? I started this model in Blender 2.79 and at the time of saving the .blend file last time in version 2.79, I had the visibility of objects with red arrow turned off.

Now how do I get those object meshes to show in the viewport in version 2.8? Their visibility is on as indicated by the eye icon but they still cant be seen or be selected in the viewport.

There are a few visibility options in Blender 2.80 that confuse new users (and also experienced ones). By default, you can only see the hide in viewport one, which is represented by the eye icon. However, there is also another option called disable in viewport. You have to enable a filter option first from the filter popup on the right to even see this icon (looks like a small TV screen):

Then you'll be able to see and toggle it from the Outliner:

Its purpose is to hide an object from a collection instance. So if you instance Collection from the example in the screenshots, the Plane object would be hidden. If you only used the eye icon, the instance will show the Plane object regardless.


Where does End Clip Distance start on Orthographic view? In Orthographic view the Start Clip setting has no effect. If I move the End clip it will affect both front and back clipping on the scene.

Setting the end clip to 1m (as I prefer working in metric scale) will show me a sliver of my scene that is only 1 meter deep, (determined by the clip distance). My question is this: that 1 meter distance seems quite arbitrary: 1 meter from where? X:0, Y:0 Z:0? How is the center of that visible range determined?

It's defined by the View pivot. The view orbits around a single point which is moved by a variety of actions (e.g. panning with ⇧ Shift MMB or zooming to an object with numpad .):


shadows on wrong side of normals I have this simple set up of cubes and planes with a texture, all of my normals face out but for some reason some of my them don't react to the lighting and shadow as they should:

for them to look correct I'll have to flip the normals to face toward inside, I can't find what's the reason and it don't look like having a logical pattern to it, some faces look weird at random.
I suspect my normal map, can somebody explain what's wrong with my normal map and what a proper normal map should look like please?http://sta.sh/01py369pouw3
I've changed my normal map to a proper one but looks like the problem is rooted somewhere else

does anybody have any idea what's wrong? http://sta.sh/01n0s48c9prn

You are right about your normal map. Somehow all the pixels that are white in the brick diffuse texture appear to be Transparent in your normal map.

I have no idea what was going on with the end part of your wall that wasn't showing shadow in your original image but after remodelling it from a basic cube it seemed to be working as expected.


Sharp edges while maintaining circular shape I encountered a problem when modeling an inside of the wheel.
The problematic part is where a spoke joins a rim. I want both the rim and spoke to have sharp edges, but when I crease the transition between them, the circular shape of the rim is no longer maintained there. And when I don't crease the transition it looks weird.
Here is how the creasing looks like without subsurf in edit mode:

If you would like to do some tests on the model, you can download it here.
Is there a better way to get sharp edges than via creases?
Thank you in advance!

Im not sure if it would help but, you can try separating the inside of the rim by selection and take off the subsurf in the inside of the rim.


Texture Coordinate overlays another texture on my existing texture I'm fairly new at Blender so there are so many ways I could be doing this wrong. Right now I'm working on a cobbled street but when I try to scale it using a mapping and texture coordinate node it's almost like the same texture is overlayed on top in rendered view.

Here is my node setup:

And this is what it looks like rendered:

Also, when I add the displacement modifier after subdividing it, the new geometry changes to the weird texture that the texture coordinate made as opposed to the scaled texture.

Shown here:

Thank you!

What I would say from what I understand:

You need to plug the Texture Coordinate > Mapping chain into the Vector of the Image Texture of your Bump, exactly like what you've done for the Image Texture of your Diffuse, otherwise he doesn't know how to project this Bump information on your floor.

Now you say that you've added a Displace modifier. I'm not sure why, as your the Bump method is a way to fake relief within a low-poly mesh without any additional subdivision.

If you choose to use a Displace modifier you should not use a Bump node, just unwrap your mesh (for example in Top Ortho view make a Project From View unwrap), use UV as the output of your Texture Coordinate so that he knows that he must use the UV you've just created, and mix a Diffuse with a Glossy, with your Specularity image as the factor.


Export geometry with multiple UV maps to PLY I want to create geometry with multiple (at least 2) UV maps. One of them will be used to map the base texture (from a texture atlas) and the other one will map a pre-baked lightmap.

I want to export the mesh including both UV maps to a PLY file.

In Blender, I added two UV maps and edited one of them to make them distinguishable:

Unfortunately, only the specific UV map marked as "active for rendering" is exported into the PLY file:

[...]
property float x
property float y
property float z
property float nx
property float ny
property float nz
property float s // u
property float t // v
[...]

As PLY allows arbitrary vertex properties, it is not limited to only one pair of texture coordinates per vertex.

Am I missing something or is this a limitation of Blender's PLY exporter?

This is a limitation in Blender's exporter, but also in the PLY format & its conventional use - which is to only have one UV layer.

You could of course modify the exporter to write shape-keys, weights or any arbitrary vertex data, but other applications won't read it unless special support is added.


What setting locks local rotation and scaling of an object? I have encountered a strange phenomenon, it must be some key I hit but I have no idea what!

All of a sudden I noticed that nothing will rotate or scale in object mode in a project I am working on.  After playing around with some basic settings I noticed that when I set the pivot center to the 3d cursor and try to rotate something it simply moves the object around the 3d cursor without rotating it.  Scaling the object moves it towards or away from the 3d cursor.  Here is a picture:

It seems that I have somehow locked local rotation and scaling of all objects, the only way I can rotate or scale anything is in edit mode.  How on earth did I do that and how do I turn it off?

It sounds like you have activated the Manipulate Pivot Points tool.  It's found directly to the right of the Pivot Point selection menu in 3D view > Header.

Here's a demo.

It can also be toggled with ⎇ Alt, (comma).

Now, if you mistakenly press some keyboard shortcut that ends up causing you grief like this; you can try pulling down the top header bar to view the Info area.  It should contain most of what you've recently done.(to view EVERYTHING you'd have to enable debug logging, that's gets messy quickly)


Activate face by script I want to activate the biggest face by a script.
It's no problem to locate and get the data, but how can I activate it in Editor?

# Activate biggest face exclusivly:
import bpy
import operator

# List of Polygons of (first) selected object:
pgList = bpy.context.selected_objects[0].data.polygons

# sort and get biggest face:
pgMax = sorted(pgList, key=operator.attrgetter('area'), reverse=True)[0]
print("{0:} Polygons, largest = {1:.2f},   selected = {2:}".format(len(pgList),pgMax.area,pgMax.select))

# How do I activate this Polygon?
# The results are very random. Sometimes selected, sometimes not, sometimes Blender chrashes.
bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.mesh.select_all(action='DESELECT')
bpy.ops.object.mode_set(mode = 'OBJECT')
pgMax.select=True
bpy.ops.object.mode_set(mode = 'EDIT')

#Later i'ld like to create a TransformOrientationSystem. But this will be next problem.
#pgMax ....  .transform.create_orientation(use=True)
# erzeuge dazu ein lokales Bezugssystem

```

Set the active face

To set the active face

me.polygons.active = <index of face>

or via bmesh

bm.faces.active = <BMFace>

Bmesh

Can use bmesh  in edit mode, bound to the object being edited. Takes away the need to toggle modes

Notice I set the mode to face.  Otherwise would need to flush the selection.

import bpy
import bmesh
context = bpy.context

context.tool_settings.mesh_select_mode = (False, False, True) # faces
ob = context.edit_object
me = ob.data

bm = bmesh.from_edit_mesh(me)

faces = sorted(bm.faces, key=lambda f:f.calc_area())
bf = faces.pop()
bf.select = True
for f in faces:
    f.select = False
bm.faces.active = bf
bmesh.update_edit_mesh(me)

In object mode can set all to false by looping or via

import bpy
context = bpy.context
context.tool_settings.mesh_select_mode = (False, False, True) # faces
# deselect all polygons

ob = context.object
me = ob.data
all_false  = [False] * len(me.polygons)
mp = sorted(me.polygons, key=lambda p: p.area).pop()
me.polygons.foreach_set("select", all_false)
mp.select = True
me.polygons.active = mp.index

set random active face in python without toggle mode

Is the active object and zeroth selected object always the same?


How can i Mirror more than one objects at the same time? I want to mirror a lot of objects at the same time. How can i do that? I am tryed group objects but i don't know how i can mirror group. I am sharing a photo about this problem:

Download Smart Join Addon

Select the mesh (wheel) and click on smart join (it temporary join all the selected mesh). You can now move all the join mesh and add any modifier to all the join mesh.
If you want to separate the mesh just click the separate s. join

If you want to edit the join mesh click on the expand smart join and after finishing the editing click on collapse smart join.


How Does Blender Voxel Data Work? I've been looking online for a long time, searching for documentation on the subject of Blender Voxel Data.  So far, I know that Blender uses many file types, including the .bvox file type.  For the .bvox file type, I have found that it uses ASCII characters to load in density values, starting with the dimensions.  For example, a data set with dimensions 64,64,64 would save into the .bvox file as:

@@@

However, only the density values are saved.  The data set I have is formatted as follows, where dd is a density value:

xx yy zz dd
xx yy zz dd

My python code strips each line and takes only the density values and uses pythons pack struct to pack the values into a .bvox file. This works fine, but I am wondering how Blender knows where to put the coordinates of the densities?  Each density value has to be at a specific point, and how does Blender know where that point is?  And also, is it possible to specify my own coordinates for each value?

First off, that's not ASCII; this is merely a misinterpretation of the raw data. The actual format can be figured out from Blender source files render/intern/include/voxeldata.h and render/intern/source/voxeldata.c together with blenlib/intern/voxel.c. The format is used for 3-dimensional textures.

The header is read by read_voxeldata_header(), and consists of four ints: the X, Y and Z dimensions, as well as the number of frames. There's no code to handle endianness nor size variations, so the files aren't portable across platforms. Most current platforms will store these as 32-bit little endian.

Next come the frames, in order. Each frame is also stored in raw memory format, as X*Y*Z floats; this will typically be IEEE 754 single precision (32 bit) values.

Within each frame, the order of the voxels is defined in the sampling functions. They use a macro named BLI_VOXEL_INDEX to perform the lookup, defined in blenlib/BLI_voxel.h. It shows that the order is along X axis first, then Y axis, then finally Z axis.

The raw 8-bit format is similar, but has no header, and uses only 8 bit fixed point values; the voxel value is databyte/255.0. This requires the actual dimensions of the voxel to be entered in Blender.

The image sequence format simply uses a layered group of images, along ascending Z axis. The pixel data gets averaged into a grayscale voxel texture.


Uv Unwrap not working After I unwrap in my current project file the texture never appears in rendered mode what could I be doing wrong? When I watch tutorials they unwrap and the texture automatically appears on the object you are working on.

Mark out the seam on the mesh in the 3D View window.
Open a UV/Image Editor window.
Make sure the whole mesh is selected in the 3D view (press A key a couple of times if necessary).
Then select Unwrap (or press U while mouse is over 3D View).

You should then see the unwrapped model in the UV/Image editor window.


Is there a way to animate objects as one temporarily without "independent movement"? I've been working on making a Minecraft Rubik's Cube, and while trying to animate the rotation of a face (with pivot center median) the pieces of the face move independently. Even when they are grouped this happens, and parenting wouldn't work because then I would have to parent every possible side combination just for a turn. Is there any way to move a side as a group without this weird rotation (Sorry I'm not the best in Blender :P)?

Thanks in advance!

To animate a Rubik's cube:

Join all your cube in the same object with a ctrlJ.
Put the origin at the center of the object with a shiftctrlaltC > Origin to Geometry.
In Edit mode, select all and press P to Separate by Loose Parts. Now all the cubes are separate but they all have the same origin point. It will allow you to rotate them with the same rotation centre.
In Object mode, create an Empty at the same origin point, then select all your cubes and parent them to your Empty with a ctrlP > Object.
Put your timeline cursor at frame 0, select all your cubes and press i > LocRotScale. It will create the initial position of your Rubik's cube.
Make sure that your Pivot Point (on the horizontal menu bar on the bottom of the 3D View) is set on Median Point.
Put your timeline cursor at frame 10, select a face of your rubik's cube (i.e. 9 of your cubes) and rotate it on the X axis. Select all the cubes and Press i > LocRotScale.
Go on as many times as you want, it should work.


Why is my eevee render turn gray? When I render a single image in Blender 2.83 with eevee or cycle it does it without any problem

But when i render an animation with eevee either in png (frame by frame) or in matroska (mp4) the result is always gray.
the colors of the letters on the right side move using
AnimAll add-on, I don't know if this has anything to do with it.

You have Compositing enabled (Properties Area > Output Properties (Printer Icon) > Post Processing) but your Render Layer node in the Compositor is not connected to anything:

Either just turn off Compositing or enable all the passes used for denoising (Normal, Diffuse Color) and connect them properly. Read: How to properly connect the Denoise node in Compositor?


How do I smooth out a path here is a gif that shows what I mean, https://gyazo.com/8eddc89e4b69484d22b8974d49c474fd
I want to make a path for the tractor to follow but the paths are just to rough, even if I extrude 10 times or 100 times, it keeps chopping. im a blender noob :/ but if someone knows an easy way for me to make a smooth path that would be great

You can just increase the resolution of the curve:

I also see that you are using a NURBS path with several extrusions to form the simple curved road shape. Curves are designed to help artists interpolate between control points so they don't need to manually add dozens or hundreds of them. Try to use as few control points as possible.
I advise you to use bezier curves, as they offer users much more control over the shape. Here is what the road (I assume it is a quarter circle, I might be wrong) would look like. I added a primitive Bezier Circle and deleted the other 3/4ths of it.


Create a Hanging Bucket Effect (Handle Hooked on Rod) I'm trying to create a hanging bucket effect, where the handle hooks on a rod and when the bucket falls, the handle stays hooked. I've tried almost every combination of Active, Passive and Active (unchecked dynamic) for each object, but cannot get the bucket to recognize that the handle is there. I've created the handle from a path and converted it to a mesh, so I'm wondering if that is the issue

Here is the blend file:

https://drive.google.com/file/d/1fgziSnjLwu51Opn54m7xZQz3ArsMaA1W/view?usp=sharing

Any help on how I can create this effect would be greatly appreciated

I think your problem is the relative size of your wire and bucket meaning the physics has to be calculated very precisely.  I tried to set this up and had similar problems initially, and the the following steps fixed it for me:

Make sure the Centre of all of your objects is set to be near your geometry. (Object > transform > Origin to Geometry)
In Scene settings increase the 'Steps per second' (I went to 240FPS) (Scene> Rigid Body > Steps Per.
Make sure the 'Sensitivity' on the wire and the bucket are set to zero (or very close to) other wise the 'hole' in the bucket is effectively closed by the buffer this creates. (I think this is likely your problem, your objects are effectively starting 'inside' each other, and collisions are not detected if they start overlapping.

Set the Bucket and the Wire Like the below picture, and the thing it's hanging from exactly the same except untick 'Dynamic':

I get this:


View camera boundaries in user perspective? I'm currently weight painting and find myself glancing back and forth between camera view and user perspective view to check where I'm painting in relation to my camera boundaries (for an environment scene).
Is there a way to view the camera boundaries from within the user perspective view?

Another option is to simply scale up the camera object. It doesn't effect the FOV at all. Select the camera, go to the properties panel and Camera > Display > Size.

Scale it up until the frustrum covers your painting area. You can see it from any angle. Alternatively you could parent a lamp with a square cone to match the camera frustrum.

Add a spot lamp and constrain it to the camera and copy the camera's Field Of View to lamp Size. You will have to scale the lamp's Y axis to fit aspect ratio.


Transform Effects Strip Real Values I am using the video editing function of Blender to make a image pan & zoom clip (aka Ken Burns). The image is a chart I made in Photoshop and I want to zoom into an exact point on the chart and a exact zoom level.

In the effects strip controls, there are places to adjust the scale as well as the position, but I can't figure out how the values in these boxes translate to real-world values (in my case I want to go to exactly 300%, centered on the 508x291 pixel spot on the image).

This could be a solution with VSE, but you'll get a blurried image (if you scale 300%)

Some consideration first:

The effect strip will scale always from the center of the image.

If you want to scale from the point A (508x291px from the top-left corner), you have to move the point A to the center first, then scale.

Pan and zoom in VSE

Add the first effect stript to translate the image by the offset you need.
Add the second effet strip to scale (3 = 300%)

Some math:

If your image dimensions are 1920x1080px:

first effect strip (position)

center: xc=960, yc=540

pointA: xa=508, ya=291

translation: xc-xa, yc-ya = 960-508, 540-291 = 452, 249

second effect strip (scale)

scale 3 = 300%

As you can see, the quality of the image is very low.
Since you are scaling 3 times the size, the resolution is 3 times lower.

Note

When you deal with scale in VSE, you have to pay attention to the original size and the render size.

When you add an image (or a movie clip) in the video sequencer editor, the image will be scaled to the render size.

If you want the image to maintain the original size, you have to check the "Image offset" option (transform in pixel).

Doing so, you can pan the image and center the point of interest but you cannot scale it down, because the image will be cropped.

If you want to zoom an image, I suggest you to use the node compositor or a camera moving in front of an image plane in 3d View.

Pan and zoom in 3D View

Using the 3d View, the image texture can be bigger than the render size.

Activate the "import images as planes" add-on, if it is not yet activated

Import the image to stage

Some considerations about the options:

Check "Shadeless"
If you're importing image with alpha channel (png), check "Use Alpha" and "Z Transparency"
If you want the image to have precise dimensions, the best choice is "Plane dimensions: Dots/BU)": it allows you to determine the dimensions starting from the pixel size (eg: 1920 x 1080px at 100 Dots/BU -> plane dimensions: 1.920 x 1.080 BU)

Pan and zoom in Node Compositor

Here a possible node compositing:


How to make a camera follow a specific particle I have been tasked with having a camera follow a specific piece of paper as it moves through an office environment. The paper is one of many that are flowing along and the shot is from the view of this one piece of paper. I know I can hand animate it, but I was wondering if there is a way to track the camera to a particle and see from it's POV (so to speak).  I would like to attach to the particle and look from it as if the camera were riding on the paper.

I opted to manually animate the camera and keep a single particle object (piece of paper) in the field of view. Thanks


Multiple Render Borders in Cycles Preview Is it possible to specify multiple disjunct render borders?

I realize that this is trivial when rendering but it would be very useful when previewing on a less-powerful computer.  I have two complex meshes on separate sides of the scene and would like to preview them both at once.

Unfortunately this is not possible currently, you can only have one renderborder per 3D view.

However, you can have multiple 3D views, each with it's own renderborder:

Note that you can only have one camera renderborder which is global for all cameras, so this is only possible in viewport render.


Blender - Fill Up Bezier Curves I'm having a big problem with the bezier curves in Blender.
Im trying to fill up the curves, but i can't.
I have already saw some videos from youtube, telling that I have to clic on the 2D button.

But when i clic on the 2D button, this is what it happens.

I will really appreciate any help.

Thank you very much.

Rotate the curve till is coplanar with global X-Y plane.

Than apply Rotation by pressing Ctrl+A.

Now you can set the curve to 2D.


Telugu fonts are not recognized by Blender 2.8 Telugu font types with .ttf formatted files are NOT displayed under fonts section of Blender 2.8, Any additional plug-in required or is it an issue?

It seems that your font file is missing the file extension. While Windows knows that it's a TrueType font, Blender simply filters files by their file extension. Since this particular file doesn't have one, it isn't displayed in the file browser. Add the .ttf file extension to the file name and it should work properly.

Alternatively you can temporarily disable the file extension filter in Blender and the file will be visible as well.

Blender 2.80:

Blender 2.81 and later:

There may be another reason why you don't find your font file in C:\Windows\Fonts.
There are two option for installing fonts, you can either Install it (only for your user) or Install for all users. In the latter case it installs the file as expected into C:\Windows\Fonts, however in the former case it will be placed into C:\Users\[your username]\AppData\Local\Microsoft\Windows\Fonts.

Image source: Announcing Windows 10 Insider Preview Build 17704

The Windows Explorer will list all fonts when looking at C:\Windows\Fonts, including those that were installed for your user only. Therefore it's necessary to check where the file is actually stored. The easiest way to find the path is by opening the file's properties. With the file selected, right-click on it to open the context menu and select Properties. The General tab contains the Location property, which is the path to the file.


Cycles Material "Texture missing" in render? I spent hours on creating a background with matte textures.

No problem, they show up in the Material and the Texture view:

Everything works.

Solid view:

Now I tried to render it and got this:

Pink textures all over the place. I have seriously no idea why Blender keeps doing this. I double checked all textures in the node trees, they are exactly where Blender points them at.

Here is the material:

but they just do not show up in the render.

I have no post-processing so far.

Here my lightpath settings:

I hope somebody can help.

Thanks in advance!

Update!

Apparently it has something to do with an out of memory error (since this is just a background for  gigantic scene with hundreds of textures)

As you can see it doesn't render properly when all objects are visible

But as soon as I hide every object except for example a tree that isn't rendering properly, everything works as it's supposed to

Blender gives no CUDA errors though.. I'm really confused.
I have 10GB or RAM installed and a GTX 550 ti with 1GB btw if that helps

SOLVED

Apparently there was indeed a CUDA out of memory error. It's fixed by just switching to CPU render.

Thanks everyone for their input!!!


Uploading an object from Blender to UE4 looks different so I have created this ak-47 mesh using blender

and when I try to export it to UE4 it looks like this(I exported it as a .fbx file so I don't think this is the problem)

As you can see for some reason the parts that are white in blender works fine but the parts that are grey are not.

when I crated this ak I first built it as a one object and then separated it to 4 different objects so I would be able to add different materials to each part later and I think this might be the problem somehow.

I'm new to blender and this is the first time I try to crate something without a tutorial so this might be a very stupid problem but I couldn't figure it out so thank you for the help :)

I experienced this same problem. Open Blender and go into edit mode by clicking Tab. Then you need to select all the faces, and use Ctrl-N to recalculate the faces' normals. Finally click that thing that looks like a wrench and click solidify. By doing that you're making every face solid like a room and that should work.


I made a Cycle Animation with F-Modifier, but how can i stop it in a exact frame? I made an animation with F-Modifier on the Graph Editor and it's working, starts from 0 to the infinite...but if i need to make it stops at for example frame 200, how can i do that?

if you want to limit the whole animation use the limit modifier :

and to limit one modifier only use the Restrict Frame Range option :


Trouble exporting blend to JSON Format I have recently found a strange behaviour in Blender: sometimes when I delete certain objects in the scene, the JSON exporter becomes unavailable. For example in my actual scene, if I delete a specific plane it becomes unavailable, but not for any other meshes. Impossible to delete that plane.

However I can delete it with certain other specific objects, at the same time, and the exporter becomes available again. This as well only works with certain objects. Also, when the JSON exporter becomes unavailable, the same always happens for Motion Capture (.pvh) and Stanford (.ply) format export options. I have studied parent and material relationships but I haven't been able to find any logic in that behaviour.

What am I doing wrong ?

(This is a copy from this SO question)

Well i forgot to post the answer i found : the 'strange behaviour' was in cases i had no objects selected actually, that is why the exporter was not available. I dont know if this condition existed in the previous exporter too, maybe that was what lead me to ask.


UV-Mesh transformation in python I want to create a large set of spiral galaxies with textures using a python script.
I managed to create shader nodes and links to set up a material.

For the spiral shape, I need to perform a transformation of the standard uv-mesh. The transformation is written below. Basically, it is a proportional editing, where the center row of the rectangular mesh is grabbed and shifted horizontally.

bpy.ops.object.editmode_toggle()

bpy.ops.transform.translate(value=(1.03353, 0.00369117, 0), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=True, use_proportional_edit=True, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False)

How can I include this transformation in the python script?
My script has the following structure:
 bpy.ops.mesh.primitive_uv_sphere_add(radius = 5, enter_editmode = False, location=(x,y,z))
 sphere = bpy.context.active_object

 sphere.data.materials.append(get_material(i))
 sphere.scale[2]=0.1

and the function get_material(index)
def get_material(index):
    mat = bpy.data.materials.new("GalaxyMaterial"+str(index))

    mat.use_nodes = True
    node_tree = mat.node_tree
    nodes = node_tree.nodes

    output = nodes.get("Material Output")
    bsdf = nodes.get("Principled BSDF")

    links =mat.node_tree.links

    node_coord = nodes.new(type="ShaderNodeTexCoord")

    node_texture = nodes.new(type='ShaderNodeTexNoise')

    links.new(node_coord.outputs[2],node_texture.inputs[0])
    node_texture.inputs[2].default_value=18
    node_texture.inputs[3].default_value=5.3
    node_texture.inputs[4].default_value=0.567
    node_texture.inputs[5].default_value=1.1

    node_ramp = nodes.new(type='ShaderNodeValToRGB')

    node_ramp.color_ramp.elements[0].color = (0,0,0,1)
    node_ramp.color_ramp.elements[0].position=0.45
    node_ramp.color_ramp.elements[1].position=0.7
    node_ramp.color_ramp.elements[1].color = (1,1,1,1)

    links.new(node_texture.outputs[0],node_ramp.inputs[0])
    links.new(node_ramp.outputs[0],bsdf.inputs[17])
    return mat

I was not able to apply the transformation
bpy.ops.transform.translate(value=(1.03353, 0.00369117, 0), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=True, use_proportional_edit=True, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False)

to the uv-mesh. Blender only applies this transformation to the active element.
Instead, it is possible to rotate the mesh manually. To obtain the proportional rotation, I rotated the mesh depending on the radius of the mesh point.
import bpy
import math
import numpy as np
import random
import bpy
import mathutils
from mathutils import Vector,Quaternion

#make objects glow
bpy.context.scene.eevee.use_bloom = True
#make background black
bpy.data.worlds["World"].node_tree.nodes["Background"].inputs[0].default_value = (0, 0, 0, 1)

#delete all objects
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False)

#camera0
bpy.ops.object.camera_add(enter_editmode=False, align='VIEW', location=(20,0,0), rotation=(math.radians(90), math.radians(0), math.radians(90)))
camera = bpy.context.active_object

#sphere
bpy.ops.mesh.primitive_uv_sphere_add(segments = 30,ring_count=30,radius = 2, enter_editmode = False, location=(0,0,0))
galaxy = bpy.context.active_object
galaxy.scale[2]=0.1

mat = bpy.data.materials.new("GalaxyMaterial")

mat.use_nodes = True
node_tree = mat.node_tree
nodes = node_tree.nodes

output = nodes.get("Material Output")
bsdf = nodes.get("Principled BSDF")

links =mat.node_tree.links

node_coord = nodes.new(type="ShaderNodeTexCoord")

node_texture = nodes.new(type='ShaderNodeTexNoise')

links.new(node_coord.outputs[2],node_texture.inputs[0])
node_texture.inputs[2].default_value=25
node_texture.inputs[3].default_value=5.3
node_texture.inputs[4].default_value=0.567
node_texture.inputs[5].default_value=1.1

node_ramp = nodes.new(type='ShaderNodeValToRGB')

node_ramp.color_ramp.elements[0].color = (0,0,0,1)
node_ramp.color_ramp.elements[0].position=0.45
node_ramp.color_ramp.elements[1].position=0.7
node_ramp.color_ramp.elements[1].color = (1,1,1,1)

links.new(node_texture.outputs[0],node_ramp.inputs[0])
links.new(node_ramp.outputs[0],bsdf.inputs[17])

def proportional_rotation(radius):
    return mathutils.Matrix.Rotation(math.radians(-200*radius), 4, 'Z')

# rotate vertices proportial to their distance from the origin
mesh = galaxy.data
for vert in mesh.vertices:
    r = math.sqrt(vert.co[0]*vert.co[0]+vert.co[1]*vert.co[1])
    vert.co = proportional_rotation(r) @ vert.co

galaxy.data.materials.append(mat)

The result looks like:


How to get the max and min value of a certain NodeSocket's slider? I'm rather new to scripting in Blender and have stumbled upon a problem I can't find a solution to. I'm trying to find the max and min value of an input of a Node.  I manage to find the input object (they're subclasses of NodeSocket) but I can't find any way to extract its max or min value. I reckon that many of them doesn't have it set, but how come then that the slider to control them seem to have a min and max? Can I extract this?

To clarify, for a Nodes input X, a slider might be restricted to values between 0 and 10 by default. If i force it to, say -10 then the slider will adapt and range between -10 and 10. Can I extract this first range somehow? Is it manually set or somehow automatically calculated in Blender?

In the below image, Blender restricts the slider to 0.1 - 20.0.

UPDATE
The node in question is a custom Group Node node and comes from this Blende-file, maybe that has something to do with it?


texel density real life like textools 3ds max I'm trying to make unwrap, the density of the texel is like in real life. If the mesh that I am unwrapping is 1x2 meters, I want the density of the texels to meet the meter by 1024x1024. How should I do it?
It is a functionality that has the textools plugin of 3ds max, does that exist in blender?
I do not use the addon uv magic since it only applies the scale of the same object.

TexTools has been released for Blender and already features Texel Density tools. You can download and read more on my website.

Unlike the 3dsMax version there are now some advanced options on how to apply the UV scale


How to get a list of Drivers used in certain bone I would like to know how to get a list of drivers used in a certain bone.
like how many and what type and what kind of variables it's using.
I know I need to use bpy.context.object.animation_data.drivers but somehow I can't achive what I want.

If you know how to do that, please tell me.

Thank you in advance

I haven't found a super elegant way to access a driver directly from the bone, if someone knows that please let me know in the comments. But what you are trying to do can be achieved by building your own Python Dictionary over the armature in question. I assume that you have an armature with drivers on it, and it is the current active object. I further assume you have a console open (on Windows you can open it from the 3D View Main Menu, on Linux and Mac you need to start Blender from the console). Now run this from the Text Editor:

import bpy

# create an empty dictionary to store all found bones and drivers in
boneDict = {}

# iterate over all bones of the active object
for bone in bpy.context.object.pose.bones:

    # iterate over all drivers now
    # this should give better performance than the other way around
    # as most armatures have more bones than drivers
    foundDrivers = []
    for d in bpy.context.object.animation_data.drivers:

        # a data path looks like this: 'pose.bones["Bone.002"].scale'
        # search for the full bone name including the quotation marks!
        if ('"%s"' % bone.name) in d.data_path:

            # we now have identified that there is a driver
            # which refers to a bone channel
            foundDrivers.append(d)

    # if there are drivers, add an item to the dictionary
    if foundDrivers:
        print ('adding drivers of bone %s to Dictionary' % bone.name)

        # the dictionary uses the bone name as the key, and the
        # found FCurves in a list as the values
        boneDict[bone.name] = foundDrivers

# now you have a dictionary in hand, which you can use to
# retrieve all driver info from
print ('bonedict: %s' % boneDict)

# usage examples

# get all drivers of the active bone, if it has some
boneName = bpy.context.active_bone.name

# first check if it has drivers at all
if boneName in boneDict.keys():
    # if so, access the drivers list by using the bone name as the key
    activeBoneDrivers = boneDict[boneName]

    # get number of drivers:
    print('Number of drivers for bone %s: %i' % (boneName, len(activeBoneDrivers)))

    # iterate over those drivers only:
    for d in activeBoneDrivers:
        # print the expression
        print('expression: %s' % d.driver.expression)

        # print if driver actually works:
        print('driver is valid: %s' % d.driver.is_valid)

        # get the type
        print('driver type: %s' % d.driver.type)

        # print the variables
        for var in d.driver.variables:
            print('variables: name %s, type %s' % (var.name, var.type))

            for target in var.targets:
                # you can also iterate over the targets
                # if you use Pythons dir() function, you will see what methods and properties you
                # can access:
                print ('targets methods: %s' % dir(target))

I tried to comment the code as completely as possible, so all explanation how this works is in there. Also, I chose to add the FCurve to the dictionary instead of the Driver directly. FCurves can sometimes be used to further tweak the driver, so you might want to access the curve and its Modifiers too. If you have further questions, feel free to ask  :)


How to align a cluster of points? If you have a cluster of points selected like this:

how do you align the points so that they create a flat plane?

You can achieve this by scaling the points along a perpendicular (Normal) axis:

Via Keyboard:

Alt+Space: Change Transform orientation to Normal
s: Scale selected
z, z: The axis to scale on; the first 'z' specifies the global axis. Pressing again specifies local.
0: The amount to scale by
Enter: Confirm the action

Via Mouse:

Then you need to left click anywhere in the scene to confirm and modify the properties of the tool.

And you will get all the points aligned.


How do I programmatically set hair position and shape in Blender 2.8? I’m working on a project where I set a (relatively) small number of hair strands using particle system. In Blender 2.79 I’d just loop through obj.particle_systems[0].particles and set each particle’s location and hair_keys[].co. As discussed in https://developer.blender.org/T58792 this doesn’t work now in Blender 2.8, but there seems to be a workaround? (or new intended behaviour?)

Anyway, I don’t get it to work. The hair strands are not updated to the positions I try to set anymore.

So my question is: In Blender 2.8, what is currently the best way to set the hair strands’ position and shape programmatically?

I’ve made a minimal example that tries to make a row of 5 hair strands. See this comparison of the code run in Blender 2.79 and Blender 2.80, respectively:

Here is the Blender 2.79 code that gives the desired result:

import bpy

# 1. Use initial cube as object and set CYCLES
obj = bpy.data.objects['Cube']
bpy.context.scene.render.engine = 'CYCLES'

# 2. Add a particle system
psys = obj.modifiers.new("hair", 'PARTICLE_SYSTEM').particle_system
psys.settings.type = 'HAIR'
psys.settings.use_render_emitter = False
psys.settings.use_strand_primitive = True
psys.settings.cycles.radius_scale = 0.2
psys.settings.hair_step = 3
psys.settings.count = 5

# Connect and disconnect (needed, but why?)
bpy.ops.particle.disconnect_hair(all=True)
bpy.ops.particle.connect_hair(all=True)

# 3. Set hair positions vertices
for m in range(len(psys.particles)):
    psys.particles[m].location = (m, 0, 0)

    for n in range(len(psys.particles[m].hair_keys)):
        psys.particles[m].hair_keys[n].co = (m, 0, n)

# Toggle back and forth to update viewport
bpy.ops.particle.particle_edit_toggle()
bpy.ops.particle.particle_edit_toggle()

And here is my current best attempt at the corresponding Blender 2.80 code (with some minor API-changes + the aforementioned workaround):

import bpy

# 1. Use initial cube as object and set CYCLES
obj = bpy.data.objects['Cube']
bpy.context.scene.render.engine = 'CYCLES'

# 2. Add a particle system
psys = obj.modifiers.new("hair", 'PARTICLE_SYSTEM').particle_system
psys.settings.type = 'HAIR'
obj.show_instancer_for_render = False
psys.settings.use_strand_primitive = True
psys.settings.radius_scale = 0.2
psys.settings.hair_step = 3
psys.settings.count = 5

# Connect and disconnect (needed, but why?)
bpy.ops.particle.disconnect_hair(all=True)
bpy.ops.particle.connect_hair(all=True)

""" https://developer.blender.org/T58792 """
#https://docs.blender.org/api/blender2.8/bpy.types.Depsgraph.html  <--- relevant?
depsgraph = bpy.context.evaluated_depsgraph_get()
object_eval = obj.evaluated_get(depsgraph)
psys_eval = object_eval.particle_systems[0]

print('Number of particles:\n  %d  (psys)\n  %d  (psys_eval)' % (len(psys.particles), len(psys_eval.particles)))
psys = psys_eval
""" ------------------------------------------------------- """

# 3. Set hair positions vertices
for m in range(len(psys.particles)):
    psys.particles[m].location = (m, 0, 0)

    for n in range(len(psys.particles[m].hair_keys)):
        psys.particles[m].hair_keys[n].co = (m, 0, n)

# Toggle back and forth to update viewport
bpy.ops.particle.particle_edit_toggle()
bpy.ops.particle.particle_edit_toggle()

Note: I posted this exact same question on BlenderArtist.org, but afterwards read that StackExchange may be more suited for this type of question so I'll attempt here as well.

Halfway there now…

Following this answer for manipulating particles, and shoehorning this problem with the same approach led to the following:

Viewport: OK! :D
Render preview: OK! :D
Final render: Not OK... :(

Code:

import bpy

# 1. Use initial cube as object and set CYCLES
bpy.context.scene.render.engine = 'CYCLES'
obj = bpy.data.objects["Cube"]

# 2. Add a particle system
psys = obj.modifiers.new("hair", 'PARTICLE_SYSTEM').particle_system
psys.settings.type = 'HAIR'
obj.show_instancer_for_render = False
obj.show_instancer_for_viewport = False
psys.settings.use_strand_primitive = True
psys.settings.radius_scale = 0.2
psys.settings.hair_step = 3
psys.settings.count = 5

# 2½. Animation options
psys.settings.frame_start = 1
psys.settings.frame_end = 1
psys.settings.lifetime = 1000

# 3. Setup frame_change_post-callback
depsgraph = bpy.context.evaluated_depsgraph_get()           # Get depsgraph

# Define particle setter. Set at every frame update(?)
def particleSetter(self):
    particle_systems = obj.evaluated_get(depsgraph).particle_systems

    for m, particle in enumerate(particle_systems[0].particles):
        setattr(particle, "location", (m, 0, 0))
        for n in range(len(particle.hair_keys)):
            setattr(particle.hair_keys[n], "co", (m, 0, n))

    # Toggle back and forth to update viewport
    bpy.ops.particle.particle_edit_toggle()
    bpy.ops.particle.particle_edit_toggle()

# Clear the post frame handler
bpy.app.handlers.frame_change_post.clear()

# Register our particleSetter with the post frame handler
bpy.app.handlers.frame_change_post.append(particleSetter)

# Trigger frame update
bpy.context.scene.frame_current = 0