How to set up a single driver so that it moves a shape key from 0 to 1 and then another one from 0 to 1 I don't want it to move all the shape keys from 0 to 1 at the same time. I only want it to start moving the next shape key after the previous one has reached 1.

By adding your own function to the driver space you can customise a driver to suit your needs. The following function returns a value between 0.0 and 1.0 based off an input value and and offset.

import bpy

def multi_driver(var, offset):
    val = var - offset
    if val < 0.0:
        return 0.0
    elif val > 1.0:
        return 1.0
    else:
        return val

bpy.app.driver_namespace["multi_driver"] = multi_driver

The last line adds the function to the driver namespace so you can use it as multi_driver(x, y) in any driver you setup.

In this example I am using a custom property as the value input, you can change this for a bone or object location etc. The first shapekey uses an offset of 0, the second an offset of 1, the third an offset of 2 ...


Bezier Curve for some reason seriously messing up The bezier curve has been rotated so that's the problem(most probably), but how do I fix it?

You can enable viewing the curve's normals in edit mode using the overlay dropdown.

If your curve is twisted, this will show up clearly in the angle of the normals:

Unfortunately the only way I know to fix it is to select individual control points and either change their vector type to automatic (by typing VA) or by rotating the control point until the alignment looks good.


How to find the pixels of a texture for a certain face I'm making a script that determines the color of a face, based on the texture. I have an object that is UV unwrapped and has a texture assigned. What I would like to do is find the pixels that are in the UV space of a certain face.

I have something that works, but it is terribly slow. For every face I loop over all pixels of the texture image and determine if they are inside the UV space of the face. Not the best method I think :D

In the Python API documentation I found something about MeshTextureFace and this seems exactly what I need. But I have no idea how I could use this.

Any ideas?

By the sounds of it, you just need to optimize what you have.

Some suggestions.

Don't check every pixel, at the very least calculate a bounding box around the face's UV's and only check those pixels.
Rather then do a point-in-polygon test for each pixel. Use a scan-line method. See:  Darel Rex Finley's Efficient Polygon Fill, Or Blenders version of it fill_poly_v2i_n

Note that being a scripting language Python isn't ideal for these tasks - but it can likely be sped up enough to be usable as long as you don't need real-time feedback.

Update, made a more efficient version of Darel Rex's algorithm, see link.(avoids looping over all coordinates for each y-pixel).


