text:
How to draw a flat ellipse surface in Blender with the following known dimensions?
I'm trying to produce the following ellipse as a surface or curve within blender with the following specifications.
The following dimensions, including the position of the origin in x,y,z coordinates will be known. For this image, it will be a flat plane in the x,y direction.
What's the best way or how do you go about coding this?
thanks!

some minor clarifications - the width is a + b = 12.
How about if this was the scenario instead, when it's more skewed and doesn't look like a circle?

https://blenderartists.org/forum/showthread.php?316772-Create-a-mathematically-correct-ellipse

I found a solution!
Use this code in the blender text editor:
import bpy
import math

#IMPORTANT : set 3d cursor to world origin
bpy.context.area.spaces[1].cursor_location = (0.0, 0.0, 0.0)

#Add circle curve
bpy.ops.curve.primitive_bezier_circle_add(view_align=False, enter_editmode=False, location=(0, 0, 0), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))

#define variables
a = 10
b = 2
c = 3 # I use the half of c
d = 5

#Calculate width
width = a + b   #or width = a + d + b?

#Calculate horizontal distance from world origin of c
distance = b / 2

#Calculate height c for the circle
#x^2 + y^2 = 1, see Unit Circle
x = (distance / (width / 2)) * math.pi * 0.5

cCircle = math.sqrt(1 - x**2)

#now we have to scale the height of the circle, so cCircle becomes c. And give its width.
factor = c / cCircle

bpy.ops.transform.resize(value=((width)/2, factor, 1), constraint_axis=(True, True, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)

#Calculate location origin
originX = -((width) / 2 ) + b
originY = 0
originZ = 0

#Set 3d Cursor at Origin location
bpy.context.area.spaces[1].cursor_location = (originX, originY, originZ)

#Set origin to 3d cursor
bpy.ops.object.origin_set(type='ORIGIN_CURSOR')

#Move object to world origin
bpy.ops.transform.translate(value=((width/2) - b, 0, 0), constraint_axis=(True, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, release_confirm=True)

#Voila

I hope this helps!

hello! thank you for that. It worked great. I had to make a minor modification;  from bpy.context.area.spaces[1].cursor_location = (0.0, 0.0, 0.0) to bpy.context.scene.cursor_location = (0.0, 0.0, 0.0) somehow .area.spaces didn't work for me.

is it possible to achieve the alternative problem? :)

Yes, but then you must use the bezier curve.

You can do it manually or do you need a script for it?

Here's an updated version of float's answer. This solution is for Blender versions 2.93, 3.0, 3.1, 3.2, and 3.3
import bpy
import math

win = bpy.context.window
scr = win.screen

def use_temp_override():
    version = bpy.app.version
    major = version[0]
    minor = version[1]
    return not (major < 3 or (major == 3 and minor < 2))

def get_areas(type):
    return [area for area in scr.areas if area.type == type]

def get_regions(areas):
    return [region for region in areas[0].regions if region.type == 'WINDOW']

def execute():

    bpy.context.scene.cursor.location = (0,0,0)

    a = 10
    b = 2
    c = 3
    d = 5

    width = a + b
    distance = b / 2

    x = (distance / (width / 2)) * math.pi * 0.5

    cCircle = math.sqrt(1 - x**2)
    factor = c / cCircle

    areas  = get_areas('VIEW_3D')

    # ========================================================================================
    # (if) execute using temp override
    # ========================================================================================

    if use_temp_override():

        with bpy.context.temp_override(window=win, area=areas[0], regions=get_regions(areas)[0], screen=scr):

            bpy.ops.view3d.snap_cursor_to_center()
            bpy.ops.curve.primitive_bezier_circle_add(radius=1, enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))
            bpy.ops.transform.resize(value=((width)/2, factor, 1), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=False, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False)
            bpy.context.scene.cursor.location = (-((width) / 2 ) + b, 0, 0)
            bpy.ops.object.origin_set(type='ORIGIN_CURSOR')
            bpy.ops.transform.translate(value=((width/2) - b, 0, 0), orient_axis_ortho='X', orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=False, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False)

    # ========================================================================================
    # (else) execute using legacy override
    # ========================================================================================

    else:
        override = {
            'window': win,
            'screen': scr,
            'area': areas[0],
            'region': get_regions(areas)[0],
        }
        bpy.ops.view3d.snap_cursor_to_center(override)
        bpy.ops.curve.primitive_bezier_circle_add(override, radius=1, enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))
        bpy.ops.transform.resize(override, value=((width)/2, factor, 1), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=False, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False)
        bpy.context.scene.cursor.location = (-((width) / 2 ) + b, 0, 0)
        bpy.ops.object.origin_set(override, type='ORIGIN_CURSOR')
        bpy.ops.transform.translate(override, value=((width/2) - b, 0, 0), orient_axis_ortho='X', orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=False, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False)

print("start ======")
execute()


text:
How to make an animation smoother?
I am trying to animate a skateboard doing a trick called a hardflip. The trick involves the skateboard rotating 180 degrees and flipping once.  If I animate the whole trick with two keys, it make it look weird because it involves the flip and rotation. To solve this I split it up and put two keyframes. Then on the second one, I rotated the board halfway, and flipped it over halfway. Then I put a third key and on that one I flipped and rotated the board the rest of the way. The problem is, since the animation is split into three keys instead of two, it looks like the board rotates half way, slows down a bit, then speeds up into the second half of the rotation. Is there a way I can make it look smoother? The image shows the timeline, and circles are over the main 3 keys. The other are just to adjust poses.

It sounds like you need to change the interpolation of the f-curves
https://www.youtube.com/watch?v=R9gCHhJOjlQ

Animation in large depends upon the Rig, what it's capable of and human intuition. To make infinitesimal adjustments take note of Quaternion or Euler rotation and adjust graph curves. Presets as described by @eromod work in many instances.

Try using the f-curve it helps with smoothing out animations and help with the timing

Select your object and then open the Graph editor in a new window. You'll see a series of coloured lines going across the window with little square nodes on some of them. Those nodes represent your keyframes, and the lines represent the transform values for your object over time.
Play your animation as you watch the graph editor. You'll see that the curves/angles of the coloured lines coordinate with the location/rotation of your object as it moves.
Locate the line(s) that represent the rotation values and find the little nodes on it and play with their positions to get an idea of how the shape of the curve affects the object's movement. You can also affect the shape of the curve by playing around with the handles attached to the sides of each node. Use these handles to adjust the curve shape between nodes.
Once you have an idea of how the shape of the curve affects the motion of your object, you should have no problem figuring out how to smooth out the movement of your object.
Have fun!

source: Stack Exchange

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

sort: votes


text:
How do I use the AI PDF SVG addon?
After reading howardt's answer here about cleaning meshes created from imported .svg curves, I installed the addon AI PDF SVG.
But when I import a .svg file, I do not see the options described in "Usage".

How do I use the addon?

I think you are simply not using the good import menu entry.
There is another SVG import tool installed as standard addon in Blender.

Only the second one (on bottom above and which is corresponding to your link) has import options.
Alternatively, it is also possible that the wrong addon has been activated:

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


text:
Gradient between two materials on the same mesh
I am trying to colorize a mesh for a 3d illustration, and I have been using Steven's technique so far.

The problem is that, as Stephen notes at the end of his answer, the contrast between the two materials is rather sharp.
Is there a way to blur or gradient the line between the two materials?
I was thinking about colorizing faces with a ramp between the two different colors, but that sounds complicated, and I'm using Cycles, so maybe there's another, simpler way to do this?

Consider creating a third material that mixes the first two materials according to the U coordinate of a UV map.

Scroll down to the snippet "SMOOTH BLEND" - it might help you out using OSL for your effect: http://blendersushi.blogspot.de/2013/08/osl-disk-grid.html

It's just a matter of values. Paul Brachmanns Answer is the right direction... with a little tweaking you'll get:

Use Generated Texture Coordinates followed by a Vector Mapping Node with Rotation: [35.2°, 45°, 90°]; Scale: [1, 1, 5.189] followed by a Converter Math node set to Modulo with a Value of 1, invert it with an Color Invert Node and use the result as the Mix Shaders factor...
You can add another Mapping node in front of the shown Mapping node to rotate the coordinates along one single axis (Z or X). To flip it around by 180°, add a Color Ramp node after the Modulo and flip the black and white sliders...

Instead of the Math Modulo you can use a Color Ramp node to have a single transition without the repeating pattern. Tweak it a bit to get the positions of the color changes (as they are not linear in thirds) with constant interpolation and then switch to linear or easing once you found the proper positions. It will give you an even better result.

Oh and give Paul an Upvote as well as he already pointed out the proper direction. ;-)

Hi! Just went back to this project and I'm having a hard time directing the gradients (up > down, down > up, left > right, right > left...) could you help and edit your answer to indicate how to use the Mapping node to give the gradient a direction? Thanks!

Did you try to manage rotating it on your own? I figured it out in no time... And your original question wasn't about different angles, so you might leave this question answered and ask a new one referring to this for further details ;-)

