text:
Rendering to Texture with bgl in Python
Is it possible to render a shader generated Texture in Blender Python with a shader ?
That's what I have so far:
    texIDinput = inputTex.gl_load()
    texIDweights = NetData.mWeights.gl_load()

    # 50% alpha, 2 pixel width line
    bgl.glEnable(bgl.GL_BLEND)
    bgl.glColor4f(0.0, 0.0, 0.0, 1.0)
    bgl.glLineWidth(2)

    bgl.glBegin(bgl.GL_LINE_STRIP)                  # begin a vertex data list
    bgl.glVertex2i(0, 0)
    bgl.glVertex2i(255, 255)
    bgl.glVertex2i(0, 255)
    bgl.glEnd()

    bgl.glCopyTexImage2D(texIDweights, 0, bgl.GL_RGBA, 0, 0, NetData.size, NetData.size, 0)

    NetData.mWeights.update()

But I dont get Lines on my Texture after running the Script ?

I am not an openGL expert. The documentation links to OpenGL 2.1. I don't think this version supports render to texture.
import bpy
import bgl

viewport_info = bgl.Buffer(bgl.GL_INT, 4)
bgl.glGetIntegerv(bgl.GL_VIEWPORT, viewport_info)

WIDTH  = 400
HEIGHT = 400

img = bpy.data.images.get("texture")
img.gl_load(0, bgl.GL_NEAREST, bgl.GL_NEAREST)
tex = img.bindcode

out = bpy.data.images.new("output", WIDTH, HEIGHT)
buffer = bgl.Buffer(bgl.GL_FLOAT, WIDTH * HEIGHT * 4)

bgl.glDisable(bgl.GL_SCISSOR_TEST)
bgl.glViewport(0, 0, HEIGHT, WIDTH)

bgl.glMatrixMode(bgl.GL_MODELVIEW)
bgl.glPushMatrix()
bgl.glLoadIdentity()

bgl.glMatrixMode(bgl.GL_PROJECTION)
bgl.glPushMatrix()
bgl.glLoadIdentity()
bgl.gluOrtho2D(0, 1, 0, 1)

bgl.glClearDepth(1.0)
bgl.glClearColor(0.0, 0.0, 0.0, 0.0)
bgl.glClear(
    bgl.GL_COLOR_BUFFER_BIT |
    bgl.GL_DEPTH_BUFFER_BIT
)

bgl.glEnable(bgl.GL_TEXTURE_2D)
bgl.glBindTexture(bgl.GL_TEXTURE_2D, tex)

bgl.glBegin(bgl.GL_TRIANGLES)

bgl.glColor3f(1.0, 1.0, 1.0)
bgl.glTexCoord2f(0.0, 0.0)
bgl.glVertex2f(0.0, 0.0)
bgl.glTexCoord2f(1.0, 0.0)
bgl.glVertex2f(1.0, 0.0)
bgl.glTexCoord2f(1.0, 1.0)
bgl.glVertex2f(1.0, 1.0)

bgl.glEnd()

bgl.glCopyTexImage2D(
    bgl.GL_TEXTURE_2D, #target
    0, #level
    bgl.GL_RGBA, #internalformat
    0, #x
    0, #y
    WIDTH,
    HEIGHT,
    0 #border
)

bgl.glBegin(bgl.GL_QUADS)

bgl.glColor3f(1.0, 1.0, 1.0)
bgl.glTexCoord2f(0.0, 0.0)
bgl.glVertex2f(0.0, 0.5)
bgl.glTexCoord2f(1.0, 0.0)
bgl.glVertex2f(0.5, 0.5)
bgl.glTexCoord2f(1.0, 1.0)
bgl.glVertex2f(0.5, 1.0)
bgl.glTexCoord2f(0.0, 1.0)
bgl.glVertex2f(0.0, 1.0)

bgl.glEnd()

bgl.glFinish()
#bgl.glGetTexImage(bgl.GL_TEXTURE_2D, 0, bgl.GL_RGBA, bgl.GL_FLOAT, buffer)
bgl.glReadPixels(0, 0, WIDTH, HEIGHT , bgl.GL_RGBA, bgl.GL_FLOAT, buffer)
out.pixels = buffer[:]
img.gl_free()

#reset
bgl.glEnable(bgl.GL_SCISSOR_TEST)

#necessary(?)
bgl.glViewport(*tuple(viewport_info))

bgl.glMatrixMode(bgl.GL_MODELVIEW)
bgl.glPopMatrix()
bgl.glMatrixMode(bgl.GL_PROJECTION)
bgl.glPopMatrix()

Result

is it possible to render to an fbo ?

glreadPixels is damn slow i thought ?

expanded the example using bgl.glCopyTexImage2D


text:
two gpu's, how to differentiate them in system settings pull down menu?
I have two identical gpu's.  When opening the compute device menu in system settings, there are two identical entries.  I'd like to select the one that isn't being used - is there a way to do this?

source: Stack Exchange

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

sort: votes


text:
turn 'only render' on, play animation, turn 'only render' off when done playing
I'd like to set up a python script that will

turn 'show only render' on
play animation
then upon stopping (or
esc), stop the animation and turn 'show only render' off.

Ideally this would work for viewport playback and play blast...
The first two are easy, but I can't figure out how to get 'show only render' to turn off after stopping the animation. Any ideas, suggestions... ?

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


text:
Textures go missing when I set new scene
I have a game menu scene, and when I press start I set the new scene to be the main scene.
Problem is, most textures disappear leaving a light purple color behind them (not the default one for missing textures), like this:
In this image for example the ceiling has a texture. What am I missing? It works normally till I set the scene.

Make sure you're set to GLSL

Thanks Vincent. Although this one was set to GLSL the previous scene was to multitexture.

Viewport Shading
I think your starting scene is set to "Solid". Ensure it is set "Texture" or "Material".

Render tab shading
One scene might use Shading mode "Multitexture", while the other uses "GLSL". Ensure to use the same mode for all of you scenes.

Yeah the game-menu scene was set to multitexture and it changed the glsl to multitexture too, when set. Thanks.

hey monster, if someone posts the correct answer in the comments, we usually wait for them to answer for 24 hours. if they don't then it's free game.

This answer was aiming for Shading Mode (the Render tab mode was discovered while reproducing the situation). I'm not sure if I saw your comment at that time, sorry. --- I suggest to post answers as answer (Yes, I do not do this all the time either :D ).

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


text:
Image textures on planes are distorted
I added a texture to a plane.
When rendered, the texture on the plane is all distorted.

I'd like for the texture to fit nicely on the plane.
In case I haven't submitted enough information (i.e. properties on the texture or plane), please comment, and I'll edit my post right away.

how did you assign this textures , did you unwrap the objects?

@Chebhou, I don't quite know what you mean by that (I am new to Blender). I had the plane selected, went to the "Texture" inspector, made the type "Image or Movie" right above the "Preview" sub-inspector, and set the image in the "Image" sub-inspector.

you have added the texture but you need tell blender how to position it on the object , and there are many ways for that

check this answer http://blender.stackexchange.com/questions/23173/what-methods-can-be-used-to-place-a-texture-onto-an-object/23174#23174

Looks like that rather than using UV coordinate mapping, use generated.

to


text:
Blender 3D - Movie Frames around an arc
I'd like to create an animation in which several movie segments are playing in separate plane objects that follow one another around an arc within the camera view. I can get a single movie playing on a plane object but I'm not sure how to get the plane to not only move along the arc but also rotate so that the plane faces the camera through out the movement. I will be having the objects moving only through a 1/4 circle.
Thanks!

Are you wanting the plane objects to follow a path? Am I understanding you correctly?

An object can be animated along a path by Follow path Constrained to set its orientation toward the camera you need also a Track To Constrained

The duration of the animation can be controlled in the curves settings:


text:
Can't change my object duration on timeline
Total noob question, but how do I change the duration (in/out point) as to where it cuts in and out (appears) on the timeline.

You may use a Dope Sheet Editor (https://www.blender.org/manual/editors/dope_sheet/dope_sheet.html).

First go to the Timeline window.
There you can define your rendering and playback range by choosing your start frame and end frame:

In order to adjust your keyframes
open the Dope Sheet window:

Press A to deselect all keyframes
Press B to border select the keyframes you want to adjust
Press G to move the selected keyframes to the desired position


text:
Rigging problems afoot
I'm totally a rigging noob, so I followed this quick and easy tutorial to rig my cartoony 3D model, and it was all peaches and cream for now, until i parented the model with the armature. The feet twist unnaturally just by connecting the armature, without even moving the mesh. Everything else seems just fine, as far as movement and weighting goes, but the feet! I took a few screenshots before and after connecting the armatures together, and I really want to get this fixed. I tried adding loop edges, resizing, adjusting the position of the foot armatures, nothing is working. I also read about Ctrl+a -> Scale, which I tried, and its not fixing the problem either. I don't know what else to do. I don't want to be a rigging nooblet forever!
Will I have to remake the mesh or the armature at all?[![][1]Before rigging][1]
After rigging

Nevermind, fixed it! I checked the bones again after I checked another thread and fixed the bones' rotatopn to 0 (it was set to values like 90, and 177.23 or so) and it realigned the feet. I must have rotated them while building the armature by accident.

Nevermind, fixed it! I checked the bones again after I checked another thread and fixed the bones' rotatopn to 0 (it was set to values like 90, and 177.23 or so) and it realigned the feet. I must have rotated them while building the armature by accident.
(how do I mark this as Answered...?)


text:
Unable to use inflate tool
Trying to use the inflate tool on a mesh in sculpt mode. However, I am unable to make any noticeable change on the object and cannot drag my brush over it. All other sculpt tools work as expected, but I notice that the outline of my brush is grayed out, whereas the brush has either a pink or yellow outline when using other tools. My object has plenty of subdivisions so I don't think that's the problem.

Would it be fine if you attached the .blend file. So we could examine the curious behavior of your file? http://blend-exchange.giantcowfilms.com/

Check that you have a strength value for the brush, a zero strength will do nothing. A strong autosmooth with a low strength can also negate the effect of some brushes.

Each brush can be set to use a different colour to outline the brush, by default inflate uses a grey while other brushes use red, green or yellow.

I had accidentally changed the stroke method to one I wasn't used to, which made using the tool confusing. (Yeah, the outline color didn't have anything to do with it) Thanks all for your help in narrowing down the solution!

I just had this problem and it was because of the brush settings:

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


