text:
What is the difference between "Generated" and "Normal" texture coordinates?
I cannot understand from the documentation the difference in the Texture Coordinate node (in Shader) between Generated and Normal, and even the purpose of the Texture Coordinate node itself, which I have as the first node.

you could try daniel kraffts video (on youtube) titled "all material nodes in blender explained"

Have a look at this presentation by Bartek Skorupa on texture coordinates.It is a bit long, but a lot of good information in the talk.

Skip the Intro Manipulate texture coordinates like a boss - Bartek Skorupa

And 2 English sentences, one for Generated and one for Normal could be given ?

you can start here: https://docs.blender.org/manual/en/latest/render/shader_nodes/input/texture_coordinate.html?highlight=texture%20coordinates

Texture Coordinate vs Geometry Node and how-do-texture-coordinates-work

The referenced YouTube video by Daniel Krafft might or might not be All 80+ Blender material nodes explained in under 30 minutes

@Isaiah Haveman: Can you link directly to it (or provide the ID)? Alternatively, confirm.

Shader nodes start at 07 min 16 secs

The manual entry for the Texture Coordinate node.

It may help to visualize it this way:
When we render a scene, for each pixel on the camera we project a ray, and if we make contact with the surface of an object, we ask "What is the color that should be reported for this pixel given material properties, lighting, occlusion etc?"

This is fairly simple when the material is a solid color, but what about materials that vary?
A procedural material can be thought of as a "field" in the physics sense, it exists and has a value in every position in your scene.  When you map this texture to an object and look at it in the viewport you are displaying the cross section of this field that coincides with the surface of your object.

The Texture Coordinate node merely defines the X,Y,Z coordinate space used to map the texture.  Object coordinates, for example, use Blender's scale setting and set the object's origin as 0,0,0.  Generated coordinates use the object's bounding box as the coordinate space over a range of 0,0,0 to 1,1,1.

Normal coordinates are a little strange.  My current understanding is that they are less based on position, and more on the rotation of each individual face (more specifically the normal direction).  Maybe someone will expand on how this may be useful for you, my knowledge is limited on this one.

Just to expand a bit on Allen Simpson's fine answer:

Generated coordinates return the location of the currently evaluated shading-point, say, P, calculated in the 'Generated' texture space, which, whatever the size of the shaded object, measures 0-1 along the sides of its bounding box, with its origin at the minimum. The bounding box is parallel to the object's local axes, (which may be skew to the mesh, if you rotated the mesh in Edit Mode).
(This is a default; the 'Generated' space actually can be scaled and shifted in the Texture Space panel of the object's Data tab.. but I think that's a bit of a legacy?)
Two of the outputs of the Texture Coordinate node, Normal and Reflection, don't return the location of P; they return directions from P: locations on the unit sphere centred on P.
Normal in the Texture Coordinate node returns the vector from P, in the direction of the interpolated (after smoothing) normal of the surface, to the tip of the yellow arrow, 1 Blender unit long. It's measured in Object Space: its X,Y and Z components are parallel to the Object's X,Y, and Z.
Normal in the Geometry node returns the same thing, but in World Space. The Reflected output returns the direction of the currently evaluated incoming ray, onward, after reflection from the surface at P. It is also measured along axes aligned with the World.

Excuse me, mister. Could you please help me with this question?
https://blender.stackexchange.com/questions/300633/how-does-normal-texture-coordinate-work
Thank you so much!

Hello, @IanAmbrose. I think it turns out that (IMO) Nathan has answered it very well, since this request! If his answer doesn't quite do it for you, i'd recommend a diplomatic nudge to clarification, over there :D


text:
How to easily draw a grease pencil on top of an image
I use the Compositing workspace in Blender 2.8 to overlay images with grease pencil objects. (Alpha Over node taking an image as the first input and the View Layer as the second input.)
When I create those objects or move them around in the Viewport, I would like the Backdrop (which shows the objects on top of the background) to update and reflect those changes. However, it doesn't until I hit F12 to render :( Is there a way to solve this?
Furthermore, I make use of keyframes to fade in the objects. Is it possible that the backdrop listens to changes of the current frame and updates accordingly to display only those objects that have a positive opacity at the corresponding point in time?
Maybe I am just doing it completely wrong - in that case, please point it out ;) I'm still very new to Blender.

related: live action footage and grease pencil animation

[EDIT: added second way, easier method]
So, you want immediate feedback since you want to draw something on top of an image. There are 2 ways:

Draw while having background image activated on your camera (while also in camera mode obviously):
Select your camera, go to the Camera properties, check the Background Images, then Add Image, then open file manager icon and select the image you want.

Tweak the settings of the background image, it's straightforward and you can see the result on your camera. Note that the default frame method is actually stretch, but I change it to fit to show you the white gap on the sides of the image from the camera since the dimension output is not the same as the image.
This background image is only reference, so you still need to composite the image and render output in compositor, next step is make sure you know what you're doing around the image size difference (if any) in the compositor.

Import image as plane (bundled add-on): enable this add-on first (if you haven't already) from Preferences > Add-ons > search "import image", check to enable.

Now there will be new option: Add > Image > Images as Planes. If you have selected the image, change the settings first: Material Settings: Shadeless, Align: Face Camera. this way you don't have to rotate the plane to match the camera.

Now, match your image size with the output dimension: scale the plane until its 2 sides match one of the camera width, then adjust the Y accordingly.

or even better PRO TIP: if you don't know the image ratio, or the image is too big and you want just smaller size for the render output, you can input math into the input field. For example, if the image is 3687x2142 px (landscape), but you only need lower than 1500px for the each side, you can input 3687/3 in the X resolution, and 2142/3 for the Y, resulting in 1,229 x 714 px.

Wow, thank you so much for the camera trick! :D When I render from the Layout workspace the background is not rendered. Is there a checkbox or something to switch the background on in the render? (in order to eliminate the need for entering the compositing workspace and adding nodes there...) This would be very convenient ;)

This background image is just for reference, so you do still need to composite your render and the image in the compositor. BUT now that my brain is clearer than before, you can actually just IMPORT an image as a plane with shadeless material. My bad XD

This sounds extremely promising! :) I found the "import images as planes" add-on but how do I adjust the camera to only see the plane without gaps or cropping the image? (Image and output are the same size.)

@yogabonito I added GIF for the demo, hope it helps.
also i recommend you edit the title of the question into something like "how to draw grease pencil on top of an image easily", so people in the future not expecting this to be about compositing.

Thank you for your hard work @lintang_biru! Very much appreciated! :D

I am no expert, but this is to help you about some fundamental things:
Compositing is just like using Photoshop to edit your render output. Regarding your question of whether it's possible to update the compositor wihout rendering (F12):
1.) Yes, if you don't change the scene
2.) No, since you said you want to update the compositor after changing scene.
Why so? When you move objects in the scene, or changing the scene in any way, Blender has to calculate lights, material, etc again to produce correct render output, right? So it's impossible to update the compositor without rendering again if you make changes to the scene.
Now, I don't know how complex your 'compositing' is, but do you know that you can just use the 'rendered mode' first to see how the scene looks like, then if your scene is done, then you can move on to compositing them.

Is it possible that the backdrop listens to changes of the current
  frame and updates accordingly to display only those objects that have
  a positive opacity at the corresponding point in time?

Yes, you just have to be in the correct frame and hit render, so it's actually back to the explanation above, since changing an object visibility/opacity is changing the scene, you have to update the compositor by rendering again at the frame that you want

hmm, actually my composite is reeeaaally simple. Only an image with some grease pencil objects over it - no light source involved in the whole scene. Is there another way to get immediate feedback as to where on the background I am drawing?
+1 for taking your time, thank you :)

My bad, I was skimming your question and missed the real problem of what you really want. I'll add another answer with screenshot.

source: Stack Exchange

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

sort: votes


text:
How can I smooth an edge from a cut-out?
I have a rounded "onion looking" shape and have used a Boolean modifier to cut a hole out of it:

Now I'm trying to smooth out the edges so there are no harsh corners on the shape. How can I do this?
Here I have highlighted the area I'm trying to smooth out:

Once you've applied the boolean, rearrange the topology so that it's a good one, then bevel the edge:

Thank you so much! Can you explain what you did between image 3 and 4? It looks like the bevel becomes larger, trying to learn that step. Thank you

I think I just moved along the edges (select an edge loop, press GG and move along Y) and scaled it?

First in first, the faces cut out by boolean modifier will use the data from that cutting cylinder. So you need to set that cylinder smooth in shading.

  Note: I am using bounding box to display that cylinder

Due to how boolean work, you might want to apply sub-modifier before boolean modifier and make all your object smooth.

And also, vertices cannot be smooth by sub-modifier after boolean modifier (the crease value seems to be dropped), so you will need to add sub-modifier on that cylinder too.

You can download this example here:

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


text:
Why is the other side faded in mirror mode?
This has happened before, and I'm in mirror mode just using a reference picture, and I now I notice that the other side is in a faded color. And I cannot click it or interact with it.

You can see and interact with modifier's result as selectable cage, In modifier's properties check Adjust edit cage to modifier result (the very right button in the top row). This works for many others but not all modifiers as well. Beware though that it will be visible but not actually exhisting geometry.

It is by design. The other side will only be available for direct manipulation after you have applied the modifier. Mostly, when a user attach a mirror modifier, it's purpose is so that the user could just focus on working on one side of the model until we need to break the model's symmetry.
The greying out give you a visual as to which side of the model you are currently suppose to work on as you rotate around the model. You can imagine it would be frustrating to be clicking on something that is inactive by design.

(Its it is.)

As hawkenfox said, it is by design. However, there is a way to allow the other side of the mesh to be interacted with (warning, it behaves a little strangely). It is toggled using the mesh-triangle icon in the top bar of a modifier.

This mode won't quite let you interact with the other side of your mesh normally. All that it does really, is select the corresponding vertex on the non mirrored side and let you move that. As a result, the control widget will be over the original side of you mesh always, and you cannot perform transforms between the sides of the mesh. (You couldn't scale to verts on opposite sides together for example)

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


text:
How to iterate over material index using Python

I want to iterate over the material index of material slot and change the value of each material index. How can this be done in Python?
I've tried using the Python shown below, but it doesn't work correctly.
import bpy