Simply using a gradient texture to blend two shaders using a mix shader node is not an option?
Setup goes like this:

The two emission shaders of course would be replaced by your material setups.
I think that is about as simple as it gets.

Hi Paul! Thanks for the answer. Could you please elaborate on how to tweak  the direction of the gradient using the Mapping node? I've been trying every possible number combination in every box to make a linear gradient go from left to right and it's so counter-intuitive... so hard! thanks

One idea would be to use 'Object' mapping and then use a helper object's coordinates (select it from the 'Object' drop-down). This enables you to transform the gradient by moving, rotating and scaling the helper object (which to me appears to be a lot more intuitive).


text:
Soft bodies bouncing with collision
I am trying to get soft body objects to interact with each other as if they were real world, rubbery objects.
An example of the type of material I am trying to create can be seen in David McLeod's work (who uses C4D):
https://vimeo.com/131654511
When I try to make soft body objects interact, they usually merge with each other:

or fly around like crazy:

But although I have tried many different settings, I couldn't get the soft bodies to bounce off each other and interact properly as they would in real life.
How could I achieve that?
Here is a .blend file that I'm having the problem with:

Thanks! I love blend-exchange! But the file is 9mb, exceeds limit of blend-exchange; do you have another suggestion?

Oh, you're right! I was thinking about another scene for which I had a large file I think... I've edited the question with a blend-exchange link, hopefully it'll help!


text:
Water ripples / waves on the surface of an object
I would like to create a character made of water.
To do this, I am trying to do it with a simple sphere first.
I tried to apply modifiers to the sphere to get it to move and undulate like water ripples. This tutorial is good for creating waves, but it uses the "generate" geometry setting of the Ocean modifier, therefore making the shape flat.
When I use the Displace option of the Ocean modifier on a sphere or cube, it moves up and down and bends slightly but doesn't create the effect I am looking for.
I also looked at this tutorial, which helped me understand the Wave modifier better, but produces results that are not exactly what I'm looking for (cf blend file). The ripples appear on top and bottom but not evenly around the shape, and don't have the sharpness and strength that I'm looking for.
I haven't tried to combine real water simulation, force fields or particles.
Ideally, I would love to be able to save this texture and apply it to the character and/or of the scene.
This is a good example of what I am trying to achieve (unknown artist):

Blend:

Possible duplicate of Map ocean displacement to a sphere?

I got a pretty decent result by using an ocean modifier and a displace modifier.

I find that icospheres lend themselves to displacement better than UV spheres due to the more even geometry.  So for the above example I used an icosphere with a subsurf modifier to give it some more geometry.
The basic wavy fluid look is produced with an ocean modifier.  The key settings to change are to set it do Displace the geometry instead of regenerate, increase the Choppiness and Scale, and adjust the Size to fit the scale of your scene.
Here are the settings I used (for a sphere with a diameter of 25 Blender Units):

The smaller bumps are created by a normal displacement modifier.  It is placed after the ocean modifier in the modifier stack and uses Global mapping coordinates for a clouds noise texture.  This is so that as the geometry is moved around by the ocean modifier, the displacement texture changes too.  Make sure the noise texture is set to a high Depth value as well to get a more detailed look.

Thanks! My bubble keeps moving up and down when I apply these settings, do you know what makes this happen? (also, could you share your blend? thanks!)

@fabriced  Could you post a screenshot of what it looks like?  I'm not quite sure what you mean by the bubble moving up and down.

Yes, sorry: http://i.imgur.com/l82V8IM.gif

allo @PGmath? I'd love to know how you got that result... Ocean modifier makes my mesh bounce up and down...

@fabriced  Try playing around with the Scale parameter.

What you are looking for is probably a regular displacement modifier. Most options you tried are "generative" and create geometry or alter it profoundly, making them unsuitable for applying on more complex geometry like a character.
Just use your regular mesh character, a sphere or any other more complex shape, add some subdivisions to it with a Subsurf modifier and then at the end of the stack add a displacement modifier.
Use any of the built in procedural textures to drive the displacement of the modifier, like Musgrave or Stucci, Voronoi worked fine for me.
Change it's coordinates to Object, and use an empty or any other object to drive the texture coordinates. You can then animate its position, scale or rotation to suit your needs for the animated water effect.

You can add finer detail to the water ripples effect to your mesh at render time only by simulating finer disturbances in the surface with a material based bump map or normal map or displacement without affecting the amount of geometry as heavily.


text:
Any way to modify an already existing rig for a character?
A model I'm using already came pre-rigged and was ripped directly from a game. I'm able to work with it, but there's just a lot of controls that are positioned oddly (sticking out rather than inside the actual model). I'd already attempted to fully re-rig the model but ended up with parts that stuck out everywhere.
Is there any way in which I could simply move the armatures without it affecting the model/parenting/etc.?

What format is the imported model? The FBX importer has options that can control the bone orientation (in the right panel, the "Armature" section at the bottom). If the model was ripped from a game then the armature has only deformation bones but no control bones (IK/FK, constraints, etc) that make animation easier. You can add your own control bones and add Copy... bone constraints so that you can pose the deformation bones with the new control bones (retarget). Alternatively, you can rig the model from scratch, including weight painting.

Thank you and sorry for the late response :) The file was indeed an FBX model. How exactly could I add control bones? Sorry, I'm a little new to everything!

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


text:
Geometry nodes - Curve to mesh with profile and taper or scaling in two axis
I want to extrude a rectangular handrail along an existing spiraling curve. The handrail should get thinner and wider at the end of the spiral (as if it was blacksmithed). Setting a curve radius only gives me control of the thickness, but I want the thinner parts to also be wider (in Y axis). In other words, the extrusion profile should gradually change from a square to a flat rectangular at the center of the spiral.
Any hints would be appreciated.

do you mean like this? [1]: https://i.sstatic.net/yFcOW.png

@Chris, yes that's it

Either use curve radius for one dimension, and for the other counter it (scale by a reciprocal $1 \over r$) and scale by the radius you want:

Or just solidify ("bevel") the edge yourself:

The two solutions aren't exactly the same, due to the last extrude not being preceded with "Set position" to maintain mean mass close to original curve, also maybe because in one case skeleton of mesh is constructed on points, and in another it's edges (curve segments) rather than points, that produce thickness, so the interpolation could slightly change the shape. Also, as you can clearly see below, I didn't put much effort to make the results similar:

with this node tree:

you will get this:

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


text:
My fluid inflow doesn't stop even after animating it keyframes (useflow) to stop
I have been learning blender for 2 months now, I get stock at this point where I am finding it very difficult to animate a running fluid from the flow into the effector
Pls can someone explain how to stop fluid, I have watch countless of videos but it seems am not getting what is going on

pls provide your blend file so we can check it out what you did wrong. thx.

Please reduce your case to the simplest demonstration of your problem, and illustrate it, with a clear, straightforward description. You can share that on https://blend-exchange.com/ .  We can't help without enough to go on.


text:
Overlay frames of the animation on top of each other
I want to create an animation where the frames will be layered on top of each other. That means that when the first frame will be just the first frame, but the last one should be a mix of all of them.
Is there a way how to do this in the video editor?

if you render all frames as images, you could then stack all over each other in video editor, yes.

@Chris If I have cca 100 frames, I cannot do that manually. Is there a way how to automatize that?

i don't think so. except you now python and the blender-api, should be doable with that.


text:
how to increase length of selected section
In the picture attached how can I increase the length of the selected section (along its slightly tilted vertical axis I mean) so that everything else below moves down accordingly when I do so. Or, I cannot do it, and I must first separate what is below, increase length of what I want, and then rejoin what was separated from below?


text:
How to copy symmetrically
I want to first bring the center of the top face of vertical bar to the intersection point of the edges as I marked #1 (right now it is slightly off as I did it manually), and then copy the vertical bar symmetrically to the other side , where I marked #2 and x. So I will have two vertical bars inside the big rectangular prism, symmetrical with respect to center edge loop. How can I do this? (which I highlighted as visual aid now)

Snap the cursor to the center loop, then set the cursor as a pivot.

Might also be worth using the Mirror modifier if it's going to be symmetrical.


text:
how to bring corners of two objects together
I know it is simple but I cannot do it. i want to bring the top of vertical bar down to match the edge of horizontal bar so they form a shape like a right angle. so yes of course i can bring the vertical bar down and manually approximately position it near the edge of horizontal bar. But i want it to accurately snap. I mean i want the top face of vertical bar to snap to the small side face of horizontal bar. here is what i did: i brought the cursor to the top face of vertical bar. I turned snap on, and chose face and center option so that the top of vertical bar snaps to the center of side face of horizontal bar. but i cannot do it. it doesn't snap.

What happens when you turn off Proportional Editing? Have you tried Merge By Distance on both objects before moving?

There is also the snapping method shown in this YouTube video: https://www.youtube.com/watch?v=Jfr5ULxQ0Rg that was introduced in Blender 4.0.