text:
Reducing noise in interior Scenes caused by many lights using Cycles
As mentioned in the title of this post I am just struggling with the noise in my render result. I am not talking about fireflies, I am talking about actual noise.
I read a lot about how to improve the result by increasing the amount of samples and stuff, but for the following result I already sampled the image 2500 times.

As you can see, the scene is quite simple. I modelled a room with multiple spotlights in the ceiling.

In full resolution I have a lot of noise in the darker areas, even after 2500 samples.
The target of the project is to make 3-5 sec camera animations, that lead from one hot spot in one room to another (the showroom isn't finished yet btw).
This image took me about 12 minutes to render on renderstreet. And regarding the finished project, it would take me about 74 hours to render only one animation with this noisy result.
So my question is, how can I get a cleaner result with less samples, so it will render faster?
I added my .blend file for you to download. I deleted the glass stuff in the middle of the room because I want my client to be anonymous).
http://www.file-upload.net/download-9405390/main.blend.html
Thanks in advance!
-Marten

possible duplicate of How to avoid noisy renders in Cycles?

@RayMairlot I know that post, but as I said I am not looking for the answer to simply increase the number of samples. I already had a total amount of 2500 samples per pixel wich is pretty much I guess. Even though everything above doesn't really improve the result anymore, its just pushing pixels arround but not making it smooth.

Try these https://www.youtube.com/watch?v=kE7kh5WdE3k , http://wiki.blender.org/index.php/Dev:2.6/Source/Render/Cycles/ReducingNoise and http://www.blenderguru.com/articles/7-ways-get-rid-fireflies/#.U_SSn_ldVRo

@someonewithpc Yeah I know most of the tricks, such as activating "no caustics" and and "clamping". I guess my problem might be the small light sources. The light in the scene is only emitted by the holes in the ceiling plus additional spotlights at the same position for each hole. I will give a shot at the first video you mentioned. Maybe I can fix my noises with his compositing solution.

Perhaps change the title to "Reducing noise in interiors caused by many lights" to avoid this question being closed.

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

@gandalf3 actually its not related to what you posted since i don't use glasses surrounding my emitting meshes.

I had a go at optimizing it, and got this image rendered in 16:53 on my CPU (quad core xeon) with 100 samples. It's not great, considering the resolution and the denoising which may be unstable in animation (I haven't tested it), but hopefully it'll give you some ideas..  If nothing is moving except the camera in the animation, then you can also try baking any shading which isn't dependent on the camera angle (e.i. diffuse). If possible, cutting back on the number of lamps will also help. .blend.

In your example render the lighting is so even you might want to consider relying almost entirely on AO, and just using a few lamps in the sockets next to the pictures etc.

@gandalf3 first thanks for your effort, it's much appreciated! In the meanwhile i also found this awesome noise reducing node group, it does a great job and also saves me some extra samples. I didn't try it on animations yet, but i hope it works otherwise I can't make use of it in this case:/. With the glass/glossy materials you mean the small windows infront of the pictures right? Well that seems to be legit, I misunderstood that.

@gandalf3 btw, what do you mean with just using ambient occlusion to light the scene? you mean setting light paths to direct light and activate ambient occlusion?

@SlimMarten That could work to, but I meant only using a few lamps in places near the pictures, where they are aimed at the wall. The main thing which I think is hurting performance here is the number of lamps..

Did you find any solution to your problem? I have a similar problem...

@MaxKielland Hey dude, I actually did! I am just in a hurry so I will write a response later. For now I can tell you, my solution is "linear workflow" .. I will write down more details later, but you can already google it, it's kinda hard to understand and it takes some time until, you realize how it actually works..

Thank you, I googled it and there are a lot of material to read on the subject. I managed to fix the most of my problems but still have some noise in glass materials with a light behind them.

@MaxKielland what kind of light to you have behind it? ..Glass materials need much more smaples to render clearly than normal diffuse materials. Maybe try increasing your samples for glass.

If the lighting is going to be static, you can consider baking all the light and texture information into a texture, and then just run the camera through it.

I guess, that you know most of the common tricks. But here are some tricks that I often use:

Make a hole into the building outside of the cameras view of field
Increase the resolution, decrease the sample rate and resize the image afterwards. This will make the image softer, but if you double the image size, and render with a low sample rate and resize the image afterwards, the noise is evened out (I was able to render an interior architectural scene with only 5 samples)
Enable a small amount of global illumination and increase the shadows afterwards with the Compositor

Increasing the resolution works fine for noise problems, but also has some downsides: the render will take much more memory and might be slower in total. A picture at 200% render size may take 1/4th of the samples, but more than 4x the time to render.

Did you bake your lighting? If the only thing that is moving is camera and not the lighting or the objects, you can bake all of that data to textures, apply them to each object and you can practically render and view your scene in realtime.

Welcome to the site :) Here we like detailed answers which explain how to do things in addition to general tips. If you don't wish to spend time on a slightly more in-depth answer right now, you might consider putting general pointers in the comment section (once you have enough reputation)


text:
Correct skinning is still not deforming my mesh
I just skinned a small model and ran into a little problem with that. I skinned with vertex groups, so I applied all vertices that should be deformed by a certain bone to the vertex group "cube_bone". The bone has the same name of course.
When I look in weight paint mode now, everything looks like its supposed to:

When I now want to try a pose, this is what happens:

Actually its correct that the blue spheres are moving, since they are controlled by the childreen of the bone I am trying to skin. But what is wrong with the "cube_bone" ? Or why do the vertices not move at all?
I also found out, at the "Vertex Weight" Toolbar under "deform" there is no bone applied, only under "all".
On the other working bones, the bone is also listed under the "deform" tab

Looks like your bone has the "deform" option unchecked

yes, fixed it... kinda feel dumb now, thank you! :D

I know that feeling :)


text:
Blender Internal: How do I add motion blur?
just wondering where to enable motion blur in the blender internal render engine.
It's supposed to be in the render settings called "sampled motion blur" but I can't find it.
I am using Blender 2.74
Download demo-file here.

It should be right there.. Have you tried reloading factory settings?

@gandalf3 not yet, how do I do that?

Info (near the top of the window by default) > File > Load Factory Settings

@gandalf3 okay, I found out when I make a new file or reload the factory settings Sampled motion blur returns to my render settings.
Somehow this problem is connected with the file I am working with. Do you have any idea ?

That's strange.. Is it possible you could upload the file in question?

@gandalf3 actually not :/ its an unreleased customer project I can't share... I know its hard to figure it out without file, but my hands are tied.

What if you delete all the objects etc? If the problem persists, could you upload it then?

@gandalf3 good idea. I killed all objects. problem still present. I attached the file in my question.

Hm.. That really is strange. If I had to guess, perhaps a bug in an addon or something caused it to disappear at one point, and then that was saved in the file. To fix it, you could append everything into a new file. A bit of a clumsy solution, but perhaps easier than setting the motion blur settings through the python console.

@gandalf3 yep, you just described my worst case scenario since the scene has a lot of linked proxies in it and I can't easily append everything from the corrupted file. Seems like I have to deal with it.

Sampled motion blur is not available in Blender internal when the Full Sample option is enabled in Anti-Aliasing.
The solution is to turn off Full Sample.


text:
Materials from Blender to Three.JS: Colors seem to be different
I am just working on a bigger WebGL project, using the three.js framework. I am also using Blender as my 3D Software and the latest version of the three.js blender exporter.

While developing I noticed, that colors seem to be slightly different from the colors I picked in Blender.

