Getting separated meshes to use the same armature (clothes and hair moving with body ex) When I made my character model I made it as 3 seperate objectes: one for body one for clothes and one for hair. I then joined these objects using the 'ctrl + j' command.

I have created armature but the manipulating the armature only moves body + objects that are connected with the body(ears).

I'm not sure if I should somehow separate these objects again and give them their own armature (seems kind of labor intensive)

Or if there is a way to 'merge' the meshes so they are all connected and can move along with the poses.
If anyone has any guidance or can point me in the right direction it is greatly appreciated. The similar questions I have found differ in the fact that the user is using separate objects while I am using one.

Thanks!

I would parent the object to the a bone that makes sense and then just make sure that bone is has full influence over it.


Noob question. Join/separate object Why can't I also separate two object while in Object Mode (while to join two objects, you must go into Object Mode and not into Edit Mode) but I have to go to Edit Mode to do that? Am I using wrong workflow, method a way to do that? Looking at it from wrong perspective?

I assume you are referring to the "join" (ctrl+J in Object mode) and "seperate" (P in Edit mode)

You can think an object as a grouping of mesh data with a name. Which mode you need depends on what you want to do:

What join does: Takes the selected "objects" (therefore use object mode) and merges the mesh data from the selected objects into one single "object"

What separate does: Takes the selected vertices, edges and faces (therefore use edit mode) and writes them to a new "object" (which is different from that you are currently in.

So for example join (as in ctrl+j) doesn't make sense in edit mode since you already are in a single object. However if you want to make seperately selectable and modifiable groups of vertices, edges and faces then you could use "vertex groups"
Equally seperate (as in "P") doesn't make sense in Object mode, because for that operation you need to tell blender what vertices, edges and faces you want to seperate.

Happy Blending! :)


Fluid is floating instead of falling? Instead of falling into this sink that I made, the fluid floats above. I'm not quite sure what's causing this. As you can see, my Domain is large enough so that it shouldn't be a problem:

Settings:

My current .blend file can be found here.

The main reason for that behaviour are non-manifold mesh and unapplied transforms.

Non-manifold mesh used as obstacle.
One of the common options for different fluid objects is Volume Initialization. Only one value, which is Shell, can work regardless whether mesh is opened, i.e. non-manifold, or not. Two others assume that mesh is closed and thus won't initialize volume of obstacle (in this case) as expected.

In your file the sink object, where water is supposed to fall down after flooding the top box, is a plane with a Solidify modifier for adding thickness:

Non-manifold geometry is shown as selected

The object is set up to use Volume Initialization > Both which requires manifold object (you can change it to Shell though and simulation will work).

The mentioned modifier, supposed to make the object as manifold, won't be taken into account as it is placed below Fluid one in the stack of modifiers. However you can't move it above Fluid modifier because the latter requires original data of the object to work. Thus you end up either with applying Solidify or extruding faces in Edit mode.
Unapplied transforms on objects used in simulation

In order modifier to work as expected, transforms (scale, rotating) should be applied to object data. See more in Why is it important to apply transformation to an objects data?.
They aren't applied for all objects used in simulation. It is important at least for object with Solidify modifier for correct adding thickness to the mesh (and I recommend making its faces planar, e.g. with Mesh > Clean-up > Make Planar Faces). Note that leaving other transforms unapplied may lead to unexpected results too (although fluid simulation will work).

With that done, fluid will act as expected:


One shape key, multiple bones driving it I have a character that has 1 shape key that controls the shape of her thighs (both left and right). What I'd like to do is control this shape key with a driver when either the left or right foot is positioned. In other words, when I move the left foot (IK), the "thighs" shape key is activated. When I move the right foot, the same key is activated. Two bones that activate the same shape key driver. Is this possible?

You can have one driver only, but in that driver you can set two (or more) variables, one driven by the left bone and one driven by the right bone. The scripted expression could be something like "var1 + var2".


How to render an animation as video in Blender? Yesterday I was working on a simple animation, an animated logo.

Here is an image of the progress:

I already have the animation working and everything is okay with the project, but I can't figure out how I can render the animation and turn it into an AVI format video.

How do I render an animation in Blender?

You have created an animation and want to make it into a final video format. Here are the steps -

Choose an output location for your animation under the Output Settings tab by clicking on "Output".

Set the Path to the folder where you want your output files to be saved, whether it is rendered as image files or a video file.

Before you make a video file of your animation, it is a good idea to render it as an Image Sequence first. If you render it directly to a video file, you can't stop/pause the render or there is a chance that you will get a corrupted file and have to render all of the frames all over again. Having an image sequence will allow you to experiment with different formats for and settings for encoding to video.
(If you want to render directly to video without saving as images, skip to step 8)

When you have chosen an output directory for your Image Sequence, choose an Image Format.

On the main menu Select Render > Render Animation (or press the shortcut Ctrl + F12)

Blender will now start rendering the scene frames one by one.

When the rendering is finished you will have a lot of numbered images. To encode them as a single video file, start a new project and choose New > Video Editing.

On the Sequencer window, click on Add > Image Sequence

Select all of the image files of your animation with A and click on "Add image strip".

In the Properties Window now select FFmpeg video as File format.

A new tab will appear with Encoding options.
There you can select the Container and the Codec for the output video file.
Container is the file format for the file, (Mov, Avi, Ogg, MP4, to name a few) sometimes is referred as a "wrapper".
Codec (short for Compression-Decompression) Is how the image is compressed. The picture quality, file size and processing power needed to view the file are largely determined by the kind of codec used and the settings used for it.

On the main menu Select Render > Render Animation (or press the shortcut Ctrl + F12)

The result of this will be a video file.
----------
For older versions of blender (previous to 2.79)
The options to choose formats are like this:

Choose a video format for your animation here:

The Render Animation" is located in "Render" tab.
To open the video editor click on "Choose screen layout" and then "Video Editing".


Add nodes to a custom node tree I have a custom node tree called MyCustomTreeType. I know that there are scripts to add nodes to the composite and material node trees: Controling compositor by python

How can I use this with my custom tree?

The example of the custom PyNode tree includes information about how to add nodes to the menus via NodeCategory so i'm going to assume you've got menus working.

(if not: see TextEditor > Templates > Python > Custom Nodes )

If you want to add a node via python, it's the same as with shader trees or compositor trees, except you use data.node_groups.

ng = bpy.data.node_groups['MyNodeTree']
new_node = ng.nodes.new(your_nodes_bl_idname)
new_node.location = (20, 40)


Blender 3D 2.75a Beveling Tool Issue I have a a problem with the Blender 3D Beveling Tool. I have it set up to bevel any edge with a weight of 1. This way I can select the specific edges I want beveled on my project. However I'm unable to Bevel the bottom edge and I'm not sure why.

When I select the bottom edge and move its weight to 1, I end up with this

So I'm not sure what I'm doing wrong. I started this object out as several Planes that I connected together. Does anyone see something I'm just failing to take into account? Here is a screenshot of the Bevel Settings

Any advice would be greatly appreciated. Just can't figure out why its working on the side as shown in the first picture and not the bottom. The Screenshot shows the profile as 1.0 however its actually .99

Additionally I am using Blender 2.75a. for whatever reason I cannot mark it as a tag.

The stripey effect near the corner (known as z-fighting) would indicate multiple faces in the same location.

In edit mode select all vertices then remove doubles. You can find remove doubles in the specials menu W or in Mesh -> Vertices -> Remove Doubles


Smoke Simulation - Not visualized all over the wanted area I am at my first experimenting with smoke simulations.  I managed to get the effect I wanted but when I start rendering smoke does not seem to be rendering all over the area I want.   Under all the arches of the building, you see below.  What is more strange is that if I zoom in at the angle you see in the screenshot the visualized area increases the more I zoom in.

I am suspecting that I have unwantedly clicked a world setting or something similar since I noticed the same problem with the plain I have as the ground of this scene I am trying to create.

Thanks in advance for any help given.

I believe you need to increase the volumetrics clipping end distance. It is in the rendering properties (where you choose between Eevee and Cycles) and then in the Volumetrics foldout :

Be aware that the precision of the particles in the simulation may be affected by that setting. If the simulation is taking place far away you can also increase the clip start distance to narrow down the clipping volume.


How to bevel a concave edge? I would like to "Bevel the face", like so:

I would like the result to be like the one below created by scaling new edge-loops cut by hand and so not very precise.

If is it possible to do so with a modifier and not via geometry would be amazing.

You can add another loopcut and bevel it.

Add a loopcut to the upper part
Add a Bevel modifier (limited to that loop)
Scale the loopcut down and adjust the bevel

I limited the bevel by Weight, but you can also use vertex group


How to get rid of the space between the edge of the camera render area and the actual viewport? For some unknown reason, blender decided to put an enormous space between the edge of the viewport and the render area of the camera (see image). How  do I get rid of this? I increased the resolution of the render and the scaling, but it seems to do nothing at all. I also changed the focal length of the camera and tried to zoom in and out. Nothing.

Also, this appears to be the default way the camera is set up on every blender scene. How can I change the defaults too ?

You have a View Lock on the camera to view enabled.

Hit the N key and look for the checkbox title Lock camera to view, it might be one of the others but I suspect this is the guilty setting.

This is a known issue for newcomers to blender, but it is actively being worked on, you can read more about improvements relating to these controls on ‘Lock Camera To View’… It was torture to find it!

The fact that you have this happening in all blend files suggest that at some point this had been enabled and has been saved into your startup.blend file, meaning that you need to save your startup file after you've fixed the issue ( but now you know how, so it won't be a problem right? ).


How to fold a disk into a cylinder while the edge are touching I am really new to blender and I am looking to do modeling. How I can show a circular disk folds into becoming a hollow cylinder?

Let's try this:

Create a cylinder (Fill Type > Ngon), rotate it so it faces the view, apply the rotation with a ctrl A.
In Edit mode, inset with i.
Inset again and alt M > Merge at Center.
Create some edge loops with ctrl R to add some topology.
Give your object a Simple Deform modifier, Bend mode, with a 360° Deform Angle.
Give it a Subdivision Surface modifier, press the Smooth Shading button on the Tools panel.
To give your object some thickness you can add a Solidify modifier, put it above your Subdivision Surface modifier, and choose the Thickness value that suits you.
To have a sharp edge make sure to have an edge loop close to the edge.


How should an animated character be moved while repeating a walk cycle? I created a walk cycle as an action, placed it in the NLA editor and repeated the cycle.

For each repetition the character jumps back to the starting position, what are some options to move the character forward? (The ending position should be starting position of the following repetition of the action).

Starting position:

Walking until last frame of action the same action should follow but the position jumps back to the origin. (Same as image 1 except current frame has advanced)

I also tried in the NLA editor (same effect as above):

For each cycle, make sure the support foot (one that's planted to the ground) moves back in linear speed. Use Set Keyframe Interpolation T > Linear for the support foot's first keyframe. You should also know the distance it moves back. Just Ctrl-drag (snap to increment) so the distance value is easy to reproduce, no need for guesswork.

Next, move the root bone, at the same distance, also in linear speed. Here's an example before moving the root bone, using David Rodriguez's Carmen rig (box moved linearly, standing in as the ground):

and after moving it [GIF] (box still as ground), and the animation's graph:

Support foot's position within the cycle represents how far the ground "moves". By moving it at linear speed, with known distance, it's easy to move the root bone in a way that will counter the support foot's.

NLA-based Walkcycle

The workflow is also applicable for non-linear animation, with slight difference. Create a separate action data for root bone's animation, put it above the walkcycle track:

Though the walkcycle's action is the same, the root bone's need to be extrapolated linearly. For the root bone's action, execute Channel > Extrapolation Mode Shift-E, and select Linear Extrapolation. That way, the root bone's animation strip only needs to be scaled to match the walkcycle's, no matter how long is repeated.


Why do vertices move when 'Smooth Vertex' is applied to mesh? I'm having a problem when my meshes exported (to FBX) whereby Blender will smooth the model down.
To replicate the same problem I used Smooth Vertex and as you can see from the before and after the verteces on the barrel have moved. When I import the mesh into UE4 the problem is a lot worse with segments of the mesh completely missing. Its probably down to a fault of my own but this is my first ever modelling project so I'm still learning.

UE4 also displayed this warning message when I imported the FBX mesh.

Warning: No smoothing group information was found in this FBX scene.  Please make sure to enable the 'Export Smoothing Groups' option in the FBX Exporter plug-in before exporting the file.  Even for tools that don't support smoothing groups, the FBX Exporter will generate appropriate smoothing data at export-time so that correct vertex normals can be inferred while importing.

Any ideas as to why this may be happening would be greatly appreciated.

when exporting to FBX, Blender looks at the Modifier Stack of each object and applies the RENDER modifiers to the object. I can only guess without checking the file, but I suspect that you have a SubSurf modifier on your geometry.

Uncheck the Render Visibility (red arrow is pointing at it in the screenshot) and export again, it should be fine then.


How to display the edges of a mesh while in Object mode? I sometimes like to view my models in wireframe mode, but it doesn't show individual faces, only lines representing the general formation of the object. With subdivisions (especially) this does not achieve what I'd really like to see, which is more of a "blueprint" look.
Solid view:

Wireframe:

What I want (except this is solid):

What I want (except, this is edit mode, not an actual drawmode):

Is there a draw mode that can achieve this?
P.S.: I don't mind if the answer uses Python. I'm not a Python programmer but I'd be able to understand the code (I've got programming experience and have used Python on and off before).

If I understand your question right, then you just need to enable Draw All Edges and Wire under the Object properties.

Wire draws all edges in the mesh that are not coplanar (edges not lying on the same mathematical plane). Draw All Edges draws these coplanar edges in wire display and wireframe mode.


Can I incorporate audio into my output avi render? I am using blenders video sequence editor to put together a video with overdubbed audio.

I have dragged a video clip and and audio clip into the sequence editor. BUt when I render, it is only rendered without sound. When I go to the Properties>Render>Audio, it just gives me the opportunity to output an audio file.

Is there a way to have it render a single video file with audio?

That's perfectly fine. This Button Audio does, what it says, it "Mixes the scene's audio to a sound file". It does mix down actually all Audio Strips into one which you have placed inside the set Frame Range in the VSE.

When you want to render out a Video File, you have to hit the Animation Button. It will render out your active "Scene".

Though in the Post Processing Panel you can check (which is by default) to process everything through the VSE. This is obligatory for the Audio MixDown as there is the only place to import Audio Files (or Movie Files containing one Audio Strip). These will be used during your Playback as well.

When you want to have a Video file as output with sound, you have to use the Animation Button while having an Audio Strip placed as described above and having your File Format set to a Movie Option (like H.264).

AND very important: you have to choose an Audio Codec in the Encoding Panel which comes available once you choose a Movie File Format like AAC or MP3.

This is set to None by default which would result in a Video file without sound even though you placed one in the VSE properly when hitting the magical Animation Button (Ctrl F12).


How do I use CTRL-R to cut all the way through an object, not just one face? Can you please tell me if there is a handy shortcut or hotkey using CtrlR or the knife tool to cut ALL the way through an object and not just it's face? I want to make a simple cut to make the tape follow the form of the bottle.

The knife tool will work in this situation. After pressing K, hit Z, which will put it in cut through mode.


Location change of child as gaming mode activated I have two cylinders, one is the puck, other is the handle. The handle is child of the puck. They both have dynamic physics.
I use python to define their motion.
As soon as I hit p and enter gaming/testing mode, their locations are changed. But the handle has more dramatical location change than the puck.

Here is two photos of before and after hitting p:

Before:

After:

I cannot figure out why this sudden change of location and getting compressed in y direction.

Here is my script:

import bge

def main():
    cont = bge.logic.getCurrentController()
    scene = bge.logic.getCurrentScene()
    keyboard = bge.logic.keyboard
    puck = cont.owner

    # sensors
    bottom_edge_collision = cont.sensors["bottom_edge"]

    # keys
    r_pressed = bge.logic.KX_INPUT_JUST_ACTIVATED == keyboard.events[bge.events.RKEY]

    if r_pressed:
        scene.restart()
        print("rsrt", puck.localPosition)

main()

Here is my blend file:
https://drive.google.com/drive/folders/1dcXSZ7HHZH9h8f6KFJWUsVmuRl69o6bd?usp=sharing

Without seeing your blend file we can only guess. The most likely candidate is a non-unit scale. Select the objects, press CTRL+A and choose "Scale". This applies the object-level scale factor to the mesh itself, and resets the object-level scale to (1, 1, 1).


mirror modifier for animations? I'm a bit new so maybe this feature exists but i couldn't find it.

But while i'm trying to animate simple things such as a walk or run cycle i find myself frequently ctrl-c, ctrl(-shift)-v-ing the first frame of the animation towards the end of the animation.

Is it possible, maybe somewhat like the way you use modifiers to mirror meshes to
 use something like modifiers to mirror/copy your keyframes as well, so you don't constantly hace to copy and paste to update the second half of your animation?

You can use F-Curve modifiers in the graph editor. Specifically what you would want is a cycles modifier with the cycle mode set to repeat mirrored.

Here is the documentation


How to group nodes in Sverchok? From node tree type, I can easily group nodes by easily add Frame (layout>frame). However I use Sverchok add one in which there is no such layout like node tree type at all.

Select the nodes you want to group and click Create a node group .
To put nodes in a frame select them then hit Shift+P .


Portions of my mesh seem to be locked in place and can't be moved, rotated or scaled. How do I fix this? So I've been making a human model in blender from scratch. While I was working on the hands, I've suddenly been unable to move, rotate or scale the rest of the mesh. I've seen suggestions that the Transform options need to be unchecked, which has been the case. I'm having trouble finding any other potential solutions, since my issue only cause a majority of my mesh to be unmovable. I am able to move the object as a whole around in object mode, but that's it. An example of this is when I go into edit mode and select the entire mesh and try to move it around. Only the unfixed portion of the hand moves, everything else is stationary. I can't sculpt on those fixed portions either. None of this was an issue a couple days ago when I modeling the rest of the body, but now it's suddenly a problem.
I appreciate any help I can get to solve this issue.

Managed to figure out what the problem was. I noticed that when I selected the faces or edges of the 'fixed' portion of my mesh, the transform panel stated that nothing was selected. Eventually I tried unhiding the mesh, which seemed to fix the issue and allowed me to manipulate the rest of the mesh again. Normally when you hide portions of the mesh, they don't appear visually on the screen, so I had not expected that to be the solution when the entire mesh was visible. Rehiding a portion of the mesh properly hides those faces so I have no idea why I could see them in the first place.


Rendering a video sequence does not Display I am using Blender to edit my videos, and I've run into a snag. Whenever I try to render the animation, It will only display as black.

My .blend data:
https://www.mediafire.com/?cb9u9lyzzj3mu2f

Does anyone know what's the problem and how to solve it?

If you go under the render tab, go down under post-processing and un-check the compositing pipeline and select the sequencing pipeline. Then try.


Why are all the movie clips I import into the compositor not working? When I import a movie clip into the compositor in blender, it shows up in the backdrop as completely transparent, showing the black and grey tile pattern to signify a transparent image. Anybody know why this might be happening? Any help would be greatly appreciated. I've attached the blend file below. (Ignore all the nodes that aren't connected to the viewer node. I'm only concerned with the movie clip connected to the viewer node)

I had the frame range set to the wrong set of frames.