the snapping is really very counterintuitive or simply not working. similar to the video i first select my object and then press G. then i try to snap with all those face edge vertex ... options and it just behaves however it wants nothing  like i want. then i also try with pressing B. now I have somewhat more control select (sometimes) where i want to grab but then i cannot take it to where i want. it just does as it pleases. snapping in blender either really sucks or i simply cannot do it - and I used many drawing programs, cad before

As there could be a few reasons why you can't get snapping to work like you want it to, the best way that someone could help you would be by looking at your .blend file. You could edit your question and add the file with just the two objects in it, by uploading it to: https://blend-exchange.com/  continued...

Based on your comment, it appears that there is something you don't understand about snapping in Blender. This is a YouTube video that explains some basics: https://www.youtube.com/watch?v=-c0Evpf8V3A There isn't likely to be anything in it that will help with this problem. I would also suggest doing a search on YouTube for blender snapping. There are many tutorials.

You can use the Snap-control on the 3d-view screen.  click on the magnet to turn on and then in my case "Edge" was the selection that worked for me.

Remember to disable snap afterward or you may think blender is going crazy on you.

no it doesn't work


text:
How to write a text superscript
How can I write part of a text as superscript in blender? It looks like I cannot. So what will I do? Write it in Word and then transfer it as image to blender? I hope it is not complicated.

Could you add a picture of what you are expecting ? If it is for mathematical formula, you can produce SVG curves using LaTeX formatting for example (https://blender.stackexchange.com/questions/72467/use-latex-in-blender).

No need a picture. I just want to know how to write a superscript in the text.

See https://blender.stackexchange.com/questions/43528/create-subscript-text/43533#43533

@upstream there is no such option therefore Stef is asking for specifity to advise a workaround.


text:
Displaying an object's true color inside another object
Let's assume object B is inside object A. Object A is colored transparently. Object B is also colored.
Now as you may easily guess, object B would be visible, but its color would appear different, more pale than its true color, because it is within object A, which is transparent.
My question is, is it possible to display the real color of object B as if it was not inside object A, without changing anything about Object A's coloring and transparency and still keeping object B inside object A?

I'm pretty sure you can, shader wise. Take a look at "Light path" node. Another solution would be to render 2 layers and composite them together. Simpler but a bit more render time.


text:
How to snap bottom face of cone to top face of cylinder
I want to make something similar to an arrow. How can I snap center of base of cone to center of top face of a cylinder? I tried every option near the famous magnet icon and also the combinations with G and B, without luck. Snapping things with blender is one of the hardest things in the world.

Blender snapping does take a bit of getting used to.. and IMO could still do wirh improvement.. not an answer, but from a modelling point of view, don't forget this option

Nice alternative thanks

@RobinBetts Extrude Faces Along Normals? It is a planar n-gon, why not simply extrude with E? A single face is by default extruded along its normal...

@GordonBrinkmann  .. Oops, muscle-memory :D I think I've got into the habit of Alt-E. all the time. ...  If you're there, upstream, .. Gordon's onto it.  :)

Yes I was able to just extrude with E thanks. BTW what is that big yellow circle appearing when I try to extrude? Or when I did inset faces, the big white circle... (and somewhere else there was a big black circle)... I can do nothing to them or get rid of them. ))

select this face on the cone
shift-s -> cursor to selected
tab -> object mode
object -> set origin to 3d cursor
snapping settings:

unfortunately you still don't have it in the middle of the face (or you just eyeball it. Or you can create now a vertex in the middle of the cylinder face and snap to vertex...but honestly, i would use align tools (free add-on, comes with Blender)

A) select both objects -> click -> select the cone then G Z Z done

I activated align tools and aligned them. then I selected cone, did GZZ but the bottom of cone still does not snap to top of cylinder.

that's right - the g z z i did eyeball it. I honestly think, that you should do it like Robin wrote in the comments, because that's quicker and more accurate

Ok. At least now I feel better that even experienced people cannot do it. They should definitely improve snap feature then. Thanks a lot for the answer.


text:
transparent object vs world background
I have an object, say object 1. it is a semi transparent object, with another object inside, say object 2. Now I introduced a world background so it renders nice but when i do this the backgorund interferes with my transparent object1. so i have to make object1 less transparent but this time object 2 inside becomes less visible. how can i for example make objects not affected by background or what else might you suggest for this situation?


text:
how to obtain only one bar from this
i divided the cube into sub pieces by loopcut as seen in the picture. now all I want is to obtain one vertical bar from this and get rid of everything else. i think i can do this by selecting some vertices and deleting them but can you show me a better way? so again, out of these 16 vertical bars that you see that make up this cube, I want to obtain only one of them and get rid of the rest. what is the best way?

Do you just want to keep one face or the complete block across the cube? - A sketch of exactly what you want to keep would help.

I don't understand your question. As I stated in my question I want to obtain one vertical bar from here, where currently there are 16 bars.

Hello could you please show a drawing of how it is supposed to look?

The cube in the picture is made of 16 vertical bars. I want to get rid of 15 of them and keep just one. No need to attach another photo to my question.

Select the 15 bars and Ctrl X to dissolve?

Also, Alt Ctrl RMB to select an edge ring (then Shift LMB to remove from selection)

LMB Select the face, Ctrl-I invert selection, X delete?

"The cube in the picture is made of 16 vertical bars. " I seriously doubt it. I guess that what we are looking at is one cube made up from the usual 6 surfaces, 4 of which are divided into 4 lengthy faces each, the other two divided into 16 square subfaces each.

If you remove what you perceive as "the other bars", you end up with something with two square faces and four non-surfaces without any face (in case of keeping one form the inside) or two square faces, one lengthy face (in case of one on the side but still somewhat in the middle) or two square face and two lengthy faces (in the case of keeping one on a corner).

Several people have asked you to provide how the result should look like, because they want to know what you really expect, which part you want to keep and whether you are aware of the different kinds of non-faces - and (if I guessed wrong) whether you are really right in saying that this cube consists of 16 bars with 6 actually existing faces each. I doubt it, because then I suspect that you would not have any problem.

If you still cannot, or decide for other reasons not to, provide a desired result sketch, please at least answer this question: How many faces do exist in what you show? If you are right in stating that this cube consists of 16 bars, then the number of faces should be 64. I expect however, that you only have 48. Note that the number of vertices is the same in both cases, they are all visible from the outside of the cube. (Everybody feel free to find and point out errors in my math/counting. I am only bean counting to help OP become aware of relevant geometry difference.)

moonboots your first method works, but I couldnt do it with your second method. Robin, CTRL I is really good trick, I didnt know this but good to learn. This is why I asked such a simple question while beginner level, to learn correct practices. Yunmosh, as you can see, when you want to understand something, you just understand it. No need to make things complicated. The question is simple and so were the answers from 2 people who solved the issue.

I think what's throwing people is that the common way to model is not subtractive like  this - to obtain the column you are looking for, the simplest way would be to add a a plane, subdivide it 3 times, select one of the faces, extrude it "up" by 2, select and delete all the rest of the faces and make a face to fill the "hole" in the bottom.

Although, even easier than this, however (given your desired dimensions), would be to take a default cube, enter edit mode and scale by 0.25 along the X and Y axis, but not the Z (S + Shift+Z + .25)

or elect the cube, hit N, and adjust dimensions. so i learned myself. yours is good way too thanks

Nice! - There are at least 6 ways I can think of offhand to accomplish the same thing, glad you found one on your own. Keep practicing, you'll see how trivial this kind stuff becomes pretty soon.

This post might be another approach you could take - essentially creating the columns as an array, then look at how to select a single instance desired: https://blender.stackexchange.com/questions/242103/making-a-volumetric-xyz-array-in-geometry-nodes


text:
How to join these edges to make a 90 degre pipe
These two edge loops at the end of straight pipes are identical and I am trying to join them to make a 90 degree pipe. I select the two edge loops and then from edge menu I select bridge edge loops but it gives error and says I must select atg least two edge loops. Why? I already selected 2 edge loops. BTW the bridge should make the 90 degree turn as a curve, not just straight. But first I wanted to create edges between these two  edge loops.

Hello maybe the 2 pipes are 2 different objects? In that case you need to join them in object mode with Ctrl J

See this post: Bridge edge loops - select at least two edge loops.

Best to use Blender's Spin tool to create something like that. Quick tutorial here.

yes it seems that they were two separate objects thats why. Now i was able to do it. And spin tool is great, I did with that, thanks John.