object = bpy.context.object
material = object.active_material
for num in range(0, 5):
    object.active_material_index = num
    if material.use_shadeless:
       material.use_shadeless = False
    else:
       material.use_shadeless = True

The fastest way to loop over the object's materials is through its material_slots attribute. Here's an equivalent code for toggling all object materials shadeless property:
import bpy

for m in bpy.context.object.material_slots:
    m.material.use_shadeless = not m.material.use_shadeless

The only issue I see in your own code is that you're assigning the material to a variable before changing active material index, which renders the latter operation moot. Changing the index before assigning the resulting material to a variable, will yield the result you want.

this work best, using material_slots seems solve the issue

doesn't look like it works for you. maybe further testing is needed.

The error with the script is its not re-assigning material.
Corrected script:
import bpy

object = bpy.context.object
for num in range(0, 5):
    object.active_material_index = num
    material = object.active_material  # <-- changed line
    if material.use_shadeless:
       material.use_shadeless = False
    else:
       material.use_shadeless = True

@Adhi's method is nicer, just showing what the mistake was.

aahh...so I just missed one line, thanks for pointing it out Campbell.

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


text:
Obtain UV selection in Python?
Using Python, can one select or find what is selected in the UV Image Editor?
I tried accessing the UV screen itself and found its SpaceUVEditor but got stuck there.
Any thoughts?

Note, UV's are stored in face loops, so 'BM_LOOPS_OF_FACE' is the correct iterator to use. Then from each loop you can access the UV customdata layer. However this is a bit odd that you are referencing C iterators in a Python question.

The UV map being shown in the UV Image Editor is the active one, accessible through uv_layers.active variable of active object's mesh data.
According to API docs, loops and all UV maps in uv_layers are aligned. Which means, if you have the indices of every selected MeshUVLoop within current mesh's UV map, you'll get the corresponding MeshLoop at the same indices within that mesh's list of loops. From there, you can get their vertices.
To make my explanation above clearer, here's a sample script that will print selected UV loops' vertex coordinates to console. The script won't work if use_uv_select_sync button in UV Image Editor's header is toggled on, in which case MeshUVLoop's select property is ignored.
import bpy

# UV data is accessible only in object mode
prev_mode = bpy.context.object.mode
bpy.ops.object.mode_set(mode='OBJECT')

# Update vertex selection properties, in case the script wasn't run in
# object mode
bpy.context.object.update_from_editmode()

# Active object assumed to be a mesh and already have a UV map
mesh = bpy.context.object.data
uv_map = mesh.uv_layers.active
selected_loops = []
selected_vertices = set()

for index, uv_loop in enumerate(uv_map.data):
    if(uv_loop.select):
        selected_loops.append(index)

for loop_index in selected_loops:
    selected_vertices.add(mesh.loops[loop_index].vertex_index)

for vertex_index in selected_vertices:
    print(mesh.vertices[vertex_index].co)

print('*' * 20)

# Restore whatever mode the object is in previously
bpy.ops.object.mode_set(mode=prev_mode)

Blender comes with a template which deals with UV selection, see:
Templates > Python > Operator Mesh UV
The body of this template:
import bpy
import bmesh

obj = context.active_object
me = obj.data
bm = bmesh.from_edit_mesh(me)

uv_layer = bm.loops.layers.uv.verify()
bm.faces.layers.tex.verify()  # currently blender needs both layers.

# adjust UVs
for f in bm.faces:
    for l in f.loops:
        luv = l[uv_layer]
        if luv.select:
            # apply the location of the vertex as a UV
            luv.uv = l.vert.co.xy

bmesh.update_edit_mesh(me)


text:
AttributeError: 'ShaderNodeTree' object has no attribute 'active_output'
I've working on "private" exporter and it has some issues like the topic. The addon perfectly working inside latest Blender 3.6.5 but did not worked with 4.0a and 4.1a. Here the part of codes:
def getOutputNode(material):
    node = None
    if material.use_nodes and material.cout.use_nodes and material.node_tree:
        node_tree = material.node_tree
        if node_tree.active_output != -1 and node_tree.nodes[node_tree.active_output].bl_idname == "COutputNode":
            node = node_tree.nodes[node_tree.active_output]
        if not node:
            for n in node_tree.nodes:
                if n.bl_idname == "COutputNode" and n.is_active_output:
                    node = n
    return node

def findCOutputNode(material):
    node = None
    if material.node_tree:
        node_tree = material.node_tree
        if node_tree.active_output != -1 and \
            node_tree.nodes[node_tree.active_output].bl_idname == "COutputNode":
            node = node_tree.nodes[node_tree.active_output]
        if not node:
            for n in node_tree.nodes:
                if n.bl_idname == "COutputNode":
                    node = n
    return node

and here that error:
    if node_tree.active_output != -1 and node_tree.nodes[node_tree.active_output].bl_idname == "COutputNode":

AttributeError: 'ShaderNodeTree' object has no attribute 'active_output'

The Blender Node Tree structure has changed in 4.0. So, no longer are inputs or outputs accessed through NodeTree.inputs or NodeTree.outputs but by iterating over NodeTree.interface.items_tree. Getting the active_item can be found through NodeTree.interface.active but it is not targeted to inputs or outputs. It will be harder to get the active input or output due to the API changes.
For more detail, visit 4.0 Node Group Python API
    for item in tree.interface.items_tree:
        if item.item_type == 'SOCKET':
            if item.in_out == 'INPUT':
                ...
            elif item.in_out == 'OUTPUT':

Where am I must change this lines? ' for item in tree.interface.items_tree:
if item.item_type == 'SOCKET':
if item.in_out == 'INPUT':
...
elif item.in_out == 'OUTPUT': '

Substitute tree in tree.interface.items_tree with the tree you are working on.  You can make a function to find the output closest to the active item if the active item is not an output.

I'm a bit stumped that the new API is so much more complicated than the previous one... I understand that it opens up a lot of possibilites UI wise to have subpanels in the in/outputs but it makes the entry barrier for newbies much higher...

I totally agree with you. For panels, they should have just added a 'Panels' ui list and make them accessible through tree.inputs, tree.outputs, or tree.panels. However, I'm not a Dev and they may have better reasons to do it the way they did it,

Guys, please, help me! I don't understand which am I must to do and which lines are need to change?


text:
how to make blender automatically use relative paths 2.8
How can i make blender always use relative paths?
I looked into the preferences but couldn't find any setting for this. apparently in 2.79 there was such a setting but in the newest version it seems to have disappeared.

This is located in Edit> Preferences under the Save & Load category, then Blend Files> Relative Paths:


text:
How to make 2 cubes with 'child of' faces crash, lose cube parent, and faces spray around and drop on the floor
it seems i have to re-ask my question.. delete parent halfway animation, keep position and more
i have two cubes flying around, they are rigid bodies and have cube faces that are 'child of'.
When the cubes collide i want the 'child of' faces to lose the 'parent' and 'spray' a bit around because of the impact of the collision of the cubes and drop on the floor.
Not sure what to do..
Now i take out 'influence' at the collision moment.. but i have no glue how to reach my goal from here..
I tried to make the faces rigid bodies as well.. but then the cube doesn't do it's physics anymore..
now i'm quite confused..

As I told you in your previous question you need to keyframe the Rigid Body "Animated" option: At the frame before the dropping, when they are still child of, keyframe the Animated box on, and the next frame, when they stop to be the child of, keyframe the Animated box off. Put your cursor at the beginning of the timeline and play:

File here:
So as your situation is a bit different, as your cubes are subjects to physics since the beginning, what you can do is give your children (here a simple cone) a Child Of constraint with the cubes as parent, give them a Physic > Rigid Body > Active, switch off the Dynamic option at the beginning, keyframe the option box, switch it on when the cubes collide, keyframe the option box:

File here:
Also, make sure that your objects are clean, meaning scales are 1:1:1, origine at center, etc...

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


text:
Blender 2.8 Eevee Transparent Background Output
Using Eevee on 2.8 to create some VFX, however, all the video renders I output still have a black background and not transparent. I have selected Alpha channel to be "transparent" to no avail!
Can someone please help!
Many thanks,
Andrew

It is worth noting that it does show transparent in the viewport and when I render inside blender. However, the issue is when I output the render, the background is now black and not transparent.

Make sure the file format that you are rendering to supports alpha

Check the compositing, had the same issue because I forgot to uncheck "use alpha" in the composite node.

This is the solution

I had the same issue, posting just in case anyone else comes across this. Removing a volume scatter node from the world material fixed the transparency issue, with it there it always rendered as black.

Firstly,  Render an Png or Tiff Image sequences which supports RGB + alpha  instead of Video.
Secondly,  To enable transperancy go to Render Settings in the properties panel and under Film go to alpha and select Transperant from the drop down.


text:
Activating Add-on, getting: ImportError: No module named 'bpy.utils.previews', 'bpy.utils' is not a package
Add-on  Pro Lighting Skies Demo

This message error pops up when I follow the steps on how to download.  Somebody please help me.  I followed Andrew Price's directions on his website, Blender Guru, but it will not work.

I've modified your question to be more useful to future users who search for the error or problems installing this add-on.

You need to update to Blender 2.75. Versions prior to this don't have bpy.utils.previews which is used for custom ui icons and preview images. You will also need to install the add-on again, probably.

You're either having trouble importing the addon correctly, or there's a bug in the addon.
Best way to import the addon is to leave the addon package inside a ZIP file and then choose the install from file option.
If, after loading the addon this way, you still get this error, you need to report it back to Andrew.


text:
Reacting to changes to a Python defined RNA Property
Hey I have a questions
I have a prop_search which is filled with names. Is there some kind of callback when I change the selection of the prop_search?
like I have this:
def draw(self, context):
    col = layout.column()
    col.prop_search(context.scene, "hdri", context.scene, "coll", icon='OBJECT_DATA')

can I somehow define a function that is triggered whenever I change the prop_search?

I'm pretty new to Python for Blender.

alright, I deleted the second question :)

Domi do you understand the new title to this question? (what an RNA property is)

Yes, for any property, you can define a set and update callbacks.
These are functions you define, passed as an argument and called by Blender whenever the property changes.

get - you can return the value and store it wherever you like.
set - you're responsible for making sure the new value is stored/modified.
update - is called after setting, often used to ensure related data is updated.