Slower Cycles Render on Faster Computer I'm rendering the exact same file in Blender on two computers.  It's an animation (here's a frame)
I'm using the network rendering placeholder and non overwrite functions to render individual frames from each of the computers.  If you haven't heard what this is or how it works, it's not really too important to my question, but you can find out about it here.

Anyway, the render is being done in Cycles with GPU acceleration enabled.  I am using the experimental set for the GPU renderer as there is sub surface scattering in the skin and cloth which is only available with experimental.  So the exact same file/scene is being rendered frame by frame by my two computers (one does, say frame 275, the other then does 276, so almost the exact same in terms of what's in the frame).

Both computers are Windows 7.  Both running Blender 2.76b.  One is an older i7 @ 2.4 Ghz with 12GB RAM and a GTX670 graphics card.  The other is a brand new i7 @ 4Ghz with 32GB RAM and a GTX970 graphics card.

My older, slower computer with the GTX 670 is rendering frames in 2m40s or so, while my new computer with the GTX970, with more memory and more CUDA cores and a faster GPU clock speed (should be way faster) is rendering them in 6-7m.

I have double checked and both are rendering using the GPU.  I shut off GPU rendering on both just to check, and sure enough, they were both way slower, as expected.  Both have the newest drivers.  Tried restarting, uninstalling and reinstalling driver.

I did get a weird error on my newer computer on one render that said there was a CUDA error, so I'm thinking this may have something to do with it, but I haven't been able to recreate the error.  Since this computer is almost brand new, I don't have a lot of history to go on.

Bottom line, render speed on these should basically come down to the GPU, and with a newer, faster GPU, with more CUDA cores, more memory it should be rendering faster.  Unless somehow the newer GPU is missing something that the older one has.

I know that unfortunately with this information it will be difficult to diagnose the problem, but I really don't know what else to include.  I'm hoping that someone will be able to point me to something to check.

I think it's a know bug, but no solution has been found yet. Not much you can do but wait for a solution.

See here https://developer.blender.org/T45093


Animation duplication for multiple objects I have an image from an animation. Here I have a wall being built and bolts and nails come in to add to the process. I have 4 nails here that I have animated, but I still have several more studs to nail down and I would like to take these 4 nails, duplicate them, and then move them over to use as I go down the line ( so I hope there is a way to just move all of the X coordinations on these nails down 16 inches with exact precision ).

I did get the collection instance to work but the sad part is it gives me no control. I want the animation staggered and here it just makes a straight copy that I can't interact with in any way and all of them fly over at the same time.

Shape key animation

Set origin at point of nail.
Make a simple shapekey, moving whole mesh in edit mode to "fully
nailed". Origin is at head of nail for this shapekey.
Orient the nail anywhere, Need only animate the value of the shapekey, from 0 to 1.

The nail in image is animated to nail in local Z direction... The nail object is rotated -90degs about Y axis.  should have put local axis on it I suppose.

Drivers

An interesting take on this is to use drivers (make sure that prefs > save & load > auto run python scripts is checked)

Copy the script below, paste into text editor and click run script. To have it run automatically when blend file is opened, name it nail.py and check register.

import bpy

dns = bpy.app.driver_namespace

def nail(start, end, frame):
    if frame < start:
        return 0
    elif frame >= end:
        return 1
    else:
        return (frame - start) / (end - start)

dns["nail"] = nail

Now in the value property of a nail can type in

#nail(10, 50, frame)

to have a nail start nailing in at frame 10 and finish at 50.

Now we can copy the nail, move it somewhere else,  and change the numbers in the driver to change when the nail gets nailed.

This may be a bit "out there", but is an example of there are many ways to skin a cat with blender.


How to create 'inner-tube being towed by boat" physics effect I have a rough terrain (plane, displacement mod) that serves as a LAKE. I have an INNER-TUBE (a torus) that I want to tow around on top of the LAKE.

My initial method (that doesn't work, or is incomplete):

Rig: Create a curve. Parent an empty ("BOAT") to the curve in a 'Follow path' relationship. Add a couple of Limit Distance constraints to the INNER-TUBE to create a range of distances the INNER-TIRE can move around the BOAT.
Physics: Create a Rigid Body World. Set LAKE as passive, INNER-TUBE as active. Add some dampening and friction to the LAKE and INNER-TUBE .
Animation: Set frames and negative-start evaluation time for BOAT path (negative start time allows INNER-TUBE to settle on the LAKE before movement). Mark start/finish keyframes for BOAT.

The result is: Not Much. Once BOAT starts moving INNER-TIRE moves with it... but INNER-TUBE is completely unreactive with the TERRAIN, and doesn't swing wide after BOAT turns corners. INNER-TUBE may as well be directly parented to BOAT : INNER-TUBE just stays in the same angle to TRUCK as at the initial orientation.

In short: physics ain't happening.

The scene's enormous so I won't provide a blend file. But if someone could provide a simple .blend that illustrates how to do this boat-tows-inner-tube effect at its simplest level, I'd be grateful :)

I'm not an expert on rigid body physics in blender, so I can provide a full example, but it sounds like you have used an object constraint to attach the tube to the boat. If you want physics you should use a rigid body constraint instead. See: https://www.blender.org/manual/physics/rigid_body/constraints/types/index.html


How would I composite my rendered animation I'm new to blender. I created an animation, and it saved in my folder as 140 pictures, for each frame. How do I take all of that and add it into the compositor to add some effects that I need?

In the node editor, delete the "Render Layers" node and replace it with an "Image" node. Then click "Open" and navigate to folder where your animation images are saved. Hit A to select all the images, and then finally select "Open Images".


Black artifacts only in final render I have a rather simple glass material on a wine glass model, it renders perfectly fine in preview, but in final render it gets these black artifacts around edges.

I've checked other threads and tried tweaking the near/far clip but it doesnt seem to affect the issue. I've also upped the light paths to full global illumination.

Example:

Material and render settings:

What could be the cause of this? Any help appreciated.

The problem was smooth shading, as pointed out by Igor Tatarnikov and Hexbob6.  I needed to apply an edge-split modifier to the problematic geometry to fix the issue.

See Why does the Minecraft-texture have black/dark borders in Cycles?


Is there a working extension to import Kinect skeleton data as animation into Blender? I already tried Bloop which would end in rewrite lots of C++ and Phyton code. The issues with bloop are described here im-so-annoyed-im-resurrecting-this-blog.

For other things like RGBDemo the dependencies to OpenNI are no longer available.

It wouldn't be necessary that the import is done in real-time.

Is there any working module/add-on, external converter?

There should be a script for importing bvh files under

File -> import -> Motion Capture (.bvh)

, at least in current versions of blender.

A program to save kinect skeleton data as a .bvh file can be found e.g. on  the following site:
http://tech.integrate.biz/kinect_mocap.htm


How to Interrupt a process the results in an unresponsive interface (like "Control-C") I imagine that this question has been asked, but I could not find the answer, so I'll ask it:

I just created an icosphere and tried to increase the number of subdivisions to 5. But, whoops, I entered 25! Now Blender is churning away on a difficult task that I would rather not be completed. Is there anyway to "Undo" a process while Blender is still "thinking about it"? Like a "Control-C" equivalent? Or, do I just need to kill the whole Blender application?

ESC key might do it.  When the task is going to take an age, you can go to Windows' Task Manager and stop the Blender program outright...(Ctrl+Alt+Del)  It does mean you lose what you've been doing since the last save however.


Re-Centering the Camera view after Shift Drag? This seems like something obvious, but I just don't know where to find this.

I'm using blender for projection mapping applications, and have set up my camera to emulate the base position and FOV of my playback environment.

Using Shift+Numpad-Enter to get the view into a 1:1 mode works just fine. My problem is that if I accidentally hold Shift and Middle-click-drag, the camera view frame gets moved within the viewport.

Is there a simple way to reset this back to the center. "Eyeballing" it back to the middle just isn't precise enough for me. I'd rather just be able to hit a keystroke combo and not have to worry about it.

The only option I know of is to select the camera in question and then press Home before repeating Shift+Numpad Enter

Pressing Home with the camera selected runs the 'View All' command and will bring the camera back in view and centred but it will also adjust the zoom so that all the camera is visible, possibly loosing the 1:1 ratio. So it would be necessary to repeat the 1:1 view shortcut afterwards.


How can I duplicate an object with independent meshes? I am trying to duplicate a mesh object using python. After duplication I try to change the duplicated object's mesh, but the original object's mesh also changes.
Seem like both objects have the same mesh. How can I also duplicate the mesh?
Here is some Code:
>>> obj1 = bpy.data.objects['Cube']
>>> obj2 = obj1.copy()
>>> bpy.context.collection.objects.link(obj2)
>>> obj1.location = Vector((3,0,0))
>>> obj2.animation_data_clear()
>>> ve = obj2.data.vertices[0]
>>> ve.co = ve.co*2

You should copy object data.
obj1 = bpy.data.objects['Cube']
data = obj1.data.copy()
obj2 = obj1.copy()
obj2.data = data
bpy.context.collection.objects.link(obj2)
obj1.location = Vector((3,0,0))
obj2.animation_data_clear()
ve = obj2.data.vertices[0]
ve.co = ve.co*2


What is the difference between Reference and Background image in 2.8 In 2.8 I can add images two different ways: "Reference" and "Background".

As far as I can see both create an image that is aligned with the current view,  and both create an empty. The only difference I see is in settings for Front and Side.

When shoud I use each option and How are they different than an Empty as Image?

Both of them are different presets for an image used as empty.

There are a couple of key differences between reference and background images.

Reference images essentially act as objects. like standard objects they aren't transparent so if you pass an object behind the image then it will be obscured by the image.

Background images will show behind objects regardless of which view you see it from

Both reference images and background images will show in wireframe or solid view

Background images have backface culling

Unlike reference images if you create a background image while in orthographic view you cannot see the image in perspective view.


How to illustrate ideal refraction using cycles? How can a scene be setup to illustrate ideal refraction? The desired result is something like this (courtesy wikipedia):

In this cycles setup, a light projects nearly straight rays out (see Making a Laser in Cycles - Straight Beam of Light?). A plane is setup with a refraction shader. When the light passes through it, the outgoing rays are much more diffuse than the incoming rays.
Setup:

Plane refraction shader:

The result with the light rays::

How can the result be improved? Can the strength of the ray be increased after it hits the plane? Can the desired result be generated?
Sample Blend file -

LuxRender shows refraction correctly.

Install LuxRender (currently support 2.82 and 2.83)
Setup a model with a refraction shader just like for Cycles
Render!

Sample Blend file -


grow faces over single axis Let's say I have a grid of small cubes 20 x 20. I want to be able to make some amount of them 'grow' over one axis.
The closest I had to this was use displacement with a cloud texture matched to an empty object that moves across the screen, but because it affects vertices instead of faces it doesn't look like cuboids anymore. Is there a way around this?

(to further complicate things I'd like to be able to then assign different materials to sides so would be much better if starting point is cubes rather than plane)

I would keep the displace modifier but start from a single vertex that way it doesn't deform the meshes.
Start with a single vertex and add 2 Array modifiers

Add a Displace modifier, setup a cloud texture, direction to Z, and set the coordinates to object, and add an Empty in the scene.

Add 2 Screw modifiers along X and Y, set the steps to 1 and the angle to 0°

Add a new vertex group to the object

Add a Solidify modifier. Set the thickness to 0, the rim material to 1 and the output vertex group to the group you just created.

Add a very large plane in your scene, set it to not render and set the viewport display to Bounds

Add a Shrinkwrap modifier, target the large plane, set the wrap method to Project along Negative Z, and limit it only to the vertex group. I also added a Bevel modifier.

Add 2 Materials, one for the Top & Bottom, and one for the Sides.

Move the empty :


How to use 2 lattice to deform 2 spheres on impact I put a lattice around my sphere per basic deform set up:

Instead of modifying the sphere from the inside, I want the inverse effect.  I want the sphere to squash like a ball when it interactions with it.

This works.  Now here is the advance set up where I'm stuck.  I want 2 balls that are part of the same object to interact with each other, using the lattice modifier, they would squash equally from both sides.

I had to modify this in edit mode because if I can get a photo, than I wouldn't need to ask this question :)
I got stuck as soon as I tried to bind the 2 balls into a lattice.  They deform immediately which is not what I want.

I'm assuming this can probably be done easily if I make the balls 2 separate objects.  But that's the challenge here - I don't want to.  Is what I'm asking for possible with a single object?
Edit: They will be animated to squash with bones.

I'm not sure why you need to keep your 2 balls within one object, but you could try it with Lattice or with Mesh Deform or even with shapekeys.
If you want to do it with Lattice, scale the lattice it in Object mode (not Edit mode) so that it contains your 2 ball object, in the Properties panel > Object Data > Lattice, give it enough Resolution (i.e. subdivisions):

Now create a basic shapekey, then another one:

In Edit mode, squish your lattice the way you want:

Back to Object mode, keyframe the shapekey value to animate:

Here is what it could give:


How can i stop the fingers from stretching when i move the body in the Minecraft Rig? i have downloaded the Minecraft rig from this website: http://www.rymdnisse.net/download/blender-rigs/minecraft-blender-rig/
,but for some reason, when i move the body around, the fingers streach out. how can i stop this?

this is most likely because you're currently selecting the mesh/skin when trying to move the character.

Instead you need to select those bones in order to move/rotate/scale the character.

This tutorial might help, https://youtu.be/_C3CCz5S75A?t=7m56s (at 7:56)
To move the whole character in while in pose mode, select and move that larger platform around his feet.


How to get values from bpy.context inside a class I'm working on an Addon that saves Render Settings and Camera Settings.
If I try to save camera settings but the multiview in the Output Settings is not set to True, it gives an error, because the Stereoscopy Settings in the Camera-Properties are non existing.
I found out because it is not possible to get values from the context inside of a class.
How can I make an if statement happen by looking for a boolean value in Blender context?
This example is a copy from the Blender API, just to make it work in a small txt-file. Look for the if statement with ##<-------- here is the question.
import bpy
from bpy.types import Operator, Menu
from bl_operators.presets import AddPresetBase

class OBJECT_MT_display_presets(Menu):
    bl_label = "Object Display Presets"
    preset_subdir = "object/display"
    preset_operator = "script.execute_preset"
    draw = Menu.draw_preset

class AddPresetObjectDisplay(AddPresetBase, Operator):
    '''Add a Object Display Preset'''
    bl_idname = "camera.object_display_preset_add"
    bl_label = "Add Object Display Preset"
    preset_menu = "OBJECT_MT_display_presets"

    # variable used for all preset values
    preset_defines = [
        "obj = bpy.context.object"
        "data = bpy.context.data"

    ]

    # properties to store in the preset
    preset_values = [
        "obj.display_type",
        "obj.show_bounds",
        "obj.display_bounds_type",
        "obj.show_name",
        "obj.show_axis",
        "obj.show_wire",
    ]

######################
######################

    if bpy.context.scene.render.use_multiview == True:  ##<--------here is the question
        self.preset_values.extend([
            "data.stereo.convergence_mode",
            "data.stereo.convergence_distance",
            "data.stereo.interocular_distance",
            "data.stereo.use_spherical_stereo",
        ])

#####################
#####################

    # where to store the preset
    preset_subdir = "object/display"

# Display into an existing panel
def panel_func(self, context):
    layout = self.layout

    row = layout.row(align=True)
    row.menu(OBJECT_MT_display_presets.__name__, text=OBJECT_MT_display_presets.bl_label)
    row.operator(AddPresetObjectDisplay.bl_idname, text="", icon='ZOOM_IN')
    row.operator(AddPresetObjectDisplay.bl_idname, text="", icon='ZOOM_OUT').remove_active = True

classes = (
    OBJECT_MT_display_presets,
    AddPresetObjectDisplay,
)

def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.OBJECT_PT_display.prepend(panel_func)

def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)
    bpy.types.OBJECT_PT_display.remove(panel_func)

if __name__ == "__main__":
    register()

After a long while I finally understand it:
It's not possible to get the context inside a Class outside a function, (except of batFINGER's way, but I still don't understand that).
But it is possible to get what ever is needed in a function outside the class and then use the function like this: (Here is only the relevant part of the script shown)
-----> In this way, the context won't update. Therefore the way over the "@classmethod def poll(cls,context) is needed. (not shown here)
import bpy

def Multiview():
    if bpy.context.scene.render.use_multiview == True:
        print('Yes, its true')
        return True
    else:
        return False

class AddPresetObjectDisplay(AddPresetBase, Operator):
    '''Add a Object Display Preset'''
    bl_idname = "camera.object_display_preset_add"
    bl_label = "Add Object Display Preset"
    preset_menu = "OBJECT_MT_display_presets"

    # variable used for all preset values
    preset_defines = [
        "obj = bpy.context.object"
        "data = bpy.context.data"

    ]

    # properties to store in the preset
    preset_values = [
        "obj.display_type",
        "obj.show_bounds",
        "obj.display_bounds_type",]

    if Multiview():          ####<------- Context used here
        preset_values.extend([

        "obj.show_name",
        "obj.show_axis",])

Or another useful example:
def Blender_2_93():
    if bpy.app.version >= (2,93,0):
        return True
    else:
        return False

With that little function is it very easy to  make changes for different blender versions if a preset system is used or something else where the access to context, data or what ever is not usual.


How do I make blender use precise measurements for scale? I am looking at several objects in my viewport and all of them are of different sizes.

For example, a new mesh cube has sides that are 2 meters (I already set the units to metric)

However, when I go to the Object settings for these objects, the Scale is always 1.0 for every single object. (the scale is relative to original size)

But I want to use a system where I can type 1,1 METERS (or feet) instead of this "percentage" system.

How can this be done?

I think you confuse the term scale with dimension. Changing the scale is always a percentage value of the object's size. If your cube is 2 [whateverunit] and you type "S - 1.1" it now has 2 [whateverunit] multiplied by 1.1

The only method of changing an object's size directly without using percentages I know of is manipulating its dimensions which you can find directly below the scale settings in the properties shelf. AFAIK there are no keyboard shortcuts to manipulate the dimension values directly - maybe due to the fact that Blender never intended to be an accurate CAD-like software.


Procedural Candlelight I am budding my head trying to find a good way to create a realistic candle flame. I have tried making a candle procedural texture using gradients and fresnel, from the right angle it looks promising, but it is way to hard to control.

What would you guys do? Is it the smoke way, or is there a better/simpler way?

Final:

Node overview:

This is method is quite simple, it's basically make gradient as mask add facing mix and repeat. You can use this approach to extend this material even further and add some more colours, rims, and maybe more.

So here it is:

Mesh:

Flame is modeled from Cylinder, but you can make it as you like. Even from beveled Bezier Curve (easy animation).

Compositing:

As a final touch you can add some Compositing. I've done very simple colour correction, added Glow and Lens Distortion.

Everything should be pretty clear, but if you have any question don't hesitate to ask in comments.


Export an animated 3D model to Power Point As you might have seen, it is now possible to insert an animated 3d object, like a walking T-Rex, into PowerPoint.

See for example: https://support.office.com/en-us/article/insert-animated-3d-graphics-6f08009a-3da5-400d-a706-8e23f304cd72

Now, I am wondering, how can I create custom 3d models for powerpoint that would also have embedded animations like the T-rex has?

I have not found anything on the web so far. Most of the topics discuss how to create static 3d models for PP, but not how to create 3D models with embedded "scenes" or pre-set animations. Any help would be highly appreciated.

Take a look at here for a quick overview and at the 3D Content Guidelines for Microsoft powerpoint for details.  As the 3D engine in Powerpoint is now based off Babylon.js GLTF format is your best bet to get content to import correctly.


is there anyway to automatically create a mesh for an armature i have some animation files that needs to be modified, when i import them in blender, the animation file doesn't have a mesh attached to it and that makes modifying super hard.
is there anyway to automatically add a default mesh or something to these armatures ?if not,
then what is best way to modify an animated armature without a mesh

thank you


How can you align two vertices relative to a global coordinate when you want to preserve the orientation of the edges that contain them? I want to move a vertex A along an edge A1 in such a way so that the vertex has the same Z global coordinate as another vertex B which is in another edge B1. B1 and A1 are not parallel.

I tried using the Normal coordinate system to move A along A1, but snapping to B only considers the current (Normal in this case) coordinate system so it didn't work as desired.

Then I tried snapping the 3D cursor to an endpoint of A1 and scaling A (with the 3D cursor as pivot), but snapping to B did not work as expected (I'm not sure why).

The only solution I was able to come up with was to duplicate the edge and snap A to B in the global coordinate system, then while moving on the XY plane snapping to the duplicated edge. Far from being practical.

Here is a picture of what I'm trying to achieve:

I want the selected vertex to move only along the green axis but I want to snap to the vertex in the red circle relative to the global Z.

Is there a better way to achieve this?

I would also like to know the answer :)

However, as a workaround for this specific case the knife tool K in combination with angle constrain C is very handy:


Joining objects good practices? I have to objects (Face and a nose) I need to join together.

Now I guess I could simply Ctrl+J it and the result would be following
But I notice that none of the vertexes are actually joined. Is this a bad practice? The model is going to be imported to Unity, could I run into some troubles? If so, is there a preferred method for combining two objects?
I tried using the Boolean Union, but that would mess up the "face". I was wondering if it would be better to somehow (don't know how) increase the quad density of the close proximity of the "nose" and try boolean again.
Note: The model in the picture will have some animation.

Joining this way, especially facial work, probably won't serve you well in the long run.  The biggest issue you face, which you have already picked up on, is that it will disturb your topology.  Longer term, the layout of faces and vertices doing it this way won't serve facial animation if you ever want to do anything. Think about smiling, for example.  You would have to fight the direction of those edges to make it turn up.  And in some areas where you need more fine detail, like around the eyes, you won't have it.
For example, look at the meshes here....
https://cgcookie.com/course/mesh-modeling-bootcamp
You can see how the mesh serves the animation (see the face loop video).  Now in your case, it doesn't look like you have to do anything that complicated, but I would recommend following a tutorial like that one.  One, you will probably learn a lot of great new stuff and it will get you ready for what you may want in the future for this project.
Good luck!


How to export vertices' locations in a .dat file? Is there anyone know,

(a) how to do an ico sphere of radius=0.5;

(b) how to set the verticles' number and faces' number in an ico sphere;

(c) how to export all vertices' locations in the following format to a .dat file?

! each row has all three vertices' location for a face.
x1 y1 z1 x2 y2 z2 x3 y3 z3

....

Animation Nodes
You can use Animation Nodes to get such information and write it to a file. First, loop over the polygon indices and get the vertices locations at those indices, then get the individual numbers of the vectors, convert them to text and join them using as space as a separator:

Then join the output using a linear break as a separator:

Then you can write the text to a text block using the Text Block Writer Node:

Save the text and you are done.
Python
This script will write the data to the text block test.dat:
import bpy

mesh = bpy.data.objects['Icosphere'].data
data = ""

for poly in mesh.polygons:
    for vert in poly.vertices:
        for c in mesh.vertices[vert].co:
            data += str(c) + " "
    data += "\n"

if not "test.dat" in bpy.data.texts:
    bpy.data.texts.new("test.dat")

bpy.data.texts['test.dat'].write(data)


diference between preview and render Hello
i ma a bit noob... but i need to make glass for helmet which i will put on someone face after that...
so i would like to have the same resoluts with preview render and final render.
so please can someone help me to have the sam resoluts in preview like in render ? thanks
it happend just when i do that glass transparent for render (so that mabie happend in old version too i am not sure now)
here is non transparent shoot:

I found a solution: You can refine the alpha channel post render, here is how:

Just use any node that can influence a gradient and stick it in between the native alpha channel and the one of the output node.


I need to scale one end of a model I have created a fairly complex model and now realise that I have made an error in one aspect of the dimensions. Rather than redo the entire model I can imagine a fix but I'm not sure if this is even possible.
My imagined solution relies on fixing the complex model in some kind of 3D rectangular bounding box and then scaling one face of the box in the Z dimension such that the bounding box becomes more of a trapezoidal shape.
My hopes increased when I read about the scale cage tool but this scales all faces by the same amount

If you can imagine my model fitting inside the 'before' box and then the model being scaled in the proportions such that after scaling it would fit into the 'after' box then you have managed to visualise what I'm trying to achieve.
I hope there is a fix for this and I look forward to hearing from anyone that can help.
Russell

You can use the Lattice modifier for this.
It works almost exactly as you described.

Add a Lattice Modifier to your Mesh.
Create a new Lattice through Add > Lattice and deform it to your needs
Target the new Lattice object and use the Strength slider to control the influence


How to rotate/translate a part of body without afecting the rest of it? Hello Blender wizards,

I've been following a really old tutorial (2009): https://www.youtube.com/watch?v=sUifORl-faI and I've come to a problem.

When I try to rotate just the extrusion, the rest of the body rotates as well (7:36 to 7:41).
A similar problem occurs when I try to translate just a single vertex, and all other vertices move together (9:05 to 9:10).

Thanks!

You must have activated the Proportional Editing option on the bottom horizontal menu bar. It allows you to influence the closest vertices/edges/faces.


How can I fill the face just between the vertices and not the inner circle? So, as the title suggests, I want to fill JUST inbetween the inner and outer circles, but whenever I fill them in, it'll fill in that inner circle, something I don't want, I've tried different selections of vertices and edges, but it still fills everything in. Any help is appreciated

What you want is "Bridge Edge Loops". Select the two "rings" you want to connect, right-click, and select it. Do this for both sides. See below:


Ocean Modifier Questions I have a few questions on how the Ocean Modifier works. They are for the Blender Internal,so please be specific.

What does the Foam Data Layer do in Blender Internal? Does it do anything?
Is the Ocean Texture associated with the Ocean Modifier? If so then is it a replacement for Foam Data Layer but for Blender Internal?

Thanks for clearing up the topic

I assume that by "Blender Manual" you mean "Blender Internal".

The foam data layer is just an ordinary vertex color layer, you can see it in the object data, you can change it in the vertex paint mode, and Blender Internal can render it - see "Vertex Color Paint" and "Vertex Color Light" in Material/Options.


Would it be possible to make your game for Mac Linux and Windows I understand that you can only make a runtime of your game on the current os you are on (I am on Linux) Would the .blend open on Windows that I have been working on on Linux via flash drive and am i able to save it as a runtime on there?  Help is appreciated.

Yes the blend files can be opened on any system that can run blender. You can then export to game engine runtime on that system. You just need to check that they have the player installed as well, this should be included with release downloads but may not be for custom builds or graphicall downloads.

As gandlaf3 pointed out there is a new addon included with 2.72 that allows you to export to multiple platforms from your current system. You just need to enable the addon and test it. This is a new addon so be sure to report any trouble you have.

Be sure to pack all external files or include all external items for each platform.


Can color management (e.g. filmic) be disabled for specific file output nodes for raw data? I know for Blender sets the color management setting globally for the project. As far as I am aware every data that is saved as image, will pass through the color management of Blender.

Now the problem is, I have data that I want to store as an image format (e.g. png not OpenEXR or HDR), that shouldn't be passed through color management. For instance I have an ID-mask in compositing, that I would like to store. This isn't an image, like a render, were the transformation through the LUT makes sense (or does it?).

If my understanding is correct, the color management used by the file output node treats the values like pixels, mapping each value to the corresponding value in the LUT. However with such data like the ID-mask the function should either be

1) the identity, if the output format allows to store floating point ([0.0, 1.0] -> [0.0, 1.0], f(x)=x) or

2) only scale to the range of output format (e.g. [0.0, 1.0] -> [0, 255], f(x) = (int) x * 255.0).

The latter of course introduces inaccuracies due to different ranges of values, but still does what is expected.

How can this be achieved or is my understanding of color management fundamentally flawed?

You can get non-color managed non-linear files from image viewer: save with save as render option disabled (in 2.79 it is disabled by default). Maybe there's possibility to use bpy.ops.image.save_as in script to save images frame by frame for animation, but I'm not into python to help on this.


I tried to merge 2 vertices, but it keeps moving to the center I've made 2 different objects at the first time which were 'Body' object and 'Horn' object. And they've already had same Mirror Modifiers of Y Axis, Clipped.

Now I Joined 2 objects to use Ctrl + J. (Horn to Body.)

I Selected 2 vertices from the top of the head like the second picture on the below, press W to tried merge those at the center. But it's moving on to 'Center of the Head'.

I searched on the Google and Blender Manual to solve this issue without question but unfortunately, I still can't find it.

Could you please give me any solutions?

This could be related to the mirror modifier. If the body was made on the right side and the horns on the left, they look ok, but the real vertices are on the opposite sides. Deactivate your mirror's visiblity to check this.

You should work with the "Adjust Edit Cage" of the mirror modifier disabled to avoid creating things hard to merge.


Sections of UV unwrap not taking texture painting I Have bought a model I am colouring and animating, however when i come to texture paint it after UV unwrapping, adding material etc there is a part of it that will not be painted, does anyone have any idea what might have gone wrong?

If your object is a single object made up of multiple meshes, and you are adding materials to these meshes, then you need to make sure the materials are all sharing the image texture that you are painting for them to show the effect the texture is meant to describe.

A color image meant to give color to the model has to be shared for all the materials to be included with the paint - and even if you aren't going to use color on several mesh parts, those materials might be sharing a single image for bumps/gloss/etc.

In the actual case above, OP needs to make sure the model in question isn't composed of multiple objects and is indeed one object - and that the materials added all share the same image texture.


How to UV unwrap multiple animated objects at once I have created a rigid body simulation, which I baked into an animation. The final animation includes several cubes close to each other on a tray, like shown below:

I want to UV Unwrap all of these cubes into one UV Map by using "Project from view".

I tried to join all of the cubes, Unwrap, then separate, but that just makes all the cubes follow the same animation as the cube which was active when I first combined them.

How can I unwrap them all without manually unwrapping each individual one without messing up the animation?

Follow these steps and you should be able to get this done.

Add a camera to the scene that points in the direction you want to project the texture. (Optionally, make it orthographic.)
Select all of the cubes you want to apply the texture to.
Run the simulation until you get to the frame where you want to apply the texture.
Add a UV project modifier to the active cube. Under the Projectors field, pick the projection camera you added from the list of objects.
In order to make sure that the image is being projected at the correct size, switch to Blender Render and the Textured view mode. In the N panel, set Shading to Multitexture and check Shadeless. This will let you preview the texture mapping independent of any material settings.
In the UV project modifier, pick the image you want to project from the list and check Override Image.
Press CtrlL to Make Links between the active and selected objects. You want to apply the UV project modifier to all the active objects so pick Modifiers from the list.
Make adjustments to the UV Project modifier in order to get the projection you want. You will need to re-link the modifier to the other objects after each change.
When you're happy with the results of the modifier use AltC, convert to Mesh in order to apply the UV Project modifier to all of the cubes.
Set up a material that uses the texture you're projecting and use CtrlL to link the materials to the other cubes.
Render out the image sequence and bob's your uncle.


How do I use a map or node as a mask? I want to use an AO node as a mask for a different texture, as in I want the AO node to be a factor for 100% opacity in the white areas and lower in the dark until full black equals zero.

Im not talking about using a stencil or anything to do with texture painting as I want this to be procedural.

How would you set up a mask using nodes?

https://preview.redd.it/h8czrfosnw141.png?width=1362&format=png&auto=webp&s=73506d0f8cabd3f4b27a7bcd8b08795a5531a9fb

Ive been trying to use the Mix RGB as a mask the only issue is it washes the colors out.

So lets say I have this brick texture  and I want to control its opacity based on an image texture or a AO node so I made an AO node with a color ramp to include a white and black area. I want pure black to be zero opacity pure white to be 100% opacity. So the face should be all brick and the dark parts of the neck should have nothing under it right?

I mix the two using the AO as a foreground and fac, and the background is  the brick. It works sort of but the colors are washed out and I would like the AO to be nothing but an alpha mask but the black values still stay. Ive used every blend type with similar results and ive used both color and aplha from the AO color ram as my mix node fac.

The best example I can give is doing this in Substance painter is pretty simple I have my AO map

And then I have just a red fill layer under it and the AO black areas are used for opacity. I basically just want this kind of masking with a Blender node set up

Your nodes setup is not good, you're actually mixing a grey color (in the MixRGB Color1 socket) with your brick pattern, it gives a grey brick pattern. Also you should put a Diffuse before your Output. I propose this solution which uses the AO as a mask between your brick pattern and the dark color you want to give in the folds of the shape:


How to play a sound after script finishes? Is there a way to play a sound after a script finishes ? For scripts taking between 30min and many hours (like the delaunay triangulation one from doomlysz), it's good to not have to check every 10 min if the job is done or not.

You could play a MP3 file using the aud module

import aud
import time

sound = aud.Factory.file(pathToMP3 )
device = aud.device()
handle = device.play(sound)
# omit this to play full sound file
time.sleep(5)
handle.stop()

Alternatively you could launch any external application as described here: Run an external application with the bge


Match certain parts of a mesh to the body? I'm trying to make Knight tassets, as show in the second pic. So I need the cream colored part of my mesh to stay to the color coded bone, the green colored part to the green bone and so forth so that the entire thing doesn't look so stiff when it moves. Been fiddling with it for like an hour and still can't figure it out. I took like a 2 week break from Blender and I think I sorta braindumped everything,

Any help? I've made vertex groups for each part of the mesh but can't figure out what to do next.

You need to assign the appropriate parts of the mesh to the appropriate bones like you would normally. Use the weight paint tool, or vertex grouping.

For those side plates I would definitely recommend assigning them their own bones if they are not strapped into the leg, and would, for instance, hang downward if the character leaned to one side.


How to make the light emission invisible? I was experimenting with a scene with an object that is unwrapped so that every polygon has the same texture so that I can use it as a wireframe. The object is sitting on a plane. I tried this node setup, but it is not as I expected, because for some reason the main material casts light.

Here is what I want to achieve: the wireframe should be a light source that doesn't cast light. By the way, there is no other light source in the scene that is lighting the object.

However, it works this way:

However, in this way only the wireframe of the object is visible.
How can I make the wireframe only to be a light source and not to cast any light?

If I confused anybody, then this is what I mean:
http://cgcookie.com/blender/2011/10/20/blender-tip-creating-invisible-lights-in-cycles/

You can use a Light path node to mix shaders based on the properties of the incoming ray.

For example, this node setup mixes Base material and Line material based on Line texture, then mixes that with Base material based on the kind of incoming ray; rays coming directly from the camera will see the mix of Base and Line, but other rays will "see" only Base.

So shadows and indirect lighting etc. will be cast as if Base shader was connected straight to the material output.


How to paint through all mesh during vertex painting? Tell please how to paint all vertices, not just visible, in vertex paint mode?

The only workaround I found is to use the Weights to Vertex Colors addon . It's not a real solution, just a workaround, but since you can paint through the mesh in weight paint mode by unchecking "Limit Selection to Visible" , you can paint there and then convert your weights into vertex colors. But of course it converts it in greyscale (although there's an option to use the rainbow ramp from the weight painting but that's not usable for most textures).

But I think a "Limit to Visible" option in Vertex Paint should definitely be added in Blender.


My laptop gets too hot when rendering in cycles I am having overheating issues with my MacBook Pro retina
I have this configuration

MacBook Pro Retina 15"
Processor 2.4 GHz Intel Core i7
Memory 8 GB 1600 MHz DDR3
Graphics NVIDIA GeForce GT 650M 1024 MB
Software  OS X 10.9.5

Blender is an amazing tool, but working with cycles my computer
gets too hot. I have tried using last CUDA version but the problem still happens.

Any advice?

I have the same laptop, and it does indeed get hot. But this isn't really an issue specific to Cycles or even this laptop, any CPU / GPU heavy computation that has good multithreading will do it, and laptops often just aren't made to run cool under such loads.

I suggest to use CPU rendering with a lower number of threads like 2 or 3 instead of using an automatic number of threads. This mobile GPU isn't faster than the CPU in most scenes anyway. Cycles doesn't have an explicit way to specify using fewer GPU cores, though you could try decreasing the tile size to make it render slower and hopefully get it to run cooler as well then.


bas relief model from a 3d model/scene? From Wikipedia:
https://en.wikipedia.org/wiki/Relief#Bas-relief_or_low_relief

  A low relief or bas-relief is a projecting image with a shallow
  overall depth, for example used on coins, on which all images are in
  low relief. In the lowest reliefs the relative depth of the elements
  shown is completely distorted, and if seen from the side the image
  makes no sense, but from the front the small variations in depth
  register as a three-dimensional image.

Example image from the same page:

This can obviously be done with sculpting, but I feel like there should be an easier/faster way to make such an effect (for example a coin, medallion, religious icon, etc.) from an existing 3d scene rather than recreating from scratch by sculpting.
I'm not sure how, but I think rendering the scene in a specific way via the Compositing Nodes and then applying that rendered image as Displacement modifier on a grid mesh might give such an effect.

Here are some models from Blendswap someone trying to find a solution can use for testing: http://www.blendswap.com/blends/search?keywords=statue&is_fan_art=1&blend_license=&render_engine=&sort=downloads&direction=desc

Generating nice heightmaps for bas reliefs:

1) Add a camera facing the model(s).

2) If there are multiple models, make sure the models are the same distance from the camera and have the same "thickness" (Y scale/size in the camera's local Y axis), make the latter 1 blender unit.

3) Set materials to black, shadeless.
Set background and ambient colors to white.