Please help me with this :( https://blender.stackexchange.com/q/313691/184148

You need to join the two pipes or you wont be able to bridge the edge loops

Once they are joined, you can bridge the edges and increase the strength and segments to make the joint. However with this method and the pipes being very close to each other, the topology isn't optimal as you can see at the angle the polygons stretch a lot

But you can easily make a cleaner pipe joint
First, add a cube, subdivide it two times, remove and extrude the bottom

then make a 45 degrees cut starting from the center point. You might need to change the angle constraint to get the knife to snap to 45 degrees. Then delete the top left part

Once thats done, duplicate in object mode, rotate by 180 degrees on the Z axis and delete the top part

then rotate the newly created part so it fits with the first part, join them and merge by distance

Add support loops and a subd modifier and thats it, you've got a clean 90 degrees pipe joint that you can use in any project

Very nice alternative, thanks. The topology looks better for sure... one question... how do you bring the pipes together in the beginning? Since snapping sucks in blender I had to move them manually so that they are close to each other, but they cannot be as good as perfect snap. Or were you able to snap them to touch at 90 degrees (before even joining them I mean) ?

@upstream the cylinders were 1M long and wide, so the grid snapping worked just fine. I'd advise you to lookup the new snapping tools that were added in 4.0, it made snapping much more efficient

I have 4.0 and I spent days on snapping but it just behaves as it pleases although  lets say i am trying to snap faces and i select face. For example, I tried to snap bottom face of a cone to top face of cylinder and even though i select center and face it is not doing it... go to my profile and see my previous question please.. not even the experienced users could do it. Can you do it? All I want is to snap bottom face of a cone to top face of cylinder, center to center.


text:
Snap cubes to each other
I am trying to snap the center of the face of the cube to the center of edge of the rectangular prism as shown in the picture but I cannot do it. Can you describe me how? Yes I know the magnet icon for snapping, and yes I know all those options near magnet icon there but which one ? Please describe in detail what mode, which is selected, how and where to grab, which key, which mouse click and its sequence etc. It has been 2 days and I just cannot do it, this is very frustrating. I tried every combination I believe. Watched several tutorials...  It just behaves as it pleases and snaps to funny locations when I try to grab with G and move it. Either snapping in blender needs significant improvements or I cannot do it - and I used several drawing programs before and never had issue with snapping.

you have to remember, that the origin point wants to snap to the target, so you first have to set the origin point of the moving object to the face.

select the face
shift-s -> selection to cursor
object mode -> set origin to cursor
snapping edge center
move it

ahh ok thanks a lot... finally... and just toi make sure. i first go to edit mode, select the face there, and then i move back to object mode right? so this cannot be done fully in object mode then, without setting the center to cursor like this? I mean i was able to do some other snapping in object mode without setting the origin of cube to cursor, but not this one. and if i do not set the cursor there, it seemed like it grabs wherever my mouse was, is it the case? so regardless, in any type of snapping, the proper way is to set origin to cursor like you did?

i think so, yes. Or you use lemon's answer, if you are using a newer Blender version.

In version 4.0, you can use B, while grabbing the mesh, to select the base point which will then be the point to place.
After that drag over the other mesh and validate the translation when the symbol indicating the edge center appaears:

The circle indicates face center, triangle edge center, square vertices.
4.0 release notes, for more information.

Are you in edit mode while doing this? Which options near magnet icon did you select? I had tried with B also 1000 times and could not do it. Do you press B twice? do you press G first and then grab and then B? They made all these as if we must perform actions like in mission impossible... Can you write in more detail if possible? I really appreciate

I cannot do as you do. Can you give more details step by step? which mode, what is selected for magnet options and then vertices, and then on the left side of screen between move select transform and then at what point we press all these. I lost 2 days trying to figure this out. just because some guys thought everyone was born with knowledge about what to click when. this is very counterintuitive and difficult.

This is new things in v4.0. You grab G, as usual. Then use B (still grabbing) and click on the element you want to place (here the face, indicated by a circle symbol). Then continue grabbing until you see the triangle symbol that indicates the edge center and at this step validate the grab.


text:
How to update image preview(icon)?
I have a UIList with a property that uses the preview icon of an image as its icon. It works, but it doesn't update, unless the icon is updated somewhere else first, i.e. in the texture paint slots or the Image Editor'' selector. Is there a way to make it update?
edit- I was told that image previews are updated when a dependency update is triggered on them. Does anyone know how to do this in Python?

I don't know if this will help, but it might. Good luck!

Well this isn't a UIList problem, its an icon update problem. I'm very familiar with that tutorial. Thanks a lot for responding though.

This is supported by the API. Giving a code-example that doesn't work properly would help here.

I can't give a code example that doesn't work because my code works. I don't have any code that says "when this image is changed, update its preview" because I don't know how. That is what the question is. If you know how, I would be grateful if you shared.

I would love to get an answer for that question too! :)


text:
Edges from Bones Script
Can anyone verify that this script works in 2.78?
import bpy
# ACTUAL FUNCTION THAT TURN BONES INTO EDGES
def boneToEdges(armature_name='metarig'):

   myRig = bpy.data.objects[armature_name]

   # which armature to work on
   #myRig = bpy.data.objects['Armature']
   #myRig = bpy.data.objects['metarig']

   # this actually return STRING NAME of bone
   boneNames = myRig.data.bones.keys()

   # the actual data to each
   myBones = myRig.data.bones

   for i, bone in enumerate(myBones):
       #print(bone.name, bone.vector)
       # every bone has HEAD and TAIL

       #loc = bone.vector
       head_loc = bone.head_local
       tail_loc = bone.tail_local

       createEdge(coord1 = head_loc, coord2 = tail_loc)
boneToEdges("MyArmature") # Change the name to your Armature Object Name.

Sources:
https://www.youtube.com/watch?v=qVVFO-Lw4XA&t=155s
http://blendersushi.blogspot.com.au/2013/06/python-skin-bone.html

It doesn't work as you have it posted, you're missing some code. I can confirm that this code works in 2.78:
import bpy
def createEdge(coord1 = (-1.0, 1.0, 0.0), coord2 = (-1.0, -1.0, 0.0)):

    Verts = [coord1, coord2]
    Edges = [[0,1]]

    profile_mesh = bpy.data.meshes.new("Edge_Profile_Data")
    profile_mesh.from_pydata(Verts, Edges, [])
    profile_mesh.update()

    profile_object = bpy.data.objects.new("Edge_Profile", profile_mesh)
    profile_object.data = profile_mesh

    scene = bpy.context.scene
    scene.objects.link(profile_object)
    profile_object.select = True

# ACTUAL FUNCTION THAT TURN BONES INTO EDGES
def boneToEdges(armature_name):
    myRig = bpy.data.objects[armature_name]

    # which armature to work on
    #myRig = bpy.data.objects['Armature']
    #myRig = bpy.data.objects['metarig']

    # this actually return STRING NAME of bone
    boneNames = myRig.data.bones.keys()

    # the actual data to each
    myBones = myRig.data.bones

    for i, bone in enumerate(myBones):
       #print(bone.name, bone.vector)
        # every bone has HEAD and TAIL

        #loc = bone.vector
        head_loc = bone.head_local
        tail_loc = bone.tail_local

        createEdge(coord1 = head_loc, coord2 = tail_loc)
boneToEdges("Armature") # Change the name to your Armature Object Name. "

Thanks Cmomoney! I figured I was doing something wrong. Works perfectly now. Cheers!


text:
Texture/Shading problem
I'm having the following problem;
Part is textured on a solid red using a basic image file, but as you see some parts show strange shading. Normals are ok and all faces turned out.
Any advice?

Can you attach your Blender .blend file with the problem mesh?  The simplest file which demonstrates the problem is desirable.  Small size file is  desirable.

It looks like normals issue alright, without a blend file it will be hard to diagnose.


text:
Converting light emitting objects from Cycles Render to Blender Render
After struggling a tiny bit with render durations on some low-lit Cycles scenes, I am trying to convert a Cycles render scene to a Blender internal scene and hopefully, get faster rendering times.
After switching the project to Blender Internal Render, I converted the neon lights that spell the word on the wall, by deleting the material and creating a new material. I increased the Emit value since the neon letters should illuminate the whole scene. And enabled Indirect Lighting in World panel, as well as set Gather to Approximate.
The result is somewhat strange:

1-There are strange artifacts around the emitting objects
2-The letters do not illuminate the scene as they used to in Cycles, unless the objects are mirror/reflection enabled (the bed and the hand are very dark)
3-the glow coming from the light objects only carries onto a small strip of the neighboring walls, which then become dark abruptly, instead of bathing the room in an ambient glow
This is the scene in Cycles, and what I would like the scene to look like (note how the whole room is filled with light yet the glow is soft and casts shadows):

I have looked online and here on SE for render engine conversion tips but couldn't find any...
Blend file:

I did some changes to your scene. The strange artefacts result from the high emit value and the curves themselves.

I adjusted emit value to 15 instead of 1000.
Give the curves some extrusion. No neon light is total flat, it has some depth. A value of 0.001 works great.
I added some ambient occlusion. A value of 0.008 makes the scene less dark but preserves the night mood...


text:
How would I change a Cycles material's color using the scale of the object instance it's applied to?
Basically I have a field of spheres that are a bunch of different sizes that use the same material and I want them to be a different color based on their size.