See: http://www.blender.org/api/blender_python_api_2_75_release/bpy.props.html#bpy.props.EnumProperty

In the example above, you would have to set the callback on the hdri property definition.

thanks, but I'm confused, how can I set an update-function for my example above?

@Domi, updated answer.

@Domi: you can't define a callback in UI code (panel / prop_search). It must be specified for the property when it is set up.


text:
can you place markers on an axis or define constraints on the size of a mesh
I'm a novice to blender and 3d modelling software in general. I'm making a game involving custom character parts and I have constraints needed on the length along the x axis. For example the width of a torso part so shoulders and arms can fit properly. I'm wondering if you are able to define constraints within blender on the mesh or place some kind of markers on a axis

you can use a background image with the body sketch to work on it easily , and there's no constraints for mesh


text:
Emission and Transparant mixture works in 3D View but not in Render
I'm a bit new to cycles shaders, so I'm going about this a bit blindly.
I've tried mixing a few shaders, and it works in the rendered viewport, but not in the full render.
I'm trying to make spaceship thrusters. It should start emitting  brightly, and then gradually fade to transparent. I've tried both particles, and volumes, but neither worked well for me.
This is my material:

And here is the (expected) 3D View rendered result (left) and the actual (incorrect) rendered result (right):

The .blend file
EDIT: I was able to get it to work by switching to CPU from GPU.

Is it possible you could upload your .blend?

give me a moment and I'll make a simplified blend that exhibits the problem.

@gandalf3 Interestingly when I tried to create a new blend showing the problem I couldn't reproduce it (it worked). But I cannot get my blend to work so I created a cut down version of my blend and uploaded that (see the link at the top of the post). There is probably some setting I have not set. I canabalised another blend file to create this one so some artifact from that surely remains which is causing the problem.

On a slight tangent. If I wanted to copy certain objects from my scene to a new blend, what's the easiest way to do this?

I was able to solve it by setting the render device to CPU instead of GPU, ,shouldn't I be able to render transparency on the surface shader using the GPU?

Yes, you definitely should. It works for me though, even with the lamp output node. There might be a bug here somewhere..

The lamp output node is not intended for use with surfaces, as a matter of fact I'm surprised it worked at all in viewport render.
It works fine for me if you replace it with a material output node:


text:
How do I add lots of holes into the surface of my model?
I am 3d printing a ds9 model from thingiverse, but I would like to add all the holes for the fibre optic threads to my mesh surface.
This Commercial kit has over 1000 holes to drill for fibre optics. I've found a company who has Drill hole plans that I can use as a texture map. I would like to shortcut the drilling hole step, and am looking for a method to create lots of holes from the texture map.
Note: I already have a method to create the shell/hollow model, as well as a method to cut the model in half.

If these drill hole plans are vector, there may be a chance of importing an SVG into blender, making the curve into a mesh, extruding, then using that to subtractively boolean out those holes... but I doubt it. This is a super-specific task and there is probably no way to cut corners on the modeling work if you want to get it right. But considering the symmetry of the DS9's design you can probably use a mirror modifier with an empty or maybe linked duplicates to speed up the work.

If the drill hole plans are in vector already convert the file to .svg.

If the hole plans are not vector.
Convert the holes to vector using Inkscape, Illustrator, etc...
Once everything is traced/converted save this file as .svg.

When you have a usable .svg file.
Open Blender and choose File/Import/Paths
Choose your .svg
With the newly created path selected in blender.
Go to the curve options and raise the extrude value up.
If the alignment is good, use the boolean modifier to "cut" the holes. Example
If not already vector & automated methods fail. Instead of manually tracing the holes. You may be best off duplicating a cylinder, of the correct size, & placing the duplicates where need be. Using the mirror modifier if and/or where possible. Then use the boolean modifier as mentioned previously.


text:
python script that reads text file containing coordinates and creates a path/curve for object to follow
I am a highschool student working at a college's engineering department for the summer. I just began working in blender and have intermediate knowledge of python. Could anyone share a script they've made that can:
1) Read a text file of xyz coordinates into python.
2) Turn these points into some type of curve or path that an object can then follow to model the path the coordinates map out.
Like i said i don't have a great understanding of blender but if someone could write or give me a script that is able to do this it would help. Please explain in simple terms also.. Again I am not an expert.
The file has three points on each line, separated by commmas, and is pretty large. All the coordinates would need to be floats on account that they are decimals.

-4.934860e-06 , -1.380798e-06 , -1.504166e-05 ,
-1.359547e-05 , -4.301138e-06 , -4.403530e-05 ,
-3.727631e-05 , -1.307421e-05 , -1.287422e-04 ,
-7.177810e-05 , -2.724715e-05 , -2.643154e-04 ,

here are some of the data points when in the text file
now with the .csv they were put into an excel file
when copied and pasted they look like this:
-4.93E-06   -1.38E-06   -1.50E-05

possible duplicate of How can I connect a set of vertices to make a 3D model, with a script?

but if you want a curve path explicitely I'll share one below. (that saves from having to convert Mesh to Curve Polyline )

OK. that changes how the import code should look. but not a lot. Just a final thing, can you take a screenshot of the dataset file as it shows in your text editor. (just so we know exactly the formatting... which may be lost during the copy over to this text area here) .  i'll have to come back later to this

the formatting of your file, does it really have a comma at the end of the line? the csv.reader doesn't expect the extra comma.

i\ve added a link to an alternative way to read data in that doesn't use Python's built in csv reader - but you may have to customize it.

You can run this code straight from Blender's Text Editor.

You'll see a lot is the same for creating a simple vertex-edge based mesh, but this snippet:

imports x,y,z as a list of coordinates
creates a curve object and prepares it to accept the vertex coordinates
transforms the list of coordinates to flat list
this means
[x1,y1,z1], [x2,y2,z2], [x3,y3,z3]
becomes
[x1,y1,z1,x2,y2,z2,x3,y3,z3]
uses 'foreach' to push the flat list of coordinate components onto the .points.co's.

code:
import csv
import os
import bpy

filename = 'circle.csv'
directory = '/home/zeffii/Desktop'  # <-- if you have linux or osx
# directory = r'c:\some\directory'  # <-- if windows, the r is important
# directory = 'c:/some/directory'  # <-- if windows (alternative)

fullpath = os.path.join(directory, filename)

with open(fullpath, 'r', newline='') as csvfile:
    ofile = csv.reader(csvfile, delimiter=',')
    next(ofile) # <-- skip the x,y,z header

    # this makes a generator of the remaining non-empty lines
    rows = (r for r in ofile if r)

    # this converts the string representation of each line
    # to an x,y,z list, and stores it in the verts list.
    verts = [[float(i) for i in r] for r in rows]

if verts:
    # curve coordinates require a 4th 'W'(weight) component,
    # the +[0.0] adds that for us
    out2 = []
    [out2.extend(list(i)+[0.0]) for i in verts]

    # has one coordinate by default, we add one fewer than we need
    num_points_to_add = len(verts) - 1
    curve = bpy.data.curves.new("path_name", type='CURVE')
    polyline = curve.splines.new(type='POLY')
    polyline.points.add(num_points_to_add)
    polyline.points.foreach_set('co', out2)

    obj = bpy.data.objects.new("obj_name", curve)
    scene = bpy.context.scene
    scene.objects.link(obj)

points to note:

by all means use your own file-names :) , but as a convention if you are using comma separated values, it helps to use the .csv so you know even without looking at the content of the file, that is stores data that way. Also the first line of the file should describe what each column contains ( see the example curves.csv in the other post)
my csv reading code expects the first line to have column information, the line 'next(ofile)` can be commented out if your data starts straight on the first line

If your csv isn't formatted in a standard way, you can try using this script and adjust it to your specifications.
Judging by the coordinates you're importing you might want to scale the input up by 1000 times so the resulting curve/object isn't too small to see without zooming in. If it were up to me i'd change the line where the value is cast to a float and add a scalar multiplication to go from -4.934860e-06 to -0.493486 . If you don't know what the e-06 means it's a scientific notation to quickly show the size of a number without adding 6 zeros between the decimal point and the significant digits.
# (or 100000, or more.. depending on the total object extents)
scale = 10000
# the r[:3] here means you are only interested in the first 3 values on every line.
verts = [[float(i)*scale for i in r[:3]] for r in rows]