I started tweaking colors via code and when I told the purple material at the straw for example to be the hexcode from Blender (#9081E7), this is what my webgl result looks like:

I think it's safe to say that the result looks more like the colors from Blender.
Now my question is: why is this happening? And how can I fix it, without telling every single material to have a specific hexcode?
I looked into my straw.json file and noticed that the three.js exporter is exporting colors in rgb values like so:
"colorDiffuse": [0.278894,0.219526,0.799103]

Is it possible that the engine rounds these values what causes the difference in color?
Thanks in advance

this is color management issue look for similar questions here

@Chebhou do you have a link?

sorry no but just a search http://blender.stackexchange.com/search?q=color+management

@Chebhou hm... I can't find any post on color managment related to three.js

not to three.js  exactly but with the way blender treat the color if that make sense , see this http://blender.stackexchange.com/questions/28284/colour-shift-when-viewing-render-outside-of-blender

@Chebhou I don't know dude. I have been messing arround with blender and a linear workflow a few month ago. the result was, blender already comes with a linear workflow (since 2.5 I think). I read the post you linked and tried to recreate his problem. I rendered an image of my scene and saved it as .tif. When I open the TIF in Photoshop, colors are the same as in Blender. Everything looks good so far.

you have to wait for the more experienced users

(notice also the webgl lacks shadows..another hint that this might be more related to lighting) -- I think the rounding of rgb is unlikely to cause dramatic differences

@zeffii Yes I have scene lightning. I am using a sun-light from the left, ambient light and hemi light form the back. Since hemi-light downgrades the performance massivley, I am not using it in webgl. But I replaced the sun with a directional light, also casting shadows and the ambient light of course. Even if I turn of shadows in blender and web gl the difference is clear. Besides that, the ambient color in webgl behaves strangley different from the ambient color in blender

@zeffi its almost the same. and if you read my question correctly, you can see if i enter the color via a hexcode, the color is almost correct (besides the difference caused by the lightning)

Okay, I found the solution by myself.
The reason, why the colors are different in webgl is: the exporter makes use of the rgb values that blender provides. After a lot of research I found out, the rgb values in blender are not gamma corrected. The Hex values are gamma corrected.
Thats why the colors were correct, after I applied the corrected hex-code to the materials.
Since that is a very crappy workflow, I talked to a developer from my team and he did some research on the WebGLRenderer.
He found out that you can enable a property called "gammaOutput". If you do that, all colors get gamma corrected by the renderer.

SOLUTION
renderer.gammaOutput = true;

compared to the first image in my question you can see the webgl version isn't that dark and oversaturated anymore. The small difference you can still notice comes form the environment lightning in blender.

what does the shot look like now it's corrected?

@zeffi I updated my answer

cool , that's much closer.

Thanks! This also helped me.


text:
If property does not exist, use default value in python
I have a problem with my script, i want to let the user creating or not the property, but when the property is not used, blender give me an error (its normal).
i have tried things like:
if "myprop" not in own:
    own["myprop"] = MyValue

And
defaultValue = MyValue
value = own("myprop", defaultValue)

But nothing work, i allways get an error.
Maybe the second one can work, but i dont know how to use it correctly.
I have another question, my player use the Character physics, and in the physics menu, we have the Jump Force.
I want to set the Jump Force in python, i know the function for doing this is:
jump_speed

But i dont know how tu use this:
GameObjectSettings(bpy_struct)

Thank you.

Extract and edited from my Movement script:
import bge

def main():

    cont = bge.logic.getCurrentController()
    own = cont.owner

# Verifier si les propriété existent.
Verif_Prop(own)

def Verif_Prop(own):

    # Verifie si la propriété existe.
    if "VitesseMarche" not in own:
        # Non définie, utiliser la valeur par défaut.
        own["VitesseMarche"] = 0.2

Source (i own the script): http://blenderartists.org/forum/showthread.php?381505-FR-EN-Advanced-Moving-Script-for-the-BGE-V2-0

Shorter way is own.setdefault("VitesseMarche", 0.2). Or if you don't want to modify dict where you get value you can just do own.get("VitesseMarche", 0.2).

Your code replace this exactly?                                                                              if "VitesseMarche" not in own:
own["VitesseMarche"] = 0.2


text:
Joystick Buttons problem since update 2.78
im making a game on 2.77a, my menus are working correctly.
I updated blender to 2.78, but my joystick buttons are not detected at all.
The Joystick movement still work, but blender is unable to detect any pressed buttons from my gamepad.
I previously made this simple, with logic bricks, but i tried to create a new logic brick, with exact same parameters as before, but nothing work.
I repair the installation but this didnt solve my problem.
Maybe this build of blender have some issues?

I experienced something similar with my pythonscript i created for joystick inputs. It seems like Blender 2.8 changed the input a little bit. All buttons do have other indecies now, so i think you should remap them all, maybe this helps.

So the index of the buttons is changed? I will try this soon


text:
Extruding Vector Files in Blender
I am sure this has been discussed quite a few times, but I found a tutorial recently doing the exact same thing as I did, but in my case my logo is messing up!
Here is the link to the workflow:
https://www.youtube.com/watch?v=mihkAGfnrWA
This is what it looks like after adding the solidify modifier:

I already recalced the normals of my spline, but besides that it messes up my spline shape, it had no effect.
Any suggestions on how to fix it?
SVG FILE

This has been answered before here Extrude and bevel an imported svg curve
It's most likely dirty geometry and duplicates/overlapping segments on curve export.
Before exporting from Illustrator or whatever vector drafting software you are using turn off any effects, filters, or outlines that may add additional geometry to the curve.
After importing enter edit mode and check for overlapping vertex or duplicated geometry and remove it.
Edit:
Although upon inspecting your SVG file in Inkscape it does show incomplete (the "S" part seems to be inverted or missing some nodes), I just tried importing it into Blender successfully with no problems.

You mentioned using the solidify modifier, so I'm assuming you converted it to mesh, which may be one of the problems. Try leaving it as a curve and use the builtin bezier tools like extrusion and beveling to achieve the volume and shape desired.
Also your curve seems to be very small, and scaled down. Try scaling it up considerably (in object mode by maybe a factor of 10 000) and afterwards press Ctrl + A Apply > Scale
Then enter edit mode, select all vertex and set their radius to 1 (on the Toolshelf>Tools>Curve Tools> Set Curve Radius button. You can then use the Extrude and bevel modification under the Properties Window > Object Data tab > Geometry
If you ultimately do need to convert your logo to mesh for whatever reason, before you do, go over all the straight (linear, non curved) segments of your logo and turn both their handles to vector by pressing V > Vector.
Illustrator seems to export linear segments in a non standard way with one of the curve handles overlapping its origin vertex, which results in lots of overlapping mesh geometry when converting to mesh, which i turn is what is causing the artifacts with the solidify modifier.

I don't have duplicate geometry or any overlapping vertices actaully. I tried selecting connected vertices with CTRL + L. After that i pressed H to hide them. No more duplicate vertices were left. I will add my svg to the question so you can check for any other problems in here

I think your problem is converting to mesh, try using the original bezier curve object, and cleaning up its coinciding handles before converting to mesh. Original answer updated with more info.


text:
Problem using Bevel and Subdivision Workflow
I am trying to model a simple piece of a sniper scope. For that I am using a Bevel and Subdivision modifier to get clean and crisp edges when raising the model's resolution.
this is what the topology looks like without any modifier active:

As you can see it is based on a simple cylinder, nothing fancy. Next you can see the beveled topology. I want each beveled edge to stay sharp when subdividing.

However when I add the subdivision modifier on top I get a weird pinching effect in the areas I marked red. see the image:

I have to admit this is a problem that comes around pretty often but I never figured out how to fix it yet. I already tried adding some support loops, but it is important to me to keep the perfect circular shape of the scope part.
If you are reading this and know what to do in this case I would be more than happy if you could give some advice. Please find the blend file attached.
blend file
blend file from pasteall.org

Hello :). I believe RobinBetts and Leander adressed this in some older thread...

Here it is: How to avoid pinching on concave shapes with the bevel modifier and subsurf?

@jachymMichal thanks for your reply! I already came across his answer, but his solution relies on additional edge loops. As soon as I add additional edge loops to my model I break the circular edge flow of the scope and the silhouette is no more perfectly circular from the front view

Try setting the Miter outer to 'Arc' under Geometry in the Bevel modifier.

@ Jachym Michal  it doesn't matter, I NEED to ask!!!!

@JohnEason nice tip, starts to look way better. The Downside of it is that it creates Ngons that are also still noticeable when having a closer look after subdividing.

@moonboots I updated the post with a pasteall.org link

Try to add bevel weights. I found answer in this video:
https://www.youtube.com/watch?v=R73wtu1Ixnw
minute 1:20 Or change bevel settings from angle to vertex

You probably need more topology, like this (use a Shrinkwrap to make it stick to a cylinder shape):

The pinching is almost not noticeable:

If you want a better result I guess you need to add more topology:


text:
Two meshes close together are breaking apart in view and render. Possible fix or built-in feature?
this specific problem is something that I knew about for quite a long time but have been able to work around until now.

There is a wall behind the set of bricks, and since both objects are very close to each other, (though not touching), the view presents a choppy and ripped up version of the mesh I need.
Is there a way to prevent this? In the settings of the camera or blender at all? Is it a built in function or is it something I can turn off?
Thank you for any help.

This looks like z-fighting. Where objects basically share the same space.

This is not built-in feature (nor it can be), it's a limitation (afaik in CG in general) of precision for the several faces occupying (nearly) the same place in the 3d space. It depends on clipping as well and as clipping differs for viewport and camera you need to adjust them accordingly (not to say moving meshes slightly away)

So it's impossible to prevent once I reach a certain distance away?

Hold on, I get it, I just had to set the minimum amount of clipping to 3. (My object space is very large, (Maximum clipping of 1000 units XD)) That seemed to work well enough.


text:
Blender 2.9 Extrude by 3ft Manually Problem
I've been getting back into Blender after a long time away from it. I used 2.79 a lot before, but since I'm using 2.9 right now, I'm having trouble accessing some features I use to use.
I need to extrude edges out a certain distance in my model. I did this manually before in Blender 2.79 via transformation values. In that version, when extruding an edge, I'd be able to set its distance relative to the edge it was extruded from.
However, in 2.9, when I try the same thing, the transformation values are not relative to said edge.

In this image, I want to extrude the edge 3 feet away from its parent edge. When doing so in 2.79, the values used to be set at zero, so I could easily put in "3ft", but here, it displays its median distance from what I assume is the origin.
In 2.79, I could press "G" whilst the edge is selected, and all three values would reset to zero.
Is there a way to reset these location values to zero. (without moving the edge), for when I start to extrude something? I could calculate what distance I should use, but it would flow much easier if I could just input the offset distance I want.

Doing a transform from a numeric input is still possible. After pressing G, just type the number directly into the viewport and press ⏎ Enter. Or for better control, lock it to an axis first: press G for the transform, then (X, Y, or Z) to select that axis, then type the number and press ⏎ Enter.
This also will work directly from the extrude. i.e: press E to extrude, then (X, Y, or Z) for the axis, and then type a number and press ⏎ Enter.

Sweet! Thank you!


text:
Zone of darkness surrounding view camera in eevee render preview
I've encountered an issue with the render preview in eevee.
In my scene, close objects are cast in darkness, whereas objects further away are lit up.

It seems that this zone of darkness follows my view camera.

I can move far away and see the previously darkened objects lit up.

I thought it might have to do with clipping, but changing the values for a camera in the scene didn't affect it, and neither did changing viewport clipping.

My best guess would be a huge object constrained to the camera and casting shadows. More probable situation would be a malfunctioning graphics card. What brand do you use?

Seems like shader (material) setup using distance ...

Okay, I just figured it out. I'm using a sun-lamp casting rays in a certain direction, but I also have three large objects in the distance that don't have materials set up and seem to be casting shadows.

If I hide them from view, the zone of darkness goes away.

This blend file is originally from blender internal, and I've been setting up the now blank materials in the scene to similar versions of the originals in eevee. The three distant objects are meant to represent features of a night sky; stars, the moon, the moon's glare. That's why they're there.


text:
How to replace materials in one blender file with materials of the same names from another file without creating copies
I have two blender files that have different materials with the same names.
Both were originally in Blender Internal, but I manually converted the BI materials to eevee in one of them.
The other file, which has a lot of materials with the same exact names as in the other, does not have the updated versions yet, and I'd like to easily swap them out for the ones I manually converted.

I have almost 600 materials in the first file that may need to replace the old ones in the second file, so if I can avoid having to go through each one, that would be awesome.

Python script
Change the path on line 3 src_file = "E:/tempmymat.blend"
import bpy

src_file = "E:/tempmymat.blend"

D = bpy.data

def main():
    # find materials that you want to replace
    bad_mats = {m.name:m for m in D.materials if not m.library}

    # load materials to replace with
    with D.libraries.load(src_file, link=True) as (src, me):
        me.materials = [name for name in src.materials if name in bad_mats]

    # create copies of the loaded file's materials, rename them and store
    # a convenient dictionary pointing from old materials to new materials
    replacements = {}
    for m in me.materials:
        new_mat = m.copy()
        bad_mat = bad_mats[m.name]
        new_mat.name = m.name
        replacements[bad_mat] = new_mat

    # find old materials and replace with new materials
    for o in D.objects:
        for slot in o.material_slots:
            replacement = replacements.get(slot.material)
            if replacement:
                slot.material = replacement

    # unlink old materials and the external file (library)
    for m in bad_mats.values():
        D.materials.remove(m)
    D.libraries.remove(D.libraries[-1])

main()

if not m.library is used on the first line of main() in order to ensure there's a single material with each name. If you need to make it work with materials linked to other files also being replaced, remove that condition. If you're worried that as a result you can indeed get multiple materials with the same name in that dictionary, you need to come up with some other method of associating a loaded material with an existing material.
Related:
How to know which object is using a material
How can I replace a material from Python?
How to Link/Append a data-block using the Python API?

It worked! Thank you!

Thanks for the great answer, Markus. It was a good head start into scripting Blender for me. Unfortunately, your script does not do deep copies of materials. That means that image texture for example get lost when unlinking the source file. Is there an easy way to copy all dependencies of material nodes?

Try link=False


text:
Blender Cycles camera renders at wrong position/ratio (not keyframes)
So I made a mistake (object verts) in a recent animation I made and decided to go back and fix the problem, but when I tried to re-render it (using the animation tab) and the same camera I did as before it rendered the object in the wrong position. I checked my keyframes and markers for the camera; of which I have none, and as of me writing this I can't figure out the problem.
I've provided an image demonstrating the issue. The camera is clearly centered (relative to the object) and on the render preview, using that same camera it is also clearly centered. I honestly don't know why this is happening, thanks to anyone who is willing to help me out.

Is it possible you could upload a .blend exhibiting the problem?

@cegaton I've checked, but no that doesn't seem to be it. -I've experimented with the problem and it seems like something in one of the other layers is causing it. Once I deleted.. whatever it was in the other layers, it began functioning as normal.

So, problem solved? -I've been trying to find what caused it in the first place, but as of now I can't say..

For me it was keyframes and your post reminded me of that.


text:
Is there a way to disable self-cast shadows on grass (particles,) but still have grass receive shadows from other objects?

Hello persons, so I'm trying to achive ghibli or breath of the wild style grass using only generated texture nodes, (ie not image textures, math) and that much is turning out okay. However the issue I'm currently stumped on are the grass shadows.
To achieve toon-like / watercolor-like grass it has to be shadeless as to not cast shadows on itself, but I also want objects like trees and people to cast shadows on the grass as well. As much as I looked, I couldn't find a way to keep the grass from casting on itself, but also allow it to receive shadows (or something comparable) from other objects.

^ As you can see in this provided image, the result from the front (left image) appears as I would want it to look, however the moment you view the grass from an angle facing away from the light source (right image,) it's made apparent the grass is casting shadows upon itself, making the whole thing appear dark. I'm looking for a way to prevent the grass from casting a shadow onto itself, but allowing other objects like a cube to cast shadows on the grass.
Misc details:
Running real time in Eevee. Currently rendering particles as paths (not objects,) texture is plugged into an emmisive material node to achieve simple toon effect, so it isn't a diffuse material; the current shadow effect is instead just a color hue shift determined by a Diffuse > RGB to Shader > Color Ramp > Mix RGB (fac) mask. However as explained, it isn't solving my issue at hand.
Any advice or attempt help is much appreciated, thank you.

I have an "okay" solution for your problem (in cycles) and it is only working with gras meshes (not billboards) so far. I know exactly what you are struggeling with, because I asked a similar question a while back but without an answer.
Recently I tried something that works best:
you need to render your scene 2 times.
First time:
Everything + the shadeless grass.
second time:
Check "shadow catcher" for the grass meshes + Instead of the Emissionshader give the grass a Diffuseshader. For everything else check "Holdout" (both checks are in the Object Properties). And under Render Properties -> Film -> Check Transperent (for a transperent background).
now you can combine both images in the compositor or in a programm like photoshop.
here is a quick example:
[
but i hope aswell we will get a better solution in the future, it must be possible because EEVEE is using the same technology as Game engines, and this is a well used and very common style in (indie)games (dauntless, the witness, zelda: botw, fortnite).

You can actually create a shadow catcher / mask in Eevee with a Diffuse > Shader to RGB > ColorRamp > Mix Shader (fac) , however this isn't useful when it's applied to the grass, as the grass is still casting shadows on itself. However, if there was a way to pull this data from ANOTHER material and object (ie the ground plane) I wonder if it would produce a competent effect. -Tho idk if it would even work, or if it's even possible to get shadow catch data from another object, material, or via the camera in Eevee.

I'll look into your fix, but I don't like the prospect of rerendering a scene; especially as this grass it intended to be used for an animation.
I feel like this should be WAY easier to solve than it is. Other engines (particularly game engines) have achieved the results years ago. I feel like it should be possible, but as much as I search I cannot find anything to suggest that it is, which is just.. weird.

"However, if there was a way to pull this data from ANOTHER material and object (ie the ground plane) "
that works. I explained it, in the theard i posted, in my answere. You can bake the shadow onto the (white) plane, and use it as a mask. But it only works with an emitter particle system (as far as i know). Hier is the explanation with a picture https://blender.stackexchange.com/a/143362/105722
but still a workaround :(

Yeah sorry I thought you were referring to post-processing. While effective for static renders, I was wanting something that offers way more flexibility and control. (i.e. dynamically adapting with the light source.) But it's okay, because guess what. I figured it out! I'll get started on a tutorial soon and post it here as answer cuz it's pretty complicated, but yeah, I got dynamic toon grass shadows working in Eevee. (Doesn't seem to work in Cycles tho.) I don't know how to post images here within a standard comment, so uh.. I'll update later with the results.

Hey so after a lot of research and thinking, I figured it out!
Edit: While my first answer posted here was the first known way of getting real-time stylized grass shadows in Blender Eevee, it was extremely complicated, requiring a lot of complex work arounds, and came with a few caveats (notably: you were limited to "object" as your tex coords, you had to render hairs as objects, you needed to use a datatranfer modifier, among many other things..)
Since then artist and twitter user Kidane (@Puffertron) saw my original tutorial and revised the method using only materials. After seeing his post I was able to refine the method even further, giving the user more creative control over things like shadow color, transitional sharpness, and overall the effect is a lot cleaner/simpler. Thanks to Kidane it is leaps and bounds better than my original method. One thing to note is that it works with hair paths, not hair objects. Full explanation on new method here:

https://youtu.be/zjKKZL03HNs
User JustQB has also suggested another possible method using billboards, which supposedly comes with it's own set of benefits. I know little about billboards, so I will likely look into it and update my answer here if the method is found to be just as useful. (His comment and video in regards to billboards can be found below.)

I found a solution for Grassbillboards. But it is not as precise as LanceBeryl's Solution (for 3d objects), which I would recommend if possible :) .
the Idea is to let white Billboards catch the shadow, and get this white and grey/black information with the help of an "Shader to RGB" node. Plug a color ramp node after that node to make grey shadows also black. than use this coloramp as a factor to decide between a bright grass color (for grass in light) and a dark grass color (for grass in shadow).
A full explanation can be found here:
https://www.youtube.com/watch?v=AzDoFjx9skQ


text:
Are UV unwraps with identical settings the same every time?
If I have two identical objects with the exact same geometry and seams, and I unwrap them with the same settings, will their respective UV unwraps always be identical? Or is there any randomization with UV unwrapping even with the same situation?

after some test I'd say: identical

If there was any randomness to it at all, my guess is that you wouldn't need two separate instances of your mesh just to perform a test. Presumably, one mesh would be sufficient, by repeatedly undoing the unwrap and redoing it. One would think that eventually, it would unwrap in a different way. I don't see any reason to imagine that, on the assumption that there IS randomness, we should expect to get consistent results from a single mesh being re-unwrapped over and over, but also expect to get get potentially random outcomes when applying the unwrap to different but identical meshes.

The thing is, I am using a vagon remote computer, which is a lot more powerful than mine, to bake textures and full renders onto objects, and then download the result onto my own computer, to then apply to the objects in there. Both the blender file on the vagon computer and on mine have the same geometry and seams, and I have to unwrap the same object once on vagon, and a second time on my own PC to get my desired end result. So if there's inconsistency with the unwrapping process, it can mess the result up. That's my situation.


text:
Joining Rigid Body objects after baking to shorten BVH building time
I want to render a rigid body simulation with ~20k objects.
Because of that, Cycles needs about 5 minutes / frame to build only the BVH data of those 20k objects (and I have a powerful machine). Is there any way to join the objects to one single object while maintaining its individual movements? I tried baking the simulation to keyframes, but when I join the objects, their individual transformations merge as well.
Btw, I only tested this with a smaller simulation, because baking 20k objects to keyframes takes like ages (hasn't even finished yet...) So maybe there is another way to avoid the long BVH building time?
Thanks in advance for any help! :)

I doubt joining the objects would have much of an effect anyway.. What is the vertex count?

It has a tremendous effect, I joined all objects to a single object (removes any of the bake information of course) and the BVH building time dropped to 3 seconds and the 3D View stopped being laggy as well. The objects have only 4 vertices. It's 181k vertices in total.

Huh. Do all the objects have the same geometry? You might try linking them (Ctrl L > Object data) and see if that helps

Of course I meant  8 vertices/object (they're dominos ;)).
I tried linking the objects, it took about 7 minutes to link them, but it works, BVH building time is down to several seconds! Didn't know that trick, thank you very much, you saved me about 62 hours of unnecessary render time + a lot of electricty ;)

If you link the objects with ⎈ CtrlL > Object data, one copy of the mesh data will be shared between all 20k objects (as opposed to 20k copies of the same data).
While not as efficient as whole-object instances (e.g. dupli objects), AFAIK this is about as close as you can get while still keeping the rigid body sim.


text:
How can I achieve this "security camera" effect?
I want to create the following effect:
When a keyboard control is pressed the main camera will be switched to another camera that already exists in the scene. At that time till the camera is switched back, everything at the scene where both cameras exist must remain as is with no change, except a few things of my choosing.
How can I achieve this? I thought of suspending the scene but I want to be able to move the new camera.
My 2nd thought was changing all objects to different states when I set the new camera so they won't move at all, but that will mess with scripts and it is confusing.
My 3rd thought was a bit more complicated but till a point I think correct. It was the following idea: What if I add the new camera in the original scene and create a new overlay scene with one new camera there also. Now everytime I switch to the new camera in the original scene, I'll suspend the original scene and add the overlay scene with a small delay so that it will seem that it is the same "new" camera. But there is a problem. How can I save any motion done with the camera in the overlay scene to be copied to the "new" camera in the original scene?
I hope I did not make this too complicated. Any ideas?

Switching a camera is pretty easy with the Scene Actuator in "Set Camera" mode.
Switching controls/behavior is independent from the camera, as it has no relation to what is rendered. Typically you "enable" a set of controls while you "disable" another set of controls.
There are many ways to achieve this effect. The basic idea is that each entity remembers if it is enabled or disabled (= state) and acts accordingly.
Additionally you need a way to request one or multiple state changes e.g. via property change, message listening or other events.
Example:
When receiving message "enable security camera", you

let the camera switch to the security camera,
disable the current controls on the player's avatar
enable the controls on the security camera
...

When receiving message "enable security camera", you

let the camera switch to the player's camera,
disable the controls on the security camera
enable the controls on the player's avatar
...

if you have a lot of such objects and possible toggles, you might want do this is two steps:

disable all
enable what was requested

This way you do not care the previous state.

By disabling all you mean adding another state to every object that I want to remember its state and stay still during the switch? Is there a faster way? Also, what if an object has 2 states already and this "idle" state is the 3rd? How will it remember to come back to state 1 or state 2? Properties again?

Yes, as each object has it's own operations it needs its own state handling too. An alternative would be to dynamical create and remove objects, which is also a sort of state (existence). In a state system it is no problem to add further states as long as the value range allows more states (e.g. a boolean property can only have two states). I recommend to use the build-in state system.


text:
plane disappears during animation
I have created an animation that works perfectly with alt+A. I tried to use actuators and a script to make it work in bge, but everytime I run it the plane disappears. Here is the blend file.
If you move the mouse, the 3 arrows follow the cursor. When you right click on the ground plane, the animation should have taken place. It does not. Instead the ground plane disappears leaving behind a small green line.
Here is the module code:
#Import the bge library.
import bge

#Make the mouse cursor visible during game running time.
bge.render.showMouse(True)

#Set the current game scene and python controller to variables.
scene = bge.logic.getCurrentScene()
cont = bge.logic.getCurrentController()

#The function "initialization" is responsible for setting all scene objects, object sensors and object actuators to variables.
#These variables are created into the function but are for global use. Their names are the names of the objects/sensors/actuators in blender.
def initialization():
    for k in scene.objects:
        exec("globals()[\"%s\"]=scene.objects[\"%s\"]"%(k,k))
    for k in ground.sensors:
        exec("globals()[\"%s\"]=ground.sensors[\"%s\"]"%(k,k))
    for k in cont.actuators:
        exec("globals()[\"%s\"]=cont.actuators[\"%s\"]"%(k,k))

#The function "empty_to_pos" gives the cursor_empty coordinates on the ground.
def empty_to_pos():
    cursor_empty.worldPosition = (mop.hitPosition[0],mop.hitPosition[1],ground.worldPosition.z)

#The function "cursor_anim" is responsible for the start and end of the cursor animation.
def cursor_anim():
    cont.activate(anim_arrow_1)
    cont.activate(anim_arrow_5)
    cont.activate(anim_arrow_9)

initialization()
empty_to_pos()
if (right_click.positive):
    cursor_anim()

print ("I reached the end of track.py")

and an image:

Any ideas why the animation is not working and why the plane disappears? Thanks

Action (animation) actuators need to be part of the object, which you want to animate.
In the .blend, the animations are applied to the "ground" plane instead.
To make objects interact with each other in the logic editor, select them at the same time using Shift + Leftclick in the Outliner:

You will see the objects in the logic editor:

Then edit the logic so that one object's controller controls other objects' actuators:

You can see the full process in this video.
Unfortunately two of the arrows don't animate correctly and I'm not sure why that is. Perhaps their transformations need to be applied?

Many thanks, I did not know they had to be in the objects themselves.The mistake you referred to happens because the actuators 9 and 5 had starting and ending frames 0 to 0. Should have been 60 to 100.My bad.


text:
How do I know if Blender is making use of CUDA to render?
I am using Blender 2.69 from the Linux Mint Software Manager on a system with a GTX 950, just checking to see if it will recognize CUDA. After some work, I've gotten the CUDA drivers from Nvidia installed and now there is an option to use CUDA as the compute device in the user preferences. I also selected GPU compute in the properties panel. I rendered a short, one minute clip of video using Cycles Render and monitored my GPU usage in Nvidia X Server settings. It didn't seem like the GPU was being used much (hovering 5-10%) but the video did render a little quicker than I expected.
How can I know for sure if Blender is using my GPU to the fullest to render?

If you have properly set up CUDA and selected GPU Compute in the Render Properties panel then Blender should be using your GPU.  (Though I have seen instances where having two different Blender files open separately and both rendering switches the GPU one to CPU mid-render.)
Probably the easiest way to make sure that Blender is utilizing your GPU is to use some sort of monitoring program.
My Favorite is NZXT CAM, it's pretty sleek and works very well.  CAM monitors and gives graphs of CPU and GPU load, temperature, voltage draws, and fan speeds.  It also shows which programs are using the most load.
HW Monitor is another very popular choice, it doesn't have all the options that CAM has though.  It basically just shows you the current values, minimum, and maximum of each spec.

OK, nevermind.
I ran the BMW benchmark and it maxed out my GPU. The video is just a very simple render.
It's working.

Also use auto tile size add-on to quickly make sure you are using the right tile size for optimised render speed.

authors: Артур Новиков


text:
Making a custom list of Kinect Data for later assignment
I am adding Kinect data capture into a MakeHuman Blender add-in, through a small .dll I have written.  I am getting data (JSON text) fine, which I hope is close to being correct.
The REALLY great thing is KinectV2's can capture up to 6 bodies at a time.  To take best advantage of that, I am trying to delay actually making the action(s) when the person hits the 'Stop' button.
Instead, I want the data for however many bodies were just tracked stored somewhere, and a list of what just got recorded displayed.  An 'Assign' button below it creates the action for the selected animation buffer on the selected armature.
The number of examples of using UIList on web is pretty small.  Many just point to existing Blender data.  My data also does not extend the data of any Blender types.  I see those calls to template_list where the same value is supplied for multiple arguments, and I am just totally lost.
Here is the current UI, with a mock-up of what I want to add in red.  Any help would be appreciated.

I found my answer myself through trial and error.  Not every question is destined for re-use.  Feel free to toss.


text:
Mapping Kinect data to armature
I was attempting to improve a Blender addon for MakeHuman by directly interfacing with a xBox Kinect2 sensor.  I also made an operator in the addon to convert their default skeleton to something that matches.  It is manually pose-able, so hopefully not the main issue.
The capture part using a DLL I made went well.  It sends back JSON formatted info.  I am just not good enough to figure out how assign it to an armature, after trying many different things.
I made a .blend with the converted armature, and added a script (in a text editor window) with a single frame of data and one of the ways I tried to assign it.  The script "works" in that it creates a single frame action with the data.  What it does to the mesh is terrible, but I wanted to do as much leg work as possible.
The pose is just standing with arms crossed.
I should mention that Kinect has Y and Z flipped from Blender.  The values are in meters.  I already converted it to the decimeters of the mesh.  Here is a doc (with picture) of the Kinect's Camera Space.
If someone could look at this, it would be great.  Just to have a self contained question, here is the code of the script in the .blend.
import bpy
from json import loads
from mathutils import Matrix, Quaternion, Vector

json  = '{'
json += '"SpineBase": {"location": {"x":0.71,"y":8.82,"z":19.70},"rotation": {"x":-0.012,"y":0.999,"z":0.000,"w":0.043} },'
json += '"SpineMid": {"location": {"x":0.64,"y":11.77,"z":19.69},"rotation": {"x":-0.012,"y":1.000,"z":-0.000,"w":0.001} },'
json += '"Neck": {"location": {"x":0.69,"y":14.45,"z":19.52},"rotation": {"x":0.024,"y":0.997,"z":-0.052,"w":-0.041} },'
json += '"Head": {"location": {"x":0.37,"y":16.28,"z":19.80},"rotation": {"x":0.000,"y":0.000,"z":0.000,"w":0.000} },'
json += '"ShoulderLeft": {"location": {"x":-1.10,"y":13.00,"z":19.16},"rotation": {"x":0.836,"y":-0.538,"z":0.057,"w":-0.094} },'
json += '"ElbowLeft": {"location": {"x":-0.96,"y":13.56,"z":16.15},"rotation": {"x":-0.636,"y":-0.003,"z":-0.027,"w":0.771} },'
json += '"WristLeft": {"location": {"x":0.92,"y":13.73,"z":14.89},"rotation": {"x":-0.520,"y":-0.207,"z":-0.434,"w":0.706} },'
json += '"HandLeft": {"location": {"x":1.44,"y":13.95,"z":14.75},"rotation": {"x":-0.345,"y":-0.329,"z":-0.438,"w":0.762} },'
json += '"ShoulderRight": {"location": {"x":1.76,"y":14.05,"z":19.09},"rotation": {"x":0.607,"y":0.767,"z":-0.179,"w":-0.109} },'
json += '"ElbowRight": {"location": {"x":1.42,"y":11.88,"z":16.84},"rotation": {"x":0.900,"y":-0.135,"z":0.183,"w":-0.372} },'
json += '"WristRight": {"location": {"x":-0.18,"y":11.33,"z":15.28},"rotation": {"x":-0.518,"y":-0.029,"z":0.589,"w":0.619} },'
json += '"HandRight": {"location": {"x":-0.69,"y":11.26,"z":15.05},"rotation": {"x":-0.405,"y":0.093,"z":0.633,"w":0.654} },'
json += '"HipLeft": {"location": {"x":-0.05,"y":8.76,"z":19.25},"rotation": {"x":0.705,"y":-0.658,"z":0.188,"w":-0.184} },'
json += '"KneeLeft": {"location": {"x":-0.32,"y":4.51,"z":19.35},"rotation": {"x":0.737,"y":-0.032,"z":-0.675,"w":-0.013} },'
json += '"AnkleLeft": {"location": {"x":-0.38,"y":1.02,"z":19.61},"rotation": {"x":-0.635,"y":0.034,"z":0.771,"w":-0.018} },'
json += '"FootLeft": {"location": {"x":-0.56,"y":0.25,"z":18.76},"rotation": {"x":0.000,"y":0.000,"z":0.000,"w":0.000} },'
json += '"HipRight": {"location": {"x":1.46,"y":8.84,"z":19.37},"rotation": {"x":0.684,"y":0.701,"z":-0.144,"w":-0.140} },'
json += '"KneeRight": {"location": {"x":1.64,"y":4.60,"z":19.19},"rotation": {"x":0.676,"y":-0.002,"z":0.736,"w":-0.030} },'
json += '"AnkleRight": {"location": {"x":1.72,"y":0.97,"z":19.63},"rotation": {"x":0.676,"y":0.051,"z":0.735,"w":0.032} },'
json += '"FootRight": {"location": {"x":1.83,"y":0.28,"z":18.63},"rotation": {"x":0.000,"y":0.000,"z":0.000,"w":0.000} },'
json += '"SpineShoulder": {"location": {"x":0.66,"y":13.81,"z":19.59},"rotation": {"x":0.006,"y":0.999,"z":-0.024,"w":-0.042} },'
json += '"HandTipLeft": {"location": {"x":2.18,"y":14.01,"z":14.50},"rotation": {"x":0.000,"y":0.000,"z":0.000,"w":0.000} },'
json += '"ThumbLeft": {"location": {"x":1.39,"y":14.46,"z":14.98},"rotation": {"x":0.000,"y":0.000,"z":0.000,"w":0.000} },'
json += '"HandTipRight": {"location": {"x":-1.17,"y":11.07,"z":14.77},"rotation": {"x":0.000,"y":0.000,"z":0.000,"w":0.000} },'
json += '"ThumbRight": {"location": {"x":-1.33,"y":11.40,"z":15.07},"rotation": {"x":0.000,"y":0.000,"z":0.000,"w":0.000} }'
json += '}'
frame_data = loads(json)
armature = bpy.data.objects['Default_no_toes']

def assignBone(boneName, parentPoseMat):
    poseBone  = armature.pose.bones[boneName]
    restLocal = armature.data.bones[boneName].matrix_local.copy()
    isRootBone = parentPoseMat is None

    # construct a matrix from kinect data
    rot = frame_data[boneName]['rotation']
    kMat = Quaternion((rot['w'], rot['x'], rot['z'], rot['y'])).to_matrix().to_4x4()
    if isRootBone:
        loc = frame_data[boneName]['location']
        kMat = kMat * Matrix.Translation((loc['x'], loc['z'], loc['y']))

    # convert to local coordinates
    kMatLocal = kMat * restLocal.inverted()

    # back out parent bone's pose, in parent's local terms
    kMatFinal = kMatLocal * parentPoseMat.inverted() if not isRootBone else kMatLocal

    # assign animation values
    if isRootBone:
        poseBone.location = kMatFinal.to_translation()
        poseBone.keyframe_insert('location', frame = 1, group=boneName)

    poseBone.rotation_quaternion = kMatFinal.to_quaternion()
    poseBone.keyframe_insert('rotation_quaternion', frame = 1, group=boneName)

    for potentialKid in armature.pose.bones:
        if potentialKid.parent == poseBone:
            assignBone(potentialKid.name, kMatLocal)

assignBone("SpineBase", None)

I have abandoned this approach, but as a note the data shown is in a "mirror" compared with the skeleton.  By default, a Kinect is setup to act like a mirror.

I think I have solved this problem by solely using the captured location data, ignoring rotation, and saved my sanity at the same!
First, when a buffer of frames of one of the captured bodies is assigned, add an empty with the same name as the bone to the scene:
def makeEmpties(self):
    # Add all the empties in OBJECT Mode, one for each bone
    # use first frame of animation, not bones though, since user could have removed fingers
    bpy.ops.object.mode_set(mode='OBJECT')
    self.empties = {}
    for boneName in self.dataSets[0]:
         o = bpy.data.objects.new( boneName, None )
         o.empty_draw_size = 0.5
         o.empty_draw_type = 'ARROWS'
         o.show_name = True
         o.name = boneName

         bpy.context.scene.objects.link(o)
         self.empties[boneName] = o

Then for each frame, assign the location of the corresponding empty with the Y-Z switched data.  For the root bone, 'SpinBase', I need to assign the tail not the head, so an offset of the length is also added (It is a horizontal bone in this rig):
def assignEmpties(self, bonesAnim):
    for boneName in bonesAnim:
        loc = bonesAnim[boneName]['location']

        empty = bpy.data.objects[boneName]

        empty.location = (loc['x'], loc['z'], loc['y'])
        if boneName == 'SpineBase':
            empty.location.y += self.rootOffset

Then either a copy rotation or stretch constraint is added to each bone, and I got my first recorded pose.  Should the constraints be added before the empties are positioned, a TOTAL mess is the result.  Do not know yet if the constraints need to be deleted after each frame & re-added after repositioning, but I can live with that.  There has to be a function to delete the constraints (as well as empties) at the end of the transfer anyway.  Code:
def assignConstraints(self, armature):
    # assign a stretch to constraint to each bone of the empty of the same name
    # unless it is root, where a copy location is assigned
    bpy.ops.object.mode_set(mode='POSE')
    for bone in armature.pose.bones:

        if bone.parent is None or not armature.data.bones[bone.name].use_connect:
            constraint = bone.constraints.new('COPY_LOCATION')
            constraint.target = self.empties['SpineBase']
        else:
            constraint = bone.constraints.new('STRETCH_TO')
            constraint.target = self.empties[bone.name]

Here is the first frame of a capture.  The fingers look bad, but with only 3 hand bones, that is going to be tough.  I plan on deleting those bones:

Sort of a note to myself, but this way has the problem of requiring to face the sensor.  Have just thought of at least approximating root rotation using left & right hips, & maybe upper chest using shoulder same way.


text:
Existing Frame Trimming Capabilities of Actions
I am working on a direct connection of a Kinect2 sensor to Blender.  It is progressing, but I find that there are always going to be unwanted frames at the beginning and end of a capture session, especially if you are doing this by yourself.
Do I need to write operations to trim (either delete & shift left, or drop to the right)?  I do not want to re-invent the wheel, but at the same time some multi-step keyboard / rodent operation is not going to cut it for me.
There is an 'Animation: Motion Capture Tools' add-on.  Activating did not seem to do anything that I could find.  The doc link was an empty page.  Is this or maybe something new in 2.8 which supports this?

I took the lack of responses to mean that there was no really clean way to do this, so no re-invention would be done.  So just did it.  Made as a simple class in a separate file for simplicity, but also means I can just cut & paste.
from mathutils import Quaternion, Vector, Euler
import bpy
#===============================================================================
class AnimationTrimming():

    def __init__(self, armature):
        self.armature = armature
        self.action = armature.animation_data.action
        self.first = int(self.action.frame_range[0])
        self.last  = int(self.action.frame_range[1])
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#                         operation entry points
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def deleteAndShift(self):
        # drop from the front up to, but not including, the current frame
        firstGoodFrame = bpy.context.scene.frame_current
        self.dropRange(self.first, firstGoodFrame)

        # shift remaining keys on a bone, property basis, to the left
        for bone in self.armature.pose.bones:
            rotProperty = 'rotation_quaternion' if bone.rotation_mode == 'QUATERNION' else 'rotation_euler'
            self.shiftLeft(bone, rotProperty, firstGoodFrame)
            if self.hasLocationKeys(bone):
                self.shiftLeft(bone, 'location', firstGoodFrame)

        # dope sheet not reflecting deletions immediately, so do "something"
        bpy.context.scene.frame_set(self.first)

    def dropToRight(self):
        # drop all frames for the bones after the current frame
        lastGoodFrame = bpy.context.scene.frame_current
        self.dropRange(lastGoodFrame + 1, self.last + 1)

        # dope sheet not reflecting deletions immediately, so do "something"
        bpy.context.scene.frame_set(bpy.context.scene.frame_current)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#                       below only called internally
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def dropRange(self, first, lastNotIncluded):
        bpy.ops.object.mode_set(mode='POSE')
        for bone in self.armature.pose.bones:
            for frameNum in range(first, lastNotIncluded):
                # does not error when location property missing, so just do all possiblities
                rotProperty = 'rotation_quaternion' if bone.rotation_mode == 'QUATERNION' else 'rotation_euler'
                bone.keyframe_delete(rotProperty, -1, frameNum)
                bone.keyframe_delete('location' , -1, frameNum)

    def shiftLeft(self, bone, property, firstGoodFrame):
        bpy.ops.object.mode_set(mode='POSE')
        newFrameNum = self.first

        # for each kept frame shift it, then delete the old one
        for oldFrameNum in range(firstGoodFrame, self.last + 1):
            # find the value of property of the bone at a given frame & set the bone to it
            values = self.findKeyValues(bone, property, oldFrameNum)
            if len(values) == 0: continue

            if property == 'rotation_quaternion':
                bone.rotation_quaternion = Quaternion(values)
            elif property == 'rotation_euler':
                bone.rotation_euler = Euler(values)
            elif property == 'location':
                bone.location = Vector(values)

            # add a new keyframe
            bone.keyframe_insert(property, frame = newFrameNum, group = bone.name)
            newFrameNum += 1

            # delete the old key frame
            bone.keyframe_delete(property, -1, oldFrameNum)

    # a given key only contains a single float, so return all found for a given property / frame number
    def findKeyValues(self, bone, property, frameNum):
        ret = []
        dataPath = 'pose.bones["' + bone.name + '"].' + property
        for c in self.action.fcurves:
            if c.data_path == dataPath:
                ret.append(c.evaluate(frameNum))

        return ret

    def hasLocationKeys(self, bone):
        dataPath = 'pose.bones["' + bone.name + '"].location'

        for c in self.action.fcurves:
            if c.data_path == dataPath:
                return True

        return False


text:
Reading files of an addon
I write an exporter, which exports PBR materials, mostly from the PrincipledBSDF shader.  Would like to add a small directory of generic environment textures in my zip file, in a format that Blender does not use.  Like a 2 umbrella studio environment texture, seen here as a reflection texture.
User could then also pick from a custom property list, in addition to a the .hdr in the world node.  The file would get copied to the export directory.
Problem is how do I know where the directory from the addon is, in a completely OS independent way?

This gets the root directory of the add-on from any file (or at least those in the same directory).  Can always do an os.path.join() if I need a sub-directory.
def getAddonPath():
    import os
    return os.path.dirname(os.path.realpath(__file__))


text:
Color grading/matching strips in the VSE
Imagine you have a number of strips in the VSE and you want the white balance, the exposure, or the color balance to match between each strip. Would there be a setup that would enable you to display for example strip 1 (with strip modifiers if any)  in a window and strip 2 in another window? If such setup was possible, one would them add strip modifiers to strip 2 to match strip 1 (eyeballing).
Thanks

There are 2 ways to do this:

You could stack the strips above each other and make a new preview window for each strip. At the bottom of the preview window is a channel number, simply set this for the strip you want to see.

Or you can make 2 preview windows and turn on the Ghost offset function in the preview window. Simply turn on the ghost button and enter the frame offset so the black line lands on the shot you want to compare. Then toggle down the Overlay menu next to the offset and select "reference". The other preview window should show "Current", this will display whatever the green play indicator is stopped on.

Just use two Transform Effect Strips for temporary side-by-side display and do your Color Balancing on top of these. Afterwards you can select your untransformed Strips and Copy your Modifiers to Selected Strips.
Your Effect Strips Blend Type has be set to OverDrop (or AlphaOver) and you need to Scale and translate it accordingly (I uniform scaled both to around 0.55 of their size and translated their position into the corners).
Then you can apply a Color Balance Strip Modifier to them... To not get confused with or have unwanted side-effects from the underlying strips you might mute the source strips of your Transform strips.

You have to copy your Strips to be at the same Frame on different Channels as you cannot simultaneously show two different frames in Blender.

Can't follow the answer very well, could you rearrange your answer that is easiler for a beginner to understand ... like where are the buttons I need to click on to even begin to do that?

There are great tutorials out there to get you started. Follow them first and you should be good to go ;-)


text:
How-To: Text Sliding out of a Circle 2D
I will be explaining this as best as I can, however I will be actively updating with more detail if necessary.
End Goal:
I want to have a circle roll in from the left of the screen (a logo will be on the circle so it will have to be actually "rolling" across the screen), stop shifting horizontally but continue the rolling motion about 1/4 from the left of the screen. I want to have text "slide" out of the circle as the stationary roll is occurring to look as if the roll is extending the text out of the circle.
Question:
How can I get text to extend in such a way? I know that this is harder because the text has to appear out of thin air as opposed to sliding from off-screen. What is the best way to do this?
Second Question:
If possible, can I import a pre-made circular 2D logo into Blender to use as the circle? I already know that making the roll motion is just a matter of repeatedly rotating it 90 degrees and using animation keys (may not be correct term, but I know how to do that part).
Thank you!

So, you don't want to see the text until the stationary roll?

@Ninjamaster4427 Welcome to Blender.StackExchange! Please restrict your Question to a single question. You can ask as many separate questions as you need and link to a previous question if it carries some useful context.

what is the exact 'extend' effect? the characters are getting out of the circle in a radial way (centrifugal)? or they are streched out (elastic).    2. I don't understand when the text appears. Does it not come with the disc? It's generated only when it's extended?    3. Does this text appear at once or fades or letter by letter? How? .... A handmade drawing/schema could be enough, like a little storyboard.    Sorry, but the solutions are very different for each case, simpler or more complex

Here is a quick method for that:

Create a circle curve object.
Enter Edit Mode, make sure all points are selected, then V to switch handle type to Aligned.
AltC to make it an open curve (acyclic).
Select the tip point, then E to extrude it. Note that the length should no less than the length of the text.
You can manually tweak the shape by extruding and transforming points to make it a circle (or several circles for a longer rolling later).
Add a Follow Curve modifier to the text object, and choose the curve as path object. You may also want to scale the text to match the curve.
If the text appears flipped, you can select the path then enter Edit Mode, then W > Switch Direction.
Then move the text horizontally to the expected location.

Finally, you can key the movement for path object to get the result:

Example File:

I believe this is the sort of effect you are looking for, right?

Though there are several possible methods of doing this, I would probably use this method with some Cycles node tricks.

First set up your scene.  You will need a text object for the text to be revealed and a disc placed directly in front of the text and animated to move and rotate from left to right (or vice versa).  Something like this:

To test the location of the disc in the text material I will use the disc's local coordinates.  However, since the disc is rotating as it rolls its coordinate space will be too.  To fix this add an empty and parent it to the disc.  Then, in the Constraints properties panel for the empty, add a Limit Rotation constraint to the empty and check all three limits X, Y, and Z (leaving all the Min and Max values at 0).

Now you need to set up the material for the text.  To sample the empty's location use the Object output from a Texture Coordinate node and select the empty in the Object selector box.  Split out the X component with a Separate XYZ node to test if it is greater than 0 (meaning that this part of the text is to the right of the disc/empty) and plug that into a Mix Shader with a Transparent shader in the bottom input.

FYI, if you use a vertex parent you would not need the constraint.

Font Text on Curve Feature

Image below.  Text is placed on a single yellow curve which has a circular portion and a tail.  The tail is very small for this image, it is indicated with the yellow arrow.  The curve has two shape keys.  A basis with a long tail.  A Key 1 with a short tail.  The Shape Key Value [Influence] is animated with keyframes to dynamically change the curve.

Image below.  You can see the curve shape is animated so that some of the text is placed on flat portion of curve and some is placed on circular portion.

Image below. The curve has two shape keys.  Here is the long tail on circle shape key basis. Its often difficult to see long skinny hair lines in explanations. The grid is present in the image to give sense of scale.  Key 1 value 0.

Image below.  The Key Value 1 has value near 1.  The the resulting curve is closer to just a circle.  Just a little tail.

Image below.  Close up.  Curve emphasis  Tiny little tail.  Text is visible.

Discussion
The goal here is to place text on a curve efficiently.  Curve direction can be changed.  Text is left justified.  Some text [spaces] are added before the visible characters to ease the transition between text on flat part of curve and text on circular part of curve.  The curve is treated differently than the concept of Blender [parent/child].  If you rotate the curve it will have no effect on the text.  To achieve rotation animation, rotate the text object.
To create the curve start with a Bezier Circle.  [Cyclic U] set to false since we want circular shape with tail.  Add a new vertex to complete circle and then added tail vertex.  5 on curve vertices.
Image below.  Where the tail meets the circle please reduce the handle lengths to ease visual manageability.


text:
Export Shape Key Animation without Geometry
I was wondering if there is a chance to export a shape key animation from blender (as .fbx) without actually exporting the mesh.
The reason why I am asking is, I want to use and import that animation in Unity. The animation will be applied onto the already imported model with the same poly order. However I don't want to export the same geometry over and over again with each animation fbx I create. It is very redundant and unnecessarily blows up my projects filesize.
Any ideas are welcome, thanks in advance.

Not with any existing exporter that I know of.  Without the mesh, the animation simply consists of keyframes of the various Shape Keys' Value setting.  You could write an exporter to export the F-curves, but then you'd be faced with the problem of the importer, in your case Unity, knowing how to associate the F-curves with the new mesh -- and you would only have the value settings, and no mesh delta information.

thanks for your answer. the problem you mentioned is no problem actually. I export my character once, including the rig and all shape keys. each animation that will have f-curves for the rig and shape keys will be imported individually and applied to the already importer character. so having obly the f-curves for the shape key index is what I need and what will work in unity. I tested this before and it works. Only problem is having redundant geometry with each animation I export. and the reason fir that are the shape keys.

So having a custom exporter would be the solution I guess…


text:
Rigify: How to parent a custom metarig bone to a bone created by rigify on rig generation
In order to rig the pupil and iris size of my eyes I want to add more controls under the basic eye controller object of rigify. The Control Bone I am talking about is called "eyes" after generating the rig.
I know how to add more control bones to a rigify rig, but I have no idea how to make it a child of the "eyes" bone after rig generation since I can't simply parent my custom bone under some eye bone in the metarig because it only exists after rig generation

Perhaps you could create a custom meta rig that's just a copy of the standard rig with your pupil controller added?

@MartyFouts yeah that is what I am doing right now. and in the meta rig I add a bone to control my pupils. When generating the rig I want this particular custom bone to be parented to newly generated standard rigify eye control. I can't do this in the metarig, because the eye contorl bone does not yet exist at this point. It is generated by script and does not exist in the metarig

ah.  Then you probably need to go deeper into rigify customization than I've been. You might have to actually modify the part of the script that generates the rig from the face.super_face metarig.

@martyFouts alright, thanks anyway. I also thougth of just constraining my generated control bone to the eye control, but everytime I overwrite my rig (and i will do this quite often due to rig changes) it kills the generated constraint on my cusotm contorlb one. I read about relinking constraints but somehow it doesnt work.. maybe I am doing something wrong tho

So after many days of researching and posting online, I finally found a built-in way on how to approach parenting custom bones to bones that are only existing after rig generation. ... and to be honest it is super simple and I wonder why I overlooked this feature in the first place. However, this is how you do it:

Create a bone in the metarig (the relation of the bone doesn't really matter, because rigify will change it to your needs on rig creation, just place it where you need it to be in world space)
In pose mode select your newly created bone and go into bone properties tab.
Choose a rigify type (for example basic.super_copy)
In the options enable "Relink Constraints" option
A new text-input called "parent" appears

enter the name of your target parent bone into the input
generate your rig
enjoy your new bone relation for your custom control

If I had to improve this feature I would probably relocate the text-input for the parent relation. It only appears if you enable the "Relink Constraints" option, but imo this option shouldn't be constrained to another option since one could want to change the relation of a bone on rig generation no matter if there are constraints you might want to relink or not. By now it seems like I am the only person on the web who actually used this feature, but if you ever come into the situation where you need it, I hope you found this post and can learn from this answer since the feature isn't documented at all :)


text:
Can one correct intersecting geo with geometry nodes just like I did in Houdini?

I was wondering if anyone has yet discovered a solution to modifiy and correct intersecting geometry in Blender using Geometry Nodes. The provided image shows a correction done in houdini using VEXpressions. I need this correction in order to get proper cloth simulation in Marvelous Designer later on.
EDIT:
this is the VEXpression used in houdini to correct the geo
vector sampleP = @P + @N * chf('offset');
float dist = volumesample(1, 0, sampleP);

if (dist <0){
    f@intersect = 1;
    @P -= @N * chf('N_amp');
}

Interesting Q. I can imagine quite a few possible approaches to the problem?.. what approach did your VEX take?

@RobinBetts I updated the question with Houdini Code. Looking forward to your ideas


text:
How to bend one side of a planar mesh fade the bending effect towards the other side
I couldn't figure out how to bend one side of a planar mesh like the edges on that side follow a circle. I also want this bending effect to fade smoothly towards the other edge. It is like square(projected) piece cut out from a sphere but I want to control the fading effect and I also want one side of the piece to be a line. I thought, this is a primitive thing, it cannot be considered as "do the modeling for me" request. I'm sorry, If I'm not in the right place to ask such a question. I tried different modifiers but I couldn't converge to what I was willing to see. What is the easiest way of doing this in blender?
Edit: I tried to sketch it:
In this sketch, side view shows that from B to C it is bended. This is the final thing that I want to model. Then, I will repeat this round a cylinder. That part is easy. But, initially, I have to figure out how to bend one side of the mesh from B to C like in the first figure. The edges connected to the corner A are just lines. And the shape is symmetrical.

If you could add a few pictures of the effect you're looking for that would help a lot. At the minute it's a little difficult to understand what you're trying to achieve.

is this what you're looking for? https://i.sstatic.net/CY2e8.png

You can have a look at the Warp tool which can be found by searching using the Spacebar menu. I can't really post an answer since I never use it.  All I really know is that the 3D cursor position affects how it turns out.

Here is how to do it. Doing it with modifiers isn't possible as far as I know. If you need more control, comment.

Start by adding a circle.
rotate the circle by 90 degrees on the X axis(RX90).
Delete the bottom half of it.
Take the bottom to vertices and duplicate the by 2 units on the y axis (Shift-DY2).

fill the two vertices.
hit (Ctrl-R).
add 1 less loop cuts then half the number of vertices in your circle you can use the scroll wheel to do this.
Join up all the faces (Ctrl-E>Bridge Edgeloops).
add some loop cuts until your faces are about square.
tweak the shape using proportional editing.

Here is another way to model the smooth shape you want.

Add a circle
In edit mode delete the bottom half of it.
Extrude it to make a half cylinder shape.
Add loop cuts for a smother final shape.
Select the end edge loop.
Turn Proportional Editing on.
Scale the end edge loop to 0 on the Z axis, adjust the Proportional Editing Influence to include all but the other end of the shape.
Again with the same Proportional Editing settings, move the end edge loop down until the bottom is flat.


text:
Sockets writing and reading but no data is received
I've written a very simple script for Blender, to test UNIX UDP sockets for a bigger app. I've got a external script that feeds data into a socket, and another inside Blender (with Always Sensor and Python Controller) that first creates the socket, and then reads from it. The problem is that there is connexion, and data is extracted from the socket, because the buffer never fills, but  "data, addr = GL.s.recvfrom(1024)" returns nothing.
Writer:
s = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
client_address = '/tmp/index'

angle = 0
while True:
    if angle == 0:
        angle = 45
        data = str(angle)
    else:
        angle = 0
        data = str(angle)
    s.sendto(data, client_address)
    print("Sent " + data)

Reader
cont = bge.logic.getCurrentController()
hand = cont.owner
temp_address = '/tmp/index'

if not hand['Once']: # Game property so the socket is only created once
    GL.s = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
    GL.s.setblocking(0)

    # Make sure the socket does not already exist
    try:
        os.unlink(temp_address) # Remove (delete) the file path
    except OSError:
        if os.path.exists(temp_address):
            raise

    GL.s.bind(temp_address)
    hand['Once'] = True

try:
    data, addr = GL.s.recvfrom(1024)
    print("Data received!" + data)
except:
    print("No data yet!")

The Writer keeps writing, and the Reader keeps saying "No data yet".

I've seen that the problem is not in the socket but in the way python treates the exception. There is data stored in data but it raises an error in the recvfrom() so the except block is executed


text:
Soft body self collision BGE
I've got the model of a hand fully rigged and programmed with a python controller, but I can't find a way to make it collide with itself, so the fingers won't "perforate" the hand.
I am in Blender Game, and the mesh is configured as Soft Body and added boundaries, but it keeps acting the same.

Is there a way to make it? Thanks in advance!

You really do that with softbody? Why? usually fingers are animated via armature and playing an action.

It is rigged, the point is that I need the mesh to collide with itself, so I used softbody because in the blender manual says that only soft bodies can collide with themselves. I'm open to other ideas.

I'm pretty sure this manual talks about Blender soft body rather than BGE soft body. These are two separate things (and not compatible). I haven't seen a self-collision option at the BGE soft body. As you already rigged the mesh the armature takes over ALL poses. There is no need for soft body, especially not at the fingers. Just play the action.

The api says that only softbody can collide with themselves and that's true but it referes collision between two or more objects not to self collision. ;)


text:
Changing states in BGE
I am having difficulty changing states with the same keyboard sensor.
The bricks are simple. One keyboard sensor activated by tapping "1" connected to the actuator that will change to state number 2. Then on state number 2 the above keyboard sensor with no changes, connect to the actuator that will change to state number 1.
The initial state is number 1. It manages to change to number 2 but then it does not "come back" to state 1 if I press "1" again. Any ideas why?

You do not need such setting at all. The default (no level trigger, no Level, no Tap, no Invert) will do it's job as is.
How does it work?
State A)
When you press the key the state actuator to State B gets activated. The state changes to State B)