I'm using a volumetric shader, so each of those little clusters is one sphere.
I accomplished something similar to what I want by using the Object Info input node's position attribute. It looks like this. Unfortunately the Object Info node doesn't have a scale option. Is there a way to add that? Or perhaps some method using drivers? I'm still not very good with drivers so maybe I'm just missing something.
atomicbezierslinger has suggested a way to change the color of a particle based on its size, which is an interesting solution, and it worked well.

I'm not very experienced with particle systems, so I basically manually went through to each sphere and gave it it's own particle system that emits 1 particle from its volume and with no physics. I manually changed the size of each particle then shrunk the emitter sphere down to .01 so it would be in about the right spot. I'm feeling a bit like a monkey on a typewriter but it got the job done.
My problem is solved thanks toatomicbezierslinger, but I would still be interested in whether or not it's possible to not have to use particles to do this. I can't be the only person to have this problem and the method I used wasn't exactly fast.
Perhaps there's a way to use Object Index on the Object Info node by assigning an index to each sphere based on its size using a script of some sort? I don't know the first thing about python, so I wouldn't know.
I'm using blender v2.76b, by the way.

Can you show a image of your field so that we can see the quantity  and how easily particles might enter the picture?

You placed a link in my proposed answer below.  I suggest you add it to your question where all can see it more easily.

Haha my bad, I didn't get what you meant. I've added it now.

I wrote a simple data driven script below for  use with particles. Are these values changing dynamically over time? YN? Do the values come from a text string or file? Is this a single image or an sequence of images animation? Should the script position the object as well or not?

Size ratio from Texture coordinate (Object) comparison
Concept:
The idea is to compare the Object's texture coordinates type of each object with the ones of a "fixed" size object (e.g. an empty).
By dividing the corresponding values of each field, you'll get the same value for each surfaces's point, which is also the size's ratio between the considered object and the "fixed" one.

Node setup:
The shader is composed by two Texture coordinate nodes followed by a Color Mix node (set to Divide). Note that the node on top has the empty object as target.
The output of the math node is already the size ratio factor. It can be, for example, plugged into a Ramp node and then in the wanted shader type.

To achieve a usable shader, we should also get rid of the dependency from the object's position by taking advance of the Object info node.
The node tree used in the image sequence above result the following:

Note: similar implementation should follows to get rid of rotation's dipendency.

I think this should be the accepted answer, since it works for objects not in a particle system, which is more applicable to the question (and easier, in this case, than creating a particle system for every object - yikes!)

Yep. That looks like a pretty good solution. atomicbezierslinger's is what actually god my project done, but this looks like the best answer to the question. This community is awesome.

Cycles Sample 01

Cycles Sample 02

Consider a particle system and material shader nodes.
Use the particle info node size [relative scale] value.
Note the object particles with [size] set to 1 and [random size] set to 1 in the image below.

We assume that your placement of spheres can use a particle system.
Particles are emitted in 2 frames.  Of course with a more complex mesh particles can be placed anywhere.  There was no artistry in placement of the example I provided.  You can do better.
Below same Material with different Particles Settings. A more controlled placement with particles spaced evenly.

Here's the image of my field: link It's kinda hard to tell since they're all soft, but theres like 50 something data points, each with its own specific size. A particle system seems like a good choice, but is it possible to control exactly where each particle appears and what size it is?

Script/User Action Answer

Position and Particle Settings Scale determined from Python Script.
Rotation from Particles Settings via Script.  Color is maintained across rotation.

We have seen above you have attached a particle system to a plane.  I will show my settings later. You may also show yours.
User preferences allows you to duplicate object with fresh/unshared particle system.  So copying object will copy new particle system.  Script does not need to create particle system.  Script changes position of emitter object and scale of particle system.  Use at your own risk.  Standard Disclaimer.

User Steps

Make single particle system. Place in group for selection convenience.
Copy N times. Logarithmic steps if new selection is copied.
Place script below in editor. Select all objects created in step above. Run Script.

Notes

Use material in previous answer or your capable material.
Python can probably easily import/parse the original textual data into python list format. The original data format has not been posted by the OP.
Below we assume 3 coordinates [X,Y,Z] for your position.  Single scale value in the range [0.0, 1,0] for relative scale.
In the Python below you may need to normalize size by division by largest in list or largest possible size.
This is a simple script.  Many assumptions such as only using zeroth particle system.  Modify to your particular needs.

Script
import bpy
import datetime
import math

def place_scale():
    print("Place Scale")
    print(datetime.datetime.today())
    print(datetime.datetime.now())
    #your data is different, from processed file or other
    lc1 = [[[1,0,1], 0.50], [[2,0,2], 0.75], [[3,0,3], 0.10]]
    lc2 = [[[1,0,1], 1.00], [[1,0,2], 1.00], [[1,0,3], 1.00]]
    pos_scale = lc1
    so = bpy.context.selected_objects
    limit = min(len(pos_scale), len (so))
    for x in range(0,limit):
        so[x].location = pos_scale[x][0]
        so[x].particle_systems[0].settings.particle_size = pos_scale[x][1]
place_scale()

authors: webknjaz -- Слава Україні


text:
problem with sharp transitions between rotation keyframes
Maybe this question was asked in some other post, and if so feel free to direct me to it. But, help please :( .
For TLDR, skip to the 2nd to the last paragraph.
I have an animation project consisting of an object which is orbited (in a curvaceous way) by a first camera on a track. the track goes all around the object, as seen below (though it looks like a closed loop, it's actually a bezier curve that has a tiny opening). The first camera has a damped track constraint to an empty in the object. It also has a locked track constraint to an empty on another, nearly identical track above this track. The empty on the above track has almost the exact same movement and speed as the first camera. It is meant to keep the first camera pointing...I guess, up. (If the two tracks are identically aligned, it can be problematic at a couple points in the animation, triggering the camera to "snap rotate", but I'll treat this as another matter.)
Another camera copies the transforms of the first camera on the first track, and this "copy camera" is used by a Python script to insert VisualLocRot keyframes for the duration of the animation.
The script that uses the copy camera, before it finishes inserting each keyframe, does a "camera to view selected" on the subject being orbited, which fits the entire object to the vertical or horizontal edges of the camera view.
Problem is, I'm getting what I call "rotation artifacts", pictured below, in the F-curves. Just by looking at the selected keyframes, I can kind of tell what's happening, but I don't understand why Blender is doing it that way. (Why can't the curves keep going up or down, without breaking like that?) I don't know how to fix.
I hope to soon grasp all the algebra and trig I need to understand this problem better. Are quaternions my magical unicorn solution? Please let me know if I've done a bad job of explaining this, or if you need more info.

Sorry about the title. I forgot to fix that.

you can edit your question any time (or any post for that matter), just use the "edit" link below the question.

You might have tripped on "Gimbal Lock" problem with Euler. And yes Quaternions method let you avoid the "Gimbal Lock" issue. There is a very clear video about gimbal lock issue here ... https://www.youtube.com/watch?v=zc8b2Jo7mno&list=PLLJePYWucKoOm0NN3blOFqAlvL5Etyf6A

I suspect you are having the same problem I had in How do I ensure a sequence of quaternions from matrix.decompose() is continuous? .
It boils down to "q and -q both represent the same orientation".  Since you mention a "script", maybe you can modify your script to use the same logic as my QuaternionStabilizer class to figure out whether to keyframe q or -q.

After visiting your link, this looks like exactly the answer I need! I will look into this, though, it will take me some time to understand all of it. Thanks.

The Gimbal Lock ... maybe?
You might have tripped on "Gimbal Lock" problem with Euler. And yes Quaternions method let you avoid the "Gimbal Lock" issue. There is a very clear video about gimbal lock issue here ...
https://www.youtube.com/watch?v=zc8b2Jo7mno&list=PLLJePYWucKoOm0NN3blOFqAlvL5Etyf6A
Understanding the topic may help you avoid gimbal lock if you want to continue
using Euler solutions. To summarise what I have learn is that if your object is a camera, you can avoid Euler's gimbal lock with some good knowledge and learn how to avoid them. However if you are working of an object like a fighter jet that has radical rotation in your scene, it's best to apply Quaternions.


text:
How to align modal draw to the middle of the 3d viewport?
I have a question about the opengl modal draw :
How to align text from a modal draw to the middle of the viewport and and keep it automatic between Tool Shelf and Property Shelf, when i changing them?
I want to avoid that the property shelf overlapp the modal draw on the right viewport side, when i change the scale of left toolshelf.
Maybe there is a similar question always done?

You draw in the window type region of the space you are drawing text on (eg the 3d view).   The x, y, width and height attributes of the region take into account the tool / property bars.

If the text is generated dynamically, major issue is calculating the position based on the width to get it centered (IMHO). Probably related: https://blender.stackexchange.com/q/57709/31447

According to the API, Area.region collection holds all "regions of the screen area" as well as their dimensions. In case of the 3d Viewport: Header, Transform Panel and N-Panel.
The following code is based on this answer, extended with a simple calculation to get the correct position of the text in the 3d Viewport. Notice that you can also iterate through the collection and sum up the dimensions instead of doing that stepwise.