Yeah, it makes sure each line has data, sometimes that last line of a text file contains no data but it interpreted as a line because it has a newline character (a character that we don't see..)


text:
Making indented panel lines for 3d printing
I'm quite new to Blender but planning to use it for 3D printing, so I'm looking for a solution which will actually modify the geometry. I have created a couple of aircraft. I need to detail them with some panel lines but I don't know how to easily make an indented straight line.
existing model - https://www.shapeways.com/model/1051048/d21-drone.html?li=my-models&materialId=6

Looking at that model close up, the topology isn't so great. It seems to be made of all tris. I would recommend remodelling it as it is quite a simple shape. After that, take a look at the knife, inset and extrude tools.

Thanks for the tip. I should have said, I'm aware the topology is shocking especially around the front where the wings start. As a beginner, I'm not sure how i managed to get so messed up around that area.  Thanks, I will investigate those tools.

The tools you are asking about are quite simple, you can make loop cuts with CtrlR. Roll your mousewheel to create multiple cuts and use left click to confirm/right click to cancel.

Since Blender can handle ngons, if your shape is a flat hard surface, feel free to cut it. Activate the Knife took with K, click an edge as a starting point and then click another edge as the end point, when satisfied. Press Enter to confirm.

You might also be interested in the Inset tool. This can be useful for giving your faces a bit of distance from the sharp edges so any further modifications don't look odd or modify parts of the mesh you don't want. Press I while selecting multiple edge loops or faces and use your mouse to adjust the inset level.

The Extrude tool is what you will use to create the indentations. Just select the face(s) and press E, you can use your mouse to adjust how far the extrusion goes in/out.

And all of those combined on a simple box model, produces this. Tri's aren't so bad when working with hard surface models but they make editing a pain.

Decent topology is a must when doing 3D printing. See, What exports does blender have for 3d printers?.

For additional reading.. What is the technical difference between an Ngon and a bunch of Tri's?.


text:
How to make triangular pyramids on each face of an original triangular pyramid
How could I make triangular pyramids on each face of an original triangular pyramid.

If I didn't misunderstand your question, you can switch to Edit Mode, Make sure all faces are selected by pressing A, then AltP to poke faces, which will create a vertex on each face. Tweak Poke Offset value in its setting panel down to the left-hand Tool Shelf.(or press F6 to call a separate popup).

Thank you so much, if I can just know now how to create the original triangular pyramid. Let me know what I can do in return even if you don't know how to do this!

@user1802 Do you mean a regular tetrahedron? There are several ways to make such shape. Typically, you may enable an addon called Regular Solids, which can make one much easier.

You can add a Mesh Circle and set Vertices to 3, fill type to Triangle Fan. Move the center vert up, deselect, select the 3 bottom verts and make face for your triangular pyramid. Then poke faces.


text:
Cylinder with no cap ends invisible on the inside
So I'm having this problem with a cylinder. It has no cap ends and the insides don't show up in edit mode. I've already tried flipping and recalculating normals, it did not worked. I've tried creating another cylinder, but it didn't worked too.
Image:

This is because you have Textured Solid ticked under Display in the Toolshelf. You use this feature when you want to display face assigned textures while in solid view.


text:
How do I join several objects into one?
I'm creating side skirts for a truck and I am duplicating the frames I want. The problem is it's making the duplicated object into another object. How do I put it into the same one?

I'm not sure what you are asking. Do you want to make those into one object? (Ctrl+J)

I want to make each model into only one layer for each of them

for example I have model6.000 and model6.10 I want to make it so the are both within model6.10 only

Try selecting them both (selecting model6.10 last) and pressing Ctrl+J

it only lets me select one object

Are you in edit mode? Try switching to object mode (press Tab)

yeah im in object mode

And you are selecting with Shift+RMB?

no I wasn't mate im selecting with going to the 6.000 then right click select then 6.10 right click select and doing ctrl+j

So does using Shift+RMB work?

yes thank you very much mate your help has been very usefull cheers buddy

yeah buddy its not working now

What's not working? (the selection? or joining?)

both I do the selecting but im having to use the LMB

I'm not sure what you mean.. Could you clarify?

hey man I get the selecting bit right as one outlines as orange but the ctrl+j doesn't work

That's odd.. Are there any error messages? (look at the top bar next to the blender logo right after it fails)

nah no error is showing up fella

I got it to work on one but its not working on another one

Are you sure the objects you are trying to join are all the same type? (e.g. mesh, curve, etc.)

yeah as they have been duplicated

when I click on the + next to the model the meshmodel has a different code

@user2004 I feel that you were trying to do everything that ganfalf3 said within the Outliner window. When hitting Ctrl J, make sure the mouse is over the 3D View area, or by the 3D View header menu "Object" > "Join".

yes that's right my friend haha

thanks guys you have given me some useful tips and how to do this I found the problem was I did it in the outliner column thank you

The mesh data (the entry with the inverted triangle) is stored separately from the object. When you merge objects, the mesh data from one data block is merged into the active objects mesh data block. The old datablock will still be around until you reload the blend file, which is why it has a different name. You don't need to worry about this, if the meshes display with with a yellow outline when selected, they are joined.

thank you thee only problem im having now is when I do this it inverts the object so it becomes invisible

Try recalculating the normals (Enter edit mode (Tab), select all (A), and recalculate normals by pressing Ctrl+N)

how do I give you two reputation or something like that

sorry I tried and said it wasn't available due to only 1 other member

@iKlsR I tried, but apparently you need more than 1 rep to chat. user2004 If my answer has answered your question, you can accept it by clicking the check mark. Feel free to take the tour for more info.

@gandalf3 If someone doesn't have the privilege, ping a mod or make a room and give them access privilege there.

I have edited your question to use terminology which I think you meant. Please rollback if my edits are incorrect.

You can join objects by selecting them (ShiftRMB) and pressing CtrlJ in the 3D view while on Object mode.
The selected object(s) will be joined to the active object.
The active object the one with the yellow outline, usually the last object selected.

you can move an object to another layer by: object mode + m + select the intended layer
reference: http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Putting_Hat_on_Person

@user2004 seems to mean objects, not layers. If I understood their question correctly, they want to join the objects, nothing to do with layers.


text:
How can I align an object in a discrete sense to the camera orientation?
I don't want to move the camera to follow an object, but I would like to place an object using the currently selected camera.
The obvious use case is position text. 2D text could obviously be added in another tool (like Gimp). Other use cases could be aligning an object perpendicular to the camera (like a perspective gauge arrow).

The most obvious way is to align the object upon its creation. The option Align to View is present on all object creation operator's property, I use this mostly for text object. It will align the object's rotation to whatever active view perspective when the option is checked:

When that's not possible, sometimes I use a bit of Python, too, assigning the camera object's rotation_euler to the object to be aligned. From Python shell:
C.object.rotation_euler = C.scene.camera.rotation_euler

Bah, I'm sure I even saw that option. Thank you Adhi.

Another option is to use a Track To constraint to cause the text to always point a particular axis at the camera. Regular grs controls can be used to position it, and the Track To constraint will keep it oriented toward the camera, even if you have to re-position it.

For text I would track the Z axis to the camera, and use the camera's Y as the up_axis

Alternatively, you can set the camera as the object's parent if you're planning on animating your scene. Combine this with Adhi's answer to have it aligned. Select the text (or whatever), then the object (hold Shift), then CtrlP to set it as the parent.

Using the camera as the parent is good for text that stays at the same position in the frame.  For text that moves through the frame with the objects in the scene, you'll want the Track To constraint.


text:
Is it possible to stay in Face Mode when making loop cuts?
It appears that Loop Cut (Ctrl+R) automatically switches you to Edge Mode.
Is there a way to remain in Face Mode after doing a Loop Cut? I've looked through the hot key references that I could find but no luck.

AFAIK, no. I think the best you could do is write a python script to perform the loopcut, then switch back to facemode when Ctrl+R is pressed.

You can in a way.. In the 3d view header, hold Shift and click on the Edge and Face icons.  The only drawback to this is that you will be in both Edge and Face selection mode.
Also, the quickest way to switch selection modes in Blender is to use CtrlTab, (you can also hold Shift while selecting here too to get multiple selection modes, to leave a mode, do the same thing).

Having BOTH the Edge and Face modes active at the same time did the trick.  I'm finding that particular workflow far simpler now.  Thanks for the tip


text:
How can I emulate moving water in the BGE?
I am not sure how to make a texture of water make waves and stuff.  I know how to do it in Render, but not BGE (Blender Game Engine). Any help would be appreciated.

How about an animated texture? If you rendered out the waves in Blender Internal, then loaded them into the BGE, you would have animated water.

I am not exactly sure what you mean.

@BlenderLover It's not quite moving water, exactly, but you might find this interesting.. Water Shader and  pre-made BGE shaders

There is also deformation scripts I use that actually make real and animated waves in the game engine, I'll post back here with a proper .blend file within the week.

have you looked into normal maps at all? you will need one of those and then you can animate a plane by changing the position of the texture. there are tens of videos on doing this.

The only way that works well and looks great in the BGE, is creating an animated water texture.
Having real geometry to create displaced waves in the game engine would look cool, but it is very memory intensive and would cause your game to lag.
To create an animated texture for the water, there are quite a few steps. Here is a video that describes the technique used to create the water used in the Blender Game "Yo! Frankie".
Video Summary:
Step by step tutorial that shows how to create realtime animated water for the BGE using animation maps.

On a side note you can also emulate moving water directly from vertices, here's an example; I do however strongly recommend cleaning it up a bit.
.BLEND FILE
This is however not animating water directly to a plain, and shouldn't be done on a larger scale as it will drag down performance.


text:
How to unlink a linked-duplicate?
All is in the question, we can duplicate object with SHIFT+D but also with ALT+D, which is quite handy, because as you know every changes done on a linked duplicate object will be repeated on others linked objects ("same objects").
I've used it as example to create all the UVs of a box, all at once.. But now I would like to break it, to stop it... And I don't know how to do that...

Sorry, It seems I've FINALLY found the answer, just press "U" in edit mode, and we can stop the objects from being linked.

For more recent versions of Blender, see also: Can not find unlink object data in Blender 2.8. Note there is a Unlink option in the contextual menu of the ouliner. It has nothing to do with creating separate instances. Unfortunately the help just text says: Undocumented operator.

You can press U > Unlink Object+Data. The object's "data" is the mesh itself. Multiple objects can use a single mesh, so that editing one will update the others (they're "Linked")
You could also go into the Object Data tab and manually select different mesh data for the object to use:

The 2 on the right indicates that that mesh is being used by two objects. Clicking on the 2will copy that mesh and unlink that object from the old mesh, linking it to the new one (using an incremented name like Cube.001), the same result as if you'd done U > Unlink Object+Data
I know you already know the answer, but this is a place for the future too :)

I come from the future and this doesn't seem to work anymore, here in Blender 2.8 "U" in edit mode gives me the Unwrap menu.

So for 2.8 unlink is called "Make single user". It is in Object menu> Relations>Make single user>...

For Blender 4.1 it's:  Object menu > Relations > Make Single User > Object & Data


text:
How can I cut an edge from a plane?
I wonder what's the best workflow for a such basic task:

I want that the plane would have the same two corners. I got stuck at the 7th step.
Two questions:

How can I cut that duplicated edge from a plane?
Is there a faster way to achieve the same result?

Hello and welcome. In future please prefer writing the text describing the workflow as actual text in the body of the question, rather than inside images. It makes it easier to fix any mistakes or typos, and also makes the question indexable, so it is searchable and easier to find for future users and people with similar issues.

It could be a CtrlShiftB, 1-segment Vertex Bevel:

You can adjust to precision in the operator's F9 Adjust Last Operation panel.
Thanks to @John Eason for the reminder.. While modelling, always have your object's Scale CtrlA applied to (1,1,1) for predictable results from operations and modifiers.
Edit: The shipped add-on 'TinyCAD' can find the projected intersections between lines, and insert vertices at the closest approach. If you have a lot of that to do, you could set up shortcuts for that.
Without add-ons, this could be a way? There's probably a better one..

With Snap set.. 'To: Vertex' and 'With: Active'