State B)
When you release the key ... nothing happens.
When you press the key the state actuator to State A gets activated. The state changes to State A)

What happens with Tap?
Tap means that the next frame the sensor evaluates False even if the measured event is still present (Tap makes the sensor lie). Evaluating False results in a deactivation of the actuators. The state actuator runs one frame only ... and ignores deactivation completely.
Therefore it works the same way as without Tap.
What happens with Level?
Level means the sensor triggers the controller on state change (additionally to the evaluation changes true/false false/true).
This is problematic. When you press the key it is unlikely you release it within the 1/60s. This means when entering a state the sensor will trigger the controller (with true) and activate the state actuator which switches to the other state.
This way you get constant state changes until you release the key. So you are playing random generator. If that is you goal ... well done. If not ... better disable Level.
What happens with True Level Triggering?
This makes the sensor triggering the controllers when evaluating True all the time. This forces the actuators to get activated as long as the key is pressed. This results in constant state switching.
In difference to Level, you can delay the switching by setting the Frequency parameter (Freq:) to a value greater than zero.
What happens with False Level Triggering?
This makes the sensor triggering the controllers when evaluating False all the time. This forces the actuators to get deactivated as long as the key is not pressed. As deactivation gets ignored .. it just wastes some processing time.
Usually this is not necessary.