How to change the Viewpoint Shading like in older Blender versions I'm modelling only with textures and vertex collours, since all the extra shading and effects are game-specific and are done within the level editor (not in Blender).
In older versions of Blender, i only used the viewpoints Texture, Solid, Wireframe and Bounding Box.
Texture View let me see the model with vertex collours and textures without any extra shading. It showed it exactly, how it would be exported/appear in the game.
The Wireframe and Bounding Box viewpoints let me see the model in Vertex Paint without textures and only with vertex collours.
Now in the newer versions of Blender, i can't find any option to see my model only with vertex collours and textures. In solid view options, i can only see either vertex collours or textures, not both at the same time, and there is always extra shading there. Only the Vertex Paint let me see the model with both, but when switching to Object Mode, it's gone.
Is there any way to get the shading view to work, like it did in older Blender versions?

You seems to be correct - with Flat type Lightning you can use Texture or Vertex Paint only, if you want use Workbench.
I wanted to use Material type, but it reflects only Viewport Display setup (single RGB Color).
So the only one way I see is use Eevee material.
Plug Vertex Color node and Image texture node into Mix RGB node, than directly into Output without any shader.
To see colours untouched you should change Color Management > Standard.


Aperture Diaphragm in Blender 2.8 Blender Newbie here.

I looked for a way to model an aperture lens and found this question: How do I rig each blade to fan out like an aperture lens?

The questions has been answered very well (Thanks Carlo) but when I try to redo this in Blender 2.8 I'm stuck at the following point (yes, right in the beginning).

I have created a triangle and a circle. The triangle is child of the circle. I activated Instancing on Verts because this is from what I understood the new "duplivert".
But, there is not "rotation" setting in Instancing and I have no idea how to rotate the instanced triangles so that they are pointing to the center.

Or is there a better way to achieve this?

I tried the array modifier but this need the Pivot Point to be in the center (and I need it elsewhere for the copy rotation constraint afterwards)

I tried spinning but this does not work at all for flat objects like a plane.

I really tried to find a solution for a few hours now and you are my last hope. :)

Thanks in advance for any hint.

EDIT:

Once I try to use Align to Vertex Normal it's getting out of hands. :)

Is there a way to adjust the vertex normal or what am I doing wrong?

It's still there, just the name is changed :).
Now it's called  Align to Vertex Normal ✓

When setting up the constraint, change Mix to Add.
Otherwise the triangles won't line up later.

You can add the constraint to other objects using Object > Constraint > Copy Constraints. Just make sure, the constraint isn't on the circle itself :).


Blender Video Editor: Clip stays attached to cursor after releasing left click during drag I am having a problem with the blender sequence editor and editing clips. Whenever I want to move a clip or trim it, I would hold left click (I set it as left click) to trim/move the clip but when I stop holding left click, the clip or end of the clip still stays attached to my cursor until I click again. Is there a way to set this so that I don't have to click 2 times to trim/move a clip and instead just drag them?

With the clip selected, you can hit 'g' to move (just like the 3D view, the Graph Editor, the Node editor, etc) and use your mouse to reposition the sequence. When you are finished, left-click to accept, or right-click to undo.

I think you will find that this is very easy to use, and, even better (because it is exactly like the rest of blender) it is also easy to remember.


How to compare three (or n) values and output the minimum value using nodes I want to compare three values (RGB) and then pass the minimum (or maximum) along the node chain. For instance an input of (100,50,255) would output 50. The math node only allows you to pass along one value for comparison.
Does anyone know how I could accomplish this?
Thanks much.

Shader nodes?  SeparateXYZ (or SeparateRGB, it doesn't matter, they do the same thing) and then run serial minimum operations:

Dividing by 255, because your numbers suggest you're interpreting color as values in 0,255 when Blender interprets colors as 0,1.
Serial maximum operations will work the same way.
If you want to, you can node group all of that stuff to make a MinimumVec node group, for easy reuse.


report error , menu not found I am getting Report error menu not found when I right click in edit mode to get the vertex content menu.
I deleted blender and reinstalled and I am having the same problem , would really appreciated any tip to solve this.
I am using Blender 2.91.2 on a Macbook pro 10.7.15 Catalina

Ok guys solved it:)!  I just  loaded factory settings inside blender preference.
Click Edit choose  Preference
Press on hamburger menu at the bottom left and choose load factory preferences.


How can I make a dropdown box of materials and run code when one is selected? How would I go about making a property box that contained all the materials in a scene (in a Toolshelf (T) panel for example) and is able to pass the material in the list to another operator that assigned the material that was selected in the property box?

Use pointers.
EDIT, having a property to keep the name, and use in a property search has IMO been superseded by assigning a pointer property with a poll in later (circa late 2.79 and beyond).
Example, select from and assign a property to a material of all non grease pencil materials in blend :
Custom search data to UILayout.prop_search

Finding only the materials in the scene would be doable (make a set of all materials of all objects in scene)  but is probably not necessary, instead suggest using bpy.data.materials the list of all materials in the file.
EDIT: However have done this here
How to populate UIList with all material slot in scene? 2.8
A UILayout.prop_search can be used as a UI to assign a material's name to a string property.
import bpy
from bpy.props import StringProperty

class LayoutDemoPanel(bpy.types.Panel):
    bl_label = "Set Active Material"
    bl_idname = "OBJECT_PT_example"
    bl_space_type = 'VIEW_3D'
    bl_region_type = "TOOLS"
    bl_category = 'Materials'

    @classmethod
    def poll(cls, context):
        return len(bpy.data.materials) > 0

    def draw(self, context):
        layout = self.layout

        scene = context.scene

        layout.prop_search(scene,
                           "selected_mat",
                           bpy.data,
                           "materials")

def register():
    bpy.types.Scene.selected_mat = StringProperty(default="None")
    bpy.utils.register_class(LayoutDemoPanel)

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

if __name__ == "__main__":
    register()

In an operator can use the property like so.
scene = context.scene
material = bpy.data.materials.get(scene.selected_mat)
if material is None:
    # no material has it been renamed?
    return {'CANCELLED'}
# do something with material


Create new file in Blender 2.79 I'm an absolute beginner in Blender.
I installed Blender 2.79,  when I want to create a new 2D animation file I couldn't perform this task.
I googled a lot but I couldn't find where is the problem.
I'm using Windows 10 - 32bit

That is normal behavior. Blender uses a template file, and to create a new document is to reload the template file. From the manual: "New (Ctrl-N): Clears the current scene and loads startup.blend."
Blender 2.79 is not the most recent release, and more recent releases of Blender have changed the phrasing of this menu option and it now gives a choice of templates.
The latest 2.9 release is available here: https://www.blender.org/download/
And the Long Term Support release of 2.83 is here: https://www.blender.org/download/lts/


My script incorrectly adds 1 extra int to game propert, why? been spending this whole day trying to figure out why
my script adds 1 extra (wrongfully) int to the property 'score'.
All code works, excepts that the IF statement adds one extra int, messing up the score since only one int should be added.

I'm a newbie to scripting so an answer would be beautiful.
Thanks

Your keyboard sensors will keep triggering while the key is pressed, possibly triggering your script twice or more for a single key press. To solve this, enable the "Tap" button so that it only triggers once for a press.

I can also recommend reading up on PEP 8 -- Style Guide for Python Code. It gives you guidance on naming conventions; following it makes it easier to collaborate with others, and also makes it easier for us to understand your code and help you with issues.


Blender EEVEE render engine not working The material shader is not showing or not able to change. Only blank black shader is visible. blender 2.8 test release.

Blender 2.8 is still under development and until the official release is made there are many things that will not work correctly.

Information about reporting bugs in Blender can be found here:
https://wiki.blender.org/index.php/Dev:Doc/Process/Bug_Reports


Alpha over layers but maintain environment background I have a scene where I have a few different render layers that I need to put on top of each other for the final render. Everything works fine when I have transparent background checked for the render but I need to also have the environment background image behind everything. Also, the camera moves and displays different parts of the background, so I can't just alpha over everything on top of an image texture. Is this possible? Thanks in advance!

Enable Environment in the render layers.

Enable Film, transparent.

Then composite your layers with transparency together, and place them over the Environment using Alpha Over.


Plotting 3D Surfaces Building on from my previous question, how can I plot something more complex than a sphere (and not as easy to split into a set of parametric equations)?

Say, for example

$$2x^2+y^2-5z^2+z-7x=16$$

Graphed on Desmos (use the z-slider to change the z value) for those who cannot as easily visualize the 3D surface.

As far as I know, there isn't an add-on or method that can graph more complex mathematical functions in the way you want. As an alternative, you can put your equation into nodes and then render it with a Volume Scatter shader.

Begin with the default cube. Add a new material, and add a Texture Coordinate node (Shift + A > Input > Texture Coordinate) and Separate XYZ node (Shift + A > Converter > Separate XYZ):

Then, create your equation using Math nodes (Shift + A > Converter > Math). Here, I created your example equation:

Now, add a Color Mix node (Shift + A > Color > MixRGB) and set it to Multiply. Plug the texture coordinates in to one slot, and a Value node in to the other. This will scale our window:

Finally, multiply the output by 10 to increase the value, then plug it into the Density of a Volume Scatter and a Volume Absorption shader added together:

This will nicely display the function when rendered, though the shading isn't ideal:

click for larger image

To optimize rendering, change the following settings:

Although it doesn't give you a workable mesh, this can definitely give you a renderable graph.

We can also improve the look of it by coloring it:

click for larger image


How do I make a car model drivable? How can I animate a car driving? Is there a way to control the car like you would in a videogame?

Fully working car driving example can be downloaded from here:
https://www.blender.org/manual/game_engine/physics/types/vehicle.html

Just download the zip, open the .blend and hit P to drive.


