How to place image in a surface hi guys, I'm a newbie in blender and I just want to ask how to map and image/graffiti in surfaces that already has texture in it where there is X MARK (see image attached)I have my node setup also attached. I tried the uv maps(below the vertex group) but I dont know how it works,I also tried overlaying using mixRGB node but it maps to every surface that has concrete.I cant control it

A mix RGB node will work fine:

Use the alpha from the image on top for the fac input. You may need to try reversing which image is on top for best results.


Is there a way to output gif animation from blender? Is there a way to output an animation or video file in gif format from blender?

If not, what about VSE? Or can I record a screen inside blender?

Thanks a lot.

No, there isn't a way to export (or import) gif directly.
GIF is not a supported format in blender.
You would need to export your images or animation in a different format, and then convert it to GIF using an external application.
For a list of the supported formats read this.
To record a screen capture using external software refer to this post in Meta:
What is the process for creating gifs for questions and answers?


What is the role of Auto-smooth? I have noticed this: the "Auto-smooth"

I can't figure out what is its' meaning.
I understand that i can use it combing with the smooth shading.
For example:

A) FLAT

B) SMOOTH

C) SMOOTH & AUTOSMOOTH 30°

D) SMOOTH & EDGE SPLIT 30°

It seems that Auto-smooth works like the Edge Split Modifier, with the huge difference that doesn't add vertex and edge loop. My mesh from B) to C) has the same amount of vertex while mesh from B) to D) doubles the number. My question is:

Why there is this Autosmooth?

