curve intersection with volume in animation nodes How can we detect the intersection of a spline with a volume? I've been trying to create edges from the splines to detect the crossing between lines and planes but I'm not sure if thats the correct approach.

What I am trying to accomplish is to detect where a curve enters and exits a volume, any ideas?

EDIT

I'm trying to reproduce the solution but I found that my evaluation spline node doesn't look like yours, it actually has the parameters from "Get spline samples" node, but also differs in its outputs. Checked hidden parameters but all is unhidden.

EDIT

seems "get spline samples" does the job fine. Might be a custom naming issue

EDIT 2

After downloading @Omar Ahmad blend file I noticed that this method is far more efficient but still produces inconsistent results. When a play with the spline points moving them around and increasing all evaluate and get sample nodes to resolution up to 5000 the problem persists. I'm sorry if I'm being too strict with this detail (which could be due to a resolution factor) but is very important for me this works as foreseeable as posible. Here the screenshot showing the problem:

Naively intersecting lines with planes could be problematic as the Intersect Line Plane node, or the Python function behind it, considers the plane to be infinite. Therefore, as a second step, you would have to check if the intersection really is on the polygon.

I suggest using the BVHTree > Ray Cast node instead.

With the Evaluate Spline node (for Aimation Nodes v2.1; Get Spline Samples for AN v2.0) and two different slices of the node's Locations list – vectors[:-1] and vectors[1:] – I create small line segments along the spline.

start vector and end vector of these segments (as iterators) as well as the BVH Tree of the object (as parameter) are fed into a loop. Within this loop I call Ray Cast with a maximum distance of the segments' lengths and a minimum distance of zero. (The minimum distance by default is 0.001 or something which might result in some missed intersections.)

With the Condition input of the loop's Vector List output I collect all location vectors of ray casts that resulted in a hit.

The Ray Cast node also has a Normal output that lets you align objects on the face where there is an intersection – e.g. by using the Direction to Rotation node. If you also want to distinguish entries into and exits from the volume then you can calculate the angles between the normal and the segment and check if it's smaller or larger than 90°.


DIsplace Modifier Problem https://gph.is/2QKbRBK
I'm attempting to use the displace modifier to cause the desired effect as shown in the gif, but the issue is that the modifier's strength is limited by the placement of the highly subdivided edge.
The mesh is in a vertex group called "displaced" set to weight of zero with only the highly subdivided edge set to a value of one. This allows just that edge to be displaced in only the x direction.
Is there any way I can get the blue to fill in where it overlaps to the red side?

other details:
The UV map is simply a square divided in half with two colors. The highly divided edge is right over the line between the two colors in the UV editor. Changing the location of the object's origin has no effect. The displacement is governed by an animated empty object. All texture settings result in the same problem, only strength of the modifier can be lowered to get around the limit but is not a desirable effect.

I bet somebody has a cleverer idea of how to achieve my goal, and I'd like to hear it.

Other problem is that rendered view shows a blend of the colors.
https://gph.is/2NXizGb

My original UV image had a middle stripe of a blend of the two colored sides creating an illusion of two colors mixing in Blender.
I recreated the UV image with no stripe. It's working now. Also, I recreated a plane mesh, and instead of subdividing it a lot as I had originally tried, I used a ton of loop cuts in the axis of distortion (y), and then another loop cut perpendicular to that (x) and marked as seam to bisect the plane.

https://gph.is/2Dh8vDE


Do joined objects have to have internal faces removed for 3D printing? I'm going to be putting some sculpted objects joined together in blender that are going to be 3D printed.  In 3D printing do the faces that are not on the outer surface need to be removed? If they do it appears I have some big problems.

In general, yes. You are not allowed to have non-manifold geometry. If you are not already, I recommend using the 3D Print Toolbox addon, which gives you tools to check if your model is compatible to print.

The proper way to combine those spheres would be with the Boolean modifier or booltool. This can create messy topology, but that doesn't matter much for 3D printing.

It is possible that some slicing programs will automatically handle this problem, but I don't know. (A Slicer is the program that actually prepares and sends the job to your printer, such as MakerBots software, Slic3r, or Cura)


How to get displacement working on a completed house? I made a house with blender but how can I apply displacement modifiers only to the walls and not to the whole object?

You can create vertex groups in edit mode and attach them to the displacement modifier.

Select your wall's vertices.
Press space and search for add vertex group
Assign the vertex group to the modifier.


Why are the 'Sun' shadows different to other light sources? Blender 2.8.1 Eevee As you can see in the images below, the shadows cast from Sun are more accurate than ones cast from any other light type in Eevee. Why is this? Is there any way I can make a Point light cast shadows the same way as the sun, without enabling 'contact shadows'?

Here is the sun:

Here is the point:

It turns out that the 'Bias' option for the non-sun light sources needed to be set to the absolute minimum. Everything looks great now.


Animating bones causes odd deformation I pose my hand like this.

I go through and LocRot and the second I move off the keyframe it deforms into this.

Most likely, you forgot to keyframe those two individual bones. Make sure they are selected, then add the keyframe when they are in the position you want them in.

If they are already keyframed earlier in the timeline, in a different position, when you move your timeline cursor they will jump back to the position they were in at the earlier keyframe.

Make sure you are on the frame in which you would like to place the key, then do the bone movement, then place a key before changing frames.

Perhaps you would rather remove the original keyframe instead. This will avoid the jumping, and the bones will stay in the position you left them.

Another possibility is that you accidentally added a keyframe later in the animation, causing this problem. Maybe there is one on the frame next to the one you are on?

I'm sorry if this doesn't answer your question, but I do not have any other reasons why this problem is occurring from your post.


Measure light on surface I'm pretty new with blender, I'm looking for a tool similar to this one for vray for 3ds max:

https://www.chaosgroup.com/blog/how-to-set-up-lighting-analysis-in-v-ray-next

I aim to make the lighting calculation (measure the average lux on the floor of a room)

Thanks


Wrong shadows with Cycles Renderer I've tried to preview my final render, however I've noticed that the shadows are casted incorrectly. The problem isn't the positioning. Moving the lights doesn't affect shadows and only makes already illuminated areas brighter if the light source is near them. But even if I put the point light in front of the face, the shadows aren't modified at all.
I've tried strenghtening the light and changing its size, however the shadows are still wrong.

Is there any step I've missed? How can I fix this?

Incomplete node setup

Normal maps need a conversion  before you feed them to the shaders. The black spots you are experiencing are not shadows, but an incorrect calculation of the surfaces normals.

A Normal Map node must be added between the texture and the shader.

As said in the manual:

  The Normal Map node generates a perturbed normal from an RGB normal
  map image. This is usually chained with an Image Texture node in the
  color input, to specify the normal map image.


Texture shows in render but not in 3d view What are reasons my UV map doesn't show up in 3D view?

3D view in object and edit mode only shows a wireframe.

However when I render, I can see the UV map applied.

This looks quite obvious to me: the normals are inverted, thus the faces get culled. In english, the textured view is optimised by showing only one side of the faces. This way the inside of the mesh doesn't get rendered.

For some reason you have the faces pointing the wrong way around (ie. Blender thinks that the inside of your mesh is the outside and vice versa.). To fix this, in edit mode select all vertices and go to the Shading / UVs tab (allready open in your screen capture) and under Normals hit recalculate. If this didn't work, you can try to manually invert them by hitting Flip Direction. Now the surface should work.

I hope this helps.


How to rotate/line up an object to an axis I am trying to rotate the below object against an axis so that it looks like in the second image

In the second image I rotated the object manually, however I know this isn't ideal as it may not be perfectly aligned. Is there a better way to do this, using a trick/tool to ensure it lines up perfectly?

Many thanks

1. If you rotated your object in Object Mode :
Hit Alt+R to reset rotation
2. If you rotated your object in Edit Mode :
That was a bad idea, cause you can't do .1.
Generally, if you want to rotate/scale your whole object, do it in Object mode.
If you want to rotate/scale a part of your object (some verts/faces), do it in Edit mode.
Ok but it's done now. What can I do ?
You can try box-selecting the vertices that you know should be aligned, and align them manually (s/z/num0 to align them on Z). It's tedious, that's why you should always prefer .1.


Visible smell sensor? I'm a newbie to Blender and I'd be grateful if you could help me to solve my problem.

Imagine, there are multiple objects located in a 2D maze and all of these objects release different odors. Odors are spreading just like Wifi signals and they are visible, and our player can follow these odor signals to detect the location of these objects.

So how can I make objects to release such visual signals? And how can I make the player to detect that there is a signal exist in a specific direction.

Thank you very much in advance for your answers and please let me know if my problem isn't clear.

I would use a different colored smoke for each smell. You could use a mist effect and change the atmosphere color as you get closer to a smell, or you could use something like in this question How to create volumetric/smoke material in blender game engine?.


Restrict Particle force influence by Area For a crowd simulation, created by using force fields(Force) to generate limited particle displacement [simulating a "PARTING EFFECT"],how  can one restrict influence of the Effector to only the particles close to the Effector Object and not have any influence on the particles which are away from the Effector?

In this simulation[Gravity=OFF],the force field is set to the lowest effecting Strength(= 0.1) to cause any resonable particle displacement,but all particles are getting affected.

There is no effect on setting Field Weights by Weight Painting the particle emitting Object and with no way to assign separate Vertex groups of Emitter Regions in the same particle emitting object,how can one cause two different Particle behaviours in the same Particle System and using the same Force Field?

Use the Falloff on your effector, enter a power value (here 4.3) and limit it's maximum distance to whatever suit your scene.

