text:
Controlling BGE properties with python script
I would like to know how to change the values of properties added using the "AddGameProperty" option in the game logic UI using python code? I want to write code that changes the 'Property' value in an Action Actuator logic block. I attached a screenshot for a bit more clarity:

If you want to access a property from the current object controller it's :
cont = bge.logic.getCurrentController()
own = cont.owner
my_property=own['propName']

But if you want to access to a property from an other object it's
scene = bge.logic.getCurrentScene()
my_property=scene.objects['other object']['otherpropName']

When I get the property using scene it shows only the default property, I don't get the current value of the property which changes as the game progresses.

Your question is a bit unclear, but you can use use own['propName'] to access a property


text:
How can I exclude meshes or objects from being renderd
I use two planes to emit light.
How can I exclude them from being visible in the final render BUT still have their light?
Thanks,
Armin

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
How can I exclude a light from being rendered but keep it's effects?
Well, its a bit more than that.

I created my scene, lets say a living room and did add a plane.
I did choose Emission as material for the plane. So it is my only light source for that scene. It makes nice light.
Of course the plane shows up in the final render.

But I just want to use the light it creates but don´t want to see the plane it self in the final render in the scene.
Can that be done?
Thanks a lot
armin

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
How to write a simple Wavefront-OBJ exporter in Python?
Recently we were working to write our own software to load a Wavefront .OBJ file.
The file in question uses the .OBJ file format that Blender 2.73 and below generates which is like this:
# Blender v2.73 (sub 0) OBJ File: ''
# www.blender.org
o Cube_Cube.001
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
s off
f 1 2 3 4

The .OBJ exporter of Blender 2.74, in other hand, creates files like this, which are more closer to the definition that one will find in Wikipedia for example:
# Blender v2.74 (sub 0) OBJ File: ''
# www.blender.org
o Cube
v -1.000000 -1.000000 1.000000
v -1.000000 1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v -1.000000 1.000000 -1.000000
vn -1.000000 0.000000 0.000000
vn 0.000000 0.000000 -1.000000
vn 1.000000 0.000000 0.000000
vn 0.000000 0.000000 1.000000
s off
f 2//1 4//1 3//1 1//1

While this is a valid OBJ file, its more involved to parse.
So, the problem is that I would like to write an exporter that uses just a subset of what the .OBJ file format can offer. In this case, just vertices and faces with everything in one line.
I would like to use python inside of Blender to do that but I have no idea on how to start to write this script.

@chicOrtiz I've answered what I think is the bulk of your question, if there are remaining questions either update your question or preferable ask an additional question (separately) which can be answered in a shorter way. Right now (unbeknownst to you perhaps) you have asked at least 4 questions, but I anticipate that it could be more. That's ok, just ask new questions individually, that way we keep information modular and people will find answers to specific questions more rapidly.

Usage example of this simplified .OBJ: LINK

This is a simple OBJ export script, that this writes valid OBJ files that load back into Blender: verts and faces, (no edges or materials).
import bpy
from bpy import context

filepath = "/tmp/simple_obj.obj"

obj = context.object
mesh = obj.data

with open(filepath, 'w') as f:
    f.write("# OBJ file\n")
    for v in mesh.vertices:
        f.write("v %.4f %.4f %.4f\n" % v.co[:])
    for p in mesh.polygons:
        f.write("f")
        for i in p.vertices:
            f.write(" %d" % (i + 1))
        f.write("\n")

This script can be pasted into Blenders text editor and executed, you will want to modify the output filepath.

Post on BlenderArtists: LINK

This question is actually several questions.

how to write code to generate that string
how to write code that writes this to disk
how to write code that wraps this code as an exporter operator
how to add boilerplate to the operator to make it an add-on

Answers to Question 3 and 4 can be found in Blender's TextEditor, and in the many exporter scripts found in /scripts/addons/.., don't be afraid to read all of them to get a better understanding of the boilerplate code.:

TextEditor -> Templates -> Python -> Operator File Export
TextEditor -> Templates -> Python -> Operator Simple

I will deal only with 1 and 2 (note that there are quite a few approaches to doing this, with any luck others will give their intepretations too).
import bpy

obj = bpy.context.active_object
mesh = obj.data

filepath_out = "/home/zeffii/Desktop/temp/single_line.obj"
with open(filepath_out, 'w') as ofile:

    begin = "OBJ File: "
    ofile.write(begin)

    for v in mesh.vertices:
        # line = "v {v.x} {v.y} {v.z} " for full precision
        line = "v {v.x:.4f} {v.y:.4f} {v.z:.4f} "
        line = line.format(v=v.co)
        ofile.write(line)

    for f in mesh.polygons:
        line = "{0} {1} "
        # obj vertex indices for faces start at 1 not 0 like blender.
        indices = [str(i+1) for i in f.vertices[:]]
        line = line.format("f", ' '.join(indices))
        ofile.write(line)

Outputs the following, which is what you were originally after.. on one line:
OBJ File: v -1.0 -1.0 -1.0 v -1.0 -1.0 1.0 v -1.0 1.9393 -1.0 v -1.0 1.9393 1.0 v 1.0 -1.0 -1.0 v 1.0 -1.0 1.0 v 1.0 1.0 -1.0 v 1.0 1.0 1.0 f 1 3 2 0 f 3 7 6 2 f 7 5 4 6 f 5 1 0 4 f 0 2 6 4 f 5 7 3 1

This code makes a few assumptions,

It assumes you only want to export the active object.
It assumes the Object's obj.matrix_world is equal to an Identity matrix, and therefore ignores it. For export purposes it may make more sense to apply the matrix first in case you have transforms going on (scale / rotation / translation / sheering), or pass along the matrix in the appropriate form.
assumes you only want 4 decimals precision
assumes you will eventually be generating a filepath using the exporter, but if you want to know more about paths read the path wiki

here the string formatting mini language uses :.4f to show only 4 decimal places, for web stuff this may be enough, but if you want full precision it's less code:

This is a slight variation of @ideasman42, done by my friend Yorik Van Havre. It writes the file all in the same line. The output can be pasted directly to this HTML file, if someone is interested.
import bpy
from bpy import context

filepath = "/home/chico/Desktop/obj/simple.obj" #Unix filepath template
#filepath = "C:\obj\simple.obj" #Windows filepath template

obj = context.object
mesh = obj.data

with open(filepath, 'w') as f:
    f.write("OBJ File: ")
    for v in mesh.vertices:
        f.write("v %.4f %.4f %.4f " % v.co[:])
    for p in mesh.polygons:
        f.write("f ")
        for i in p.vertices:
            f.write("%d " % (i + 1))

Your Html file is using the wrong document type. By the way you might also have a look at three.js. There are a lots of examples available and a course at udacity. Three.js may use the canvas for output as well.

Use the canvas renderer if you can not use WebGL.


text:
System requirements
I have a laptop with 4GB RAM (hp i3) Intel graphic card of 2gb. I have downloaded blender 2.82. Is it ok to use that in my laptop? I am going to use only Eevee engine. Will using blender cause a damage for my laptop?

Hi, welcome! You could try to use a recent blender version on your laptop, you cannot do any harm, but it ould also not work, if your pc is not recent or powerful enough. Anyway you can always download older blender versions (try 2.7x) and be able to do quite a lot!

I don't think any software could damage a PC / LAPTOP, if the hardware is ok (if a FAN is broken, any software could damage you computer).
You can use cycle or Eevee without any problem.
The only problem you could face is that performances are slow (slow rendering time for example, but you can use a cloud render platform if you don't want to stress you computer).

could you please tell me about cloud rendering and hoe to do that?

check google --> https://www.google.com/search?q=blender+cloud+rendering&cad=h
You upload your .blend file and request for a render. Based on the duration of the render, some credits will be deducted from your account. Usually it's quite cheap.

You'll be totally fine, if you're going to use Eevee only, then there's really nothing to worry about.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Rotating object to axis
Is there a way to rotate my object such that it matches perfectly with the axis? I'm trying to mirror a spherical object but the mirrored product is always off due to (what I suspect to be) rotational issues. I'm new to blender and I've been struggling with this for hours, any help would be welcome

Hi, I just fixed image embedding in your post. Please take some time to understand how to use the question editor image tool. Btw, don't take photos of your monitor, it's not very clear and also complicated, take a screenshot instead (https://www.wikihow.com/Take-a-Screenshot-in-Microsoft-Windows)

About your issue, it's not very clear what you mean, so add details about which exact operations are you performing on the mirrored object, and  add a screenshot of what happens

You can simply use spin for this check out this video
https://www.youtube.com/watch?v=YRgcXnd1Wl4

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Making a rounded solid from curve
Ok, so I am still a bit of a noob, mostly just watched and followed some of the Blender Guru stuff on YouTube, but now I want to try and create something I really want.
The goal is to try and turn a 2d SVG image into something I could give to a CNC Router and have it carved for me. Rather ambitious maybe, but it is the whole point right now of trying to learn how to use blender.
So I imported the SVG, and I got a lot of curves, which using Alt + C I can turn into meshes (I also used Limited Dissolve to remove some of that mess).  Now my idea, was that I would use Insert Faces, to make the shapes smaller, and raise them up a little. A cross section would then be an arch like shape.  All falls apart though because the shapes are irregular, and as soon as something gets too narrow, it starts twisting in on itself.
Is there some easy way of doing this, or am I facing a lot of manually moving vertices around?

https://blender.stackexchange.com/questions/130075/boolean-slow-looking-for-speedup-ideas/130096

Not really the same.  I could easily just extrude everything, but I want it all rounded off after, that is what is hard.


text:
Character model diffuse baking
First time using stackexchange, so bear with me. I'm making a mid-poly character in Blender 2.8 for a third person shooter in Unreal Engine 4. . While I am satisfied with the shading so far, the model takes up nearly 500 megabytes of memory, far too much for a game asset. I am using a combination of 1024 and 2048p resoultion PBR materials.I have been trying to bake a single diffuse, normal, roughness, and metallic map onto a copy of the model with a packed uv map and just a single material, however the resulting texture images look nothing like they should. I'm really new to blender and just learning about how to use cycles baking, so any help is appreciated. Thank you!

What exactly is the problem with the results you're getting?  nice model by the way. :)

So when I bake the diffuse textures from the original model onto the game model, I'll get this weird smearing in certain areas, notably around the face and eyes, and a pretty severe drop in resolution. I can't seem to find a metallic bake option in Blender cycles, either, but I would like to keep the pbr materials functional.


text:
Character Model Hair
I am working on a mid-poly character for a third person shooter in Unreal Engine 4, however I'm running into difficulty with her hair. So far I've been making basic hair cards, mainly just repeating strips I vary by hand to give a spiky appearance. However even with the Cycles principled hair shader, the hair definitely looks like a mess of triangles. Any suggestions?

You have to add transparency to it with a node setup like this: https://i.sstatic.net/yZCKX.jpg

Curves work great with hair. That might be able to fix the problem. Try using curves to do the hair. I've tried a few methods, but curves work the best for me.


text:
Record Animation In BGE
I am having trouble getting the Record Animation setting to work in the BGE. Is it possible to record animated characters that are controlled using BGE's logic bricks with some script? In my script I change the positions of the characters bones.

I don't think the Record Animation option records armature. I think it's only the position/rotation of rigid bodies.

It doesn't seem to record rigid bodies in the BGE. The joint constraints fail to work.

Sadly the Record Animation does not record logic bricks. It only records the actions for physics. Example: a tower falling down and all the pieces scattering across the ground.

Ah that is unfortunate, would be a great feature to record come complex systems that could take ages to animate... Thanks anyways!

This is an older question, but according to this it now does record logic bricks:
https://docs.blender.org/manual/en/dev/game_engine/physics/introduction.html

Indeed, it says so in the document,... but it doesn't work, does it?

This is not intented as an answer, but it's too elaborate for a comment.
I had the same situation. I wanted a couple of objects to 'tumble' keeping their original location. This would have been really easy to accomplish using logic bricks and the game engine. Instead, I choose to write a very simple Python script. I just post here in case some one else finds it useful.
(That being said, this can ofcourse also be accomplished using keyframe animation. I found Python to be more effective)
import bpy, math, random

scene = bpy.context.scene

for actFrame in range(1,250):

    bpy.context.scene.frame_set(actFrame)

    i=0

    for ob in scene.objects:

        if "dark" in ob.name: # or any other condition that suits your needs

            i=i+1

            rotx = actFrame / 30
            rotx = rotx*(1+i/6)

            rotz = actFrame/180
            rotz = rotz*(2.5-i)

            ob.rotation_euler = (rotx, 0, rotz)
            ob.keyframe_insert(data_path="rotation_euler", index=-1)


text:
Blender API : pass collection as parameter of python operator
I am trying to pass a collection as parameter of an operator, but I have following issue :

AttributeError: bpy_struct: attribute "collection" from
  OBJECT_OT_example_op" is read-only

Here is my example code :
import bpy

class Item(bpy.types.PropertyGroup):
    name = bpy.props.StringProperty(name="Name")

class ExamplePanel(bpy.types.Panel):
    bl_label = "ExamplePanel"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_category = "Example"

    @classmethod
    def poll(self, context):
        return True

    def draw(self, context):
        layout = self.layout
        layout.operator("object.example_op", text="Test").collection = bpy.context.scene.collection

class ExampleOperator(bpy.types.Operator):
    bl_idname = "object.example_op"
    bl_label = "Example Operator"
    bl_options = {'REGISTER'}

    collection = bpy.props.CollectionProperty(type=Item)

    @classmethod
    def poll(self, context):
        return True

    def execute(self, context):
        for item in self.collection:
            print(item.name)
        return {'FINISHED'}

def register():
    bpy.utils.register_class(Item)
    bpy.types.Scene.collection = bpy.props.CollectionProperty(type=Item)

    it = bpy.context.scene.collection.add()
    it.name = "item1"
    it = bpy.context.scene.collection.add()
    it.name = "item2"

    bpy.utils.register_class(ExampleOperator)
    bpy.utils.register_class(ExamplePanel)

if __name__ == "__main__":
    register()

Any suggestions ?
Tried with PointerProperty, but don't know exactly how to use it, and got same error.
Thanks :)

Not sure how to pass collection prop to an operator in the layout.  My suggestion is change for item in self.collection to for item in context.scene.collection ie use the scene collection in the operator.  You can however use bpy.ops.object.example_op(coll=[{"name":"Goose"}, {"name":"Herman"}]) to pass the collection to the operator... coll=scene.collection will throw an error too.

Thanks for your answer. I can't use directly context.scene.collection in my case. Will work in this example, but my real case is more complicated, and is not a property of bpy.types.Scene.

Campbell give me an answer in Blender mailing list.
Here is the proposed solution :
import bpy

class Item(bpy.types.PropertyGroup):
    name = bpy.props.StringProperty(name="Name")

class ExamplePanel(bpy.types.Panel):
    bl_label = "ExamplePanel"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_category = "Example"

    @classmethod
    def poll(self, context):
        return True

    def draw(self, context):
        layout = self.layout
        op = layout.operator("object.example_op", text="Test")
        for src_item in bpy.context.scene.collection:
            dest_item = op.collection.add()
            dest_item.name = src_item.name

class ExampleOperator(bpy.types.Operator):
    bl_idname = "object.example_op"
    bl_label = "Example Operator"
    bl_options = {'REGISTER'}

    collection = bpy.props.CollectionProperty(type=Item)

    @classmethod
    def poll(self, context):
        return True

    def execute(self, context):
        for item in self.collection:
            print(item.name)
        return {'FINISHED'}

def register():
    bpy.utils.register_class(Item)
    bpy.types.Scene.collection = bpy.props.CollectionProperty(type=Item)

    it = bpy.context.scene.collection.add()
    it.name = "item1"
    it = bpy.context.scene.collection.add()
    it.name = "item2"

    bpy.utils.register_class(ExampleOperator)
    bpy.utils.register_class(ExamplePanel)

if __name__ == "__main__":
    register()

This example should be in the official documentation. Great example.


text:
sound_bake in command line script
I'm making an audio visualizer which I want to render from the command line. Unfortunately the bpy.ops.graph.sound_bake() function seems only to work from the GUI.
I've found various tutorials, but they all use the gui to create the animation. They always require this fix
bpy.context.area.type = 'GRAPH_EDITOR'

to set the correct context for bpy.ops.graph.sound_bake() to work. This works for scripts run from the gui, but when a script is started from he command line bpy.context.area is undefined.
For materials I already found that instead of
bpy.ops.material.new()
I should use
mat = bpy.data.materials.new("")
to avoid problems with the context. I have not been able how to work out how to do something similar with sounds.
It seems in scripting, using bpy.ops.* can easily give problems with the context, as these function might check the mouse position for some reason, etc. and there would/should be alternative functions. I have no clue on how to find those alternatives. So far I found them by chance, but I have not been able to find an alternative for bpy.ops.graph.sound_bake()
How can I bake an mp3 to an fcurve and apply that curve to an object, in a script?

For Sound Drivers Addon I do a lot of sound baking, so I thought I'd check out how it would perform running in background mode (this has led to another q re running modal timer operators in bg mode). Anyhow using context override the following bakes in bg mode using command
blender -b ./Desktop/baketest.blend --python-text bake.py

using the following as a text block named bake.py.
import bpy
#from sound_drivers.utils import get_context_area
def get_context_area(context, context_dict, area_type='GRAPH_EDITOR',
                     context_screen=False):
    '''
    context : the current context
    context_dict : a context dictionary. Will update area, screen, scene,
                   area, region
    area_type: the type of area to search for
    context_screen: Boolean. If true only search in the context screen.
    '''
    if not context_screen:  # default
        screens = bpy.data.screens
    else:
        screens = [context.screen]
    for screen in screens:
        for area_index, area in screen.areas.items():
            if area.type == area_type:
                for region in area.regions:
                    if region.type == 'WINDOW':
                        context_dict["area"] = area
                        context_dict["screen"] = screen
                        context_dict["scene"] = context.scene
                        context_dict["window"] = context.window
                        context_dict["region"] = region
                        return area
    return None

c = bpy.context.copy()
get_context_area(bpy.context, c)
obj = bpy.data.objects["Cube"]
obj["y"] = 0.0
obj.keyframe_insert('["y"]', frame=1)

speaker = bpy.data.speakers["Speaker"]
bpy.ops.graph.sound_bake(c, filepath=speaker.sound.filepath)
bpy.ops.wm.save_mainfile()

Note for convenience sake I grabbed the filepath from a speaker's sound.  This successfully baked the sound file onto the "y" custom property of the Cube in bg mode.
Use something like How to pass command line arguments to a Blender Python script? to extend functionality,.
NB: Example of creating a simple sound visualiser using sound_drivers.

You sir are my hero for the day. May good things come your way.

There is trouble with selecting only channel ["y"] in the graph editor. So at the start it somehow have to deselect all channels, groups, objects > then select only obj["y"] and then bpy.ops.graph.sound_bake. But with the blender background deselecting is somehow tricky, I don't know how to do that properly trough bpy.data.. because data.actions[].groups[].select ... is not setable trough text editor.

The solution provided by @batFINGER didn't work for me, possibly due to changes in the context override technique. However, I found a similar approach that worked.
First we need the Context
def get_context(type):
    for screen in bpy.data.screens:
        for area in screen.areas:
            if area.type == type:
                context_override = {"area": area, "screen": screen}
                return context_override

after that we set the Context in temp_override also its important to set the active object
def sound_to_sample(context, mp3):
    override = get_context("GRAPH_EDITOR")

    with context.temp_override(**override):
        obj = bpy.data.objects.get("Cube")
        context.view_layer.objects.active = obj
        obj.select_set(True)
        bpy.ops.graph.sound_to_samples(filepath=mp3)

batFINGER's answer is great, but I was getting an incorrect context error until I selected the object I was trying to bake the sound curve onto.
...
obj = bpy.data.objects["Cube"]
obj["y"] = 0.0
obj.keyframe_insert('["y"]', frame=1)

speaker = bpy.data.speakers["Speaker"]
obj.select_set(True)  # This was important
bpy.ops.graph.sound_bake(c, filepath=speaker.sound.filepath)


text:
How to animate hair particle growth?
Can't find how to animate hair particles growing. For some reason keyframes don't work on the hair length parameter.

Set the length to the longest you want the hair to be, and then keyframe the End factor in Particles > Render > Timing:

How can you do that when using a group configuration? I want to grow leaves and trees. but the end parameter disapears when using group or object.

@Jamingrone Sounds like a good candidate for a new question :) We try and keep to one question per post to keep things organized.

Odd that one is ALLOWED to animate the Hair Length in Emission section, and yet this has no effect?


text:
How to combine a blurred emit pass with rest of render?
I am compositing a candle and I want apply some effect to only the flame. So I activated the  Emit pass so it will only be affected, and I applied some glare effects to it.
My question is how can I combine this Emit pass with the rest of the image? Secondly what is the correct order of the glaring nodes I mean by types fog, ghosts, ect?

for a case like yours I would use a color operation such as Screen or Lighten.  A good read about blend modes

I would use add here.
When you set the glare nodes to a mix of 1, then they only output the glare, without the original image.
As for the order of the glare nodes, I would apply them all at once.
By applying them one after the other, the next one includes the effect of the previous one in it's calculation, making the result brighter than it should be (and potentially doing things like putting starbursts on the ghost images..).
Instead apply then all to the same source with a mix of 1, then add them together:

Result:

I fix the 1st problem by multiplying the mask of the flames by the original image then add the filtered flames so it will be added to a 0 pixels.but still dont know the 2nd question

Simple solution is to use Color -> Mix node, set it to add. Plug in the composite image, plus the filtered image. Output it to the viewer and composite output.

but this give me a very bright white color in the flames

You should use Screen for this.


text:
How do I know the number of polygons after adding a subdivision surface modifier without applying it?
How do I know the number of the polygons after adding a subdivision surface modifier without applying it? I have the number of poly after applying.

The number of faces (polygons) is displayed in the Info Header at the top.
The default cube:

After adding a Subsurf Modifier it has 96 faces (2 subdivisions:

In a complex scene with multiple objects you would need switch to Edit Mode or move the object to an unused layer M to see only the number of faces for a particular object.
Before applying the modifier it is also a good idea to change toWireframe display mode to get an impression of how dense the mesh actually is.
The subdivision divides a face into four faces (per level) as mesh subdivision would do. Here an example with algorithm Simple because it appears more obviously.

Catmull-Clark:

The rough rule derived from the above info (without studying the paper) is
sub_faces = original_faces * 4 * subdivision_level

it doesn't cover triangles and n-gons. For a more detailed describtion see:
Subsurf
(thanks to @cegaton)
It provides formulas based on the number of vetices which seem to be more accurate.

But what is the mathematical operation that happen when adding a subsurface modifier.

The the original paper describes the Catmull-Clark subdivision algorithm: CATMULL, E., AND CLARK, J. Recursively generated B-spline surfaces on arbitrary topological
meshes. Computer-Aided Design 10 (Sept. 1978), 350–355.

What about triangles and n-gons? the sub_faces = origianl_faces * 4 * subdivision_level rule doesn't apply there

See the link posted by @cegaton it doesn't cover n-gons but I think it gives an idea on what to expect when subdividing. If you have additional or more accurate informations please add another answer.


text:
Removing alpha from PNG image with set alpha node gives pixelated result
I am making a node group, and I want to remove the alpha from an image. I added a set alpha node and set the factor to 1, but this gives me a crazy result as you see in the screenshot. I 'm using a normal image with black text and an alpha background, but when I add the set alpha node, the image goes crazy.

I also tried using an alpha over node, but that didn't work either.

Have you tried other/different pictures? Is the result the same? What's the picture format btw?

it is a PNG,and I have tried different image and it works.


text:
Can't try Blender 2.8 due graphic card and/or driver
this post may seem repetitive but among many with this kind of issue none of them can help me.
I already updated both drivers (Intel and Radeon) and BIOS, installed Radeon ProRender + libraries and still got the problem.
I checked about both Radeon 520 and Intel UHD 620 and they support openGL 3.3.
Intel driver is already disable here to don't et it create any conflict.
Please, I don't know what else I can do.

Sorry guys, just found the solution. In my case, Blender runs just after a complete uninstall (disabling not enough) of Intel driver.

I have analogous situation with Nvidia Quadro P500 / Intel UHD 620. For some reason Quadro is not able to cover requirement of OpenGL 3.3, I believe that it should be working, and Intel UHD 620 should be able to run Blender without any issues too with OpenGL 4.6.
Many people use some shady dll downloaded from suspicious youtube videos, I recommend using some more reliable source as for example https://fdossena.com/). It was working but it was slow as hell.
Then I suddenly notice small text in Nvidia control panel "Windows OS now manages selection of the graphics processor". Then it was matter of seconds to select integrated card and Blender started without any issues.


text:
Replace Bones with existing bones from other models | 1 animation for 2 differnt models
i think there is a easy way to fix but i cant find it(Beginner).
So i have two different models; 1 Character and 1 weapon both of them have their own pose/bones but I can see that the bones/pose from the weapon are similar too the bones from the character. Now i want to use an  animation of both together but it will only apply to one of the models, not both. How can I fix it?

Select the armature that doesn't have the animation, create a dope sheet window, turn it to an action editor, select your animation in the drop down menu.


text:
Help! I do not know what to do!
I need to get out of animating mode, and I can't! This must be simple. I just do not know what to do.

shift + ctrl perhaps? More information

Hello and welcome. Could you please use a descriptive title that describe the issue? Avoid words like "help" and "question", since that basically describes all posts here.

Could you please put in a lot more info like a video or picture


text:
How does BGE inheritance work
Following the documentation at: https://docs.blender.org/api/blender_python_api_2_76_2/bge.types.KX_GameObject.html I can extend a game object with:
class Mine( types.KX_GameObject ):

    def __init__( self, old_owner): #Note: where has my argument gone?

         #stuff

def activate( controller ): # Called from Controller

    Mine( controller.owner ) # Note: Object is stored nowhere

But I'm missing what's doing the magic here. Somehow the controller not gets passed as second argument to __init__ but as first and the game object is internally (?) exchanged (?) with mine.
So how is this working exactly? Is there some blender-foo or is this something Python can do for me which I'm not aware of?
EDIT:
To make it more clearly: If I do "normal" inheritance in Python this is how it works:
class Parent:

    def __init__( self ):
        self.a = "FOO"

    def talk():
        return a

class Child( Parent ):

    def __init__( self, b ):
        Parent.__init__( self )
        self.b = b

    def talk( self ):
        return self.a + self.b

child = Child( "BAR" )
print( child.talk() )

someglobal[ 'child' ] = child

so the parameter "BAR" gets passed as second argument b to the constructor of class A. The constructor calls the other one from class A and I end up with an instance which I have to store somewhere globally in order to access it from somewhere else.
Compare this to blender's version: The already instantiated object is passed as an argument to the constructor. But it doesn't end up as second argument to __init__ but gets somehow mangled in while the second argument is something else (in fact it seems to be nothing. trying to access it yields in an error). The finally constructed instance is then somehow stored in the global dictionary for objects and replaces the old one.
These somehows and somethings are which I'm interested in. What's happening here?
EDIT2: Taken from the linked documentation:
def __init__(self, old_owner):

# "old_owner" can just be ignored. At this point, "self" is
# already the object in the scene, and "old_owner" has been
# destroyed.

If I only read the python code in this module (my first example) this is not what is supposed to happen python-wise. So what makes self the object and what destroys the old owner? Is this some c-code magic patched into the python interpreter? Or is this some python magic somewhere in KX_GameObject? Or something else?

This is explained somewhat in the link you provided in the comments in example code : "KX_GameObject can be subclassed to extend functionality. For example"

Thank you for sympathising. But I know that. What I like to know is what makes this work. See perhaps my second edit.

So to answer my own question at least as far as I understand it: The magic is in the C++ code. (But I have never embedded python in C++ and only have a rough understanding whats going on here.)
This is from the sources (148ff): Blender uses for it's own game objects a base class called PyObjectPlus. These classes are references via a proxy class called PyObjectPlus_Proxy.
PyObjectPlus defines a method called 'py_base_new' which is called whenever a new object is created which is based on a game object.
This method checks that the first argument is indeed of the 'cont.owner' type and then replaces the object in memory with the extended one.
So it's not "normal" python at all. This comment is from the Sources (194):
/* invalidate the existing base and return a new subclassed one,
 * this is a bit dodgy in that it also attaches its self to the existing object
 * which is not really 'correct' python OO but for our use its OK. */

When inherit an object you will "merge" the attributes, properties, functions:
class Mine( types.KX_GameObject ):

    def __init__( self, old_owner):
        self.life = 100

def activate( controller ): # Called from Controller

    object = Mine( controller.owner )
    print(object.worldPosition) # [0,0,0] KX_GameObject.worldPosition
    print(object.life) # 100

While no inherit:
class Mine():

    def __init__( self):
        self.life = 100

def activate( controller ): # Called from Controller

    object = Mine()
    print(object.worldPosition) # ERROR
    print(object.life) # 100

About, is this something Python can do for me which I'm not aware of? PY classes class-objects

Hi. Thanks for your answer but that's not what I mean. I think I do know how "normal" Python inheritance works. That's why I'm confused how this thing works in blender. I try to edit my question to make it more clear.

I will guess that, as the object (KX_GameObject) that will pass to the child class is already in a memory instance and have its attributes and properties already set the child class is not required to instantiate again that and blender internally maybe does  as "the known" python inheritance and returns the new instance with all the attributes set from the old KX_GameObject.


text:
Membrane cone effect?
I'd like to achieve something similar to this (the mesh shown in the picture.  I don't need it to be rendered as wireframe.  Just need the mesh):

What I have in mind is that I have a plane, and I subdiv and deform it with a circle using something like the hook modifier.  I tried it and apparently the hook modifier doesn't work as I imagined.
In addition, I'd like to not only let the plane deform by a circle, but also by a custom curve.

For something like that mesh specifically, I think you could do that with loop tools add-on, decimate modifier, and wireframe modifier.

@Timaroberts, ok I don't need to make it wireframe.  But let me look into that add-on.

First add a plane, and subdivide it 4 or 5 times.
Select a vertex close to the center, then grow the selection with
Ctrl++ a few times (however large you want the circle to be), and switch to face
selection with Ctrl+Tab >face

This is where the Loop tools add-on comes in as mentioned in the comments. If you do not have it enabled already, enable it by opening user preferences with Ctrl+Alt+U and searching for 'loop' under the add-ons tab:

Press W for the specials menu, and choose loop tools>
circle or just press W >  L  > C
and X  to delete faces.
Switch to edge selection with Ctrl+Tab >edge and select the new edge loop where the faces
were deleted, and enable proportional edit with O
Translate along the Z axis with either linear or sharp falloff ( I used sharp in my example) until
you are happy with how it looks.

As I said in the comments, the decimate modifier would be useful here. Add it set to unsubdivide  with 1 iteration to match the topology of your reference.
You can end up with something like the following:

Gif of the process:

You can use the Screw and Decimate modifiers to create this shape and others like it.
First, add a Bezier Curve and shape it like the slope of that volcano-ish shape.

Next, exit Edit Mode and add a Screw modifier. You can leave all of the options as the default for now, though if you want, you can disable the Smooth Shading option. To better view the mesh, switch into Wireframe mode in the viewport.

Next, add a Subdivision Surface modifier and leave the options as default for now.

Technically, this works fine. However, in the image you showed, the topology has two perpendicular edge loops running diagonally, while right now we have edge loops running horizontally and vertically. To fix this, add a Decimate modifier, set the type to Un-Subdivide, and set the Iterations to 1.

Any of the above modifiers and/or curve can be tweaked to get the desired result. The most useful values would probably be the Steps in the Screw modifier, and the Subdivisions in the Subdivision Surface modifier.

Is there a way to make the volcano not circle shaped, and make the shape of the top and bottom end different?

I'm not sure I understand what you are asking. "Make the shape" different in what way?

I think he means that in the reference image the base is square-ish with four apparent sides, not circular


text:
Check if a mesh has a material in Python
I want to create a script that check if the mesh has a material, if not it applies a diffuse shader with mid grey (value 0.735).

What haver you tried, where is your script going wrong?

I don't know the command line to do that.

If the mesh has no materials then
1>len(obj.data.materials)

although it is also possible that it has a material slot with nothing in it
obj.data.materials[i] is None

and the complete script is
import bpy

def no_material_on(mesh):
    if 1>len(mesh.materials):
        return True

    for i in range(len(mesh.materials)):
        if mesh.materials[i] is not None:
            return False
    return True

def my_grey():
    name = "my grey"
    rval = bpy.data.materials.get(name)
    if rval is None:
        rval = bpy.data.materials.new(name)
        g=.735
        rval.diffuse_color = (g,g,g)
    return rval

def mission1(obj):
    mesh = obj.data
    if no_material_on(mesh):
        mat = my_grey()
        if 1>len(mesh.materials):
            mesh.materials.append(mat)
        else:
            mesh.materials[0] = mat

#

mission1(bpy.context.active_object)

Instead of if 1>len(obj.data.materials) you can simply use if obj.data.materials.

len([s for s in C.object.material_slots if s.material]) will work for any object type.


text:
What is the python script to export the selected meshes in .obj?
I want to export my selected meshes in .obj in a relative path from the .blend file in python.

Related https://blender.stackexchange.com/questions/5382/export-multiple-objects-to-obj

See if that helps you : How to write a simple Wavefront-OBJ exporter in Python?.

Does this answer your question? Export multiple objects to .obj

export obj to relative file path script:
import bpy
import os

blend_file_path = bpy.data.filepath
directory = os.path.dirname(blend_file_path)
target_file = os.path.join(directory, 'myfile.obj')

bpy.ops.export_scene.obj(filepath=target_file)

further export obj options:
bpy.ops.export_scene.obj(
 filepath="",
 check_existing=True,
 axis_forward='-Z',
 axis_up='Y',
 filter_glob="*.obj;*.mtl",
 use_selection=False,
 use_animation=False,
 use_mesh_modifiers=True,
 use_edges=True,
 use_smooth_groups=False,
 use_smooth_groups_bitflags=False,
 use_normals=True,
 use_uvs=True,
 use_materials=True,
 use_triangles=False,
 use_nurbs=False,
 use_vertex_groups=False,
 use_blen_objects=True,
 group_by_object=False,
 group_by_material=False,
 keep_vertex_order=False,
 global_scale=1,
 path_mode='AUTO'
)

The script I provided exports to the folder where the .blend file is located. If you want to add a subfolder, you can simply include it in this line: target_file = os.path.join(directory, 'subfolder', 'myfile.obj'). For an absolute path, you can provide it as a string: bpy.ops.export_scene.obj(filepath="C:/path/to/file.obj").

In Blender 4.0 and up, the operator bpy.ops.export_scene.obj no longer exists. Use bpy.ops.wm.obj_export
bpy.ops.wm.obj_export(
    filepath="filename.obj",
    check_existing=True,
    filter_blender=False,
    filter_backup=False,
    filter_image=False,
    filter_movie=False,
    filter_python=False,
    filter_font=False,
    filter_sound=False,
    filter_text=False,
    filter_archive=False,
    filter_btx=False,
    filter_collada=False,
    filter_alembic=False,
    filter_usd=False,
    filter_obj=False,
    filter_volume=False,
    filter_folder=True,
    filter_blenlib=False,
    filemode=8,
    display_type='DEFAULT',
    sort_method='DEFAULT',
    export_animation=False,
    start_frame=-2147483648,
    end_frame=2147483647,
    forward_axis='NEGATIVE_Z',
    up_axis='Y',
    global_scale=1.0,
    apply_modifiers=True,
    export_eval_mode='DAG_EVAL_VIEWPORT',
    export_selected_objects=False,
    export_uv=True,
    export_normals=True,
    export_colors=False,
    export_materials=True,
    export_pbr_extensions=False,
    path_mode='AUTO',
    export_triangulated_mesh=False,
    export_curves_as_nurbs=False,
    export_object_groups=False,
    export_material_groups=False,
    export_vertex_groups=False,
    export_smooth_groups=False,
    smooth_group_bitflags=False,
    filter_glob='*.obj;*.mtl'
)


text:
How to use the textblock operator in Python
I am trying to write informations of what my script is doing in the textblock. I have the Python script to call it but I don't know how to put text in it:
bpy.ops.ui.reports_to_textblock()
What is the code to write "Hello world!" inside?

An example using simple operator template, the 'REGISTER' option in bl_options set which among other things makes sure "bpy.ops.object.simple_operator" makes its way into the report created by bpy.ops.ui.reports_to_textblock().
A call to self.report(type, message) writes to the report area, when run from UI.  For an Operator report
 The type can be set of one of ('DEBUG', 'INFO', 'OPERATOR', 'PROPERTY', 'WARNING', 'ERROR', 'ERROR_INVALID_INPUT', 'ERROR_INVALID_CONTEXT', 'ERROR_OUT_OF_MEMORY')
class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"
    bl_options = {'REGISTER'}

    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    def execute(self, context):
        self.report({'INFO'}, "Hello World")
        main(context)
        return {'FINISHED'}

After running the simple operator, then ui.reports_to_textblock(),  the "Recent Reports" textblock will contain,
Operator: bpy.ops.object.simple_operator()
Info: Hello World

In case you want to to open a textblock to write reports to, use API methods, textblock below is of type Text
import bpy

textblock = bpy.data.texts.get("RM_Report")

if not textblock:
    textblock = bpy.data.texts.new("RM_Report")

textblock.write("Hello World\n")

Thank you for the answer. I have copy/pasted your code but the textblock doesnt shows up near the render engine selection.


text:
How to update a custom property value modified by script?
I have a custom property that controls two shape keys. When I type bpy.context.object.pose.bones["Bone"]["prueba"] = 1.0 in the console, the value changes but does not affect the shape keys. If after that I click on the value slider of the property it updates the changes. What can I do to solve this?

You might have to force a frame change to get it to update.
   bpy.context.scene.frame_current += 1

Set a frame with scene.frame_set(frame)  or use scene.update()


text:
Rendering stops after 1 frame
When I render an intro or 3d item it stops after 1 frame. To explain better, when I render a 315 frame intro it only renders the first frame and stops.

To render every frame in the range, you have to click the 'Animation' button. Otherwise, it will only render the current frame.


text:
Drag and Drop implementation on blender models
Can drag and drop be implemented on the blender models via web design. As I am trying to make a web app that allows to drop and drop different car parts on a blender car model..

There's not enough information in the question background to allow me to form an opinion. For example, what platform (platform here meaning device + OS) do you intend your web app to run on? What design constraints are you planning to use? For example, it might be more possible to implement drag and drop on a car designed for minecraft, than for another set of design criteria, such as faithfulness to real world parameters. In other words, it would not be likely easy to mount a Corvette door on to a Shelby Mustang.

Well i am trying to, in short create a website which kinda runs on webGl compatible browsers.. platform intended is PC's laptops etc.. And I want to consider real world parameters while doing the drag and drop on the cars..

You definitely can implement drag-and-drop with Blend4Web. This will require some JavaScript coding though. Please ask on the B4W forums for more details.


text:
Create a grid with specific indices
I need a Mesh (640x480) with vertex-indices for 0 to 639 in the first row, 640 to 1279 in the second row, and so on.... I will try to show what I mean in the picture:

First, I tried to use a Plane and subdivide it, but by doing that it destroy any useful indices of the Vertices. In my second attempt I use:
bpy.ops.mesh.primitive_grid_add(radius=1, view_align=False, enter_editmode=False, location=(0, -0, layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))

to create a Grid with bpy. It creates a 10x10 Mesh (9 faces a row), with indices like I need. Now it just have to be bigger. Does someone know a command to create a Grid like I need with the 640x480 vertices?

You can just add the x and y subdivisions argument:
bpy.ops.mesh.primitive_grid_add(x_subdivisions=640, y_subdivisions=480, radius=1, view_align=False, enter_editmode=False, location=(0, 0, 0), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))

Wow - you are rescuing me - i seems to work perfectly.


text:
How do I prevent the body mesh from protruding through the clothes mesh?

I have tried deleting vertices, but that doesn't work. Is there another way to hide this problem?

Couldn't you just pull the clothes away from the body in the parts where they're overlapping?

If you don't want any geometry under your model's clothing at all, the simplest thing to do is to export it using the option to hide faces under clothes in MakeHuman.
This way, all faces under clothes will be hidden for you.

ok cool. thanks, but how would i be able to return the skin in blender or would i have import and export again to see the skin

If you want to keep the model underneath, use the Mask Modifier to hide the unwanted geometry.
Create a Vertex Group and Assign with a strength of 1.0 on the parts of the mesh you want hidden, name it whatever you want. Add the Mask Modifier and choose the Vertex Group.

If you are using Blender, another option would be:
1) Select the clothes;
2) Go into Sculpt mode;
3) Choose the Inflate tool from the tools on the left, and then blow up the clothes a little bit, so it covers the body;
4) Repeat step 3 for all the exposing areas.

I would sure hope you and the OP are using blender. If not then they asked on the wrong site.

@David yes good point...


text:
Where can I specify how many sides 'Select Faces By Sides' uses?
I'm looking for non-quad faces in my mesh and I found someone mentioned Select Faces By Sides. I found that option on the Select menu and in the Help documentation, but I do not see where I can specify how many sides. I must be looking right at it, but any help would be appreciated.

As with most operators in blender, you can access the operator options by either opening the side toolbar (T) in the 3D view or by pressing F6 immediately after running the operator:

That's it! Thanks very much. Will accept your answer as soon as it will allow me to.


text:
What is the reason for partially allowing visibility control of linked objects in the outliner?
When I link an object from another file, the visibility, selectability and renderability icons in the outliner are greyed out and inoperable.  Yet I can control these functions by right-clicking in the outliner or by using hotkeys.
This behavior is different from linking groups where the outliner buttons are fully functional.
Is there some rationale for this partial functionality in the outliner for linked objects (as opposed to linked groups)?  I.e. bug or feature?
(Blender 2.77a, Windows 10 64-bit)

When you link objects the linked object reflects the object in another .blend file. It wouldn't make sense for user to seem to be able to make changes to it.
When you link groups you are not really linking the objects themselves, but a new instance of the collection of objects. Its the same as when operating within the same .blend: new instance of object can be manipulated without affecting the original copies as long as you don't manipulate the data ie. mesh itself for mesh objects.

Yes I understand the principles and advantages of linking.  I'm not concerned with the editability of the linked object.  The question is  related to the visibilty/selectability/renderability buttons in the outliner.  There, they appear to be non-functional but it IS possible to toggle them with hot keys and with right-click.  Linked groups have functional buttons.

This is rephrasing but linked groups are fully editable objects because you're making new instance of objects. You can edit their position, scale, animate them etc. Linked objects are reflecting the actual objects in another file. Its simply how instancing works. If you want fully editable version of the linked object, link object data and put it in a new object, ie. link mesh data and then add new mesh object like a plane, go to data tab and from dropdown menu change it to use linked mesh data.


text:
How can I separate faces without the edges?
So I am doing this tutorial from Cinema 4D, and I am trying to do it in Blender.
My question is: How am I supposed to separate the faces of an Icosphere from each other as shown in this tutorial? (part 1)

You can get the same functionality with Extrude individual Faces (the easiest way to access this function is by pressing space and just typing it in).
If your Pivot Point is set to Individual Origins and you are in Face select mode, you can then also scale the individual faces down independantly with S.
With Select > Inverse and X > Faces, you can delete everything in-between.
Steps:

As an addendum, you can use P > By Loose Parts to make each individual section a separate object.

Also Extrude individual faces is accessible with Alt+E (IMO easier than the space key)

Thanks, that helped but maybe I was to vague, I also wanted to know how to do the effect with the empty making the faces rotate as well. If no one knows how that is ok.

In my opinion, you should create a second question for that. That's relatively unrelated and a lot more complex to achieve.

I think this is the most direct method.

Select All
Mesh -> Edge -> Edge Split
Set the pivot point Individual Origins in the 3D view header.
Scale the faces.

There is a (kind of) hidden tool in Edit Mode called Edge Split (different from the modifier). You can search for it with Space or access it via the Edge Specials Menu (CtrlE). It will split each selected face along it's edge.
You can then use P > By Loose Parts to make each face a separate object.

Edge split is accessible with Ctrl+E

Indeed it is, thanks. Update the answer :D

You can duplicate this functionality using the inset tool (I in Edit mode)

Press I twice to inset and enable individual:

Press Delete and select Faces:

Add an EdgeSplit modifier and set Edge Angle to 0.
Add a Displace modifier.


text:
How to create a cube from two united planes?
I just started with Blender

This image is a left view from a model made from extruded cubes. Normally, when I extrude a cube from its face, 4 new vertices are created and the other 4 are already existent.
How should I proceed if I only want to create 2 new vertices and use 6 already existent ones, that is, use 2 faces to extrude a cube?

There are a few ways to do this, I'd recommend looking into the different types of snapping in blender (Snap to Selected especially)

One of many ways to achieve an extrusion-like result if one face is already in place:

select the two open edges in edge-selection mode

Shift + S: snap 'Cursor to Selected'

set pivot mode to '3D Cursor'

select 'hinge' edge at the bottom

Shift + D to duplicate, S, -, 1, Enter to mirror around 3D Cursor

Fill the result by selecting pairs of edges and pressing F

I use a notebook in which I don't have the Return button nor a numerical keyboard.

@Filipe Toyoshima: Sorry, I should have written 'Enter' (fixed above). I don't think there's a difference between the two here. Or use the left mouse button, that works as well.

Another way could be F2 addon


text:
Stiffness of cloth jacket
I got a Jacket without material-volume (zero thickness) in relaxed position(sleeve-opening at trouser-waistband).
I use Physic's Cloth-Modifier with preset Cotton. Self-collision is activated.
I think i understand what Structural(stiffness) and Bending(stiffness) means.
But i actually have a jiggling shirt without stiffness.
Now the questions:

Does the material needs a volume?
What is the relation to the values (does the object's size modifys the animation)?
Structural and Bending are set to above 2000, why bake the animation an scrunched implusion?
EDIT: add question 3 screenshot

try and turn off collision and see if the same implosion happens

Yes! The self-collision does the implosion. But i need self-collision. I will play with the values.

Do you have the correct verts assigned in the pinning group? What modifiers are you using? Any force fields? collision objects?

By material, I assume you mean the mesh. For the purpose of simulating the cloth, the answer is no you don't need volume/thickness.
You can dynamically add thickness that is not calculated in the simulation by adding a Solidify modifier after the cloth modifier. This may be useful if you want the cloth mesh to appear thicker without slowing down the simulation
AFAIK, no. I have seen no visible differences after running a few tests.
I'm not sure what you mean. Could you try and explain more/add screenshots?
From the wiki:

Structural
  Overall stiffness of the cloth.
Bending
  Wrinkle coefficient. Higher creates more large folds.

Also see the wiki page on cloth simulation.

I have added a screenshot.

@PeterRader I'm not sure what's going on, I wasn't able to reproduce it.. Is it possible you could upload a blendfile?

Nope sorry, copyright/restricted content.


text:
Melt Cup together with handle
How to seamless connect a handle to a cup?
What i have done:

I add a Nurbs-Cylinder and close the bottom. (The cup).
I add Bezier-Curve formed like the profile of a handle.
I add a Bezier-Circle formed like the intersection of the handle.
Set the Bezier-Circle as Bevel Object.
Resize the nodes of the Bezier-Curve.
Render

The Handle touches the cup just a little bit.
How to Seal the handle with the cup?

Convert them to meshes, join these meshes and join their topology, preferably leaving it as "all quads". You can read more e.g. in this lesson, starting from the part 3 of 8.

It would help to see the topology of the mesh.  I would to check out Johnson Martin's topology guides for some ideas on how to cut a hole in a mesh, then use [Ctrl]+[E] > Bridge Edge Loops to connect the handle to the hole in the cup.

There is no Mesh. Why do you think it is a mesh?

you can convert to a mesh with [Alt]+[C].

@PGmath hitting "W" is faster for "Ctrl+e" when it comes to bridging edge loops.

@PeterRader "There is no mesh. Why do you think it is a mesh?". There IS a mesh. Everything that you can display is a mesh. Right now you are just generating this mesh with a nurbs surface. Blender is a very bad nurbs editor, but an excellent mesh editor. That's why you need to quit using nurbs to represent your surface. Use subsurface subdivided meshes - e.g. cage meshes to represent your surface.

You could use the bridge function of the loop tools add-on if you have it enabled. You can find it under user  preferences> add-ons if you don't. In the attached gif I used a curve for the handle of my cup, and a cylinder for the cup itself. Press  Alt+C  to convert the curve object to a mesh object, then  Shift and RMB to select both objects. Then press  Ctrl+J to join your meshes. Now you can delete the unnecessary faces, and bridge the appropriate edges. To do so, use  Alt+RMB  to select your first edge loop, then Shift+Alt+RMB to select your second edge loop, and click bridge under the loop tools options.

And if i do not like to work on Meshes?

@PeterRader Blender's Curve surfaces editing capabilities will not be satisfactory for what you want. Blender is at it's heart a Polygon modelling tool.


text:
Insert keyframe menu does not show up
When I press I to activate the Insert Keyframe Menu (in the 3d-view/pose mode) a keyframe is created immediately instead of showing the menu.
This used to bring up the menu. I must have changed some setting but I have no idea which.
How do I get the menu back?

Seems like you've chosen some keying set in the timeline header.

You can clear this by pressing the X next to the name if the selected keying set.

One possibility, you may have unknowingly activated Automatic Keyframe feature and selecting a Keying Set. If this is the case, you need to deactivate the feature by toggling off the red "recording" button in Timeline window, and remove the keying set:

Interface for 2.8X and later will look as so:

In my case I had to select the object, ex. camera, if it is not selected pressing I doesn't work.


text:
Join an edge in a mesh
I need to join this edge (pic below) to the rest of the mesh, how I do that?

That edge is joined to the mesh, but there are three ways that it might look the way it does.
1) It's not part of a FACE. To make it part of a face, select the (at least 3) vertices that you want it to be part of, and press F. That will make a polygon out of those vertices. If you've chosen correctly, that edge will be part of the polygon as well
2) It's a 2-sided polygon. This is a really strange case, but the solution is usually just to delete it. You can switch to Edge Select mode, select that edge and delete it. You might have to do that multiple times to delete all of the edges that are on top of each other.
3) It IS part of a face, but you're looking at the backside of the face. Polygons only have one face. This is defined by the direction that the normal is facing for that polygon. The normal is a vector that points out from the surface of the face, perfectly perpendicular to it. If you're looking at the polygon from the same side as the normal, then you can see it. If you're looking from the other side, the polygon will disappear, and seem transparent. To solve this problem, confirm that it's a face and which direction it's pointing. In the viewport, TAB into edit mode. Then press N to open the view properties pane if it's not already open. Somewhere in that pane, you'll see a trio of buttons. One of them will be a box with a face highlighted. Click that box to turn on "Draw Face Normals." This will draw a little (or not so little, if the size is set too high) blue line that indicates the normal. The line starts ON the face of the polygon, and points outward. Look at the polygon from the same side as the normal (the normal should be pointing more-or-less at you) and the face should be visible.
Hope that helps!

Hey Matt, sorry for late reply! Many thanks for you help, in fact the solution for me here was in your first item but the others two was very helpful! Again, many thanks :)


text:
Is there an OBJ Sequence import script or add-on?
An OBJ sequence is necessary for making complex animations using other 3D programs. I want to use blender and realflow together.
Realflow particle simulations and meshed realflow simulations are in *.bin format.
These images suggest this was at some point in development:

How can I import an OBJ sequence?

What exactly is your question?

For now I want OBJ Sequence importer for blender in form of script or addon. Do you maybe have it maybe ?

and then to import realflow simulation from reaflow to blender that is what I want.

HERE IS SOLUTION:
http://blenderartists.org/forum/showthread.php?292968-AddOn-Import-OBJ-Sequence-As-Shape-Keys%28on-one-object%29

@JovicaŠalović This really works?


text:
Cycles Special Passes - Artefacts in Multipass Compositing
Hello my dears blender artists!
I think you know there is too low numbers of quality tutorials about Cycles special passes:

z depth
Vector/speed
UV
obj/mat index
and manually generated World position or Point volume position pass
normal pass

These Cycles extra passes are not optimized on high end standard. It cannot be used in compositing without artefacts.
Could you make some professional tutorial or course on some complex scene where we could see how to solve these issues?
For example:

z depth VS speed blur in composite (what to apply first? how to solve dancing edges when we use z depth pass on beauty pass? We want physically correct blurs of that kinds like in render with that blur which is slower...)
UV pass - remapping object with complex topology and UVWs
as everybody knows - index luma passes are not optimized - we always have anti aliasing dancing edges in any compositing software
I know for new criptomatte pass , but how to solve these...
point position pass: we cannot have it as the others passes - we have to do render again in mode: "material to override all other".
Yes, yes I saw it: https://www.youtube.com/watch?v=AEerSx19ydU
but that is out of date solution - when we use this manually created pass - for example Fusion, Nuke, After, Blender cannot read it correctly like Vray or Octane point position pass.
https://youtu.be/kwzbO38q_fQ?t=197
Usage of this technique is something amazing and powerful
Normal pass for example to apply in relighting scene or part of scene?

Of course, all of these artefacts we cannot see when we do compositing on single frame, but big part of blender community has these problems in composited animation.
Cycles multipass rendering is not better in last blender verions, the problem is the same as in 2.50, 2.60 and in 2.70 generations!
I would like to buy this tutorial or course as many others members
or at least to support you in some platforms like Patreon...

Have a look at number 1 in the list : https://blender.meta.stackexchange.com/questions/1/what-questions-should-be-definitely-off-topic/6#6

I'm voting to close this question as off-topic because tutorial requests are considered off topic on this platform.

Hi Jovica! That's the wrong place to ask for a tutorial. This is a Q&A site, see the help page. Better ask at blenderartists.org or even better: just ask a question and add what you've tried so far.

I think it would get answered well quickly on blenderartists.org, that's a good advice.


text:
How to know which object is using a material
How to know which object is using a material.
I know that a material is used 4 time -> picture under:
I'm searching a solution with python and I'm blocked here :
bpy.data.materials['Y.000a'].users

But this function only return the number of users and not the name.
Of course the solutions, that I'm searching for, doesn't have to obligatory use python.

I wouldn't be surprised if there were a better solution, but here's what I use:
mat = bpy.context.object.active_material
objs = []
for obj in bpy.data.objects:
    for slot in obj.material_slots:
        if slot.material == mat:
            objs.append(obj)

Then objs will be a list of objects with the material mat. If you only know the material name and it's not the active material, simply replace the first line with:
mat = bpy.data.materials['material_name']

Note: This does not check if a material is assigned to any faces on the object, simply if the material is in one of the slots for that object.

You could also use objs = {}, and then in the if-statement: if not obj in objs: objs[obj]=[slot]; else: objs[obj].append(slot) to get a dictionary of the individual material slots, or add a counter to get the index (if required).

The outliner is a great place to find things. Entering a string in search field located in the header not only finds items containing the string but highlights them for easy access. The search menu also offers choices for case sensitive and complete matches.

Many things can be found in the outliner - from objects and meshes to materials, textures, modifiers, vertex groups, constraints, bones and actions.
While image names used by blender internal textures can be searched, currently images used in nodes (internal or cycles) can't.

For a non-python solution, it's the best way I think. Thank you.

I want to go over all of my materials and select (or get indices of) faces to which that specific material has been applied to. I haven't been able to find a good solution for doing that as of now. I would appreciate if you can take a look at my question here and see if you can offer a solution?

I have created a simple addon for this:
http://blenderartists.org/forum/showthread.php?317507-Addon-Simple-addon-to-display-material-relationships
Example screen

Please provide more than a link in your answer. Can you for instance, show a screenshot of your work?

Link only answers are discouraged. (If the link goes, so does the answer)

This isn't the best way, but for I'll post for completeness.

Another quick way is to select an object which you know has the material and press ShiftL> Material.
This will select all the objects which use the active material of the selected object.

Thanks in my case I use multiple scene and layer so it isn't very usefull.

@lucblender It does have limitations, but it might be useful for a quick check in a one scene file. You could toggle all layers visible with the back-tick (`) key (The key below the escape key on most keyboards)

For a quick check it's the best solutions I agree with that.

MNAME = 'myMaterial'
obs = [o for o in bpy.data.objects
       if type(o.data) is bpy.types.Mesh
           and MNAME in o.data.materials]

or
obs = []
for o in bpy.data.objects:
    if isinstance(o.data, bpy.types.Mesh) and MNAME in o.data.materials:
        obs.append(o)


text:
VSE audio playback problem in 2.80
I have several meta-strips with lots of sound strips in each. I want to edit one of these meta-strips, but when I playback the meta-strip from inside, Blender still plays all sounds from all other meta-strips.
I decided to mute all meta-strips except from the current, but it did't help. Sounds are playing from all strips, even from muted off. Even if I mute all of the strips, sound is still playing (video behaves as expected, though).
In 2.79 it works just fine.
What happened in 2.80? Is it a bug or I missed some tiny option?

I'm seeing something very similar in 2.83. Did you ever get to the bottom of this?

Sound like a bug you should report. Remember to mention that it worked correctly in 2.79.


text:
low framerate and crashes in the viewport by using not even up to 30% GPU and CPU
Hello im new in blender and wana ask is that normal by my PC that it this scene if i play it for the first time i got 1 to max 15 fps . And my GPU and CPU usage is not even by 30% .
And if i for example want to move 8000 simple cubes or duplicate them all blender freeze  for around 5 mins .
Propably it is something stupid , but i can not get it . Pleas give a tip

8000 cubes is quite a lot, isn't it? And if they're all rigid bodies... How about you try turning simplify on? (Under the Render settings, tick it and set Max Subdivisions in view to 0).

It's not @ThunderBolt832

Bake your rigids (sim) in the first place and then render the scene.

@brockmann I tried it , but it doesn't help. I think to that copping or moving simple cubes shouldent be a big problem  . Its look like blender don't want use my pc resources. Now i try to render a simple scen witch falling cubes . First time i have enable cuda (gpu and cpu) and he use only 100% of my cpu . Second time i disable cpu and set GPU in render tab . Now look my task manager like this : GPU 20% CPU 20% used


text:
Weird reflection in final render
I've been going through the blender guru's 2.8 neon tutorial, and the result was looking alright, but in the final render a weird reflection appeared.

My brick texture is nonreflective, but this doesn't even seem like a normal reflection regardless. Even weirder, the reflection does not show up in the rendered view of the viewport, so I had no idea this was going to happen.

Does anyone have any idea what could be causing this?

This looks more like an object than a reflection to me, my guess without seeing your file is that you have an object hidden in viewport yet set to visible in the render.


text:
How to change the top radius of a truncated cone with Python?
My Blender version is 2.76. I used the python command
bpy.ops.mesh.primitive_cone_add(vertices=16, radius1=R1, radius2=R2, depth=L)
to create a truncated cone. In order to animate my scene, I need to increase or decrease the top radius (radius2) of the cone. How can I set its value from within my python script?

Do you need to identify and select the rings via python, or just change their diameter? I mean does everything need to be automated via python from object creation to top ring animation? Or can anything be done manually?

Do you want to edit the parameter itself after creating the object? or scaling the top vertices would work for you?

Thanks, Todd McIntosh and Georges, for your questions. I do not know what you mean with "rings". I use the truncated cone as a whole mesh, and  I want to vary its top radius2 between 0 and radius1 so that the truncated cone changes its shape between a pure cone and a cylinder

Given your new snippet of info re cone to cylinder edited answer.

Cylinder to Cone via shape key.
Here is a take on this using shape keys, Can't use 0 as the radius on the cone tip as it will not be able to be joined as shapes.
import bpy
context = bpy.context
scene = context.scene
# no active object
scene.objects.active = None
R1 = 4
R2 = 4
L = 10
# create cone
bpy.ops.mesh.primitive_cone_add(vertices=16,
                                radius1=R1,
                                radius2=R2,
                                depth=L)
cone1 = scene.objects.active
# create opposite cone
bpy.ops.mesh.primitive_cone_add(vertices=16,
                                radius1=0.001, # can't use 0
                                radius2=R2,
                                depth=L)
cone1.select = True
# join as shapes
bpy.ops.object.join_shapes()
# remove cone1
scene.objects.unlink(cone1)
bpy.data.objects.remove(cone1)

Change the R1, R2 for the second cone to suit your needs.  Altering the shapekey value will give cone at 0.0, and cylinder at 1.0
context.object.data.shape_keys.key_blocks['Cone.001'].value = 1.0

Thanks, batFINGER, for your proposal. I tested it and found, that only "Cone.001" is remaining in the Scene. I do not see any influence of cone1 on the result. My intention however is to maintain the identity (name, location, rotation etc) of an existing truncated cone (cone1 in your example) and just to vary its smaller radius.

Moving the shapekey slider from 0 to 1 changes the mesh from cone to cylinder.  This value can be animated or changed via a script. The shapekey panel, as illustrated in answer is on the mesh (data) properties panel... hmmm perhaps I need to make an animate gif.

Correcton: Thanks, batFINGER, for your proposal. I tested it and found that only "Cone.001" is remaining in the Scene. I do not see any influence of cone1 on the result. My intention however is to maintain the identity (name, location, rotation etc) of an existing truncated cone (cone1 in your example) and just to vary its smaller radius. Can you give me an additional advice?
If I also use your last line of code (context.object.data.shape_keys ...), Python reports a KeyError: 'bpy_prop_collection[key]: key "Cone.001" not found'. Should I add another line of Python code to avoid this error?

The shape key may be called "Cone", I prob. had another cone in scene when testing.  I'll upload a blend file with the value animated..


text:
Exporting the blend file as a python script
I am looking to automate the steps I took to build the model in the blender GUI as a python script. You can think of it like how it would be if blender had a 'export as .py' which I could take and execute to render the model.
Blender does spit out some python in the window above the file toolbar, but I cant use it to automate the model rendering as it is incomplete and seems to only have the configuration, here is a screenshot:

Is this any different then your earlier question? If it is different, please edit and make clearer the differences. Else, please do not post duplicate question, just because your first one did not get answered yet.

As mentioned in the previous question, this doesn't have one general answer, no simple way to export manual steps to an automated script. It's best to ask a specific question about how to automate one specific scene, and to learn from the techniques presented there how to generalize to other problems.

@David, I deleted the earlier question as it is ambiguous.

@TLousky With reasonable time I assume I can write a python script to generate a particular model, however, I was looking for a generic solution if any. If there are no such solutions, please put that as a answer and I will accept it.

@VinayBinny the way you should of gone about this, was edit your first question to say what this does (this one is clearer); instead of deleting the first and asking another.

Why would you want to use a script to create the model?

I think the user wants some sort of' macro recording' functionality in Blender to recreate all taken steps procedurally (like say to replay it as an interactive tutorial?). As far as I know there is nothing like it currently implemented, officially or as an addon. It might be possible through Python scripting though, I am not much into programming, but it sure looks like a complex and involved task.

@DuarteFarrajotaRamos the minimal info in the question says that executing the .py file should render the model.. If I understand that correctly this is very possible, but not in the way they expect

It does, not sure, but I believe the user meant something like a "build history" where the script would recreate programmatically the whole scene repeating step-by-step the user sequence of operations and input. That what it sounded like, not sure if this is entirely possible.

Could maybe do something with bpy.ops.ui.reports_to_textblock() output.

As hinted at by the comments, this is by no means an exhaustive or a general solution. At the moment there is no real way to save or export the actions you perform in Blender as a script or macro.
So the only way to automate things is to learn and understand the Blender Python API well, and to write a specific script to automate each task. You'll often be able to reuse code from one script in other scripts, and even to write generalized libraries that perform specific tasks, but it won't really allow you to tackle ANY problem or to automate all cases.
So here's a script that automates the creation of a rock like object from a cube, and will show you:

How to add primitive objects (in the example: cube, camera)
How to add modifiers and to set their properties.
How to add materials and set their properties.
How to add textures and set their properties.
How to set the render output path.
How to render to a file.

There's lots of things it does not show, including:

How to add and set up lighting.
How to change render settings (resolution, etc).
A zillion other things like animation, rigging, compositing, creating complex node based materials in cycles, simulations, particles... and more.

For these you'll have to read and learn other specific techniques and APIs.
Here's the code:
import bpy
from math import radians

# Add the base cube shape
bpy.ops.mesh.primitive_cube_add()

# Create a reference to the active object (which is the cube since we just added it)
cube = bpy.data.objects[ bpy.context.object.name ]

# Add a new subdivision surface modifier and set its view and render subdivision levels to 4
subsurf1 = cube.modifiers.new( "Subsurf", "SUBSURF" )
subsurf1.levels = subsurf1.render_levels = 4

# Add a new displacement modifier, set its texture to a new noise texture, and set the displacement strength to 0.15
disp = cube.modifiers.new( "Disp", "DISPLACE" )
disp.texture = bpy.data.textures.new( "DisplaceNoise", "NOISE" )
disp.strength = 0.15

# Add a 2nd subdivision surface modifier, and set its view and render levels to 2
subsurf2 = cube.modifiers.new( "Subsurf", "SUBSURF" )
subsurf2.levels = subsurf1.render_levels = 2

# Add a camera and set its location and rotation values
bpy.ops.object.camera_add( location = (0, -4, 0 ), rotation = (radians(90),0,0) )
camera = bpy.data.objects[ bpy.context.object.name ]
bpy.context.scene.camera = camera

# Give our rock object a new material
cube.active_material = bpy.data.materials.new("Rock.Mat")
mat = cube.active_material # Create a shorter reference variable to the material

# Set material properties
mat.diffuse_intensity  = 0.45
mat.specular_intensity = 0.1
mat.use_shadeless      = True

# Create a new musgrave texture and apply it to our materials as its active texture
mat.active_texture = bpy.data.textures.new( "Diffuse", "MUSGRAVE" )
mat.texture_slots[0].color = (0,0,0)         # Set base texture color to black
mat.texture_slots[0].texture_coords = 'ORCO' # Set texture coordiantes to object

# Set render filepath and render
bpy.context.scene.render.filepath = "/tmp/rock.png"
bpy.ops.render.render( write_still = True )

The unimpressive result of this script:

From what I can understand, you want Blender to export a .py file that you can run to render your model. This is possible, but not in the way you might think.
Instead of placing all of the data from the .blend file in a .py file, just use the command line arguments for Blender to render in the background.
Requirements:

Python installed so you can execute the python file (or you can do this from a terminal)
If using Windows, Blender must be in the system PATH. (You can also run commands with the full path to Blender C:\Program Files\Blender Foundation\Blender\blender ...)
A .blend file to render

Now to render externally (Command Line)
blender -b <path to .blend file> -o <file name> -f <frame number>
-b: Renders in the background
-o: Sets the output filename. If it starts with // then it will be relative to the .blend file
-f: Sets the frame to render
So if I had my file test.blend, I could run blender -b test.blend -o //output -f 1 to render the first frame in the background and give it the name output0001.png relative to the .blend file.
There are many other arguments to use for Blender, so to see the whole list, either run blender -h or read the manual for more information.
Using Python
import subprocess
subprocess.call('blender -b test.blend -o //output -f 1')

Save this in a .py file and you can execute it to run Blender in the background to render your file.
This method is nice if you want run the process on a whole directory of .blend files, or something similar.


text:
How does blender work?
I am new to 3D modelling and blender, I come from a programming background, I am fascinated by the kind of things blender can do. The more I use blender the more questions I have and the more confused I am, I am always thinking of how does blender do it? I am really interested in knowing how blender works internally but I understand that needs a lot of background in 3D modelling/Geometrical algorithms. Is there any resource that you would suggest that will help me make sense of what is happening in blender or 3D modelling? ex: How is a image texture mapped? How is occlusion handled? etc.

You might want to have a look through pixar in a box at Khan Academy

I think the main thing you will want to learn first are the basics of a computer graphics development. This generally means learning the basics of OpenGL programming. You will also need to go over some basic trigonometry and linear algebra for this. Once you understand these basics it should be a lot easier to just google for individual topics and find explanations.
I learnt most of this at my university introduction to computer graphics course, so maybe you could try looking at an online course covering these topics. I noticed a couple of online courses that look like they cover similar ground, although I haven't tried them myself, so I don't know the teaching quality:
https://www.coursera.org/course/webgl
https://www.edx.org/course/computer-graphics-uc-san-diegox-cse167x-1
When you get more familiar with the basics, you can try looking at blender's source code as well. I wouldn't recommend that for a complete beginner though, as it can be quite hard to follow in places.


text:
How do I make 'X-Axis Mirror' available in Pose Mode?
More often that not, while posing an armature, I want to mirror the pose across the X-axis, so that when I move "brow.L", "brow.R" also moves in the same way.
You can copy and paste a mirrored pose, or select both bones prior to performing a transform, but both of these options aren't particularly good workflow wise.
In edit mode, in the tools panel, under options you can enable "X-Axis Mirror" to copy all transforms across the X-axis in real time, but this option is not available in pose mode.
I'm not very experienced with python, but edit source reveals:
col.prop(ob.data, "use_mirror_x")

My understanding is that "use_mirror_x" refers to a boolean property, but I have no idea how to find where that boolean property is defined or if it would be possible to modify it to get the same result in pose mode.
Any advice on this is appreciated. Maybe there's a better way to achieve this?
Thanks.

For who still want to find a solution now, and assuming you want to do this in Blender (not scripting).
In Blender 2.93 select your armature, go to Pose mode, press N on your keyboard to bring up the panel, in Tool enable X-Axis Mirror. Then you're good to go.

If you want to mirror your animation form the left side to the other side during pose mode you just need to select the whole left side then copy the pose with Ctrl+C.
After that press Ctrl+i to go to your right side and finally press Shift+Ctrl+V to paste the the X flipped pose, that way you'll have a perfect mirror of both side


text:
How do you script batch changes to bone constraints
I need to understand how to script a batch change to bone constraints like copy location, limit distance etc.
I have a couple of hundred bones, with a set of constraints on them. It took forever to set up and I need to tweak them.
A friend who has written scripts for me before gave me a solution to one problem. I've tried adjusting the code he wrote to do something else but I've written something wrong. I don't know the syntax and proper context.
I tried changing my friend's code in the text editor:
import bpy

armature = "Armature.001"

arm = bpy.data.armatures[armature]

for bone in bpy.context.object.pose.bones:
    bpy.ops.pose.select_all(action='DESELECT')
    bone.bone.select = True
    arm.bones.active = bone.bone

for constraint in bpy.context.active_pose_bone.constraints:
    print (constraint)
   if "Copy YZ only" in constraint.name:
        CopyLocationConstraint.use_y = True

bpy.ops.pose.select_all(action='SELECT')

I understand what this SHOULD do but don't see the relevance of some of these lines of code. I need some assistance to find what I am missing.
The next bit I need to change is a distance value on transformation constraints (to_max_y = 2cm?). I guess the solution is similar but I need to learn how to word changes like this correctly.
I've spent hours reading examples online but still need help.

FYI, this is very close to what's called a "scripted rig." Scripted Rigs are a big deal in The Industry. Searching for those terms will help with your research, generally, but maybe not specifically with Blender.

Thank you for that Matt. This project has grown from a standard rig into something that requires scripting to be efficient. I do think that, going forward, learning to script it all is necessary. Would the term "scripted rig" refer to setting up bones and the constraints entirely via code?

I'd go about it this way.  I use context = bpy.context on test scripts, that can later be pasted into Operator or Panel code.  Work from the context object, rather than using a name like "Armature.001" (guilty myself on many occasions)
I use list comprehension out of preference.
import bpy
context = bpy.context
# the rig object
rig = context.object

# all copy location constraints on all pose bones
constraints = [c for pb in rig.pose.bones
                 for c in pb.constraints
                 if c.type == 'COPY_LOCATION'
               # and "XY" in c.name
              ]

# set the desired properties
for c in constraints:
    c.use_y = True

# similarly for Transformation
# type from mousing over add constraint in UI
constraints = [c for pb in rig.pose.bones
                 for c in pb.constraints
                 if c.type == 'TRANSFORM'
              ]

for tc in constraints:
    tc.to_max_y = 0.02 # given 1 blender unit is 1m

# all constraints from preselected pose bones
constraints = [c for pb in context.selected_pose_bones
                 for c in pb.constraints
              ]

Thank you @batFINGER, I did this with variations for a couple of constraints and it worked perfectly. Although the last part of the code got this error.
TypeError: 'NoneType' object is not iterable

As I am new to the coding side of things I would like to understand what the difference is between the method I was originally trying to adapt and list comprehension.

One last question, as I want to learn how to script these changes, what do the following lines mean and where can I find some kind of tutorial or guidelines?
"c for pb in rig.pose.bones"
"for tc in constraints:"

https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions


text:
Can I run a Python script step by step in Blender?
Can I run a python script step by step with normal blender, a build, external software or an addon?
I'm developing a script (town generator) and I want to  to execute the code step by step like a debugger. Is this possible?
Edit: it's possible with the eclipse software check this link

Can you explain the purpose? do you mean interactively step over the code as with a debugger?, or just that you execute code one line at a time (so a python script could be streamed from an external source, or to listen for commands and execute one line at a time, for eg). What kind of interaction with Blender are you wanting to do between each line execution?

I want to execute the code step by step like a debugger. I would that blender execute the code a bit like if i enter my pyhton script line by line in the python console and like that i can see what append.

Please edit your question to make this more clear.

You could also use the Blender BreakPoint Addon, it stops at breakpoints and dumps local or global variables. The hosting site also provides video tutorials.

You can use this amazing addon. It'll allow you to debug blender with PyCharm.

In 2020, the easiest way to do this is with this extension for Visual Studio Code: https://marketplace.visualstudio.com/items?itemName=JacquesLucke.blender-development

I have upvoted Justin, but would like to stress it: DO choose this option.

Launch blender from a terminal emulator.
Add import pdb; pdb.set_trace() to your code where you wish to start debugging from.
Run your code and you'll be put into the Python debugger, where you can use sEnter to step through the code.

See the pdb documentation for more info on usage. Also for the nicer ipython debugger (features syntax highlighting and tab completion), you can use ipdb.

No, Blender can't do this with the default feature set.
Edit: As Aldrik says, you can use pdb, however blender can't step over python code in its own interface.
There are however some things you can do that may be of interest to you.
Load as a python module
If you compile Blender as a Python module, you can use any Python IDE which supports debugging/stepping, The times I really wanted to step over Python code I did this, however it can't be used with a Blender window active.
See:
How can I run blender from command line or a python script without opening a GUI?
Use the command line REPL
REPL, being (Read–eval–print loop).
Python has a module that you can use to create a python interactive console, it can be used to execute scripts one line at a time.
See: http://docs.python.org/3/library/code.html
The example below executes 3 lines of python script, then prints a variable which the script defined:
import code
namespace = {}
console = code.InteractiveConsole(
    locals=namespace,
    filename="<blender_console>",
)

# Code - can be anything...
# load an entire text file into this for eg.
my_code = [
    "a = 1",
    "b = 2",
    "c = a + b",
]

# execute the script line by line.
for line in my_code:
    console.push(line)

# get something back from the executed code
print(namespace["c"])


text:
black and white hair texture to colored hair
I have a picture with white hair and the background is black and i want to make the black background to be transparent and the white hair to be colored or even better if i could add another texture on top of this one and it applies only to the hair somehow. How can i do this? Im still not very good with nodes...
So, Here is the image i got

You only want to do image manipulation with compositing right? Nothing really related with hair particle system? And your picture is already rendered or you can make make modification and re-render it?

The picture above is the image that i want to use as texture so its not particle hair that i have rendered. Its just an image that i found online that i want to use as texture. But as you see the background on this texture is black and the hair is white. And i want to change that with nodes so the black background become transparent and the white hair becomes colored. So i'm not using particles. I try make polygon hair

And since you want to use node I assume it's with cycle?

Yeah that is correct

I assume that you already made a simple cycle material and UV wrapped your hair texture on your polygon hair.
Transparency
Since your picture is full black and white you can use it as an alpha mask to mix between your hair color and a transparent shader:
Add --> Shader--> Mix Shader
Add --> Shader--> Transparent BSDF
For the mix shader

Factor : your picture in an Image Texture
First Shader input : BSDF of the Transparent BSDF node,
Second Shader input : your color Shader, for the example I simply use a diffuse shader but you can make more complex shader to have a better result
Output of the Mix Shader to the Sufrace of the Material Output Node

Apply a texture
Now you can add a texture to your hair.
You can add pretty much any kind of color input, in my example case I used just a noise Texture and a color ramp as the input color of a Diffuse Shader, but you can use an Image Texture or any other input color.
Here is the node setup :


text:
Random black spot in mesh
What is causing this offending face to turn black when viewed from certain angles? I think its flipped the wrong way but I'm not sure how to fix it.
No manifold errors pop up when I hit ctrl + shift + alt + m. It also looks completely fine when I disable the texture.

The offending face is highlighted above
Texture here
Blender version Used : 2.70

Comments are not for extended discussion; this conversation has been moved to chat.

I know this is waaaay too late, but anyone finding the same problem may find:

Could be flipped normals.
I think here is actually a case of that spot not having the material on it. There are ways of adding multiple materials to meshes (some faces have different textures than others). Fix this by going into edit mode, select blank faces and add a material.


text:
How can I change the viewport shading to 'Texture Solid'?
Can someone tell me where is texture solid button in 2.77?
I cannot find it anywhere.
I cannot see it in Shading menu.

What 3D viewport shading mode are you in? Textured, Solid, Wireframe, Rendered...?

The shading panel's options are Mode dependent.
Means,Every shading mode has his own option,Texture Solid is one of the Solid Mode option so you have to be in Solid Mode to enable it.

If you notice on the dock below the viewport screen it says what mode your in. I'm in object mode. Next to it there is a white circle. Clicking on it will show your options on how to display the objects. after clicking on a drop-down (or drop-up) menu will appear.
Click on Texture. Done!


text:
Python: How to Export All the UV Layouts in Blender
Can anyone confirm this script works in 2.79b? (I can't use 2.8 at the moment) The script is supposed to export the UV layouts of all selected meshes at once to a specific folder, but I'm no coder, and I'm not having any luck with it yet.
Error Message:

Source: https://gifguide2code.com/2017/01/24/python-how-to-export-all-the-uv-layouts-in-blender/
import bpy

selObj = []

for obj in bpy.context.selected_objects:
 selObj.append(obj.name)

bpy.ops.object.select_all(action='TOGGLE')

i=0
while i < len(selObj):
 bpy.context.scene.objects.active = bpy.context.scene.objects[selObj[i]]
 bpy.ops.object.mode_set(mode="EDIT")
 bpy.ops.mesh.select_all(action='TOGGLE')
 bpy.ops.mesh.select_all(action='TOGGLE')
 bpy.ops.uv.smart_project(angle_limit=66.0, island_margin=0.0, user_area_weight=0.0)
 f="C:\\Users\\Desktop\\UVLayouts\\" + bpy.data.objects[selObj[i]].name
 bpy.ops.uv.export_layout(filepath=f, mode='PNG', opacity=0)
 bpy.ops.object.mode_set(mode="OBJECT")
 bpy.ops.object.select_all(action='TOGGLE')
 i+=1

Hi. What do you mean "Can anyone confirm this script works"? What error are you getting? What is leading you to believe that it isn't working?

By "confirm this script works," I just meant test it.
Here is the error message: https://ibb.co/6rhN7gk

sample blendfile: http://pasteall.org/blend/index.php?id=51680 The script seems to require a folder called " UVLayouts " on the desktop.

In future, please use the built-in image uploader. See: https://meta.stackexchange.com/questions/75491/how-to-upload-an-image-to-a-post

To the answer
It won't work if the code in line 17 - "C:\\Users\\Desktop\\UVLayouts\\" doesn't exist on your computer as a Directory (or blender doesn't allowed to modify in that directory). You could change the path of it or create a directory on that location with the same naming.
The mechanism of how bpy.ops.uv.export_layout work on opening a file make this error. It use open, a python built-in function to deal with file.
It requires the parent folder of the filepath exist, as discussion in here.
You should check out the discussion carefully since that is a basic knowledge of python. And for my advise, you could always search the error in google, the answer for your problem is there most of the time. You need to search it with a good key words, in this case FileNotFoundError: [Errno 2] No such file or directory will do the work.
The Script
As Martin Z point out, we should fix this script a little bit to make it more robust (for those not familiar with programming):
import bpy
import os

# You should change this varibale in "here" to match your own directory path
# use '/' or '\\' for hirecacy
target_dir = "C:/some/directory/"

selObj = []

for obj in bpy.context.selected_objects:
 selObj.append(obj.name)

bpy.ops.object.select_all(action='TOGGLE')

i=0
while i < len(selObj):
    bpy.context.scene.objects.active = bpy.context.scene.objects[selObj[i]]
    bpy.ops.object.mode_set(mode="EDIT")
    bpy.ops.mesh.select_all(action='TOGGLE')
    bpy.ops.mesh.select_all(action='TOGGLE')
    bpy.ops.uv.smart_project(angle_limit=66.0, island_margin=0.0, user_area_weight=0.0)
    full_file_name=target_dir + bpy.data.objects[selObj[i]].name

    # This code detected whether target_dir exist, if not, then create it
    dirname = os.path.dirname(full_file_name)
    if not os.path.exists(dirname):
        os.makedirs(dirname)

    bpy.ops.uv.export_layout(filepath=full_file_name, mode='PNG', opacity=0)
    bpy.ops.object.mode_set(mode="OBJECT")
    bpy.ops.object.select_all(action='TOGGLE')
    i+=1

Run this script in blender 2.7x text editor, and change target_dir = "C:/some/directory/" to your desired location. And still, strongly recommend to read the code carefully.

I fail to see this as an answer to the question. It is not clear to me how one could export UV layouts of all objects in a scene in Blender after reading this.

@MartinZ Well, my bad. Going the issue too deep into basic python problem. But I thought I did answer the question in a better way when people doesn't know how script is work. Anyway, update a little bit more answer.