text:
Does Blender support the glTF format?
Is the import/export of GLTF files is going to be supported or is there a python script that can handle that?

There is an exporter available here:
https://github.com/Kupoman/blendergltf
While its work-in-progress, its already usable for exporting textured meshes.

It looks like the Khronos Group also has an official exporter for version 2.0: https://github.com/KhronosGroup/glTF-Blender-Exporter

Thanks I wasn't totally clear on the differences. I did notice that's Kupoman's still supports v1 but Khronos' is v2 only.

Thanks. Nice to see some movement around this topic. Seems like the Khronos one is GLTF 2.0 only (no 1.0).

Blender 2.80+ now ships with glTF-Blender-IO pre-installed.  This is a combination of the original Khronos glTF exporter with Julien Duroure's glTF importer.
The Blender Manual has documentation on importing and exporting glTF, including a section on how to get physically-based (PBR) materials to glTF.

There is also seems to be alpha version of importer: https://github.com/ksons/gltf-blender-importer

Verge3D comes with a well-maintained and open-source Blender to glTF (GLB) exporter. Check it out on GitHub.


text:
Creating a colored translucent material for Plastic/PVC roll
I'm trying to make a material that closely resembles the below photograph (ignore the hue)

As you can see, my results below arent all that great, Whilst I'm okay(ish) at the modelling side, I'm useless when it comes to materials and in this instance I've hit a brick wall!

Any advice on the correct material setup would be really much appreciated! Please feel free to explain like you would to a five year old!

Try this node setup: https://blender.stackexchange.com/questions/74686/how-to-create-clear-plastic-cycles/74709#74709

If what you're trying to achieve is the "ghost image" of all the inner stripes of tape, maybe increasing Transparency and Transmission Bounces in the "Light Paths" rendering settings could help?

source: Stack Exchange

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

sort: votes


text:
Strange shading on model

hi, why the model looks weird. no double face or normal flip?
I include the blender file
file download

And what should it look like? What do you consider weird? Be more specific.

You have Custom Normal Data assigned to this mesh.
Go to Data Tab > Geometry Data > Clear Custom Split Normals Data

hi, thks. problem solve

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


text:
Will my Blender installation work after updating to windows 10?
I'm thinking of installing win 10 and was wondering if I will be able to pick up everything where I left it...
Obviously I cannot request a 100% guaranteed result but I want to know if anyone has updated to win 10 and then run blender without a problem. Or did you have troubles? Anecdotal evidence welcome, it is surprisingly hard to come by :)

Thank you guys. I went with the update and (for what it's worth) everything went well. I barely notice that I changed OS, my files and apps are all there.
Of course this is my own experience. Backup your data to be on the safe side.

See http://blender.stackexchange.com/questions/33848/is-blender-compatible-with-windows-10 and http://blender.stackexchange.com/questions/34901/does-blender-work-in-windows-10. There are cases when it's not working, still they should be solvable.

Please accept an answer to let others to know that it is ok more than explaining it in the question. You could answer your own questions if you have an answer for it.

I 've gone from windows 7 to 10 and haven't had any problems. For safety of course save all your projects in an external hard drive, but you better wait other answers.

You can save your files in a save place, uninstall blender, update to windows 10, and install the last version of blender (2.77a when writing this) so you have a clean version.
As you can see in blender.org the last version is "Compatible with Windows 10 | 8 | 7 | Vista" so you won't have any* problem.
Or at least not more problems than with windows 7.

I had the same problem recently. Blender 2.79 didn't want to start on Windows 10.
I used Intel® Driver & Support Assistant https://www.intel.ru/content/www/ru/ru/support/intel-driver-support-assistant.html
which updated couple Intel drivers on my laptop including Graphics Driver.
After restarting the system, the problem was solved - Blender starts and works well.
So yeah, it's the graphics driver problem as mentioned before.

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


text:
Object created from Sapling addon not exported properly to FBX
I just made a tree in blender, with the sapling add-on, for my unreal engine 4 game. I exported the mesh and i imported to the unreal engine 4.. there are no textures imported and it looks something like the picture -.- HUGE leaves and a normal size tree in different places... also in the unreal engine 4 log it says that it must be something with my exporting in blender.. anyone know how to help?

yes they were.. I re-applyed them and then re-exported the mesh and imported it into ue4 and still the same..

are the leaves parented to the tree? If so, try Alt P > Clear and Keep Transform.

@David I dont have them parented .. i managed to upload them by transforming the curve into a mesh.. now i have the texture problem only.. they are coming in unreal engine all gray :P i need to find a way to "bake" or "attach" the texture into the mesh :D  if you could help in this one it would be nice :)

I found the problem. The sapling add-on wasn't creating meshes; it was creating curves. So I transformed the curve into a mesh and then exported it.


text:
Problem Bake Normal Maps from hight poly mesh to low poly mesh
I'm a student and this is my first experience with blender so I'm not an expert.
I'm facing a problem when I try to bake normals in tangent space.
hippo.blend DOWNLOAD
I have two meshes representing an Hippo, created following some tutorials on youtube. One is high poly, second is low poly.

I'm using blender render, as in the tutorials.
I'm able to create an uv map unwrapping the low poly mesh and to do the first bake (select low poly mesh and click bake in render menu).

It is one day that I'm trying the final step of the tutorial in which I open my uv map in the uv editor, select in bake options "selection to active", I select the high poly mesh, shif+select low poly mesh and I click bake again. I can see that blender do the bake but the result does not change in any way.

I found the tutorials on youtube typing "Hippo Blender". They are five and I followed everything. But between the video 4 and video 5, I put bones and two animation on my model (not done in the original tutorial). Then I started again with the last tutorial.
I'm using blender 2.79b in the tutorial it is used blender 2.6 I think.
I try to read all the related topics in this forum but I'm not able to find a solution.
If someone can help me I can share the blender project
Thank you in advance
I edit the question after the answers adding some images of the current settings and the normals that I can see.

as you can see my uv map never changes.

How about increasing the Distance?

I'm selecting first the hight poly mesh. No reason for freestyle box, today I became crazy and I started to try random options (not a good way to do thing), now I deselected it. I tried to follow a tutorial in cycles but when I press bake blender crash. I played with all the possible parameters but nothing change.

yes, probably I messed up the project when I did the bones instead of following directly the last tutorial on the uv map. I think that the only way is restart the hippo project from zero maybe after a new clean installation. Thank you again for the help

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


text:
How to animate, while switching though objects
In Mario Odyssey, The characters eye's are too difficult of a shape to do regular eyeball topology. So they rely on a plane that is Iris/Pupil like. But sense The eyeball can't be rigged, sense the eye's are a oblong shape. They use a verity of other object's to do the blinking. But my question is how does one animate such a complex eye. I'm referencing this Luigi model from Mario Odyssey. Nintendo Switch - Super Mario Odyssey - Luigi I have all the eye object's for blinking. but I don't know how to set this up for animation.

Hello and welcome. Please add reference images to your post to help others understand what you wish to achieve

I guess you have 2 solutions, either use UV Warp modifier to stick pictures that you can animate on the surface: https://www.youtube.com/watch?v=5NlvgMYZgaY  /    https://www.youtube.com/watch?v=kB9cJ3wOoPk  or use sphere that you squeeze with Lattice: https://www.youtube.com/watch?v=1MfxTdq0V2I


text:
Textures not rendering in EEVEE but renders in cycles w/blender 2.8 even with image nodes?

When I go to render in cycles the textures properly render but in EEVEE most of them don't show up, is this a limitation of eevee or am I doing something wrong? Thanks