In your screenshot you used "Set state". I used "Change state" in my actuator. Your method works without "level", and mine works with "level". Do you know the difference between "set" and "change" ,if yes can you add it to your elaborated answer so I can also mark it?

@Lev you should use set state, it usually cleaner and less faulty for the computer (I have no idea why)

@RadishoftheOpera thanks for the info. Do you know the difference between them 2 by any chance?

no... sorry about that.

"Set" explicitly sets the states as provided by the actuator. "Change" toggles the states set in the actuator. Toggle = if active it will become inactive, if inactive it becomes active. So it depends on the current state. In my eyes "set" is the be cleanest mode to implement a state machine.

I fixed my problem by enabling "level" in the keyboard sensor instead of "tap".
"Tap" seemed more logical to me, so if someone knows why it did not work, let me know.
So if you want to change states with the same keyboard sensor activate "level".


text:
Text in the overlay scene BGE
I have this overlay scene

The numbers are all part of the same text with spaces among them. If I don't make them into meshes and run the game, some spaces between them get lost so the numbers are not where they supposed to be(every number in the start of the respective box). If I alt+C and make them into meshes it works. Why does it fail to work if they are part of text?

I'd consider using bgui for 2D user interface.  It handles scaling quite nicely.  https://github.com/Moguri/bgui