4) Set renderer to Blender Renderer.

5) Enable Mist.
This is where the magic happens. Have the mist appear where the closest polygons to the camera are, have it completely fade in when the farthest polygon from the camera is located.
If the camera is 4 units away from the closest point of the model, set Mist Start value to 4.0, and if the model has been scaled to 1 Blender unit in the Y axis, set the Mist Depth to 1.

A Bright/Contrast Node can be used in the compositing nodes to further adjust the rendered heightmap.

6) Important! Render in OpenEXR or another 32 bit format, otherwise the depth data stored in pixels won't look smooth when applied as a Displacement modifier later.

A model like this (download link in the question, in Blendswap),

Should render into something like this:

Use power-of-two resolutions for this image to save render time when used as heightmap.
Use a high resolution, such as 2048x2048.

Now, add a plane and subdivide it 10 times, or any other flat mesh with many polygons.
Add a Displacement modifier, and set its texture to the image you have generated.
Change the Strength value until it looks good for you.

You should end up with something like this:

To make the edges of your relief less sharp, blur the edges of the model in the heightmap image, or in Blender Compositor nodes when generating that heightmap.

Done.

There is probably a different way to do this besides using Mist. The point is to just have the closest points to the camera colored completely black and the farthest yet visible completely white, or the opposite way.