K cut an arbitrary edge, to insert vertices
ShiftD duplicate the vertices of the template edge.
GX with and GY, switching active vertices, snap to the target corner, one dimension at a time
Snap the pre-cut vertices to the duplicate, and M > 'By Distance' merge everything down.

Just apply the scale first in object mode (CTRL-A) if the plane isn't a square or the bevel won't be at 45 degrees!

Oh come on guys, how come there are no upvotes? I'm offended on Robin's behalf :)).

(seems to work)

Nice. Thanks. I guess that's the answer, but could you also help me with the first question? I might use it for other things in modelling. Cheers!

Also is there a way to add new vertices on the plane edge where they intersect with duplicated edge?

Thank You Very Much Robin! Very helpful. Have a great one!


text:
Procedural texture of random square clusters
I'm trying to procedurally texture some future tech. It has small squares that seem random. I envision making a noise texture pixelated, and then animating the pixilations to move over a cube object, looking very futuristic.
Ideally, I'd layer many pixelation colors over one another so the squares are like a kaleidoscope fading in and out.

Just to add to @Allen's answer.
If you also want the borders, just add a brick texture into the setup

AHHHH! I KNEW THE COMMUNITY WOULD COME THROUGH. thanks! this is perfect! if you want to see the alien stuff I'm doing check out my twitter. @andersonatlas

Happy to help :). Good luck with your project :).

If you take a Voronoi Texture's Randomness parameter all the way to 0 it generates squares like you want.

You can take the Color output into a Noise Texture like you suspected and generate lots of different outputs.  What I did here was put a Color Ramp on the other side set to Constant to isolate groups of these squares to use as a mask for whatever you want.

But you can imagine animating some of these values and generating any number of visualizations.

The secret is in discrete of UV coordinates. Example on the picture.

oh this looks like a nice way to make digital camo :))


text:
How can I cut a UV sphere in half?
I need to use half of a sphere, but I cannot work out how to cut it in half. The best I can do is to remove 1/4 of the sphere.
With a UV sphere, I size it to my requirements, set scale to 1.0, select editing mode, press Numpad 5, press Numpad 1 to get to Front Orthographic view, position the cursor above the center top, drag to select half, press DEL, and select Vertices.
What am I doing wrong?

One way.. (I'm always using this for mirroring)

Alt-LMB select edge loop
V rip, with your cursor on the waste side of the loop.
Hover, and L select connected under cursor
X delete faces.

.. which can speed stuff up, sometimes: you can do it from any view.

Thanks. Being fairly new to all this I had to work out that LMB need to be pressed when pressing ALT key.

Hello @John! I've linked out to the relevant area of the manual. You've prompted me to go back and browse it a bit myself. Even though I'm not as new to it as you are, the manual keeps throwing up useful surprises for me, in the fundamentals ( selecting, snapping, viewing, etc. )

In this version there's only a few things to care for: if you instead want to delete the upper half, you might not want to move the selected edge loop. So, after hitting V to rip the loop, hit ESC (or RMB) so it stays in place from where you ripped it. If you then hover over the upper half and press L, the lower edge stays selected (which might not be visible since it's in the same location as the edge loop connected to the upper half). That's no problem if you delete faces afterwards, but if you delete edges or vertices than the top row of your bottom half will be gone, too.

@GordonBrinkmann  Ahh!  my muscle memory is so embedded I didn't notice these possibilities. Yes, It's delete faces, not verts or edges. But I was struggling to reproduce your selection of one half and opposite edge.. in the end I realised, without thinking, my cursor is always on the waste side of the loop before invoking  Rip. And I always drag a little to ensure the rip has happened and I have the right side selected, even before right-clicking to drop the selection in place. Escape key is too much of  a stretch for me :)

I guess for people new to Blender it's not so obvious that the cursor defines which edge will be selected after ripping. But since you can press L over whatever part you like it isn't important. Only in this case one has to be aware of different selection methods of Blender, because L adds to existing selections instead of replacing them. I think, in Blender when a selection is added and when it's replaced is sometimes not obvious for new users, too. Anyway, your answer is perfect, especially because no orthographic view is needed and you can even easily create slices of the sphere.

Bisect.
Will throw the bisect operator into the ring.

For the top or bottom halve of the default cylinder could bisect using local origin (or any point with z = 0) and normal aligned with z axis.
The clear inner / outer remove geometry below / above the plane defined by point and normal.  Both will leave only the cut.
Fill, fills the cut.
The threshold keeps original geometry if within.
Can define and cut on any bisecting plane.

So many ways to do this.

You need to check the option to include hidden vertices in your selection:
https://docs.blender.org/manual/en/2.91/modeling/meshes/selecting/introduction.html#selection-modes
(Also called "X Ray"-Mode)
The Hotkey is Alt+Z.

This answer, or go into Wireframe mode.

Set the view to Front Orthographic (Numpad 1)
Set the viewport shading mode to Wireframe (Z4)
Press Tab to switch into Edit Mode
Enable Vertex Selection
Select one half of the sphere
Remove the selected vertices by pressing X and choose Vertices from the menu

Step 5 should probably specify the method of selection. Box selecting seems to make the most sense.

@R-800 I don't agree. While using box select is likely to be the most common or useful method, it is entirely possible that another selection method is more convenient/correct given the situation ; we cannot assume that the simplest example applies to OP's situation. Blender provides multiple selection methods and the user is expected to be capable of choosing the method most applicable to his situation. tl:dr method of selection constrains the answer without improving it.


text:
Is it possible to programmatically draw GreasePencil strokes?
I am toying with the idea of using MediaPipe for hand tracking and use that for drawing GreasePencil strokes.
The hand-tracking part is quite well documented, but how would I then relate that to positions on the screen?
And now that I think of it, it could probably lend itself to other cases as well.

I don't know anything about your hand tracking system inputs. But few basic guidance below about grease pencil object creation.
import bpy

name='hand track'

# Create a new gp data,
# link it to an object
# and link the object to the scene
hand_track = bpy.data.grease_pencils.new(name)
obj = bpy.data.objects.new(name, hand_track)
bpy.context.collection.objects.link(obj)

# Create a new layer,
# new frame
# and new stroke
layer = hand_track.layers.new(name)
frame = layer.frames.new(0)
stroke = frame.strokes.new()

# Simulate capture of 10 hand positions
for i in range(10):
    # get the index of the point we'll add below (index of the last)
    index = len(stroke.points)
    # Add a stroke point
    stroke.points.add(1)
    # Set it to the wanted position
    stroke.points[index].co = (i, 0, 0)

# Set the object as selected, active and update the scene
obj.select_set(True)
bpy.context.view_layer.objects.active = obj
bpy.context.view_layer.update()

(A lot) more details in the documentation.


text:
Flatten the base of STL file & cut it into a regular shape
I want to flatten the base of my STL file & cut it into a regular shape (e.g., round, square...).
The results I expected should be the same as this video shows (https://www.youtube.com/watch?v=bSNy9iUqDbI). I tried but I did not succeed with his method in blender.
If anyone can help me, I would be appreciated. It is best to give a detailed method because I am a beginner in this. Thank you in advance.
My STL file is here: https://www.dropbox.com/s/by7fdw49x05savj/terrain_test01.stl?dl=0.

Import model from stl format

In edit mode, select all vertices and delete duplicates (Merge distance in 2.80) with desired accuracy

Select all faces in edit mode and Extrude it down

Resize selected faces by Z axis to 0, align it by lowest vertice of top surface

Select all faces, again remove duplicate vertices and Recalculate Normals (if everything fine you do not need to make it Inside)

Add Cylinder object and make it right

In edit mode remove cylinder top face, select all leftover faces and Extrude region to cover the main object

Add Boolean modifier to Terrain and set up Difference with Cylinder

Profit!


text:
Impact Forces in Blender Game Engine
I am using the blender game engine to run drop test physics simulations and I was wondering if there is a way to collect the force and impact data from the collision. Maybe using "appliedImpulse"? I am using Python within the BGE and can already collect impact points. I am trying to find contact time and/or force. Thank you!

It sounds like what you're looking to measure is a change in velocity. Look into getLinearVelocity()

@Mentalist is there a way to check the change in velocity over time? For acceleration etc.

Yes. On each tick of the game engine, measure the linear velocity, and based on the difference between the current and last tick - do something. I used this approach to calculate fall damage and it worked pretty well. Make sure the object is using a compatible physics type, or it won't work.


text:
Blender Collision Simulation Data
Is it possible to access data from a collision, such as point of collision and impact force? I am trying to simulate a "drop test" in Blender and cannot figure out how to access the information. As of now, I am trying to use the Blender game engine and python.

By using collision callbacks you can retrieve the hit object, point and normal (not sure about how to retrieve the impact force though). See the API reference for more info. Example file below.
def my_callback(object, point, normal):
    ''' Do whatever you want with your collision data '''
    print('Hit by', object.name, 'at', point, 'with normal', normal)

def register_callback(cont):
    ''' Run this with an always sensor (tap enabled) when the game starts '''
    own = cont.owner

    if not my_callback in own.collisionCallbacks:
        own.collisionCallbacks.append(my_callback)

Example file:

Thank you! Do you know how to run this code while the game engine is running?

@RussellChow I've added a better script and a example file (for Blender 2.79). If this answers your question, please accept the answer. ;)

Thank you very much for the help!


text:
What can I do to fix the "Could not write image: Permission denied" error after I'm done with a render?
I'm fairly new to Blender (I'm moving from other CG programs, as I really liked its 2.8 update), and I've been trying to render some basic things here and there to get used to how the program works. However, after my render was done, I stumbled upon a problem. When I was about to save the image, Blender refused to output it to the folder, giving me the following error:

I've checked all sorts of stuff, from admin permissions (I run it in admin mode, and all permissions to the folder are allowed), to folders, to Blender preferences (even went as far as resetting it to its factory settings), etc... Still no dice, I still get the same error every time, and my "Save As image" button stays greyed out no matter what:

Strangely enough, I do not get the same errors in Blender 2.79. Does anyone have any idea of what's going on? Am I overlooking something, or...?
I'm running Windows 8.1, and Blender 2.8's folder is located in Windows' default "Documents" folder, if this information helps.
In any case, thanks in advance!