text:
expandpath() ?? can python reach out to an external directory on users comp?
I have a scores text file (game scores kept here) that gets created on completion of game level.
I am installing users downloads of my game into C:\Program Files\ folder, but programs folder is not writable.
My Python logic (below) in my game levels creates a text file in the existing installation folder, where my other game blend files are stored.
But when I test the download, no scores saved, because the file installs into Windows C:\Program Files\ folder (which is of course fine, it's the right place for a game, but I lament).
So I want to get the script below to not just create a scores.txt file in the existing folder, but to create it in documents (not My Documents/).
My installer will add a blank folder in documents whose name is known, lets call it blurb\, then Python does exactly what it did before, but create the folder (and of course fetch/get/load) in documents\blurb\scores.txt.
This I assume is where it all happens:
scores = _loadScoresFromFile("scores.txt")
from bge import logic
import pickle

def _saveScoresToFile(list_scores, string_filepath):

    file = open(string_filepath, "wb")
    pickle.dump(list_scores, file)
    file.close()

def _loadScoresFromFile(string_filepath):

    try:
        file = open(string_filepath, "rb")
    except IOError:
        print("Failed to load scores from {}".format(string_filepath))
        return []

    return pickle.load(file)

scores = _loadScoresFromFile("scores.txt")

def display():

    scene = logic.getCurrentScene()
    writer = scene.objects["Writer"]

    name = logic.globalDict["name"]
    score = logic.globalDict["score"]
    score2 = logic.globalDict["score2"]

    tup_entry = (name, score, score2)
    scores.append(tup_entry)
    scores.sort(key=lambda entry: entry [1])

    new_entry_idx = scores.index(tup_entry)

    for entry, i in zip(scores, range(len(scores))):
        new_writer = scene.addObject("Writer_new", writer)
        new_writer["Text"] = "{:d} - {:s} - {:2}:{:2}".format(i + 1, entry[0], entry[1], entry[2])

        new_writer.worldPosition.y -= 0.105 * i
        new_writer.localScale = writer.localScale

        if i == new_entry_idx:
            new_writer.state = 1

    _saveScoresToFile(scores, "scores.txt")

def setName():

    scene = logic.getCurrentScene()
    name = scene.objects ["Name"]

    logic.globalDict["name"] = name["Text"].strip()

def setScore():

    cont = logic.getCurrentController()
    score = cont.owner

    logic.globalDict["score"] = score["Text"]

def setScore2():

    cont = logic.getCurrentController()
    score = cont.owner

    logic.globalDict["score2"] = score["Text"]

Do you mean the path C:\Users\USERNAME\Documents? AFAIK this one shows as My Documents in the OS (and localized on system of other languages) despite its real folder name, which is always English. And do you want to know how to use Python's expandpath() or what is it actually about?

yes, c:\user\USERNAME\documents

I know :// means to use the existing directory...Im trying to figure out if blender/python can reach out beyond its own directory to edit the scores file in c:\user\USERNAME\documents of the users computer. Im sure this is all quite clear.

ok...im using an installer to install my game, the installer instals in c:/programs forlder, this is non writable. The pythin code above is in my blender level file, which works fine when i use it in a user folder. but installed in program files, obviously it cannot be written to. I need the code to reach out  to documents or even appdata where a folder is kept that can contain the scores text when its created and then be written on, so my game has persistent memory for scores!

Python is able to access the entire file system, except paths that require elevated rights (such as C:\Program files\ and C:\Windows\). It can also access them if you run your it as administrator, but you would usually not want that.
If you want to get the user directory path, use:
from os.path import expanduser
home = expanduser("~")

It also works on Windows. Example result: 'C:\\Users\\CoDEmanX'
Note that the Documents folder is not necessarily called like that, if you really want the actual path, you'll need to do this:
import ctypes.wintypes
CSIDL_PERSONAL= 5       # My Documents
SHGFP_TYPE_CURRENT= 0   # Want current, not default value

buf= ctypes.create_unicode_buffer(ctypes.wintypes.MAX_PATH)
ctypes.windll.shell32.SHGetFolderPathW(0, CSIDL_PERSONAL, 0, SHGFP_TYPE_CURRENT, buf)

print(buf.value)

For me it prints D:\Dokumente, because I set it up this way on my system.

huh? so how do i change the code above to simply access a folder (outside of program files) to create a text file with the users scores in my game. My installer will create the blank file....anyway...Ima go buy a gun to shoot myself

scores = _loadScoresFromFile("scores.txt") I want to use expandpath so i can tell blender to choose a folder outside the program files folder

I don't see anything Blender-related here, you just determine any writable path, preferably in the user dir (I discourage to use a fixed path, as nothing is guaranteed, like C:\ being the system drive). Check the official Python docs, StackOverflow or whatever for general IO questions.

Sorry, yesterday was a bit frustrated with this problem, I added this to my code

from os.path import expanduser
home = expanduser("~") then this scores = _loadScoresFromFile("/home/scores.txt") but its ignoring the variable home as the designated place, i also tried home +scores.txt with no difference

You don't use a variable there?! fp = expanduser("~/jareel_scores.txt"), then use fpas saving/loading path.


text:
Get path to Blender executable
How to get Blender executable's file path in a Python script?
__file__ gives me my addon's path, but I cannot be sure Blender is in the same folder tree, I guess.

You can get it using bpy.app.binary_path
Blender's API docs say:

bpy.app.binary_path:
  The location of blenders executable, useful for utilities that spawn new instances`

ahhh, i tried googling exactly for that but didn't find it! thx!


text:
making reusable text object
I want to simulate a multi-agent system with Blender. It's almost done, but I experience a problem.
System agents speak to each other by passing messages, and I want to pass messages between them. I considered a text object as container of these messages. There is no constraint on the number of agents.
I want to create one (or some) text object and reuse it many times, by only changing source and destination locations and body texts.
After some search, I realized, that there is no data_path that supports keyframe_insert() to change the body text. Beside that I found dynamic text, but my context is extremely different with that method's context.
I want to change text on every keyframe, and it depends on my simulation's input.

An application handler could be used to read subtitle data from your simulation module and display it by editing a text object.
import bpy
from bpy.app.handlers import persistent

@persistent
def frame_change(arg):
    print("Load Handler:", bpy.data.filepath)
    t = bpy.data.objects["Text"]
    # here get the text you want to display
    label = ("Frame # %d" % bpy.context.scene.frame_current)
    t.data.body = label

bpy.app.handlers.frame_change_pre.append(frame_change)

Thanks stacker for your attention. However it could be a solution; but It is not efficient at all. because i have so many message and this function should fill these message in all frames. but i need to change message only in key frames.

please guide me if I am in wrong way

When you don't need to change the text content in frames just skip the code until you reach a 'keyframe'. Compared to the costs of rendering I wouldn't worry on efficiency.


text:
Csv Import pointcloud into Blender
I have 24 points which correspond to 12 different "elements" (2 points per element) saved in an .csv file with the following column order (1: Element Name, 2: x, 3: y, 4: z).
I would like to import them so that there will be an edge between the two points for every element.
Alternatively if this is not possible. It would be great to import all the points as separate elements. So I can know which points correspond to which element by the order of import.
Update:
This is great and I would like to extend this to the first six point:
I tried to update your code with the edges I want, but it fails.
What does ensure_lookup_table() do ?
In if row[0] there is only one vert. How can I add more ?
The Ideal solution would be select 1,6 or all verts and make a mesh.
The order of the edges would be cool to have but if too much hustle.
Just importing 1, 6 or all verts and connecting them to a mesh would good.
Here my attempt to updated your code:
import bpy
import bmesh
import csv
from mathutils import Vector
from bpy_extras.object_utils import object_data_add

csvfile = open('path2csvfile')

inFile = csv.reader(csvfile, delimiter=',', quotechar='"')
# skip header
inFile.__next__()

for row in inFile:
    #  column order (0: Element Name, 1: x, 2: y, 3: z)
    if row[0] not in bpy.data.objects:
        vert = [Vector((float(row[1]),float(row[2]),float(row[3])))]
        mesh = bpy.data.meshes.new(name=row[0])
        mesh.from_pydata(vert, [], [])
        object_data_add(bpy.context, mesh)
    else:
        bpy.data.objects[row[0]].select = True
        bpy.context.scene.objects.active = bpy.data.objects[row[0]]
        bpy.ops.object.mode_set(mode='EDIT')
        mesh = bmesh.from_edit_mesh(bpy.data.objects[row[0]].data)
        mesh.verts.new((float(row[1]),float(row[2]),float(row[3])))
        mesh.verts.ensure_lookup_table()
        mesh.edges.new([mesh.verts[0],mesh.verts[1]])
        mesh.edges.new([mesh.verts[1],mesh.verts[2]])
        mesh.edges.new([mesh.verts[2],mesh.verts[3]])
        mesh.edges.new([mesh.verts[1],mesh.verts[4]])
        mesh.edges.new([mesh.verts[4],mesh.verts[5]])
        bmesh.update_edit_mesh(bpy.data.objects[row[0]].data, True)
        bpy.ops.object.mode_set(mode='OBJECT')

using the second script in Blender if I deleted Line 16 and Line 17 (I don't know why; I tried because that line was indicated by Blender)   I can import the points, but I cannot view them  I can note that all of points are in the centre (x=0, y=0, z=0) [![enter image descriptio

Python includes a csv import module, which makes reading the csv data and using it to create objects rather easy.
As we read through the file, if an object with the name in column1 doesn't exist we create it, if it does exist we add a second vertex and make an edge between the two.
This creates a new object for each element name, you can easily join them together once done by selecting them and pressing ⎈ CtrlJ
import bpy
import bmesh
import csv
from mathutils import Vector
from bpy_extras.object_utils import object_data_add

csvfile = open('/path/to/data.csv')

inFile = csv.reader(csvfile, delimiter=',', quotechar='"')
# skip header
inFile.__next__()

for row in inFile:
    #  column order (0: Element Name, 1: x, 2: y, 3: z)
    if row[0] not in bpy.data.objects:
        vert = [Vector((float(row[1]),float(row[2]),float(row[3])))]
        mesh = bpy.data.meshes.new(name=row[0])
        mesh.from_pydata(vert, [], [])
        object_data_add(bpy.context, mesh)
    else:
        bpy.data.objects[row[0]].select = True
        bpy.context.scene.objects.active = bpy.data.objects[row[0]]
        bpy.ops.object.mode_set(mode='EDIT')
        mesh = bmesh.from_edit_mesh(bpy.data.objects[row[0]].data)
        mesh.verts.new((float(row[1]),float(row[2]),float(row[3])))
        mesh.verts.ensure_lookup_table()
        mesh.edges.new([mesh.verts[0],mesh.verts[1]])
        bmesh.update_edit_mesh(bpy.data.objects[row[0]].data, True)
        bpy.ops.object.mode_set(mode='OBJECT')

awesome. this looks promising. will test and let you know. thanks a million for the code.

This is very super super nice. Works like a charm. Exactly what I wanted. Thank you very very much.

Sambler, I wonder is it possible to convert point cloud data into a mesh in Blender?

@Amir Nothing built-in, have a look at this and this, if you can't get cube surfer to work you would have to build it yourself from the source

One approach, albeit a bit hacky, would be to create a script to convert your CSV coordinates into OBJ format which you can import.
Consider an OBJ file with the following content.
o Cube
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
l 1 2

It defines and object named "Cube" with two vertices (lines 2 and 3) that are connected by an edge (line 4).
You might opt for something like this..
o ElementOne
v 0.006084 -0.388238 -0.181844
v 0.006084 -0.388239 1.818155
l 1 2
o ElementTwo
v 1.500000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
l 3 4

I might even just write down the OBJ file using a notepad, if this is a one use scenario...

I think that it is a good solution because it is blender-independent.


text:
Trouble importing STL produced by VTK
I am new to blender and am unsuccessfully trying to open an STL file.
Our own visualization software offers STL export via a library called VTK, which we can import into other CAD software (e.g. to feed into a 3D printer).
Blender's Import Stl function also loads the exported STL file, and I do see the number of vertices, faces, tris, objects, etc. increase, however, I fail to see anything in the view.
I assume this comes from my lack of even basic understanding of how blender works and that for instance the faces are just transparent, or everything is very small or somehow else rendered invisible.
Could one of you please have a quick look at the STL file and give me a hint of what I am doing wrong?

Rendering in our own VivoQuant software
What I get after import to Blender:

The import goes fine, but the model isn't visible in the viewport because the view isn't pointing at it, you could do a few things:

zoom out  (mouse wheel)
rotate the view. (middle mouse button)
press home to View All.

Use the Outliner View to see if the object imported, then select the object by clicking the name.

With the mouse cursor in the 3D View press . (period) to focus the view on the selected object.

Many thanks, I was indeed able to find my mouse now. I did try moving the camera around, just didn't expect it to be off by that much.
Also, I found that the Origin functions are very useful; I set the 3D cursor to the center, then used Origin to 3D Cursor, and finally Geometry to Origin to get the mouse into the center, just in case this helps anybody else.


text:
Black holes / Water in glass
I try to render mineral water bottle filled with water in Cycles. For testing purposes I use super simple model with absolute flat lighting filled with white color.
What is bothering me are the black spots on the render. I mean, I know there should be some strange curves generated by IOR, but in the complete white environment black patches should`nt appear.
What should I do, to avoid them? I`m attaching images with the render result.

I know that lighting and model are dull, but I use them to exclude any unnecesarry factors. My render settings are:

This is my latest bottle atempt with photo lighting. It looks better, but on the top of the bottle strange curves appeared. I think that it is caused by plastic rings on the bottle, but it look unnatural. I think that I`m missing something, because I still dont have control on this render behavior.

Maybe related - http://blender.stackexchange.com/questions/7864/black-patches-in-glass-when-using-cycles-render-engine. Also http://blender.stackexchange.com/questions/2558/how-to-illuminate-the-darkness-inside-glass-objects-in-cycles

I'd say this result is normal.
My guess: it's caused by the refraction from the bottom of the cap.

See http://adaptivesamples.com/2013/10/19/fluid-in-a-glass/

Ive seen all this articles. In fact, the bottle I created as a result of the last tutorial (adaptivesamples.com). Unfortunately, it doesnt solve my problem.

change the ior of the glass perhaps to unrealistic high numbers

These "black spots" are actualy supposed to be there.
Look at these images with similar dark spots

It is actually more prevalent in thicker objects so if you really don't like it, try making the glass thinner

This images has a glass with much thicker walls.

You`re right. I just have impression that this black holes should be much lighter. The photos, that you are showing are made in photo studio with black areas (just assuming), but in the complete white environment there should not be any black patches.

@andrew Did you try making the plastic thinner?

Check the hdri lighting with this seen !
Hope this will work for you ! check it ]1

authors: Александр Осипов


text:
Why is the colour picker displaying tinted colors?
The colour picker is behaving not as I expect it to. I cannot move the selector towards most of the edges, setting the RGB to 1.00 for red and the rest to 0 just gets an orange colour. Also I cannot simply keep the "value" the same and select a different shade, the "value" resets.
I'm not sure if i've pressed something in error or there is a setting in the user preferences/elsewhere that needs changing.
I'm using the cycles renderer. The issue occurs with any colour picking :- material, background etc. Quitting Blender and restarting does not resolve the issue. Version 2.79.6

Colour picker behavioiur easier to see

In Scene tab set Display device to sRGB.


text:
Glass rendering incorrectly with dark areas
I am a fresh newbie in Blender. I watched lots of tutorials from Blender Guru, and wanted to make a potion bottle. I don't know what went wrong, but the shading went completely wrong, and for some reason the main spehere doesn't reflect anything. If anyone knows why, please help me!
I used a glass material, mixed with diffuse for the bottle.

The dark areas are normals facing the wrong direction. Fix these by selecting everything A in edit mode and pressing Ctrl+N.
To fix refraction issues, add a solidify modifier to the mesh. You might have to adjust the thicker part on the top. The glass shader is trying to guess where the glass is solid, so you should use it on closed meshes  only for the refraction to work correctly.
For tinting glass, use a volume shader in the volume material output instead of mixing the surface with a diffuse shader.

Maybe try principled shader.  It will be more... correct. With fresnel effect working you might see big reflections on the edges, just as in real world. Plug that straight into surface output and set transmission to 1, roughness to 0. Btw I am not sure if default IOR is correct for glass.

He is using 2.78, which did not have Principled Shader

Oh, ok then maybe he should download a newer version, he doesn't lose anything

Somebody down voted our answers  :(

I am new to this website, I thought down voting is only necessary if someone's answer is insulting or something, not when someone tries to find a solution and doesn't succeed.

You may delete the answer to avoid more down votes :)

This is probably downvoted because while the principled shader might improve the result, the problem can be completely fixed with the current stable version. The down vote is justified in my opinion, because the provided solution is not recommended for most users (who do not want to update to releases labeled as potentially unstable). However it would have been really helpful to explain the reason after downvoting.

@JanKulczycki People have different definitions of what the down vote means. For me personally, I would down vote something if the answer is either unclear, obviously incorrect, or lacking effort. It's always recommended to comment to clarify the reasoning behind the vote so that the answer can be improved.


text:
How to use different GPUs to render and for the UI?
I have read somewhere on the blender site that when rendering with Gpu, you may get limited ui control or something, so if you want to have control and render at the same time you have to use 2 graphics cards, one for rendering and one for ui.
My specs:
b450m ds3h,
Ryzen 5 2400g with integrated graphics,
Rx 580 8gb
So, would it be possible that i would plug my monitor in the Motherboard, but set the render device in the settings to my rx 580, so i'd render with rx 580 but use the integrated graphics for ui and other tasks in the background (YT, gimp...)?
And yes i know that i would have to switch the hdmi cable to my gpu when gaming.
I know it works that way with 2 dedicated gpus, but i dont know about integrated, so i asked you. Thanks a lot!


text:
Blender 2.8 applying image to object
I must be missing something obvious.  I am in the texture tab, set up the file paths to the image but I am not getting anything.  Engine is Eevee, Viewport = layout, shading = rendered.
Here are the settings:

As you can see in the first menu of the properties panel, you're texturing  a brush, not a material.

A workable solution can be found here.

A python version of this issue is here:  https://blender.stackexchange.com/questions/146746/python-2-8-creating-diffuse-bsdf-in-a-shader-node-when-i-want-it-in-a-surface-n


text:
Python 2.8 - plane bevel disappears on object join
In the following code I am joining several objects.  'Plane1' and 'Plane2' have beveled corners.  But when I join them to 'Cube' the bevels disappear.  Why?
Below are two code snippets; the first creates the plane and the bevel (in case procedurally I should do something different), the second has the join operation that causes the bevels to disappear.
Here's the code that creates the plane and the bevel:
def add_plane_obj(ObjName):
    bpy.ops.mesh.primitive_plane_add(size=SizePlane1,enter_editmode=False,location=(-2,-2,BaseZ))
    bpy.context.active_object.name=ObjName
    bpy.ops.object.editmode_toggle()

def add_plane_resize(ScaleX, ScaleY):
    bpy.ops.transform.resize(value=(ScaleX,ScaleY,1))

def add_plane_material(MaterialsIndex, MaterialName, R, G, B):
    bpy.ops.material.new()
    try:
        bpy.data.materials[MaterialsIndex].name=MaterialName
    except:
        pass
    bpy.data.materials[MaterialName].diffuse_color=(R,G,B,1)
    bpy.context.object.data.materials.append(bpy.data.materials[MaterialName])

def add_plane(ObjName, MaterialName, MaterialsIndex, R, G, B, ScaleX, ScaleY):
    add_plane_obj(ObjName)
    add_plane_resize(ScaleX,ScaleY)
    add_plane_material(MaterialsIndex, MaterialName,R, G,B)

def bevel_plane(BevelWidth):
    bpy.ops.object.editmode_toggle()
    bpy.ops.object.modifier_add(type='BEVEL')
    bpy.context.object.modifiers["Bevel"].segments=15
    bpy.context.object.modifiers["Bevel"].width=BevelWidth
    bpy.context.object.modifiers["Bevel"].use_only_vertices=True

add_plane('Plane1','RSwhite3', 0, WhiteR, WhiteG, WhiteB, ScalarX, ScalarY)
bevel_plane(BevelWidth1)
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)

The following code causes the bevels to disappear after executing the join on 'Plane1' and 'Plane2:'
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
bpy.ops.object.select_all(action='DESELECT')
bpy.data.objects['Cube'].select_set(True)
bpy.context.view_layer.objects.active = bpy.data.objects["Cube"]
bpy.data.objects['new_name'].select_set(True)
bpy.ops.object.join()
bpy.data.objects['Plane0'].select_set(True)
bpy.ops.object.join()
bpy.data.objects['Plane1'].select_set(True)
bpy.ops.object.join()
bpy.data.objects['Plane2'].select_set(True)
bpy.ops.object.join()
bpy.data.objects['Circle'].select_set(True)
bpy.ops.object.join()

As well as an object being selected, one object is known as the active object, this object has its properties shown in the properties panels and may be affected by some operators that will ignore the other selected objects.
In your case, when joining multiple objects, the modifiers of the active object are kept while modifiers on other objects are disposed of.
You could set the plane as the active object before the join or add the modifiers after the join. Most likely you want to apply the modifiers to the plane so that the bevel on the plane is kept and is not also added to other parts of the joined mesh.


text:
Option flags for custom properties (bpy.props)
I just read about properties in the documentation. Every type of property can be created with some options. Most of options are self explanatory, but I really don't know how to explain the option called 'PROPORTIONAL'. Example:
bpy.types.Object.example = bpy.props.IntProperty(name='Example', \
    default=-1, options={'PROPORTIONAL'})

I was able to find the following doc string:

Adjust values proportionally to each other

but it does not make much more sense. Properties can't be edited using proportional editing, right?
Is there any documentation for all of these option flags?
HIDDEN, SKIP_SAVE, ANIMATABLE, LIBRARY_EDITABLE, PROPORTIONAL?
I wasn't able to find any.

The PROPORTIONAL flag is not related to Blender's Proportional Editing feature, but Multi-Number Button Editing. It's broken in 2.72 for custom properties however.
There doesn't seem to be any documentation in the API docs about this particular option beside what you already found. The corresponding is_... properties seem to be the only documentation.

HIDDEN: True when the property is hidden.See also Hide custom properties in the UI panel with python
SKIP_SAVE: True when the property is not saved in presets. See also this comment
ANIMATABLE: Property is animatable through RNA (should actually be true even if not specified)
LIBRARY_EDITABLE: Property is editable from linked instances (changes not saved)
ENUM_FLAG: Property is an EnumProperty and multiple entries can be selected (ShiftLMB)


text:
How to install Blender sub-process modules to run Blender in background?
Does anyone know how to install BlenderAsPyModule on a Linux machine?
As a beginner, I don't understand how to do it.
Is there a simplified guide?

I do not know how to install BlenderAsPyModule, but if your main goal is to run Blender in the background you can start it with the command-line option -b. You can even pass it a python script to do your rendering with the option --python myScript.py. Have a look at this question and the documentation of the command line options for more information.

Hi @maddin45, thanks for the reply , is it possible to import and export the models using this?? on background ?

If you just want to open a .blend file you can add it to the command line options: blender myFile.blend -b --python myScript.py. If you need to import a model using an importer script you can do it in the python script you passed to Blender. You will have to add the path where the importer script lies to your script's system path. For the .obj importer this would be: import sys, sys.path.insert(0, '<blender_root+something>/scripts/addons/io_scene_obj'). Then import the importer script import import_obj and call import_obj.load(0, bpy.context, 'someFile.obj')

Hi @maddin45 i can understand what you are saying, but can you provide any online document related to this ??

Not really, sorry. I do not know of any tutorials regarding background rendering using python. I had a similar problem some time ago and solved it by searching for pieces of code in google and reading through the Python API documentation.


text:
Split an edge in two?
Is there a simple and quick way to add a vertex to an existing edge? I mean in a similar manner (Ctrl+R) like a loop cut for the whole object?
My current workflow is, deleting the edge completely, then I select one of the vertices and extend it via E shortcut. Is there an easier method to get an extra vertex like:

Select your edge, open the Edge menu with Ctrl+E or the context menu (RMB) as of Blender 2.8x / Specials menu (W) in older versions and select "Subdivide":

Edge menu in Blender 2.8+

Edge menu in Versions pre 2.8

And after you've subdivided the edge, you can increase the number of subdivisions to add more than one intermediate vertex, and by using vertex slide, you can move one vertex anywhere along the edge. One other thing to be aware of is that when you create an intermediate vertex by subdividing an edge, you risk creating undesirable geometry on the face of faces of which the edge is a part.

If the edge is not supposed to be equally subdivided, you might find the Knife tool (K) helpful as well.

Extend vertices
Since 2.72 Blender versions, with the command Alt+D and a vertex selected, you can add a vertex on edge next to the mouse cursor.
Then, by double tapping G key, you can slide it along the edge.
If you just need one single extra vertex and you are not interested in a uniform object subdivision, there's no fastest way.


text:
Blender Game engine Animation Not playing
The Tux character in the attached blend does not play the walking animation. The parenting is set correctly (armature) and all modifiers have been removed.
Any ideas?
GoogleDrive Blend

I can't open your file from here.
You need at least the armature modifier. You can easily get them by

select the skin mesh object(s)
shift select the armature
ctrl+p Set Parent To \ Armature Deform

Usually you need Vertex Groups set that match the names of the armature's bones.
ctrl+p Set Parent To \ Armature Deform \ With ... allows you to create such Vertex Groups.
I hope it helps


text:
How to convert coordinates from vertex to world-space?
How do I convert from object-space to world-space?
I suspect it is:
vert_os = obj.vertices[foo]
vert_ws = vert_os.getPositionFromMatrix(obj.matrixWorld)

but does the matrix also handle translations, or do I need to handle that separately?
Can someone link to the relevant documentation?

Multiply the world matrix by the object-space vector for world space coordinate:
import bpy

ob = bpy.data.objects['Cube']

v = ob.data.vertices[0].co
mat = ob.matrix_world

# Multiply matrix by vertex (see also: https://developer.blender.org/T56276)
loc = mat @ v

# Don't do the reverse!
loc = v @ mat  # wrong!

`Object.matrix_world is a 4x4 transformation matrix. It contains translation, rotation and scale. A 4x4 matrix can also be used for mirroring and shearing (not covered in my answer).
[a] [b] [c] [d]
[e] [f] [g] [h]
[i] [j] [k] [l]
[m] [n] [o] [p]

The translation is stored in the first 3 rows of the 4th column of the matrix (d, h, l):
mat.col[3][:3]

You can also use:
# Create new Vector object
mat.to_translation()

# Access the original matrix' translation
# (assignments will change the matrix, thus the object location!)
mat.translation

Rotation and scale are sort of combined. The rotation is stored in a, b, c, e, f, g, i, j and k. The scale is stored in a, f and k. The values in a, f and k of the rotation are taken and multiplied by the scale factor to store both pieces of information.
To get only the rotation, you need to normalize the 3x3 matrix:
mat.to_3x3().normalized()

To get only the scale, you can use the utility method:
mat.to_scale()

Or manually, normalize the matrix and divide each of the un-normalized by the normalized components (a, f, k):
# you could do this manually like
# vec / sqrt(vec.x**2 + vec.y**2 + vec.z**2) for every matrix column
nmat = mat.normalized()

scale = Vector((mat[0][0] / nmat[0][0], mat[1][1] / nmat[1][1], mat[2][2] / nmat[2][2]))

If you need the world coordinates of all vertices, it's more efficient to use the transform() method:
me.transform(mat)

It will apply the transformation matrix to the mesh, so multiply the world matrix with all vertex coordinates. You may wonder about the change in orientation of a mesh object in viewport if you do the above. It can be fixed by resetting the matrix_world (otherwise the transformation will be done twice):
ob.matrix_world = Matrix()  # identity matrix

Maybe you mean v = ob.data.vertices[0].co instead of v = ob.data.vertices[0].

Love how "translation stored in d, h, l" — could be a tagline for DHL :D

This is fairly simple and applies to any data (curves, armatures, lattice ...)
v_co_world = obj.matrix_world @ obj.data.vertices[0].co

Its also handy to be able to do the reverse, get a point in worldspace relative to the vertex.
# get the cursor in object space
# (so you can compare it to the vertices locations
#  without first having to transform them into worldspace).
v_co_object = obj.matrix_world.inverted() @ scene.cursor_location

For me, the camera's matrix_world was an identity matrix, so to get the coordinates of a point relative to the camera, I needed camera.matrix_basis.inverted() * mathutils.Vector([0,0,0])

In blender 2.8 use @ operator for matrix multiplication
for example
transformed_vertex =obj.matrix_world @ obj.data.vertices[0].co

I'm using Blender 2.8--this worked for me without importing NumPy. Using * failed.

@ is a operator in python. For more info PEP465

If you're brave enough to use numpy you can get all the vertex coords as a numpy array about a thousand times as fast as any other python method:
import numpy as np

    def get_co(ob, arr=None):
    """Returns vertex coords as N x 3"""
    c = len(ob.data.vertices)
    if arr is None:
        arr = np.zeros(c * 3, dtype=np.float32)
    ob.data.vertices.foreach_get('co', arr.ravel())
    arr.shape = (c, 3)
    return arr

def get_proxy_co(ob, arr):
    """Returns vertex coords with modifier effects as N x 3"""
    me = ob.to_mesh(bpy.context.scene, True, 'PREVIEW')
    c = len(me.vertices)
    me.vertices.foreach_get('co', arr.ravel())
    bpy.data.meshes.remove(me)
    arr.shape = (c, 3)
    return arr

def apply_transforms(ob, co):
    """Get vert coords in world space"""
    m = np.array(ob.matrix_world)
    mat = m[:3, :3].T # rotates backwards without T
    loc = m[:3, 3]
    return co @ mat + loc

def revert_transforms(ob, co):
    """Set world coords on object.
    Run before setting coords to deal with object transforms
    if using apply_transforms()"""
    m = np.linalg.inv(ob.matrix_world)
    mat = m[:3, :3].T # rotates backwards without T
    loc = m[:3, 3]
    return co @ mat + loc

A thousand times faster?

I just did a speed check. against loop and list comprehension.
on an object with 60,000 verts, numpy was only 20 times faster.
Sorry about the exaggeration.

20 is still good.  Care to add test result to answer?

I'm not good at posting here. Is there a way I can send you my code?

I posted the code on git
link

If you have your coords in a flat numpy.array from foreach_get("co", coords), the following dot product of the world matrix with the local coordinates will get their their global version:
import numpy as np

def to_global(local_coords, world_matrix):

    # Reshape coords to Nx3 matrix
    local_coords.shape = (-1, 3)

    # Add an extra 1.0s column (for matrix dot product)
    local_coords = np.c_[local_coords, np.ones(local_coords.shape[0])]

    # Then:
    # Dot product matrix with the coords transpose
    # Keep the first 3 rows (x,y,z)
    # Transpose result to Nx3
    # Flatten
    global_coords = np.dot(world_matrix, local_coords.T)[0:3].T.reshape((-1))

    return global_coords

To use:
# Get the local coords
local_coords = np.zeros(len(my_obj.data.vertices) * 3)
my_obj.data.vertices.foreach_get('co', local_coords)

# Convert to global
global_coords = to_global(local_coords, my_obj.matrix_world)

On my machine and a mesh with 491,526 verts, the function takes 8.1 ms, or about 0.16ms per 10k verts:
>>> timeit.timeit(lambda: to_global(local_coords, my_obj.matrix_world), number=1000) / 1000.0
0.008153792893048377

import bpy

obj = bpy.data.objects['Cube']

wm = obj.matrix_world
print( wm )
for v in obj.data.vertices:
   world = wm * v.co
   print(world)

The world matrix contains the transformations for location,rotation and scale as in the Properties Panel:

The relevant documentation on Math Types & Utilities mathutils


text:
Create custom graph and access values from Python
I need to allow the user to create their own transfer function y = f(x)
(I will then use this transfer function to warp the scene)
Currently I'm using a mathematical formula:
y = exp( 1/(x^2 + 1) )

But it doesn't allow a (non-mathematical) artist to shape the curve, and it is awkward even for a mathematician to turn an arbitrary shape into a mathematical formula.
Ideally I would like the user to be able to draw the curve freehand, or maybe in the same manner as constructing curves in Blender.
In fact, can I get away with using Blender's existing curve tool? Say I create a new scene, I suppose I can then create a curve that is constrained to the xy axis. But then how could I get y = f(x) from a Python script?
And also, is there some 2D curve tool, that might allow the curve to be designed from within some panel?
Is there any solution path I'm missing?

After a bit of investigation it seems you can't use Graph Editor for "standalone" FCurves.
However, you can link them to any object and name them as you like. I used the default Cube in example below, but it might be as well an empty mesh.
Below script uses Cube as object that "holds" your curves within its animation_data.action. It creates them if they do not exist, and if they exists current one is picked.
import bpy

placeholder = bpy.context.scene.objects["Cube"]
if not placeholder.animation_data:
    placeholder.animation_data_create()
if not placeholder.animation_data.action:
    placeholder.animation_data.action = bpy.data.actions.get("curves") or bpy.data.actions.new("curves")
action = placeholder.animation_data.action

print(placeholder)
name = 'my_curve'

fcurves = action.fcurves
for f in fcurves:
    if f.data_path == name:
        break
else:
    f = action.fcurves.new( name )
    f.select = True
    f.keyframe_points.insert( 0, 0 )
    f.keyframe_points.insert( 100, 10 )

Then you have get to edit curve you can add points by duplicating existing ones using shift-d.

After shaping it you can use FCurve.evaluate() (API docs - bpy.types.FCurve). For example like this:
for i in range(100):
    print(i, f.evaluate(i))

I just had a look at FCurve http://wiki.blender.org/index.php/Doc:2.6/Manual/Animation/Editors/Graph/FCurves -- they seem to be tied to time on the x-axis (frames). Is there any way I can choose my own x-axis e.g. theta from -pi/2 to +pi/2 ?

Again, will have to confirm when I will get my hands on Blender, but I don't think you are restricted in any way as far as x-axis is concerned. By default, yes, it is treated that input value is current frame. However as you're going to call evaluate() yourself you shouldn't be concerned about that (as long as you're not planning to plug it as some property). P.S. I am no expert in Blender Python scripting, just guessing from what I know (and it is not that much).