The textures for text objects are generated at scene start. Unfortunately they do not match what you see in the preview window. Therefore it is hard to rely on them. As you have different buttons I suggest to create a single text object for each button.

pqftgs I ll check it out.
@Monster so the mesh of the text(if there is any) is elsewhere than their textures that I see in screen? Or there is no mesh and only textures so what you said happens? (make it into an answer to mark it)

Text objects are converted to a mesh with a plane for each letter. The planes get a rendered texture of the chosen font.
Unfortunately this render does not 100% match the text object it is based on. That is the reason for the size and location differences.
I suggest to split your text object that you get one for each button. This reduces the visible location and size differences. Additionally it allows you to parent the text to the button.


text:
How to make a player follow the cursor?
at first I'll link a video of the effect I am reffering to in the title.
In this video if you skip to 03:40 - 04:00 and to 05:00 - 05:30 you can see two different visualizations of the effect I want to accomplish.
Considering the effect visualized in 03:40 - 04:00, what I did in the past was to add an object everytime I right-clicked my mouse over the navmesh in the hitPosition. That object had the mesh of those arrows(animated) and had a lifespan along with logic bricks that made the player follow those newly-created objects. The problem with this idea though was that the time the player took to travel from his current position to the arrows(cursor) was different every time but the lifespan was fixed. I had many problems with this way I was trying to create this effect and I abandoned it.
Untill I saw this effect in 05:00 - 05:30. This is exactly what I wanted to do. Most new games with isometric or nearly-isometric cameras have this "player to cursor" motion where the player travels to cursor when right-click mouse is pressed and stop travelling when not.
What's the best way to achieve this in blender GE?
I will still have my navmesh to stop the player from getting to some areas.