Permission denied errors come from the system, so when blender wants to write it is the system stopping it. Can you save to another folder? Is the target folder (or parents) marked as read only? Are you saving to the same folder as blender? Have you extracted blenders zip file or running blender from inside it?

I've tried saving to other folders, but I still get the same issue. The target folder is marked as write & read, and I've got blender 2.8 saved in my documents folder so the structure is like:
C:\Users\Andre\Documents\CG\Blender 2.8
and the render one i'm using is located at:
C:\Users\Andre\Documents\CG\Blender Files\Renders
I've extracted blender's .zip files yes, but never tried running blender from inside it. I'll give it a try! Thanks!!

Your probably trying to write it as a file format that blender cant save it as.

Are you sure that the account you are using or blender has permission to write to where ever you are saving the render?
If you don't know how to do that you can go to the file directory and then go under properties and then security. Make sure everything has permission to write to that file.


text:
Best practice for UV mapping buildings from CAD software
I have problems with importing revit models in my work, the model is made in revit and I after I render with blender.
the most important problem is that when I attempt a brick texture to the walls, the mesh of the object is irregular. Normally, I use cube projection (uv mapping) and everything is ready, but when I scale the texture so that you have the correct size, it loses the right projection.
I wonder if there is any way to make this easy, or easier to make the mesh again?

Projection for view in ortho view does not work because the mesh is difficult to use.

this image is with cube projection unwrap and without rescale texture,

this image is trying to put the correct size with mapping, you can see that it loose the good projection

I used to do this kind of UV mapping a bit and found 3 methods useful.

UV Project modifier, you can use a camera for each wall angle and the cameras project onto the closest aligned walls. very fast to setup and you can edit your geometry afterwards without having to fix UV's.
Smart UV project, this gives simple projections but has the disadvantage that the bricks on the walls for example, wont line up.
Manually - which can be done quite fast infact - Select a face, Shift+G, Select Similar Normal. Then project from view, or from a Camera if you want to have more control over alignment and quickly re-apply the same projection again can be handy too.

Other things to be aware of...

You may want to move the projected UV's for each surface so they dont overlap.(just makes it easier to edit and manage). with tiling textures it wont effect the displayed mapping on the mesh.
topology may be important to improve, this depends weather you are simply projecting UV's or if you intend to manually edit them (in that case you care more about topology and avoid skinny faces for example).

The topology of that model fairly poor, and good topology matters especially with UV unwrapping.
You'd probably be better off making the model again, or:

Apply a Remesh modifier to automatically "retopologize it", or
Retopologize the model with the Shrinkwrap modifier or snapping tools, or
Manually cleaning up the mesh by normalizing your edge flow, removing weird edges.

If you still don't get good results, try unwrapping the model manually with Mark Seam and U Unwrap.

I think you may be over emphasizing the importance of topology, with models with flat surfaces from a cad application its likely Unwrapping isnt ideal anyway (which is better suited to more organic/curved shapes).

I am of the opinion that good topology is always important. But maybe that's just me (and Jonathan).

disagree - the need for good topology depends totally on the use case (weather you expect to deform it, or need smooth shading for eg). For architectural models it may not matter much, or at least it may not be worth spending time to change it.

I understand that the topology is important, but when you work on architectural projects, generally, the project is changing every week, and to model and create drawing sheets, it is much easier to work with software cad format that connects more easily .
The best way I try is;
Manually - which can be done quite fast infact - Select a face, Shift+G, Select Similar Normal. Then project from view, or from a Camera if you want to have more control over alignment and quickly re-apply the same projection again can be handy too.
thanks


text:
How to create a 3D presentations using Blender?
I've made a 3D reconstruction of a church where I've worked and I would like to use this to illustrate my work (technical analysis on mural painting). I've some data to show regarding the building and some additional photos . So I would like to create a presentation with blender adding text and other things directly into the 3D model, and navigate through it to show the data and my considerations. I would like to make something like Prezi with Blender. How can I do that? I've seen one tutorial but I would like to know, which is the best way to organize the data? How can I make a presentation with different "slides" so that I can go to the next or the previous?
Of course I don't want a step by step tutorial, I want a general procedure to know how to organize the project to make this kind of use of Blender.

Blender is not a presentation program or tool. Why not just render out fly-throughs and stills of your work, then put all that into a nice presentation.

@Derek I know, but in fact is a very common problem in architecture I would like to present the work inside the 3D model eventually then exporting to video and using another software for video presentation...

Interesting question but an answer would be very much based on opinions. Depending on how the scene or model is build you could use the blender game engine to navigate around the scene and add text etc (could use keyboard to spawn effects or use near sensors etc). Of cause this would require some knowledge about bge.

@user2859 thanks! Alternatives are not opinions, I'm sure that this is something useful of course these are unconventional research efforts and so is not easy to find the right one...

This might be interesting for you: using blenders game engine for more than just games. Note that the demos are very old. For playback of those you might need an older version of blender.

@user2859 yes, blender real time gallery is close to what I want thanks a lot.

I can see your point. BGE would be a nice choice for that kind of use if you want to use blender to get 3D effects that PPT and Prezi cannot do. However, this is more like a tutorial request, since introducing BGE would be a huge task for others. I suggest that you can find more BGE introductions and tutorials on Wiki or Youtube yourself. Good luck.

I'm still a bit unclear.. Do you want to end up with a static, pre-rendered video or slideshow type thing? Or render the models in real time?

So little thinking outside the box for this to be a computer graphics QA site. This is an awesome idea, +1

I've seen this done before (yes, Blender as a power-point replacement).
Using Camera Switching
Blender can use timeline markers to switch cameras.
This means you can jump between markers to switch slides.
You can have 3d text in each view, and animate the visibility if you rather they don't display in every slide.
This also has the advantage that you can press Play and watch the full presentation.
See: How do I cycle through the camera views?
Using Scenes & Screens
You can configure each screen in blender to be a slide in a presentation.
Then use Ctrl + Left/Right to switch.
Each screen can point to a different scene (or the same scene with different cameras in each viewport).
You can also make use of background sets (the ability for many scenes to share one common scene as a background). - see scene buttons.
Using background sets means you can have a common scene for the detail, and other scenes can overlay text or any elements you don't want to enable all the time.
Using Scenes & Outliner
This just means adding one scene per slide, and using the outliner to change between them, The small disadvantage here is you need to have the outliner open, so you can't switch slides fullscreen.
With this method you can still use background set-scenes, and its rather quick to setup. If you wanted to you could always add a key binding or addon to switch scenes without using the outliner.
Hints

Enable 3D View -> Display (Panel) -> Only RenderThis stops cursor, manipulator and other info widgets from drawing, so you can focus on the content
You may find 3D View Full screen useful to play the presentation,its setup to minimize distractions.

If you want to get rid of the header too - this can be toggled with Alt+F10.

This Python command will cycle to the next scene:

Code:
from bpy import context
context.screen.scene = bpy.data.scenes[(bpy.data.scenes[:].index(context.screen.scene) + 1) % len(bpy.data.scenes)]

Create your models.
Make sure, everything is scaled properly.
Light up your scene, composite it.
Add Cameras for various views. Animate them (use key frameing on Cameras).
Render out your scenes.
Then in VSE add up your images, give them effects, transitions, add text , pause, rotate, move , add sound and your have a nice package to show off as presentation (non-interactive).
You can create a lot of animation stuff in blender, you just need time and skills.
Search youtube for VSE tutorials.
By the way, given link is mostly 2d stuff, you need to use a 2d program to create the visuals, after that you can import them in blender (2d plane-Image plane) and animate.


text:
How to determine whether a python script is hostile?
In a recent release of blender a safeguard for python scripts has been introduced. This is to prevent python script from doing any damage to the system. Although I doubt that there are any blender users that want to wreck havoc. Blender now has a built in system for protecting against malicious scripts. I do not trust this system though. How can I determine if a python script is hostile manually?
So far this is what I have come up with:
import os there is no reason that a python script for blender needs this module, this allows the user to run cmd/terminal commands.
What other things are there to watch out for?

Why not? os.path is part of os and it's pretty useful.

Depending on the length of the script: maybe just read it? That'd at least require an attacker to obfuscate it a bit.

os isn't the only module that provides functions to remove files from filesystem etc., shutils can be used for such evil things too. Or you could somehow shell-execute system commands to do so.
Module imports can even be camouflaged like this:
evil_module = __import__(chr(int("".join(map(lambda x: str(x), [1]*3)))) + '\x73')

So you won't immediately know what it actually imports (os module in this case).
What is to be seen malicious also depends on your view. Like with any trojan, virus or whatever, they don't necessarily damange your system or delete things. A python script could open a network connection and send spam mails, or transmit information about your machine to an attacker.
There are many possibilities to abuse python, and bpy makes it rather worse - bpy.ops.wm.url_open(url="...") could be used to open a prepared website, that infects you with a drive-by download.
The best protection is it run scripts from trusted sources only.

Thanks for the example CodemanX.  Are there any others that you can think of.  It would be nice to have a list compiled of anything which may be suspicious.  Really, it would be nice if Blender could detect these and show a warning.

I don't think it's possible to define a list of potentially malicious modules, functions etc., just like for virus scanners. You wouldn't want to block I/O for an importer/exporter, but a malicious script may use it to spread itself. There is no absolute security, unless you unplug your computer and never use it. It doesn't make any sense IMO to collect things that could be abused (people are too creative), you would either break good scripts, or inevitably overlook something a bad script makes use of.

Alright, so I agree with a lot of that but there would have to be a pretty good reason for scripts to have the ability to delete files on the HD.  That to me is something people should be aware of if it exists.  Another one would be network access.  To my thinking, Python interfaces should have no concept of either of these two ideas.  These two things combined could destroy a lot of computers.  There is no reason for this threat to even be in Blender.  There is a very good reason why Windows OS has proven so unsecure and it's all the software that has these vulnerability built in.

It's not just Blender users that are a problem.  If people who like to target other peoples machines with malicious code have a way to use Blender installations as a site of venerability then they will certainly exploit this.  If you leave the front door of your house open when you are not there then people will go into your house and take things.  That is unfortunately the way the world is.  Anything features like this should be set to 'off' by default and even expert users should have to jump through annoying hoops to activate them for their own machines.