Could be useful for create hard edges in my low poly (it doesn't increase the number of my vertex) and let me have nice and clean surface for a possible bake with my high poly?

Thank you to anyone will help me!

With Blender 2.80 the use of the Edge Split modifier is deprecated in favor of new custom normals.

Custom Normals allow precise tweaking of normals beyond what auto-smooth can do

There's a lot more information in the Normals section of the recent documentation site. Although I'm not a big copy-n-paster, this is what it has to say about Auto-Smooth:

  The Auto Smooth option is a quick and easy way to combine smooth and faceted faces in the same object.

In addition, when you use custom normals:

  This has the side effect of enabling Auto Smooth, as that is necessary to use custom normals. Once you have custom normals, the angle threshold of the Auto Smooth behavior is disabled – all non-sharp-tagged edges will be considered as smooth, disregarding the angle between their faces.

Which brings us to the link to the documentation for Auto-Smooth:
https://docs.blender.org/manual/en/2.80/modeling/meshes/structure.html#auto-smooth


Rigid body fixed constraints looks like springs I building simple car animation. I started with one axis with wheels. I have problem with fixed constraint, it behave like some spring, i connect cylinders and cube like on picture. I attached also video what happens :-/ Do you know why something like this occur ?
Picture:

Video:
https://www.youtube.com/watch?v=qTU5fxMvxbk

Try increasing the number of constraint iterations and simulation steps in Properties > Scene > Rigid body world:

10 iterations and 60 steps:

100 iterations and 120 steps:


Why is my render so fuzzy? I was trying to render my scene, and the render turned out very blurred. (It is not supposed to be blurred). Is there a setting that I am missing somewhere which is making it look like this?

You have the focus of the camera set a value that is not the distance from the camera to your object,  and are using a very wide lens aperture. Your scene is "out of focus".

Change the value for distance to the actual distance form the camera to your object, and maybe try a higher number for the f-stop.

To find where your camera is focusing you can enable display->Limits. If you move the focus you'll see a cross mark that indicates where the focus point is:

in 2.8 enable Limits in the Viewport Dislpay section of the camera, enable Depth of Field and set the distance to your object.

A trick you can do is use an empty. Move the empty to the place you want the camera to focus on and select the empty (or any other object as the focus target).

For more info read the blender manual's page for Depth of Field


Rounded wireframe with big cells I'm pretty new to Blender and I'm trying to create a perfectly round NURBS sphere. I need a wireframe of this sphere with big cells (like on the image below) but I also need curved (sic!) not straight edges of cells. Is there a way to do so?

First, add a UV Sphere to your scene. Now go into edit mode, make sure you are in Face select mode (press Ctrl + Tab and select Face) and press Ctrl+B. Make the resulting edges as large as desired. Now press Ctrl+I to invert the selection and then press Delete > Faces.

Now go into edit mode and select all by pressing A, and then W > Subdivide Smooth and change the subdivisions up or down as desired.

Now add a Solidify Modifier to your object to add some depth. You may also want to add a Bevel modifier while you are at it.

You should now have a nice smooth wireframe:


Transform Rotation into location problem I have a gear and it needs to rotate two full turns (720 degrees) to open a door which should move up for a length of three blender units. The transform works for about 180 degrees then the door falls back to the start point.
There is no difference if I'm addressing the transform Rotation Constraint to the gear or if I'm using 'the door Open Empty' and rotating that object.

Anyone know a solution?

Add driver to the location property with right-clicking:

Setup the driver like this:

Now the Empty's Z rotation controls the object location.


Bevel preventing me from seamlessly joining two modular pieces of geometry I have two pieces of geometry that I want to join for a modular building this is my geometry without any bevel (the shaded black geometry)

And this is with the bevel

I know what the culprit is but have no idea how to fix it without making incompatible modular parts
It's due to where the geometry is connecting
Though I have added a real bevel with a 90 degree lip to stop beveling rather than shading and I have the same issue, but only on the overlapping part shown here for reference

and here with the real bevel

In this case it can also join to itself like so

Any ideas on what I can do to prevent this?
Thanks,
Jamie

I created small segments that fit between them, though I really don't like this solution! So if anyone has a better one please let me know!


Can't get simple uneven reflection map working I cant manage to get the reflection work as shown in the reference pictures, I've tried to use everything i could find, bump, normal, clearcoat...
clearcoat won't work bc the surface is very even right? i mean the reflection cant vary because there's no difference in bump?
i tried a displacement map with a noise jpg or generated inside blender, the displacement was too huge and not small enough, couldn't find a way to make it slightly rough or more dense...
Most tutorials show nodes that either dont exist anymore or dotn have the options they used to have, tried alternatives but the reflection is either completely distorted if i set the noise scale in the node based diplacement too high or i simply dont get the result i need...
this is how waf I've come, i made a quite similar version of the real one and projected it onto a densely subdivided circle.
i would love to use the cracked paper texture as a displacement map but the normal map I generated in photoshop has extremely harsh edges in blender even after u blurred it in photoshop...
nothing seems to work, i worked the entire day on this... this is where i ama t atm..
These are my references, see the way it reflects? and also the slight unevenness of the whole thing? it seems to be coated for preservation...

Any Help is appreciated!
Sincerely Oz
EDIT Thanks Gorodon! heres the current state, i guess the rest is fine tuning, prolly adding another layer of reflection.

VIDEO

Here's my example to show you what you can do. I guess you're right, it's coated for preservation. I've tried my own take on it.
I gave the Principled BSDF a slight (estimated) Roughness of 0.2 for the original underlying paint. Since the rim seems to be more of a golden color, I plugged a black and white ring texture into the Metallic socket, so that everything is black (or 0) except for the rim which is white (or 1) and therefor metallic.
To recreate the protective coating (which looks quite shiny), I set Clearcoat to 1 and Clearcoat Roughness to a very low 0.01 (you might even go down to 0).
Since the scratches in the surface come from the broken paint, I thought it would be best to have them in the original surface Normal as well as in the Clearcoat Normal. I've taken some sort of scratch texture, plugged it into the Height socket of a Bump node and this into both normal inputs.
For the lighting I took four planes with a strong Emission shader to act as lamps and positioned them so that they can be seen in the reflection on the shield. The slight blue reflection comes from an Environment Texture which I used for the world.
My result:

My node setup:

The metallic map:


Baking Shadows onto textures in Cycles Renderer I'm trying to bake a lightmap in Cycles Renderer to a texture.

The problem is it only bakes Ambient Occlusion properly, but no shadows.
You can see in the screenshot to the left that in the Rendered Preview there are some hard shadows, but when I bake that object to an image the shadows are gone.

What am I doing wrong?

Thank you!

FIXED!

I had a glass object that I hidden in the scene. I had to move it away from between the lamp and the target mesh.


Is it possible to update a StringProperty as it's being typed? I'm building some text editor tools. I would like to have live access to a string property as it's being typed. I can assign an update function within a string property but it only updates after the user has pressed enter. I want a way for the update function to run with every key press. Legit ways to do this? Hacks?

There is an option for this.
Create the StringProperty with options={'TEXTEDIT_UPDATE'}:

prop = StringProperty(name="Test", options={'TEXTEDIT_UPDATE'})

https://docs.blender.org/api/2.79/bpy.props.html#bpy.props.StringProperty


Assign mesh to mesh vertex-group / bone I have a bus model consisting of a body mesh an some sub meshes. I have assigned the sub meshes to my "body" - bone so that it moves with my body-bone in pose mode:

But I want the body mesh to be assigned to the body bone, too. I have tried to select it in edit mode, and then "assign" to body group, but that doesn't change anything:

What am I doing wrong?

The bus will be moved by the "body" bone if all vertices are assigned to the "Body" vertex group and the bus object has an armature modifier pointing to the armature of the "body" bone.

In fact, in your file if you select a moving object (i.e. a wheel), you'll notice that the automatic procedure has inserted an armature modifier:

While if you select the bus no armature modifier is found, so the bus doesn't move even if its vertices are assigned and weighted to the "body" bone:

The simplest method to have your rig work is: go to pose mode and select the body bone; then select the bus; shift select the body bone again; Ctrl P "bone option", which skips the vertex groups and solidly parent the whole mesh to the body bone:

But a new problem arises: the bus doesn't move along with its wheels and accessories: this is because (i.e. a wheel) has a double parent so it gets double movement request: the wheel mesh is parented to the bus mesh, so - when the bus moves the wheel mesh moves; but the wheels vertices are moving too, due to the armature and bones assignements!

So you'll have to remove all parenting between wheels and bus, leaving to the armature the work to make the spare parts move together:

Last consideration: the usual" workflow would be: join all pieces in one single mesh, Shift select the armature, Ctrl P "with empty groups", select all vertices except wheels and assign them to the body bone, select all vertices of a  wheel and assign them to the wheel bone.


Accidentally removed cloth preset, how can I restore it? I accidentally clicked the 'remove preset' button and now I am missing "rubber".  Is there a way to restore the preset?  Thank you!

I actually tried removing the rubber preset in 2.75 just to see what will be the best way to restore it, but it wouldn't really let me remove it at all. It's still there even after I pressed the remove button.

But anyway, in any other version, try to load factory settings and see if that helps. If not, take this as a great opportunity to update to the latest version of Blender!


Is there any down side to creating objects from reusable parts? Is there any downside to creating, for example, a structure, say a building from many objects and various textures? Like, create the roof, the walls, a pillar and combine those and export the model into my game engine? Or, for example, a pickaxe, created from different parts, so I can reuse those parts in other models.

I don't think this will be a problem anywhere. As long as you make sure the objects are properly parented to one another, or even better (at least inside Blender), to an empty, you should be fine. Your game engine will, of course, need to be able to deal with object parenting properly, but if it doesn't... you probably don't want to use it.

@metaphor_set raises a good point in his answer. You can check this Unity question where they discuss this; however, I still believe that reusing objects will lead to a better workflow. That said, you should really think (aka, benchmark) whether this could become a problem, and, if so, you could, before exporting or, possibly, before applying materials merge the various objects into one, to counter this problem.


How to align wave texture perfectly? Is it possible to align procedural wave texture in Cycles perfectly - say - vertically? Because when assigned to an object (in node editor), it's rotated ~45° or so...
I tried playing with mapping, but it's never perfect...

Sphere; loc, rot, scale applied; not unwrapped:

Node setup:

Ok, I'm years late to the party, but the reason the texture is rotated is because it's applying the mapping using the X, Y, and Z coordinates equally.  If you want to constrain it to a single axis, you can just use a "SeparateXYZ" node followed by a "CombineXYZ" node and only use the axes you want.  For example, as gandalf3 pointed out, if you want the texture aligned along the Z-axis, simply connect the Z output of the SeparateXYZ node to the Z input of the CombineXYZ node.

Likewise, if you want it to follow the X-axis, connect only the X output to the X input.  If you choose both Y and Z, your texture will be at a 45-degree angle because it's affected half by the Y coordinate, and half by the Z.  You can also think of it bisecting the axes you use.

That's why when you use X, Y, and Z all at once, it points at exactly the center between the X, Y, and Z axes.  You might think that's 45 degrees from each axis, but it's not.  Since the rotations are applied on top of each other, you get the "weird" values of 35, 45, and 90 degrees (look up Euler angles if you want more info). It's not a mystery once you understand the math (or at least how the math works).


How to align multiple wave textures? When creating wood textures in Blender, I often use the Cycles 'Wave' procedural texture (the equivalent of the Blender-Internal 'Wood' texture). I can use it to create what appears to be very realistic wood grain.

However, I run into a problem whenever I'm modeling wood blocks with sharply cut edges. Real wood would have a different cross-sectional type of grain on each side, depending on how it was cut (for example, in the image below, one side would have a 'ring' structured texture, and the other two would each have a different 'band' texture). Moreover, if you look at any one of the individual dark bands, you'll see that they 'align' with each other across the three faces.

Is it possible to make three different procedural textures that align with each other in this way? If that isn't possible, is there any way to produce a similar effect using other techniques?

A very flexible way to make the texture is to make it from scratch with the nodes, not relying on the built-in, a bit limited wave texture. Using some math nodes and adjusting the value results in a pretty nice wood texture.

Here the two vector inputs define a line that passes through both (the core of the three), and the distance from that to the object surface is calculated inside the distance node.

The surface positions are distorted a bit by adding a bit of noise to them, the distance calculation is done per the equation here.

Using modulo makes the distance from the surface to the line a looping range of values from 0 to the distance between the waves in the wood. Multiplying that by the inverse of the distance brings the range to 0 - 1, which can then be mapped into a nice gradient using a map range node. That can be used to multiply or mix the color value to achieve the final result.

See also:

http://www.minimaexpresion.es/?p=690&lang=en
http://materialw.wordpress.com/materials/wood-material/
http://blenderartists.org/forum/showthread.php?246113-A-fine-procedural-wood-material-for-Cycles
http://shiny-dynamics.blogspot.fr/2012/04/wood-texture-for-blender.html
http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Procedural_Textures
http://wiki.blender.org/index.php/Doc:2.6/Manual/Textures/Types/Procedural/Wood
http://www.blendswap.com/blends/view/52626 (mirror of previous link)


barely any options being shown within blender ive just started using blender, so be patient with me if this is a simple fix.
i recently got blender for 3d modelling, and in all tutorials ive seen, almost none of the options shown appear in my version of blender, my current issue is with the sidebar menu that is toggleable with the keybind "n" showing about a tenth of the amount of options that should be there.
is my blender in some sort of simplified mode?
another issue is that right click is supposed to allow you to add meshes, but this functionality is also removed
example of issue:
how my sidebar appears

how ive seen it appear

all help is appreciated

The user interface of Blender was updated in the 2.80 version. Many tutorials are using an older version of Blender which looks a bit different. However the features are still there in Blender 2.8x*, just in slightly different places or on a different shortcut. I'd recommend to watch the Blender Fundamentals 2.8 for an introduction to the new user interface and Blender in general.

* There are some exceptions, e.g. the Blender Internal render engine has been replaced with Eevee and the Blender Game Engine has been removed.

The options you're looking for in the sidebar are located in the View tab. There you'll find the properties for the Clip Start, End and 3D Cursor.

Meshes can be created either through the Add menu or by using Shift+A


Customized time stamp / clock Is it possible to create a customized time stamp on the video? By customized I mean an arbitrary hour:minute:second that would count up time (24 fps)? The Metadata stamp is useless for this purpose, since it will stamp current system time at the end of each frame render, which depends on render time anyway.

Metadata should give the following:

Time gives timecode as HH:MM:SS.FF (This will depend on the framerate you set in the render settings.)
Date gives the system date and time.
RenderTime gives the time taken to render the frame.
Frame gives the frame number.

You could affect the timecode by sliding your scene to the desired timepoint in the VSE and render from there.


How to make 3D model fully distributable this is not a fully related Blender question but I figured this might be the right place to ask.

I would like to create a standalone distributable 3D model. That is, a file that I can send and that the recipient can open and visualize without the need of installing anything.

Is there any way to do this? Currently I export the model into VRLM and then I can use Cortona 3D to open it with a browse. That still needs a plugin to be installed and I would like to avoid that by compiling everything into a single executable file.

Thank!

Lore

This could depend on how you expect people to see and interact with your model, and how simple the process you wish to be but come to mind:

making it a distributable "blender game" (an interactive environment), but requires skills, experience and does not support all cycles features, eg. Your recipient could download it and "play it" locally.
see:
http://www.blender.org/manual/game_engine/licensing.html#standalone-games
http://wiki.blender.org/index.php/Doc:2.6/FAQ/Game_Engine/Standalone_game
using services like https://www.blend4web.com/en/ which require no plugins (is even gpl so you can even host your own)... Your recipient could just visit a page and interact in the browser with the model. (examples: https://www.blend4web.com/en/demo/)
another similar service (but not gpl, afaik) is https://sketchfab.com/


How can i add an glass objet to an motion tracked scene with proper light coming through it? i have a scene with a cg glass cup and there is no light coming through it, how can i fix that, i thought about HDRI but i dont know if that would help, im quite new to 3d modelling and everything in this area.

You can either create an HDRI with a smartphone or a 3d camera for best results. That would give you a good base to work with when it comes to lighting.

Tutorial on how to make an HDRI

Another option would be to have a look at the scene you are tracking (if it is a video you took) and try to replicate the lighting according to it. That could involve setting up a 'sun' light object, or multiple area lights.

Tutorial that helps with recreating studio lighting for artistic renders, for example

Tutorial for helping you set up an HDRI if needed, starting from 14:29


Duplicate objects to multiple locations Is there a way to copy/duplicate/link objects to multiple locations at once? For instance I have several boxes around the scene and I want to copy/link/duplicate a sphere to the location of each box... Is this even possible?

I love Python scripting, however this can easily be done without Python. Here is one quick way:

Select all the objects you want to use for position.
Duplicate them.
Add your the object you wish to duplicate in their position to the selection. It should be active now.
Link their data ctrl+l -> Object Data

That is it. The object will inherit the position, orientation and scale. You could apply those in order to avoid that this if not needed (ctrl+a) before linking data.


Retopology and baking normals for double-sided (thick) clothes from Marvellous Designer workflow I apologize for wording stuff badly in advance.

I can't work out an efficient workflow for creating clothes with thickness using Marvellous Designer and Blender that incorporates retopology and texture baking.

Currently, I have a project in Marvellous Designer with a character in a shirt and a coat. Coat is supposed to have thickness (so the insides could be seen).

My plan was:
1. Modelling and simulating clothes in Marvellous Designer, export without thickness (done)
2. Sculpting details in zBrush/Blender/3DCoat/Sculptris/whatever (done, used Blender and 3DCoat)
3. Retopology in Blender (done)
4. Apply thickness modifier to the low poly and high poly models (done)
5. UV low poly in Blender (done)
6. Baking Normal Maps in Blender or xNormal /maybe Knald or 3D Coat (tried xNormal and Blender - bad results)
7. Import in Unity/Unreal

But I'm having problems with #6 (baking normals): both coat's and shirt's collars project on geometry under themselves. As I understand, I'd need to explode the model (separate and space out all geometry that might overlap - in my case - collars from the shirt and the coat and probably the insides of the coat, too) but the thought of going into the edit mode for high poly models is terrifying, let alone trying to select something there (freezes due to high poly count)
Tried baking with cages - trying to adjust the cage for collars or other tight spaces or inside cavities seems next to impossible too.

So I guess, it's either of two questions:

Is there an easier workflow for clothes made with Marvellous (on what stage do I add thickness: when exporting from MD / to high poly sculpt with thickness modifier (looks bad) / to low poly model (baking one-sided mesh to a thicker topology?) ), how to retopo cavities under collars so the bakes there would be hassle-free?
Or is there just an easier way of baking overlapping geometry?

This works to some extent:

Flip the normal of the inner faces
Bake the Object Space normal
Connect it in your material shader graph, even though your normal is in Object Space, use Tangent Space in your Normal Map node.
Create a new image, select it and now bake the normal map, but this time use Tangent Space.

If anyone knows the better workflow, please share it :)