text:
How can I call the active brush within my script?
I am attempting to modify sculpt brush settings via a custom menu. To do this I'm setting a string property to specify the setting I wish to modify.
Since these settings are dependent on the active brush, I need to pull in the current brush via:
bpy.context.tool_settings.sculpt.brush

It seems this should work. I can confirm that it's accessing the correct brush. However, when I assign the brush context to a variable, and then call that variable within the data path it complains:

Traceback (most recent call last):
    File "/stringProp-tool.py", line 16, in execute
  TypeError: bpy_prop_collection[key]: invalid key, must be a string or an int, not Brush

Here is my script:
import bpy

class BrushSettings(bpy.types.Operator):
    """Toggle Setting For Active Brush"""
    bl_idname = "sculpt.brush_setting"
    bl_label = "Toggle Brush Setting"

    setting = bpy.props.StringProperty()

    def execute(self, context):

        setting = self.setting
        brush = bpy.context.tool_settings.sculpt.brush

        if setting == 'use_accumulate':
            value = bpy.data.brushes[brush].use_accumulate
            print(value)
            bpy.data.brushes[brush].use_accumulate = not value
        return {"FINISHED"}

class BrushSettingsMenu(bpy.types.Menu):
    bl_label = "Brush Settings"
    bl_idname = "sculpt.brush_settings_menu"

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

        accumulate = layout.operator("sculpt.brush_setting", "Accumulate")
        accumulate.setting = 'use_accumulate'