Have a look at the trunk addons, e.g. netrender: It requires the modules sys, os, http, socket, shutil and more. It sends and receives data via network (could also be internet I guess) and removes files recursively (shutil.rmtree), it's not a malicious script however. Would you want this to be blocked?

Ok right, I forgot about renderfarms, oops.
My concern is that Blender might become a leper due to rumors or carelessness regarding security. I'm not advocating that people panic and uninstall Blender. Just that extra caution is used by Devs so that these fears and possibilities do not snowball.
Any software package that gains a reputation for being easily exploitable can end up black-balled very easily. Many companies might refuse to allow it in their buildings.

I'm hoping to avoid sounding like an alarmist but there was a time when many of the worlds main DNS servers would be offline sometimes for days at a time and almost everybody that had an email address was getting virus's sent to them as attachments by address's that belonged to their close family and friends.
This type of thing that should not be taken lightly.

The change in 2.68 was done to increase security, without any evidence that something bad ever happened to anyone. Nothing will be auto-run anymore by default. I find it absolutely sufficient. Everything else the user could run can be good or bad, there's no easy way to figure it out. The addons shipping with Blender are controlled, addons_contrib from official repository should be safe too. The rest is up to the user and in the worst case the virus scanner / firewall. There are countless threats worse than Blender.

I agree about all of that.  The Addons that Blender ships with are well chosen and the threat is light.  Watching a free movie is currently a bigger security threat.  Blender is in no current danger of becoming a community wide Cuda powered virus render-farm. Not for now anyways.  One thing I am certain of is that somebody, somewhere is planning things like this.

There are justifiable use-cases for all potentially dangerous python modules. The more you exclude from python in a standard Blender distribution, the less useful it is for good-natured coders. Some of the built-ins, exec() and eval() for instance, can add an extra layer of obfuscation to the code being executed, you'd need to use repr() to see what kind of code they're attempting to run - but that doesn't mean that they don't have perfectly legitimate uses in a dynamic program.
Yeah, it's a valid security concern and that's why Blender doesn't auto-run python scripts in .blend files by default, until you manually tick the box "Auto Run Python Scripts". Blender will tell you if a driver in a .blend wants to auto run, but it will make you navigate to User-Preferences -> File and set it yourself.

The only way to reduce potential harm of using .blends / scripts that you don't trust, is to first read them. With scripts at least you can read the source, how many programs do you install for which you don't first read the source? A lot probably.


text:
Must I add a license block to all files in a multi file addon?
When an addon grows it becomes convenient to break it out into modules, do those other modules (.py files) also need a license block or is it sufficient to only put it in the __init__.py.

Your question conflates the issue of weather to include a license block in all files with the GPL IMHO. If this is not GPL specific question you could remove that part.

good point. fixed.

@ideasman42, so writing Blender addons with the intent to get them in trunk or contrib, it's preferred that each file has a GPL license block?

if you want the addons to be bundled with  with Blender's default installation then, yes - they have to use a GPL2+ compatible license.

Regarding GNU licenses, their how to page says the "statement should go near the beginning of every source file" (emphasise mine).

No, but it's good practice. All the official Blender addon files have a license block.
https://stackoverflow.com/questions/845895/putting-license-in-each-code-file

Some projects uses See COPYING for license in all their files, instead of full license block (and include a file thus named), but generally they put some information about license in all component source files.


text:
How do I report a bug in Blender?
I have noticed that Blender crashes under certain circumstances. Every time I try to open a separate 3D Window with either Bone or Empty Sphere added to the scene, it just shuts down.
Can you confirm similar behavior?
If it is a bug, how do I report it?
Blender version 2.69 (sub 2),
build date: 2013-11-07.
I'm using Ubuntu 12.04.
Here is the console output:
connect failed: No such file or directory
Read new prefs: /home/orustam/.config/blender/2.69/config/userpref.blend
Writing: /tmp/blender.crash.txt
Segmentation fault (core dumped)

Contents of the blender.crash.txt file:
# Blender 2.69 (sub 2), Revision: 61181
bpy.ops.object.armature_add(view_align=True, enter_editmode=False, location=(0, 0, 1),
rotation=(0, -0, 0),
layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))  # Operator

# backtrace
/usr/lib/blender/blender() [0xbf87d2]
/lib/x86_64-linux-gnu/libc.so.6(+0x364a0) [0x7f1c9820c4a0]
/usr/lib/x86_64-linux-gnu/libdricore9.0.3.so.1(vbo_save_playback_vertex_list+0x42) [0x7f1c863c9ee2]
/usr/lib/x86_64-linux-gnu/libdricore9.0.3.so.1(+0x7e592) [0x7f1c862f4592]
/usr/lib/x86_64-linux-gnu/libdricore9.0.3.so.1(_mesa_CallList+0x82) [0x7f1c862f8362]
/usr/lib/blender/blender() [0xcdb942]
/usr/lib/blender/blender() [0xcdc776]
/usr/lib/blender/blender() [0xcde730]
/usr/lib/blender/blender(draw_armature+0x93a) [0xce011a]
/usr/lib/blender/blender(draw_object+0x3ea6) [0xcd4926]
/usr/lib/blender/blender(view3d_main_area_draw+0x697) [0xca56f7]
/usr/lib/blender/blender(ED_region_do_draw+0x85d) [0xe6e1ed]
/usr/lib/blender/blender(wm_draw_update+0x5bb) [0xbfcc4b]
/usr/lib/blender/blender(WM_main+0x28) [0xbf9b78]
/usr/lib/blender/blender(main+0xcbf) [0xbc2c0f]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f1c981f776d]
/usr/lib/blender/blender() [0xbf72e9]

Here is a nice article/video by Sebastian König about reporting bugs in Blender.

I also found a problem yesterday with a separated 3D window... In my case the window opened and worked properly, but if I tried to render (hit F12) from this window, Blender crashed. However, I'm not sure if Blender.SE is the right place to discuss about bugs...


text:
How to Join two objects properly
I've made an animal model, which consists of two objects: eyes and a whole body. I decided to make them into one object. When I tried to do that with Ctrl  + J one eye joined to the body and the other disappeared. What's the problem?

Apply all modifiers first

Are you using the mirror modifier for the eyes? If that is the case try applying the modifier before you join the meshes.

In essence when you join objects all Blender does is merge their meshes. If you have 4 objects selected, the last object you clicked will be the dominant Object (In Blender we call it 'Active') . This can have interesting (but probably undesired) effects if the dominant Object has a different modifier stack than the objects being added.
When you join two objects that have different Modifier stacks, the dominant object's modifier stack will be used, and the other modifier  stacks are discarded. This is why you will lose the mirror modifier if the dominant object doesn't have a mirror. To remedy this you would need to apply the modifier on the 'joinees' first, or cut the dominant mesh in two and add a mirror modifier  there.
To emphasize you could test this on a small scene, imagine I have 4 objects with all different modifier stacks
object_1 with modifiers (mirror, subsurf(level=2))
object_2 with modifiers (mirror, subsurf(level=4))
object_3 with modifiers (array modifier, subsurf(level=1))
object_4 with no modifiers

If I select in sequence, object(1,2,3,4) , then all associated meshes are added to object 4's mesh, and because object 4 has no modifiers all modifiers are dropped.


text:
how can i convert a vertex of a plane into bezier with handle?
i want to make a plane with rounded edge. Can i change the vertex into bezier with handle?

No, not the way you describe. You can convert a mesh to a collection of Straight splines using Alt+C in object mode, but the resulting Curve object doesn't have handles you can drag away from the Knot. (more about this later)
A simple mesh based solution is to use ctrl+shift+B with the vertex selected and drag out to generate the Bevel, or Fillet (to fillet use mouse wheel to set to number of cuts)

Regarding Spline / Bezier based 2d surfaces i recommend the answers to this question: Make a quarter curve with curves
You can convert the plane to a Curve object (using Alt+C as mentioned earlier, but this creates a Curve of type 'Poly', which means it doesn't have handles, only points. The curve object can be recast as a bezier type (but not easily from the UI, at least I'm not privy to any method). You can use the built in python console to convert the curve from 'POLY' to 'BEZIER' and it will create the handles in the right places too. Also remember to set the Curve type to 2D (from 3D) else you won't see the surfaces
>>> # after you've converted the plane to a Curve object using Alt+C
>>> obj = bpy.data.objects['Plane']
>>> obj.data.splines[0].type
... 'POLY'
>>> obj.data.splines[0].type = 'BEZIER'   # this sets it


text:
Get texture image dpi
I'm trying to get the dpi of the material textures via scripting, but I could not find any information on this.
You can assume that my UV-mapping is un-stretched, each polygon will be covered by the same amount of pixels in relation to the polygon area.
Do I need to use external library?

I don't think there is such a thing as dpi in this context: dpi is always a ratio between size in phsyical dimensions and resolution of the texture. The physical size can't be known from the texture itself.

The dpi is the way of geting real size from resolution. So with the resolution and dpi, we can get the real size of the texture. BTW, no dpi in context.. let's have a look on Pillow...

But (afaik.) as far as there is no dpi-info and no info about the physical size (which a texture file doesn't carry), you can't get it.

(Apart from maybe metadata from pictures taken with a camera. Is that what you are speaking about?)

Sorry if I don't fully understand what you mean.

We are now out of the topic but : every picture have a dpi resolution, I would like to get it when the picture is used as a texture.

I believe we don't mean the same things when we see DPI: are you talking about PPI (as here: https://en.m.wikipedia.org/wiki/Pixel_density#Calculation_of_monitor_PPI)?

(Substitute "screen" for "image")

I'm thinking about https://en.wikipedia.org/wiki/Dots_per_inch

SO something print-related???

My goal is to map the texture on my object using the object size to match the image size. Let's consider a brick wall image for the texture. Set the texture dpi to 300, then consider 300px as an inch, so adapt the texture size to have a brick measuring 10inches (for example). If you create a wall  in blender, put the texture on it, then unwrap UV and scale UV to match the real texture size, so the wall have brick at the good real size, just scaling the UV, based on the picture where the DPI has been well set. (Of course, if the DPI is not used this way in the image, it does not make sense)

Ok. Thanks. Now I understand what you are talking about. I really believe there is no such way: Blender doesn't (afaik.) treat an image with such metadata differently. And there isn't neccessarily such data available: make a 100 x 100 black square. There is no meaningfull value for DPI in that image.

DPI of a texture/image will depend on how many pixels are mapped onto a polygon and the real-world area of that polygon. Now your question is more exact (homogeneous uv - no stretching), some parts of this answer aren't directed at you but hope to describe the notion of DPI and that it won't always be a single figure per model.
The following only works if your image-texture is square. width px is the same as height px
factors that decide DPI
You can use the same texture on large polygons and on small polygons, you can also scale the uv coordinates so a small polygon could contain many pixels (effectively high 'dpi'). The DPI therefor is not a property of the texture, but of each polygon and uv mapping.
If you have no such stretching going on and each uvmapped face is covered by the same amount of pixels relative to its real-world area, then you can calculate the DPI once.

Variable DPI vs Homogeneous DPI
The effective DPI of a texture is often variable, but not always. Indeed for certain kinds of texturing it is desirable to have no stretching at all. In either scenario the formula is the same, but when you speak of homogeneous uv-mapping you only need to calculate it once.
Finding UV coordinates
Code to help with this can be found in TextEditor -> Templates -> Python -> Operator Mesh UV. Below i've stripped out the template to make sure it just prints the 2d coordinates of each .uv (a 2D .uv corresponds to a 3D vertex.co). This would give you the 2d coordinate in the UVmap of each vertex per polygon:
import bpy
import bmesh

obj = bpy.context.edit_object
me = obj.data
bm = bmesh.from_edit_mesh(me)

uv_layer = bm.loops.layers.uv.verify()
bm.faces.layers.tex.verify()

for f in bm.faces:
    for l in f.loops:
        luv = l[uv_layer]
        print(luv.uv)

Here's the formula used to calculate the area given a list of coordinates, here's the same formula stated in Python. From the Area you can extract a hypothetical side length.
import math

import bpy
import bmesh
from mathutils import Vector

def texture_dpi(polygon_area, uv_area, image_dim):
    """
    polygon_area:   in (meters or BU)
    uv_area:        in ratio (0..1)
    image_dim:      either width or height of image, this assumes
                    square images anyway, else none of this makes sense
    """

    l1 = math.sqrt(polygon_area)
    l2 = math.sqrt(uv_area)

    # assume the units are BU or meter.
    inches = l1 * 39.3701
    pixels = int(l2 * image_dim)
    return int(pixels / inches)

def calc_area_from_2d_vectorlist(v):
    # http://www.mathopenref.com/coordpolygonarea.html
    sum = 0
    n = len(v)
    for i in range(n - 1):
        sum += ((v[i].x * v[i + 1].y) - (v[i].y * v[i + 1].x))
    sum += ((v[n - 1].x * v[0].y) - (v[n - 1].y * v[0].x))
    return abs(sum / 2)

def get_bm_from_edit_object(image_name):
    obj = bpy.context.edit_object
    me = obj.data
    bm = bmesh.from_edit_mesh(me)

    uv_layer = bm.loops.layers.uv.verify()
    bm.faces.layers.tex.verify()

    totals = []
    for f in bm.faces:
        vl = [l[uv_layer].uv for l in f.loops]
        fa = calc_area_from_2d_vectorlist(vl)  # 2d area of uv loop
        totals.append([f.calc_area(), fa])     # 2d area of face (local size)
        break  # if homogeneous  , else comment it out.

    image_dim = bpy.data.images[image_name].size[0]
    for polygon_area, uv_area in totals:
        dpi = texture_dpi(polygon_area, uv_area, image_dim)
        print(dpi)

get_bm_from_edit_object('some_texture.png')

Considering the UV map using a 0-1 range, considering the object sized in real-word units and considering the texture/image with a dpi, I can change the UV scale to make all this match the same real-world units.

Great! Upvoted 7 hours ago, unfortunately I can't upvote again :D

Nice answer, thanks a lot. This is out of the topic because I'm not trying to change UVs coordinate but just to scale the UV map. I consider the UV has been scaled the same for each face, and using the total length of the UV map from 0 to 1. Then, knowing the DPI of the texture (converted into real world size) and knowing (asking the user) the total lenght of the UV map (in real world size too) I can make them match via UV scale.  Thanks again for the effort :)

Yes, my question is not enought precise. I'm begginer here, sorry.

That's OK. @Ange_blond If I can give advice it is to take more time to formulate precise questions, give us your list of knowns. -- and edit your question to include information asked for by our comments. (less information should be in comments...)


text:
Is there a shortcut to undo a viewport move?
Is there a hot key to undo a view port change similar to the bracket key in Maya?
I've looked through the hotkeys and don't see anything.
Thank you.

I guess there is not the command, it is not possible, hence there is no hotkey... you could get some help from this addon/script http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/3D_interaction/stored_views

This is also a feature I used quite heavily in 3dS Max!!! Surprised it doesn't exist.

I encountered many bugs so this is more of a proof of concept than ready solution
I adapted the code from here.
Run the below code, make some changes to viewport and press CTRL + SHIFT + F12 to undo viewport changes (keeping track of a few more properties has to be added e.g. orthogonal/perspective)
bl_info = {
    "name": "Work Macro",
    "category": "Object",
}

import bpy, time
from collections import defaultdict

timeout = 1  # number of seconds between changes justifying a separate state
undo_buffer_size = 100  # in this crude implementation, each buffer will grow
                        # to double its limit before being truncated to the limit

states = defaultdict(list) # key: space object, value: list of tuples(last_change, view_matrix)
view_handler = None

def callback():
    # perhaps you can only use context.area.spaces.active instead of iterating here
    areas = bpy.data.window_managers[0].windows[0].screen.areas
    for area in (a for a in areas if a.type == 'VIEW_3D'):
        for space in (s for s in area.spaces if s.type == 'VIEW_3D'):
            space_states = states[space]
            if not space_states:  # empty list
                space_states.append((time.time(), space.region_3d.view_matrix.copy()))
            else:
                last_time, view_matrix = states[space][-1]
                matrix_change = view_matrix != space.region_3d.view_matrix
                if matrix_change and time.time() - last_time > timeout:
                    states[space].append((time.time(), space.region_3d.view_matrix.copy()))
                    if len(states[space]) > undo_buffer_size * 2:
                        states[space] = states[space][-undo_buffer_size:]

class WorkMacro(bpy.types.Operator):
    """Work Macro"""
    bl_idname = "object.work_macro"
    bl_label = "Work Macro"
    bl_options = set()

    def execute(self, context):
        space = context.area.spaces.active
        if len(states[space]) > 1:
            states[space].pop()  # remove current state
        revert_to = states[space][-1][1].copy()
        space.region_3d.view_matrix = revert_to
        #sometimes the above will slightly modify the matrix so let's update the undo state with it:
        states[space][-1] = (time.time(), space.region_3d.view_matrix.copy())
        return {'FINISHED'}

# store keymaps here to access after registration
addon_keymaps = []

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

    # handle the keymap
    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name='3D View Generic', space_type='VIEW_3D')
    kmi = km.keymap_items.new(WorkMacro.bl_idname, 'F12', 'PRESS', ctrl=True, shift=True)
    addon_keymaps.append(km)
    global view_handler
    view_handler = bpy.types.SpaceView3D.draw_handler_add(callback, (), 'WINDOW', 'POST_VIEW')

def unregister():
    print('unregister')
    bpy.utils.unregister_class(WorkMacro)

    # handle the keymap
    wm = bpy.context.window_manager
    for km in addon_keymaps:
        wm.keyconfigs.addon.keymaps.remove(km)
    # clear the list
    del addon_keymaps[:]
    bpy.types.SpaceView3D.draw_handler_remove(view_handler, 'WINDOW')  # remove handler added on end of register() function

if __name__ == "__main__":
    register()

Wow, this should be come a standalone plugin

There is no feature/hot key in Blender that allows the viewport moves to be undone. However, you can undo other actions with Ctrl+Z. Blender, sadly does not support undoing of viewport motions and editor locations, and the location of the 3D cursor. However, there are some addons that may be able to help you with those.

Just wanted to suggest that you could open a new workspace specifically for view angles you want to keep.


text:
Punching a Hole
Alright, I am new to Blender, I have watched many videos explaining how to make a hole in a mesh, but all the examples use just a plane or a cube,
I am making a Helo/Jet or VTOL with props in the wings,I have the Jet Modeled and need to punch a Hole through the wings and can not seem to figure it out
Above is a ScreenShot, Like I said this is my first object i have done in blender. I would like to Put a hole in each wing and one through the tale.

I've flagged this in the hope a mod will move it to blender.se - I can't really use Blender

Use the Knife Project Tool Or Boolean Modifier: See http://blender.stackexchange.com/questions/6321/cutting-an-archway-in-a-wall-of-a-model-of-a-building/6333#6333 for suggested reading

The site can be explored by using the search tool too: http://blender.stackexchange.com/search?q=cut+hole

You can use the Boolean Modifier set to "Difference" as already suggested, or use the Booltron Addon, which I find a bit more versatile than the builtin modifier, and quicker to use in most cases.
Here's a video and the link to the addon's repository:
https://www.youtube.com/watch?v=KxbJSUQpw7I

Anthony (OP), I think you would be better off modeling the holes than doing a boolean because your mesh is low-poly and you'll want to keep the topology clean if you plan to subsurf. Use the Mirror Modifier so you don't have to repeat the same operations on the left and right sides. Learn to use "Loop Cut" "Knife Tool" "Delete faces" "Fill faces" and you'll have the basic knowledge needed for cutting holes.  @torels Thanks for suggesting Booltron! Just installed it. Huge time-saver.

Thanks guys like i said.. really new to this, already using mirror for this model, every thing else you guys suggested went right over my head, I have seen the buttons for what your suggesting, I will do check google and see what i can figure out. and here is a link to the model on my onedrive
https://onedrive.live.com/redir?resid=AB21864BC8446233!3089&authkey=!AFU9KALOTkzhHsY&ithint=file%2cblend

The steps you have seen for making a hole in a flat mesh will get you 90% of the way there. Once you have the two holes on either side of your wing, simply select the vertices around the hole on both sides and use bridge edge loops to add a surface connecting the two sides. You can either search for this in the space bar menu or find it in Mesh->Edges->Bridge Edge Loops

You may also want to add a small bevel (⎈ CtrlB) around both ends of the hole.