Multiple similar functions mapped to one hotkey? First time posting to these forums. I am in the process of trying to learn Blender having come from a Max, then Maya centric workflow. I was wondering how difficult it would be to map a series of similar functions to a single key that can then cycle through them?
I tend to want to have as few hotkeys to remember as possible and have found that this was a good way to go about it. As an example, in Maya, I have one hotkey that cycles through transform modes, and another that handles axis constraints. In theory, I could also create one that cycles through subobject modes.
Thanks.

Blender has a quick favorites menu, hotkey = q. To add operations to the quick favorites menu, simply right click on the operation and choose add to quick favorites.
For example, let's say I want the add mesh operation to be in my quick favorites menu:
Now when I hit q this is what I see.


Understanding the nature of a Blender render New to Blender, and reading the docs, I can't seem to get a good "real world" explanation of what a 'render' actually is:

Is a render a 2D image (sort of like snapping a photo of a 3D scene from a specific viewpoint/orientation/position), or is a render a full-bore 3D model?
Is the render an actual file (if so, what is its file extension, as opposed to the *.blend unrendered model file), or is it something that only lives in memory?
If Blender is used to create assets/models for use in games, I've heard of several game engines that have rendering capabilities. So, in the context of games, what's the typical flow: are assets rendered in Blender, and then saved & used by the game engines (already pre-rendered)? Or are the assets left as unrendered *.blend files, which then get used by the game engine, leaving the engine responsible for performing the render?

A render is exactly as you say in your first bullet point; a render is a snapshot (or series of snapshots for animations) of the scene taken by the scene's camera, saved as either an image, a sequence of images or a video. The file format will be whichever format you save it in e.g. JPG or PNGs etc. for images or MP4 or MOV etc. for videos.

The process of creating this render is rendering, which is where the renderer - Blender Render, Cycles or an external render engine - calculates what colour each pixel should be based on how light is travelling through the 3D scene and interacting with the surfaces, materials and textures on the objects. This can be an intensive process, particularly for animations where a render has to be done for each frame of animation.