def register():
    bpy.utils.register_class(BrushSettings)
    bpy.utils.register_class(BrushSettingsMenu)

def unregister():
    bpy.utils.unregister_class(BrushSettings)
    bpy.utils.unregister_class(BrushSettingsMenu)

if __name__ == "__main__":
    register()

    bpy.ops.wm.call_menu(name=BrushSettingsMenu.bl_idname)

The lines  giving me grief are these:
value = bpy.data.brushes[brush].use_accumulate
bpy.data.brushes[brush].use_accumulate = not value

Accessing data via collection look-up they expects a string or an int:
That is why you got the error.

bpy_prop_collection[key]: invalid key, must be a string or an int, not Brush

Running the following in the console window we can see that setting variable gets assigned a bpy.type.brush
>>> type(bpy.context.tool_settings.sculpt.brush)
<class 'bpy.types.Brush'>

Its a simple fix, you need to use the name of the brush.
value = bpy.data.brushes[brush.name].use_accumulate

However, obviously in this case you better just use.
value = brush.use_accumulate


text:
What is the smallest possible .blend file size in 2.8x?
I'm trying to make a container library .blend file for common node groups and I cannot get the file to be smaller than 51.3 KiB (52 506). Can you do better?


text:
How to achieve higher BGE frametime?
When I hit P, my game starts usually. I have "Show Framerate and Profile" ticked, and when I play, it seems that there is a cap at 60 for my frames. How can I increase this? Also, it reads the following: Frametime  :  00.0ms (00.0fps). What is the "00.0ms"? Mine does not display 0, thats just for explanation, but I am quite confused on what it means. To summarize, how can I increase the fps cap and what does the "00.0ms" area mean?

"Frametime" shows the framerate in frames per second (FPS), and milliseconds per frame (ms). At 60 FPS each frame lasts 1000/60 = 16.6666... milliseconds. I thought disabling Use Framerate in Properties > Render > System or increasing Properties > World > Physics > FPS would the framerates to exceed 60, however this doesn't seem to be the case (you can limit the framerate to below 60 though)

This is the correct answer. But you might also have to disable V-Sync in the render panel. (and maybe in the display driver level as well)

For reference, frame time is how long it took to render a frame. You normally want that number to be a as low as possible. You want high frameRate, low frameTime. These two value are linked. (1/frametime = framerate)

The default settings are "capping" the framerate to 60, but it seems you can "unlock" the cap by deselecting the "use frame rate" checkbox under render > system properties tab:

I am quite confused: after this is done, my fps is still at ~59/60. It would occasionally go above 60 but immediately cap to 59.9. I kept lowering settings to make sure that there wasn't a coincidence of me just running at 60 constantly, but this is not the case. Do I have to do this over all my scenes? What could I do do try to make this work? I appreciate the answer, but I would like a little more info so mine would also work.

Generally speaking this is not a good way to get a higher frame rate. It will uncouple the game-time from wall-time, so on faster computers the game will appear faster, and on slower computers game will appear slower. It's better to use the FPS option under World settings.


text:
How do I alter keyframes for a new framerate?
I created a new scene for a new animation. I didn't know this at the time, but a new scene is a new world, so settings will be back to default. I made all my weapons, models, HUD elements, and others with the default settings. Whats the problem with this? I have 60 fps for my animation framerate, but the new scene has it on 24.
Yes, I should simply increase it to 60 to match everything else, but all my animations will run faster than 2x regular/intended speed. I could set it to 60, and do whats on my mind: delete and rework all of the tons of animations I have created.  I obviously am looking to an alternative, and I am thinking that, hopefully, in some way, I can take an animation and maybe move the frames or have all the frames moved by a percentage (example: original frames = 10, moved by 150% makes total 15 frames)?

In object mode, select all the objects for which the animation rate needs to be changed from 24 to 60 fps.
In the graph editor, place the 2D cursor at frame zero, and set the pivot center to 2D Cursor
Hit A once or twice to select all of your keyframes. (You may want to hit CtrlH to hide the curve handles if it looks too busy)
Hit S, then X to scale horizontally, then type 2.5, then Enter
This scales your 24 frames-per-second animations out a multiple of 2.5 to 60 frames-per-second.

I'm so glad this is in the engine, I sort of felt hopeless as I didn't know this existed. I'll take a better look and test it when I can. Thanks though! :)


text:
How do I clear the render border?
In the 3d viewport I am using a border region to only render things inside the selected region. I did this with CtrlB. I cannot get rid of the region. How can I make the border disappear?

Related: Render Border's related check boxes - How do they work?

I found this question on a search engine when trying to hide texture borders. The solution was to disable mipmaps in Blender menu "File" -> "User Preferences" -> "System".

Use Ctrl + Alt + B to clear the render border, or if you open the Space menu and type "render border", you should see the option.

There is also Shift + B, but this is the legacy shortcut for border render IIRC and it only works when looking through the camera. Use Ctrl + B as you can have different render borders for the viewport (when doing realtime rendering) and the camera.

Wow! I've been struggling with this problem for a long time. Thanks for a solution!

verbiage changed to 'Clear Render Region'?

On the View Properties Panel (N to open it) you can find the "Render Border" checkbox. So, select/unselect the chebkbox to enable/disable the render border appearance.

There is also a "border checkbox" in "Properties > Render > Dimensions panel", SteveW posted an image of the panel in this post.


text:
Model doesn't mirror correctly
One of my first models from several months ago, when I began with Blender, doesn't work with a mirror modifier properly. While tabbing between Edit and Object modes, the object origin remains in place, while the mesh location is different on the x-axis by a half a blender unit. In Edit Mode the mesh favors the right as in +5, while in Object Mode it is -1! I did try clearing scale, rotation and location. Any ideas?
Here is the blend file: http://www.pasteall.org/blend/33015

Essentially when attempting to mirror the gap between the models center is large in edit mode while it's near perfect in object mode?

Here is a blend file I appreciate any assistance  http://www.pasteall.org/blend/33015

The model is also being rotated by the armature so it's not actually upright.  When the armature is deleted; the model rotates slightly along the X and Y axis.  I think you may have to start over by removing the parenting, clearing the transform, realign the model and then add the mirror modifier before re-doing the rig.

Start over is what I feared I would need to do considering it was my first model, learning model while I like to hurry through things..I really very much appreciate your assistance...I guess saying "Thanks" is the only way to provide gratitude!

The reason that you object looks ok in object but not in edit mode is that the parented armature is displaced. You could try to remove it, and enable clipping in the mirror modifier. Than move the original (right) part of the mesh toward center. And setup the armature again.

That sounds like a good possible alternative...Much thanks!!!


text:
FloatProperty seen as a tuple when adding hard_min or hard_max
Below is a snippet of some addon code:
class MyOperator(bpy.types.Operator):
    bl_idname = "object.my_operator"
    ...

    threshold = bpy.props.FloatProperty(
        name = "Threshold",
        description = "Threshold",
        soft_min = 0.00001,
        soft_max = 0.1,
        # hard_min = 0.00001,
        # hard_max = 10,
        step = 0.01,
        precision = 5,
        default = 0.001
    )

    def execute(self, context):
        t2 = self.threshold * self.threshold
        ...

As is the code runs fine, but the second I uncomment either of the hard_m** properties I get the following error: TypeError: can't multiply sequence by non-int of type 'tuple'.
What am I missing here?
info:
Blender 2.78, OSX

If you have a look at the FloatProperty documentation you will notice there is NO hard_min/hard_max parameters.  Suggest using min and max instead.
As an example we'll add some undefined grombo parameter to a FloatProperty
    threshold = bpy.props.FloatProperty(
        name = "Threshold",
        description = "Threshold",
        soft_min = 0.00001,
        soft_max = 0.1,
        grombo = 99,
        #hard_min = 0.0001,
        #hard_max = 10,
        step = 0.01,
        precision = 5,
        default = 0.001
    )

    def execute(self, context):

        print(self.threshold)
        t2 = self.threshold * self.threshold
        print(t2)
        return {'FINISHED'}

and run the operator in the py console
>>> bpy.ops.object.my_operator()
(<built-in function FloatProperty>, {'soft_max': 0.1, 'precision': 5, 'step': 0.01, 'default': 0.001, 'grombo': 99, 'description': 'Threshold', 'soft_min': 1e-05, 'name': 'Threshold', 'attr': 'threshold'})
Error: Traceback (most recent call last):
  File "/home/batfinger/3DModels/Tests/movebones.blend/Text.001", line 25, in execute
TypeError: can't multiply sequence by non-int of type 'tuple'

ie, if there is an undefined parameter, then the value returned is a (function, {parameters}) tuple, hence the rather cryptic error.

A grombo parameter? Made my day :D

Well I'll be darned! I was using the documentation from https://docs.blender.org/api/blender_python_api_2_78_1/bpy.types.FloatProperty.html, where it does list a hard_min and hard_max property! Thanks for the heads-up!


text:
Vertically move several vertices while keeping their alignment
Here is my current object:

I want to move the selected vertices up the Z axis, I want the vertices on the other side (i.e. top of the object, right of the picture) to stay in place, and I want the vertices in between to move accordingly with there two constraints:

They must keep their horizontal position (only Z displacement).
The general left-right edges must stay linear (no angles at a middle vertex).

I tried the following things, nothing worked:

Moving only the selected vertices up, creating a dummy edge between the far left and the far right, moving a middle vertex up with "snap to edge" enabled. → The "snap to edge" isn't precise when moving along Z axis.
Moving only the selected vertices up, selecting all the other top faces, and using "scale along local Z" (shortcut S, Z, Z) to size 0. → The local Z is the one for the full object, not the selected vertices normals.
Moving only the selected vertices up, with linear proportional editing on. → The bottom vertices are closer from the selected one than some I want to move and it changes the bottom of the shape too.

How can I achieve my goal without too much pain?
EDIT
The final general shape should look like this:

Just humor me a moment, how many vertices do you expect you have selected currently? And can you sketch the expected outcome? The word description is too difficult to envision for me.

I have 8 vertices selected: 4 on the left and 4 at the top of the image. The expected outcome, well, see my edit…

One way to approximate it could be to use proportional editing with linear falloff, but it might be a tiny bit imprecise on the last angle

Yes, I tried that already.

I think I would approach this as extruding everything up top to the maximum hieght desired. Now i would select a vertex I wanted to keep high and another I wanted low. Pressing J would create the correct diagonal. Then it would be a matter of more selections and J and deleting all faces that weren't a part of the outcome expected. J is cool for this I think.

This looks like a good candidate for the shear tool, did you try that ?

@HelloHiHola My question was marked as duplicate, but some other constraint that I didn't speak about in the question (such as the height of the lower vertex must be kept) make the answers irrelevent. Your idea works, though! I'd accept it as an answer if it was possible! Thanks!


text:
How can I get a list of floats from a texture?
I'm trying to have a grid of cylinders with different heights, using Geomery Nodes.
My initial idea was to use a Noise Texture to get a field of values that I then give to a Cylinder primitive.

This is not working as it can't transform a field into a value, but the idea is there: I want each cylinder to have a different height, based on the value of the texture at those coordinates.
How can I achieve that?
NOTE: I don't actually need a grid of cylinders, I need a grid of complex object created by a custom group with inputs. My question is mostly on "how to change that field into a value".

If you don't want to use cylinders here, but different procedural objects, then this question is definitely a duplicate of Why is there a red line when I try to connect one node to another?

It's similar, but I guess the texture makes all the difference: there is surely a way to get "the value at those coordinates" and therefore change that field into a value, isn't it? If it's not possible, then yes, it's a duplicate.

As I said in my comment below, you can mark any points in your procedural group beforehand, which you can move after instantiation. It is therefore strictly a duplicate, but with the answer below you might be able to solve it.

Another helpful answer might be this one: How can I instantiate a procedural node group with different parameters?

Another possibility would be to move the cylinder caps after instantiation.
To do this, mark them before instantiation, add a random value to the instances, and after the instances are realized, move these marked points to the desired position.

By the way, this question/answer explains why you get a red line:
Why is there a red line when I try to connect one node to another?
(Blender 3.6+)

Good answer, I edited the question to indicate that the problem is simplified in it, I actually need to apply that to a custom object and not a cylinder. I can't use a workaround on this :-(

@SteeveDroz I understand. With this technique, however, you could mark any part of your procedural geometry beforehand (and not just the cylinder caps as in this example). This would allow you to move certain points after instantiation.

You see that red line? That means an error. What error? Well, the output from the noise texture is a field output. Where as the cylinder primitive takes only singlular float values. Blender cannot that you want a grid of cylinders and you want the cylinders to change heights according to a noise texture which is based on the position.(The default value of the noise texture vector input is the position field)
How do you achieve what you want?
Well for that you will need the grid of cylinders to exist first and then control their heights after that.
I have a setup in which I have used grid of circles and extruded them using the noise textures.(I wasn't able to figure it out with cylinders, hehehe, sorry)

Thanks, but it doesn't help. In fact, my question is a simplification as I don't really need cylinders but a custom group that has a value input. That wouldn't work.

Ok, so it would be helpful if you change the question in that case. Basically the noise texture will be evaluated according to the position of the object. If you want a list like you said in the question, then idk, probably scripting then.  If you want a value per object then you can capture it or something like that. Also check the other answer that was just posted. It's a much better method.

.. or use the captured noise-on-points value just to scale  instances in Z?  Maybe that's an unwanted deformation.

@SteeveDroz As Akshay says, if it's a simplification but you want something different, it is better to ask a question which tells us what you want because otherwise this might lead to incorrect solutions. But Akshay: of course you can change the height of the cylinders instanced on a grid by a noise texture. But you have to scale the instances, not the original object. Because (unless you instance a collection) the original object can only have a single original geometry. This can be manipulated on the instances though: scale instances

@GordonBrinkmann I was going to do exactly what quellenform did. I had a setup similar to it. What I forgot was capturing the top first instead of just directly plugging it. That made all the points go up and down. So just to help out this person, I made a setup with circles instead.

Well sure, to move the points upwards you have to go a different way. But at first when it seemed as if he wanted to use it on cylinders, simply scaling them would have been easy...


text:
Enumerating vertices with their indices
This code...
def objects_starting( s ):
    return[ obj for obj in bpy.data.objects if obj.name.startswith( s ) ]

def export_all( folder ):
    if not os.path.exists( folder ):
        os.makedirs( folder )

    # G E O M E T R Y (2 files)
    for obj in objects_starting( 'geom' ):
        print( obj.name )
        verts_file = create_file( folder, obj.name + "_verts" )
        faces_file = create_file( folder, obj.name + "_faces" )

        export_geom( verts_file, faces_file, obj )

        verts_file.close( )
        faces_file.close( )

def export_geom( verts_file, faces_file, obj ):

    mesh = obj.data

    verts_file.write( "[points]\n" )
    verts_file.write( "%i\n" % len( mesh.vertices ) )

    for v in mesh.vertices:
        v_world = obj.matrix_world * v.co
        verts_file.write( "%i " % (v+1) )   <-- FAILS HERE
        verts_file.write( "%.16e %.16e %.16e\n" % v_world[:] )

fails with:

TypeError: %i format: a number is required, not MeshVertex

I'm scratching my head because I had something similar working yesterday:
def write(filepath):

    meshes = [ob.data for ob in bpy.context.selected_objects if ob.type == 'MESH']
    total_verts = sum(len(me.vertices) for me in meshes)
    total_faces = sum(len(me.polygons) for me in meshes)

    # verts file
    file = open(filepath + ".vert", 'w', encoding="utf8" )

    file.write("[nodes]\n")
    file.write("%i\n" % total_verts)

    for me in meshes:
        for v in me.vertices:
            file.write("%i " % v)
            file.write("%.16e %.16e %.16e\n" % v.co[:])
    file.close()

What is going on?  It must be that my new technique for getting a list of meshes doesn't return the right data type, or something.  But I can't see it.

I suspect (v+1) may be forcing an implicit typecast to integer on v

What you try is:
verts_file.write("%i " % (v + 1))

But v refers to a MeshVertex instance. What you need is the .index property of the vertex:
verts_file.write("%i " % (v.index + 1))

Or count yourself:
for me in meshes:
    for i, v in enumerate(me.vertices):
        print("%i " % i)
        print("%.16e %.16e %.16e\n" % v.co[:])

I suspected that, but then disregarded it because file.write("%i " % v) apparently worked, in the old code. Why didn't this cause the same problem? ...or is it the + operator that's giving the error? ...I assumed it was %i

It does not work either way in current Blender, 'cause MeshVertex is not a number and can't be cast to int. It could be implemented (in Python, it would be like def __int__(self): return self.index), but why would one want to allow MeshVertex + int? If you want the vertex index, then use the vertex index (v.index). There's nothing wrong with + or %i, but the code is incorrect.

Sure, I understand that it's a type problem. I didn't realize that there was a MeshVertex.index so it was just a suspicion. Regardless, all I was saying is that because + complains for MeshVertex + int, it seems like "%i " MeshVertex should ALSO complain. Maybe it just doesn't, but I thought you might know why.

"%i" % bpy.context.object.data.vertices[0] will complain about the type as well: TypeError: %i format: a number is required, not MeshVertex

You're adding 1 to v in verts_file.write( "%i " % (v+1) ) but the + operator is expecting v to be an integer, not a MeshVertex, which is why it didn't fail the first time (you weren't adding to it).
As CoDEmanX states, you need to operate on v.index to get the vertex's index.
(+ was expecting the integer, not %i as I claimed before)


text:
Python - Orient light to polygon (face normal as direction)
I am currently trying to write a script that creates a light at every polygon oriented to each polygon. The script takes as an input the active mesh. It iterates over the polygons of the mesh and gets their global position. It then creates a light at that position. The problem is that I cannot get the light to be rotated so that they are perpendicular to the face, is the same as the normal. I tired using the function polygon.normal but this does not give me a vector I can apply as a rotation. Instead .normal gives me a local position vector. It is local in the sense that it sees the polygon center as 0, 0, 0, basically the .normal function is no good for me in this case.
Here is what my script currently does:

Here is what I want it to do:
I do not care about the yaw of the light only the orientations matters to me atm.

part of the script or download here also included in the blend file
The code is well documented I think, let me know if anything is unclear. The function for creating the lights starts at line 47.
def create_light_at_face():
    """
    layers: tuple. 20 booleans where exaclty one boolen is True
    return: None
    creates an area light the has the same orientation as the normal at the center of each face
    """
    for poly in mesh.polygons:
        loc = get_global_poly_pos(poly)
        normal = get_normal(poly)  # this is probably needed somehow

        # get the rotation needed for each polygon face, idk how
        # default values in RADIANS, actual values will be computed somehow
        rot_x = 0
        rot_y = 0
        rot_z = 0
        bpy.ops.object.lamp_add(type='AREA', view_align=False, location=(loc[0], loc[1], loc[2]), rotation=(rot_x, rot_y, rot_z), layers=get_layers())
        # scale lamp up a little fo we can see the area
        bpy.context.object.data.size = 3

There's probably a cleaner solution, but for the time being, you can use:
import bpy
from math import radians
from mathutils import Vector, Matrix

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

def get_layers():
    """
    return: tuple of 20 booleans. True if layer is active layer,False if not
    Allows the mesh to be created on the active layer. There is only 1 active layer
    """
    active_layer = bpy.context.scene.active_layer
    layers = [False] * 20
    layers[active_layer] = True
    return tuple(layers)

def create_light_at_face():
    """
    layers: tuple. 20 booleans where exaclty one boolen is True
    return: None
    creates an area light the has the same orientation as the normal at the center of each face
    """
    mat_world = obj.matrix_world
    up = Vector((0,0,1))

    for poly in mesh.polygons:
        co = mat_world * Vector(poly.center)

        forward = poly.normal.copy()
        forward.rotate(mat_world)
        right = forward.cross(up).normalized() # Vector.length closer to 1.0
        up = right.cross(forward)

        rot = Matrix((right, up, -forward)).transposed().normalized().to_4x4()
        mat = Matrix.Translation(co) * rot

        bpy.ops.object.lamp_add(type='AREA', view_align=False, location=co, layers=get_layers())
        # scale lamp up a little fo we can see the area
        bpy.context.object.data.size = 3
        bpy.context.object.matrix_world = mat

create_light_at_face()

Also tried eulers, but did not work reliably (some lamps pointing inwards).
As ideasman_42, suggested, to_track_quat() can be used to do the job, too:
        quat = poly.normal.to_track_quat('-Z', 'Y')
        loc = Matrix.Translation(poly.center)
        mat = mat_world * loc * quat.to_matrix().to_4x4()
        bpy.context.object.matrix_world = mat

It's not much code less, but more understandable I hope.
Another variant:
        loc = mat_world * Vector(poly.center)
        # use loc as co for lamp_add operator here
        quat = poly.normal.to_track_quat('-Z', 'Y')
        quat.rotate(mat_world)
        bpy.context.object.matrix_world *= quat.to_matrix().to_4x4()

Note, constructing the orientation matrix is interesting to do manually, but you could use http://www.blender.org/documentation/blender_python_api_2_69_release/mathutils.html#mathutils.Vector.to_track_quat

Thanks for hint, I got it to work after a while. Added two variations for to_track_quat()

To manually duplicate a light onto every face, oriented to the normal, is rather simple, parent the light to the object and enable DupliFaces. Make Duplicates Real can then turn the duplicates into individual objects.
That can also be easily duplicated using Python -
import bpy

replicator = bpy.context.active_object

bpy.ops.object.lamp_add(type='AREA', location=(0,0,0))
light = bpy.context.active_object

light.parent = replicator
replicator.dupli_type = 'FACES'

replicator.select = True
bpy.ops.object.duplicates_make_real()


text:
Python 2.8 - feasibility of unwrapping a dynamically sized cube in python
For a dynamically sized object in Python (a cube resized into a rectangle, dimensions determined at run time), is it just too ambitious to create a script to do the unwrapping of the object?  From what I can tell, unwrapping appears to be a very hands on process that might not be amenable to automation.
Just curious before I chase this down the python rabbit hole...

What would be the purpose of unwrapping? Seamless continuous coordinates or just non-stretched sides with uniform scale? You can just call Smart UV project from python after you've done creating and scaling the cuboid. An axis-aligned cuboid would be about the easiest shape to practice programming UV coordinates if you want to get your hands dirty.

@kheetor The cube is resized into a very long rectangle, causing serious texture stretching.  Unwrapping was prescribed as a solution.  The problem is described here:  https://blender.stackexchange.com/questions/146849/python-2-8-image-texture-stretch-versus-repeat

You should have kept this in your previous thread. The idea of using "Generated" texture coordinates is that you don't need to assign UV coordinates. You can negate stretching by not using generated (which are stretched to object bounds) and rather using something like Geometry -> Position instead for uniformly repeated texture.

How would I do that in python?  My code is here:  https://blender.stackexchange.com/questions/146849/python-2-8-image-texture-stretch-versus-repeat

If you just switch from 'Generated' to 'Object' you'll get the object coordinates which aren't stretched. (unless you are scaling the mesh in object mode) But you aren't explaining what kind of texturing you are trying to achieve and what your meshes are like which makes giving you accurate advice difficult.

Here a picture of the texture and the target object:  https://blender.stackexchange.com/questions/146938/why-doesnt-the-image-in-the-uv-image-editor-appear-on-the-object-in-the-3d-view

Looking at that you have scaled it in object mode which means all your stretching issues are because of non-uniform object scale. You need to apply object scale and either redo unwrapping or use "Object" output of "Texture Coordinate" node.

The scaling of the object (using python code) is (1,1,1) immediately before the texture is applied. After applying the texture there is no more rescaling

@kheetor Thanks for your help above.  Would you mind taking a look at this question of mine?  https://blender.stackexchange.com/questions/149322/python-2-8-transform-resize-uv-map-instead-of-object


text:
Blender 2.8 (python) - this line of code causes inexplicable fatal crash
This line of code worked fine until I dropped it into a function.  Now when it executes, blender shuts down without throwing an error:
bpy.ops.render.render(use_viewport = True, write_still=True)

The error likely has nothing to do with the code, but maybe has tapped into an internal corruption within Blender?
Has anyone ever encountered this before?  Possible solutions?

Does rendering through the UI work properly (F12)? You can run Blender from the terminal with --debug to get error messages or on Windows blender_debug_gpu.cmd in Blender's install directory by double-clicking on it (this will create a log file).

how often is that line of code executed by the function you put it in?  ..instead of that line can you write print('happens') and see if it's executed perhaps more often than you realize?


text:
Blender 2.8 (python) - adding keywords to a JPEG output file
Is it possible to add descriptive information to a .jpg file - for example, image title, description and keywords?
I am particularly interested in python scripts that would do this.
Thanks!

piexif could be what you're looking for. Blender doesn't offer any options to write custom exif tags.

will that work as an import/addon/whatever within blender, or do I have to run it outside of blender?

You would either have to run it externally or create an external script directory that Blender can load which you would then have to add in Preferences > File Paths > Scripts. The latter would allow you to import the module in Blender.


text:
Blender 2.8 - how do I make a texture reflect light?
I have a marble texture that I would like to make shiny.  Roughness is currently set to zero, but there is no light reflection.
Any suggestions would be much appreciated.  Thanks in advance!

Diffuse shader is just what the name suggests, diffuse. Try using a principled shader or combining a diffuse with a glossy shader through a mix shader node.:)

There is no reflection because you are using a diffuse shader. Diffuse shaders have zero reflections, and you need to mix it with a glossy shader to put them on.  There's a simpler and more realistic way to do this, though.  just add a principled shader node and  connect the texture to it the way you connected it to the diffuse.  if you want more info on why you shoud use the principled shader versus a diffuse and glossy mix, Blender Guru has a great youtube tutorial on it.
I hope this helps!

I suggest you watch the video as it explains every slider on the shader.

when I try glossy (compared to diffuse) shader, everything goes much darker except the illuminated part of the texture.  Is that normal?

which youtube video?  https://www.youtube.com/results?search_query=blender+guru+shader

it's the one called " How to Use Blender s New Ultimate Shader - The Principled BSDF"  and yes, it is normal to have the material darker when using a glossy shader versus a diffuse.


text:
Blender 2.8 (python) - automated UV map variation to avoid look-alike cubes
I have a script in python that creates a lot of cubes to which I would like to apply a texture.
Thus far I have done the UV mapping with smart project, mostly because I have been intimidated by the prospect of having to figure out how to write the python script that would map coordinate by coordinate.
My concern is that smart project will map the cubes the same way every time as opposed to creating variation.
My question - what is the most efficient way for me to vary the mapping of each cube?
Thanks!

You can prob do this via the node editor. If they all use the same material, you can offset the uv mapping node using the Random socket of the geometry node. (naming of the nodes could be wrong, I’m on my phone)

how would one do that?  I have mostly used smart project thus far and am a complete novice when it comes to UVmapping at the node level.


text:
Blender 2.8 - quadratic gradient fail
My goal is to create a gradient in a circular manner (one color in the center of the circle, the other at the edge with a transition in between).
I attempted to apply the lessons from this post, but can't get it to work.
Any suggestions would be much appreciated.

Does your sphere/disk have UVs?
Also, if you have UVs and move them by x-0.5, y-0.5, the gradient gets pushed outside of the UV space. If it's there it might be very faint.
An easy setup to control this can be the following:

Note the Empty in the Texture Coordinate Node! - You can move, rotate and scale it to position the gradient. Keep it in the center of your object as a starting point. (My mapping node looks different because I'm using a build of 2.81 at the moment. But it works the same way.)
Another tip: Use the NodeWrangler Addon that comes bundled with Blender to look at the Outputs of the Texture Coordinates or the Mapping Node while you make changes. (Just Ctrl + Click the Node a few times) That way you can see what you're affecting.

You need to use Quadratic Sphere and not Quadratic in the Gradient Texture node.


text:
Blender 2.8 - bevel modifier on a cube to which other objects have been joined
Is it possible to bevel a cube that has been the subject of a join?
I am positioning text objects on the surface of the cube and then joining them to the cube; but this seems to interfere with the bevel modifier.  The surviving object is the cube.
I have created a cube and applied a bevel modifier successfully; but when I join something else to the cube, the bevel disappears.
I have also joined multiple items to the cube and then applied the bevel modifier (which doesn't work).
Thus, whether I apply the bevel modifier before or after the join, the result is the same - no apparent bevel!
Any thoughts would be appreciated!

Try doing this: In the bevel settings, limit the bevel based on weight. Then, in edit mode, select only the edges of the cube, and set the bevel weight to 1.

Instead of Joining the meshes together you could Parent them, then they can retain their individual bevels and still be "attached"


text:
Imported OBJ will not move to grid
I imported an OBJ from SweetHome3D to the latest version of Blender. When every object is selected (press A), I press "shift-S" to click "Selection -> To Grid". However, the single OBJ object will not move to the grid. I already have my camera positioned for the grid. I have never dealt with OBJ files; can I not move them?
Below is my car after applying SteveW's suggestion. The car is on the central grid (what ever you may call it), but it is broken. The grid is at the orange dot.

I have updated my answer with a more detailed explanation. :)

@SteveW, Nice work!

After import, try this:

The object should appear in the center of your grid.
Update:
Note: The default Grid Floor (visible grid) is merely a 2D representation of a very small part of the actual grid, centered at the zero point (X=0, Y=0, Z=0).
When you Shift S > Selection to Grid, the selected object's origin ('center' point) will snap to the nearest grid division (a position in 3D space where all three (X,Y and Z) grid lines intersect). The object geometry (the visible object), will move with the origin, maintaining its position relative to the origin.
By default, the origin is normally in the center of an object. It is the rotation point and location, displayed here:

The geometry, and origin, of an object can be moved independently of each other, and this can be confusing because the origin gives you the location of the object, but the visible object (geometry) can be in a different location!
In your case, the imported .obj objects were not near the Grid Floor and Blender had no information about an origin, so it placed origins for all the objects at the zero point (which happens to be one of the points where all three grid lines intersect). And then, of course, with Shift S > Selection to Grid, nothing happened.
ideasman42 suggested: 'Origin to Geometry, then snap the objects to the grid', which works - but they were still not where you wanted them because they would have snapped to the nearest grid division. At this point, instead of Shift S > Selection to Grid, you could have used Shift S > Selection to Cursor (assuming the 3D Cursor was in the center).
According to what you said, I thought you only had one object, and so I suggested you use: Origin > Geometry to Origin, which would have worked perfectly but…  :)
I hope this clarifies things a bit and isn't too confusing.

This works! However, the cars wheels and interior look like they have been in an accident (OoO), but technically I never asked how to move it in one functional piece. Therefore, this is the answer (^u^)!

@DevynCollierJohnson to move it in "one functional piece" use Origin to Geometry instead.

@DevynCollierJohnson, This answer was purely to get your object to the center of your grid in the simplest way, as you seemed to be unaware of the '3D grid'. - ideasman42's answer (although correct), would have left the object in some place other than the grid center, and it appears you were having trouble finding it.

Not sure this is the correct answer? - or its answering a different question, Origin to Geometry has nothing to do with the grid.

@ideasman42, can you explain what you mean?

Because its already snapped to the grid.
To explain: OBJ is a mesh-only format, therefor there is no object center. Just geometry and the object center is always (0, 0, 0), so there is no snapping to do.
To do what I think you're asking, you can have blender calculate a new origin (in the toolbox Origin -> Origin to Geometry), then you can snap the objects to the grid.
You may also want to split the mesh by loose parts before doing this though OBJ may be already split up, depending on the import options.

How is it already snapped to the grid? I may import a single piece of furniture and it would be very far away from the grid

@DevynCollierJohnson "OBJ is a mesh-only format, therefore there is no object center ... the object center is always (0, 0, 0), so there is no snapping to do."

The OBJ object is not on my grid like I want it to be. I must zoom out and try to find the object. Once I find the imported object, it will not move. It is stuck. How do I force it to go to the grid?

@DevynCollierJohnson by 'grid' do you mean the visible grid in the 3D View? - 'Selection to Grid' snaps the object to the nearest grid node in 3D space, and can be anywhere.

@SteveW, Yes, I mean the visible grid. I never heard of grid nodes.

@SteveW, Nodes is a confusing term here, I think Object Center Point is the correct term.

Nodes is not my term, if you see the tool tip for Snap >Selection to Grid, it says 'Snap selected item(s) to nearest grid node'.

@SteveW, renamed grid node -> grid division r58703.


text:
How can I send blend file data with Python Pickle?
I want to send objects across the interwebs,starting with the default cube.
Python pickle can send binary packets across connections, so this shouldn't be too hard, just a read in that seems the most confusing.

How does one grab binary data from a .blend file?
How does one grab binary data from memory? Is there a python binding for this?
If I can do read, chances are write is similar.

Potential uses: send your best friend your default cube, colored , textured, with images and cool stuff attached to it,with all the modifiers too.

Do you want to send the data from the .blend or from an external file? A bit more information would be appreciated.

default cube saved as a .blend , open this up in blender and you now have the default cube instance in memory, and a default cube in the blend. I want to modify the cube (chance a vertex) on the instance in memory, then send the binary data over a socket connection to a listener, that will reconstruct the binary data and put it into my scene. Kindof like a start trek transporter, only simpler. I suppose if I can find the instance in memory, I can use that info to read the blend file externally... the memory one seems to be easier to think about though.


text:
How to get to the pie menus?
With the pie menus, new for blender 2.72, I'm now wondering how do I get to them? I have tried some of the different keyboard shortcuts mentioned for the pie menus.

For 2.72 you have to enable the pie menus in the user preferences. CtrlAltU or File -> User preferences then the Addons tab. Search for pie, enable the addon called User Interface: Pie Menus Offical.
After the pie menu addon is enabled the keyboard shortcuts such as Tab or Z will open a pie menu. Documentation about the pie menus on the blender wiki.

Got your selfie, eh?


text:
Merge vertices at individual centers
I would like to clean up some geometry, I need to get rid of dozens of small triangles. I am able to select many of them by using "Select similar: Area", but I can not clean them up all at once. Instead, I have to go and select them one by one, and then press Alt+M and select "Merge: At Center" for each one of them.
Is there a way to merge them all at once, at their individual centers? I tried switching pivot point to "individual origins" but it doesn't change anything.

Edge collapse
As stated by the Blender reference manual's page:

This takes a selection of edges and for each edge, merges its two vertices together

Despite the description look quite simple, the algorithm is capable of iterating the process upon several selection clusters.
The operator can be triggered by the option in the "deleting menu" that pop up after pressing X key as in the image sequence below

Switch pivot point to Individual Origins with all regions selected
Scale to zero (press S and then 0)
Press W and select Remove Doubles

In my case I'd want to merge edges individually and I wasn't able to, this was my workarround.
In this image below, you can see that I have separated edges that came from mirror modififer, I tried to solve this using clipping, but it didnt work.

To solve:
Edit Mode -> Remove Doubles -> Choose a value that fits in ur case, mine was 0.00910m

In case u dont have noticed, on the image says the default value of the Remove Doubles tool wich is 0.00001m. Another thing is pressing shift and dragging the mouse left and right to softly change the values.


text:
How do I remove unwanted Transform Orientations?
I'm using a lot of custom-defined transform orientations (Ctrl+Alt+Space) recently while modeling. The list has grown too large, how do I remove some or all of them?

The custom transforms are also listed in the 'Transform Orientations' panel in the Properties shelf (N).
Choose the custom transform you would like to delete from the list, then press the 'x' next to it to remove it:

It is possible to delete a transform orientations by selecting it, hitting Space, and searching for Delete Orientation.


text:
How do you sample an image at a computed coordinate in the context of a Blender Internal node-based texture?
I am experimenting with procedural textures, and I'd like to create a texture like
x = A.dot(orco-P0)
y = B.dot(orco-P0)
output = image[x][y]

It is not THAT hard to compute dot products in nodes (although it is a lot of clicking).  The roadblock I am hitting is that the Image input has no input for coordinates.
How can I accomplish my mission in texture nodes?  (This is using Blender Internal in case that wasn't clear from the subject line)

The calculations belong in the material not the texture.
The nodes for a texture define the colour for every available point as if it was an image.
The texture node in a material requests the colour from the texture at a specific point. The vector input to the texture node defines the point requested from the texture.

In practice: it seems you relay the truth; but philosophically: I am disappointed with blender.  If I want to define a texture (mapping from coordinate to color) which is defined in terms of other textures (mapping from coordinate to color) it is clearly unusual, but it should not be impossible.  No one has coded it yet (and I'm not motivated to create yet another ignored patch).  Materials are probably the workaround, but complicate things.

I implemented sambler's suggestion of doing the math in the material instead of in the texture.  This is the result:

And the interior of the "convert space" node group looks like


text:
How can I send instance attributes from Geometry Nodes to Shading Editor?
I have a file created with Blender 4.1. My GeoNode creates instances and changes their color based on their ID using "Store Named Attribute" and creating an attribute named "color", different on each instance.
Down the line, there is a "Realize Instances", if that helps.
In the Shader Editor, I recover that value with "Attribute".

Everything works well with Blender 4.1, but when I open that file with Blender 4.2, all my instances are red (ID=0).
I guess there has been some change, but where? How should I proceed to update my file in order to obtain the same result?

Set the Attribute > Type to Instancer when you want to access data from instances. However, you say there is a Realize Instances node "down the line" and you do not show your complete nodetree, so I cannot verify that this is the full solution to your issue.

I'm sorry I don't show my whole tree, but it's huge! Nonetheless, I found the answer: "Relalize Instances has a new "Realize All" tick that I should untick. I'll edit my question, adding that part. Feel free to edit your answer afterwards.

@SteeveDroz How should I edit my answer? The question seemed as if you stored data on instances, therefore you have to use Instancer on the Attribute node. Now I only know you realize some instances but not all, but there is still no information on which part your data is now stored...

Just add "also uncheck Realize All in Realize Instances" and your answer solves my problem ;-), I will accept it as the Chosen One. (sorry, I'm a bit sick and I'm not sure I'm clear)

If I would say that just from the question it would only be wild speculation. I would actually rather say, since you store the data on instances, do not use a Realize Instances at all.


text:
Compositing Layers Have Halos
I'm having a heck of a time compositing numerous layers using the Alpha Over nodes in the compositor. I have done this many times before without a problem.
All the objects on each layer are ending up with alpha halos around them. The saved image (Targa, TIFF, PNG,etc.) all have semi-transparent halos around each layer's contents.
I've tried checking Convert Premul at each stage along the node tree trying to get the alphas to work correctly together but the checkbox seems to be having no effect at all.
Can anyone tell me what's up with this?
(Unfortunately, I can't post a .blend because it contains purchased models)
Thanks.

I've uploaded a very simple .blend showing the same problem as well as a screen shot. The blend is here.
I understand what's happening (I think) in that each layer's edges are being anti-aliased against the black background, resulting in gray edges. But there must be a way to do what I'm trying to do here. I know I've done it before where the alphas are blended such that the gray halos aren't there.
Anyone know how I should be doing this?

Try enabling "Convert Premultiplied" on all your AlphaOver nodes. If this works, I'll explain.

I've activated/deactivated Convert Premul in just about every possible combination, as I stated in the original question. The checkboxes have no effect whatsoever.

Polosson nailed it! FSA wasn't checked. I had set that to be checked by default in new .blends but must have turned it off and updated my default scene. Thanks a million!

The problem seems to comes from Anti-aliasing.
Try disable it (Render Panel) and see the result.

The "bad" thing is that your render won't be anti-aliased...
If you still want anti-aliasing, you can turn on Full Sample, but this will increase the render time significantly.

use an alpha converter node in compositing to make it premultiplied.

You have that problem because the alphas of each plate are correlated, as the foreground doesn't overlap the background, it masks it out.
Solving it is not super straight-forward but it's quite easy:

Add add the alpha channels of each layer together. Use a mix node with the "add" mode.
Add RGB plates together, same as above: mix node, "Add".
Use the "set alpha" node to assign the result of the added alphas to the result of the added RGB plates.
Profit :-)

The result will be properly combined with no halos or holes.