I would not remove the "target" object. Just let it there. You need just one.
You can activate/deactivate the steering (rather then adding/removing the target object).
To do this you need to sense the events when to do what.
Unfortunately you did not say what you want to get. You just mention what other games are doing.

"player to cursor" motion where the player travels to cursor when right-click mouse is pressed and stop travelling when not

right mouse button sensor -> AND -> steering actuator

This activates the steering on when pressing the right mouse button, and deactivates the steering when releasing the button.
You also need to think about when to place the target object at the hit position under the cursor. Typically you do that once at right mouse button.
You can continuously do that while holding the right mouse button too (be aware the situation when the cursor is over a non-targetable position).

Followed your advice about not removing the object and your steering SCA logic. I got only one question. Would you enable true level triggering in the right mouse button sensor? If I do it works better and strangely enough If I don't I get high gpu latency for reasons that I don't get.

You need true level triggering only to constantly place the target when you hold down the button. The steering will work as long as the actuator is activated. It will not care any subsequent activation signals from any controller. (Placing the target and activating/deactivating the steering are two different operations regardless if they are results of the same event (mouse click).


text:
Grey screen when pressing P in BGE
Eveything was working fine while I was in the BGE until for a reason I don't know, the scene doesn't render. Or to be more exact the 1st layer doesn't render.
I tried to copy all layer 1 objects to layer 2 and then when I pressed P, layer 2 stopped rendering as well.
What do I do wrong? I've seen people talking about clipping etc. but I didn't mess with any settings.
Here's the blend file so you can recreate the above.

you disabled rendering for those object, look in the outliner...

Well, thank you! I must have pressed a shortcut that I am not aware of when I had picked them all. I didn't get suspicious at all to check there. Make it into an answer and I'll mark it. One other might stumble on the same problem.

@Lev You might have pressed W > Restrict Render unselected.

As @m.ardito correctly noticed I had disabled rendering for the objects, which is clearly visible in the outliner.