sound control smoke particle I try to create a music, and I would like to do  a simple animation , just a black background with some smoke on the front that would be animated  following the sound of the track, I have no idea how I can achieve this, but I know this community is huge and I hope someone can give me a clue with something I can start with, thank you :)

This is a great Youtube tutorial on using the 'bake sound to f-curves' to drive animation, starting with very basic movements based on the sound graph to being able to control different parts of animation based on different stems of audio. It uses Blender v2.79 but I recently followed along using v2.82 and it is still very comprehendible.


array modifier and object offset Is there a way to generate an array object in exactly the same location as the original as per the following YouTube video (around 4:00), to enable me to rotate it 90 degrees around the empty and snap it to the original at the edges?

https://www.youtube.com/watch?v=emT-CL957HE

I am not sure how he did it in the video - here is my file - img src="https://blend-exchange.giantcowfilms.com/embedImage.png?bid=880" />](https://blend-exchange.giantcowfilms.com/b/880/)
THanks

The principle outlined in the video is the following:

Create a plane (shift+a mesh > plane) with default size/radius 1 and place it at 0, 0, 0
Create an empty (shift+a empty) and change its coordinates to -1, 0, 1
Select the plane
Add an array modifier
In the modifier settings, select Object offset and in the field below select the Empty (just like in the video)
Increase the count of the modifier to 4 and voilà
If you want to move your mesh around, either move it with the empty or hit Apply in the array modifier and the mesh will be independent from the empty but also you cannot modify the array modifier anymore.

Now there is a mirror modifier for some reason there. So before Step 3, add a mirror modifier and you will see no change. You have to go in edit mode and move the vertices to the right (or left), then you will see the mirror double. I didn't follow the tutorial so I don't know why he's doing this.

Simple technique, but it's really far from being intuitive ! Thank you for the video, I learnt what this object offset is all about. You can make all sorts of patterned shapes like cogwheels with this.


This PLY is too dark! How to improve it? Please, how to improve darkness in this PLY: http://156.54.99.175/3d/sodark.zip  ? It is too dark! What's the issue?

I think that there is not a Blender-related issue: the vertex colors are the ones the file provide.

Here's what they look like in Meshlab:

And in Blender:

put apart the different viewport shading by seeing the true solid colours in cycles preview or textured mode in blender render, and you'll see no difference:

You can tweak the vertex colors with nodes as liked:

Note that vertex colors are changed only in the viewport, for rendering purpose, not in the vertex color layer. If you want to store a new, brighter, vertex layer you should:

bake cycles tweaked vertex color to an image texture
convert the texture to a new vertex color layer


Display object textured regardless of viewport display mode I'm working on marine gun turret model and trying to use its drawing/blueprint image to make 3d model more accurate. Blender wireframe view mode is great for modelling but when I switching to it the plane mesh with brawing/blueprint texture also switches to wireframe and texture disappears of course:

And when I switch to wireframe I see the following:

I know about 'Maximum Draw Type' object settings and I probably can set Gun model to 'Wireframe' maximum draw type and don't touch viewport display mode. But somethimes it is better to see gun model in solid mode and sometimes in wireframe. So I need something like 'Minimum draw type' and apply it to gun image plane behind the gun model i'm modelling. Can I do it with Blender?
Thanks in advance.

As you use the unwrapped plane with image texture (or image imported with Images As Planes addon) to show as the reference, it will lose effects from the Solid shading mode because the plane is a mesh and will behave exactly the same as the one you're modeling. So while changing shading mode to Wireframe no image will be visible.

Use background images instead; they don't depend on shading mode. Note that they will appear only in preset orthographic views, however those should be used for precision modeling anyway.
It's also possible to use an  empty of Image type (Shift+A > Empty > Image) which can be useful as reference image. It doesn't depend neither on shading modes nor on ortho views.


Hair Dynamics throwing hair all over the place in Blender 2.8 Hair particles are bouncing all over the place with Hair Dynamics turned on. I have seen other forums where they all had different solutions. Such as turning up the quality steps and others that I tried. None of these solutions worked for me. I am trying to simulate the hair that would follow a horses hair path with maybe a light breeze as he is walking. I came closer to the tail than I did with the mane. The tail I turned down the gravity settings in the field weights to .68 and increased the density target in the hair dynamics settings to 6.0 and the density strength up to one. Then increased the stiffness to 3.0 and the mass to 1kg. However by about frame 6 it starts dancing all over the place. These settings did not work at all on the mane. I uploaded the scene file and a screen shot in case anyone can have a look.

https://www.dropbox.com/s/ijdrtszrcsgifbf/hair_test.blend?dl=0

i don't know if you already figured this out, but when the hair is going all over the place, if you want the hair to move together like a head of hair or like a main, you need to set the voxel size high enough, 1.0 is a good start, and then set the hair target hair density to 0.5, and target strength to something like 0.01.  Goal strength i set to 0.3 for cloth and for hair.  That should get you going in the right direction.

Under field weights wind can be an issue, OH and your hair may to heavy at 0.3kg, try 0.08 kg to start, maybe less.


How to bring 3d effect in surface? Can anyone tell me how this surface looks like 3d which covers red sphere and blue cylinders.

see the blend file here
https://blend-exchange.giantcowfilms.com/b/3570/

The primary problem with the lack of visual space is that you're using an Emission Shader for the blue and the red.  Emission shaders cannot receive shadows so they look more cartoony for something like this.  I would change the material to Diffuse:

I added a UV Sphere with a Solidify Modifier and mixed the Glass Shader with Transparent (mostly transparent) to take the "edge off the glassiness".


Shift+Select a edges of a mesh after applying array modifier here's my problem, I made a curve from a mesh outline, this mesh was itself created from the array modifier.
When using the array modifier, the command for shift+select only selects the piece of the original mesh used in the array.
Ex:

So my question is, is there any way for blender to recalculate what is a selectable line, even if I have to do it by juntion, this could sabe a lot of time in the future.
My objective here would be to convert this edge into a new curve, and so create a rail from an array.

If you hadn't enabled the Merge option in the Array Modifier, although they are in a single object, each duplicate of the mesh created by the array will be separate. To be able to select the entire line of edges, they need to be a single mesh. To join them, select all with A > press M to merge > click on By Distance. This will merge all the duplicate vertices together, giving you one single, continuous mesh. You can also specify a distance threshold.


How stop moving the view when entering walk mode? When I enter walk mode, I want the view to stay in the same position. Here's what the documentation says:

On activation the mouse pointer will move at the center of the view, and a cross marker will appear…

I don't want the mouse pointer to move. I found nothing in settings to adjust this behavior

I just fixed the issue with the help of dann#6226 (Discord)

try to change the shortcut, I suspect it might be doing two things at once.

does it do this if you use the menu to enter and exit?

I was using middle mouse, and multiple actions where having the bind on this button. Changing it to another key and making sure to not be used by other actions too, fixed the problem


Unable to split an edge as expected I have selected one edge and would like to split it. When I click on the command in the menu, nothing happens. When I use the modifier, nothing happens. My selection on the object remains.

I am definitely in edge mode.
It is definitely selected and it is the only selected edge/face/vertex/object.
No UVs.
Shading: nothing selected, neither smooth nor sharp for anything.

I'm pretty new to Blender, so I apologize if this is silly/dumb.

This does not work:
http://blenderartists.org/forum/showthread.php?279119-Edge-Split-Not-Working

Stats:
Blender 2.71
17" MacBook Pro from mid 2009
OSX version 10.7.5 (lion)
8 GB of RAM
NVIDIA GeForce 9400 M 256 MB
2.66 GHz Intel Core Duo Pro

I hope I understood your question correctly, since the topic asks something else than the text. If I got it right, you want to know why you can not split a single selected edge.

I think the problem is that Blender can not connect two vertices with an edge twice.

If you only select one edge and try to split it, Blender would have to insert a second edge between its two vertices. My guess is that this collides with the internal data structure of Blender.

To solve this problem you would have to insert another vertex along this edge first, so that after splitting you will get a "ring" of four edges. Then there are no two vertices connect twice and Blender is happy.


How do you make holes in a cylinder sharp using subdivision surface modifier? I am making high poly model for a gun using subdivision surface modifier, in the pic you can see the barrel with a hole in it but the control loops deform the curvature of the barrel as in it isn't round anymore. How do you make holes in a cylinder sharp using subdiv? Or you shouldnt use subdiv?

I've looked at a lot of similar questions on here, and it seems the only answer is to fill in your holes, then do your subsurf modifier and apply it, and then cut out your holes afterwards.


How to convert a normal map into a curvature map (per pixel curvature) I am trying to generate a sharp curvature / cavity map in the compositor from a normal map but I don't know the node setup.

Here is my reference: http://polycount.com/discussion/comment/2273084/#Comment_2273084

Generate a curvature map from a normal map

Here are two node setups you can use to generate a curvature or cavity map from a normal map, they use the same amount of nodes and give the same result. You can download all the node setups here: https://drive.google.com/file/d/1bixkxs6cSes-J9GVwDeIP7pW2OnGNhYd/view?usp=sharing

Link of the image used: https://drive.google.com/file/d/0B1wP1Y8dmh8aVmN6VUpYMU02Q28/view?usp=sharing (it is from the Unity Store "Rock and Boulders 2" free pack: https://assetstore.unity.com/packages/3d/props/exterior/rock-and-boulders-2-6947).

First node setup (easier to understand):

Second node setup:

You can also use this Emboss node setup to generate the curvature map: https://blender.stackexchange.com/a/102727/23134

You must set your normal map as Linear in the "n" menu to make the value nodes works properly. To export your curvature to another software like Photoshop add a gamma node at 2.2, don't use it to work on it in Blender.

I have written in the frame +R X- meaning that the red channel must use a -0.5 translate in X and it's the opposite with a positive direction the image must be inverted.

The Pixel width determine the thickness of the lines, it is then divided by 2 and inverted one time for each channel so it moves in X +0.5 and -0.5 for the red channel and Y +0.5 and -0.5 for the green channel.

How does it works?

The color channels of the normal maps create a lighting effect, for example the red channel gives the impression that the textures is lighten from the right and the green from the top. By moving the texture in the direction of the shadows, so for the red channel with the lighting coming from the right we move the texture to the left and by inverting the image to invert the lighting direction we move it to the right, then the images are both combined to create a black contour from the expanded shadows. Three Linear Light node at 0.5 are added, one to combine the red channels, one for the blue channels then one for both color channels.

Then the gamma node converts the image from sRGB to Linear.
Blender works with sRGB images, when you set an image to Linear in the "n" menu this tells Blender that the image imported is in Linear mode and must be converted in sRGB to work with it.

Things you can do with the curvature:

you can overlay it with a smooth curvature map, see how to generate it here: https://blender.stackexchange.com/a/100637/23134
you can multiply it with an ambient occlusion map for a diffuse grayscale (in PBR do not multiply it).
you can fake an hand painted effect by adding a color ramp node: https://blender.stackexchange.com/a/90153/23134
See how to create a Dota asset with this texture: https://blender.stackexchange.com/a/101830/23134
you can bake the normal map in 32 bit Float exported in OpenEXR Float Full to improve the curvature map, you can then export your curvature map in 8 bits TGA.
you can bake the normal map in an high resolution then generate the curvature map and scale the image down to get an anti-aliasing effect.
if the normal map is baked in DirectX instead of OpenGL you will need to use a Converter > Separated RGBA and invert the green channel then plug everything to a Converter > Combine RGBA.


Texturing an object with array and curve modifiers guys!I'm currently working on this model of the Great Wall of China and it will be used on a 2D mobile game map, so it's not necessary to be too detailed. So I made a segment of the map and put there some seams.Then used the array and curve modifiers to spread it across the whole map,but my problem is that it's too obvious the textures are repeating.

Do I have to enable to modifiers and then proceed with the textures and the node setup.

Is it possible to make it shift hue or saturation randomly between some values for better realism.I'm also planning to use different textures on the walls and I'm wondering how to make a good blend between the different textures?

Here's a screenshot of my render preview with just diffuse textures.

One of the most common problems with tileable textures is that it's not only the color variations but also the patterns that create the repetitive look.

While your idea to change the hue and saturation values might work on a model that uses real bricks instead of textures, it would probably disturb the seamless look of your model. You would change the values for the whole segment which (depending on your model's mesh) would most likely produce vertical lines between them.

Depending on how much effort you like to invest in that particular task there are two approaches.

The first one is obviously to choose a different texture that is still tileable but hasn't the distinct features that make the repetition so obvious.

The second one needs a significant amount of work but then you might re-use the resulting textures for a different project. You would have to create three or four tileable textures yourself and they should be each tileable to all the others.

There are some tutorials about creating tileable textures in Blender, some really good ones can be found on stym's youtube channel.

The trick would then involve changing only the inner area of the texture while the outer area stays the same. You should also avoid putting too prominent features over the edges, since they would ruin the randomness again.

The next step would be creating several materials for your model, then  apply the modifiers, then select random segments and change the material to a different one.


If property does not exist, use default value in python I have a problem with my script, i want to let the user creating or not the property, but when the property is not used, blender give me an error (its normal).
i have tried things like:

if "myprop" not in own:
    own["myprop"] = MyValue

And

defaultValue = MyValue
value = own("myprop", defaultValue)

But nothing work, i allways get an error.

Maybe the second one can work, but i dont know how to use it correctly.

I have another question, my player use the Character physics, and in the physics menu, we have the Jump Force.
I want to set the Jump Force in python, i know the function for doing this is:

jump_speed

But i dont know how tu use this:

GameObjectSettings(bpy_struct)

Thank you.

Extract and edited from my Movement script:

import bge

def main():

    cont = bge.logic.getCurrentController()
    own = cont.owner

# Verifier si les propriété existent.
Verif_Prop(own)

def Verif_Prop(own):

    # Verifie si la propriété existe.
    if "VitesseMarche" not in own:
        # Non définie, utiliser la valeur par défaut.
        own["VitesseMarche"] = 0.2

Source (i own the script): http://blenderartists.org/forum/showthread.php?381505-FR-EN-Advanced-Moving-Script-for-the-BGE-V2-0


Selection not centered on selected object I have a really strange thing happening right now - I'm sure there's a reason for it, and it's almost certainly something I did when creating the model, but I really want to figure out a way to fix it..

I have this window I'm modelling for an architecture-style render I'm planning. The object is just the window, and everything else is behaving properly, but for this particular object, the selection/center point is way off to one side, and I don't know why.

What is going on, and how do I fix this?

Most likely you moved the geometry while in Edit mode, leaving the origin behind. Use the Origin option in the toolshelf (T) and ‘set origin to geometry’ to move it automatically back to the geometry.


Is there any way to align this circle? I would like to align a circle with the edge under it. But every time I try to rotate it around the z-axis, it never gets perfectly aligned and overall this "window" has some curves in it.

I want it to be rotated the same way as the edges around it as if they were the same plane.

You can do something like this:
click on the edge you to to align, in order so 3d cursor will be there-->add a plane and scale it a bit--> select the object you want to move--> enable snap during transform (small magnet icon) and select snap to face--> press G to grab and X,Y ou Z to move on that axis. Once it is close to the plane, will snap onto it. press enter, deactivate the magnet and delect the plane


Smoothing out surfaces obtained through displacement modifier I'm inspecting ways to smooth things correctly in Blender. I've created this structure out of a cube and displacement modifiers applied to every side. As you can see, results bear some grid artifacts:

My question: is there a way of smoothing that out of the usual subsurf modifier?
I've used procedural textures over vertex groups to create displacement.
Maybe there is a way to obtain smoother geometry by using finer textures in the beginning...
I could resort to some smooth modifier, but there are three of them and the difference is not really clear to me...
Thank you in advance.

the .blend file

Seeing nobody answering, I'll post something myself:

Obviously, used subsurf.
I'll be checking in other ways when I have some more time...


Dragon Project: Unwrapping issues Here is what I have accomplished so far:

I have sculpted out what I wanted my dragon to look like
I re-topologized the dragon into a much less dense design.
I tried my best to unwrap this design to no avail.
I crafted a normal map (Which works very poorly)

I currently still use Blender 2.79 because I really like it, the main thing that I am trying to accomplish is to just one time get one model done all the way through.

I have sculpted a lot of my works, but every time I retopologize and then try to unwrap I always get a disgusting mess as a result. I have seen tons of tutorials on the entire process and I have never seen anything like my result.

So, sometimes when you have no other options you just have to take a step back and throw yourself on to someone's feet and beg for help. I really love this kind of art and have been stuck on this for months.

I have no idea what I'm doing wrong or even how to correct this issue. I can even send you my blend file for further observation if it will help.

This is my original completed sculpt

This is my re-topologized mesh

This is a representation of the unwrap that I have

These are the steps I took to apply the normal map

The seams are pretty bad and that you can still see that my dragon is polygonal as ever

https://drive.google.com/file/d/12t99_Vl1bkYhNsxou2SUD3qYkjIGotnd/view?usp=sharing

To get useful answers try to ask more focused questions.
It's not really clear where exactly you're stuck.

Feel free to post as many specific questions as you need, that's what this site is for :).

To adress small technical issues:

Repair non-manifold vertices (Select > All By Trait > Non Manifold)
Align the centerline more precisely (to mirror properly)
Correct Face orientation, as some are pointing the wrong way
To get rid of the rough polygonal look, you can use 2 levels of Subdivision Modifier.

To align the centerline enable Absolute Grid Snap.
You can use Scale tool to align more vertices at once.

Other tips

Use more circular edge loops on your model for easier unwrapping
Add more seams when possible, to limit the stretching
Learn more about making Normal Maps (you can learn a lot on this site)
Try the new Blender Remesher (since Blender 2.82)

For art critique, you can try BlenderArtists.com.

Repaired mesh with some simple materials and a new UV map.


correct a deformed checker texture? So, I'm trying to recreate this setup:

But, when I apply the checker texture, I get this:

The texture if really deformed.
How can I correct this?

Thanks

Set your coordinates to object.

And make sure that you apply the scale to your object.

(⎈ Ctrl + A in Object mode)

read:

Non-Uniform Scaling during UV unwrap. What is this?

and

Why is it important to apply transformation to an objects data?

and

Why do the measurements of this object seem erroneous?


Unrotate a square polygon with Python: all 3 axes I have a rotated square polygon. And I want to 'unrotate' it so that its normal axes would match world axes.

I'm able to unrotate it on the Z axis by using the face normal and rotation difference (I don't care about translation at this point):
quaternion = Vector((0,0,1)).rotation_difference(face_normal)
rotation = ( +quaternion ).to_matrix().inverted()
obj.matrix_world = rotation.to_4x4()

But for the love of god I can't figure out how to also add face  X and Y rotation to the mix.
Desired result:

Use the edges.
The bmesh module has some methods for faces to calculate the tangent vector of the face based on its edges. For example sake will use the tangent vector created from two longest non connected edges.
Using the face normal, the face tangent and the cross product of the two can create a rotation matrix from the three orthogonal vectors.
The axes are the columns of a matrix, so a rotation matrix with unit vector axes x, y, and z could be
Matrix((x, y, z)).transposed()

if you recall from linear algebra, the transpose of an orthogonal matrix is also its inverse.
Test script, aligns face zero based on the matrix created as above.
import bpy
import bmesh
from mathutils import Matrix, Quaternion

ob = bpy.context.object
me = ob.data
bm = bmesh.from_edit_mesh(me)
face = bm.faces[0]

n = face.normal
t = face.calc_tangent_edge_pair().normalized()
c = face.calc_center_median()

M = (
    Matrix.Translation(c) @
    Matrix((t.cross(n).normalized(), t, n)).to_4x4() @
    Matrix.Translation(-c)
    )

bmesh.ops.transform(
    bm,
    matrix=M,
    verts=bm.verts,
    )
bmesh.update_edit_mesh(me)


How to Programatically Render Multiple Times with Different Materials each I have an animation about 170 frames long (not important).
In the animation I have Balls with a certain Material on them (UV map).

I'd like to have this Animation rendered 100 different times - each time with a different UV Map on the Balls.

Additionally, I'd like each of the 170 set of PNGs to have a different name, corresponding to the UV Map being rendered.

Like:
Ball01_001.png ... Ball01_170.png
Ball27_001.png ... Ball27_170.png
.
.
.
Ball99_001.png ... Ball99_170.png

Is this possible with some code?

Okay, so with m.ardito's help in the above comments, this post on Blenderist and some related questions on Stack, I came up with the following Python script, running it with

blender -b filename.blend -P setting.py

Here's the script:

import os
import shutil
import bpy

uvMaps = os.listdir('C:\\GameDev\\UVs')

for i in range(len(uvMaps)):
    if uvMaps[i].endswith('.png'):
    shutil.copy('C:\\GameDev\\UVs\\' + uvMaps[i], 'C:\\GameDev\\UVs\\Actual\\BallActual.png')

    Scenename = 'Scene'

    #quality
    bpy.data.scenes[Scenename].render.resolution_x = 900
    bpy.data.scenes[Scenename].render.resolution_y = 900
    bpy.data.scenes[Scenename].render.resolution_percentage = 100
    bpy.data.scenes[Scenename].cycles.samples = 200

    bpy.data.scenes[Scenename].frame_start = 0
    bpy.data.scenes[Scenename].frame_end = 44
    bpy.data.scenes[Scenename].render.filepath = 'C:\\GameDev\\Balls Sprites\\Ball_' + uvMaps[i][:-4] + '_Pos1_###.png'
    bpy.data.scenes[Scenename].render.use_placeholder = True
    bpy.ops.render.render(animation=True,scene=Scenename)
    bpy.data.objects["Ball1"].hide_render = True

    bpy.data.scenes[Scenename].frame_start = 45
    bpy.data.scenes[Scenename].frame_end = 77
    bpy.data.scenes[Scenename].render.filepath = 'C:\\GameDev\\Balls Sprites\\Ball_' + uvMaps[i][:-4] + '_Pos2_###.png'
    bpy.data.scenes[Scenename].render.use_placeholder = True
    bpy.ops.render.render(animation=True,scene=Scenename)
    bpy.data.objects["Ball2"].hide_render = True

    bpy.data.scenes[Scenename].frame_start = 78
    bpy.data.scenes[Scenename].frame_end = 108
    bpy.data.scenes[Scenename].render.filepath = 'C:\\GameDev\\Balls Sprites\\Ball_' + uvMaps[i][:-4] + '_Pos3_###.png'
    bpy.data.scenes[Scenename].render.use_placeholder = True
    bpy.ops.render.render(animation=True,scene=Scenename)
    bpy.data.objects["Ball3"].hide_render = True

    bpy.data.scenes[Scenename].frame_start = 109
    bpy.data.scenes[Scenename].frame_end = 135
    bpy.data.scenes[Scenename].render.filepath = 'C:\\GameDev\\Balls Sprites\\Ball_' + uvMaps[i][:-4] + '_Pos4_###.png'
    bpy.data.scenes[Scenename].render.use_placeholder = True
    bpy.ops.render.render(animation=True,scene=Scenename)
    bpy.data.objects["Ball4"].hide_render = True

    bpy.data.scenes[Scenename].frame_start = 136
    bpy.data.scenes[Scenename].frame_end = 160
    bpy.data.scenes[Scenename].render.filepath = 'C:\\GameDev\\Balls Sprites\\Ball_' + uvMaps[i][:-4] + '_Pos5_###.png'
    bpy.data.scenes[Scenename].render.use_placeholder = True
    bpy.ops.render.render(animation=True,scene=Scenename)
    bpy.data.objects["Ball5"].hide_render = True

    bpy.data.scenes[Scenename].frame_start = 161
    bpy.data.scenes[Scenename].frame_end = 181
    bpy.data.scenes[Scenename].render.filepath = 'C:\\GameDev\\Balls Sprites\\Ball_' + uvMaps[i][:-4] + '_Pos6_###.png'
    bpy.data.scenes[Scenename].render.use_placeholder = True
    bpy.ops.render.render(animation=True,scene=Scenename)

    bpy.data.objects["Ball1"].hide_render = False
    bpy.data.objects["Ball2"].hide_render = False
    bpy.data.objects["Ball3"].hide_render = False
    bpy.data.objects["Ball4"].hide_render = False
    bpy.data.objects["Ball5"].hide_render = False

The idea here is that each Ball is coming out from behind a Masked object and travels a number of Frames until it reaches an end, spins down and stops (end_frame). The animation is one long animation from 0 to 183. Each ball begins the travel after the previous one has completely stopped.

By hiding the previous Ball each time, I'm allowing to completely disregard the previous animation - using each Pos (in the file name - from 1 to 6) to be used as a different layer in the Spritehseet I'm creating from these animations.

Since all 99 animation sets are the same, I've created 594 different animation combinations. To be used as sprite animations in a 2D game.

Update:

After running this for three whole days, and barely passing half of the 99 ball renderings, I've added this:

bpy.data.scenes[Scenename].cycles.device = 'GPU'

See a tripling of speed, on average.


How can I have a smooth transition between colors on a low poly model? I don't know what to call it but I have a low poly landscape right here, but my problem is its color.

I want it to have like some sort of gradient effect using different materials. If you don't understand, take a look at the islands in this picture.

It has a kind of gradienty thing with the islands. Basically the transformation of the color from green and brown on this color is seamless, and I don't want a sudden change of color in mine. I know it's impossible to make it follow my landscape with just one material, but I just wanna see if there's a simpler method like using random on object index or a color ramp, and I really don't wanna make this manually.

The gradient texture can do that. If you want to change the gradient orientation, go through a Mapping node first.


Armature bones created in python disappear after exiting edit mode I'm writing an importer for a file format with skeletal data, so I'd like to generate an armature with bones to represent it. I can put the object into edit mode and create EditBones without any trouble, but the bones then vanish as soon as I exit edit mode.

As far as I can tell, exiting Edit mode is supposed to convert EditBones to actual Bones, but that's not happening. Instead, when I exit Edit mode, the armature is reset back to the state it was in before I entered Edit mode.

Here's a test case that can be run line-by-line in Blender's Python console.

# Create a new armature, make it active, and put it into edit mode.
bpy.ops.object.armature_add( enter_editmode=True )

# Add a new bone named "test"
C.object.data.edit_bones.new( "test" )

# At this point, you can see the armature object with two bones ("Bone" and "test") in the Outliner

# Exit Edit mode by switching back to Object mode.
bpy.ops.object.mode_set( mode='OBJECT' )

# Result: the "test" bone vanishes without a trace.

I've tried a bunch of variations, all with the same end result. It feels like I'm missing a step; perhaps something to explicitly apply the edits.

I'm using Blender 2.68a and Blender 2.69.

At the point of creation, the new bone's head and tail is both (0, 0, 0), which gives zero (invalid) length. You only need to modify at least one of them, giving a valid length, to keep the new bone outside of Edit mode:

>>> bone = C.object.data.edit_bones.new("test")
>>> bone.head = (0, 1, 0)
>>> bone.tail = (1, 1, 0)
>>> bpy.ops.object.mode_set(mode='OBJECT')
# The new bone won't disappear after exiting edit mode.


How can you change the "inherit rotation, scale location" for a vertex or empty or an object, not just a bone? When you parent bones to bones, you have options of inheriting rotation, scale and location. But, I don't see those options when I do things like parent an object to an empty or an empty to a vertex. Where are these options?

There is no such option. Objects always inherit their parent's transformation. You can use constraints to selectively copy transformations from other objects to work around this, though.


How do I make custom grass using particles? I've looked everywhere and all I can find is how to make realistic grass using hair particles. What I'm trying to do is create a sort of low poly scene using grass that I modelled myself. I put it into the particle system, but it's all just lying on it's side even though the Initial Orientation is set to Object Z, in fact, non of the orientation settings will make the grass go right side up. The grass models that the particles are referencing are right side up. Some of them are even floating in the air.

How do I make them face right side up? How do I stop them from floating? It would also be good to have them be angled towards the direction that the ground faces are facing.

EDIT

Okay, I figured out how to get them the right direction... sort of. However, now they are appearing on the wrong side of the mesh. I checked the Normals and they are the right direction, and when I flip them to the wrong direction, the grass appears on top, but upside down.

Well after hours of looking things up and getting frustrated, I realised that the origin points of the grass were set to the top and not the bottom. Problem solved!


How can I make my selected edges render at a smooth angle? In comparison, Autodesk Maya had a normals modifier tool in the toolbar which you could select Soften Edge or Harden Edge. Soften Edge would make edges render up to 180 degrees giving it a smooth look without adding any meshes/geometry. I've tried searching many tutorials about Blender how to simply mark any selected edge to appear smooth, but it goes into some crazy process involving smooth all then edge modifiers/bevel steps which actually adds geometry overall.

This video shows what I'm trying to do in Blender, does Blender have anything as easy to mark edges smooth/hard?: https://www.youtube.com/watch?v=vOoZ-wvGmrQ

Go into edit mode, select all edges, press shift+E and drag away from mesh to harden edges. Repeat the process while dragging towards the mesh to re soften soften the selected edges.


Problem with custom button for apply transformations on model want to have button for apply transformations, but when I tried this code, it just doesn't work :(

layout.operator("object.transform_apply(location=False, rotation=True, scale=True)"), text="Reset Trasforms")