import bpy
import bgl
import blf

def draw_callback_px(self, context):

    bgl.glEnable(bgl.GL_BLEND)

    # ...api_current/bpy.types.Area.html?highlight=bpy.types.area
    header_height = context.area.regions[0].height # 26px
    npanel_width = context.area.regions[1].width
    transorm_panel_width = context.area.regions[3].width

    width = context.area.width - npanel_width - transorm_panel_width
    height = context.area.height + header_height

    # draw text
    text = "Hello World"
    font_id = 0  # XXX, need to find out how best to get this.
    bgl.glColor4f(*(1.0, 1.0, 1.0, 1))
    blf.size(font_id, 70, 72)
    dim_x = blf.dimensions(font_id, text)[0]/2
    dim_y = blf.dimensions(font_id, text)[1]
    blf.position(font_id, width/2-dim_x, height/2-dim_y, 0)
    blf.draw(font_id, text)

    # restore opengl defaults
    bgl.glLineWidth(1)
    bgl.glDisable(bgl.GL_BLEND)
    bgl.glColor4f(0.0, 0.0, 0.0, 1.0)

class ModalDrawOperator(bpy.types.Operator):
    """Draw a line with the mouse"""
    bl_idname = "view3d.modal_operator"
    bl_label = "Simple Modal View3D Operator"

    def modal(self, context, event):
        context.area.tag_redraw()

        if event.type in {'RIGHTMOUSE', 'ESC'}:
            bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
            return {'CANCELLED'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        if context.area.type == 'VIEW_3D':
            # the arguments we pass the the callback
            args = (self, context)
            # Add the region OpenGL drawing callback
            # draw in view space with 'POST_VIEW' and 'PRE_VIEW'
            self._handle = bpy.types.SpaceView3D.draw_handler_add(draw_callback_px, args, 'WINDOW', 'POST_PIXEL')
            context.window_manager.modal_handler_add(self)
            return {'RUNNING_MODAL'}
        else:
            self.report({'WARNING'}, "View3D not found, cannot run operator")
            return {'CANCELLED'}

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

def unregister():
    bpy.utils.unregister_class(ModalDrawOperator)

if __name__ == "__main__":
    register()

To display the text as well as allow the user to interact with the UI, you can change the return statement of the modal function from {'RUNNING_MODAL'} to {'PASS_THROUGH'}:
...

def modal(self, context, event):
    context.area.tag_redraw()

    if event.type in {'RIGHTMOUSE', 'ESC'}:
        bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
        return {'CANCELLED'}

    return {'PASS_THROUGH'}

...

Also see the API on Modal Execution: https://docs.blender.org/api/blender_python_api_current/bpy.types.Operator.html#modal-execution

Thank you!  That's really detailed.
Again briefly repeated:

total window minus tpanel minus npanel results is real area.
divided by 2 for the center point. >> minus lenght of the text divided also by 2

Great practice script.
Rewritten for 2.8.
Added descriptive functions in class for extensibility.
When switching to another tab, the descriptive text is removed.
# for blender 2.8

import bpy
import blf

class ModalDrawOperator(bpy.types.Operator):
    """Draw a line with the mouse"""
    bl_idname = "view3d.modal_operator"
    bl_label = "Simple Modal View3D Operator"

    font_info = {
        "font_id": 0,
        "handler": None,
                }

    def draw_callback_px(self, context, event):

        header_height = bpy.context.area.regions[0].height # 26px
        npanel_width = bpy.context.area.regions[3].width

        width = bpy.context.area.width - npanel_width
        height = bpy.context.area.height + header_height

        """Draw on the viewports"""
        # BLF drawing routine
        text = "Hello World"

        font_id = self.font_info["font_id"]
        blf.color(font_id, 0, 0.292, 1, 0.7)
        blf.size(font_id, 50, 72)
        dim_x = blf.dimensions(font_id, text)[0]/2
        dim_y = blf.dimensions(font_id, text)[1]
        blf.position(font_id, width/2-dim_x, height/2-dim_y, 0)
        blf.draw(font_id, text)

    def modal(self, context, event):
        # If overridden outside of the 3D view
        try:
            context.area.tag_redraw()
        except AttributeError:
            bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
            return {'CANCELLED'}
        # If there is no active 3D view
        if bpy.context.area.type !="VIEW_3D":
            bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
            return {'CANCELLED'}

        if event.type in {'RIGHTMOUSE', 'ESC'}:
            bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
            return {'CANCELLED'}

        #　All other operations are permitted.
        return {'PASS_THROUGH'}

    def invoke(self, context, event):
        if context.area.type == 'VIEW_3D':
            # the arguments we pass the the callback
            args = (self, context)
            # Add the region OpenGL drawing callback
            # draw in view space with 'POST_VIEW' and 'PRE_VIEW'
            self._handle = bpy.types.SpaceView3D.draw_handler_add(self.draw_callback_px, args, 'WINDOW', 'POST_PIXEL')
            context.window_manager.modal_handler_add(self)
            return {'RUNNING_MODAL'}
        else:
            self.report({'WARNING'}, "View3D not found, cannot run operator")
            return {'CANCELLED'}

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

def unregister():
    bpy.utils.unregister_class(ModalDrawOperator)

if __name__ == "__main__":
    register()


text:
How to add the layout.template_node_view into a Toolshelf Panel
I saw this toolshelf creation, and tried to figured out how he done that without copy all the code?
Without succeed!

Is there an easy way to do this?
layout.template_node_view(ntree, node, input)
layout.template_node_view(???)
Maybe someone could help?

That's easy. You can simply re-use the property, see: http://blender.stackexchange.com/questions/43953/copy-existing-property-from-e-g-properties-window-to-a-custom-panel/43956#43956

this works for the most simple settings, but for nodes it seem more complicated.

Voted for reopening :) Can you share what you tried so far? Can't test it at the moment, but re-using the shown code should work as expected. Don't see a difference (any issue) here, since thats how blenders interface is designed.

lamp = context.object.data     eg: row.prop(lamp, "type", expand=True) This is how i added the lamp setting  into my toolshelf panel.

Works as explained in the other post. Working example: https://gist.github.com/p2or/a6d9e757123f550255d5

@poor - what you copied from ui.py doesn't work with lamp objects and the use nodes button doesn't enable in the toolshelf. I think this example is as simple as you can make it to handle both lamp and material nodes.

@sambler You are totally right - thanks for helping out here and providing this more complete example. I really appreciate it.

@poor & sambler! Thank you for the fast help, this is really great! I hoped
to getting along with a few lines less, but after building my panel like in the Working example all works well. I thing this question is answered. Is there something i have to do now? I am new in blender.stackexchange...

@MKB You're welcome. No I think it's fine. I try to expand the linked answer to cover such cases too ;)


text:
Hair simulation freaking out
I have been working on a Polar Bear for a school for a while now and I have a full rigify rig and shape keys for facial expressions but whenever i go to simulate the hair it spazzes out and bake a ball of hair that is useless. I need help Quick!

I expect your issue comes from your particle children settings. Maybe a high brownian under physics. Can you add a screenshot of those. or share your blend file here

Here is the Link for the file.  I had to put it on google drive because the file was too large https://drive.google.com/file/d/0B2P6Uof8h1lAVmJEM1h0NEU2cE0/view

Looks like you managed to sort it out the messy part, for some reason the solidify modifier is causing the patchiness that you have.

I turned off brownian, children and removed the solidify modifier and the hair does not move it just stretches everywhere.  I simulated it with just the solidify modifier removed and the haid freaked out.

If I open your file, enable the hair particles and goto frame 62 I get this if I delete the solidify modifier I get this

If you only delete the solidify modifier, on frame 7 the hair is still messed up for me when i simulate the hair.

It is definitely hair dynamics, jumping ahead to a frame looks fine but playing through frame by frame goes mad. I think you should report it as a bug. For now try with hair dynamics off and see if the result is ok.


text:
Ball doesn't roll straight in Blender Game
I'm trying to create a simple golf putt game using the Blender Game Engine as depicted here:

The problem is that the ball doesn't roll straight. If I launch the ball at about 5 degrees left-of-center, I'd expect it to stay on that path until it hits the hole or falls off the board.  Instead it takes a curved "S"-shaped path, apparently affected by the wires that can be seen when rendering the board material as wire.
The problem goes away if I don't cut the hole in the board, apparently because the wires are not present.
Below is a complete script that reproduces the problem. I'm using Blender 2.76 on Mac OS X and running the script at startup using "./blender.app/Contents/MacOS/blender myscript.py".  The problem also occurs for other versions including 2.72, 2.73 and 2.75.
The .blend file resulting from the script below is available here:
https://www.dropbox.com/s/wvwulkjq16au3rw/ball_roll_problem_v276.blend?dl=0
Just press the spacebar after starting the game to launch the ball, and you should see that it follows an "S" path rather than rolling straight.
An updated .blend file with improved mesh is available here:
https://www.dropbox.com/s/vvyb7kkvtk11u3g/ball_roll_problem_v276_remeshed.blend?dl=0
The improved mesh helps the problem, but the ball still doesn't roll straight;  the wires surrounding the hole still cause it to follow an "S" path.
Is there a way I can get the ball to roll straight?
Any help would be most appreciated!
import bpy
import inspect
from math import radians