Also add a drag force, and set it up like in the screenshot, to avoid the cubes flying away after they were pushed (the drag isn't shown in my gif just to be clear).


Multi extrude a vertex in the coordinate direction I' want to multi-extrude one vertex to the coordinate axis it is possible in blender without doing it manually here is an example.

I've uploaded on GitHub a script that allows you to extrude selected vertices in all directions.

https://github.com/parameciostudio/extrude-vertices-all-directions

You can set the amount and choose whether select created vertices or not.

How to install

Open up extrudeVerticesAllDirections.py in the Text Editor and press Alt+P

How to use

Select a mesh object and toggle into Edit Mode (Tab)
In the MISC tab of the Tool Shelf (T) you'll find a new Extrude in all directions panel
Set the extrusion amount and whether select new vertices or not (if not, original vertices will still selected)


Keyframing Physics Animation I have a Rigid Body object that I want to be animated at a specific time. Can I animate it using the Blender Game engine? Also, is pressing P the only way to see it (can I see it using AltA)?

Ensuring that blender is set to "Blender Game" mode, ensure that the "record animation" check box is ticked in the Game menu.

Then hit
P to start running the game (it'll probably run slower than normal). After the length of the animation you want to record has been recorded, press Esc to exit playing the game. Press left/right on your keyboard, and you'll notice a key frame has been added to each object for every frame of the animation:

(Also notice that if you play the animation using AltA now, the physics will run as it does in the game engine as the position data has been applied to the objects using key frames).

If you want to delete part of this animation or shift all of the physics animation in time, enter the dope sheet window like so:

You can select key frames by pressing B and drawing a box around the key frames you want to select. When doing so, ensure that you select the key frames of the object that you want to edit the animation of, and not X,Y,Z location and rotation as that will distort the physics simulation. You can ensure you are not doing so by clicking on the arrows so that these options are not visible:

After you have selected the key frames of the object you want to edit, you can increase/decrease the speed of the animation using the S key and make the animation of that object occur later/earlier in time using the G key.

You can also delete parts of the animation by box selecting the key frames you want to delete from the animation as outlined above, and pressing the Del key:

This will mean that the key frames of the object's animation you have deleted will not run (essentially cropping the start and end of the physics simulation if that is desired)


Help with "Cuda Error: Out of memory" can anyone help me... I just wanted to do a quick clay render to see some shadow issues but I keep getting a "Cuda Error: Out of memory" message come up.  I'm running the render off of my GPU which is an 8GB 1080 GTX so I cant really image a problem.

I turned off caustics and put the samples at 64 and still I'm getting the error.   Would anyone be able to offer any advice and maybe try the render with their PC?

Your scene contains some incredibly high amounts of subdivision. You can see in the stat readout above the scene had reached 6.7GB of memory use. (the remaining 1.3GB was probably lost to overhead and OS). Even just in the viewport, your scene is almost 15 million triangles. And several objects have higher render subdivision than viewport subdivision, resulting in even more geometry at render time! For example, you have a number of objects with a modifier like this:

This uses subdivision level 4 at render time, which is 16x the polygons of subdivision level 2!

Most objects in that scene are not going to look substantially different with reduced subdivision. The "door" and "body" objects might need one more level than they have in the viewport, everything else looks fine just at the viewport level it's currently set to, or even lower!


Why am I getting banded stripes in my reflections? I've been using blender for about a week, so I'm still very much a beginner - I'm trying to make a roll of plastic for my website, I'm having a problem though, in that my reflections are showing strange bands.

I'm aware that I need to increase my render samples (the screenshot is to illustrate the problem), but this doesn't remedy the problem.

Anybody got any ideas?

Try setting the shading to smooth from the tool shelf (t). If that doesn't work then check your normals or do recalculate outside for the normals. If that doesn't work either check your model for errors, overlapping faces etc...


Someone please explain why materials only apply when i click on use nodes This doese'nt work

This does...

You're in Solid shading mode which doesn't support node-based materials.
Switch to Material Preview or Rendered preview and nodes will work properly.


Copy driver transform object when creating new scene Is there a way either when copying a scene or even and easy way after, to update the "transform object" of a driver? I've noticed that even if creating a new scene as "full copy" that although all the objects and meshes are properly duplicated, that the driver object of the newly created key is still set to the original driver object. I know I can simply change it in the graph editor, but in some cases scenes can have many meshes with many keys and this becomes quite tedious.

See in this outliner image, I've duplicated the scene with "Full Copy" and although all my objects are now single user, both keys are using the same Driver Object.

I would submit that as a bug. I would expect a new driver if I did a full scene copy, and not have a Scene 1 object still driving a Scene 2 target.


I want to render a few frames and all I get is a black screen To escape Blender I tried to export the particle simulation to fbx by baking the animations and then bring it in and then I can render it very easily there.
I was unable to bake the animation of flocking birds, so I'm forced to render in Blender but I still cannot figure out how to render frames.
Can anyone just show me even by pictures where to click to render one frame the correct camera

The 'active camera' is the one used for rendering. To make a camera the active camera, click on it and press Ctrl + NumPad 0.
To render a single frame you press  F12 or in the top left corner click Render > Render Image.


Shadow Catcher blocks background image in 2.8 I'm pretty new to blender, and as I was getting used to 2.79, 2.8 landed and confused me ever more. I was wondering why the Shadow Catcher blocks the background image I set even if I checked transparent under Film.

Found out an answer. I should've just searched tutorials instead of troubleshooting forums instead.

Here's the link that helped.
https://www.blendernation.com/2017/04/17/use-new-blender-shadow-catcher/

So I apparently just needed to hit render and mix up some nodes in the compositor.

Thanks to the people who took their time to correct my post as well!


What is the most physically correct glass shader? What node setup is the most physically correct? I mean, wich is the glass shader that looks the most like real life? The glass shader that makes the light rays act like real life.

"Glass" is too vague; there are many kinds of glass with many different optical properties. See refractiveindex.info to get some idea of the number of parameters you can worry about.

As far as cycles is concerned, a plain glass shader is as close as you probably care to get before increasing render times too much. Though absorption may be applicable with colored glass.

While there are ways to approximate other phenomena like dispersion in cycles, if you are serious about simulating those you are likely better off using a spectral renderer like luxrender.


how do I add missing section to a cylinder I have a label that wraps around bottle, however it does not wrap around sufficiently. I need to close the gap, making the label longer but keeping a perfect circular shape (as seen from above). Is there an easy way of doing this or do I need to start again from scratch?

Duplicate (ShiftD) a section of the label large enough to fill the gap, (don't move it,) and then rotate it around Z until it does.

Do the rotation in vertex select mode: select all the vertices in the new section, finishing with one of the vertices that's going to lie on the seam, to set it active. Set Snap On to 'Vertex' and 'Active'. The active vertex can the snap to its partner on the other side during a constrained rotation (RZ)

If the label is not conveniently centered on the world origin , choose 2 diametrically opposite vertices from it, and (ShiftS) send the 3D Cursor to Selection. Then use that as your rotation pivot.

Once the vertices on the seams are coincident, CtrlV bring up the vertex menu, and select 'Remove Doubles'.


IK Rotation option for opposite end I have a string of bones with an IK constraint at the end that uses most, but not all, of the bones. When the target is brought back, the first bone bends greatly away from the bone before it, and the last bone (the one with the IK) bends greatly relative to the rotation of the target. In the IK constraint, there is a rotation option which will force the last bone to match the rotation of the target, and the bones before it rotate to account for that. How can I do this but for the first bone instead of the last, so it matches the rotation of the immediately before the IK-affected bones and the other bones rotate to account for it?

This effect can be done by reversing the IK string ([w] -> "Switch bone direction") and placing the IK constraint on the "first" bone targeting the bone that used to come before it. Give the "last" bone (that used to have the IK constraint) a Copy Transforms constraint of the old IK target.

However, there are a couple things wrong with this method:

If the target is brought outside of the maximum length of the bones, instead of the bones pointing toward the target, they will follow the target and point at the other bones.
The rotation of the new target must be accounted for.


Blender to Android studio i tried making a game with blender engine and used 3d modules from blender 3d can i import it to android studio? since blender doesn't support Android.

While I think there has been some work done to get blender running on an android device, I wouldn't recommend trying at this stage.

You can export your 3D models and open them in an Android application, though using Android studio would mean programming the game yourself.

I would recommend using an external game engine, such as godot or unity to create an android game, both of these can use the models you create in blender.


Why are the UV objects scaled after "Project from view" I'm trying to texture an audio cassette, which is something I do for the first time.
When I select the faces where the texture should be applied on and then go for UV > Project view then the unwrapped UV objects are scaled... What do I wrong?

Thanks for your help!

Here a bit more precisions on how UV scale works.
When you unwrapped you probably didn't load your image in the Image Texture node (in the Shader Editor), so by default it unwrapped at a 1:1 scale. As the selected image in the UV Editor is not 1:1, it appears stretched.
To make sure that the UV is proportional to the mesh, select the right Image Texture node in the Shader Editor, load the right image, then unwrap again.
Before (Image Texture node selected but no image loaded):

After (Image Texture node selected with image loaded):


Changing default text value in file dialogue My mesh exporter opens up a file dialog, allowing the user to choose a folder.

It then creates the folder if necessary, and populate it with data files.

My problem is that there is default text in the text box:

Is there any way to clear it from Python?

It is a trivial problem as it is just a few keystrokes to do it manually, but if there is some way to do it I would like to.

It's actually a feature of the ExportHelper mixin:

class ExportHelper:
    filepath = StringProperty(
            name="File Path",
            description="Filepath used for exporting the file",
            maxlen=1024,
            subtype='FILE_PATH',
            )
    #...
    # subclasses can override with decorator
    # True == use ext, False == no ext, None == do nothing.
    check_extension = True

    def invoke(self, context, event):
        import os
        if not self.filepath:
            blend_filepath = context.blend_data.filepath
            if not blend_filepath:
                blend_filepath = "untitled"
            else:
                blend_filepath = os.path.splitext(blend_filepath)[0]

            self.filepath = blend_filepath + self.filename_ext

        context.window_manager.fileselect_add(self)
        return {'RUNNING_MODAL'}

    def check(self, context):
        # code that uses check_extension and adds it if True
        # ...

Add this to your export operator to overwrite the invoke() method:

    def invoke(self, context, event):
        self.filepath = ""
        context.window_manager.fileselect_add(self)
        return {'RUNNING_MODAL'}

It won't use a default name for the export, clears the filepath from a previous run of the operator (so always starts empty), but still adds the file extension if you enter a file name (you can disable it if you want).


Image Texture does not appear (correctly) When modelling a smart phone I selected part of my mesh, create a uv map with  "project from view" and added an image texture. First the image texture was stretched and now it doesn't appear at all.  How can I have this image texture Front Camera.png correctly mapped on my mesh ?

The image texture is not a shader, so it shouldn't be plugged to a mix shader node.

Use the image on the color part of the diffuse node.


my menu material is different from most people's menus on the internet, how to replace it? This is my material menu look like

meanwhile this is most people material menu look like in most youtube tutorials https://www.wikihow.com/images/thumb/5/5a/Blender-Diffuse-and-Color.png/363px-Blender-Diffuse-and-Color.png.webp

As @Lemon said,
change your RenderEngine to Cycles and in the MaterialTab tick "use nodes". Now you have the same menu as in the YouTubeTutorials.


Collision detection in cycles I want an object to do something if another object collides with it, very similar to the "Collision"-logic-brick in the bge. Is there any way to use a similar method in another engine?
I am aware of a python command collision. Maybe it can integrated into a driver.

I dont know about the blender logic operations but this is what I can do in this case:

Add a driver for the operation you want to apply to the object.
Add a distance variable and set the object to itself and the other object.
Add a custom property and call it margin which will be the margin of the object (the distance in which the object will interact from the origin point).
Add this custom property to a single property variable.
Type "ternary conditional operator" like this in the expression.
Now when ever the "Cube.001" touch the "cube" the scale will change to 2 instead of 1 (and of course you can change the operation)


How to make particle animation intensify as an empty comes near? I know how to use a driver to, for example, make an object rotate as an empty is brought closer to it. But I am wondering if I can use an empty to amplify the keyframe Y values more the closer it gets. This way I can have a forest of trees swaying gently in the wind but for only the tree particles in close proximity to the "wind" empty the sway will intensify to a heavy rocking motion. I would somehow need to specify minimum and maximum amounts of animation. I have no idea what sort of Python expression I would need for this, or if it's even possible to use a driver to amplify keyframed data. Any help appreciated!

Weights on a lattice.

Armature controlling lattice and lattice controls particles.

Particles can be affected by a lattice.  This might prove to be the least CPU resource consuming.  Lattice can be affected by armature or shape keys et cetera.  Higher UVW specifications may produce more controlled effects.
Particles can be affected by forces attached to an empty.  You can use an effector group to minimize force calculation


How to get actual rendering progress and estimation from render_stats python handler? There is render_stats bpy handler

It seem like it is invoked every time rendering engine prints to console smth like

Fra:0 Mem:410.70M (0.00M, Peak 450.46M) | Remaining:01:16:22.96 | Mem:307.83M, Peak:307.83M | _mainScene, interior | Path Tracing Tile 18/8160

I am wondering if  there is a way to get numbers like estimate(01:16:22.96) and current tile(18) from render_stats handler in python script?

Now the only way I see to get this is parsing blender output which is not very cool

There is something alike it in UI, but there is no tooltip with python snippet for it:

This question may seem alike Is it possible to get render time per tile?, and it's stands there that you can't. But in there it's about render time for specific tile, and I am asking about render time estimation for particular frame, may be you can get overall estimation?

I know it's not the best, but the best I've been able to come up with is code that processes the console output:

Output gives you the render time of the last frame
Output tells you the frame number that was just rendered
You know how many frames are in the complete render, which you can pass to your program
You know the start time of the render

From the above, you can calculate the average render time per frame, which I've found after just a few minutes becomes a pretty stable value.  If the number of rendered objects per frame changes dramatically over time, then of course the average value will change, but given the average render time per frame, you can come up with:

Number of frames which were rendered - grab that from the console
Amount of time elapsed (Current time - Start time)
Current running average render time per frame
Frames left * average time/frame == Render time left

If you have multiple scenes within an animation, you can then also do per-scene calculations, along with the overall animation calculation.

Again, it's not the optimal solution, but it's pretty easy to put together, and it does an effective job of informing you how much time do you have to go before your animation is done.

I hope this helps.


What is the simplest way of extracting the depth values of the scene? I am totally new in the 3D-world, But I am really interested in having the depth values of the scene (in the raw floating point numbers format),
Unfortunately, I could not find an associated question (and also its answers) in the whole Blender beta society about that,
Any possible help is highly appreciated in advance, Thanks a lot.

I'm not sure I understood the request.
In case you intend to as depth values: values of the z-buffer of the camera
then the answer is easy.

you have to use this simple code:

#first import the libraries
import bpy
from bpy_extras.object_utils import world_to_camera_view

context = bpy.context
scene = bpy.context.scene

#create the def for take the z-buffer
def checkCameraView(cam, obj):
    for v in obj.data.vertices:
        x, y, z = world_to_camera_view(context.scene, cam, obj.matrix_world * v.co)
        print(z)

#select the camera
cam = scene.camera
#check every mesh type objects in the scene
for obj in scene.objects:
    if obj.type == 'MESH' :
        checkCameraView(cam, obj)

z is the depth of the vertex
x and y are the coordinates on the Cartesian coordinate plane (2D) of the chamber
x = horizontal
y = vertical

api link: world_to_camera_view

This was the question?


Black wires covering object Im quite bloody inexperienced in this software, so you might as well call me a noob, but here is my problem:

I was modelling a soda can, then I decided to make a stand for it and accidentally pressed the smoke simulation. Afterwards I don't know what I pressed when suddenly the can and the stand turned black with bazillion of wires.

What I know is that I put a lot of Edge Loops as a finishing touch for the can before it happened and it has subsurf modifier on it.

Heres a picture:

Soooo, basically I'm stuck at this point (School Project)

Enabling a smoke simulation changes the maximum draw type to "wire", as opposed to the default "textured".

I believe what you are looking for is this:

EDIT: This is in the object tab in the properties panel. I forgot to mention that.


Render checkpoints during long renders I've tried to render a complex scen for my first time. The reported time was 23 hours but after some 14+ hours the computer restarted for unknown reason. In case I'll face a similar situation in the future, is there any way to save a checkpoint image of an ongoing render? Or even better, is it possible to create checkpoints of the entire rendering for crash recovery?

It's standard practice to do this with animations, as described in this video.  If your scene has no animation, you can use the same technique for still images by rendering one vertical strip at a time, by animating the camera settings.

For example, to render the image in 20 vertical strips, set the horizontal resolution of your image to 1/20 of the desired image width, and set the Frame Range to 1...20.  Then with the camera selected, add keyframes to the X Shift property:

Set X Shift to -0.95 in frame 1 and 0.95 in frame 20.  Go to the graph editor and make sure the property is using linear interpolation.  The curve should be a straight line like this:

After rendering your scene as an animation (using the method described in the video), you will have twenty images that you can stitch together using Photoshop or Gimp.


strange behavior duplicating objects in blender 2.8 Within a day of installing the molecular script addon, selecting an object in blender 2.8, duplicating it (hitting "shift + d"), and confirming (if that's the right term) the duplication (hitting "enter") results in the two objects becoming linked.  This problem is similar, but not identical, to the problem described in Can not find unlink object data in Blender 2.8
None of the solutions to unlink the two objects works.

A workaround: the second object is able to be moved without hitting "g", and that's enough to unlink it from the original.

The question is how to make a duplicate without having to move the copy of the original?

I think there may be a few problems. Either this is a Blender glitch, in which the answer for that case is to restart Blender, or you may have set the objects to be linked when you duplicate them. You can fix this by looking at the options Blender shows on the left when you duplicate the object. If the box shows "linked" as being checked, then click that to unset linking the objects when duplicating. Also, perhaps, it may be because you hit enter to confirm the duplication. If you left-click the mouse (or track-pad), it will also confirm the duplication's location. Right-clicking keeps the duplicated object at the first object's location, but keeps the duplication.


Everything rendered in black except sky background in cycles So, my problem is that I want to render my first proper ~10 sec animation in cycles and it all comes out black, except the sky background. Now when I display everything as rendered in my standard 3D view it all looks like it is supposed to be. What could be my mistake? I googled my problem already and did not find a proper solution... http://www.pasteall.org/blend/39100

Welcome!
In future questions, please try to provide as much detail as possible, optimally with screenshots to explain the question or issue.

Specifically here, it appears you added an overriding faulty material (Material.002) that replaces all other materials in your scene.

To fix the issue, remove it by going to the Scene Tab in the Properties Window, scrolling down to the Layer property group, then clicking the delete ("X") button in the Material box.


(v. 2.72) Input movie's audio/video is in sync, but VSE output is floating and desynchronized between audio and video I've captured some .mkv files with Simple Screen Recorder (SSR).
When I watch these individual files, they play fine in Mplayer. The sound and image are in perfect sync. I hear clicks from my mouse and they match with actions on the screen.

While editing (A/V Sync is on) in Blender's Video Sequence Editor (VSE) it all seems rather fine - I can not play it back smoothly from Blender (640x480@60FPS, h.264 losless, stereo FLAC audio), but it doesn't seem to float too much. Just a little, especially when I start in the middle of a clip.

I rendered the movie, and the sound is completely off with timing in relation to the motion picture. It's floating around by a couple of seconds (an event happens, a few seconds later I hear sounds that were related to the event I saw earliest etc.).

I tried re-rendering the movie after enabling and generating timecode (Free run mode) for all movie clips. It didn't help at all.

What is happening? Is this a bug? I'm having these sync issues for years now.

My guess would be that Blender is not decompressing the file successfully. Best solution is to transcode the source media (with non Blender app) to be Blender friendly but sadly this will probably increase file sizes a lot.


What do the 'Custom shape' options on the Sapling Tree Gen add-on do? I downloaded Sapling Tree Gen 2.78 and I can't find any help.

What do the 4 lines of Custom Shape mean?

If you change shape to custom shape, these values will be active.

When you point your mouse on it it says these are the values for Base, Middle, Middle position and Top respectively. You can change those, using your mouse and drag these fields to the left or right or enter number between 0.01 and 1


Scaling around median with mirror I have a circle with a mirror modifier. When I scale it in object mode, it scales fine, but when I do the same in edit mode, the median seems to be the centre of the non mirrored vertices. How could I fix this?

Change the Pivot Point to 3D Cursor (shortcut .):


Particles emitted from video layer I am trying to compose a shot that combines video layers and 3D.

In the shot, there are two video layers, one is the background and one is an alpha layer of a ghost floating around.

They are both .mp4 / H.264 video layers shot with a DSLR, one of them made transparent with an alpha layer. They would both be 1920x1080.

They could be imported in Blender as "planes as images" but any other way that works is good.

I am trying to make the Ghost layer emit particles, from the border of the object (not the edge of the frame) resembling green smoke or steam. The particles should come from the edge (all around) of the ghost layer.
I looked into doing this in other software (After Effects with Particular), but haven't found a way to get the results I'm looking for, which have more to do with curls of smoke than particles.

Here is an alpha video with a ball instead of a ghost you can use to help solve this question.
And here is a .blend file where the video was imported already

The basic setup you are asking for is quite simple. You could just arrange the planes accordingly in 3d space (although I would render on a transparent background and later composite your 3D particles + ghost layer on top of your plate).

The part with only emitting particles from visible parts of the ghost layer could be resolved using a particle texture (just feed the transparent video into the particle system using the "Textures" panel under the emitter/particle system settings; a ramp could be used on the texture for additional transparency control).

On the behalf of the smoke I would try to utilize a low-res smoke simulation (source of which the particle system would be). That generally tends to look better than just faking it using particles.


Model and materials turn black after I reopen the project When I reopen my saved project file, my model and materials turn black.
This happens all the time when I open the project. All the texture paintings were saved and displayed as painted.
Could you please help me?
P.S. I have the newest version of blender, so all the actions were done in one particular version.

Painted textures need to be saved as image files first.
Blender doesn't save them for you when you close then project or when you save the blend file.
Unless you save the textures manually you will not get them back next time the project is opened.


(Blender Bug?) Chaning Property In Redo Panel Deselects Geometry This issue has been driving me nuts and if not fixed, makes all my selection add-ons useless.

I've done a TON of testing and found when it occurs.

This is how it works:

When you select any geometry with any select operator(bpy or bmesh) and the code is executed by a custom operator, the redo panel will deselect the geometry selected by the script and only leave one unselected.

As you can see the operator is super bare bones, no junk code, yet the issue still occurs.

To confirm that this is a fault with a custom operator, I selected the edges with the same code, just without the operator. And I didn't run into any issues.

The demo speaks for it self:

I have no idea how this not already a big issue. I haven't seen anybody complain about this. But with this behaviour it tells me that it's a bug. I wish do death that I could fix it, but it seems I can't.

If anybody has any idea what's going on, please share it!

I also wanna note that I have rolled back my Blender to the most vanilla, factory settings possible. No addons are running and I'm using the default keymap.

Here's the code for testing:

import bpy
import bmesh

from bpy.types import Operator

class OT_SELECT_WITH_OPERATOR(Operator):
    bl_idname= "view3d.select_with_operator"
    bl_label = "Select With Operator"

    def execute(self, context):

        print('run')
        obj = bpy.context.edit_object
        me = obj.data
        bm = bmesh.from_edit_mesh(me)

        for e in bm.edges:
            e.select = True

        bmesh.update_edit_mesh(me, True)

        return{'FINISHED'}

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

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

if __name__ == "__main__":
    register()

Nevermind, just needed to add: bl_options = {'REGISTER', 'UNDO'} under my operator variables.


Blender screwing up normal maps from Substance Painter? I have been using blender for a bit and ran into some weird issues when using Normal maps from Substance Painter and have no idea why.

In software such as Sketchfab they show up perfectly fine with no visible deformations in the model

But in Blender the normal maps makes it look skewed and not flat per say.
Here are the nodes that I use with blender

And here are the export settings in Substance Painter if it helps

The normal map that I export from Substance Painter is in OpenGL format.
I use Blender version 2.79 and have had the same issue with Blender Eevee.

Otherwise is there a specific node setup that we should use in order to get the same results that we see in Substance painter?

Thank you for your time.

Edit 1: Here's all the Texture maps used

Unfortunately, we can't see your image texture nodes, which makes me think you don't know there is an important setting there, that you need to set up properly depending on the kind of map you're using. But as I can't see, maybe it's not the answer either.

As explained in the Blender Manual - Image Texture Node:
You have to set the color space to "non-color data" when your texture doesn't output color info for your material. Normal maps must be set as non-color data (as well as metallic, specular and roughness).

If you're curious on understanding the difference between "color" and "non-solor data" color spaces and why use one or the other, I suggest you read this topic.


How to change mid mouse button function for a keyboard key? "The Summary"
I need to change shortcuts that involves, mid mouse button and movement of the mouse, specifically "The shortcut for the Pan View Function" and the user preferences only allows me to put a single key or the mouse only. How can I set a combination of keys and mouse for a shortcut?

"The large explanation"
For medical reasons I stop using mouse, now i use just the pen of my tablet, the thing is that the button on the pen that I mapped to be the central button of the mouse is breaking easily with the continuous use, I bought a second pen and now it is begin to fail, I want to replace the mid mouse button function with any other key "I know i have to do it shortcut by short cut, that is not the problem" the problem is that the user preferences menu only allows me to change it for a single key, I need a combination of the movement of the mouse and a key, How can i do it?

Thanks Duarte Farrajota Ramos and thanks a lot cegaton that was exactly what I was looking for, thanks man!

I use blender with a wacom pen and no mouse.

In the System preferences > Input section I enabled Emulate 3 Button Mouse.

On the interface I drag the pen while holding:

Ctrl Alt to zoom in or out.

Alt to rotate.

Shift Alt to move up down or sideways.


How to Add existing Scene to VSE? Every .blender, file that we save, is a SCENE in itself, right? So the VSE provides a option to add a Scene. Now after adding the scene, how can I link it to an existing Scene?

For example :
1. I create a 3d Text and save it as Text.blender.
2. Now I create a video using the VSE and save it as Video.blender.
3. To Video.Blender I add a SCENE.
4. How can I link the New SCENE to Text.blender?

Thanks,
Anand

A ".blend" file is a an entire project that consists of 1 or more scenes.

A .blend file can have a scene dedicated to VSE output.

Any .blend project can "Append" another .blend's scenes.

Navigate to the required .blend project and select the Scene category.

Once you have appended or "imported" an external scene it is available to add to the timeline (shift-A) in the first .blend file's VSE scene as a scene strip.


Modeling with metric units (cm) I want to model a cover for my key with exact proportions in centimeters. What tool I should use and how should I do that?

Just switch to metric units in Properties Window > Scene > Units > Length:


Armature not affecting mesh I'm aware similar question was asked before, but anserws there couldn't solve my problem.
Here is link to my (based on this YT turtorial) model:

https://drive.google.com/file/d/0B_Ws3TRRodiVc2pVWldGSWRCZjA/view?usp=sharing

I was striclty fallowing instructions and when it came to parenting armature with mesh, problem started. Armature didn't afect the mesh at all. I checked the mesh and the the whole amature but it all seems to be like it should be. Even in weightg painting it was showing that all vertecies are asign to individual bones.

Armature modifier also refers to vertex groups and when I uncheak it I could see my mesh reacting to it ( but only in this instance ).

I need some help with this. I have no idea what is wrong and it slowy drives me a little bit crazy.

This is because you have "delay refresh" enabled in your armature. Disable it and your mesh will move when you transform any of the bones. Find it in your armature properties, display, delay refresh. Alternatively, just confirm a transformation of a bone (don't cancel the operation when you move it) and the mesh will snap to the bone position.


Make particle group both perpendicular to normal and random I am making a succulent, and am having problems discovering how to make the leaves come straight out. Better yet, out and up. I can't get the leaves to touch the plant, let alone stick out of it.

Additionally, I can't seem to randomize my group of leaves. They come as they are, in a row. In the screenshot, you can see the array of leaves. I have turned them 90 degrees on the x-axis, both ways, and other axes also.

Thanks in advance!

Change your Emitter Geometry Normal to 0
Be aware of [edit mode] vs [object mode]
Change your Rotation Panel / Initial Orientation to normal tangent.  This will depend on the [edit mode] orientation of your leaves.  In [edit mode] rotate your leaf by 90s degrees an an axis until you get the desired result.  You initial leaf orientiation should be lined up to the xyz axis much like your back is aligned with your spine.
Set the affect of field weights panel/ gravity to 0


find the closest vertex to a point in space When i want to find the vertex within a mesh object that is closest to a given point in space,
i can do something like this:

import bpy
p     = Vector((1,1,1))
ob    = bpy.context.object
me    = ob.data
verts = me.vertices
distances = [(v.co - p).length for v in verts]
val, idx = min((val, idx) for (idx, val) in enumerate(distances))

Then idx is the index of the closest vertex.

But is there is a ready made function available that gives back the index of the closest vertex ?

I don't think that there is a single function for that, but you can use the mathutils.kdtree module to query closest points.

If you sort the vertices of your mesh into a kd-tree you can just call

co, index, dist = my_kd_tree.find(p)

co will contain the coordinates of the closest point, index its index and dist the distance between p and the closest point. See the module documentation for the complete example.

If you want to query many closest points, using the kd-tree will be much faster than iterating over all vertices.


Blender 2.82 subdivision problem blender newbie here. I want to subdivide a plate but encountered a problem. This is the object(circle:ngon filled) before the subdivision.

This is after. the frame becomes blurry in edit mode.

Attempts to transform alters the object irrationally. I moved the innermost loop in the z-axis and here's what happened.

Someone help :(

If you're talking about the mesh visibility, it's normal you can't see some vertices as you've given your object a Subdivision Surface modifier. This modifier slightly deforms your surface, but the vertices are still displayed at their original position, so they might be hidden by the surface deformations. If you want the vertices to stick to the position that they will have once the modifier is applied, enable the modifier's On Cage option:

The other problem you're probably talking about is the fact that your vertices stick to the surface as soon as you're moving them, and that's because you've enabled the Snapping option:


Is there a way to quickly swap active images for UV maps? I have been looking around for this and haven't really been able to find a definitive answer. I just finished unwrapping a model and am getting ready to bake the Masks and an ambient occlusion map. This model has a lot of different objects a modifiers so I can't exactly combine them into one mesh. Is there a way I can take all the different objects and change the active image for baking on all of them simultaneously?

Maybe Texture Atlas can be of help enter link description here


How to open the MakeHuman Plugin Tab? I want to import a MakeHuman figure for scale.
I have installed the MakeHuman plug-in for Blender and it is showing as enabled in the add-ons list. I have enabled Accept Connections in the Community -> Socket tab in MakeHuman.
How do I open the window/tab in Blender in order to use the plugin?
I have googled for how to show add-on tabs and add-on windows in Blender, but have not found any general instructions. I have looked in the File -> Import menu, the Modelling Object Mode Add menu, the scene tree dialog context menu, and the add workspace menu, but it cannot find any reference to it.

The MakeHuman tab is in the viewport list as @ChristopherBennett says.
For my instance of 2.83.4 the key shortcuts did not work, but the list can be opened by clicking the little arrow near the top right of the viewport (shown below).


Transition between planes I want to create a landscape with multiple planes and sculpting. I want to have a transition between the planes so I don't have a gap or overlap planes.
Could someone please help me?

Go to Edit - Preferences... Add-ons tab and search for LoopTools. Enable the add-on.
Select both objects and press CTRL  + J to join them.
hold ALT and click right to the right edge of the left plane. THen hold SHIFT + ALT and click left to the left edge of the right plane.
Right click and choose LoopTools -> Bridge

Press CTRL + R, hover over the bridge and use your mouse wheel to get  a uniform density of loops across whole mesh.


Why does "merge by distance" not work here? I'm using blender 2.92 and trying to apply "merge by distance" on a mesh. You can see in the gif that I first select the vertex to show it is overlapped, then "merge by distance". I expect that after the "merge by distance" was applied I would end up with only one vertex but we can see that nothing changes after I apply it.
For context, I created the mess by starting with a cube, scaling on the X axis then I scaled the two sides to 0 on the x axis to create an edge shape so at that point there are two edges overlapped. I'm guessing it has something to do with how I attempted to create the edge on this mesh?

You have not selected both vertices to be merged. One is 'In Front' of the other, so hiding it from selection.
You have 2 options:

AltZ, toggle into X-ray mode in the viewport, so the back vertex is no longer hidden when making the selection

or

Check 'Unselected' in the operator's F9 Adjust Last Operation panel, which will merge selected vertices to all others within the given distance, selected or not.


Help with rendering shadows properly Im pretty new to blender and am in a bit of a bind here. I have this distorted water simulation that i am attempting to make look like snow (not the best but it works for what i need it for) and i am having troubles getting the shadows to render properly. if you know how to either bake to texture, or adjust settings for these shadows, any help would be appreciated.

here's a screenshot, the rendered part is just the 10 sample preview. but i personally don't think more samples will help

you can see how in the non rendered portions, the shadows on the ridges are much more visible than in the actual render, it could be my lighting as I'm using a single plane with an emission material set to 30. however if it is the lighting, would anybody know a better way to do it for this.

additionally i can also confirm that the area is just as ridgey as the rest of the plane, when viewing the entire scene rendered it all looks very shadowless. also the material for the plane is the default material. (when you just add a material to an object and don't modify it)

almost forgot! im using cycles renderer by the way.
thanks to anybody who can help!!!

From your question, I think you have one large plane pointing straight down as your light. If that is the case there in lies your problem.

Move your light off axis. If you want your shadow to be in the same place as the shaded preview, then move it along the -X axis and towards the camera. Next rotate the light towards your ground object. Now, if the light is a a low enough angle, each hump will cast a shadow. (your text will also, but that is a different issue)


hard/soft edges set normal angle how can I set se normal angle of an edge, to make it soft, hard or something inbetween?? (without beveling, withou more geometry)

I do it in maya selecting the edge ...menu/mesh display/set normal angle...

or just selecting ...menu/mesh display/hard edge

There are two ways of beveling in Blender.

Method One:
Go into edit mode and hit 'shift b' and drag the cursor until you have the desired amount. This will add more geometry though.

Method two:Go to the modifier tab and click:
 add modifier > generate > bevel
This will not add more geometry unless if you select 'apply'.


Smoke simulation only rendering when I apply smoke modifier I was able to render the scene without applying the modifier before but after some fiddling with the smoke material, some weight paints in the scene, and rebaking, the smoke stopped appearing on the final render. It only appears again on the final rendered image after I hit apply to the smoke modifier. The problem is when I apply the smoke modifier, the smoke becomes more intense and seems to take the shape of its domain.

Update: Okay, it seems like the smoke will render and stay intact if I just apply the flow object modifier but I would still like to know why it stopped rendering before I apply the modifier

These are my domain settings

My domain material settings

The reason what is think is your density for smoke in principled volume shader is very low you have set it to "0.100"  try increasing it to 1.00 or even more.


How to identify one face of cube via Blender's Python API? I have been googling for a way to interrogate the 3d view using a script, to discover the locations of the faces of a cube. I have seen a lot of rather complex, daunting sample scripts creating cubes from scratch with primitives (vertex creation etc) but so far nothing that looks simple. If I have selected a cube successfully, as below:

ob = bpy.data.objects['Cube_7_7']
ob.select = True
bpy.context.scene.objects.active = ob
bpy.ops.object.mode_set(mode='EDIT')

(the intended cube lights up when selected and goes into edit mode, so I must have at least this basic syntax right)

How can I find out, say, the median point of the bottom face of this cube?  is this straightforward (i.e. is there a face naming convention relative to the cube's position at its creation)... or is it ugly?  basically, I want to identify the bottom faces of all my cubes.

This script should find the bottom face of the cube, not taking into consideration the cubes rotation.

import bpy
import bmesh

cube = bpy.context.active_object

bm = bmesh.new()
bm.from_mesh(cube.data)

minZ = float('inf')
for face in bm.faces:
    if face.calc_center_bounds()[2] < minZ:
        minZ = face.calc_center_bounds()[2]
        bottom_face = face

cube.data.polygons[bottom_face.index].select = True
print('The bottom face is '+str(bottom_face))

Thus, you will need to either apply rotation (Ctrl + A) to all cubes or use the global Z, like this

import bpy
import bmesh

cube = bpy.context.active_object

bm = bmesh.new()
bm.from_mesh(cube.data)

minZ = float('inf')
for face in bm.faces:
    Z = (cube.matrix_world * face.calc_center_bounds())[2] ## This line is different
    if Z < minZ:
        minZ = Z
        bottom_face = face

cube.data.polygons[bottom_face.index].select = True
print(bottom_face)

EDIT: Simpler code without using bmesh

import bpy

cube = bpy.context.active_object
mesh = cube.data

minZ = float('inf')
for face in mesh.polygons:
    Z = face.center[2]
    if Z < minZ:
        minZ = Z
        bottom_face = face

bottom_face.select = True
print('The bottom face is '+str(bottom_face))

for global coordinates replace the line

Z = face.center[2]

with

Z = (cube.matrix_world * face.center)[2]


How to properly create hollow text letter suitable for 3D print? I am doing this project, where the objective is to print some hollow letters. I get to the following result with the spets that I took, where the objective is to make the letter 5 mm thick, with walls and bottom being 1 mm thick.

Steps I took:

I wrote a specific letter, resized it to proper size.
Then I apply extrude (5 mm) and set fill to BACK in the type settings.
I added Modifier (Solidify), with thickness 1 mm to the edges. Checked boxed: flip normals, even thickness and fill rim. The result so far was this.

Then i converted text to curves and then to mesh. I mirror the letter for printing.
I get a lot of intections (intersect face) and overhang face errors as seen below.

What can I do to fix this and is there another way to get the same result that I don't know of?

To create a hollow letter :

create a new project and remove the cube
Add a text object
press TAB to enter Edit mode
change the text to the letter your want
press TAB to exit Edit Mode
press ALT + C and select "Mesh from curve/meta/surf/text"
press TAB to enter Edit mode
press A to select all vertices
press E to extrude to the alf of the final letter depth
press Shift + S and select "Cursor to selected"
press X to delete faces
press TAB to exit edit mode
select menu "Object / Transform / Origin to 3D cursor"
add a solidify modifier
change the thickness
apply the solidify modifier
press TAB to enter edit mode
change the view to Front Ortho (5 1)
press Z to change to Wireframe display
press B and draw a border to select faces on the top of your letter

press X and select "Faces"
press Z to come back to Solid display
press TAB to exit Edit mode
add a mirror modifier
select the proper option X/Y/Z (unselect X and select Z)
apply the mirror modifier


Find center of geometry of a set of objects I have a Blender model composed of several objects.
I would like to move the 3D cursor to the geometry center of the model (=> one common points for all objects of this model).

I've tried to select all objects and then Shit+S: Cursor to selected.
Result: it seems that cursor goes to center of mass of all my selected objects but not in center of geometry of all my selected objects.

How can I achieved that ? Thank you.

I think selecting the object and pressing Shift+Ctrl+Alt+C would do the trick.
Similar question - How to recenter an object's origin?


How do I merge my blender files? I've made numerous different animations for a wolf, making a different blender file for each. I've just learnt that I should have made them all in the same file and played the animations back to back. Could someone please tell me how to merge the files together or copy the animations across to one file. If I can't do this, could someone please break the news to me and tell me I can't so i can start over on the animations. Thanks :)

Go to File, Append. Choose a blend file, double click to open, then navigate to the Actions you want to append to the current blend file.

See the manual for more info.


How to get a smooth transition between two objects. Two perpendicular cylinders I'm trying to create a smooth transition between 2 objects.
I thought I would start simple with 2 cylinders.

In the image below, I have created two cylinders, one slightly smalller than the other. I have simply used a boolean union, which I have applied. After this I have used a subdivision surface, to give it a smooth transition between the two. The issue as you can see is that it creates an undesired optical effect.

I've tried using a bevel, which just messes up. I've tried using a bevel modifier, which works at a very small scale. I'm looking for something like the hairdryer image attached - a smooth transition.

Am I modelling this the wrong way? If so, what would be better?

create a lip to the connecting piece
assign a vertex group to the lip vertices
add the Shrinkwrap Modifier to the handle, selecting the other cynlinder as target and using the created vertex group play around with the Mode to suit your needs).


Can't texture paint in cycles I'm trying to use texture painting with UV maps (both of which I am new to), and when I go into texture paint for my model, I can't paint it. I have UV-unwrapped the model when in edit mode with smart unwrap, set the texture node as active in the node editor, and selected my image file. Is there anything else I need to do?

I figured it out. Landscape meshes are created with inverted normals. I inverted the normals back on the left sidebar. Afterward I was free to paint.


How to solve certain topology issues I have a huge issue with topology that is really holding me back. When edges are close to eachother you get shading issues with subsurface divisions. I dont know if it is the way i model or something else, but i allways get this issue while modeling. No tutorial that i have found deals with this.
You can see there appears to be an edge on my meshes surface. Whats causing this is that there is a slight curve on the mesh (it doesnt appear on meshes that is symmetrical like a cube), and three edgeloops close together. The edgeloops creates a sharp curve on the top, whcih i want. I know i can slide the verticies away at the bottom, but when i say this is an issue i have often it is clear that i dont allways have that option.
If you have a sugestion on how to fix it, or you can direct me to a video, blog or some other learning resource i would appriciate it.

If your side is round, then you can use this topology, the tris won't create any pinching or artifacts here:

View from top:


Split mesh at a specific point I'm wondering if it'd be possible to make a script for splitting meshes to simple shapes at a certain point. Split it to prevent vertex A and B to exist in the same object.

Nevermind, I did some research and found out 'convex decomposition' is what I want. I ended up using V-HACD Blender addon.


How to make a texture always upright relative to the global Z? I have a character with a hologram effect by using the Layer Weight node.

The file won't upload so here's an image:

So when the Layer Weight node is connected in the Factor of the Mix Shader, the two inputs of the Mix shader are blended in a way that whatever is in the first input, it will be shown on the normals of the character that are more facing the camera (Emission and Transparent shader, in my example). I’m using a similar material with a gradient texture, its just that the polygons (with the "Lines" Attribute) that are more facing the camera are mixed with transparency and the other once with Emission. The normal map of the character is using a different UV layout/Attribute (this is more clear in the node setup of the file). But, is there a way for the lines to face the Global Z direction all the time even when I animate the character? Because the lines are likely to be animated to travel at the Z axis.

The texture for the lines - http://fc04.deviantart.net/fs71/i/2012/225/8/5/gradient_stock_01_by_gradient_textures-d5ayk4y.jpg

Yes.

The simplest way to do this is by using Object coordinates plugged into a Vector transform node set to transform from Object space to World space:

This will preserve the texture's location relative to the object, so moving the object up and down in world space will keep the textured "glued" to it:

If you don't want this, then you can use the Z channel of the ray position:

This will keep the texture fixed in world space:

Watch the upward translation closely to spot the difference between the two methods.

Note that I tested these with a procedural texture, so I'm not 100% sure it will work with an image texture. I assumed that a procedural texture might suit your needs better anyway. Here's the setup I used:


Should I remove hidden geometry on a model for use in a game engine? So I have this armor and base mesh character I wonder if I should remove the body and insert the armor because I'm worried with the vertices count that will ruin my fps any help?

Game would be an RTS exactly like Total War Rome
Game engine would be UNITY
With a Video Card Nvidia GeForce 930M

Going for a pretty general answer here, bear with me or skip to the end if you just want a yes or no.

So, while most if not all engines will offer some form of culling (not rendering/using what is not seen) you will still see detrimental drops in your framerate if your model has a significant polycount. By itself when testing you might be fine yes but games are meant to be dynamic and when you throw particles, physics and post processing in the mix it's a lot more for your system to process now.

For a quick example, fire up Blender and add the default cube, right click and select it, it is selected instantly! Now subdivide it say 10 times, add a subsurf modifier and set the view level to 6 and try again. It takes a while, this is a rather exaggerated example but it's more or less what your engine which is also a 3d software does as it has to iterate over the vertices in the mesh. Now imagine doing that on a moving character and having to do matrix math for every frame to calculate the new points for vertices to be at.

Even if your engine does support culling or some other magical algorithm to discard hidden geometry or automatic level of detailing (LOD) you would still most likely be hit with load times at some point whether when launching your game for the first time , loading assets or saving depending on how you go about it.

"Real" world example now, if your model has 100, 000 vertices, this is what is loaded into your engine of choice, if your armor is 20, 000 vertices and covers say 50% of your characters body. Your final polycount would be 70, 000 vertices instead of 120, 000 if you delete the hidden parts of the character model.

In any 3d modelers workflow there is usually an entire step dedicated to this called retopology where the simplest base mesh that can support the high details from a much more detailed and higher poly count model (usually sculpt). See https://cgcookie.com/course/introduction-to-retopology/

Even better, if you can generate normal and or displacement maps you can also see your polycount drop even more significantly. This is what pretty much every game studio does. If you're making a game you can't imagine that everyone will have a "good" machine to run it and most games ship with several different models depending on the resolution and or settings you are playing at.

For example here is a somewhat popular and funny screenshot of Skyrim being forced to run on the lowest possible setting. In game detailed grass and tree leaves are merely planes and that shiny detailed axe is a blob with some good textures.

Counter Strike Go

So in conclusion, people will try every trick in the book for lower geometry while still having a good look so if it isn't being seen and you can animate or get a similar effect, remove it.


Superellipse bevel with unevenly distributed edges? I want to create a simple box shape with rounded corners. This is, of course, easy enough to do with a simple bevel of the relevant edges:

However, this approach has a minor problem. With certain materials, the sudden curvature change from corner to flat face produces a faint but noticeable point of transition and an unsightly optical illusion similar to that produced by Mach bands:

These issues appear regardless of whether the Auto Smooth or Harden Normals options are used.
Strictly speaking, these are not shading artifacts: a physical object with the same shape would produce the same results. Product designers know this, which is why many Apple products, for example, are not actually rounded rectangles, but superellipses. Naturally, it seems wise to take a page from their book and model a superellipse myself.
Fortunately, Blender’s bevel operation makes it easy enough to create a superellipse by using options like the following:

This yields a superellipse shape that, as desired, completely eliminates the problem:

However, this solution has a different issue: lots of unnecessary geometry! In order to get corners with a similar smoothness to the original bevel, I had to crank up the bevel segments to 35, since all the segments are evenly sized:

This is less than ideal, as the whole point of creating a superellipse is to take advantage of the fact that the curvature smoothly varies over each side. What I actually want is for the edges to be unevenly distributed—denser at the corners and sparser towards the middle of the sides—so that the angle between each face is the same, not that the faces have equal widths. That would allow me to get the most bang for my polycount buck, so to speak.
However, I’m not sure how to do this. Thus, my question: is there any way to bevel faces into a superellipse shape while preserving the angle between the faces, not face width? I am fine with destructive modeling solutions (though of course nondestructive ones are always nicer), but I specifically want to be able to do this to an arbitrary existing edge the way I can with a bevel—so an “Add Superellipse” primitive isn’t good enough.

[I'm the bevel developer] There is not such a way right now. As I discussed on your devtalk.blender.org thread, I had assumed artists would want evenly spaced chords, and went to quite a bit of trouble to achieve that.


How to make python script check some value every frame I'm trying to accomplish with python script something like this:

Take World Z position value of an object (let's call it OB1), which is parented to a pendulum(so it's World Z position is fluctuating).
Make the script check OB1 World Z position every frame
If certain OB1 World Z position (let's call it BOT) is reached, rotate OB2 by 90 degrees on Z axis.
Make the OB2 keep new rotation until next BOT, which enables next rotation by 90 degrees on Z axis (so after 2 BOT, the rotation is 180 deg).

After a lot of googling, combining scraps of code and testing, I finally found the solution for this issue.I'm leaving it here cause it actually can be pretty useful in some situations.

See the docs about event handlers

import bpy
import math

sce = bpy.data.scenes[0]

# the function to call whenever the handler is envoked
def my_handler(sce):
    # contObj is controlling object, the one, which world Z position
    # I take to control rotation of "Target"
    contObj = bpy.data.objects["Controler"]

    # posOnZ is rounded world Z position of contObj
    posOnZ = round(contObj.matrix_world.to_translation().z,3)

    # targObj is the object, which rotation will be changed, when posOnZ reach
    # certain value.
    targObj = bpy.data.objects["Target"]

    if posOnZ == 1.168:
        targObj.rotation_euler[2]+=6*(math.pi/180)

        # check if everything works (can be omitted)
        print(targObj.rotation_euler[2]*(180/math.pi) )

        #without sce.update() you can't see the changes in 3d view
        sce.update()

def register():
    bpy.app.handlers.frame_change_pre.append(my_handler)

my_handler(sce)  # optional, to test if the function is working..

register()


Is there a way to overlay two similar UV islands with identical vertex count? Sometimes UV unwrap has several nearly identica islands. However, more often than not they differ a little. If I want to keep identical texture for these -- is there a good way to overlap them perfectly? I know I can do it vertex by vertex, but I hope there is a better way.

I know I can do it for the whole model if it is symmetrical with Symmetrize option from mesh menu. I am talking about selected islands, not all of them.

Automatically unwrapping  identical geometry pieces one by one should produce identical UV layouts.
I.e. if you have a row of identical parts of geometry, select one, do unwrap, select another, etc. Selecting all at once may produce alike, but different islands.

If geometry is not identical, I'm afraid you're stuck with manually scaling down to zero required vertexes.


Continuing division of cylinder to top faces I have a cylinder that I made and the scaled the top faces down to make it more barrel shaped, and I colored in part of it, and I would like the top faces to divide the same way the body does, so 32 segments and have it divide up until the center, I tried to figure this out but am struggling to find a way that isn't difficult, though I'm sure there is an easy way. Here's a picture with a very poor drawing to hopefully help clarify what I'm asking. Thanks!

I would like it to continue the divisions up like how I have (poorly) drawn, all around the cylinder, on both top and bottom faces

If there is a face, select it in Edit mode, then type Alt-P (Poke).  Another method which works with or without a face: select the face or edge loop, extrude it in place (E then Escape), then type Alt-M (Merge).  For your purposes you probably want to merge "at center" or "collapse" but there are other options that might be useful.


Is it possible to subdivide a surface without increasing the number of visible polygons? If I have a low poly animal and want to put some kind of a pattern on it, can I subdivide the mesh without making the subdivisions visible?
I've tried using different subdivision modifiers but it just turns into a high-poly mesh. I figured out I could use the knife tool but it would take way too long to manually subdivide every single polygon.

So the question is, is there something like an automatic knife tool that doesn't make the cuts visible? And if not, is it even possible to subdivide a low-poly mesh and still keep it low-poly or at least low-poly looking?

it is possilble with the usual subdivision surface modifier, you just have to change it from „catmull clark“ to „simple“ then it is not going to be smoother but the resolution of the model is going to rise in a way that it stays in his original shape.


Blender (Cycles Render) Normal Map Baking goes wrong Who I am and what I do:

Hello People!

I am fairly new to 3D modelling (still using 2.79) and at the moment I am working on
an M1 Abrams low poly tank (around 4600 Tris).

What I want to do is use a copied version of the low poly tank to add extra detail to it and then bake a normal map from the high to the low poly model.

I am used to the baking procedure in cycles render with small objects (like a cube for example). That means I am familiar with the setup (image, node etc.), ray distances and so on. Let's say the basic of basics of baking a normal map in Cycles Blender.

The Problem:
It starts right away. I moved the copied tank (haven't added any detail to it yet) to the same position the low-poly has and I get this as a normal map:

What do I expect:

I thought that the rays will find no difference (surface) at all because it is the same model, right? So the image should be blank. Instead I get a lot of stuff and artifacts on it.

What I've already tried:

Playing around with Ray Distances (From 0 to 1 and between).
Added smooth shading to high and/ or low poly model
Removed Doubles, Rotation & Scaling

If somebody can help me?

Thanks!

Have a nice day.

Your normals are inverted. Some of them are broken appart (they are not united) try going into edit mode and move them, you´ll see how they get appart and break from the original mesh. You got all traces needed since the normal map already tells you where this is happening. ALT+M will join vertex together (choose AT CENTER).

Another solution is to check out the normals. Definelty looks like the ones you have problems with are INVERTED NORMAL faces. Delete them from your model, recreate them in EDIT MODE and then select your object CTRL+N to average normals while in edit mode. Hope that fixes. It will certainly.
Cheers.


Python scripting: How to hide from viewport all child objects linked through parent Update:

Let me ask a slightly different way, since I may be over-complicating things.

If working from the UI there's an option to do this:

You can Shift-Click to hide parent and children objects. How do you accomplish this programmatically? The only way I've found so far just hides the main object:

row.prop(wall, "hide_viewport")

Original Question

I'm working on an addon that's essentially a kitchen designer, so the base objects that need tracking are walls. Each wall has objects snap to it and become the parent object for everything underneath.

The walls need the ability to be hidden, along with all of the associated child objects. This requires a function for a little processing. If all of the walls could be defined ahead of time, I know how to accomplish this (create the class functions and register them, etc).

However walls are added as needed, with a simple loop that tracks and displays them:

    row.label(text="Walls")

    if object.expanded_walls:
        row = box.row()
        for wall in objs:
            row = box.row()
            row.prop(wall, "name")
        --> row.##boolean_flag(script_that_hides, arg_with_wall_id)

This list is updated dynamically in the display, so displaying any wall property is easy.

But, I can't figure out how to put a simple boolean flag with each line item capable of calling a function data from objects in the same row. Any way to do that?

Boolean with update

A hide_children boolean property is added to all objects.
If the property is updated all children are hidden, plus their hide_children is set, propagating the hide down the hierarchy.

2.8x Test script, with property drawn on text editor footer.

import bpy
from bpy.props import BoolProperty

def hide_children(self, context):
    self.hide_set(self.hide_children)
    for o in self.children:
        o.hide_children = self.hide_children

bpy.types.Object.hide_children = BoolProperty(update=hide_children)

def draw(self, context):
    layout = self.layout
    ob = context.object
    layout.prop(ob, "hide_children")

bpy.types.TEXT_HT_footer.append(draw)

Similarly to only toggle children

def hide_children(self, context):
    for o in self.children:
        o.hide_set(self.hide_children)
        o.hide_children = self.hide_children

These are object properties, to layout for all objects in scene

for o in scene.objects:
    layout.prop(o, "hide_children")

Note: For 2.8x would be very tempted to do this with collections, and their hierarchy instead of objects.


Wrangler plugin not working (Known bug with the 2.83 build) I'm getting this error now everytime i try to load the textures with the shortcut control shift t...
Ctrl + Shift + T is not working on 2.8.3 ?

Most likely issue is that you don't have node wrangler enabled.

How to enable it is by going to

Preferences

Then to addons

Then search for node wrangler and press the check box beside it.


Setting sun direction on sky texture with an empty I am trying to control the direction of the sun on sky texture with an empty, I set the direction of the sun controllable by the rotation of the empty with drivers, each axis corresponding to the XYZ direction of the sun, but the result is not behaving as expected.

Sun direction in the sky texture node uses values of normalized vector that can be taken directly from World Matrix.

X value - matrix_world[2][0]
Y value - matrix_world[2][1]
Z value - matrix_world[2][2]


After compositing , the 3d model gets faint and translucent in the final render i was following the CGGeeks VFX trick shots , i had downloaded the assets and was making the trick shot , but the problem appeared in the last step , COMPOSITING , after compositing , the fake ball get faint and translucent (is this property called alpha?) , how to fix this

as you can see the ball is very faint in the sky

looks like i was not key-framing the factor node in the compositing properly , the factor was increasing from 0 to 1 in 70 frames but it was supposed to remain 1 during those frames


Character drops through Floor in Game Engine My character always falls through the ground in my game. I put character physics on it, so it falls, but it always goes through the floor.

I tried to make it land on a skateboard when the game starts, but the skateboard just slips away and they both fall. There is character physics on the skateboard, too. So why does this happen?

Also, sometimes it won't even fall to the floor and will just shake  and hover above the ground as well as the skateboard. Why will they either fall through or not even touch?

I think that happens when you scale/rotate an object, but don't apply it's scale.

To do this, press Ctrl + A> Apply scale.


How to make a report bug button in add-on? When I install a add-on in blender, I want a button to a link for reporting bugs? How can I do it? just like this

The Report a Bug button will be added automatically if you add the tracker_url key to the bl_info dict of your add-on. See the following example:
bl_info = {
    "name": "3D Simple X",
    "author": "8N Films",
    "version": (1, 0),
    "blender": (2, 92, 0),
    "location": "View3D > Toolbar > 3D Simple X",
    "description": "Very Simple and easy! Add everything you want!",
    "wiki_url": "",
    "tracker_url": "https://github.com/user/add-on/issues",
    "category": "8N Films",
}

More about 'Script Meta Informations' and a complete list of available keys, you can find in the official wiki: https://wiki.blender.org/wiki/Process/Addons/Guidelines/metainfo


Can I duplicate a mesh along curves if the curves have been moved? I set out curves to match the layout of this map. Whenever I apply array and curve modifiers to the mesh I am trying to duplicate along the curve: the mesh gets blown up in it's dimensions. Other than that, there is nothing wrong with it, just the fact the dimensions get way too big. I am using bezier curves, i have applied rotations, scale and location to all the curves and the mesh I am trying to duplicate along the curves.

I've noticed that when I apply scale to a curve that is used as a curve modifier by an object, this object always get bigger/smaller, so I guess the solution is either not to apply scale to the curve you use (or to only work its shape in edit mode which is even preferable as you will always stay at its original scale), or to scale it again and apply scale until the object is at its correct size, but this is not the good solution.


How do I apply a texture to an object in Cycles with nodes? I know nothing about nodes, so I tried to use them. I UV-ed my monkey head, and then I colored on it. I brought the image back into Blender, added a new material, then went to the node editor and opened the image. The image shows the two original nodes that were there. How do I set it up and get the image on to the monkey?

You are in the Compositing node view right now which is for post-processing.  You need to switch to Material nodes to edit your object's material.  To switch to material nodes click on the material icon at the bottom of the node editor.

Now you can add your texture with an Image Texture node and plug it into whatever shader[s] you are using.


Working sample of steering actuator with path following behavior I have this blend file to test the steering actuator, the object named "Cube" is the one that has the steering actuator.

test2.blend

I can't find a working sample on the the web, and can't setup a simple path following actuator in the file above.

Seek behavior moves the object on a straight line towards the target object, no matter what obstacles or holes in the navigation mesh are there, path following and flee won't move the object at all.

Path following and flee (distance is set to 1.0) works for me (Blender 2.68 64bit and 32 bit, Windows7 64bit). The cube follows the fish along the red path. And the cube doesn't leave the navigation mesh.


Blender NodeSocket Error I have this code:

import bpy
import random

max_number = 5
nodes = []
with_fade_out = 2

try:
    tree = bpy.context.scene.node_tree
except:
    bpy.context.scene.use_nodes = True

group = bpy.data.node_groups.new(type="CompositorNodeTree", name="MultipleSwitch")
group.inputs.new("NodeSocketRGBA", "Default Image")

for i in range(0,max_number):
    group.inputs.new("NodeSocketRGBA", ("Variation - " + str(i+1)))

input_node = group.nodes.new("NodeGroupInput")
input_node.location = (-150, 0)

group.outputs.new("NodeSocketRGBA", "Out")
output_node = group.nodes.new("NodeGroupOutput")
output_node.location = (max_number*100 + 100, 0)

group_node = tree.nodes.new("CompositorNodeGroup")

group_node.node_tree = group

But When I Run this script, It doesn't show upo any input or output, but if I put NodeSocketFloat instead of NodeSocketRGBA, it show up all the input.

For example, using the bpy docs, see the base classes (names of the valid socket ID names).

import bpy
import random

max_number = 5
nodes = []
with_fade_out = 2

try:
    tree = bpy.context.scene.node_tree
except:
    bpy.context.scene.use_nodes = True

group = bpy.data.node_groups.new(type="CompositorNodeTree", name="MultipleSwitch")
group.inputs.new("NodeSocketRGBA", "Default Image")

for i in range(0,max_number):
    group.inputs.new("NodeSocketRGBA", ("Variation - " + str(i+1)))

input_node = group.nodes.new("NodeGroupInput")
input_node.location = (-150, 0)

socket_list = [
    'NodeSocketBool', 'NodeSocketColor', 'NodeSocketFloat',
    'NodeSocketFloatAngle', 'NodeSocketFloatFactor', 'NodeSocketFloatPercentage',
    'NodeSocketFloatTime', 'NodeSocketFloatUnsigned', 'NodeSocketInt',
    'NodeSocketIntFactor', 'NodeSocketIntPercentage', 'NodeSocketIntUnsigned',
    'NodeSocketShader', 'NodeSocketString', 'NodeSocketVector',
    'NodeSocketVectorAcceleration', 'NodeSocketVectorDirection',
    'NodeSocketVectorEuler', 'NodeSocketVectorTranslation', 'NodeSocketVectorVelocity',
    'NodeSocketVectorXYZ', 'NodeSocketVirtual']

for s in socket_list:
    group.outputs.new(s, "Out " + s)

output_node = group.nodes.new("NodeGroupOutput")
output_node.location = (max_number*100 + 100, 0)
group_node = tree.nodes.new("CompositorNodeGroup")
group_node.node_tree = group

you can see here that of all those NodeSocket types, the main ones are:

NodeSocketBool
NodeSocketColor
NodeSocketFloat
NodeSocketInt
NodeSocketShader
NodeSocketString
NodeSocketVector


Cannot add scene strip in VSE I want to add a scene strip in the Video Sequence Editor but the list of scenes is empty despite a scene existing and having a camera. See the image below. Can it be some bad combination of settings or is it a bug?

The devs removed the ability to add the current scene as a strip. Try from another scene.


Background image doesn't show up in rendered view I have added a background image using a tutorial on YouTube. it shows up just fine in my camera view but does not show up when I render the animation or render my viewport. The entire viewport shows up as white

A Background Image is an Empty which displays in the viewport.  Because an empty has no volume and surface, it cannot be rendered.

If you need to render an image in the scene use the Images as Planes addon.


wireframe render over an object with the subdivision surface wireframe? Is there a way to render an object with a subdivision surface modifier with a wireframe which is the original geometry as well as the wires that make the subdivision surface?

Example:

This wireframe here is curved. What if there was displayed the straight wireframe. The wires that make are made by the subdivision surface. Thats what I want to achieve. How to do it?

What I mean is - How to render the curved wireframe (which is the original geometry with the straight wireframe (which is the wireframe the is made by the subdivision surface)?

Rendering curved wireframes:
Blender Internal
You can either use freestyle or a wireframe material, see Rendering with wireframe.
If you use a wireframe material, make sure Optimal display is enabled on the modifier, otherwise all the edges generated by the subserf will be rendered as wires (they won't be curved).

Cycles
To do this in cycles, you could use two scenes, one for the cycles render and another to render the wireframe with one of the BI techniques.
To get a BI wireframe material to render with a transparent background (for combining with a cycles render), just set the second material to Masking alpha:

And set Alpha to Transparent in Render settings > Shading:

Original answer
OP clarified the question, making this no longer relevant. As far as I can tell, that is..
If you want to do this in the viewport/opengl render, just enable Draw All edges in Properties > Object > Display:

And make sure Optimal display is disabled in the subserf modifier:


Rigify doesn't seem to allow me to shift the pole target I've used rigify on a basic human armature, to try and set up IK, and for the most part everything works- except for the elbows. The knees work just fine, but I'm unsure which bone rigify is considering as the pole target.
I assumed it was the bone behind the elbow- to which the only thing I've done, is move from the front of the model, to the back- and rotate by 180degrees. Nothing else. Is this not the bone? Is there some additional procedure I should be following instead? Thanks.

By defualt the widget that looks like two arrows is used to rotate the elbow/knee. You can also select that widget then click Toggle Pole as indicated in the image. That will enable you to use the standard pole target.


How do you access and set a specific bone animation fcurve in python ? e.g. set pinky02_L z rotation = 8 degrees I want to access the keyframes for a specific bone in animation_data.action, just so I can reset them to a default value.
My main problem is I dont know how to just access a specific bone.

The general purpose of this is to automatically reset the hand positions of bvh animation loaded onto a manuelbastionilab model. The bvh animation loads it in fine, but because there isnt really any hand data, it sets the animation to a default splayed out position. And because it assigns it to the wrong bones, it comes in with a crooked little finger. So I just want a simple python script to reset any animations I load in to a good default.

I think I should be able to get to the animation data for the keyframes with

myaction = bpy.context.active_object.animation_data.action

But I dont know what comes next, I dont know how to access the fcurves for a specific bone like a joint / bone in my little finger called pinky02_L

This seems incredibly basic but Ive spent ages googling it and failed miserably.

I suspect I might have problems with setting the data too !
I am using quaternions and so I want to access say the z rotation quaternion.
So how do I access the z rot channel, I think its some array offset for the fcurve or something ?
So once I have found the fcurve for pinky02l (pinky02lfcurve = ?), is it something like curve =  pinky02lfcurve[6] to access the z rotation channel ? Or have I got it all horribly wrong ?

keyframePoints = curve.keyframe_points
    for keyframe in keyframePoints:

And Once I have a keyframe how do I set it to a value like :

keyframe.value = math.radians(8.0)

. Is it that simple ? I bet its not!

Any answers to any parts of this would be great !
p.s. thank you to batFinger and Scott Milner for answering my question about it setting it to the wrong degrees the other day.

So from the post lemon refers too I if I am understanding it correctly if I use:

for curve in pinky02lfcurve
       if curve.data_path.endswith('rotation_quaternion')
        if curve.array_index == 2 # or is it 3 for z with quaternions ?
            keyframePoints = curve.keyframe_points
            for keyframe in keyframePoints:
                keyframe.co[1] = math.radians(8.0)

Ok so re writing to take into account batFingers post I think the following should do what I want !

myaction = bpy.context.active_object.animation_data.action
fcurves = myaction.fcurves
rot = Euler(0,0,8)
myquat = rot.to_quaternion()

pinkyb = bpy.data.objects['MyArmature'].pose.bones['pinky02_L']
dpath = pinkyb.path_from_id("rotation_quaternion")
fc = fcurves.find(dpath, index=0)
keyframePoints = fc.keyframe_points
for keyframe in keyframePoints:
    keyframe.co[1] = myquat.w

fc = fcurves.find(dpath, index=1)
keyframePoints = fc.keyframe_points
for keyframe in keyframePoints:
    keyframe.co[1] = myquat.x

fc = fcurves.find(dpath, index=2)
keyframePoints = fc.keyframe_points
for keyframe in keyframePoints:
    keyframe.co[1] = myquat.y

fc = fcurves.find(dpath, index=3)
keyframePoints = fc.keyframe_points
for keyframe in keyframePoints:
    keyframe.co[1] = myquat.z

So I hope this should be good apart from the curve control points which are still at their original positions I think. Though I also still need to work out what angle I actually want to set it too ! Thanks again batFinger and lemon.

Some py console code.

Below are some ways to find an fcurve for specific pose bone, and pose bone property.  In this example the context pose bone, and rotation_quaternion.

>>> ob = C.object
>>>
>>> action = ob.animation_data.action
>>> pb =  context.active_pose_bone
>>> pb.name
'Bone'

>>> # could query the pose bone  from collection via its name
>>> ob.pose.bones.get(pb.name)
bpy.data.objects['Armature'].pose.bones["Bone"]

>>> print(pb.path_from_id.__doc__)
.. method:: path_from_id(property="")

   Returns the data path from the ID to this object (string).

   :arg property: Optional property name which can be used if the path is
      to a property of this object.
   :type property: string
   :return: The path from :class:`bpy.types.bpy_struct.id_data`
      to this struct and property (when given).
   :rtype: str

# get the path from pb.id_data
>>> dp = pb.path_from_id("rotation_quaternion")
>>> dp
'pose.bones["Bone"].rotation_quaternion'

>>> # could also build this from name
>>> 'pose.bones["%s"].rotation_quaternion' % pb.name
'pose.bones["Bone"].rotation_quaternion'

>>> # use find for one offs
>>> print(action.fcurves.find.__doc__)
ActionFCurves.find(data_path, index=0)
Find an F-Curve. Note that this function performs a linear scan of all F-Curves in the action.
# find rotquot[3] aka rotquot.z
>>> fc = action.fcurves.find(dp, index=3)
>>> fc
bpy.data.actions['ArmatureAction']...FCurve

>>> fc.array_index
3
# use list comp to find them all for for each index
>>> ["%s[%d]" % (dp, fc.array_index) for fc in action.fcurves if fc.data_path == dp]
['pose.bones["Bone"].rotation_quaternion[0]', 'pose.bones["Bone"].rotation_quaternion[1]', 'pose.bones["Bone"].rotation_quaternion[2]', 'pose.bones["Bone"].rotation_quaternion[3]']

>>> # get the value from ob using dp
>>> ob.path_resolve("%s[%d]" % (dp, fc.array_index))
-0.43060973286628723
# ie ob.pose.bones["Bone"].rotation_quaternion[3] = -0.43
>>> pb.id_data.path_resolve("%s[%d]" % (dp, fc.array_index))
-0.43060973286628723

Links

Get bones associated with specific action in python

How can I tell if a bone property has a keyframe on the current frame using python?

How can I access bone's 'animation_data.action'?

On rotations, here is the quaternion for an xyz Euler rotation of degrees (8, 8, 8)

>>> rot = Euler((radians(8) for axis in "xyz"))
>>> rot.to_quaternion()
Quaternion((0.9930493831634521, 0.06456293165683746, 0.07427114993333817, 0.06456293165683746)) # wxyz

To set the defaults to above would set each keyframe.y of keyframes in fcurve  fc with array_index=3 to 0.06.. etc.


Strange blackening after joining meshes I've recently started working with Blender and i CONSTANTLY get this issue when i make 2 meshes and join them together to form 1 mesh.

This is what it looks like before i join the 2 meshes:

An this is what i get when i join them. (The magazine is not yet joined with the other meshes)
Any help on this issue will be really appreciated.
Thanks for the attention!

Select the entire mesh in edit mode, then press Ctrl + N to recalculate the normals.