can someone please help me?

When adding an operator to a layout, you should only add the API path, e.g. "object.transform_apply". Any parameters can be configured after if you store layout.operator in a variable:

operator = layout.operator("object.transform_apply", text="Reset Transforms")
operator.location = False
operator.rotation = True
operator.scale = True


How to create and export multiple animation/actions in blender? I understand how to create animations, but can't seem to find a good tutorial on how to create, name, and export multiple animations into Wavefront OBJ. Do you know of any or can you please explain?

This going to be exported and loaded using jMonkeyEngine3 and Wavefront OBJ as file type.

I tried using the DopeSheet in Action Editor mode, but it doesn't seem to export even though I had two actions and used the Action.use_fake_user.

I am trying to create an Idle, Walk, and Wave_Arm animations just for testing and learning.

Also, is there a way in Blender to check if animations were exported?

Wavefront OBJ is a widely supported file format for 3D models. It can store vertex coordinates, UVs, vertex normals, face definitions and texture vertices (plus additional, but not standard-compliant data in some softwares).

Animations are not supported. The export option Animation in the OBj exporter does not really export an animation, but an OBJ for every frame in your scene. So it's really a series of OBJ models. Some engines may support this for animations.

As said, the addon uses the scene, so the current timeline. Every object can reference not more than a single action. Therefore, only that one action is exported. Batch export of all actions is not supported.