For a 3D game, game engines will need the 3D models and textures in a format it can read. Commonly, you would export your models from blender as 'FBX' or 'OBJ'. These files store the 3D models as a series of points (along with other data like bones, UV maps etc.). Textures would have to be provided separately and materials would have to be created using the game engine's own material editor as they are not compatible with Blender's own materials.
To get around this you might create materials in Blender and Bake them to a texture, which is a way of rendering a material into a texture so that you can use it in the game engine (though baking has many restrictions which may mean that using the game engine's materials and lighting is preferable).

Game engines perform a 'live' rendering where for each frame (update) of the game engine the materials and lighting have to be re-calculated. Depending on the complexity of the materials and models this can be an intensive process which is why high end hardware may be needed for this 'live' rendering.


Strange problem with mesh/normals/normals direction A strange problem with my mesh I have tried flipping normal's and Cleanup by distance but still have strange faces that don't smooth
Any ideas?
Its very visible with thickness mod added...
Physically there is nothing wrong with the mesh, quad based, clean and no overlapping faces or bad polls
I tried delete loose, flipping normals, set from faces (which made it worse)
A bit stick since I want to sculpt on it but with misbehaving normals that wont be possible...
I'm not sure what the blue lines mean but they seem related...
Clear sharp doesn't work though

Try making sure that there are not doubling vertexes,or split vertexes, you can use the merge by distance in the mesh/clean up menu.


(Beginner) Inset weight "extruding" faces individually Pardon the terminology in the title, just to be clear I don't want to extrude at all, but I have an inset I want to do following along with a tutorial where I have the back of an engine I'm modeling and I want to inset the faces a specific way.

With the weight its "extruding" the face individually (first picture) where I want the connected faces to "extrude" together as two connected faces, second picture.

I can't figure it out at all. Please help :(

I'm not entirely sure I understand.  First, I don't see any completed inset faces, only the state after extrusion (first that appears to be individual faces, the second that appears to be regions.)  Second, I'm not familiar with your use of the term "weight"; I'm used to it being used to talk about the extent to which a vertex belongs to a particular vertex group.

Note that it would be easy to get the first picture on accident if you have any doubled geometry, possibly by canceled extrusions.  First w->remove doubles.  Also note that extruding one checkered ring, and then extruding the second checkered ring, will get you the first picture, but extruding both together will get you the second.

Now, here's a default (region) extrusion similar to yours:

If I follow that up with inset faces, I'll get:

Now, maybe what you're talking about is using an inset follow by a scale; this is basically the same thing as an extrusion anyways.  Here's what happens if I inset with everything selected:

I can then move those faces any which way I'd like.  However, if I try to do this in two passes, or if I enable "individual" on the operator panel, I get

You'll notice that if I now try to move those faces, I'll end up with separate faces, as in your first pic.


Blender 2.8 change font in VSE there is much new features in the blender 2.8 beta> We've had text overlays in the VSE since 2.6. Does anyone have any new or current work arounds or official ways to get various fonts into the VSE?

2.8 now has font selection for the VSE and the change was backported to 2.7 branch as well.


How do you scale cloth simulations? I can't figure out what exactly to do with this, when I run the simulation at a smaller scale, everything is fine.

When I scale it by 10 it becomes strange, even though everything is aligned with the origin and the force field is a point and as such scale shouldn't affect it.

Which parameters need to be modified for it to scale correctly?

To get your simulation to work efficiently, you must first, save your .blend file, then bake the simulation. The bake settings are under the cache tab in the cloth settings. You will be able to scale it to whatever then.


PNGs in distance appear to overlap foreground PNGs when viewed at different angles Unless I'm doing something wrong, I think this is a bug.

Large PNGs imported as planes render strangely in both the viewport and final render (Eevee). I had this same issue in 2.80 and now using 2.81. Using Windows 10.

When seen face on (top image) things look good but when the angle to the plane is tighter (2nd image) you get distant PNGs which are technically behind objects appearing in front of them.

Most of these PNGs are 30,000 pixels wide, with an alpha mask.

I use the add-on import images as planes, and import with Emit setting (see shader node settings below). Blend mode: alpha blend.

I've uploaded a short video here. You can see the problems starting from 20 secs. Before then everything is fine.

Thanks.

The reason is that the "import image as plane" addon sets the material Blend Mode to "alpha blend" by default. Switching it to "opaque" resolves the issue.

How to solve this with "alpha blend" on is also open in my related question: Plane-object displayed in background while beeing in front (Eevee Viewport)


Subdivision + Solidify + Bridge Edge Loop I try to create a chair following the youtube tutorial. Could you guys tell me why the object seems like broken, not a smooth rectangle after I use solidify. Also, the same happen again when I use the modifier in order Solidify > Subdivision and then Bridge Edge Loop to connect two faces. Below images show the problems and the file link is also added Blender file. Appreciated if you can help me out of this trouble.

Your face orientation is causing this problem. To see face orientation you can check Face Orientation under Viewport Overlays tab. Blue is outside. Red is inside.

To solve this select your object and toggle to edit mode. Press a to select all. Then press Shift+n to Recalculate Outside. This fill flip normals that are inside-out. You can also select Mesh tab and from Normals select Recalculate Outside.


how to order the objects in the dope sheet Is there a way to order the objects in the dope sheet. I know you can move the channels up with the page up button and down with page down button. But this doesn't work with the objects, is there a way to do this?

As a workaround for more oversight, you could click the little arrow in the dopesheet footer (little arrow | ghost | rescue ring), to only display the currently selected objects. select different objects in the viewport or the outliner.


Strange anomalies with weight painting I've been trying to create a rig for my dragon character and I'm doing weight painting right now. However, some strange anomalies keep getting on my way.

Picture of the anomaly is too big and so I've added it as a link instead

When I select the vertex group of the bone, it can be seen that there are no other vertices selected on the other leg, which makes it really hard to understand.

Here's the same picture in weight paint mode and none vertices of the other leg are affected by the paint..

Looking at the gif, at least two other bones are moving when you move that shin bone. The most likely explanation for your issue is that you have parts of the other leg weighted to one of these bones.

Edit:
Another thing you could try is to set the armature modifier to deform the edit mode mesh, pose it so you get the deformed mesh and enter edit mode.
From there, select one or the deformed verts and open the right hand panel in the 3d view ('N' panel). One of the sections there lists all the vertex groups and their weights that apply to that vertex. This should help you track down where the problematic weighting is coming from.


An object disappears when I start the game engine. How do I fix this? I am working on a game, and one particular object disappears when I press "P" to start the game engine. The scene this problem is occurring in was copied from another scene, and this problem didn't happen in the original scene that I copied from. Changing the normals had no effect, invisibility is turned off in the physics, and this object has no keyframes. All the other objects in the scene are visible. I am using version 2.69 of Blender. Any solutions you can provide would be greatly appreciated.

The object might be located somewhere else. So it is not visible to the camera.

Check the existence and the location with this code:

import bge

name = "Cube"

object = bge.logic.getCurrentScene().objects[name]
print("Object", object.name, "is at", object.worldPosition)


When I open my project all shadows have gone I am using blender 2.9 am creating a room with chocofur model manager for furniture, etc, it looked nice with all the shadows and lighting but I have saved it every step of the way, but now when I open it all shadows have gone and nothing happens when I try to add the process again. I have watched tutorial again and again and everything is right.

I don't have enough reputation to comment, sorry.
In addition to Christopher Bennet's comment (making sure you are in the rendered viewport, Z -> Rendered) I will suggest another possible cause for future readers.
In Eevee, one can turn off shadows manually for each light source. You can click on a light source in the outliner, go to object data properties (the light bulb). There you can select two checkboxes: Shadow and Contact shadows. Check if these have not been accidentally turned off.


how do i make the brush single? my brush on the sculpting menu every time i try to sculpt it makes a copy on the other side. i just want it to be single

as you can see you have the circle with the dot telling you were the mouse is to draw. but there's a secondary dot.

how do i get rid of it so i can make a single sculpt without it duplicating on the other side

It is mirror. In tool settings deactivate this option by pressing button X:

If you haven't this toolbar, enable it in menu View -> Tool Settings


bpy remove duplicate images (.001 .002 .003 etc.) I have this script, but its not working as expected

import bpy

for img in bpy.data.images:
    print("%s" % img.name)
    if( ".0" in img.name):
        img.name=img.name[:-4]
        print("%s" % img.name)

I want to have one texture on different materials, now i have something like this

Edit: Solved.

for mat in bpy.data.materials:
    if mat.node_tree:
        for n in mat.node_tree.nodes:
            if n.type == 'TEX_IMAGE':
                if n.image is none:
                    print(mat.name,'has an image node with no image')
                elif n.image.name[-3:].isdigit():
                    n.image = bpy.data.images[n.image.name[:-4]]

for imgs in bpy.data.images:
    if imgs.name[-3:].isdigit():
        print(imgs.name)
        imgs.user_clear()

Thanks to all who helped.

img.name=img.name[:-4] is renaming the image to match the original image name, as this name already exists a numeric suffix is added to the other image with that name, which just undoes the change.
You need to go through your material nodes and get each image node to use the same image.
for mat in bpy.data.materials:
    if mat.node_tree:
        for n in mat.node_tree.nodes:
            if n.type == 'TEX_IMAGE':
                if n.image is None:
                    print(mat.name,'has an image node with no image')
                elif n.image.name[-3:].isdigit():
                    n.image = bpy.data.images[n.image.name[:-4]]

Note that the last line doesn't just change the name used, it changes the image data block that the image node is linked to.
Once you have removed the users of the duplicate images they will be removed after you save and re-open the file.


Can't see textures on imported .fbx model I've downloaded a .fbx model from Sketchfab along with a folder with several textures contained in .png files. I am not sure how to load the textures after importing into Blender. All of the models show up black. There are several options under "Material Properties" to choose from, but when I select one and connect it to a .png texture file via "Base Color," nothing happens:

I am new to Blender but seemingly understand the basics of how textures/materials work. Still, I wouldn't be surprised if I'm missing something simple.

Duarte's comment got me to google some more, and I found someone who recommended replacing the Principled BSDF node in the Shader Editor with a Diffuse BSDF. This fixed it:

Happy to get it working, although to be honest, I'm not sure why this worked.


How to disable AO on smooth edges, but keep it enabled on sharp edges? I'm creating a scene, and I really like to use AO, because it adds some bonus detail to the final render. But in most of the cases it ruins the smooth feeling for smooth edges. I have marked sharp edges everywhere, where I wanted sharp edges, to make sure they will look just cool, and the AO looks good on them, not like on smooth edges. I'll attach a few examples:

Adding an EdgeSplit modifier before a Subdivision Surface instead of doing autosmooth seems to alleviate the problem. Dirty, I know...


Cycles Subsurface shader: GPU compute and CPU compute give totally different results Blender 2.67
Windows 7
Geforce gtx460

Head model with subsurface scattering and one texture
Cpu render - fine, but slow.
gpu render - face comes out black! (it was working at first it changed for some reason)

any suggestions? why should this happen.

Here is an image of the problem

The SSS shader has not been implemented for GPU rendering yet. It will always render black.
Update: SSS now works on GPU, so they should look the same.

If you're looking for quick renders, SSS is not a good idea. If you can get away with a simple Diffuse BSDF shader with a bit of Translucent BSDF, that'd be great.


Model does not impact the the surface to make a wave I have a problem with making the wave after moving object which I imported, it is 'ship.obj'.
I can move object and etc. but I can not make a wave effect described here.
When I use for this an object like cube (add cube) everything works perfect but I don't know why it doesn't work with the imported model.

The wave dynamics are in relation to a Mesh Volume which is why the cube is working. The geometry of the yacht hull are only planes. If you made a mesh with volume it works just fine.

Select the 'Hull-Cube' and press "/" to go into local view. In edit mode press W to remove doubles, which will remove a lot of doubles. Select all the top vertices and press F to fill. The back vertices and fill. Now you have a Mesh Volume.

Happy sailing!


Is there a reason why handler functions are added differently from custom driver functions? If I add a handler, I use:

bpy.app.handlers.handlertype.append(captainFuture)

If I want to remove it, I usually use the cheap way out since I still haven't learned to do it properly (I was young and I needed the money):

bpy.app.handlers.handlertype.clear()

Usable hack on a remote island but if by chance any addon or script uses the same handler, then disaster ensues.

Now, with drivers it's so much easier for this addled brain of mine:

Creation:

bpy.app.driver_namespace['curtis'] = captainFuture

Deletion:

del(bpy.app.driver_namespace['curtis'])

Nothing to remember but a string and a location.

Is there a binding reason why both approaches are different? Or asked differently and selfishly: Why not use dictionaries all the time?

Handlers are callback handlers that work on application level. Drivers work on data level. What does this mean?

app.handlers also work without having any data to work with. For drivers you will always need to add the driver to existing data in blender. For example an attribute on your object.

The app.driver_namespace contains some value modification functions you can use within your drivers. By itself it doesn't do a thing. It needs to be triggered by the animation system.

def mul2(value): return value*2
bpy.app.driver_namespace['my_function'] = mul2

Now you can use this function inside a driver python expression

#my_function(var)


How to randomize holes in a mesh, like with a particle system? I'm building a bush that has been ravaged by caterpillars. I am working with a set of leaves, see attached image, and some of them I have created holes in the mesh, you can see in the mesh which is selected in Edit mode.

I'm trying to figure out a workflow to generate the holes randomly - sizes, location, shape - in the mesh. Thereby limiting the base set of leaves. I'm seeking a workflow similar to how you would add raindrops on leaves using a particle system: create a droplet; Particle: Hair; Render As: Object etc...

Can you think of a clever method to achieve this?

It doesn't necessarily need to affect the mesh itself, but just the transparency (transmission) for render.

The answer to this question suggests a workflow using micro-displacements, that might be a good starting point ... not sure.  Maybe creating a texture with the holes, that can be UV mapped ... thinking out loud. Keep in mind the leaves already have a texture mapped onto them, and a solidify modifier with Subsurf Scattering in the material.

Grateful for any bright ideas you can share.

EDIT

An answer was offered to run a texture through the Alpha channel. It's close but not quite there yet. See the attached image for the setup.

The Base Leaf Texture is connected to Base Color - this has been unwrapped using 'U Project from view and placing the mesh on the image in UV editor.
This same image texture is used twice again with ColorRamps to influence Roughness input and Bump via Normal input.
As per the suggestion, I created a black and white texture file of leaf holes and this connects to the Alpha channel. (My understanding is that Alpha works with 1.0 = White = Opaque / 0.0 = Black = Transparent, hence the black and white image).

You can see this sort of works.

The issues:

This method is not random, the texture is the same on duplicates. (Might I perhaps use a larger file for the leaf holes and somehow manipulate it with an empty...?)
This method is indiscriminate on the leaf, I need to restrict the pattern of holes from affecting the stem  (Can this be done with texture paint - or weight paint - multiple textures onto an object? So the mesh can be unwrapped onto the Base Color image texture and the pattern of holes image texture for the Alpha channel be selectively painted? Can you explain how?) This still doesn't affect the randomness of the holes.
Finally there is an artifact in the cycles render, the 'holes' are dark transparent grey in accordance with the shape of the mesh rather than completely invisible. (See final attached image for the Cycles render).

Further clues are greatly appreciated. Sincere thanks for your efforts.

What about using the Alpha channel on the texture? Create a random noise texture (or any pattern you want) and plug it in the Alpha channel. I think that the effect should be believable enough.

I would then add a simple bump map in addition to that, so the corners of the whole are a bit smoothed.

EDIT:

So obviously you need to play around a bit with the generated textures, but this is the way I'd approach it. Here is a sample:

This looks stupid because I didn't use a leaf texture or the proper model, but I think it would look quite good on yours, and it's completely procedural, so it will be randomly generated automatically and you can define and keyframe the size.

I've added a small gradient so the leaf gets browner closer to the wholes (you could blend this with a nice brown leaf texture), and a bump map, so the holes don't have a completely hard border.

This is the node setup:

Hope that helps.


Painting problem when using pen in Blender I've been using Blender for years. This is my first time to experience it on a 2in1 PC (HP Pavilion x360). This machine has a pen which works perfectly in any app except Blender.

Whenever I tap the screen with the pen on a surface to paint (in UV/Image Editor or 3D View, no matter), it just doesn't start. When I drag the pen a little bit, then it starts drawing. Interestingly, the distance between the point I click and the point it starts drawing seems equal to length of the radius which appears in Win10 when holding pen to emulate right-click. I disabled holding option for right-click but the problem still exists. (This happens also when sculpting or painting weights.)

In Krita or GIMP, I don't experience this kind of issue. It just starts painting the moment I touch the stylus on screen.

I really want and prefer to use this pen in Blender rather than a mouse. How can I solve this problem? Can I decrease or totally disable required length of dragging that tells the system I'm not holding? (as I said disabling it in Control Panel doesn't work.) Or is there any way to make Win10 to treat Blender's window as in Krita's or GIMP's?

I'm back. Believe me or not I've been looking for a solution for weeks but I found a solution today just a few hours after I posted this question. So, now I'm sharing it:

Because of one of the updates, Win10 doesn't treat legacy apps and modern apps which specifically designed for pen in the same way anymore. I think this is why I have never faced any issue in many apps (such as Krita and GIMP) but Blender. (Blender is legacy but not GIMP? LOL I don't get it, too.) There is a way to disable this behavior.

Solution

Run cmd
Type this and enter: reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Pen /v LegacyPenInteractionModel /t REG_DWORD /d 1 /f

This will make it! If you have any problem with pen in future and want to go back use this command: reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Pen /v LegacyPenInteractionModel /t REG_DWORD /d 0 /f

Btw, yes... it really is a BIG mistake not to put an option for this in the control panel. I wanna swear to Microsoft but I don't know if it's allowed here. So... shame on you MS! It took me weeks to just find this solution.

[Source: https://www.reddit.com/r/Windowsink/comments/8508fi/controlling_pen_behavior_in_windows_10/ ]

Edit

Addition:

It seems this command breaks pressure sensitivity. I solved it as well:

Go back with second command I mentioned above
Run regedit and go to HKEY_CURRENT_USER\Software\Microsoft\Wisp\Touch, set PanningDisabled to 1.
If there still is any issue, install/repair WinTab (https://www.microsoft.com/en-us/download/details.aspx?id=49498 download and install Wintab_x32_1.0.0.20.zip or Wintab_x64_1.0.0.20.zip depending your system arch)
If it still occurs, go run first command again.

Now, I can draw without any latency and pressure sensitivity works perfectly!


how to move all 4 corner individually I have a empty and with array modifier. Im moving. how to move all 4 corner individually .
And i have 4 corner only 3 are moving. Any suggestion how to move all 4 corner same position.

What you're trying seems hard to do with the Array modifier, you could try with the Mirror modifier, and use an empty as Object:


Get/display the animation runtime fps in python I want to know how I can access the animation runtime fps from python to display it in the console.

The last time I looked at this there was no way to directly get the value directly from a property of the API.

You can emulate it with a frame change handler, here is some test code that prints the approx fps to console.

import bpy
import time

t0 = -1
def timer(scene):
    global t0
    t1 = time.clock()
    fps = scene.render.fps  / scene.render.fps_base
    ms = 1000 * (t1 - t0)
    fps = min(fps, (1000 / ms))
    print("FPS:", fps)
    t0 = t1

bpy.app.handlers.frame_change_post.append(timer)


Child Of Constraint Set Inverse with Python When I try to use the "set inverse" operator in python there comes an error that it missed a context called "constraint". But I did it exactly like in the Info Panel.

bpy.ops.constraint.childof_set_inverse(constraint="Child Of", owner='BONE')

The Name of the constraint is correct and the also the owner

You need to specify the context and also make sure the bone is active:

import bpy

pbone = bpy.context.active_object.pose.bones["Bone_name"]

context_copy = bpy.context.copy()
context_copy["constraint"] = pbone.constraints["Child Of"]
bpy.context.active_object.data.bones.active = pbone.bone
bpy.ops.constraint.childof_set_inverse(context_copy, constraint="Child Of", owner='BONE')

If the constraint is targeting object + vertex_group instead of armature + bone, make sure the data of the object is updated before setting the inverse. This is for example needed if the target vertex group was also generated by code:

mesh_ob.update_tag({'DATA'})

If not updated entering edit-mode of the mesh or armature will reset the set-inverse.


How to set Output path correctly for a Single Image render? I know this is such a basic question, hence I cannot find similar question to this.

I've set up Render Output file in Preferences and Clicked Save Preferences:

But after rendering nothing appears in the folder. Why?

I've found this other question, for blender 2.7, but my Render Panel has no option to put a Render Output Path:

As Answer from this post suggests:

How can I change the default render directory to a relative directory?

But my Render Panel does not have that option:

Plus:

I'd like to set the width and height of my rendered image to: 1200 * 628 (for a Facebook PPL). How do I do that so it is the default size output?

UPDATE 1

Still cannot see any image in my path:

I've change the path, should I do something else?

If you are Rendering single image Image using the Render> Render Image menu or f12, Blender will not save the image automatically.

You have to save it manually, by clicking Image option located at the left of Render Result dropdown and select Save as (or press Shift+s while in the image editor).

A new window will open where you can choose where to save the file.

If you want to save the image automatically you can render as animation.

Set the frame range to a single frame.

Then render using the Render animation option or F12.

Note that 2.8 has different panel for output.

Dimensions and frame range can be set there as well.


Cubic bezier and cubic hermite interpolation for FCurves I am writing a custom import/export addon for a model file format that supports animations for cameras with cubic hermite and cubic bezier interpolation. Is it somehow possible to emulate the same interpolation effect using Blender's FCurves which appear to only support quadric bezier interpolation?

Blender also supports cubic (3rd order) curves.

Hermite curves can be converted into Bézier curves with a bit of math. From the two control points and the derivative at those points you can compute the two other points to complete the Bézier curve. More info can be found at https://pomax.github.io/bezierinfo/#catmullconv


Clothing Not deforming in engine, using mesh deformer As you can see in Blender the clothes animates fine-ish, but in UE4 some parts don't seem to want to animate, i believe this is happening to more then just the shirt.

The mesh deform modifier is a custom piece of blender functionality and is not supported outside blender.

Only shape keys and the armature modifier are reasonable reliably supported in cross application use as methods of mesh deformation. These are the only ones supported in the fbx file format that I am aware of.


How do I make particles like the "flashing" ones in this YouTube video? I just want to know how to create this flashing effect. Specifically the lighting effect on the minecraft character's eyes. See an example at 0:14 in:

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

You can use a pass index for the material of the eyes, then use that to create a blur on the compositor.

More info on this answer


How do you change what object the node editor is editing? I'm a total noob to blender. I've tried to start using the node editor, but when I added the texture it went to the wrong object instead of the one I had selected when switching from object to edit mode. Closing and reopening node editor didn't work, either. How do I make it so it edits the object I want it to?

You need to make sure you are not in the "World" node settings and that you are modifying the right slot if your objects has several materials.


continuous sequence of frames with multiple cameras with each camera starting at start of animation? I have baked a fluid simulation that runs for 300 frames.  I have 3 cameras, one from the left side, one from the right side, and one from the top.  Can I render a sequence of 900 frames where the first 300 are rendered from the simulation from the left camera, then it uses the same simulation and does the next 300 frames from the right camera, then uses the same simulation for the final 300 frames from the top camera?

You could use the Multi-View Render Layer functionality to simultaneously render from multiple cameras to files and then stitch them together in the compositor.
Start by creating and positioning your cameras. Ensure they all have the same name with the exception of a suitable suffix - eg, 'Camera_L' for left, 'Camera_R' for right, 'Camera_T' for top. In the Render Layers tab, enable Views and create an entry for each camera with a matching suffix for each view (ie, '_L' for left, '_R' for right, '_T' for top).

Now when you render the scene Blender will render a separate image for each camera. To view the individual images you need to disable the Stereo 3D option and select the channel using the selection box.

When rendering the animation you will now get multiple renders per frame - each will be produced with a filename including the camera suffix. For example, rendering to EXR :
0001_L.exr
0001_R.exr
0001_T.exr
0002_L.exr
0002_R.exr
0002_T.exr
0003_L.exr
0003_R.exr
0003_T.exr
0004_L.exr
0004_R.exr
0004_T.exr
....

(rendering to PNG produces similar filename output)
The separate frames can now be used in the compositor using Image nodes with suitable filename and offset, along with logic to mix between them based on the frame :

The compositor nodes have three separate images, each set with a different start frame so, in this case, the first 50 frames are using the first set of images (from one camera), after frame 50 the Mix nodes select the second set of images and after frame 100 the third set.
Note the maths nodes use the presence or not of an Alpha channel to determine which image to merge into the output to automatically select the relevant image. If the alpha channel is in use for transparency then you will need to use the frame number via a driver (enter ‘#frame’ into a Value field) or another method (eg, keyframes) to determine which image to use.
Here is the final result :

Note that Suzanne is only being rotated once through 360 degrees, but rendered from each camera and combined to show each view in turn.
Blend file included (note that there are two scenes - one for the render and a separate one for compositing (required due to the different number of frames - 50 for the render and 150 for the compositor pass)).

just a hint for newer Blender versions:
you can find in Output properties -> Stereoscopy


Attaching one face to another I'm just beginning to learn Blender, and I ran into a problem. I ended up with two separate meshes in one object. I want to attach their faces together, as if I had drawn and extruded one from the other. In this example, I have an octagonal prism that I want to attach to the face of a cube. How can I do this without remaking one of the meshes?

What I have now:

I know that one way to work around it would be to simply move the meshes together so they overlap, but then they aren't actually properly attached, and won't move together/etc.

You can use either Boolean modificator (in Object mode) or Intersect tool (in Edit mode).

Start with cylinder passing through cube.
Cube and cylinder have different amount of vertices, hence cube should be edited in order to have roughly the same shape as cylinder has. It is possible to skip this and create intersection as is, however this way will create Ngons which may be undesired.
One way to change cube accordingly is to bevel it. Select it and press Ctrl+B, 2 segments, low value of Offset.

Add 1 loopcut per both sides of the cube. Use Connect Vertex Path (J) tool to connect corner vertices.

Select all, in 3D Viewport header choose Mesh > Faces > Intersect tool and in its options (Last Operator panel in the Toolshelf or F6) select Self-Intersect.

Select all again, press W, choose Remove Doubles. Note that you may need to enter higher threshold for Merge Distance, like 0.02.


Moving vertices of two objects away from each other Consider having two (multiple) objects that are very close to each other. Is there any algorithm which can identify vertices of these objects that their distances are less than a tolerance and then move those vertices away from each other until the defined tolerance is reached?
the figure is a 2D representation of the problem which is actually in 3d space.

Probably a nice balance between easy to implement and reasonably efficient would be to create a BVHTree for the mesh of one object, and query that with all the vertices of the other mesh using find_nearest_range(...).

Moving the vertices away is probably easiest if you mark the entire mesh as smooth first. That will casue the vertex normals to be in the opposite direction you want to move the vertices in. Then, for each vertex v that you want to move, you can do v.co -= f * v.normal, where f is a smoothing factor. The value of f depends on how quickly you want the vertices to move. You can use a fixed value like 0.01 to move them by 1/100th unit, or you could use a dynamic value that depends on the distance between the two meshes at that point.


Why isn't fire being loaded in the render view? I did some fire simulations in blender about a week ago. I encountered the same problem in all of them, the fire was not loading in the render view, all I get are some huge black pixels. It works well in the object view.
this is what it looks like in the render view.

I looked it up on Youtube and other forums, but I didn't find anyone facing this same problem.
I am using Blender 3.0(beta), but even when I opened the same project in older versions of blender it showed the same effects.

Your material setup is very awkward. Some things seem outright incorrect, like a color ramp being driven by color and then controlling emission strength. Start off with a default Principled BSDF, changing only the Color Attribute field from the default blank to the word color (uncapitalized).
For a custom flame color, perhaps use a plain emission shader, with the density attribute controlling the strength, and the temperature attribute going into a color ramp that starts with black. You may have to use a remap node so the temperature value so it ends up being 0 to 1.


Applying lots of shape keys with blends using Python not working? also, is there another way? I'm trying to make a script so that I can apply all blended shape keys (starting from a specific one and then iterating through the list, keeping them in order) so that they work well when exporting as fbx but it's making a bit of a mess for some reason and I can't figure out why. Anyone has an idea? Or is there any other way to apply lots of shape keys with blends in an efficient way?

import bpy

obj = bpy.context.object
shapekeysList = len(obj.data.shape_keys.key_blocks)
spIndex = obj.active_shape_key_index

for sp in obj.data.shape_keys.key_blocks:
    print (obj.active_shape_key.name)
    obj.active_shape_key.value = 1   # enable shapekey before copying

    #apply shapekey
    obj.shape_key_add(name=str(obj.active_shape_key.name) + "_applied", from_mix=True)

    obj.active_shape_key.value = 0              # reset shapekey
    obj.active_shape_key_index = spIndex        # select shapekey
    bpy.ops.object.shape_key_remove()           # delete blended shape key

    # select next shape key
    spIndex = spIndex + 1
    obj.active_shape_key_index = spIndex

These are the original shape keys:

These are the original shape keys left after running the script:

These are the ones that get created:

This is my first Python script for Blender so I might be missing something pretty obvious or something...
Thanks!

UPDATE: Ok if I go one by one manually with this code it works... but if I try to loop it it messes everything up, so the looping part is the one that's not working o.O

print (obj.active_shape_key.name)
obj.active_shape_key.value = 1              # enable shapekey before copying
index = obj.active_shape_key_index          # save index
obj.shape_key_add(name=str(obj.active_shape_key.name) + "_applied", from_mix=True)   #apply shapekey
obj.active_shape_key_index = index          # select original selection
bpy.ops.object.shape_key_remove()           # delete blended shape key
obj.active_shape_key_index += 1             # selec next in list

Also tried looping with this:

import bpy

obj = bpy.context.object
shapekeysList = len(obj.data.shape_keys.key_blocks)
spIndex = obj.active_shape_key_index

shapekeysList = []
for sp in obj.data.shape_keys.key_blocks:
    shapekeysList.append(sp)

for sp in shapekeysList:
    #the thing that's in the snipet above

Got this working:

import bpy

obj = bpy.context.object
spIndex = obj.active_shape_key_index
i = 0

### EDITABLE VARIABLES ###
last = "fullbody"       # Last shapekey to save
add =  "_applied"       # Add this to new blendshape's name

shapekeysList = []
shapekeyValues = []

for sp in obj.data.shape_keys.key_blocks:
    if last in sp.name:
        break
    shapekeysList.append(sp)
    shapekeyValues.append(sp.value)
    sp.value = 0
    print (shapekeysList[i].name + " | Value saved: " +  str(shapekeyValues[i]))
    i += 1

print ('\nFinished saving shape keys\n')
i = spIndex

while i < len(shapekeysList):
    shapekeysList[i].value = 1                                  # enable shapekey before copying
    print (shapekeysList[i].name + " | " + str(shapekeysList[i].value))

    obj.active_shape_key_index = i                    # select shape key to mix

    obj.shape_key_add(name=str(obj.active_shape_key.name) + add, from_mix=True)   #apply shapekey
    obj.active_shape_key_index = i                    # select original selection
    #bpy.ops.object.shape_key_remove()                           # delete blended shape key
    shapekeysList[i].value = 0
    #obj.active_shape_key_index += 1                             # select next in list
    i += 1


Material not rendering properly in cycles So I was setting up a texture to use on a rock, this is what the current node setup is:

This is what the preview of the material looks like:

In the preview render, and the final render the rock ends up looking like this:

I couldn't find any problems with the node setup so far, anyone know what could be causing this sort of problem?

Without anything connected to the Vector input of the Image Texture node the image texture will be assuming you want to use UV coordinates. If you have not UV unwrapped your mesh then this will be unable to map the texture around your object and the texture will not be correctly shown. Note that the material preview assumes its own unwrapping (depending on which preview model you have selected) and so is oblivious to your own mesh's unwrapping.

The solution to this depends on your intention and the image resources you are using - ie, whether they are intended to be used with a UV unwrapped mesh or whether different coordinates should be used.

If you should be using a UV Map for your textured then I would recommend still connecting to the Vector socket of the Image Texture to explicitly set those vector coordinates. This can be either the UV output of the Texture Coordinate node or the UV output of the specific UV Map node if you are using multiple UV maps and need to be able to select a specific one.

If, however, your textures are based on a different coordinate system (eg, Generated or Object coordinates) then you should use the relevant output of Texture Coordinate.

Note also that your current material is feeding the Normal Map into the Diffuse shader but not into the Glossy. This will result in a different normal being used for each element of the surface - so your reflections will not match the diffuse surface.

I believe your final material should be something like the following :

Note the extra connection from the Normal Map to the Glossy BSDF - this is so that the same surface normal is used for the Glossy shader as you have set for the Diffuse (otherwise the surface will reflect based on the mesh normal - rather than that from your normal map).

If you are using a different coordinate system then adjust which Texture Coordinate you are using. If you should be using UV mapping then ensure your mesh is UV unwrapped - and I would still recommend actually connecting to the Texture Coordinate UV socket (or a UV Map input node) rather than leaving them unconnected.


Texture looks good on some faces but not others I'm using a procedural stainless steel texture in Cycles.

I've Smart UV Projected all faces ("Correct Aspect" is checked, "Stretch to UV bounds" is unchecked).

After unwrapping, some faces look right but others don't - as you can see below.

What's going on here and how can I fix it?

Cheers.

You are using a Mapping node to stretch out or compress the noise to produce a 'brushed steel' effect. Here's a simplified material for demonstration (removing unnecessary nodes while retaining the stretched mapping) :

The Mapping is compressing the noise in the Y-axis so as to produce a 'brushed' effect. This works on some of the faces but not others (note the top and side looking 'brushed' but the 'front' just showing undistorted noise).

This is due to the mapping only affecting the Y axis. Since the 'front' face is aligned with the Y plane it is not affected by the mapping. This is due to Generated coordinates being a '3d' mapping - there is no distinction between faces and the orientation of those faces cannot be controlled individually.

The way to resolve this is to unwrap your model (which you have already done) and you should be using UV coordinates (instead of Generated) as follows :

Using UV coordinates you can adjust the 'direction' of the brushing on each face by changing the UV map to reorientate each face as desired.


How can I make the section of a prolate ellipse like the one shown in the figure? The left ventricle of the heart has a prolate ellipse geometry. The thickness of the wall of the ellipse has several layers. To describe these layers, it is necessary to make a section of the ellipse wall. It would be great to do it in Blender. I appreciate the help for teaching cardiovascular medicine.

You could do it this way:

Create a cube, subdivide it 3 times and in the Operator box give it a Smoothness value of 1:

Cut the top half, scale on the Z axis:

Cut a hole:

Extrude all along the normals (AltE):

Create some edge loop, both to sharp the edge and to give it different colors:

Give it the colors, give it a Subdivision Surface modifier:


Why is the resulting UV map stretched out when unwrapping my object? So, I've been unwrapping semi-circular objects and this happens:

I wanted to know if it is a configuration setting that I'm screwing up or something like that. I can edit it but it is a huge pain, in some tutorials they just work. This is killing me slowly and surely.

The solution is:

In Object Mode: Apply the scale first.

Now you can unwrap it.

See the image below:

Edit: It is a good practice to Apply any transformations (scale, rotaion...)before using any modifier or/and Unwrap.


Displace modifier does not work as described I am teaching Blender to basic ans advanced students & I am using the book BlenderBasics_4thEdition2011.pdf, by James Chronister in my class. That book can be found at http://www.cdschools.org/

In chapter 12 this modifier is described as below:

Neither me nor my students can make the basic cube look like the above.  Can you help?

Start wit your cube, enter Edit Mode (Tab) and subdivide it like 10 times so you have many vertices. (W).

Exit edit mode (Tab).

Add a displace modifier.

Set the Texture for to be used by the displace modifier.


Using a Normal map together with a Bump map I've been stressing these days searching for a video on using a Normal map with a Bump map, but I haven't found something good. Some suggest connecting the Bump input into the Displacement output and others suggest connecting it to the Normal output of a Shader (both using a Bump node). What would be considered a right way of doing it? The Bump node has a Normal output. Is that for the Normal map?

I have this road scene where the bricks are too smooth and I would go for making them more bumpy -

I want to use the Noise texture as a Bump map, but the bricks already have a Normal map so that I have no idea where the bump node should be connected. And when connecting it into the Displacement output nothing happens.

In a tutorial by Andrew Price called "The Secrets Of Realistic Texturing", the Normal map is connected into the Displacement output, but I'm not sure if it is a good way of doing it and the bumps are more like some streched lines which is not what a Noise texture would do - http://qgv6y6drlr2sy3es4blouyvd9.wpengine.netdna-cdn.com/wp-content/uploads/sites/3/2013/01/complete1.png

Here's the file if anybody comes up with something - http://www.pasteall.org/blend/31902

I'm unable to upload the maps (too high resolution), sorry. But, you can use maps of your own.

Here's the node setup -

This is the correct setup to combine normal and bump maps.

If you use a normal map, you can't use the displacement material output, you have to plug it directly into the BSDF. The normal map must go first, and then you can add bump mapping on top of it.


Blender 2.79b (and RC 2.80) require opengl32.dll be present before Blender will open (Windows 10) Blender 2.79b and 2.80 does not load unless I place the opengl32.dll file in the Blender directory. I've gone through all of the drivers I know to update but still no luck. Even placing the opengl32.dll file in the directory does not allow me to load previous .blend files.

Windows 10 Home
V 10.0.18362
i7-8750H CPU @ 2.20GHz, 2208 Mhz, 6 Core(s), 12 Logical Processor(s)
NVIDIA GeForce GTX 1050 Ti

Update on 7/19.
Went to Nvidia website (thank you) and downloaded the latest driver. Ran the blender_debug_gpu cmd from 2.80 with exactly the same result. The results:

Switching to fully guarded memory allocator.
Blender 2.80 (sub 74)
Build: Thu 07/11/2019 09:59 AM Windows
argv[0] = blender
argv[1] = --debug
argv[2] = --python-expr
argv[3] = import bpy; bpy.ops.wm.sysinfo(filepath=r'C:\Users\xxxxx\AppData\Local\Temp\blender\debug_logs\blender_system_info.txt')
read file
  Version 280 sub 39 date unknown hash unknown
Error   : Unrecognized Exception
Address : 0x00007FFC3FC7A839
Module  : C:\WINDOWS\System32\KERNELBASE.dll

This is a new computer so I'm almost to the point of returning it if I can get this figured out. Thanks for everyone's help.

I had the same problem. Here is how I solved it.
The PC has two graphics cards: one built-in Intel and one NVIDIA. By default, Windows (10-pro) recognizes and enables both. However, Blender default will work only with one of them. If you happen to use the other one instead, then Blender will close on start up.
Solution: Disable the graphics card which you are not using. Blender will go with the other one. It should work.
(Actually my experience is with Blender 2.90.1. Blender closes/crashes on loading/start up)


Start / stop automatically raycast Blender is used in our business, in our scenes, there are a lot of objects.
We need to know the name, material...of the objects ... quickly. The only way is to select the object and then read his name and material.

This default operation of Blender is very painful for us because the fact of selecting each object wastes time. I thought to use the raycast to return the information (name, material ...) objects under the mouse and it works fine (I used Templates > Python > Operator Modal View3D Raycast script).

When the modal operation is running, it is not to other operations at the same time. I am looking for a way to stop and restart the raycast automatically. E.g. when the mouse cursor leaves the viewport raycast is stopped and restart when you come back in the viewport.

You could modify the example operator a bit to make it work in a non-modal way. The operator can be run after MOUSEMOVE events instead, using a keymap entry.

Here's a quick example, modifying the operator (the main function is unchanged). It requires pressing the ctrl key to avoid running the operator all the time (since ray casts can be quite expensive on heavy scenes). This can be any suitable combination of events. You may also want to put this in a different keymap, e.g. for an addon.

class ViewOperatorRayCast(bpy.types.Operator):
    """Modal object selection with a ray cast"""
    bl_idname = "view3d.modal_operator_raycast"
    bl_label = "RayCast View Operator"

    @classmethod
    def poll(cls, context):
        return context.space_data.type == 'VIEW_3D'

    def invoke(self, context, event):
        main(context, event)
        return {'PASS_THROUGH'}

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

    wm = bpy.context.window_manager
    kc = wm.keyconfigs['Blender User']
    km = kc.keymaps['3D View']
    kmi = km.keymap_items.new(ViewOperatorRayCast.bl_idname, 'MOUSEMOVE', 'ANY', ctrl=True)


Node single property variable not working? I am making a node group,and for this node group I want to make an input connected to a value in the bokeh image node,but unfortunately the node has no inputs so I had to see another way to make an input (If you know how to do this please tell me),so what I did is adding a math node and add a driver to the input in the bokeh node with the variable the 1st input in the multiply node (math) while the 2nd input equal 1,but when I add a variable to the driver (single property variable) and select the scene and copy the RNA of the 1st value in the multiply node nodes["Math"].inputs[0].default_value it didn't work and value is not updated and it is marked in red as you see here

so how can I get it work?

You should use node_tree.nodes["Math"].inputs[0].default_value

When you open Outliner and select Datablocks in the header you can see and list the data structure.


Smooth Mesh Modeling What is the best method in Blender to model the area in the red circle below?  I have tried a number of methods (deleting faces, using F to join edges, etc) but am not completely happy with the results.  The meshes need to remain clean and relatively low-poly.  Any advice would be appreciated...

Thanks,
Jeff

Here you can see what I'm experimenting with, attempting to join a cylinder smoothly to a cube.  I've taken some edges from the cube, and attached them to the cylinder.  However, when I add the Subdivision Surface, the faces "buckle in" somewhat (Bottom Image)

In that example I worked only with the cylinder and extended it out and squared it off to look like a cube edge .. But if you want to attach the cylinder to a separate cube and want it to join it properly, you have to match vertices.

Remove the faces off the top of the cube and then add or remove vertices to the cube along the edge so both the cylinder and the cube have the same number where they meet. Then you fill in the faces, bridging the gap .. I have an example. The cylinder has 32 vertices along the edge and the cube began with 4. I connected the corners to the cylinder using edges, that's 4. THen I added 7 vertices on each side of the cube. That gave the cube 32 as well (7x4 +4). Then I began filling the gap.

If you look at bolts in the add-on 'bolts' you'll see they are made the same way basically where the screw part meets the head .. the cylinder is extended along the flat to the edge and the hexagonal edge vertices have to match the cylinder (ie top of the screw).

Also I have a quick example of attaching two shapes very roughly similar to your die cast example. I attached them  (this involves some editting where they meet) and THEN I worry about extending the flat area which I started to do. Hope it helps.

Oh ya, I saw the comment about retopo ... that's a good method too .. In essence it's joining various shapes and then laying over it a mesh you construct. You have know about how to lay meshes you build on top of objects which is what retopo is .. anyway .. good luck


How to texture a big Object? I have created a part of city and now I want to apply some textures.

When I had a small object, my texture looks good.
I am new in blender (2 weeks). I tried to add materials for every part of object, but in some places I need a custom texture and I can't paint the object if it has other materials already.

Link to .blend file:

The problem with your model is its size. Depending on the quality you expect to see on the finished model and on its purpose, you either need a huge texture or you can try to split up the model into smaller parts.

Another problem is that you are probably want to use seamless textures. To make them look good, you normally need to plan ahead and try to imagine your scene as a sort of a Lego model, where all the pieces have about the same size.

Preparation

Before you do anything, make sure that your model is in good condition by removing double vertices. Go into edit mode, hit W and select "Remove Doubles".

(I didn't clean your model entirely, there is still weird geometry in it. You can see double polygons around the curbs, that should be removed. Best you check every piece separately, remove doubles again and check for any redundant leftover geometry.)

Splitting the Model

To split your model into smaller pieces, select equally sized parts of your mesh, then hit P on your keyboard and select "Selection" in the popup menu.

Then you need to uv-unwrap those parts again, so each part has its own UV texture space.

The curbs and sidewalks should probably look different, so we need to separate their UVs from the road. Go into Edge Select Mode, then select the left and Shift-select the right edge of the road, then hit Ctrl+E and select "Mark Seam".

After hitting U and selecting "Unwrap", you are presented with a new UV layout for the new part of your model.

You can then straighten the UV layouts by using the method I described in my anser here.

When you are finished, your UV layout should look similar to the screenshot below. Note how the UV islands are straightened and sized equally, so they go right to the edges on the X axis.

Next, you want to open a road texture, that is seamless in the X (U) direction, then start to move the UV islands around until they match the pattern of the texture.

Creating the Material

Go to the Properties Panel - Material tab, delete whatever material you find in the slot, create a new material and rename it appropriately.

Then open the Node Editor, select "Node Tree Type - Shader" and check "Use Nodes".

In the Node Editor view, hit Shift-A, select "Input - Texture Coordinate", then Shift-A, "Texture - Image Texture" and select your Road Texture in the Texture Selector.

If you then switch to Material View, you are presented with this result:

Note how the texture pattern follows the road? This is due to our effort to straighten and realign the UV islands. This method can only used to a certain extent. If the road makes too tight curves, the texture gets distorted too much, which breaks the illusion.

If you follow through with this pattern, you should be able to achieve an almost seamles look for the whole road. You can reuse the material that was created for all similar pieces.

You can use your own texture, the one I packed into the .blend file is just a basic road texture. You could also edit it, so the curbs and the sidewalks would look different.

Link to .blend file:


UV Mapping looks messed up after unwrapping I just marked the seams and unwrapped this human mesh. After I unwrap it, it looks like this ...

I have no idea why this is happening. Please ask, if you need further information.

The red UVs you can see in the UV editor are pinned. You must have accidentally pressed p with UVs selected. This means that they will be kept in place unmoved when you perform unwrap. To remove pining you need to select pinned UVs(or just all UVS with a)and hit Alt+P in the UV Editor. Once you do that Unwrap will work as you would expect.

Pinning is very useful if you for example wanted to manually define the border of some UV island or straighten some lines and then recalculate UV unwrap based on the UVs staying in place and shape you pinned them to.