#(0) Initialize:
bpy.context.window.screen = bpy.data.screens['Game Logic']
scene      = bpy.data.scenes[0]
scene.render.engine = 'BLENDER_GAME'

#(1) Create a board using existing cube:
board          = bpy.data.objects['Cube']
board.name     = 'Board'
board.scale    = 2, 7, 0.1
board.location = 0, 0, -0.1
### cut a hole using boolean difference:
bpy.ops.mesh.primitive_cylinder_add( radius=0.4, location=(0,3,0) )
cylinder           = scene.objects[0]
modifier           = board.modifiers.new('hole_cutter', 'BOOLEAN')
modifier.object    = cylinder
modifier.operation = 'DIFFERENCE'
### apply the modifier:
bpy.ops.object.select_all(action='DESELECT')
bpy.context.scene.objects.active = board
bpy.ops.object.modifier_apply(apply_as='DATA', modifier="hole_cutter")
scene.objects.unlink(cylinder)

#(2) Add a ball:
bpy.ops.mesh.primitive_uv_sphere_add(size=0.1, location=(0, -6, 0.1))
ball       = scene.objects[0]
ball.name  = 'Ball'
### game settings:
ball.game.physics_type = 'RIGID_BODY'
ball.game.use_collision_bounds = True
ball.game.collision_margin = 0
ball.game.collision_bounds_type = 'SPHERE'
ball.game.mass         = 1
ball.game.radius       = 0.1
### game properties:
bpy.ops.object.game_property_new(type='BOOL', name='launched')
ball.game.properties['launched'].value = False
### add controller:
bpy.context.scene.objects.active = ball
bpy.ops.logic.sensor_add(type='ALWAYS')
bpy.ops.logic.controller_add(type='PYTHON')
sensor      = ball.game.sensors[-1]
controller  = ball.game.controllers[-1]
sensor.use_pulse_true_level = True
sensor.link(controller)
### add controller script:
def my_ball_controller():
    import bge
    scene       = bge.logic.getCurrentScene()
    ball        = scene.objects['Ball']
    SPACE_key   = bge.logic.KX_INPUT_ACTIVE == bge.logic.keyboard.events[ bge.events.SPACEKEY ]
    if SPACE_key and not ball['launched']:
        ball.applyForce((-30, 300, 0), 0)
        ball['launched'] = True
bpy.data.texts.new('my_ball_controller')
script          = bpy.data.texts['my_ball_controller']
controller.text = script
lines           = inspect.getsourcelines( my_ball_controller )[0]
for line in lines[1:]:
    script.write( line[1:] )

#(3) Set camera location:
camera  = bpy.data.objects['Camera']
camera.location       = (0, -12, 3)
camera.rotation_euler = (radians(70), 0, 0)
### set camera view:
for screen in bpy.data.screens[3:5]:
    for area in screen.areas:
        if area.type == 'VIEW_3D':
            for space in area.spaces:
                space.region_3d.view_perspective = 'CAMERA'

Hmmm, I ran the script with no issues. Strange.

I noticed that sometimes binary hole cutting yields material wires on the opposite side (the right side from the camera's perspective). I wonder if you've also tried launching the ball to the right using, for example:  "ball.applyForce( (+30, 300, 0), 0)" ?

The Game Engines API is bge. The Blender API is bpy. You better do not mix Blender API and BGE API in one piece of code. The Blender API will not be available when running the game outside of Blender. Object changing operations will not take effect during the game run. I suggest to offer a blend file download rather than a generator script.

Understood, I'll upload the .blend file momentarily...

As you have  noted the mesh is the issue , switch to wireframe view and launch the BGE to see how it get triangulated ( combined with some rounding errors ) it will cause the deviation of the ball.
To avoid that you have to add either a Subsurf modifier ( in simple mode ) or a Remesh modifier ( in sharp mode ) and apply it before adding the Boolean modifier this will limit the bad triangulation inside a small area ( all the mesh are triangulated when passed to the BGE)
#(1) Create a board using existing cube:
....
### add and apply subsurf
modifier           = board.modifiers.new('subsurf', 'SUBSURF')
modifier.levels    = 2
modifier.subdivision_type = 'SIMPLE'
bpy.ops.object.select_all(action='DESELECT')
bpy.context.scene.objects.active = board
bpy.ops.object.modifier_apply(apply_as='DATA', modifier="subsurf")

### cut a hole using boolean difference:
....

Thanks very much for the suggestion!  That certainly improves the mesh, but the ball still doesn't roll straight.  When it gets near the hole the wires still cause its path to deviate.  The updated .blend file is available here:  https://www.dropbox.com/s/vvyb7kkvtk11u3g/ball_roll_problem_v276_remeshed.blend?dl=0

@tdoe at the moment i think you should find a better way for creating the board experiment with higher subdivision levels or try other methods

Are there any methods in particular you would recommend?  I've tried triangular mesh collision bounds, for example, but the problem is even worse:  ball roll is strongly affected by the mesh.


text:
Detail lost when cycles baking to texture
I've been working on a model lately, and UV unwrapped and textured my mesh. After doing so, I added some dirty vertex colors to add some darker areas, and I wanted to bake it onto my regular texture. The problem is, that I lose vertex colors after baking.
Here's a picture or my rendered mesh with vertex colors, full detail:

As you can see, there are dark crevices throughout the model, which is desired. I've followed the directions in this post to bake the dirty vertex colors onto my texture. Here's the baked texture, when using type "Diffuse Color":

The largest sphere is where the body is mapped to. The texture, after baking, does not have sa many dark spots as the first image. It's apparent when I export it to Three.js with the texture:

As you can see, the whole back part of the mesh has no vertex colors. Why is that so? I have followed the directions exactly as in the post linked. Here are the applicable files:

stage1.png - FileDropper
stage1_REV.png - FileDropper

Please, pack your textures to blend file and upload .blend here  http://blend-exchange.giantcowfilms.com/  This is service for this forum and there are some reasons why should be used. :-) About your issue: 1: maybe low texture resolution, or 2: wrong unwraped - too stretched UVs. Upload your .blend here and I look at it :-)

@Shubol3D I was unaware of the service, thanks! I've edited the post.

You need to unwrap the torso with the seam on the bottom to have more even texture space distribution, right now the back part has a very low texture resolution comparing to the front.

@Denis Thanks for your response, I agree. The problem is that when I unwrap it takes a lot of time to space everything out and orient them. Would I have to completely create a new texture? Also, the seam does not seem to be unwrapping properly, download the new version here with new seam.

@AndrewLi the seam should be on the bottom from the head to the tail, also before unwrapping select all the uvs and use alt+p to unpin the vertices

To fix your problem you need to make a better texture distribution of the UVMap.
Easy way to do that is to create an additional UVMap with a seam going from the head to the tail on the bottom of the model.
Then select all UV islands, unpin the vertices using Alt+P while the mouse cursor is in the UV/Image editor window, and unwrap the model.
Make sure that the object, the new UVMap and the bake texture node are selected and bake the model.

The result:

By the looks of it, this yields the cleanest result. So just mark a seam at the very middle bottom of the mesh? Is there any quicker way to mark such a seam?

@AndrewLi yes and you can remove the seams where the spots are and unwrap in the new UV map.

So I'd have to one by one select the edges at the bottom? Seems a bit time consuming, how did you do it?

@AndrewLi Select one edge at one end then hold CTRL and select an edge at the other end.

It seems that unwrapping isn't quite desired. Since the file is now too large to upload, I'll take some screenshots: here and here. Not sure if I 'unpinned the vertices' correctly.

@AndrewLi The seams are good but you didnt unpin, because the vertices show red in UVs, make sure that the mouse cursor is in the UV/Image editor while you are unpinning.

Your problem is that your UVs in their present state are really bad for baking. This may seem to work for your other texture, but the UVs are heavily distorted in the main body area where you noticed the issue.

You can use "Smart UV Project" to get a decent set of baking UVs so that you don't need to waste time on it (make it a new UV so as not to overwrite the old one).

Here is a quick bake and the results in texture mode:


text:
Boolean intersect with plane makes object disappear
I'ts been 10 hours of researching, watching tutorials, trial and error and yet i still cannot figure this out.
I have 2 planes, one being my water for my city and the other being the ground. I'm trying to intersect the water with the ground so it will make a little divot like in the image below but every time I do that the mesh disappears or it won't allow me to even intersect it with the Bboolean modifier.
I tried Ctrl+N, removing doubles, making the ground a cube instead of a plane and yet none of these work.
I'll upload the file below but this is just the current lake I've tried out of the 200 other attempts.
The tutorial I'm following is this https://www.youtube.com/watch?v=i4ySFm4ey9U&list=LLZKTEq5R9PWrJvExEVHgTFg&index=5
At 55:36 mark is where I'm stuck.
If anyone could help it would be very appreciated thank you for your time :)