It would be trivial to do code-wise, but we lack an essential information: which action belongs to which object? All actions are stored globally (bpy.data.actions in python). For which objects an action works, is not stored. You can "run" an action on any object, e.g. matching bones in another, different armature will be animated too.

Thus, you need to switch actions on your animated object, change start and end frame on your timeline and export them one by one. Or adapt the export addon to batch-export all actions for the active object (you may use Action.frame_range to determine the keyframed boundaries).

You can check the export by either inspecting the output folder, or by checking the system console (on Windows, it's as easy as Window > Toggle System Console):

OBJ Export path: 'C:\\Users\\CoDEmanX\\Desktop\\untitled_000249.obj'
OBJ Export time: 0.00
OBJ Export path: 'C:\\Users\\CoDEmanX\\Desktop\\untitled_000250.obj'
OBJ Export time: 0.00


Subdivision-surface giving strange geometry with tris When I try to create a geometry like this

I get defects like this that also show up in the render

How could I avoid this?

I am using a 2 times catmull-clark subdivision surface modifier

Tris and subsurf don't blend well. I would suggest reworking that mesh, try using quads wherever possible. For a hard surface object, tris are ok to a point but once you start to subdivide and smooth it, it quickly gets out of hand. The 'strange geometry' is more than likely caused by the tris pinching together at one point. If you go into edit mode, use wireframes and look at what the modifier is doing. It is mutilating your mesh trying to subdivide those triangular faces.
An alternative
The way I normally go about this and one way to do it is to add the circle and a plane to the scene, delete an edge of the plane so the face goes away and then add it back. You should now have something like this below. (This is the wireframe)

This next step will be unique to every case as it depends how many vertices the circle has. You generally want to estimate at this point and select an even or so amount of vertices and subdivide one side of the plane and join these together. You can manually do this for the entire plane side by side or automate it with the mirror modifier or duplicating and rotating and removing doubles etc.. depends what works best for you.
At this point, it will be easy to see if you are off as the mesh will look odd. You generally want to aim for something that gets nice even spaces and looks symmetrical to the other sides to a point.

You now have a mesh with a circle in it with nice clean faces so you can easily add more geometry as needed and subdivide as much as you want.

For more tips see: How to fill a hole in face?
Edit:
As Aldrik mentions in the comments below, another option is to subdivide the surface to get some geometry and use the To Sphere function with Shift + Alt + S. This isn't always perfect in my experience but can work at times.


Artifacts in rendered geometry which appears okay in openGL / Solid view? I made a low poly piece and realized that in the 3D viewport with rendered mode enabled that I have some artifacts on the boundaries of faces, if you look closely it looks like scratches.

Can anyone help me in my debugging process of understanding what's wrong?
I'm still a beginner on Blender, and there's so much I ignore on the good ways to do things.
Here are the viewport clipping settings:

Here is the component in question: Blend
Originally I tried to fix this problem using BSurfaces, but this was giving me unrelated error messages:

Your real problem appears to be scale:

I think caused by clipping plane being way beyond what is necessary.

You had it set to 1mm - 1km
Overlapping faces
My first impression is that you are trying to fix the wrong problem. I suspect that the reason you are using BSurfaces is because you don't know why you are getting scratches. The scratches is a much more interesting problem, and knowing how to fix those will help you in future modelling.
If I am correct, the 'scratches' as you call them, are the result of overlapping geometry, and this results in z-fighting. The scale you are modelling at compared to the viewing world scale will result big enough rounding errors to make this noticeable.


creating 3D race tracks with elevation I have a top view line of a race track and a height map like this: http://www.gpsies.com/map.do?fileId=nhpgbnphafassllb&language=en

Is it possible to create a curve of the track and plot the height map automatically on the track so I get a result like this:

 Image from this article

There is an addon that allows you to do this, you can download it here:
Import GPX. You will also need to download the .gpx file from the website you linked in your question (select Download as > GPX Track).

Install the addon and activate it.

Go to File > Import > GPX (.gpx)

Select the .gpx file you downloaded, make sure that Use elevation for Z-coordinate option is checked, and clickImport GPX.

It may seem that nothing was added to the scene but you'll notice a new object in the Outliner (with the same name as your .gpx file). You can't see it in the scene because the track is very big (it's 2 km wide). Unless you want to keep it the original size, select the object, press N to open Properties panel, and change scale to something like 0.005. You should be able to see the whole track now. Apply the scale by pressing Ctrl + A > Scale.

Press 3 to view the track from the right side (ortho) and Tab to Edit Mode. Select all vertices (A) and extrude them (E) down on Z axis (Z).

Press S > Z > 0 to align vertices on Z axis.

Go back to Object Mode (Tab), press N to open Tool shelf and enable smooth shading on the object.

Enable Auto smooth option in the Object Data panel, and set the Angle to 80°.

Add Solidify modifier and set preferred Thickness (3 cm look nice).

Add a ground plane, add a white diffuse material to both the track and the ground plane, add lights to the scene (only sun lamp in my scene) - and render.


Is there a way to link unlinked objects? I am creating a 3D environment and there happens to be leaves and vines in the scene. I tried using Alt+D to create linked duplicates but it wasn't working so i used Shift+D to create just duplicates that aren't linked. The problem now is that I'm trying to apply the same materials and I have to go select all of them and apply separately. SO I have two questions here:

How come Alt+D didn't work? Blender clearly says Alt+D in the contextual menu but nothing happens when I use the hotkey.
Is there a way to link unlinked duplicates?

Alt-D should work, in Object Mode? .. To create links (of various kinds), also in Object mode, select the target objects, and the source object last, so it's active, and hit CtrlL.

Then select the aspect of the source you would like the targets to link to. In this case, 'Materials'.


read_factory_settings makes all other operators call fail in a python script ran at startup I want to read a ply mesh at blender startup using a python script given in the command line:
blender --python load_ply.py.
My script load_ply.py basically looks like this:
import bpy

# This line is the issue:
# bpy.ops.wm.read_factory_settings(use_empty=True)

bpy.ops.import_mesh.ply(filepath='mesh.ply')

It works fine until I use bpy.ops.wm.read_factory_settings(use_empty=True) to clear the scene before the import, which gives the following error:
Python: Traceback (most recent call last):
  File "/path/to/blender/blender-2.92.0-linux64/2.92/scripts/addons/io_mesh_ply/__init__.py", line 87, in execute
    context.window.cursor_set('WAIT')
AttributeError: 'NoneType' object has no attribute 'cursor_set'

location: /path/to/blender/blender-2.92.0-linux64/2.92/scripts/modules/bpy/ops.py:132
Error: Python: Traceback (most recent call last):
  File "/path/to/blender/blender-2.92.0-linux64/2.92/scripts/addons/io_mesh_ply/__init__.py", line 87, in execute
    context.window.cursor_set('WAIT')
AttributeError: 'NoneType' object has no attribute 'cursor_set'

location: /path/to/blender/blender-2.92.0-linux64/2.92/scripts/modules/bpy/ops.py:132

Traceback (most recent call last):
  File "/path/to/my/script/load_ply.py", line 5, in <module>
    bpy.ops.import_mesh.ply(filepath='mesh.ply')
  File "/path/to/blender/blender-2.92.0-linux64/2.92/scripts/modules/bpy/ops.py", line 132, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Python: Traceback (most recent call last):
  File "/path/to/blender/blender-2.92.0-linux64/2.92/scripts/addons/io_mesh_ply/__init__.py", line 87, in execute
    context.window.cursor_set('WAIT')
AttributeError: 'NoneType' object has no attribute 'cursor_set'

location: /path/to/blender/blender-2.92.0-linux64/2.92/scripts/modules/bpy/ops.py:132

What is the meaning of this error?
What change does the read_factory_settings operator bring?
I use blender 2.92.0 on Debian 10.
A basic file mesh.ply:
ply
format ascii 1.0
element vertex 8
property float32 x
property float32 y
property float32 z
element face 6
property list uint8 int32 vertex_index
end_header
0 0 0
0 0 1
0 1 1
0 1 0
1 0 0
1 0 1
1 1 1
1 1 0
4 0 1 2 3
4 7 6 5 4
4 0 4 5 1
4 1 5 6 2
4 2 6 7 3
4 3 7 4 0

Separate into two scripts..
As commented by @scurest the read factory settings operator, naffs the contest, in this case context.window becoming None and throwing the error as shown.
Would either make a read_factory.py script
import bpy
bpy.ops.wm.read_factory_settings(use_empty=True)

and with script as above (read factory settings commented out) (-P is equiv of --python)
blender -P read_factory.py -P load_ply.py

Opening a new file with just your imported ply mesh.  (Whereas starting with --factory-startup results in default startup objects and imported mesh)
For me the issue with doing this is my eyesight isn't what it used to be, and need everything a wee bit larger than default.
Another way would be to save an empty blank.blend  Could make your startup file blank.
blender -P load_ply.py blank.blend

downside being if accidentally saved rather than save as is no longer blank.
Similar option is making a blank application template
New default file template?
(Note can add to your user config folder, eg on linux  ~/.config/blender/2.90/scripts/startup/bl_app_templates_user/blank/)
blender --app-template blank -P load_ply.py

other options commonly seen is removing or unlinking all collections / objects from scene / blend,
How to completely remove all loaded data from Blender?


Transparency not working suddenly? Last I checked this was how to make a png alpha. Help, please.

I didn't have the image alpha node connected to the alpha node on principled shader. connected that and it fixed the problem.


How you tell shading is weird looking? I'm new to blender.
When whole mesh's shading is weird.
I can notice that.
but how you determine small part's shading good or bad?

I suppose you're asking if there's a way to see if the normals are all facing the right way? Try to be as specific as you can when posting questions.

You can check this in the viewport overlay dropdown menu, under geometry check the "face orientation" checkbox:

Red means it facing the "wrong" way.

to fix the normals so they face the same direction:

select object
'TAB' to enter edit mode
'A' to select everything
'ALT+N' to get the normals menu dropdown
select Recalculate Outside


How do I create a transition from a curved surface to a flat surface? I'm currently clueless as to how to morph a curve smoothly into a flat surface. As you can see in the image below, the black area has a flat surface, but changes into a curved surface in the red area. How can I model this smoothly?

Thank you.

You could start with a cylinder

add a few loopcuts Ctrl-R
select the  edge rings to flatten Shift-Alt-RMB
Scale along z-Axis Z

After that could select edges and scale the x-axis: