text:
Dynamic EnumProperty by type of selection
Iam searching for a method to get a EnumProperty by the type of the object (Lamp, Geo, Camera) thats selected in the viewport.
E.g. If the selected object is a lamp, it would be nice the enum dynamically adds new properties to the existing ones, like Energy and Color.
Here is my Code:
bl_info = {
    "name": "tester",
    "description": "",
    "author": "",
    "version": (0, 0, 1),
    "blender": (2, 7, 0),
    "location": "3D View > Toolbox",
    "warning": "", # used for warning icon and text in addons panel
    "wiki_url": "",
    "tracker_url": "",
    "category": "Test"
    }

import bpy
import re
import math
from mathutils import Vector
from math import pi

from bpy.types import Panel
from bpy.props import (StringProperty,
                       BoolProperty,
                       IntProperty,
                       FloatProperty,
                       FloatVectorProperty,
                       EnumProperty,
                       PointerProperty,
                       )
from bpy.types import (Operator,
                       AddonPreferences,
                       PropertyGroup,
                       )

# ------------------------------------------------------------------------
#    store properties in the active scene
# ------------------------------------------------------------------------

class mySettings(PropertyGroup):

    # apply values to LOC ROT SCL
    TransformationProperty_ = EnumProperty(
        name="Apply Data to:",
        description="Apply Data to attribute.",
        items=(('LOC', "Location", ""),
               ('ROT', "Rotation", ""),
               ('SCL', "Scale", "")),
        default='LOC',
        )

# ------------------------------------------------------------------------
#    myTool in objectmode
# ------------------------------------------------------------------------

class myTool_panel_objectMode:
    bl_label = "myTool"
    bl_space_type = "VIEW_3D"
    bl_region_type = "TOOLS"
    #bl_context = "objectmode"

    @classmethod
    def poll(self,context):
        #scene = context.scene
        return context.active_object is not None

    def draw(self, context):
        layout = self.layout
        scene = context.scene
        mytool = scene.myTool

        row = layout.row()
        col = layout.column(align=True)
        rowsub = col.row(align=True)
        rowsub.prop(mytool, "TransformationProperty_", text="")

# ------------------------------------------------------------------------
#     classes for new tab system since 2.7.0
# ------------------------------------------------------------------------

class myTool_ObjectMode(Panel, myTool_panel_objectMode):
    bl_category = "Test"
    bl_idname = "my_objectmode"
    bl_context = "objectmode"

# ------------------------------------------------------------------------
# register and unregister functions
# ------------------------------------------------------------------------

def register():
    bpy.utils.register_module(__name__)
    bpy.types.Scene.myTool = PointerProperty(type=mySettings)

def unregister():
    bpy.utils.unregister_module(__name__)
    bpy.types.Scene.myTool

if __name__ == "__main__":
    register()

Thanks in Advance,
Christian

Thanks for this great explanation CoDEmanX! Code works nicely and logic makes sense to me. Also thanks for your BTW - never thougt about Blender/Python conventions - nice to know.
For those who wants a multiple selection callback, Ive updated the code a bit:
bl_info = {
    "name": "tester",
    "description": "",
    "author": "",
    "version": (0, 0, 3),
    "blender": (2, 70, 0),
    "location": "3D View > Toolbox",
    "warning": "", # used for warning icon and text in addons panel
    "wiki_url": "",
    "tracker_url": "",
    "category": "Test"
}

import bpy
import re
import math
from mathutils import Vector
from math import pi

from bpy.props import (StringProperty,
                       BoolProperty,
                       IntProperty,
                       FloatProperty,
                       FloatVectorProperty,
                       EnumProperty,
                       PointerProperty,
                       )
from bpy.types import (Panel,
                       Operator,
                       AddonPreferences,
                       PropertyGroup,
                       )

# ------------------------------------------------------------------------------------------------
# get object type list
# ------------------------------------------------------------------------------------------------

def get_object_type_list(object_list):
    objectTypes = []
    for i in object_list:
        objectTypes.append(bpy.data.objects[i.name].type)

    return list(set(objectTypes))

# ------------------------------------------------------------------------
#    store properties in the active scene
# ------------------------------------------------------------------------

def my_settings_callback(scene, context):

    items = [
        ('LOC', "Location", ""),
        ('ROT', "Rotation", ""),
        ('SCL', "Scale", ""),
    ]

    # get selection
    selection = bpy.context.selected_objects

    # get selection type list
    selection_types = get_object_type_list(selection)

    if len(selection_types) == 1:

        # check for lamps
        if selection_types[0] == 'LAMP':
            items.append(('NRG', "Energy", ""))
            items.append(('COL', "Color", ""))

    return items

class MySettings(PropertyGroup):

    # apply values to LOC ROT SCL
    transform = EnumProperty(
        name="Apply Data to:",
        description="Apply Data to attribute.",
        items=my_settings_callback
        )

# ------------------------------------------------------------------------
#    myTool in objectmode
# ------------------------------------------------------------------------

class OBJECT_PT_my_panel(Panel):
    bl_idname = "OBJECT_PT_my_panel"
    bl_label = "My Panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "TOOLS"
    bl_category = "TESTER"
    bl_context = "objectmode"

    @classmethod
    def poll(self,context):
        return context.object is not None

    def draw(self, context):
        layout = self.layout
        scene = context.scene
        mytool = scene.my_tool

        layout.prop(mytool, "transform", text="")

        # print selected property
        print (mytool.transform)

# ------------------------------------------------------------------------
# register and unregister functions
# ------------------------------------------------------------------------

def register():
    bpy.utils.register_module(__name__)
    bpy.types.Scene.my_tool = PointerProperty(type=MySettings)

def unregister():
    bpy.utils.unregister_module(__name__)
    del bpy.types.Scene.my_tool

if __name__ == "__main__":
    register()

Thanks again,
Christian

You can supply EnumProperty() with a callback function for the items-argument and create a list of tuples based on context:
bl_info = {
    "name": "tester",
    "description": "",
    "author": "",
    "version": (0, 0, 2),
    "blender": (2, 80, 0),
    "location": "3D View > Toolbox",
    "warning": "", # used for warning icon and text in addons panel
    "wiki_url": "",
    "tracker_url": "",
    "category": "Test"
}

import bpy
import re
import math
from mathutils import Vector
from math import pi

from bpy.props import (StringProperty,
                       BoolProperty,
                       IntProperty,
                       FloatProperty,
                       FloatVectorProperty,
                       EnumProperty,
                       PointerProperty,
                       )
from bpy.types import (Panel,
                       Operator,
                       AddonPreferences,
                       PropertyGroup,
                       )

# ------------------------------------------------------------------------
#    Scene Properties
# ------------------------------------------------------------------------

def my_settings_callback(scene, context):

    items = [
        ('LOC', "Location", ""),
        ('ROT', "Rotation", ""),
        ('SCL', "Scale", ""),
    ]

    ob = context.object
    if ob is not None:
        if ob.type == 'LIGHT':
            items.append(('NRG', "Energy", ""))
            items.append(('COL', "Color", ""))

    return items

class MySettings(PropertyGroup):

    # apply values to LOC ROT SCL
    transform : EnumProperty(
        name="Apply Data to:",
        description="Apply Data to attribute.",
        items=my_settings_callback
        )

# ------------------------------------------------------------------------
#    Panel in Object Mode
# ------------------------------------------------------------------------

class OBJECT_PT_my_panel(Panel):
    bl_label = "My Panel"
    bl_idname = "OBJECT_PT_custom_panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Tools"
    bl_context = "objectmode"

    @classmethod
    def poll(self,context):
        return context.object is not None

    def draw(self, context):
        layout = self.layout
        scene = context.scene
        mytool = scene.my_tool

        layout.prop(mytool, "transform", text="")

# ------------------------------------------------------------------------
#   Registration
# ------------------------------------------------------------------------

classes = (
    MySettings,
    OBJECT_PT_my_panel
)

def register():

    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

    bpy.types.Scene.my_tool = PointerProperty(type=MySettings)

def unregister():

    from bpy.utils import unregister_class
    for cls in reversed(classes):
        unregister_class(cls)

    del bpy.types.Scene.my_tool

if __name__ == "__main__":
    register()

Note that if you select a Lamp, set the property to e.g. Color and then select a non-lamp object, the enum will show no label in the panel, but return LOC (the first item) to a script. If you select a Lamp object again, it will return COL again!
You can not set a default item if a dynamic enum is used.
https://docs.blender.org/api/current/bpy.props.html#bpy.props.EnumProperty
BTW:

Your Blender version tuple is wrong, it needs to be (2, 80, 0)
You don't need an extra class to support vertical tabs
In unregister(), the del keyword is missing to remove the PointerProperty
Blender / Python conventions are to use snake_case for names like bl_idname, but CamelCase for e.g. classes (with capital first letter)


text:
When is it ok to subdivide?
I'm new to blender and I wonder what's the best way, with the least side effects, to add more detail to a model's face. It seems that the loop cut is the cleanest way of doing it but at the cost of adding unnecessary geometry. Subdivide seems like the obvious solution to a lot of problems but then you can't use a lot of features as it can create ngons. So when do you use it?

I remember when I was a beginner and I had a lot of questions of finding a best balance to get things efficient. The subdivision surface modifier divides every polygon into 4 and smooth out the objects shape. I suggest looking up for beginner tutorials (you have a lot to learn there) and you will start to see how things are going. Check out "blendtuts.com", "blenderguru.com" and many others.

The modifier converts ngons and triangles to quads (4 sided polygons), but they are not so efficent to use on a curved surface when using the modifier.

Just to be clear I am not talking about the subsurf modifier but about the subdivide tool and the ngons it can produce on adjacent faces. Are you saying that its always bad and you might have to find a case with the least harm done?

It depends on whether you really need the subdivision everywhere in the model, if you just want to create geometry for a window then knife cut would be the better choice. For sculpting you need more (dynamic) geometry. So the answer would be it depends.

@stacker Then you get N-gons...

@someonewithpc When doing knife cuts, yes. I think the questions is unclear because it is not mentions which modifiers occur in the workflow. I'm afraid there is no single rule of thumb.

@stacker Loop cut is your best bet.

@someonewithpc this not an easy question as it might appear. I would currently subdivision only for use vertices for particle emission,duplication or landscapes. Sculpting requires retopo, loop-cuts only work well with decent meshes...

It really depends on what the model will be used for in the end. If the model is going to be animated/deformed, then clean topology is very important. Otherwise, maybe not as much.

Just to be clear.. Are we talking about the subsurf modifier or subdivisions in edit mode?

@stacker No modifiers at all.

@gandalf3 Just subdivide in edit mode.

When modelling something you would always add minimal geometry (eg. loop cuts) and work with it until the shape of the object cannot be further improved with the current geometry! This is very important, as if you start adding too much geometry initially, you will get lost and you make your task exponentially harder, because you will have to manually manipulate so much more verts.
Now, in most cases you should avoid subdividing altogether, before you are finished modelling, in a sense. Meaning that with your modelling you would have laid out the optimal topology of the model and would have made sure that every vertex and every face is absolutely necessary for describing the object and maintaining the topology! Only then you would subdivide, to get a smoother result (as your object would be approximated at a higher resolution).
Having said that, don't consider the subdivision taboo and absolutely neglect it. Usually it is good practice to check the topology of your mesh, every once in a while, by subdividing it and seeing if it flows and looks natural... this way you can also spot duplicate vertices or holes in the mesh.
I am not a pro modeler and maybe someone could argue this is not always the case, however those are some tips that help me.

Subdivision is OK when you need the geometry some examples could be:

Landscapes

Particle Systems (here used to emit buildings)

In general loop-cuts should be the way to go, they allow later refinement because they follow the mesh's topology (most important in organic modelling).
In a subdivided mesh you would have to adjust each and every vertex, instead of selecting a loop as shown here:

It depends, like architectural buildings and that kind of not so curving objects, no problem to use ngons and triangles, ngons help a lot when modeling those building. Flat shading is the key when rendering those objects.
Example: left side object has flat shadind and 24 vertices, including ngons, right side has smooth shading and 156 vertices, no ngons. When rendering  they looks identical.
People use many times smooth shading and add unnecessary loopcuts to objects what does not need smooth shading, its a habbit.

source: Stack Exchange

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

sort: votes


text:
Molding an object - Negative mold
I am trying to use my 3D Scanner and 3D Printer to make Molding of the objects using non printable materials.
For instance, if I 3D Scan a cup I get an OBJ / STL model ready to work with. But I would like to make a mold of it. Does blender have any resource to "invert" the solid? Then I woul print the mold and pour the material inside this "bucket" of mold.
Thank you.
Best,
Rick

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


text:
How to iterate through the vertices in a polygonal mesh?
I have a mesh that I have created using data that I have. I have managed to load this mesh into blender using bpy.
I know I can iterate through all the polygons using something like this
for poly in mesh.polygons:
    for idx in poly.loop_indices:
        print(idx)

But what I really want is an index to the vertex for each polygon, so I can set a specific color from another file.
Can someone help me with this?
Thanks

poly.vertices gives you the vertices for each polygon.  However, from your question it sounds like you want something to uniquely identify each vertex.


text:
How to add details from an image to a model
I have modelled a tombstone from a reference image.
Pretty happy with the general model, but would like to also model the skull and the wavey lines as you can see in the reference image.
But how would you do it?
I tried to do so by creating vertices one by one but it didn't workout.
I also did some seaming work, but stopped for now.

I would go for either bump mapping or sculpting.

There are several ways to about getting the detail or illusion of depth on a simple or flat model. The fastest IMO for a use case like this is to use the Displace Modifier. Simply Unwrap your object or the face you want the detail on or in this instance, it might be better to do a Project from View and then scale the UVs to match the image.
Next add a texture and set the Mapping coordinates to UV and use that texture in the displace modifier. After that, just tweak the settings until you are satisfied, the Strength value is the one you will primarily use.
Two things that can improve the final result.

Convert the image to grayscale (black and white) as the displace modifier works best with explicit black and white values
Use a flat surface and subdivide it several times rather than modeling extrusions etc, the modifier will handle all of that

Here is a quick test using the same image as yours with the steps I outlined above on a flat plane.


text:
How to define a colorband in Blender 2.74 using python script
I need to define a colorband using python script, but I don't know how to do this in Blender 2.74. In 2.49 version has a command colorbandDiffuse but in 2.74 version I can't find out.

Cycles and Blender Internal render engines have a different Materials ecosystem. They're similar in many ways, but different on important details.
Blender Internal
import bpy

mat = bpy.data.materials.new('experiment')
mat.use_diffuse_ramp = True
elem = mat.diffuse_ramp.elements.new(0.25)
elem.color = (1,0.2,0.3,0.3)

Cycles
Involves adding nodes, or appending a premade material from a different .blend (also easy but a different topic)
import bpy

mat = bpy.data.materials.new('experiment4')
mat.use_nodes = True

ramp_node = mat.node_tree.nodes.new('ShaderNodeValToRGB')
elements = ramp_node.color_ramp.elements

elem = elements.new(0.25)
elem.color = (1,0.2,0.3,0.3)

# the default 'new material' always has a 'Diffuse BSDF' node,
# here we obtain a reference to it
diffuse_node = mat.node_tree.nodes['Diffuse BSDF']

# nodes need to be hooked up!
mat.node_tree.links.new(ramp_node.outputs[0], diffuse_node.inputs[0])

The reason I mention appending an existing material is because it can be a lot more convenient to tailor a complex material once and use many variations of it in subsequent blends by appending the material and adjusting known values. Scripting Cycles materials can be a little verbose :)
If you still have questions then hopefully you'll have some idea what to ask about.


text:
Wrap text around a Circle without deforming it. (numbers on clock)
Currently I'm creating a pocketwatch, but im having a difficulty in spacing out the text evenly, as can see here:

If I tried to space it out by scaling with x, this happens:

Is there any way I could evenly space out the text without deforming the text or adding spaces for every text?

The desired outcome of this question is good, but perhaps the way you state it prevents a lot of potentially useful answers that don't involve bezier curves. Consider changing the title to putting undeformed Text on a Circle.

On the surface, and for most text the Text On Curve option would work great. The clockface however is the one example where the positions of the Numerals are more important than the perfect spacing between them.
See here in green the marks where the midpoint of these Numerals would need to be to make the clock look as expected, but automated Justify  or setting the Spacing of the Word will result in an indiscriminate offset (shown by the red markers).

You can tweak the individual spaces between consecutive characters, even between a space character and a letter. This is called Kerning and it can be positive or negative. The keyboard command is Alt + Left / Right.
The technique is as follows: You place the text in edit mode while it is on the Curve, then navigate with left / right to the spaces between the Numerals, then to increase spacing you do Alt+Right, and decrease space Alt+Left.

In the End it may look something like this. (which I still think looks wonky)

Consider using a background image to help decide where on the perimeter to place these numerals. It's not trivial to get comfortable spacing (but you can copy from the masters).
Problems with this method
I still have issues with this because the Curve is also applied between individual characters of the Numeral. You may or may not have an issue with that, but many clocks don't use that kind of Text On Curve aligning.

What I would do.
I'd do it with Sverchok (full disclosure, I coded some of Sverchok and wrote the Typography / Type Draw node):

For the Sverchok file here's a .blend of that node setup.

or

Add a Circle of the desired size. (with 12 vertices)
Add One Text Object
Give the Text Object the Center Align
Make the Circle the parent of the Text Object
Set Duplication in the Circle to Vertices and tick the Rotation box

You might get something like this:

with the Parent object (Circle) selected, press ctrl + shift + A to make the Duplicates Real.

Still with the Parent Object (Circle) selected press U to get the Make Single User menu , choose Objects & Data from this list. Now you can edit the Numerals individually :)

ok, done that, but how do you edit them separately, when I tried going to edit mode, they'll all be edited

I think what you meant was Objects&Data because with just Objects, the same problem still persist. But, anyways, thanks for the help

You could use the DialScale addon by Stacker (which I contributed to), it is designed to place a series of numbers and /or tick marks along a curve or line and was started in response to an answer here.
Here are some examples from the addons wiki page.

If you wish to modify the text spacing, you have options in the Text object data itself... however you set the text spacing itelf, it will always stick to the curve modifier, but it will not be deformed...

here I just set the word spacing from 1.0 to 9.0 (you can adjust values visually)

authors: Олег Краснов


text:
Is there an addon to quickly make realistic (diffuse, bump, specular, e.t.c.) materials?
Is there an add-on or a built in way to automatically make a material (or node tree) from a collection of bump, diffuse, specular maps?
(Note: I couldn't find it anywhere and I did quite a bit of searching)

Something like this is relatively easy to script, do you mean like a panel with slots for loading the filepaths of bump / diffuse / specular maps, and from that generate a generic starting point material which incorporates all of them?

That would do. I knew it would (probably) be easy to script, but I just thought it would cut 5 mins to 30 seconds at max. I just couldn't find it or script it myself.


text:
Check if active object has a modifier
How can I check if the Active Object has a specific modifier so that when I run my code, it doesn't add the modifier again to the object? It should add the modifier only to the object which does not use that modifier.

Check object for modifiers
import bpy

obj = bpy.context.object

if not obj.modifiers:
    print ("no modifiers")
else:
    print ("object has modifier(s)")

Check object for specific modifiers
import bpy

obj = bpy.context.object

for modifier in obj.modifiers:
    if modifier.type == "SUBSURF":
        print ("subsurf")

For all types see: http://www.blender.org/api/blender_python_api_current/bpy.types.Modifier.html?highlight=subsurf#bpy.types.Modifier.type

In your case I'd recommend using a list comprehension which returns True or False:
print(0 < len([m for m in bpy.context.object.modifiers if m.type == "SUBSURF"]))

or Python's any() plus the list comprehension.
print(any([m for m in bpy.context.object.modifiers if m.type == "SUBSURF"]))

Adding the Modifier if it isn't present
import bpy

obj = bpy.context.active_object
subsurf = obj.modifiers.new(name='MySubSurf', type='SUBSURF')
subsurf.levels = 2
subsurf.render_levels = 3


text:
Indented letters? (embossed)
I'm using v2.76, and I want to create a "stamp" effect with letters. I watched a video on how to do this, and the guy said to use the boolean modifier. I followed the steps exactly to the point where you select the modifier, and it does not show up. I was using cycles render, as was the guy in the video.
Examples:
https://365webresources.com/wp-content/uploads/2014/02/Leather-Stamping-Logo-MockUp-2.jpg
http://gadgetsin.com/uploads/2011/05/bullet_shell_cufflinks_1.jpg

What do you mean by "it doesn't show up"?  What doesn't show up, the modifier or the letters?

The modifier. I saw it in the list of modifiers when nothing is selected, however.

Make sure the object which should be indented (i.e. not the text) is the active object (bright yellow outline).

The text object must be converted to mesh (ALTc -> "mesh from ..."), or you cannot use boolean on it. If you don't convert it, you cannot neither use the boolean on the other mesh which has to be embossed, because you cannot select the text as target object. When you convert the text to mesh, both can be done.
My suggestion, also, is to operate as logic suggests: select the "other mesh", apply the boolean modifier, as "difference", and select the (converted to mesh) text as target "object".


text:
Editing Lamp Strength with Python
I am trying to animate changing brightness of a point lamp using input data that I have. However, when I try to access the lamp's strength using
bpy.data.node_groups["Shader Nodetree"].nodes["Emission"].inputs[1].default_value

I get the error message:
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
KeyError: 'bpy_prop_collection[key]: key "Shader Nodetree" not found

Is there another way I can/should access and change the lamp's strength via Python?

you can find the answer here

Yes, reach node_tree through lamp object bpy.data.lamps['lamp name'].node_tree.nodes.

This works great! I'm now trying to add keyframes for the changing lamp strength, what should go in the data_path parameter?

My guess is 'default_value', since you keyframing a node input.

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


text:
Multiple Linked Objects with unique Materials / Group Materials override
I want to have a Cube in scene A, and linked in scene B, but with different material.
The solution for this problem was found on BlenderArtists.

click the material tab and you will see a little drop down that says "dat" or "Data". Click that and change it to "Object". Now you can assign the material to the object instead of the mesh or "Data Block".

But what if I have 5000 Cubes in scene A, and I want 4999 of them to be in scene B with different material X, and 1, with material Y.
If I try to "link material" in scene B, with new material, it won't copy "Object" selection. I would have to go over 4999 cubes and change them to "object" in material tab.
I can't join them, and then separate - all objects are in a mess after that (and blender crashes anyway).
Material override for whole scene won't work for me.
Is there any option to override materials in groups? That would solve the problem in some way.

I think that gandalf3 or David answers is what you asked, maybe you want to try them and accept one.

(step 1 from gandalf3's answer)

Set the material datablock to Object, then right click on the drop down and select Copy to selected This is important, if you skip this step 2 will not work.

Select all the objects you want to have the same material, with the active object having the material to be copied to all the others selected. Press CtrlL, and select Materials. It will now link the materials to the Object and not the Data.

I'm not exactly sure of what you are trying to do, but
you could try this:

select the cube you want to have a different material and press U> Materials+Tex to unlink that cube's material data.

Create a new material.

Or you could:

Select all the objects which should have their material linked to Object.

Set the material datablock to Object, then right click on the drop down and select Copy to selected:

That is something you can solve with a little bit of python, you can enter this into a text block and click Run Script or just type it straight into the Python Console.
It loops through bpy.context.selected_objects which means you can easily choose which objects you wish to change.
import bpy

for obj in bpy.context.selected_objects:
    for matslot in obj.material_slots:
        # options are 'DATA' or 'OBJECT'
        matslot.link = 'OBJECT'

As the above answers, it's in the material selection, link material to the object.
In a newer blender, you can find it right to the material selection (screenshot is from Blender 2.9)

There are a number of solutions.

Select the desired objects, CtrlL to link materials data, then go to the material tab of the one object you want to be different and click the number next to the material name to make a single-user copy. Then it can be whatever you want.
You probably can join and separate, you just have to replace your object origins after you separate: select all, objects->transform->origin to geometry.
In your user settings, you can specify what gets copied when you duplicate an object, including AltD which makes a linked copy.

There are many options, you just have to understand how they work.
Lemme know if I can clarify anything.


text:
How can I create a field of numbers that repeats the times of itself?
I got a geometry node (GN) related problem here.
The project that I'm working on requires a field input of random numbers that have to repeat the same time of itself. They will be used as selection input.
For example, like 223331555554444... or 33322122666666....
I can not figure out an easy way, but I am  somehow close already. There is just a tiny little issue at the end.

As you can see in this GIF image, I basically use compare nodes to select the range of where each number should be and then times it to the number itself (since the selected range will output value of 1).
In this GIF image I first browse through the integer 01234 and the viewer can output the right field number for each input, but as soon as I plug in the index input, it only works for the first number in the field. I guess the problem my caused by the Boolean range since it doesn’t work this way.
So what should I do to output a whole list of this field?
Or is there a better way to make this number list?

I think quellenform has the solution to solve my ultimate problem. But I’m still curious about how to make my method work, because it's so close and logically ok.

Unfortunately, there is no node that will do such repetitions for you, so you would have to resort to a trick.
One possibility is this one:

Here I instantiate a simple geometry (which I only use temporarily, and which is not ultimately output as geometry) at the existing points in the form of curves.
The trick here is that curves can be subdivided arbitrarily without losing the Spline Index.
So you can create random values with which to subdivide the individual curves. Each subdivision inserts further indexes to the list of points, which then gives you the desired repetition.
The only catch in general is that the node Random Value generates relatively often repetitions of a value at low ranges...

Alright senpai!! It is the second time you guided me through the mist in a week! It is indeed a very tricky apporach. It solves my problem for sure. This is actually a followed up problem of last question you helped with. You should have a share if this project makes money lol! Thank you for your help! Hope to see you around next time! Wish you the best!

Clean! I don't get the low-range-bias thing...

@RobinBetts By this I meant that the so called "Random Values", for example in the range 1 - 6, are often found in succession, So for example the resulting sequence of numbers 1, 2, 2, 4, 1, 6, 6, 6, 5, 3, etc. Here are two twos and three sixes in a row. But this is what Random Value generates. The larger the range, the less likely the repetitions in a row.

@RobinBetts Uh, no, I obviously didn't express myself clearly: The numbers are generated randomly (numbers within the defined range), but relatively often numbers of the same value follow each other. Of course, this happens more often the smaller the range is. And there is no additional option in the node to avoid this behaviour.

Ahh... OK. For the distribution to be non-random in a way that might suit the OP, you'd need some sort of 'not the same as last time, please'.

@RobinBetts ...exactly!

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


text:
How can I create a copper coil texture in Blender?
I want to create a realistic-looking stator in Blender, but I don't have any idea how to create the texture. I didn’t find one either.

This is the coil look I aim to achieve, and below is what I currently have

Hello, what is the shape of the copper object, is it a torus?

yes, it is a torus

If you don't need it to be as realistic as in your picture, you could plug a Wave Texture into a Bump node. Also use the UV output of the Texture Coordinate and use the Mapping node rotation value to tilt the waves. To make the texture joint correctly, scale precisely with the Value node:

Thank you very very much, exactly what I was looking for! :)

I guess some annoying busybody or other is going to come along and tell you that you could have rotated the UV in the mapping node

oh sure yes  ;)  .....

Geometric solution
If you're interested in a single render or baking the texture, you can make a honeycomb of bezier circles:

Make another circle, change handle types to free, in spline settings disable Cyclic, duplicate a vertex on one end of the "C" shape, select another end and press F to connect them. Now just set the vertices twist to $0$, $90°$, $180°$, $270°$ and $360°$ (for this honeycomb any multiple of $360°$ will do, but you could design a honeycomb with radial symmetry for e.g. $90°$ increments, or maybe as low as $30°$?)
Set the Object Bevel to the honeycomb curve (brace for performance impact):

Probably you could remove many circles inside the honeycomb...

Very nice! This even creates the irregularity caused by the winding. +1 ...and yes, a few wires could be saved here ;-)


text:
How can I model "Rounds Theater Pavilion"?
I am a beginner and need help modelling this structure in Blender.

Draw the profile of your road:

Extrude:

Bevel the edges in order to round (CtrlB):

Give your object a Simple Deform modifier, Bend mode, 360° on Z, add some edges in order to have something round enough, move the mesh away from its origin if you want to increase the inner radius:

Give it a Solidify modifier to add thickness, enable the Even Thickness option:

Final version with the following modifier stack: Simple Deform, Weld, Solidify, Bevel, Subdivision Surface:

You can use Bezier Curve ... start with Circle, Subdivide few times, few control points move up on Z axis ...

Under Curve Properties > Geometry > set Extrude and set Bevel > Profile > Resolution 1 and move middle point to corner to get right angle.
Or instead of Bevel use Solidify modifier.
Set shading from Smooth to Flat a nd increase Resolution from 12 to 36 (under curve properties).
To orient extrusion in correct direction change Tilt to 90° for all points and for points on top of waves set 75°.

For some control points I changed handle type.


text:
How can I scale a mesh based on known distance between its vertices?
I've got a mesh representing my living room. I built the mesh using Meshroom. I ended up with a few things around the bit of my living room I'm interested in.
I want to scale the entire mesh to the real world dimensions, but I do not know the exact dimensions of the bounding box of the mesh. I only know the distance between two points in the mesh. Is there a way to say "I know a distance between these two points in the mesh, scale the rest of the mesh accordingly to have real world measurements"?
Here's how the mesh looks (it's only one mesh) and the measurement I know:

Because the mesh was built using Meshroom, you can see the points cloud, and I don't have one edge that I can easily select, so I shall be able to define the length between two points, at the start and end of my red line above. Here's the mesh in edit mode to get an idea:

Could you please explain what exactly you have there? In Blender, meshes are usually the vertices that build the edges and faces of a mesh object. A living room can have several objects and each object has its own mesh. So, do you have "a mesh" = 1 mesh object, or do you just call the sum of all objects together "a mesh" = a scene filled with several mesh objects?

But anyway, I will assume the scene is filled with many objects. Let's say you have one single edge and you know it's 1 m in real life. Click to select the object containing that edge. Then press Tab to go into Edit Mode, select that 1 m edge. Activate Edge Length in the Overlays. If the length in the model is for example 0.25 m, then Tab again to go back to Object Mode, select all objects with A, then scale them by factor 4 (because 1 m / 0.25 m = 4) by pressing S, 4, Return. Of course this works with other factors as well, also with decimals.

I just added some more details, hopefully it helps!

Since we now know that you are talking about a single mesh with a lot of vertices, you can do it a bit different as I explained in the comments on my other answer.
Let's say you have a dense mesh and you know the distance between two of those points (I'll take a generated landscape because I have no other dense mesh right now). First make sure the Scale of the mesh object is 1 on all axes in Object Mode:

Then Tab into Edit Mode, select the two points of which you know the distance:

Hit F to create a new edge between them. Activate Edge Length in the Overlays for the viewport. In my case it shows the length of the edge as 1.2 m:

This value might not be precise enough for scaling the object to its real world measurements, depending on how precise you want it. You can go to Scene Properties > Units and change the unit for Length to Millimeters or Micrometers instead of Meters. Now the length shows 1196469 μm = 1.196469 m which is a bit more precise.

If you have noted the value somewhere, you don't need the edge any longer and can delete it with X > Delete > Edges (not Vertices!). But you can do it after the scaling as well. If you keep it now, you can use it for checking the distance afterwards.
Tab back into Object Mode. With the known real distance between the vertices and the measured length of the edge, you can calculate the scaling factor by dividing them:
$$\frac{\text{real distance}}{\text{measured length}}=\frac{\text{5 m}}{\text{1.196469 m}}\approx4.178963$$
Now in Object Mode simply enter the value into the Scale for the object, you can do it separately for X, Y and Z or drag over the three fields to enter the same value in all fields at once, then hit Return to confirm the new scale:

The last thing to do is applying the scale with Ctrl+A > Apply > Scale  or else the measurement in Edit Mode would still show 1.2 m:

But with the scale applied it now shows 5000001 μm which is almost perfect. By now you can definitely delete the edge and set the length unit back to Meters, Millimeters or whatever you want.

Bonus tip:
In a very dense mesh it can be very hard to see the newly created edge and the displayed length:

To make it easier to see them, you can - with the vertices needed for measurement selected (even before creating the new edge) - press Shift+H to hide all unselected vertices and you can now see the edge and the length better (or you create the edge now with F if you haven't done before):

To get the hidden vertices back, you can press Alt+H. If you disable the checkbox Select in the Reveal Hidden option at the bottom left, you avoid having all other vertices now selected so that only the new edge will be selected still (helps with deleting it afterwards). Although there is no need to reveal the vertices before scaling and deleting the new edge, since hiding them does not affect the scale operation in Object Mode.

Thanks for the very detailed explanation, that's brilliant

Here's a Geometry Nodes solution (for a single mesh):
Enter into Edit Mode, select two vertices you know the distance between, and hit Ctrl + G to create a vertex group out of them. By default, the name of the vertex group will be "Group". In the Geometry Nodes modifier we use two Sample Index nodes, one set to index $0$ and the other $1$ to get the positions of those two vertices. A Vector Math gets the Distance between them, then the whole geometry gets scaled (Transform Geometry) by the ratio of the real measurement to the current. Finally, a Remove Named Attribute makes sure the vertex group we only created for this purpose gets deleted when you apply the modifier:

You could duplicate one of the vertices you know distance between and force it to be the correct distance, then scale everything from the first vertex snapping the second one to the new one you just made:

You would need to set up the snapping to work for that. I use 3d Cursor snapped to the first vertex as pivot point for the transformation. It needs to be set appropriately:

I snapped it to the vertex with the snap menu - Shift + S.
Since my points are on the same X axis, I could simply move my duplicate constraining the transform operation in X axis, however if it's not the case, you might need to make a custom transform orientation from the selected vertices:

If you make a custom transform orientation from an edge(that happens if unconnected 2 vertices are selected as well), Y is the axis along the edge(or the imaginary edge that would connect the 2 vertices), so you hit Y to constrain transform operations in that direction. This is only for moving the vert, you probably want the object scaled in all direction, so no need to do anything for scaling.
Snapping can be turned on temporarily holding ctrl key down while in transform operation, but you could just turn it on fully as well:

In my example the transform operation uses 3d Cursor as its pivot point, but the snap target is set to active element that is the vertex I made sure to select last. Snapping options are set here:

This is done using 2 vertices that seem to be on the bounding box, could you do the same from let say the 2 eyes. If you know the distance between the 2 eyes is 1m. Would the same apply? And how did you get the measurement initially? When it starts it already displays 70

I've edit my original post to add more info in case it's of any help!

It doesn't matter where the vertices are.

@maxime1992 He didn't get any measurements there. That is simply a mesh in the shape of "70 cm" as you can see from the vertices in the third screenshot. He wanted to illustrate that this edge is supposed to have a length of 70 cm in reality. Or when you import a CAD drawing it could be that you have the written measurements as mesh in there, too.

facepalm yup makes sense, cheers! Newbie with blender, I think you figured it out! But nevertheless you guys helped me achieve what I needed, thanks a lot for your patience!

Let's say I have a room like this, consisting of several objects. But I know it has not the original size.

But I know for example how high the edge of the wall is from floor to ceiling. It doesn't matter which edge size you know, this is just an example that can be used for other parts of the room as well. So, I select the wall object, press Tab to go into Edit Mode, select the wall edge and enable the Edge Length in the Overlays. This shows a height of 1.24 m:

But I don't think this value is precise enough for my taste, as a little trick I go to Scene Properties > Units and set the Length from Meters to Micrometers. Now the edge shows a length of 1237205 μm:

Now I know that the height of the room is 2.5 m so with 1237205 μm or 1.237205 m I get a scaling factor of around
$$\frac{2.5 m}{1.237205 m}=2.0206837...$$
So I hit Tab to go back into Object Mode, select all objects with A. Now it is important that the Pivot Point for the transformation is not set to Individual Origins. Any other will be okay and depends on if you want the room to stay in place with one of its corners for example, then you could set the 3D cursor there and use it as pivot point. In this example I just use the Median Point.

Now I'm scaling all objects at once by the calculated factor by pressing the scale shortcut followed by the numbers: S 2.0206837 Return.

To make the new size the original size of the objects, apply the scale while all objects are still selected with Ctrl+A > Apply > Scale.

Switching the wall object back into Edit Mode the selected edge now shows a length of 2500 mm (I've switched to Millimeters because I don't need the Micrometers precision anymore).

Thanks! This looks like the simpler answer so far, I'll go with that!

Actually sorry, I mark as answered too quickly. In my case the mesh ic composed of plenty of points, I don't have a single edge I can select. But I'll remember that, still super interesting thanks!

@maxime1992 Oh I see. You could also create a temporary edge. Select the first and last vertex of the distance you know and hit F. This connects them with an edge and you have the length. Then hit X > Delete > Edges to get rid of it afterwards.

I just edited my post with more info, I think it'll make more sense why I said that in my case your solution wouldn't work :)

@maxime1992 Maybe the comment I gave while you edited the answer helps

Interesting! I tried selecting 2 vertices with control + click and hit F but nothing seems to happen when I hit F. Is it supposed to pop a panel as well? Or what should I do exactly after hitting F?

@maxime1992 You need Shift+Click to select them both...

Yes sorry I meant shift. I can see they're selected as they're orange but pressing F once I've got both selected doesn't seem to do anything

@maxime1992 Hmmm... is the mesh too dense so that the edge is hard to see? This should work. What happens if you select both, hit Shift+H (hides all unselected, only the two should be visible now) and then hit F?

Oh ok so I did what you said, I can see both points and the edge now. But if I hit N to get the panel where I can define the size, it's different than when I select the mesh, I can't set the size there. How do I proceed from there to set the length? Oh and how do I revert the Shift H? I tried doing it again but it only shows the 2 points and the edge now

@maxime1992 I don't set the size in the N panel anywhere in my answer...? Unhiding is done by Alt+H

I do this quite a lot for reference images and imported vector drawings, so I wrote a little add-on to make my life easier. Since I already made it, I thought I could share it here.
It's in Transform sub menu in Object and Mesh(in Edit mode) menus in the 3d viewport header or you can just search for it with F3. You have to have 2 vertices selected(doesn't matter if you leave edit mode). It scales the object all selected objects without applying scale.

bl_info = {
    "name": "Scale By Known Distance",
    "author": "Martynas Žiemys",
    "version": (1, 0),
    "blender": (3, 5, 1),
    "location": "View3D search -> Scale By Known Distance, View3D -> Object -> Transform / Mesh -> Mransform",
    "description": "Scales mesh by known distance between 2 vertices",
    "warning": "",
    "doc_url": "",
    "category": "Object",
}

import bpy, math
from bpy.props import FloatProperty

class OBJECT_OT_scale_by_known_distance(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.scale_by_known_distance"
    bl_label = "Scale By Known Distance "
    bl_options = {'REGISTER', 'UNDO'}
    l : FloatProperty(name = "Distance between vertices: ", default = 0)
    current_distance = 0

    @classmethod
    def poll(cls, context):
        return context.active_object.type == 'MESH'

    def execute(self, context):
        o = bpy.context.object
#        sel = [v for v in o.data.vertices if v.select]
#        o.scale = o.scale * self.l / self.current_distance
#        o.update_from_editmode()

# Probably more usefull to scale all selected objects
        scale = self.l / self.current_distance
        bpy.ops.object.mode_set(mode = 'OBJECT')
        saved_pivot = bpy.context.scene.tool_settings.transform_pivot_point
        bpy.context.scene.tool_settings.transform_pivot_point = 'ACTIVE_ELEMENT'
        bpy.ops.transform.resize(value = (scale,scale,scale))
        bpy.context.scene.tool_settings.transform_pivot_point = saved_pivot
        self.report({"INFO"}, str(scale))
        self.report({"INFO"},"Scaled from " + str(self.current_distance) + " to " + str(self.current_distance*scale) + " ( " + str(scale) + " ) ")
        return {'FINISHED'}

    def invoke(self, context, event):
        o = bpy.context.object
        o.update_from_editmode()
        sel = [v for v in o.data.vertices if v.select]
        if len(sel) == 2:
            self.current_distance = self.l = math.dist(o.matrix_world @ sel[0].co, o.matrix_world @ sel[1].co)
            return context.window_manager.invoke_props_dialog(self, width = 450)
        else:
            self.report({"WARNING"}, "Select 2 vertices!")
            return {'CANCELLED'}

def add_scale_by_known_distance_button(self, context):
    self.layout.operator(OBJECT_OT_scale_by_known_distance.bl_idname, icon='PLUGIN')

def register():
    bpy.utils.register_class(OBJECT_OT_scale_by_known_distance)
    bpy.types.VIEW3D_MT_transform_object.append(add_scale_by_known_distance_button)
    bpy.types.VIEW3D_MT_transform.append(add_scale_by_known_distance_button)

def unregister():
    bpy.utils.unregister_class(OBJECT_OT_scale_by_known_distance)
    bpy.types.VIEW3D_MT_transform_object.remove(add_scale_by_known_distance_button)
    bpy.types.VIEW3D_MT_transform.remove(add_scale_by_known_distance_button)

if __name__ == "__main__":
    register()

So that's to be pasted into a text document(just use Blender's Editor to be sure about correct encoding) and saved to a file with .py extension. It can then be installed as any add-on from User Preferences(F4 -> P -> Add-ons tab)

This looks awesome! Thanks for sharing!


text:
Default size for empty
Is it possible to set the default size of the Empty Object? The problem is since I switched my blender scale to metric, the Empty's default size is kinda large for most times I need it.

Directly after you add an Empty press F6 to get the Add Empty Operator parameters.

The Radius parameter will set the visual size of the current Empty and all new Empties that you add afterwards during that session.
Unfortunately there isn't a configuration option to set the default radius permanently.

possibly a script could be told to load on each new .blend file to add an empty and set the radius and remove it (all behind the scenes) -- but simply setting the Radius once is almost effortless too..

When adding an empty from the add object menu, change the radius to the setting you desire. The inverse of the scene unit settings scale_length will give you a result of 1m
This can also be edited on the empties data panel.
The following changes all empties to 1 based on the scale_length.
import bpy
context = bpy.context

scene = context.scene

scale_length = scene.unit_settings.scale_length
empties = [o for o in scene.objects if o.data is None]

for empty in empties:
    # 2.79 :
    empty.empty_draw_size = 1 / scale_length
    # 2.8+ :
    # empty.empty_display_size = 1 / scale_length

or calling the operator
bpy.ops.object.empty_add('INVOKE_DEFAULT', radius=1 / scale_length)

using invoke default keep that value for the next time the operator is run.

sorry if this sounds just dumb, but can you tell  me where to find that bit of script?

To run the script, copy, paste into a new text block,  right-click  "run script".

For 2.90+ Blender versions there is now an option to set default empty size for new collection instances.
This won't affect plain empties added from the Shift + A Add > Empty menu, but will set default size for new collection instances added from Shift + A Add > Collection list.
You can find it under Edit > Preferences > Editing > New Objects > Instance Empty Size.

For 2.8x replace empty_draw_size by empty_display_size in batFINGER's code
import bpy
context = bpy.context

scene = context.scene

scale_length = scene.unit_settings.scale_length
empties = [o for o in scene.objects if o.data is None]

for empty in empties:
    empty.empty_display_size= 1 / scale_length


text:
How to generate points from an SVG
I have an SVG file with a 2D point-cloud, I want to convert each point in the svg into a point in Blender. Normally I would do it manually, but there are a lot of points and the they need to be placed very precisely. Is there a automatic way to place points in Blender?

Please add a sample to your question.

If the 2D point-cloud is a vector graphic (SVG), you can import SVG directly using File > Import > Scalable Vector Graphics (SVG). We'll need more details on how the point-cloud is stored, otherwise it's a guessing game. :-)

Dave Jarvis already mentions the svg importer, and that might work for you. If not you could supply us with a snippet of the SVG (make a copy of the svg, delete a majority of the points, save and upload it somewhere or paste it as a gist to github for example:  https://gist.github.com/zeffii/d1fc3c9520300ca038cc

A working answer will depend heavily on the way your dots are written into the SVG file. Don't expect this code below to work. It might work, it might not. If you want a more specific snippet you need to provide a reduced version of the SVG in question -- it's easy to write specific code for specific files.
If the SVG is a bunch of Circle Elements, this is one way to extract the coordinates from the file.
This code assumes you have a file like this. Press the Raw button on that page to see what the underlying file looks like in text form. Essentially it contains an inner structure with the following lines. Each Line describes the center of a circle.
...
<circle id="path4142-96" cx="423.25" cy="500.82" r="5.8084"/>
<circle id="path4142-99" cx="540.43" cy="380.61" r="5.8084"/>
<circle id="path4142-23" cx="599.02" cy="179.59" r="5.8084"/>
...

This code detects the coordinates inside cx and cy and offers to scale them by some amount to prevent an otherwise massive mesh:
import bpy
import re

def svg_circles_to_vertices(filename, scale):
    verts = []
    add_vert = verts.append

    pattern = "cx=\"(.*)\" cy=\"(.*)\" "

    with open(filename) as f:
        for l in f:
            stripped = l.strip()
            if stripped.startswith('<circle'):
                m = re.search(pattern, stripped)
                if m:
                    x, y = m.group(1, 2)
                    x, y = float(x) * scale, -float(y) * scale
                    add_vert([x, y, 0])

    # print(verts)

    mesh = bpy.data.meshes.new("mesh_name")
    mesh.from_pydata(verts, [], [])
    mesh.update()

    obj = bpy.data.objects.new("obj_name", mesh)

    scene = bpy.context.scene
    scene.objects.link(obj)

filename = "/home/zeffii/Desktop/drawing2.svg"
svg_circles_to_vertices(filename, 0.01)

EDIT: This answer is going to be pretty useless if we are talking about an SVG file (as the edit implies). In that case the comments explain the method of importing an SVG into blender, which would solve the problem.
This answer only applies to raster images such as PNGs or JPGs. I'll keep it around only in case someone else wants to do this with a raster image and might bump into this answer.
If your 2D image is a simple black and white representation, this should do the trick:

Open your image in a UV/Image editor.
Open a text editor window and paste the script below there.
Update the image name in line 15.
Update the image resolution in line 18.
Press "Run Script".

Code:
import bpy
import numpy as np

def make_mesh( context, name, verts ):
    mesh = bpy.data.meshes.new( name = name )

    o = bpy.data.objects.new(name, mesh)
    o.location = (0,0,0) # place at object origin
    context.scene.objects.link( o )

    mesh.from_pydata( verts, [], [] )

    return o

img = bpy.data.images['figure_1.png']  # Update name to the right one in your scene

pixels = np.array( img.pixels[:] )
pixels = pixels.reshape( ( 1024, 1024 ) )  # Update resolution to the one in your image

verts = []
for i in range( pixels.shape[0] ):
    for j in range( pixels.shape[1] ):
        if pixels[i,j] == 0.0:
            verts.append( [ i, j, 0 ] )

o = make_mesh( bpy.context, 'PointCloud', verts )


text:
How to install the latest version of Blender
I've use the Ubuntu 14.04. Know anyone how can I install the latest version of blender from terminal? And after that how can I make cycle render work?

Could you clarify what you mean by the "last version"?

The last version of blender... 2.75a

I'm not sure what you want.. If you uninstall blender, how do you plan on running cycles? (unless perhaps you want to use the standalone version of cycles, without blender?)

What.... no man.... I've try to find how can I INSTALL Blender 2.75a and after that how can MAKE THE CYCLES render to works.

Oh, I see.. Sorry about that (idk what my eyes were thinking). What exactly do you mean by "install from terminal"? You can "install" it multiple ways (install from PPA, or extract the zip) via the CLI, what exactly do you want to achieve (why from the terminal specifically)?

Np, so did you know how can I do that?

Soooo. . . download from Blender.org, and double click the blenderapp.exe file . . . switch render engines in the top info/menu bar

@NoviceInDisguise There's no .exe on linux ;)

I want to download if from terminal some how... because if I've download from site with SH as extension I don't know how to add him after that on application bar.

And one more thing @NoviceInDisguise, in Linux, any linux distribution the Cycles render don't work at start... first I need to download and install nvidia CUDA toolkit, but I don't know how...

Regarding cycles, CPU rendering should work out of the box. GPU rendering will require a compatible graphics card and drivers, but unless you're compiling blender from source you shouldn't need the toolkit. See http://blender.stackexchange.com/q/7485/599

oh right, been ages since i used linux

Depending on your DE, you can create a .desktop file or similar to create a blender launcher. See http://askubuntu.com/q/13758/183331

Related: http://askubuntu.com/a/169546/183331

It sounds to me like you're asking for the package management command to revert to an older package. apt caches versions of packages and repositories often keep legacy packages around after an upgrade.
sudo apt-get install <package-name>=<package-version-number>
OR
sudo apt-get -t=<target release> install <package-name>
will install a specific version of the package in question (downgrade, upgrade, different architecture, etc).
To see all available versions of the package, run apt-cache showpkg <package-name>
If you wish to freeze a package at that specific version, run apt-mark hold <package-name>
This answer was adapted from Ask Ubuntu

I don't have any experience the terminal, but you might be able to achieve the same effect by using Steam. Blender can be downloaded for linux on Steam, which should setup a desktop icon as well.

I hope this helps, my experience with linux is rather limited (:


text:
dynamic PropertyGroup / Panel
I'm building a Blender (2.75) plugin for our 3D engine (https://github.com/aerys/minko). So far so good.
One of the things I'd like to do is to mimic Unity's feature that scripts can be directly added to scene nodes in the editor. Such scripts properties can then be edited directly through a dynamic property inspector built by parsing the script public members.
I've already done what I think is the worst part: using libclang and the python bindings to parse my C++ headers and retrieve a list of the public properties (each property being a public getter/setter pair). I can use this list to generate a list of Blender properties like so:
def get_properties(self):
    if not self._props:
        c = self._get_minko_script_classes(self._clangSource.cursor)
        setters = self._get_class_setters(c[0])

        self._props = {}
        for name, set_type in setters.items():
            if set_type == 'bool':
                self._props[name] = bpy.props.BoolProperty(name=name)
            elif set_type == 'int':
                self._props[name] = bpy.props.IntProperty(name=name)
            elif set_type == 'minko::math::ivec2':
                self._props[name] = bpy.props.IntVectorProperty(name=name, size=2)
            elif set_type == 'minko::math::ivec3':
                self._props[name] = bpy.props.IntVectorProperty(name=name, size=3)
            elif set_type == 'minko::math::ivec4':
                self._props[name] = bpy.props.IntVectorProperty(name=name, size=4)
            elif set_type == 'float':
                self._props[name] = bpy.props.FloatProperty(name=name)
            elif set_type == 'minko::math::vec2':
                self._props[name] = bpy.props.FloatVectorProperty(name=name, size=2)
            elif set_type == 'minko::math::vec3':
                self._props[name] = bpy.props.FloatVectorProperty(name=name, size=3)
            elif set_type == 'minko::math::vec4':
                self._props[name] = bpy.props.FloatVectorProperty(name=name, size=4)
            elif set_type == 'std::string':
                self._props[name] = bpy.props.StringProperty(name=name)

    return self._props

Now I want to display those properties (self._props) in a panel. But Blender examples are all about "static" property definition, declaring properties as class members... I guess Python would let me create dynamic classes definitions. But it sounds hacky.
So my question is: how to pass this list of Blender *Property to the UI to display it properly in a Blender friendly way?
Thank you,

Is every type (set_type) repeatable? Are they globals, or may individual objects use any and any amount of these properties? bpy.props properties need to registered globally, e.g. on bpy.types.Scene, and will be available on every instance. For individual properties, ID props should be used instead, but there's not as much control UI-wise over them compared to bpy.props.

Each object/mesh will have it's own set of properties because each mesh will have its own set of scripts: I've already made a panel where the user can select a script file, and the code above is called in a AddNewScriptOperator. Now I want that operator to create the proper PropertyGroup/UI. What do you mean by "repeatable"?

By repeatable I mean 0..n properties of type minko::math::ivec4 for instance per object (which would translate to bpy.props.CollectionProperty). It seems like you would need one property group class for every object, because they are all different. I would actually try to use ID properties instead, as they are much more suitable.

You may be interested in pynodes, there is a custom nodes template in blender's text editor. Luxblend uses pynodes. sverchok and animation nodes would be the largest projects using them, both have videos demoing what they can do.

Using Custom Properties (ID properties) works:
for key, key_type in props.items():
    context.active_object[MinkoScript.format_property_name(i, key)] = script.get_property_default_value(key)

In order to be able to iterate on a specific script properties to draw the panel, I also store the properties dict in an ID property:
context.active_object[MinkoScript.format_property_name(i, '$properties')] = props

Then in the panel:
for i in range(0, context.active_object['minko_num_scripts']):
    layout.label(
        context.active_object[MinkoScript.format_property_name(i, '$name')] + ':',
        icon='TEXT'
    )
    box = layout.box()
    script_id = 'minko_script_' + str(i)
    script_props = context.active_object[MinkoScript.format_property_name(i, '$properties')]
    keys = sorted(script_props.keys())
    for key in keys:
        row = box.row(True)
        col = row.column(True)
        col.label(key + ':')
        col = row.column(True)
        col.prop(
            context.active_object,
            '["' + MinkoScript.format_property_name(i, key) + '"]',
            text=''
        )
    row = box.row(True)
    row.operator(MinkoRemoveScriptOperator.bl_idname, text="Remove").script_id = i
    row.operator(MinkoReloadScriptOperator.bl_idname, text="Reload").script_id = i


text:
Window settings 'Last Used Tool' F6 (automatic appearance)
During working, we often use the basic modeling tools (Extrude, Bevel, Loop Cut And Slide, etc.) After applying these tools can be tweaking (hotkey F6)
Is it possible make it so that this window appear automatically with these instruments?

Maybe such script already exists?

If you open the left hand helper pane thing of the 3d view (with N or T i think) the lower part of that should be the same as the F6 popup. Not makingreal answer presently because on phone and out of practice so can't confirm.

About the bottom panel I know. it is not always easily accessible
When this panel appears automatically modeling becomes a much easier and more convenient


text:
Lost the Move Tool
So I lost my move tool. When I select anything, the standard little 3D move tool interface with all the arrows is no longer visible. I started to use 'G' to overcome that, but now that no longer works. I can move stuff around with G in the UV editor, but it is really rigid and snaps to a grid. I can't use G at all anymore to move things in 3D View though.
I don't know what I pressed, but I messed something up pretty good.
Thanks

Related: http://blender.stackexchange.com/q/2834/599

Sounds like you hid the 3D manipulator widget. To toggle it on/off, use CtrlSpace. As Greg also points out below, you have snapping on as well, See Cursor is set to move by increments. how to reset to normal?.

Also sounds like you accidentally turned on snapping - toggle it with Shift + Tab


text:
Navigate normally from camera perspective?
When I'm in camera view Numpad 0 and I want to navigate in the 3D-view with e.g. ⇧ Shift MMB the view jumps to a completely different location.
I actually jump from Camera Perspective to User Perspective.
Can I avoid this?
Is there perhaps a way to set the "User Persp" view to the camera location and rotation?
Or a way to avoid that you when you start navigating in Camera view that you jump back to the last location in User view?
I do not mean "Lock camera to View".
I just want to start navigation from the camera's position without moving the camera itself.

Thanks for the elaborate and visualized replies.
The hacks are very clever. However, as I just want to be able to continue navigating the world starting from camera view, they take too much effort and attention.
As I've been pondering as to why this feature hasn't been added yet to Blender it became apparent that it's not that straightforward.
After all, user view and camera view are most likely in diffent perspective. User view could be in ortho view and if not, it would still be in a different focal lenght than the camera. So  a seamless navigation from your camera view would result in a changed perspective of your user view and that might be equally annoying as the problem I'm describing in my picture.
Oh well, I guess I have to get over this little limitation.
Thanks again!

If you wish, you can lock the Camera to the perspective view. That means that whenever you navigate in the 3D viewport the camera will 'follow' you in the view, copying the location and rotation of your navigation. In effect, in this mode it will look like you have never left the camera perspective as the dark border around the camera and the camera border itself, will remain visible.
It can be enabled in the properties panel (N) under the 'View' section:

At any point you can then disable the option and the camera will remain at the position you navigated to meaning you can use this to move you camera into position and then leave it at the desired location.

Thanks for the answer, but that's not what I mean. I don't want to move the camera itself. I just want to navigate the 3D starting from the [numpad-0] camera position.

Select the camera and press Numpad . (view selected)
Press Numpad 0 to enter Camera Perspective
Press Numpad 5 twice

However it will be zoomed out a bit.
I hope this is what you want.

Here's a bit of a hack, but it seems to work:

Enter camera view (Numpad 0)
Duplicate the camera (⇧ ShiftD)
With the duplicate camera selected, press ⎈ CtrlNumpad 0
Press Numpad 0 to exit camera view.

Without Lock Camera To View selected, go to camera view and then just start moving around. You'll exit the camera view, but not jump to where you were before.


text:
OSL shader issue, could not find include file: node_texture.h"
I am trying to (re)create an OSL shader in Blender, but I receive an error "error: could not find include file: node_texture.h" when compiling.
I've Googled it up, but can find nothing. Where can I find this file, or change the search path?

you should have that file too in your directory

@Chebhou could you provide a little more detail on your answer?

go to this link [http://www.openshading.com/osl/example-shaders/#] and download the example_shaders put the file that you need (node_texture.h) with your osl script file

The change happened before 2.72 was released and I still haven't got around to looking into whether the change came from blender or OSL 1.5. It is a matter of search paths and I think they need to be changed in code.
The file you are looking for is included with blender, it is installed in 2.72/scripts/addons/cycles/shader/ You can also find it in blender's source tree at intern/cycles/kernel/shaders/node_texture.h
The solution for now is to place a copy of it in the same folder as the osl script that wants to include it.

Thanks @sambler! That was the solution. Also, thanks for sharing your code and knowledge. I copied and pasted the  node_texture.h file into the appropriate folder.


text:
Is it possible to get rid of n-gons/poles when using face loops?
For example, in this model is there any way to make this all quads?

You can use a knife tool using K button in Edit Mode, then position the knife cursor over the vertices, when the knife tool snaps to the vertices you will see the knife icon green square outlined with red color, then left click with the mouse and continue cutting like in the image below. When youre finished cutting hit Enter button to apply. You can use E button while cutting to continue cuts in different locations.

Related: http://blender.stackexchange.com/questions/18432/how-do-i-fix-this-irregular-shading-on-my-subsurf-retopology-attempt/18434


text:
Is there a way to clear the "info" editor?
Say there was a mistake in a script, it didn't compile. In an info area that's bigger then just a small strip, there will be one or more red error messages.
How to get rid of them with a keypress?

I don't think you can other then reopening your file.

OK, I discovered the solution, press A twice to select all and then X or Delete to get rid of these lines.


text:
How can I separate the slice?
I want to separate the slice_low from the 5_low.
Is there a way to avoid it? It was sliced with Boxcuuter.

Hello, what do you mean by separate? Slice_low seems to be the child of 5_low, to unparent, select the object in the 3D view and Alt P > Unparent

It looks like boxcutter has automatically parented slice object to original object. To unparent the objects you can use Blender's builtin operator called Clear and Keep Transformation. This operator can be found by pressing Alt + P.
Alternatively you can go to Object menu that is located on the Header of the 3D Viewport then Parent -> Clear and Keep Transformation.
If you are for some reason interested in scripted approach, here is the example of the code you can use to clear parent and keep transformation:

import bpy

# Defining original and slice objects
original_object = bpy.data.objects['5_low']
slice_object    = bpy.data.objects['Slice_low']

slice_location = slice_object.matrix_world.to_translation() # Storing original location of slice_object
slice_object.parent = None # Clearing slice_object's parent
slice_object.matrix_world.translation = slice_location # Setting unparented slice_object's location to the intial location

Documentation: https://docs.blender.org/manual/en/latest/animation/armatures/bones/editing/parenting.html
Hope it helps!

Oh sad, iam feeling like a noob now. But Thanks a lot, didnt thought it can be a parented Object. Helped me alot and worked easily.


text:
How can I draw on procedural textures?
I try to combine procedural textures with an Image Texture via a mix node, so I can draw on my model.
But I can not find a way, so my procedural texture does not change in its brightness or contrast.
Is there a way to add draw on it and keep the Image texture transparent, except those parts where I'm painting?

Mix your procedural texture with your Image Texture in a Color > Mix Color node, plug the Alpha output of the Image Texture in the Factor input of the Mix Color:

Thanks a lot @moonboots


text:
How can I make square and triangular rings?
I'm new to Blender and trying to make two simple objects: square and triangular rings.
I started with a square object (using a cube) and applied bevel on its edges. Unfortunately, this is the best I could achieve after hours of work. I could not find good tutorials on that either. How can I do this?

This is an example of what I am trying to make:

Edited my post.

Did you try with curves?

Just want to thank everyone for their input! Very informative and helpful!

You can also do it with geometry nodes... lazy approach...

Some explanations:

Mesh to curve: transforms a mesh to a curve, removing faces and just keeping edges as splines.

Fillet curve: for "poly" option bevels the curve vertices on a given radius and divisions count.

Curve to mesh: generate a mesh from the curve given a profile curve (here a circle).

Little enhancements, in the file below. I've added "profile resolution" for a default circle profile, the possibility to use another profile and a flag to shade smooth or not the result.

The corresponding blend file:

very nice! damn i went the over complicated way lol

+1 even if i find it very unexplained

@moonboots, yep ; )

why are geometry nodes needed - isn't there a modifier which does this to a curve? and why use "mesh to curve" instead of having a curve to begin with?

@user253751, just a way to do it. One can do it directly with a curve, but with these nodes filets are here only when needed, not all along the curve depending on its resolution.

If you enable the shipped add-on: Add Curve: Extra Objects, you get curve polygons.  You can then (right-click menu) fillet their corners, switch them to 3D, and their Fill Mode to 'Full' in their 'Shape' panel, and use their native Round Bevel to thicken them in their 'Geometry' panel..
:
... maybe give a level of Subdiv.
But I wound up having to go backwards and forwards a bit to get satisfactory topology in the fillets, matching thicknesses, etc.. @Lemon's way is better, IMO.
Or.. easier to CtrlShiftB bevel the vertices of a  3-point mesh-circle, or any other faceless mesh-edge shape, convert to a curve, and go from there, with the curve's native Bevel.

Add a plane and a circle with 3 sides, join them with Ctrl+J (or you could do them one at a time as well if you wish), go to Edit mode and bevel all geometry with Ctrl+Shift+B to your liking, then convert the object to curve in Object mode and add some bevel depth in the curve properties. You can add more resolution to the curve to make it smoother and then convert to mesh again for further editing if needed. You might want to set shading to smooth as well.

What's going on with other answers?.. Do we really need add-ons, geometry nodes or so much modelling for something this simple?.. What next? Python script and displacing a sphere with shader nodes? :D Sure it's fun, but why not start with the simple everyday kind of stuff?..

Martynas, I just did it this way reacting to Harry much too complicated way to do it. Though, gn solution is very flexible...

I just think the first answer should have been the simple one that's all. :D GN solution is actually very nice and the add-on is nice to know about as well for sure.

@MartynasŽiemys I'm sure that all these answers including my weird approach have made the OP more knowledgable. If it was just 1 simplest and fastest answer, he and future learners would have never known the other stuff existed and that there are more ways to solve a problem and besides, what if geometry nodes or an addon was the approach he preferred but nobody introduced it :)

Add a plane and tab into Edit Mode then press A then M > Merge At Center. There will be one vertex left at the center. Select it and press the sequence EX-1Enter to Extrude along the X-axis by negative 1 unit. Select the center vertex again and then use the sequence EY1Enter to extrude another vertex along the Y-Axis by 1 unit. Then use this extruding technique two times more to extrude another 2 vertices to, say, 0.8 units.

Delete the center vertex by selecting it and pressing X > Delete > Vertices. Temporarily extrude the whole setup by a small amount on the Z-Axis so you get the following shape. Select the vertices shown below and go to Edge > Bridge Edge Loops

Tinker around with the settings in the Adjust Last Operation popup to get the profile you need.

Press ASZ0 to scale the vertices back to zero on the Z-axis. Press AM > Merge By Distance to merge all vertices.

Add a Mirror Modifier for X & Y and tab back into Object Mode. Right click the object and select Convert To > Curve

Under Curve Settings go to Bevel tab and give it some Depth and adjust the Resolution. Right click object and select Convert To > Mesh.

You can do the same technique for the triangle. Just leave a small gap between the 3 corners and let the Bridge Edge Loops step round those corners.

What the heck are you doing to get a square with rounded corners... or do you just want to show Igor how many different tools Blender has? Add a plane, in Edit Mode delete Only Faces, select the vertices and press Ctrl+Shift+B to bevel them... and for the triangle: add Mesh > Circle with 3 vertices and bevel them.

even no need to delete the face before converting to curve...

with bevel you can only get 1 curvature shape. but what if you wanted another profile? but yeah if you don't like the solution, just downvote it, as simple as that guys :)

I can't downvote it, I upvoted it ;) But well, the bevel only makes rounded corners - it has nothing to do with the overall shape. You also don't have to extrude upwards to bevel the corners... and he asked for square and triangular rings, it does not seem he needed to know how to get the general shape, just making it a ring and rounding the corners.

...oh, and a bevel can have more than just a simple curvature shape ;)

Oh sorry I didn't know that XD so yeah i extruded it on the z coz i couldn't get the Bridge Edge Loops to work.

that was a reply to @GordonBrinkmann first comment.

@GordonBrinkmann i got 98/100 sportsmanship badge. please add your answers guys so i can upvote :D

@lemon Of course you are right, that was kind of an "aesthetic" decision to delete the face :D

ok... I'll push an answer ; )

I'm at work, a quick comment here and there is no problem, but an answer with screenshots etc. has to wait... @lemon can do it

Yes not sure why you made it so complicated...

I totally forgot about beveling since i think of beveling mostly in 3D. in this case it was a flat surface and beveling didn't come up in my funny brains ;)

I don't think that's a very good answer to be honest. It's a bit misleading as that's way more complex than it needs to be.

@MartynasŽiemys yes thanks for the downvote :)