Blender 2.8 emmiter particle animation I was wondering if anyone managed to animate particles in blender 2.8(eevee).
I can render each image manually fine but If I hit animation button the application crashes.

And I was thinking.
Incase no one managed to achieve particle animation yet without crashing,

The solution might be to create a script that renders the frame using render (image) button then switch one frame then render the frame and so on.
Because when I do it manually it doesn't crash.
But hitting the render button 500 times is tedious at best.

Maybe one of our lovely programmers can do that for us.

Thanks everyone.

I have found my answer.
1. Close the 3d view port.
Replace it with a time line or anything.
Apperantly eevee doesn't like animating while the viewport is open. (perhaps because the viewport updates too?)(not confirmed theory)

2.Delete any files that has the same naming scheme as blenders in the destination

Save the blend.
Reset the time line (shift+left arrow key)
Use a lower viewport and rendering samples. I lowered the rendering samples from 512 to 256 and it worked.
Run the simulation at least once using( alt+a)

Restart eevee if you still get crashes,but save the file before to not lose changes and remember to run the simulation once.

You can hit animation button now with no issues.


People walking through camera tracking I’ve just started to teach myself about camera tracking in blender. I’ve watched tutorials and everything shows an animated 3D object in the middle of an open space. Can you do and get the same effect with something passing in front of the animated object during the scene? if so, how? Thanks

If the point you are tracking gets obscured, think of it in two sections, tracking before and tracking after.

Track the early footage until your marker is obscured
Jump forward until it is visible again
Move the marker back into place
Track forward through the later footage

If objects that you are adding should also be obscured, you will want to either track some points on the obstruction and make them the parent of a mask or keyframe the position of the mask to follow the obstruction through the shot. You then use the mask to cut out your objects in the render.

Instead of moving the marker into position after it reappears, you can also track the point with a new marker, these two markers can then be selected and merged into one using Join Tracks.


How to bake AO + Diffuse into one map in cycles? I have AO Map baked and a diffuse map. I combined together in cycles node editor and changed AO intensity through colorRamp.

Now I'd like to save these node settings and bake it into one. I've tried different things but I think I missed something.

What is the right wey?

Generally, you do not want to do this for AO, see Adding Ambient Occlusion to Material

However, if you really want to in this case, you can just bake the diffuse channel. Since you multiplied AO into diffuse, it is now part of diffuse. So just bake that. If you don't want to also include lighting, set bake type to "diffuse" and bake only the color pass:

(remember, however, by multiplying AO over diffuse, you are already "including lighting" as AO is lighting, not color)


How to bend extrusion along a sphere I have this extrusion I made out from the side of a curved mesh (not as in "Curve" or "Path", but just generally at a curve) and when I extrude it out, the it comes as a bar from the face I extruded from (like it should). How would I be able to make the extrusion curve at the angle my original mesh is at?

I don't know if there's a way to automatically find the perfect curve but you could try this with W > LoopTools > Bridge Edge Loops then play with the factors on the bottom of the Tools panel in 2.7 (or bottom left Adjust Last Operation box in 2.8), especially Segments and Strength.


Particles to spawn from only selected faces (refined question) How  to spawn particles from only selected faces on the object ?

I want to select only a few faces which spawn particles?

I selected vertex group but still does spawn from all faces. I set this Group under the field weights in partile settings. I want it to spawn from only selected ones (yellow).

Vertex groups works with vertices and as you can see when I try to select what you have in yellow by using vertices it covers the whole mesh. So what I would do is add 2 loop cuts. . When I apply the vertex group as density for the hair I get  your intended goal.


Selecting similar keyframes? I have a rig that is animated. It is cluttered with a lot of keyframes for its scale, despite the fact that this is completely irrelavent.

I would like to delete all keyframes pertaining to the scale values across all of my bones at once. I can't seem to figure this out—presumably, selecting all "scale keyframes" in the dope sheet or something of that sort would work, but I don't know how to do that.

Any advice?

Open a graph editor, then in the search option type in scale:

If you want to do this for all bones, unhide them and select all, if you want to do this for all objects in the scene, Click the show only selection icon. With your mouse over the list of scale keyframes press a untill they are all selected and x -> delete.


Pixels while texture painting I come to a problem while texture painting. The lines and strokes are all pixelized and looks very ugly.
I tried to double/quadruple(2048px X 2048px/4096px X 4096px) the size of the image in the UV Editor window and reassign the new image to the image texture which is linked into a Principled BSDF, but even this seems not to get drawing sharper.
I even tried to enlarge the mesh to maybe cover more pixels but nothing works.
Is there anything we can do for this?
[Edit]
I figured that the faces ratio are not correct in the UV Map. I don't know if it may be part of the problem.

From your description I guess what you're getting is the strokes on the left and what you want is the strokes on the right.

To get that make sure that the fallout is set to smooth or something similar


Interface changes with stock model files When I open a a Stock 3D model I downloaded, the entire interface changes. I see a "Default" layout option, but I don't see the stand "Layout" option at top of page. Is it possible that the model I have was created pre 2.8 & needs to be converted?

The model also does not have a Camera, & I can't see to find the "Add Camera" option that I see in basic tutorials.

I have attached screenshot of the UI as it appears with my stock model. Total Noob thanks you

You can bypass the user interface saved on the file and use your default one.

Open blender.

Then use File>Open to select the file you want, click on the gear on the right side and uncheck the LoadUI box.


Render of animation all black I have looked at literally almost every post about this issue but none of them fixed my problem. If you can help me I would not be able to thank you enough! you can download it here

You've got both an animation in the 3D Viewport set up, as well as a Sequence in the Video Sequence Editor within the same scene. The sequence in the VSE now seems to take precedence over the 3D Viewport Rendering. So essentially, when you do a render, instead of using Blender Render to knock out the frames of your animation, the VSE is trying to read the PNGs defined in the sequence strip, and spits out those.

To "fix" this, you can disable the Sequencer output in the Post Processing tab under the Render Settings. Disable the checkbox called Sequencer and render your animation.

Once done, you can enable the Sequencer checkbox again when you're ready to cut the video strips.

Personal Recommendation: To avoid this kind of confusion, create a second scene in your Blend File to separate animation from video editing. This way, Rendering and Animation can have their needed settings, while Video Editing can have completely different ones.


Would the automatic removal of double vertices ever be undesirable? While modelling an object in blender it's not unusual to have overlapping vertices that are exactly on top of each other. This happens easily when I extrude and manipulate the mesh and then change my mind later on.

So removing doubles tends to be a common operation. However, wouldn't it make more sense to have blender automatically do this to help improve workflow?
Are there any situations where I wouldn't want to remove double vertices?

One case would be if you didn't want to lose sharp edges.

When you apply the edge-split modifier, it will be splitting off faces based upon the angle. It will actually be splitting them individually so there will be doubled vertices. If you remove doubles, you'll lose the sharp edges.


Make texture painting not depend on view angle Trying to hand paint a skybox. So im sitting inside a cube, all faces flipped towards me and i'm trying to paint my cubic skybox viewing from the center of the scene. Unfortunately my strokes only get registered by the face that i'm looking at more or less directly. this keeps me from painting in the corners of the cube, doing continuous strokes from one face to another.
From outside the cube it seems to work fine (provided i flip the faces so the normals point outside of the cube again) i can even paint at extreme angles.
ANY settings of the normal falloff option in the  properties panel under tool->bushsettings->falloff didn't solve the issue (i tried turning it off, 0 deg, 45 deg, 90 deg)
is there a way to tell blender just not to worry about my view angle towards any given face and just paint my darn stroke?
Thanks in advance

Perhaps try turning off Occlude in the Options panel in the tool settings


Where to find sidebar menu Object Tools I'm following tutor4u's tutorial on blender and he does something under Object Tools, specifically under Object, join. I can't find that on my blender 2.76b.

Attached is a pic of mine and his sidebars.

It looks like you may have something selected that isn't a mesh. Try deselecting by pressing A until nothing is selected, then select the meshes you want to join.


How do I control the frames of sprite sheets? I have the basics down for importing and using a PNG as an animation base. But I am having problems with the animation running in the back ground.

I am using this for a dialogue box and was hoping to be able to use the scene.addObjects("mydiobox" , reference.point) function to simply have all the letters spelled out in an animation, but it is running in the other layer and comes in in the middle of the animation. Is there a way to decide what frame it comes in on?

You can specify the start frame in the Image Editor:

If it's coming in in the middles of that animation, we have another problem, because when an object is in a hidden layer, it should not be playing. So this is a bug or something, sorry.


Constrain a camera to an object while also aligning it perfectly to the center of the object (relative to the camera) even while using perspective So, Im trying to constrain a camera to view an object perfectly in the center...
Ive set a constraint on my camera so that it uses "track to" to point at the center of my shape.
However, I noticed that even when I use an exact measurement on my cameras position to give it a perfect 45 degree diagonal angle towards my object (x5, y-5, z5 for example), its still not aligned perfectly
As you can see in the image below, the object isnt fully in the center, even though its at a perfect position and its being constrained to the object position

Is there a way to constrain it and align it perfectly to the center of the object even while using perspective view (So I can move the object and have it perfectly centered relative to the camera's picture)
Or this unrealistic?
Essentially, I want it to perfectly fit in the center of the camera, no matter where I move it.

Shift the camera.
Adjusting the shift setting of the camera, such that the camera aligned 2d bounding box of object is centered.

Result of running on default scene, then transforming and re running, there is no constraint pointing camera to origin of object, if so there would be less shift depending on origin point

Firstly as mentioned in question am assuming you have the camera set
up and pointing to the object of interest.
A couple of useful links in regard to this.
Add camera at random position through Python
Script to render one object from different angles

Have added an optional option to create an object that shows the 2d
bounding box of object of interest lying on the plane defined by the
origin point of object, and with a normal matching the camera
direction.  Uses the code from
Getting edges of the camera's view on the scene XY plane
set create_bbox2d = True to False (or delete code) to remove completely.

It appears by your angles and camera positions that you are after a
"perspective isometric" view
Setting up an isometric view

To shift the camera requires using the aspect ratio from render
settings
Set Render/Camera resolution to Render Border coordinates

Putting it together as a script.  Select the object of interest, with a camera set as scene camera and run script.
import bpy
from mathutils import Vector
from mathutils.geometry import intersect_line_plane as ilp
from bpy_extras.object_utils import world_to_camera_view as w2cv
import bmesh
import numpy as np

create_bbox2d = True

context = bpy.context
scene = context.scene
ob = context.object
me = ob.data
cam = scene.camera
mw = cam.matrix_world
o = mw.translation

plane_no = mw.to_3x3().col[2]
plane_co = ob.matrix_world.translation

camdata = cam.data
bm = bmesh.new()
bm.from_mesh(me)
bm.transform(ob.matrix_world)
u, v = np.array([w2cv(scene, cam, v.co).xy
        for v in bm.verts]).T

tr, br, bl, tl = [
mw @ f for f in camdata.view_frame(scene=scene)]
# offset vectors from bl.
# eg middle would be bl + 0.5 * (x + y)
x = tr - tl
y = tr - br
# roll around in CCW direction

bbox2d = (
        (u.min(), v.min()),
        (u.max(), v.min()),
        (u.max(), v.max()),
        (u.min(), v.max()),
        )

if create_bbox2d:
    coords = []
    for image_coord in map(Vector, bbox2d):
        cx, cy = image_coord
        # vector pointing from cam origin thru image point (PERSP)
        vec = (bl + (cx * x + cy * y)) - o

        pt = ilp(o, o +  vec, plane_co, plane_no, True)
        if pt:
            coords.append(pt)

    if coords:
        name = f"{cam.name}_ViewPlane"
        me = bpy.data.meshes.new(name)
        faces = [range(len(coords))] if len(coords) > 2 else []
        me.from_pydata(coords, [], faces)
        ob = bpy.data.objects.new(name, me)
        context.collection.objects.link(ob)
        ob.display_type = 'WIRE'
# shift the camera
aspect = (
        scene.render.resolution_x /
        scene.render.resolution_y
        )

# UV origin shift
(u.min(), v.min() / aspect)
# UV shift

#v /= aspect
# move to UV (0, 0)
cam.data.shift_x += u.min()
cam.data.shift_y += v.min() / aspect

cam.data.shift_x -= (1 - u.max() + u.min()) / 2
cam.data.shift_y -= (1 - v.max() + v.min()) / (2 * aspect)

Quad view after making gif above, all the notice all "frames" (last one active) are in the same plane, normal to cameras direction
To animate this would use a frame change handler.


Self-Collision not work well I wonder whether cloth self-collision works.
I created a cloth with two materials and folded them like the first picture.
I started cloth simulation, whose self-collision distance is 0.75. The cloth became strange like it in the second picture.I tried different self-collision distance, but it didn't work well.... Let me show four sets of experiments. I need cloth self-collision in my clothed avatar. Cloth self-collision doesn't work well as I think. Penetration or repel happens on pocket, collar or hip where shirt and pants (they are one mesh object) overlay.

Experiment 1: Large cloth dropped to a cube with 0.75 distance on Self-Collision. The result looks good, but the beginning is not.

Experiment 2: Large cloth dropped to a cube with 0.55 distance on Self-Collision. The result looks bad, but the beginning is good.

Experiment 3: Smalecloth dropped to a cube with 0.75 distance on Self-Collision. The result looks good, but the beginning is bad.

Experiment 4: Small cloth dropped to a cube with 0.55 distance on Self-Collision. The result looks bad, but the beginning is good.

The  cloth self-collision is affected by the scale of the faces making up the cloth. This means that when you have a fairly coarse level of subdivision the self-collision Distance will result in a cloth that is quite separated whereas if you subdivide the mesh more finely the cloth is permitted to get closer before colliding. Since you only have a single face-width between your folds the self collision is forcing the sections apart in your first example, resulting in the cloth being blown out into the unnatural shape.

The solution is therefore to simply add more subdivisions. This will result in  the scaling of the self-collision to be more appropriate and will also produce a more natural behaviour of the cloth - but this will also significantly affect the simulation time.

To demonstrate this working, here's my subdivided example mesh :

I first ran the simulation with lower subdivision and a Self-Collision Distance of 0.55. This resulted in overlapping faces as in your second example. Using a high Distance also caused the cloth to 'blow out' as in your first example.

However, the higher subdivisions allow the Distance to be left at the default value of 0.75 without the cloth being 'blown out' while also preventing it from self-intersecting. In addition, the cloth was allowed to collide quite close together so there is not a significant gap between the layers. This produced the following result :

This was produced with the following cloth settings :

If you still have intersection issues (particularly from fast moving collisions) you may need to increase the Cloth Quality Steps and/or the Collision and Self-Collision Quality settings (this will also slow down the simulation).


How to merge vertices in Blender? I am attempting to create my first 3D character just for practice. Being one of my first 3d models I going through the learning curve needless to say. In doing so I find myself creating many extra vertices. Where we will say 10 vertices on a rounded shape are spaced out on the equator and on the other north pole end of the edges they are very close. The close end could all be one vertex. Is it possible to say merge all points to one point and delete the rest?

There is a merge tool.
Select the vertices you want to merge.
Press ALTM (or M for Blender 2.8)
There are a few options:
At First, or Last will merge the points depending on the order in which the vertices where selected.
At center. will merge the vertices at the center of all selected vertices.
At cursor will merge the selected vertices where the 3D cursor is.

I recommend you read this page of the blender manual for this and other ways to deal with Deleting and Merging


How can i change a bolt head to pan type? On the left it's my bolt options/properties and the bolt it self.
On the right it's what i need to have the option Pan to change the bolt head to Pan. But i don't have this options.

The bolt is after enabled the add-on Mesh BoltFactory.

If the menu for the options is not visible you can access a floating window with the same options it by pressing F6

If the menu is not visible on the tool panel, then press the + sign at the bottom of the panel.

Note that you can only set the parameters at the time of creation of the object.

Modifications have to be done before you use any other tool. Once you made any kind of transformation (scale, move, rotate, etc, or selected another object) there is no way to get the menu back. At that point, the only way to change the parameters is by creating a new object.


Texture not applied correctly I baked Ambient Occlusion on top of a texture. Every area receives the matching colors except for the front legs below the knees. When in UV Editing Mode, I see that the legs are indeed in the texture and should reveive color -- but they don't. What is the reason for this? I already checked for interior faces and whether the normals face the correct direction.

What David was asking is, have the lower front legs been assigned different Materials than the rest of the giraffe?

In Edit mode select all of the giraffe, open the Materials menu and select the material that the upper body is using then Hit the Assign button.


I can't add cuts to a plane There are three planes in this scene.
I believe each one of them is composed of only 4 vertexes.

I had no problem selecting the one on the bottom and adding cuts to it.
But when I select the one on top left, I can't add cuts. The bottom text line tells me there are cuts being added, but I cannot see them and obviously this is a bug... ?

Pick a direction

The operation you are trying to perform is called "Loop cuts and slide": basically recognize on the mesh faces a certain flow of polygons (loop) and allow the user to subdivide the interested faces by adding a given amount of edges.

What the command need to run is just the direction of the path. Quad faces can in fact be subdivided in two different directions.

Till the cursor does't approach one of the edges, you'll not see the pink edges (the future loop cuts).


How to check if Node connected to another node input in Python I am doing a process to some switch links in materials. I need to know if something is ever linked or not before to process. I can't find out how to :/
The script works well if something is linked only.

import bpy
for m in bpy.context.object.material_slots:
    mat = m.material
    nodes = mat.node_tree.nodes

    # get node input (socket)
    alphasocket = mat.node_tree.nodes.get("Principled BSDF").inputs[18]
    # get node link that connects into the socket
    lnk = (link.from_socket for link in mat.node_tree.links if link.to_socket == alphasocket)

    #add emission node
    emi= nodes.new('ShaderNodeEmission')
    emi.name= "emibak"
    outepute= mat.node_tree.nodes.get("Material Output").inputs[0]

    #make new link destination
    #here 's where I cant find out how to check
    if lnk != None:
        print(mat.name + " alphanod found")
       # mat.node_tree.links.new(lnk, emi.inputs[0])
    else :
        print(mat.name + " alphanod missing")

    mat.node_tree.links.new(emi.outputs[0], outepute)

here is another way I am searching...

import bpy

for m in bpy.context.object.material_slots:

    mat = m.material
    nodes = mat.node_tree.nodes
    print("**** Material " + mat.name+ " ****")

    for mat_node in mat.node_tree.nodes:
        if mat_node.type == 'BSDF_PRINCIPLED':
            print("From " + mat_node.name )
            alphasocket = mat_node.inputs[18]
            #print(alphasocket)
            node_in = mat_node.inputs
            #print(node_in)

            for n in alphasocket.links:
                print("Alpha connected to " + n.from_node.name)

This show me what is connected to the alpha channel but if nothing is connected I want to connect a new node.

To answer comment

  What I want is to test if any node is connected to the alpha channel
  of the Principled Shader. If not, I would create a White RGB node and
  connect it.

import bpy
context = bpy.context
ob = context.object
# all node based materials on object
mats = set(s.material for s in ob.material_slots
       if s.material and s.material.use_nodes)
for m in mats:
    nodes = m.node_tree.nodes
    bsdfnodes = [n for n in nodes
            if isinstance(n, bpy.types.ShaderNodeBsdfPrincipled)]
    for n in bsdfnodes:
        if not n.inputs[18].links:
            rgb = nodes.new("ShaderNodeRGB")
            rgb.outputs[0].default_value = (1, 1, 1, 1)
            m.node_tree.links.new(n.inputs[18], rgb.outputs[0])


Objects Not Showing in Other Workspace Viewports, Only Default I'm having this issue where my objects only show up in default view. When I switch to the other workspaces; UV editing, compositing, Nothing shows up at all; not even the cameras, lighting, either. The names show up in the outliner, but in the viewport of the other workspaces. Nothing.

Tried changing Clipping Distance: Didn't work
Tried to switch the interface windows around: Didn't Work
I am Using Blender 2.79b
I am in Cycles Mode, I don't care about Blender Internal Render
I tried changing some of the windows to 3D view in the other workspaces: Didn't work
I am using the Pie Menu add-on, idk if that could be a problem

You are in Local View, check your viewport label on the top left.

Local view is stored per viewport, so switching layouts or windows doesn't carry it over, though switching scenes in the viewport does.

Exit Local View mode to view your scene, either using Numpad / or in the 3D view header choose the menu option View > View Global/Local to toggle.


Direct Path for Desktop without Usernames for Blender 2.79 thanks for the help on my last question.
Now, i want to export to the desktop path of users, without knowing the username.
I try to explain
Export on Desktop
bpy.context.scene.render.filepath = "/users/luki-krew/desktop/"

Is working for me, the file get saved as 0001.svg on desktop.
But i want something like:
bpy.context.scene.render.filepath = "~/Desktop/0001.svg"

Perfect would be if the file name could be the same like the imported 3d Model. WOULD BE PERFECT !
Like the files named car.fbx - the export should be named car.svg
Than you so much for helping me!

The script below retrieves the home directory and generates the path to the desktop. If the project has been saved before, it adds the name as prefix.

import bpy
import os
from pathlib import Path
from sys import platform

home_dir = str(Path.home())

if platform == 'linux' or platform == 'win32' or platform == 'darwin':
    desktop_dir = os.path.join(home_dir, 'Desktop')
else:
    raise RuntimeError("OS not supported")

if bpy.data.is_saved:
    filename = os.path.splitext(bpy.path.basename(bpy.data.filepath))[0]
    output = os.path.join(desktop_dir, filename)
else:
    # Project file hasn't been saved before, therefore no filename is available
    output = desktop_dir

bpy.context.scene.render.filepath = output

If you want the prefix to be the same as the active object in the scene:

import bpy
import os
from pathlib import Path
from sys import platform

home_dir = str(Path.home())

if platform == 'linux' or platform == 'win32' or platform == 'darwin':
    desktop_dir = os.path.join(home_dir, 'Desktop')
else:
    raise RuntimeError("OS not supported")

if bpy.app.version < (2, 80, 0):
    filename_prefix = bpy.context.scene.objects.active.name
else:
    filename_prefix = bpy.context.view_layer.objects.active.name

output = os.path.join(desktop_dir, filename_prefix)
bpy.context.scene.render.filepath = output


How do I get rid of this text above my toolbar? I'm not sure what key I accidentally hit, but now I have this text above my toolbar (the one with "file, render, window, help" on it). Please refer to the attached image so that you can see what I'm talking about.

Googling yielded no results so that's why I'm here. How do I get rid of it?

Thanks,
HS

just pull up the info window...

Place the cursor at the line where the 3D window and the Info window meet. The cursor should change to a double arrow.

Pull the info window up.

Note, both above and below that header you get a "double arrow":

you don't have to drag the upper separation line

but the bottom line as shown below:


Anti Aliasing Issue with Wireframe modifier New blender user here - loving it so far. I'm running into an anti aliasing issue on a wireframe modifier object during render. Here is a breakdown and what’s happening:

I added a wireframe modifier to a tetrahedron. I'm using Eevee and added bloom & motion blur. I was initially getting some serious antialiasing that would show up in some frames (particularly frames within a shrinkwrap animation of the tetrahedron morphing into another shape—see pic).

I played around with upping the Sampling but the thing that seemed to solve the issue was a. changing the Motion Blur to "Start on Frame" instead of "Center on Frame" and b. decreasing the Motion Blue shutter from .5 to .1

But I'm still noticing this sort of vibrating anti aliasing, particularly on the center line (it almost vibrates when animated—it's a 360 rotate animation):

Any thoughts on how to reduce this if possible would be hugely appreciated!

I don't think you have a chance to affect this "blocky" bloom. It's seems to be a price of eevee to be real-time. What can you see are bloom "samples" and there doesn't exist a way to increase this resolution (from what I know).
In general I would say it wasn't designed for such a strong effect. The same as for antialiasing - the issue is raising more clearly on lines with low angle where stepping is easier to see.

What I tried ... there isn't relationship with another parametr (like scene volumetric, sampling or what ever) that can increase stepping ... the only one panel that can affect the result is Bloom itself.
So try to tweak values there ... probably you can find some setup with better result.
And ... I don't think Motion blur can fix that ... in some situation it can reduce appearance thanks to blur direction, but make it worse in other situations.

Some kind of hack ... you can try Volume object with Mesh to Volume modifier + Bloom. The idea is to use volumetric where you can easily increase steps into very smooth result, and bloom use just as last soft touch to get glowing without high values.
Add Volume object and add Mesh to Volume modifier as source choose your tetrahedron. Decrease Exterior Band Width to 0.02 and switch to Voxel Size and decrease value to 0.01.
Volume object only ...

Material - Principled Volume shader with increased Emission Strength to 2

Volume object + original tetrahedron object + Bloom

Render Properties > Sampling - increase value to something like 256
... or all this is illusion and I was wrong :)


Defining Node Groups I will appreciate for your help.
I am creating my material library, and trying to clean and rename all materials and nodegroups.
How i can define from outliner (or any enother way) wich materials use this nodegroups

(update)

Thank you for your help. I'll try to be more specific.
Just for example. I have big scene with 105 materials, Also I have unknown node group (x) which is used by 3 users. It means that 3 materials from all 105 use this node group (x) The question is, how i can easily find these 3 materials? Where this information is shown in outliner?

Thank you

Node Groups can be renamed either in the Properties of the Node Editor, or also in the Outliner by editing the 'Name' attribute:

(update)

How to find which are the users of some datablock (it doesn't matter if it is a material or group, the idea is the same):

The datablock itself does not store who the users are, instead you have to go over all the users and test.
See:
How to know which object is using a material
Display all users of a datablock


How to scale an image with python I'm writing an addon and I want to save two sizes of every rendered image. One is the original size which blender saves anyway. The other one is a scaled down version of that image.

How do I scale an image with the Python API (possibly with a specific interpolation filter like linear, cubic, ...)?

You can use the Python Image Library (PIL) for instance, there's a Python 3k port:
https://github.com/gpolo/pil-py3k and https://github.com/sloonz/pil-py3k

or Pillow, which is also a PIL fork:
https://pypi.python.org/pypi/Pillow/2.2.1

Example code (for original PIL though):
http://www.daniweb.com/software-development/python/code/216637/resize-an-image-python

As PIL supported differnt interpolation techniques, all of the above should offer the same (or more).

You could also try without any extra modules, by saving the image in blender to another file using Image.save_render(). Note that this method can be used on any image, it doesn't save the rendered image only (render stands for render settings, the render settings of the given scene will be used to save the file. It ignores the resolution settings however. To change scale, you needed to import the saved image again (so that .pixels isn't empty, which is the case for render results), then call Image.scale() and save again. But you can't specify an interpolation mode.


How would I go about UV mapping this object? I just modeled this object that I'm going to be using in a bathroom. I tried importing it into Unreal Engine but when I do the mesh becomes black after light building. People said I have to create a UV lightmap so I looked up tutorials but first I need to UV unwrap twice since Unreal Engine takes the second UV as the lightmap. I have no clue where to start UV mapping since the urinal part dips in. I understand the top sensor part since its just circles and spheres, but its the other part I'm confused about.

Object mode:

https://gyazo.com/788809e77f70e60108258f7820b38c36

Edit Mode:
https://gyazo.com/ecbdebe1bdebc22820bbe4fab8123176

Here's a view from the inside:
Object Mode:

https://gyazo.com/0ca128321a4e9b5726f2f4e6304865b0

Edit Mode:

https://gyazo.com/5e0349a89a71de55d54bad68987847f9

Can someone please just say where I should mark seems?

Never mind everyone I did a UV Smart Project and it looks like this:

Would this be good for making the light map and stop the overlapping?


How to make textures follow a certain path? I'm working on a fountain made of cobblestone. The base is currently a single object. You can see the the base in full here:  (ignore the clipping of the texture for now, I'm still working on the UV map).

What I'm trying to do now is make the texture pattern on the top of the base to follow the ones on the side, so it seems like it's actually made out of cobblestone bricks. If you move the fountain around a bit, you can see that by coincidence the bricks match up, but it makes clear what I mean:

How would you do such a thing? It would be really helpful, thanks!
If it matters, I'm using cycles render.

Thanks to this answer: https://blender.stackexchange.com/a/78362/20394 from Duarte Farrajota Ramos's comment, I was able to get the effect desired.

I just followed the steps in the gif linked above, and instead of selecting one face I selected the row of faces inward of the circle to the outer of the circle, proceding to do the rest of the steps from the gif.

It worked!


Getting hair vertices via python We can convert hair into 3D editable objects via the modifier tab, this means there must be an API to get the hair vertices instantly from python.

Can you explain it and all it's parameters and arguments?

I need it to start my project "Pholygonal", a polygonal hair generator controlled by the hair particle system.

Here is a little snippet that prints out all the coordinates of the hair vertices from the first particle system on a selected object. Make sure the object has a hair particle system.

import bpy

object = bpy.context.object
hairs = object.particle_systems[0].particles
for i, h in enumerate(hairs):
    print('hair number {i}:'.format(i=i))
    for i, hv in enumerate(h.hair_keys):
        print('  vertex {i} coordinates: {co}'.format(i=i, co=hv.co))

particle_systems[0] is used to get to the first particle system of the object. After this the particles are all the particles in the system (in this case the hairs). The hair vertices are accessed with hair_keys. Finally to get the coordinates of a hair vertex you use co.

If you want the coordinate of only one hair vertex, you could type it in one nasty line:

bpy.context.object.particle_systems[0].particles[0].hair_keys[0].co


How to "activate" some camera, i.e. view through it? Suppose, I have some camera in the scene and I want to view scene throug this camera. How to do this?
First I read this should be done by Ctrl Numpad 0. It worked once then stopped.
Next I read this can be done via selecting desired camera in Scene panel. This also worked once then stopped.
Here is the UI

As you see, camera si highlighted and also selected in scene pane. Also you see that camera is seen from aside, so we are not viewing through it. Pressing Ctrl-NumPad0 does nothing.

Ctrl+Numpad 0 sets an object as an active camera, but is not intended to change the point of view itself.
In order to view from the active camera, just press Numpad 0 or on the 3D Viewport's menu choose  View> Viewpoint > Camera.
Or select View > Cameras > Active Camera


how to import .glb file in blender 2.80 beta using python api? I want to import a model of bench in .glb format using python inside blender.

What function am I supposed to use?

GLB is the binary form of the glTF format, and the importer (2.80 and higher, or 2.79 with manual install) can handle GLB filenames directly.

bpy.ops.import_scene.gltf(filepath='path/to/myFile.glb')


Blender 2.8: Move (g) a face like in the direction, extrude would do, when object is "sheared"? "Extrude" always extend a face in the direction of the face normal.
Having a "sheared" object (see below):
How can I acchieve the same behaviour when moving a face with "g"?

You can do it switching the transformation orientation to 'normal', then grab G and use Z to indicate the Z axis which is by convention the normal direction.


How to make a realistic droplet drop on leaf? I would like to have this to be so that the leaf is really getting the weight of the droplet and bending because of the weight of the droplet. And that the droplet really drags on the leaf before falling. So, in other words, as realistic as possible. How to do that?

Wow, got this by editing the .blend of @CLR's

Softbody and a cloth object with collision enabled to produce feedback beween the simulations.
https://gyazo.com/f513d99f530abdf3e178121fdb298b02


Simplifying geometry first of all, let me tell you I'm a total novice in 3d modelling, my experience is with Sketchup only.
Recently, I came in need of a particular model, and I got it in a STL format.
Sketchup imported it just fine, however, the mesh is so loaded with unnecessary details, it makes the application just freeze.
I was told Blender can solve this problem, so I came here to ask you how can I make it a clean mesh, without losing detail but making it lighter so the software can run (and no, it's not a hardware problem, I'm using a GTX 1070 with 16gb ram and up to date processor)
This is what I'm talking about:
https://imgur.com/a/RC3U9Er
Sketchup can't handle that many faces.
So, how do I fix it using Blender?

There are a couple of things to reduce the meshes.

You can find the most part in the Mesh > Cleanup menu.

Remember you have to enter the Edit mode.

Also a Mesh > Faces > Tris to Quads helps to reduce the edges.

See the image below:


Mesh and armature not connected I created a a blender figure, with mesh and armature, and I followed the instructions to connect the mesh with the armature:

Select the mesh
Shift+Select the armature
Ctrl + P
Set parent to armature deform with automatic weights

However, in pose mode the bones can move, but the mesh will not move along.

Could you point me the on right direction to address this issue?

You have a lot of vertices overlaying, you need to select your mesh, go in Edit mode, select all and press W > Remove Doubles with a Merge Distance (on the bottom of the Tools panel) of 0.01.


How to smooth animation? Why is my animation shaking so much? It's not smooth. When he is in the air in one frame he falls down suddenly. His head and upper body shakes. I hope you understand what i mean, you can see my animation here: http://screencast-o-matic.com/watch/cIlo6wnV5D

It's not that bad I think? But if you want to see motion over time, use the graph editor. Here you can see how transformation happens over time. The more vertical the curve is, the more rapidly the change are. If the curve delta (change over time) differs, the movement may appear jerky.

In the screenshot below I have circles a jerky translation.


Link multiple vertices I would like to connect multiple vertices.
In my example, I would like to connect (with edges and faces) the front vertices with the ones on the back.
I have the same numbers of vertices on each side.

Thank you !


Is it possible to read and write to a texture using OSL? Is it possible to read and write to a texture using OSL?
I'd like to recreate this implementation of Conway's game of life using Blender OSL shader scripts. This was done using WebGL [HERE]. The key piece is the ability to read and write textures. Can this be done with OSL and Blender shaders?

It is possible to read an image in OSL using the 'texture(...)' call but it is not possible to write to an image directly from within OSL. For a 'life' simulation you need to be able to read the previous state while generating the new one and so the way to achieve this is to be able to read the previously rendered frame while rendering the current frame - this is possible using OSL (render the frame and use the 'texture(...)' call to read the previous frame in the render output location) as well as possible using standard nodes (render the current frame and using an Image Texture node image sequence pointing at the render output location).
To achieve this, firstly use the Output section of the Output Properties to specify a known location for the rendered output.
Position the camera such that the camera exactly views the plane - with no overlap. This way when we generate the new rendered frame it will exactly coincide with the plane's texture in the previous frame. For my set up I positioned a new Plane (2m x 2m) at the origin and the camera (set with square dimensions) at Z=2.8m and pointing directly down.

Render the animation - this will create the output directory and generate images as 0001.png, 0002.png, etc.
Use your favourite image editor (or use Blender) to create your initial state and save it as 0000.png so it occurs immediately before frame 1 :

The image acts as the 'seed' of the simulation, with "set" pixels representing 'live' cells and dark pixels 'dead' cells.
Create a material to show the image on the plane :

Note the Image Texture to an 'Image Sequence, set the number of frames to the total frames of the animation, Start Frame of 1 and Offset of -1 so that it will always run 1 frame behind the current frame (ie, always the previous frame).
To test it, render the animation and all frames should be identical. Adjust the Mapping node to include a slight rotation and re-render. You should get a progressive rotation on each frame - showing that it is indeed basing each frame on the previous one.

For the "life" simulation, we now just need to sample the points around each pixel in the image and determine the state of the current pixel based on the surrounding pixels in the previous frame. This can be achieved as follows :

The Value node at the left controls the pixel size (as a fraction of the entire width/height) - so 0.01 splits the frame into 100x100 cells, 0.005 into 200x200, etc. 'Window' coordinates are used for simplicity to cover the whole image and this is split into cells using Snap further offset by 1/2 a cell so as to ensure we always sample the centre of the cell instead of an edge. The top-left group of nodes use Combine XYZ to create two offsets - one vertical and one horizontal to compare the adjacent cell in each direction. The offsets are negated (scaled by -1) for the opposite directions and the 4 resultant vectors combines for the coordinates of the 8 surrounding cells. The Image Texture nodes fetch the current cell (the first one) and the 8 adjacent cells. The 'live' cells are detected using Greater Than and counted (using 'Add') and the 'rules' checked as <=1 live neighbours for death, >=4 live neighbours for death, 3 live neighbours for new life (with the Clamped Addition and Subtraction combining the results of the rules) with the final result being output via the Emission shader in the rendered frame.
Here's the result :

Obviously the nodes can be replaced with OSL - if that's desired - but as shown it's really not necessary.
Blend file included - just add your own start image (0000.png) (see Output properties for location)


Change all the input values at once I've seen people change the X, Y ans Z inputs in the mapping node all at once. How is that done?
In this tutorial, Andrew Price does it at 7:44

LMB click on the first property, drag your cursor down to the last one and you can enter one value for all of them.


Exporting Animation with Modifier I have a cube that moves along a bezier curve (it's a mine cart). It is a simple animation, keyframe at start, keyframe at end, with a curve modifier on the cube.

I want to export the animation and load it into Unity to test some stuff out. However, when I do that, the animation exports, but there is no curve modifier - it just travels along a straight axis, instead of along the curve.

Anyway to fix this?

Like oenvoyage (in the comments) I'm not sure a curve modifier is what you're talking about either. For a "simple" "mine cart" animation on a curve I would think you would use something like a "Follow Path" constraint.

If you are using an actual curve modifier my solution here will probably not work.

But if it's simple object animation created using a constraint like I theorized you might use, or parenting or any other similar methods of animating that is not just simple keyframe animation you can always bake the action to keyframes so it should always export no matter what the destination program's compatibility or incompatibility with constraints.

With the object selected go to "Object/Animation/Bake Action"

In the new menu you will probably at least want to select "Visual Keying" which will make it bake (AKA turn into regular keyframes) all animation, like constraints and parenting. If you have constraints or a parent animating the object you can check the options to "Clear constraints" and "Clear parents," or just remove the parenting/constraints yourself when you're done. You also want to make sure the frame range selected encompasses your entire animation length.

This will take most any animation or movement and convert it into keyframes on the location/rotation/scale of the base object, so it should be reasonably simple to export it to any other application like Unity. However, you will lose all the control and ability to adjust the animation that non-destructive constraints and parenting offer you.


How to uv unwrap object with python I am creating a siding generator and I want it to add image textures to the model and uv unwrap them, but I am having one pain of a time getting around the bpy.ops.uv.smart_project.poll() context. I have tried overriding the context and setting it and a bunch of other things, no luck though. Any help is much appreciated

This method works:

import bpy

for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':
        for region in area.regions:
            if region.type == 'WINDOW':
                override = {'area': area, 'region': region, 'edit_object': bpy.context.edit_object}
                bpy.ops.uv.smart_project(override)

the important thing is passing override to whatever operator you are trying to call, this forces it to take that context for a brief moment. You can read a little about it at http://www.blender.org/documentation/blender_python_api_2_72_release/bpy.ops.html?highlight=override


Smooth shading / Sub Surface / Distorted render I'm new to Blender and have been following along tutorials on youtube and I must say, and loving it. So I've reached a gap in which I can't find any help on.

In short, I'm trying to design a grinder just as practice. Heres the the part thats giving me trouble. I created a cylinder which I shaped into the outer layer. Then I made another cylinder to place in the middle of the first one which is where the triangles will be attached to. I then attached all triangles to that cylinder and made all 3 objects into 1 as you see in the image. My problem is, when ever I turn on smooth shading, or the subdivision surface as I'm about to render, the surface on which the triangles are attached to gets warped as you see in the pics. Turning on both at the same time makes it worst as well. So when I turn both off, it looks perfectly flat again but now it looks too "blocky" as you see in the rendered image. I want it to be smooth and not ""pentagonish"" looking on the outside. Any helps is greatly appreciated as I continue to learn this amazing program.

Thanks guys

Here it is in edit mode.

So when you say I need to subdivide the large plane, you mean I have to add more loop cuts (Ctrl + R) to the plane where the triangles are on? Or do I have to select a specific part of the plane and then press w to so I can then choose subdivide?

On that note, what is the difference between adding Loop cuts and adding sub divisions? And if this is the case like you said about smoothing one big Ngon, where might I find a tutorials on the smoothing process? Thanks again

After carefully following the instructions, it still isn't working on my end. I made a cylinder, added a circle, added ARRAY and then Curve to get them perfectly circled. After erasing both the top and bottom face layer that you said, I extruded my new planes and paranted them them to the outer casing. But when I add all my cylinders to keep adding more holes, it doesn't create the walls of the tubes going in. It only makes the holes at the top and the bottom, so I undid that, used Union on boolean, which left me with the cylinders sticking out high. So I went to edit mode and grabbed their edges at the bottom and top and shortened them to the planes level inside the grinder body. But now Ive reached another obstacle. Some circles are not appearing after I do boolean....................... sigh...... I'm new to this and I know I have much to learn, but I've built that grinder body like 20 times and up in trying to learn and understand what isn't working, and I'm still stuck. I'm guessing its the geometry even tho I did use more vertices like you suggested. I guess what I'm asking now, is, how would I properly create my grinder body FROM SCRATCH properly based off the pictures I uploaded. I havent even attached the triangles because Im certain it will warp it further. Any help is appreciated

After all is done, this is what happens when I add the sub to the final body piece

Sorry I didn't have time to give you a formal answer yesterday.

For the Smooth Shader part of the question, it's as simple as using the Auto-Smooth option.  Play with the angle setting to get the effect you want:

Essentially, though, your main question is a matter of workflow.  The Remesh Modifier is a bit unpredictable, but you could try it.  Other than that or doing it by hand, there's really no way of fixing the issue without redoing at least part of your mesh.

The problem with the Subdivision Surface Modifier is that it's meant to be applied to quads or tris.  In your case, you have a few ngons wrapped around multiple cavities and protrusions.  Ngons, at least as it applies to Blender, are faces having more than four edges.  Even if it just has five edges, SubSurf still won't work correctly:

So you have a few options.  Before you ever begin to design your piece, make allowance for the above if you plan on using SubSurf.  You might even consider using high density meshes in place of SubSurf to begin with.  That way you're not relying on an "after" algorithm to modify your mesh.  Of course, the only problem with that approach is file size and complexity.  If you were 3D printing something, this would be the way to go:

You could apply the SubSurf before you make your knife cuts, but again it's added geometry, file-size, and complexity:

Normally, Subsurf works great.  The problem with your particular example is the cuts you made into the mesh.  Once you make a cut into a quad, most of the time you're gonna be left with an ngon.  So here's a solution that will keep you from having to go back to the drawing board and will also allow you to keep using SubSurf without applying it.

1.) Delete that whole top flat face.