I'm sorry I will for future posts, just frustrated that I sitl haven't figured this out

You can't intersect with planes, Boolean operations require closed manifold shapes to be able to work, water planes have no volume just a single "sheet" and thus can't be used in a Boolean operation. Try adding some volume by extruding it so an intersection boundary can be found


text:
How do I delete an object? (Like a cylinder)
I have looked through a few posts on deleting objects (namely How do I delete an object by Yppie), but they wont work for me.
How do I delete an object?
I have a cylinder that I accidentally created. Normally, I would work it into the character or setting, but I cant seem to find a place to put it. (Except the nose, but I'm creating the legs right now so it will take a while.) So how do I delete it?

Please clarify what didn't work for you with deleting. It's hard to understand what does second paragraph have to do with problem of deleting an object. Delete object in the mode appropriate for you; if you'd like to delete part of mesh, select and delete in Edit mode; if whole object - in Object mode.

Objects are base entities, if you use the term 'object' it means you are in object mode. If you want to delete parts of an object that you added in edit mode then you are talking about the 'mesh'. There are many commands for selecting parts of a mesh that you want to delete, just try the 'select' menu and see what it has to offer, most useful in your case is 'select linked', then you delete it with X.

Adding a mesh is fraught with danger! Depending upon the active mode, Blender allows you to add a mesh as its own object in object mode, or in edit mode to add the same mesh as part of another object. If a mesh is added in object mode, there are ate least two ways to delete it: find the object in the outliner window, select it, and using the context menu, delete it, or select the object in the 3D viewport, and delete it there using one of the means to delete objects in the 3D viewport.
On the other hand, if the mesh was added in edit mode by mistake, it is a bit harder. Then you have to select the object, click into edit mode, select an element of the mesh you want to delete, either a vertex, edge, or face, expand the selection to the whole of the mesh (one way is by pressing the key combination CTRL-L), and deleting the selected vertices.
One other factor to complicate matters further: if you added an a mesh in object mode, and delete the vertices in edit mode as described above, you delete the vertices, but not the object, so in object mode you will still see the object's location, even though if there are no vertices to form a mesh.


text:
How to use .txt with 3D coords in BVH?
I have 3D coords from a hand mocap , the coords are (x,y,z), there are in a .txt list with 3 cols and each row represents a point. How can I transform them to BVH format? Any script, web, video or reference is welcoming. Thank u.


text:
Bounding Box with Python
I wish to obtain the Axis-aligned minimum Bounding Box (AABB) coords from a selected object, or from each object of a collection with a python script. Any references are very apreciated. Thank you.

Hi, Conspiques.. this does seem very likely to be a duplicate question. If the linked answers don't work for you, by all means edit to explain why, and we can re-open for you.


text:
How to continue smoothing after subdivision surface is already applied
Can you tell me how can I get rid of the bumps and dents and make the object in the picture smoother and look closer to sphere at the top and on the sides (like a light bulb)? I already applied subdivision surface modifier but it does nothing to get rid of the bigger bumps and dents. . I made this by first applying subdivision surface modifier to a cube and then scaling up the upper parts and scaling down lower parts. This is what i get but I want to make it look better without bumps and dents

The topology of a cube after a subdivision has been applied is still a cube, just with more geometry and in a rounder shape. If you want the shape at the top to be rounder you have a few options, just bear in mind that you can only push the existing cube geometry so far into the shape of a sphere.
Smooth vertices

Smooth vertices and laplacian smooth  are in the vertex menu of edit mode. They will relax the geometry a bit and make faces more even.
To Sphere

To Sphere will take a selection and push it into a sphere. You can combine this with a smooth vertices to further tame the geo.
Combine a sphere
You can also add a UV sphere (matching the number of vertices around the sphere and your mesh), by deleting the top of your mesh and the bottom of your sphere and using bridge edge loops you can connect the two sections.

The benefit of this method is it doesn't require you to do any repairs to the existing mesh.

thanks a lot. smooth vertices worked to a great extent (I'd say 75%), although not complete. A few questions based on your answer. 1)Laplacian smooth did nothing. Why it might be? 2) When I said transform to sphere, a big thick black circle appeared on my screen . When I moved my mouse it only greatly distorted my geometry. So I didnt do it. What is that big black sphere I have no idea. 3) I added a sphere but how can I match the number of vertices of that sphere and my existing mesh?

Since the whole of your object seems to be based on circular shapes, why didn't you start modelling with a UV Sphere instead of a cube in the first place?

Laplacian smooth has an iterations parameter, you might need to balance the effects strength and iterations.
To sphere can be quite agressive, especially with a high dpi mouse. You can click to apply it and then drag the strength of the operator to fine tune it.
To match the vertices just count the selection (there's a setting in the interface pane which had scene data, it'll tell you how many vertices you have selected too).
Definitely worth considering John's point, you could extrude a square section out of a UV sphere instead of the other way around.


text:
how to bring a part towards an edge loop
The two separate pieces in the picture were actually a single piece. Then I removed a section and there you see the gap between two sections. So they are already aligned and have same number of edges.
I want to bring the whole section on the right towards left and join to the piece on the left by joining their edges. Again, not just move the edge. Bring the whole piece on the right to join to the piece on the left and join by edges. How?

For blender 4.0 + :
First, select the right part, press G, then B to set a snap point

choose any vertex on the side loop, and move it towards the oposite vertex. It should snap the piece in the correct position

Then select the whole model and merge by distance

For previous versions of blender:
Enable Snapping (or press CTRL while editing), set the "Snap To" mode to vertex and the "Snap With" to active (in this case the closest mode would have worked too), then select a vertex on the side loop of the object on the right and move it towards the left piece. Select everything and merge by distance

thanks it works. But after snapping the right piece to left piece, why do I still need to merge by distance? I already have what I want

also it seems B is shortcut for something called box select. but now it worked as snap. and I looked shortcut for snap and it is something else. confused a little here. what is B for. i mean obviously it allowed me to snap here but it is not listed as shortcut for snap. confused

@upstream Alex used B as an option with active Move tool (G). B is Box Select while not using another tool. And the Merge by Distance because right now the vertices of the left and right piece are just laying together in the same location, they are not connected (unless you had the Auto Merge option enabled). If the pure visual connection is enough for you okay, for any further operations which depend on a single connected edge, you will get more issues.

thanks. if we wanted to do this grab and then snap by menu how would we do it? also, i lost track of where i joined them. how can i find those double edge loops on each other where I joined them, and make them one?

You cannot select options from the menu while you are actively operating a tool. It's like holding Shift to move something slower - it cannot be chosen beforehand in a menu. It's a contextual tool option. For the edge loops: just select all with A and then M to merge. Assuming you do not have a mesh full of areas with duplicate geometry it will only merge you've put together (and even if there were lots of other duplicate vertices it's probably better to have them all merged).

You could also select the two edge loops, press Ctrl + E then choose Bridge Edge Loops, and then scale X (or which axis you are on) to 0.
Make sure you have Auto-Merge on, so it only becomes one edge loop.

The OP wants to move the whole object to the other one.

how can i turn auto merge on. where. and you are aware that I do not just want to bridge the gap, but move the whole piece as I stated in my question?


text:
How do i fix this seam on the neck?
Found a Briar .obj and wanted to rig it. I am having this issue where after parenting to the rig, the neck and the head don't want to work as seen in the image. I am pretty sure it has something to do with the fact that the head and body are separate meshes, however joining them (ctrl+j) yields no difference.
I imagine I would have to join the vertices, but I can't find a way too.

Your suspicion may be correct.  I often have problems with parenting several separate objects to an armature, when animation shows the jagged edges.   I have to not only join the objects, but also go through a tedious exercise (in edit mode) of creating new faces around the edges of the nearby meshes and doing "Vertex >> new Edge/face from Vertices".  You might be able to 1) Select Non-Manifold then 2) Mesh >> Merge by Distance, if lucky

@james_t After joining the head and the neck (ctrl+j) the vertices around the head and the neck are non manifold however they overlap onto each other. I was able to fix this by using merge by distance however i first had to increase the range of it from 0.00001 to 0.0001. This joined the vertices and fixed the seam.

This is an issue of two meshes not being connect by vertices i.e. non-manifold.

(ctrl+J) this joins the two meshes into one.
Go into edit mode
(Select>>All By Attribute>> Non-Manifold) This selects all non-manifold geometry
Deselect unwanted geometry. This is easy if you go into wireframe mode and use (B+MMB) to deselect it.
Click M to open Merge Menu
select "Merge By Distance"

This should fix your problem if the vertices are close enough, however likely they are not and you will see "Removed 0 Vertice(s)". This can be fixed by opening the Merge Menu that appears at the bottom left. Simply increase the distance scale until  you see it remove more than 0 vertices

This should now have joined the non-manifold vertices and the mesh should now not have a seam in it.