text:
How can I properly model a round button?
I'm in the middle of trying to model an Xbox Series X and I've gotten stuck trying to make this one little button above the disc slot:

My problem is mainly figuring out how to make a circular face in the spot circled above.

Hi Oscar :). Are you using Subdivision surface modifier for modeling this part? The approach would be slightly different depending on it :).

@jachymmichal Not quite sure what that means sorry, is there a way I can check?

@jachymmichal Just googled it, I don't think I'm using Subdivision surface modifier

No need, you'd know if you were using it :). It's used to make modeling easier by generating polygons automatically Blender Manual - Subdiv Modifier

@jachymmichal so you think I should use that then?

just a minute, I'll post an answer for both ways :)

this might be something more suited for a normal map and not actual modeling. just saying.

@jachymmichal no problem, thank you very much

@shmuel That's a good idea, I'm simply used to modeling everything :))

jachym's method is more general than this one, allowing for inserts of various shapes. But if faced with the quite common problem of round holes in flat surfaces for subdivision, this typical method is relatively quick, if you can arrange for regions with at least 6 sides to contain the holes.

Enable the shipped add-on 'Loop Tools'
Set your Transform Pivot to 'Individual Origins'

I inset the regions that will contain the holes (Maybe more than once)
Invoke Loop Tools > Circle on the insets
Adjust, inset again, and delete.

If the 5-edge poles at the corners of the outer insets interfere with shading, (not a problem in flat surfaces)   you may have to have a think, and make your first inset from further out.
As you can see, this permits the creation of multiple holes at once. You may have to work under the Subdiv. modifier (with it active, and visible in Edit Mode), to size the holes accurately.

Edit: in response to commentary..

I haven't ever actually done/looked up the maths, but a level 2 Catmull-Clark subdivided regular octagon is a pretty good approximation to a circle.. the interpolation of the next loop out might be throwing your perception?

Is there a way to make the circles rounder?

Hi, @OscarBetts! .. more vertices in the perimeter of a regular polygon will approach a circle more closely (6+ has always seemed reasonable to me, given the error inherent in polygonal approximation, See edit..

The approach varies very slightly depending on using Subdivision Surface modifier.

Create your supporting geometry with a square hole in the middle
Add a circle (number of vertices depends on what fits best)
Connect the circle edges, to the hole

With Subdiv Modifier

keep all polygons 4-sided
add a circle that exactly matches it's vertices to the surrounding geometry
the modifier will smooth it out

Without subdiv modifier

you can use N-gons
add a circle with more sides, so it looks smooth
connect just some vertices, don't care about the rest.

Thanks for the help! Just one small question, how do I create a perfectly square hole?

I used snapping for that :). But in this case you don't need a perfectly square hole.

Okay, trying this now. Thanks heaps!

No problem, if anything else comes up, feel free to post a new question :)


text:
How can I extrude without deformations?
I am modelling a wagon wheel. When I extruded, the tips got narrow. I wanted avoid this and kept it straight and thick.
Is there a way to keep them straight? Look at the picture. BTW, I wanted to fix this with Blender only, without any paid addon.

The missing spoke won't fit evenly in the remaining gap

A Cylinder for Each Spoke
Rather than extruding the spokes out of the rim, I would make a cylinder for each spoke.
You can do this manually by creating the first spoke then duplicate it and rotate each duplicate around the hub of the wheel. Or if you use Geometry Nodes you can set the number of spokes dynamically.

Search for Extrude Faces Along Normals


text:
How can I create a wrinkled cloth style frame?
I am trying to create a wrinkled cloth style frame, and I want to know how I would even start something like this. I already have a base shape for it and subdivided it, but I am very new to work with cloth style mesh.
This is a reference picture in what I would like to achieve.

You could create a plane, subdivide it, switch to Sculpt mode, choose the Pose brush, Deformation Target: Cloth Simulation, Deformation: Squash & Stretch:

Increase the brush size with F then LMB and drag:

Duplicate and merge the vertices so that it gives a long plane, or bake its normals to use it as a normal map on a low-poly mesh:

Amazing thank you so much for the detailed explanation! I got it to work flawlessly, Now how would i create a frame out of it just like in the picture?

you can duplicate the mesh, or bake its normals to use it as a normal map on a low-poly mesh?


text:
Books or web resources for blender-python (bpy)
I want to create 2D or 3D object that is mathematically created (all vertices and faces are generated by python). I heard blender can create objects via Python. I already know Python and would like to find more information specifically about bpy.
I assumed blender python API is well documented, but I can't find good documentation (For example, look this page about bpy.data. I think there should be more information about bpy.data.*). Are there any books about blender python which complement official documentation? I don't have much time to search the web (like a sea) to find the documentation about blender python, and I don't know which web resource is the best except for official website. So mainly I'm finding a book about blender python now.
I'm currently reading:

The Blender API - Blender 2.49 Scripting

This is the only book I could find. Any other book or web resources are welcome.

Have a look at this book: http://airplanes3d.net/pydev-000_e.xml

I find this blog with few samples of python https://docouatzat.com

Around 2009 / 2010 Blender moved on to the 2.5 series and started using a new and very different python API called bpy. Unfortunately that 2.49 Book doesn't cover bpy and therefore will have little practical usefulness. In the first couple of years after the new 2.5 series bpy changed regularly both in big and in small ways.
Such a fluid environment meant publishing hard-copy documentation wasn't very sensible. This lack of books has not been a barrier for learning bpy, for a few reasons:

Blender has a built in Python console (REPL) it lets you print the docstrings of functions and operators. The REPL auto-completes with Ctrl+Space. See this answer for directions and usage and more.
Blender, and the add-ons it ships with, are open-source. The nature of these add-ons ranges from convenient mesh editing tools and mesh generation tools to importers and exporters. These categories cover almost everything you might want to see examples of -- some are short and simple others are extensive.
The cookbook (for UI and bpy) paved the way for many people, and is still a surprisingly useful reference for figuring out how to declare UI.
Blender's TextEditor has templates for common bpy procedures:
TextEditor > Templates > Python > ...

You mention that you know Python already. My advice to you is to read the source code of a few Mesh creation add-ons available in  ../scripts/addons. For instance
add_mesh_extra_objects
add_mesh_bolt_factory

These two add-ons will give a lot of insight into how to write all the boilerplate needed to convert your mathematical concept and code into an operator using bpy.

add_mesh_extra_objects
This add-on even has a selection of mathematical surface generators which seems to be what you are looking for.

makes this:

and xyz makes this:

Totally agree with zeffii's tips. I started scripting exactly this way, and also by following some nice tuts on CG cookie, especially the now archived (but still freely available and relevant) tuts by Patrik Boelens: https://cgcookie.com/archive/introduction-to-scripting-with-python-in-blender/

Another great source is the script cookbook (code snippets) page: http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Cookbook/Code_snippets
And the small blender things blog (that has lots of OSL, but also lots of BPY stuff): http://www.swineworld.org/search/label/Python
I also write about BPY scripting in my blog: https://bioblog3d.wordpress.com/category/python/

I agree with scripts cookbook, i use it too sometimes so shouldn't omit it either. As for blogs.. they will come up naturally when users search google, but the downside is they can't be updated by anyone other than the author


text:
How to move the points of a Curve in Python while in Edit Mode
I built a script that creates a bunch of curves. So far so good. Each curve (3d curve) is placed correctly a z=0 but the points of the curve are not at z=0. So I need to write a script that will put every point of the curve at z=0
I came up with this simple script after having select a curve :
bpy.ops.object.mode_set(mode='EDIT')
for p in bpy.context.object.data.splines.active.bezier_points:
    p.co.z = 0

But nothing happens, no crash but the point remain at their original Z
Thanks for the help

This should work if your curve is a bezier curve. Check the bpy.context.object.data.splines.active.type. Could be any of these: ('POLY', 'BEZIER', 'BSPLINE', 'CARDINAL', 'NURBS')

@Gaeldk, you can't modify Curve geometry / points that way directly with python while the object is in Edit Mode. Think of edit mode being for user interaction with the UI. -- place the object in Object mode and then update the points with Python.

I hesitate to answer because it seems the answer has been given in several answers to slightly different but ultimately similar questions already present on BSE. -- but this is a fair question each time.

bpy.data.Curves don't currently have a secondary representation, like bpy.data.Mesh does. Meshes can be represented as a bmesh, and they can be manipulated by Python while the Mesh is in Edit Mode. Curves on the other hand (Spline, Bezier, NURBS) don't have an additional representation that lets you modify their data via script while in Edit Mode.
A solution is to switch the Edit Mode to Object Mode, then do your manipulation, then switch back to Edit Mode if you need.
in short
bpy.ops.object.mode_set(mode='OBJECT')
for p in bpy.context.object.data.splines.active.bezier_points:
    p.co.z = 0
bpy.ops.object.mode_set(mode='EDIT')

You won't notice it switching in and out of OBJECT mode, but the bezier_points will be updated, and it will be placed back in EDIT mode.
Ideasman42 states: "changes to bpy.context.object.data are not displayed, and they will be overwritten when exiting editmode."


text:
Blender Automatic Weights: Is it grabbing more mesh than it should?
When I use automatic weights when parenting a model and armature, it works but there's an issue where it seems to grab more "mesh" around it. For example, when I rotate the left leg to test if it's been rigged properly, the leg moves but so does part of the right boot(it stretches and follows the movement of that leg)
Another example is the braids I've rigged, except instead of following another limb/the wrong bone, they stay in place when I move the character's midsection(plus the eyes also stay in the same place but I'm not going to worry about that now)
Does anyone else experience this issue with automatic rigging? If I were to change the model's default pose from the classic "T" pose to one that looks like a jumping jack and try it, would that help or not?
Here's a few screenshots of the issues I'm talking about but I will not be uploading the model itself(past experiences with thieves)

I've rigged a very basic "Test Model" for my game I'm working on and it's basically a blank mannequin in appearance that never gave me this issue. If it's because of the details, is there a way to avoid these random bits from moving with the wrong limb or detaching from the model?
I'm still fairly new to blender but I've learned enough of the basics to get me this far, however any help would be appreciated(again I'm not uploading the model file because of thieves)
Usually I join the clothes to the model but in this case I haven't because I want to update the outfit later on and rather then build from scratch, it'd be easier to switch them out.
I used the same method of parenting the armature and body for the dress, boots and hair.
Also if anyone knows how to make the eyes, teeth and tongue follow the head(WITHOUT joining these models to the main body) I would greatly appreciate it since whenever I try, the mouth becomes huge and appears in the centre of the grid.

You should add some pictures or upload your file. But yes, sometimes automatic weights may fails on some parts, or that can be a symmetry problem on your mesh... really depending on the situation

Yes, automatic weights don't always give the desired deformations.  You'll likely have to weight paint things manually to get the exact look you're going for.  I'd set my weight paint mode to 'Add', and set the strength to 1.0, and weight paint the leg bones to 1 -- then normalize everything when you're done.
If you'd like the eyes, teeth and tongue to remain separate mesh objects, you can try putting an armature modifier on those mesh objects too, and weight paint those on the same way you would the rest of your model.


text:
"Add Sticky" texture option missing in Blender 2.7
In this video, the person adds a "sticky" texture to an object.  The effect is that the object takes on the appearance of the background so that he can use it to "hide" an object behind it.  My issue is that Blender 2.7 has removed "Add Sticky", and Sticky mapping.
I find if I use the same image texture and "Window" mapping coordinates, this has a similar effect, but if the actual background is a composite (for example, I have an image that has a transform and some other nodes on it) it doesn't take those into account. Anyway to incorporate those? Or to use the actual background? –

I find if I use the same image texture and "Window" coordinates, this has a similar effect, but if the actual background is a composite (for example, I have an image that has a transform and some other nodes on it) it doesn't take those into account.  Anyway to incorporate those?  Or to use the actual background?

Hi, you can include the above information in the main post by editing your question.

Sticky coordinates have been removed, the main idea is that you should substitute the ‘sticky’ function with ‘UV project from view’ instead.
If you don't want use the uv project,  an alternative is the BLAM addon.

This works well, but it still doesn't incorporate other compositions I've done on my background (like a translation.)  Right now on my object I'm specifying an image, is there anyway to specify the world background?


text:
Enable dyntopo in Blender 2.80 Beta
I downloaded the Blender 2.80 Beta and wanted to try some sculpting, but I can't find where to enable dyntopo. Is it not supported in Blender 2.80?

Dyntopo could be found in the "Active Tool" tab


text:
Manipulator widget appearing where the 3d cursor is
Something weird is happening where the manipulator arrows moves where ever the 3D cursor is. I don't want this.

You have set the Pivot point to the 3D cursor

@NoviceInDisguise A quick search would have found a duplicate and saved you answering :)

Yeah . . . should have done that.

You have set the Pivot Point to the 3D Cursor:

Simply go to the menu and select whichever you want to use (most likely Median Point).


text:
Object appears smoothed after rendering but not in viewport
I'm pretty new to blender and used it to model a castle and print it.
Now I want to extend the model by textures and render it, but even when I render
it with basic material i get some strange output.
Does somebody know my error? I already corrected the normals and they look fine.

you are using subsurf modifier with higher settings in the render than in the view

you have a subdivision surface modifier (or multiresolution) set to render only, not visible in viewport but active when rendering.

Click the eye to see it, click the X to remove it.
As suggested by Chebhou, the subsurf modifier can also be different in viewport/render because of the subdivision levels number set for each.