2.) Select all the cylinders (and cones) and press P to separate them into their own object:

3.) Next, Alt select the inside rim and press E to extrude and S to scale toward the middle.  Press Alt + M to merge the vertices at the center.  You now have a triangle fan mesh:

Now add the Boolean Modifier to the casing and select the cylinders that you separated in step 2.  Select the Difference operation type.  You may have to raise the cylinders up until they just crest the plane of the casing.  Now Restrict the original cylinders from View and Render (but don't delete them).

The reason this works is because modifiers are applied in order starting with the top first.  In this case, we're edge-splitting, sub-dividing, and then using the Boolean mod.  This allows you the benefit of unapplied subdivision and Boolean simultaneously.

Finished product with no modifiers applied:


Scene playback with wrong/unwanted Sequencer audio I have a 30 second Scene, that I put at 3 minutes into my VSE - together with some additional "scene music".

When I play this in the VSE, it works fine - both audio and video.

But when I go to an animation panel to create/tweak my animation and hit play, the audio plays the intro from the beginning of the sequencer edit - which doesn't have anything to do with my Scene's audio.

Yet I need that "scene music" to time match my Scene correctly.

Any ideas about Sequencer time vs Scene time?

Adjust the Start and End Frames of your Scene to match the Frames where you placed your Scene into your VSE. Then if needed grab your animation keyframes in the Dopesheet Editor and reposition them accordingly.


Jagged and ugly Shadows in Eevee I’ve created a low-poly stylized tree in Blender 2.8 and rendered it with Eevee. Some of the shadows on the leaves are very jagged and quite ugly.

The entire scene is simply a camera, a sun light source and a few meshes with a single material each for the tree.

I’ve played a little with the sun light settings but it only seemed to shift where the jaggedness was occurring. I've taken a look at some similar threads on StackExchange but the suggestions didn't seem to help.

Here is the .blend file

Ideally, I’m not simply chasing a “how to fix it”. I don’t have much knowledge on 3D modelling and rendering, so any explanations as to why this is occurring would be great!

This is caused by the inaccurate behavior of Shadow Mapping used in real time rendering enginnes like EEVEE and almost all game rendering engines. People call them Shadow Acne.

What you see is actually pixelated shadow mapping to some boundary area, causing those alias shadow show on the mesh.

There are many solutions to overcome this problem, but since performance is the main issue in real-time rendering, the best solution changes depend on the situation of your application.

You can check out this explanation about shadow mapping: Shadow Mapping - LearnOpenGL

Blender 2.81 Update Information

According to the latest Blender,

  Soft shadows were changed and now enabled with the Use Soft Shadow option in the render properties Shadow panel. This will progressive smooth shadows, in combination with a more conventional shadow filtering method (PCF). Exponential and Variance Shadow Mapping methods were removed. (d8aaf25c23fa)

The way EEVEE render shadow has been changed to a more common method. And the problem of Shadow Acne should be reduce or even solved. Check for the latest Blender to see whether the shadow has been fixed.


How to switch to "active" after append? When I try to use bpy.ops.wm.append, the object appears "selected" with the red outline, but how do I switch it to "Active" with yellow outline?
bpy.ops.wm.append(
    filepath="Prefab_Objects.blend",
    directory="/Users/Yuri/Desktop/Blender_Python_Test/Prefab_Objects.blend\\Object\\",
    filename="tower")

(I need to apply bpy.context.active_object.name afterward, but can’t because the object is not "active")

You can set the active object with this command:
If len(bpy.context.selected_objects):
    bpy.context.view_layer.objects.active = bpy.context.selected_objects[0]

The active object is now reachable by:
active_obj = bpy.context.active_object


how to use matplotlib interactively with blender? I use Blender to explore and render some data that I have in real time.

Besides that, I also have an interactive matplotlib application that further helps me explore and report on the data.

How can I integrate my matplotlib into Blender, so I can use both of them in real time?

This answer reports the best solution I found so far, I'll be happy to hear from feedback or better alternatives:

I wanted to integrate matplotlib into Blender in its own space, but sadly learned that the Blender 2.80 API can't (yet) create new space types.

Therefore the solution for me was to let Blender's Python3.7 interpreter run a separate matplotlib window in a child process (see image).

For that, I had to do the following things:

Make sure import tkinter works (here how I did it, no root privileges needed). With that, it should be possible to <BLENDERS_PYTHON> -m pip install matplotlib and import it. Note that running matplotlib in plt.ioff() mode blocked Blender, and running it in .ion() mode did nothing. Running it on a child process solved it for me.
Make sure multiprocessing.Queue() can be instantiated (In my Ubuntu17 system, this required to copy the _multiprocessing.so file from my non-Blender lib-dynload Python environment.

Now running the following from the Blender interpreter should spawn a child process, that interactively reacts to any changes that the Blender user makes to queue:

import matplotlib.pyplot as plt
import multiprocessing as mp
import numpy

def worker(q):
    fig=plt.figure()
    ax=fig.add_subplot(111)
    ln, = ax.plot([], [])
    fig.canvas.draw()   # draw and show it
    plt.show(block=False)
    i = 0
    while True:
        obj = q.get()
        n = obj + 0
        print("sub : got:", n)
        lnx, lny = ln.get_xdata(), ln.get_ydata()
        ln.set_xdata(numpy.append(lnx, i))
        ln.set_ydata(numpy.append(lny, n))
        ax.relim()
        ax.autoscale_view(True,True,True)
        fig.canvas.draw()
        i += 1

queue = mp.Queue()
p = mp.Process(target=worker, args=(queue,))
p.start()

Once the window is open and listening, add entries to the plot, for example like this:

queue.put(bpy.context.scene.frame_current)

The new entry will be interactively incorporated to the plot. Once you are done, simply kill the process with:

p.terminate()

Hope this helps!
Cheers,
Andres


How do I scale vertices evenly among a selection? This seems like a broad question so I will put in a picture showing you what I am intending to do.

I have a very basic house structure, and I would like to extrude/scale it inward, evenly across all sides. However, you will notice that the two sides near the center are scaling at much smaller proportions, and I am looking for evenly distributed scaling across all vertices.

The reasoning behind me wanting to do this is to add an evenly proportioned brick-sized inset around the home for detail purposes. I am aware of the loop cut, however I am under the impression that extrude/scale is considered the fastest way of accomplishing this based on watching speed builders on Youtube.

I have found the solution to my problem. As it turns out, I was using the wrong tool for the job. The proper way to scale something evenly across all sides is to use "Shrink/Fatten" by pressing Alt+S. Once I begin shrinking or fattening my object, I only need to press S to make all the edges even, and I can adjust it to my liking.


How to export amodel from blender with textures and animations to use the model in Irrlicht? I am creating a small game using the Irrlicht engine. I have created a human model using MakeHuman and I have imported it in Blender. I am a total beginner to 3D I have created some basic animations in the model. MakeHuman already applied textures to the model, so I think It does not need to be done again. How to export the human model with textures and animations to use it in Irrlicht?

According to the Irrlicht Feature page, the engine supports the follow for fomats and texture types.

Direct import of common mesh file formats: Maya (.obj), 3DStudio (.3ds), COLLADA (.dae), Blitz3D (.b3d), Milkshape (.ms3d), Quake 3 levels (.bsp), Quake2 models (.md2), Microsoft DirectX (.X)… [more]
Direct import of Textures: Windows Bitmap (.bmp), Portable Network Graphics (.png), Adobe Photoshop (.psd), JPEG File Interchange Format (.jpg), Truevision Targa (.tga), ZSoft Painbrush (.pcx)… [more]

In order to export the mesh, you need to select the various components, then from the File -> Export menu you have a variety of options to choose from. See image.

After you have it exported then its a case of doing the engine side stuff.


Bone matrix assignment behaviour change in Blender 2.80 I am trying to port an armature importer add-on from Blender 2.79 to Blender 2.8x.

After the bone is being created the bone matrix is set.

But the assignment of the bone matrix has a different behaviour in Blender 2.82a compared to the older Blender 2.79b.

I created a small script that works for both Blender versions to reproduce this behaviour:

import bpy
from mathutils import *

def new_armature(name: str) -> bpy.types.Object:
    armature = bpy.data.armatures.new(name)
    obj = bpy.data.objects.new(name, armature)

    if bpy.app.version[1] >= 80:
        bpy.context.scene.collection.objects.link(obj)
        bpy.context.view_layer.objects.active = obj
    else:
        bpy.context.scene.objects.link(obj)
        bpy.context.scene.objects.active = obj

    return obj

obj = new_armature('human')
armature = obj.data

bpy.ops.object.mode_set(mode='EDIT')

new_bone = armature.edit_bones.new('Bone.000')

new_bone.head = Vector([0, 0, 0])
new_bone.tail = Vector([1, 0, 0])

bone_matrix = Matrix(([0,0,1,0],[0,-1,0,-6],[-1,0,0,6],[0,0,0,1]))
print("bone_matrix:\n", bone_matrix)

new_bone.matrix = bone_matrix
print("new_bone.matrix:\n", new_bone.matrix)

Running that script in Blender 2.79b and Blender 2.82a gives me the following outputs:

user@desktop:~/workspace/blender$ blender2.79b --python test2.py --background
Read prefs: /home/user/.config/blender/2.79/config/userpref.blend
found bundled python: /opt/blender/2.79b/2.79/python
bone_matrix:
 <Matrix 4x4 ( 0.0000,  0.0000, 1.0000,  0.0000)
            ( 0.0000, -1.0000, 0.0000, -6.0000)
            (-1.0000,  0.0000, 0.0000,  6.0000)
            ( 0.0000,  0.0000, 0.0000,  1.0000)>
new_bone.matrix:
 <Matrix 4x4 (0.0000,  0.0000,  1.0000,  0.0000)
            (0.0000, -1.0000,  0.0000, -6.0000)
            (1.0000,  0.0000, -0.0000,  6.0000)
            (0.0000,  0.0000,  0.0000,  1.0000)>

Blender quit
user@desktop:~/workspace/blender$ blender2.82a --python test2.py --background
Blender 2.82 (sub 7) (hash 375c7dc4caf4 built 2020-03-12 05:30:40)
Read prefs: /home/user/.config/blender/2.82/config/userpref.blend
found bundled python: /opt/blender/2.82a/2.82/python
bone_matrix:
 <Matrix 4x4 ( 0.0000,  0.0000, 1.0000,  0.0000)
            ( 0.0000, -1.0000, 0.0000, -6.0000)
            (-1.0000,  0.0000, 0.0000,  6.0000)
            ( 0.0000,  0.0000, 0.0000,  1.0000)>
new_bone.matrix:
 <Matrix 4x4 (-1.0000,  0.0000, 0.0000,  0.0000)
            ( 0.0000, -1.0000, 0.0000, -6.0000)
            ( 0.0000,  0.0000, 1.0000,  6.0000)
            ( 0.0000,  0.0000, 0.0000,  1.0000)>

Blender quit

As you can see, the new_bone.matrix matrix differes between these versions.

Updating the scene also does not change anything.

Can you give me a hint how to get the Blender 2.79b behaviour in Blender 2.82a?

My platform is Linux with Kubuntu 19.10 x64.


Inserting random loop on the mesh to change topology How to insert random loop on the mesh ? It doesn't need to be circular.
I know how to use Crtl+R but I need to add more complex curve/loop streching to many faces.

Is it possible to draw the loop with grease pencil and then just attach it to mesh topology ?

You can't change the topology of the model using the edge loop tool alone as CTRL R uses the existing topology of your model. Instead try using the knife tool to manually create your own topology.

Documentation for this can be found here.

https://www.blender.org/manual/modeling/meshes/editing/subdividing/knife_subdivide.html

Make sure that when you use the knives tool you correct your topology as you are going as this can create ngons in areas that can be troublesome.


Edit an object's material in Blender using python I wish to edit a component of an object, say a cube, using python script.

For example if I need to change the material or color of just one face of the cube/object, can I do that using python?

Yes, you can.  You will need a second material and then assign that material to the face.  Here is an example I concocted which affects the faces you have selected in EDIT mode:

import bpy
import bmesh

def get_other_material():
    mat = bpy.data.materials.get("pants")
    if mat is None:
        mat = bpy.data.materials.new("pants")
        mat.diffuse_color = (0.8, 0.6, 0)
    return mat

def setPolyMaterial(obj, polyIdxs):
    if len(obj.data.materials)<2:
        obj.data.materials.append(get_other_material())
    material_index = 1

    if bpy.context.mode == 'EDIT_MESH':
        bm = bmesh.from_edit_mesh(obj.data)
        for idx in polyIdxs:
            bm.faces[idx].material_index = material_index
        bmesh.update_edit_mesh(obj.data)
    else:
        for idx in polyIdxs:
            obj.data.polygons[idx].material_index = material_index

obj = bpy.context.active_object
if bpy.context..mode == 'EDIT_MESH':
    bm = bmesh.from_edit_mesh(obj.data)
    polyIdxs = [ f.index for f in bm.faces if f.select ]
else:
    polyIdxs = [ p.index for p in obj.data.polygons if p.select ]
setPolyMaterial( obj, polyIdxs)

I personally prefer to avoid anything from bpy.ops if I can because it requires you to mess with the editor state; and exactly what state you must adjust is entirely undocumented (although usually straightforward, USUALLY).

If you want to alter anything other than the diffuse_color, you can hover your mouse over the field and a pop-up will usually appear giving you an indication of the path to that property in python code (although sometimes it is truncated and you have to go to #blenderpython for an answer)


How do I get rid of an arced path in interpolated rotation frames I've got a straight line, with the origin at one end. I'd like to animate some rotation.

Here's the initial orientation:

Here's the final orientation:

With the initial an final rotations keyframed, here's the (linearly) interpolated path it takes:

I suppose this is because the rotation channels are interpolated independently from each other. Is there a way to animate this such that the line rotates directly from one orientation to the other, instead of following an arc?

Edit:

The key frames are rotation(0,0,0) to rotation(90,90,90). Here's the graph (all three lines on top of each other):

You are coming up with really strange interpolations because you're in Euler mode and encountering gimbal lock. Euler is notorious for gimbal lock problems, especially for animators who are unaware of how Euler rotations work. The best way to avoid this problem is to use quaternion rotation mode. You change the mode in the object transform properties. Quaternion math makes two orientations interpolate in the shortest path, meaning there is no flipping or spinning. You can think of this as "the shortest distance between two points is a line."

If you really, absolutely need to stick with Euler, the trick is to use as little rotation as possible to get the desired orientation. The Z axis will do most of the work in this case. Then tweak the X and Y values to get the final orientation.

Here are three tips to make working with this object much easier:

Work with the manipulator in gimbal mode. You can change this in your 3D view header or by pressing AltSpace. This mode gives a great visual cue to how the Euler rotations are compounding on each other.

Give the object a zeroed orientation aligned to the cardinal (global) axes. This will make it infinitely easier to visualize and predict what effect your rotation axes will have on the object. I generally point my objects to -Y or +X, but the choice is yours.

Lastly, play with rotation order. The default Euler order is XYZ, but the best mode is dependent on your scene. The mode to set it to is entirely arbitrary, but some work better than others for a particular scene. With the alignment in the last tip, my rotation order would remain XYZ. Then the only axes I would need to animate the object as I see in your scene would be Z and Y.

For another explanation, see my answer on this similar question.


Why the knife tool can't be used on some of my faces? The knife tool or knife project tool cannot be applied on the faces shown in the screenshot, but they worked on other faces. I've used 'remove doubles' and 'recalculate normals' on my model but that doesn't solve the problem. Any help is appreciated :)

Model Download Link : Here (A circle was placed in front of these faces for knife project tool testing)

It appears to be because you are trying to cut into the "virtual" geometry created by the mirror. You have set the Mirror modifier to display both sides as if they as edit-able, but the KnifeProject feature doesn't seem to take the mirrored geometry into account (but it is reasonable to expect that it should..)

the option with the green square let's you edit both sides, but not project onto both sides.

Other problems with your model:

You also have some issues with degenerate geometry (faces with zero area), and faces that you might not be aware of causing non-manifold geometry. Use

to look for hidden geometry, and in Face selection mode look for Dots on Edges, that's an indication that you have collapse or potentially  "invalid" geometry.

Additionally, the KnifeProject tool has a feature which can limit/extend the distance the cut goes into the geometry.

Is the different between these two cuts (cut from a different Viewing angle than shown so you can see the range of the cut)


Cannot run simulation for smoke and fluid I've been trying to render smoke and fluid simulations, but can't manage to get the results I'm seeking. The first problem is that the smoke and fluid don't simulate. The second problem is that the fluid domain shows up as a solid object in my render. I've tried to solve the issue for hours and I would really appreciate some help! I have appended the .blend file and I hope that someone will be able to take a look at it and help me out.

I'll be focusing on your scene here, however I will also try to generalise a bit so that you can carry the new things over.

Let's start with the fluid simulation - the fluid simulation does simulate in the file you have provided. It pours over the statue.

It does show up like a solid object in the render because you've not added a shader to it, so currently it's just plain old white.

I might have understood that the wrong way, so here's what to do if instead you mean the fact that the domain reverts to a cube during the animation: You've not baked the fluid enough. The process takes a lot of time and can't (to my knowledge) be paused. Hit the "Bake" button located in the physics properties of the fluid domain to bake the fluid cache. This will take up time and space on your harddrive. Blender might be unresponsive during baking - however make sure to save after a bake, as the cache is bound to the save-file. If it crashes and you forgot to save... well, then you can re-bake the whole thing.

If that's not your issue then I'd love to have some clarification as to what's not working out for you.

Onto the smoke simulation! Here is the part where things get a bit more general.

Smoke simulations are hard to calculate for the CPU. The "division" setting for smoke simulations is also not a "quality" slider. There is however a setting called "Smoke High Resolution". I see that you've ticked that one - and at the same time upped the divisions to 100. Blender really didn't like that 100 in the divisions setting. I got a normal result from lowering that setting to 32.

I'd recommend setting the divisions to 32 or 64 and instead increasing the "Divisions" setting under "High Resolution" to increase the quality of the smoke. I'd recommend 2 or 3, anything above 3 will not be worth the additional space on the harddrive and baking times.

A smoke emitter also doesn't need a lot of vertecies - yours currently has about 10000. Replacing it with a simple plane will yield the same result. I've personally not experimented with it, but it might reduce baking times as well.