text:
How do you merge two bones into one?
I have a generated mesh and set of bones from a makehuman model but it created two bones in the shin.
How do I merge the two selected bones into one bone but keep the skeleton intact, i.e. the knee and foot where it should be.

Saw this title on Hot Network Questions, and I wondered, when did we get a MadScience.Stackexchange site?

@MasonWheeler LOL. Welcome to blender.SE ( 3D software.) PS there is a MadScience.SE.

@David: Oh, so now we're putting bones in a blender?  Out of context, that sounds really creepy! ;)

@MasonWheeler We also deal with severed monkey heads and such.

and python smoothies!

@MasonWheeler - we even give those severed monkey heads names.

The universal way to delete something in Blender and merge surrounding elements to a single object is to use Dissolve (Ctrl+X). It works for meshes, nodes, bones and grease pencil points.

I like this better than Alt-M

Is there an advantage of doing it this way as opposed to the ALT M way?

@ChrisStone With this way, your model's weights are much less likely to get screwed up.

With the two bones selected like in the picture in your question, simply press AltM.
That will merge the two bones and take care of the bone relations.

Or You could achieve the same thing in more steps by deleting the two bones, and "filling" a bone between the two ends that are left. Then going and editing the Bone Parent and checking Connected for the top bone.

Thanks a lot! I did try ALT M but I was in pose mode and I was wondering why nothing was happening, Doh!  By the way, how did you make those neat little animations?

@ChrisStone sorry if I never got back to to (or if I did you can just ignore this) Read What is the process for creating gifs for questions and answers? I wrote up my whole process there.


text:
How to set different aspect ratio per camera in the BGE?
I'm trying to make an aplication with several cameras. Each camera is used to render to a texture with the BGE. And then, the main camera render some planes with the views of the rest of the cameras. This allow me to modify the planes to do some quad warping for me to proyect.
The problem I find is that all the cameras share the same aspect ratio, which is defined in the render settings. Is there any way I could specify the aspect ratio for each camera individually?
The idea is that the to main cameras get two views of the interface (a 2.5D type UI), and then they are rendered to the planes which can be distorted to fix the keystone and do the quad warp. A final camera, gets the corrected result, and it is played in the BGE. Since blender doesn't allow two windows, I have to use a 1600*1800 camera to expand the main window to two 1600*900 projectos. I hope it does make sense now.

May you please share your blend via Pasteall.org/blend. Your particular predicament is quite hard to understand without visual aid.

You cannot set the aspect ratio of the cameras individually. But if you are using videotexture already, why not just change the aspect ratio of the planes to get the aspect ratio you want?

As you can see in the new photos I've uploaded, it's not so easy. The textures are already 16:9, but the final composition has to be 16:18. I think you have worked a lot with projections, so if you find another way to solve this problem, it would be great. Maybe get the texture from another scene?

source: Stack Exchange

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

sort: votes


text:
How can I hide 'mark sharp' lines?
Right now I'm working with a mesh, and have several lines that I've marked sharp. Now I'd like to mark seams to unwrap it, however the cyan 'sharp' lines are always on top of the red 'seam' lines, preventing me from seeing my unwrap progress.
How can I toggle the display of marked edges?

Unrelated, but you can change the colors of the lines (User Preferences > Themes > 3D View > Edge Sharp and Edge Seam).

Yes. While in Edit mode, have a look in the 3D View's Properties region (N). There's a panel labelled "Mesh Display", and within it, a section labelled "Overlays". There you have an array of checkboxes to toggle the visibility of various overlays. If you want to disable sharp lines, left-click the Sharp checkbox and you should be good to go.

As of 4.1 (and, presumably, 4.2), Mesh Edit Mode Overlay is a separate menu, not a part of Viewport Overlays:

Since the 2.8 UI overhaul, the option is moved to the header > overlays > mesh edit mode:

Make sure that you are in edit mode, or the options won't be visible.

Blender 4.1 they removed Mesh Edit Mode from that drop down. Now i just have to find out where they are hiding it. Help please!

You are sure you are in edit mode @JohnMadsen

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

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


text:
How can I skew an object?
I have a complex mesh that I would like to change the proportions to. Using this mesh as a simplified example, how to I make this:

Into this?

Again, the mesh I'm working with is complex, so simplifying it into a 6-sided square, shrinking one face, then subdividing it would not be a viable option.

You can do this non-destructively using a Simple Deform Modifier.

Select the desired mesh
In the modifiers tab add a Simple Deform Modifier
Set the type to Taper
Adjust Factor to increase/decrease the amount of deformation.


text:
Why are my normal vectors getting thrown off when merging by distance?
In Blender 3.3.0, I have an FBX file that I have imported:

These are all separate faces, so I use Mesh > Clean up > Merge by Distance:

As shown above, the Merge by Distance command throws off my normal vectors for some reason. This persists even when doing Mesh > Shading > Flat Faces:

Enabling Display Normals shows the correct direction:

Going to Mesh > Normals > Reset vectors corrects the issue:

The normals appear to be identical:

However, I plan to do this multiple times and resetting the vectors every time I import an object would become quite tedious. I would prefer that the normals not be thrown off in the first place.
How can I prevent the normals on my mesh from getting thrown off when using the Merge by Distance command?

Not sure why it's happening without seeing your project, but often, blender "changes it's mind" about the inward/outward direction of  normals when merging by distance (in your image, the Face Normals look correct, but that doesn't mean the edge or vertex normals are "playing along" ). I know it may be tedious, but resetting normals can be simplified by the shortcut Shift+N with the whole object selected in edit mode.

Try the free version of Machin3Tools and see if it helps, just have to hit the 3 key in edit mode Machin3Tools

You need to be looking at face-corner (vertex-per-face) normals, rather than vertex normals or face normals... see answer.

I think this may be related to reported misbehaviour in the way .fbx import/export handles Split Normals Data.
Here are two identical objects. Both are flat-shaded, have all edges split, and have a Custom Split Normals Data layer added in the Data tab > Geometry Data panel. Both have Auto Smooth switched on, so they are using the custom normals.
The one on the left has been exported and re-imported as an .fbx:

When vertices on both objects are merged, as shown above , the .fbx import appears to interpolate the custom normals at vertices, (furthermore, in a way that makes no obvious sense), which, at least to me, is unexpected. You would expect split normals to belong to face-corners, and so survive the merge of vertices without interpolation, as on the right.
TL;DR
After merging vertices, clear the faulty split normals in the Geometry Data panel.

I'll hang on a  while for someone to tell me I'm wrong, and then add a link to this post to the related bug report.

I believe Blender can handle custom normals as face-corner, as vertex data, or even as groups of face-corner data.  When the mesh is manifold, it's clear which is which, but once the edges are split, there's no longer any information about whether a particular custom normal should be face-corner or vertex.  I'm not so sure that this is a situation where there is a right answer, presuming that .fbx uses the simplest methods, where custom normals are all single face-corner.  A "keep normals" operator on merge (or rip, or separate) might be a valuable right-click-select kind of suggestion though.

Hi @Nathan! Thanks!  OK...  I just thought.. if it was  called 'Custom Split Normals Data'.. then it had to be stored on loops, not vertices. Otherwise it wouldn't be split. Could be just a misleading name..

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


text:
Possible to bake texture to new UV map?
I have a finished model where the UV maps overlap - lots of wood that isn't detailed to be particular to the model.

I'd like to re-map the texture so that specific details can be added. I'd like to rebuild the UV map into non-overlapping islands, without losing the current texture application, and preferably without manually pulling apart the islands.
Is this possible?

Yes, using texture baking.
The workflows are slightly different depending on the render engine you are using, but here's how to do it in cycles.
A screenshot just to show how things are initially:

Create a new UV map in Properties > Object data, then with it selected, edit or re-unwrap to make the second UV map layed out how you want it:

Create a new image to bake to by pressing ⎇ AltN in the image editor, or by pressing new in header > Image:

Add a texture node to your material(s), set to the image you want to bake to.

Connect the texture you want to bake from with an emission shader and set hte bake type to emit. Then with the new UV map still selected in Object data and the target image's texture node selected in the material node setup(s), press Bake:

After it's baked, remember to save the image. F3 to save it to disk, or header > image > Pack as PNG to pack it into the .blend as a png.

This is so very useful thanks a lot, i knew it was baking but not how.

Wow, it actually worked! Thank you so much! Crazy that you have to have the old and new image in the material's nodes. Even though, now that I think of it, it makes sense :)

As an additional note to section 1:

Make sure the renderable UV map is set to the original. I had it accidentally on the new_map and it messed up the process

That note is crucial, if not for this, I would have spent hours looking for why my bake would overwrite my texture constantly! This also goes for baking with Blender Internal Render


text:
How do I flip an animation pose without having my character walk backwards?
I have been making a walking animation. It went pretty well up to this point where I'm halfway done:
https://gyazo.com/118b8e402ea4f2aa2d89e217e1be474b
I watched a tutorial where he copied his animation and ctrl+shift+V'ed it to get the other half. I tried to do the same, but although it's close, it's not exactly what I wanted:
https://gyazo.com/89c10c29c4e68e2edb23f1bb187d0b74
The only problem is that the two halves are walking in opposite directions now. So my question is: What are my options? Do I have to manually make the poses for the other half, or can I somehow make it work with what I have here? Thank you!
Edit with link to file:

Edit 2: I ended up manually creating the second half of my animation. Below you can see the result. My question now is if I could have achieved this without having to manually animating the 2nd half?

Welcome @Jesper. I suggest you upload the file for analysis: https://blend-exchange.giantcowfilms.com/

@LeoNas Thanks. I have uploaded the file.

Hi, please don't link images/screenshots from external sources, but instead use the question editor to load images: they will be permanent and embedded in your post, making easier for others to understand your issue.

You want him to walk obliquely but it's not the right way to do it as all mirror will stay in the X or Z axis, you must create your walk cycle in Pose mode orthogonally to the grid THEN switch to Object mode and rotate it 45°.
You must keep in mind that, when you mirror a pose, it will be RELATIVE TO THE LOCAL AXIS OF THE OBJECT, so if you rotate your armature 45° in Pose mode instead of Object mode, the armature is 45° rotated but the local axis is still orthogonal to the grid and will act this way for whatever mirror you'll do. If you want to rotate the Local axis you need to do it in Object mode.
If you have secondary animations, like the head rotating, you can either do it after the rotation in Object mode OR do a second animation, the head rotation, and use the NLA to add it to the walk.
I would redo it from scratch: Close the action in the Action Editor (X button), in Pose mode select all the bones and reset the pose with alt R, alt S, alt G, in Object mode select your armature and rotate it 90° on the Z axis so that you can see its right profile in Front Ortho view, then back in Pose mode and begin with the first pose of your walk cycle.
Also, your foot is strangely set, in Edit mode I would delete the constraint, parent (Keep Offset mode) with the legIK controllers and also in Properties > Bone > Relations, enable Inherit Rotation.
If you want your character to walk sideways you have to rotate your character in Object mode, not in Pose mode

Thanks, I will try what you have suggested. I am a little confused by the last part though. You want me to delete the Copy Rotation constraint on my foot, parent the foot with legIK and disable inherit rotation on legIK, correct? Also, can you explain how I "parent (Keep Offset mode) with the legIK" ?

Also, I might have done something wrong, but after doing what you described I am now facing the exact same problem where the two halves are walking in opposite directions after shift+ctrl.V'ing.

sorry I meant enable inherit rotation   ;)

no you should fix your problem if you strictly follow the steps, I will check again. Update: ok so I checked and it works perfectly.

Can you send me the updated file? Maybe I can see what I've done wrong

Or if it wouldn't be of too much trouble and the steps don't take long for you to do, maybe you can make a short video/gif that shows the steps.

I reset the pose, rotated it 90 degrees on the Z axis in Object mode so I had its right profile in Front Ortho view, then went into Pose mode and created the first half of my walk cycle and that's where I'm stuck: https://gyazo.com/4b0ff201698c7ca4592f56fcad54aa94

I've uploaded a picture of the different steps

Yeah that works, but I don't see how it solves my problem. I need it to walk sideways while looking straight forward. If I for example rotate the hips to face right, they will be rotated to face left when I ctrl+shift+V which makes it walk in the opposite direction. Sorry if that was not clear in the post.

if you want your character to walk sideways you have to rotate him in Object mode, not in Pose mode

But I can't rotate parts individually in Object Mode, so I don't see how that would work. Anyway, I ended up manually creating the poses for the second half of my animation. I edited my post to show the result. I guess what I really would like to know is if I could have achieved that without manually creating the poses for the 2nd half?

why do you want to rotate parts individually? Create a walk in Pose mode, ORTHOGONAL to an axis of your grid, for example your character go towards the X direction. When you have finished, come back to the Object mode, then rotate your character towards the direction you want, whatever this is, for example 45° on the Z axis. Why do you need to do that? Because when you mirror the pose in Pose mode, it will use an axis orthogonal to the grid! - Well, technically, to your Local axis, that's what you have to keep in mind!

I need to rotate parts individually because, for example, as you can see in the gif I posted, I want the character to walk sideways with the body slightly rotated to that side while the head is looking straight ahead. I need them to not be rotated the same amount to achieve this. It sounds like mirroring is not possible for achieving what I want and the way I did it is the only way.

Reformulation of what I want to say, I hope it's clearer: You must keep in mind that, when you mirror a pose, it will be RELATIVE TO THE LOCAL AXIS OF THE OBJECT, so if you rotate your armature 45° in Pose mode instead of Object mode, the armature is 45° rotated but the local axis is still orthogonal to the grid and will act this way for whatever mirror you'll do. If you want to rotate the Local axis you need to do it in Object mode. So for your animation, create the walk cycle, then rotate the character in Oblect mode, and only then make some additional animations like the head...

So just to be clear: All parts that I want to be rotated in the animation (like the head, actually everything in my case) is something that I have to do manually for the whole animation after creating the walk cycle. It's not something I can just mirror. Correct?
If yes, then great, because that is basically what I ended up doing - I was just hoping there was an easier way. If not, then sorry, I guess I just don't get it.  Maybe I'm just too dumb. Anyway, thanks for trying to explain it.

yes, create the animation orthogonally to your Local axis, then in Object mode rotate your character, and only then make your secondary animations like head. BUT if you have a lot of secondary animations the best is to use the NLA editor window, that will allow you to keep the walk intact and a second, third, fourth animations, etc... you can stack several animation tracks: for example on the first one the basic walk, and over this one the animation of the head. Watch some tutorials about the NLA editor.


text:
Weird changes in object mode after editing in edit mode
I wanted to try and make eyes, nose etc. for my character, so I went into edit mode and started changing the head of the mesh:

After making a few changes, I went back into object mode and saw this:

I suspect it has something to do with Shape Keys, but I'm still a newbie so I'm really not sure. I had "Basis" selected in Shape Keys while making the changes, but I'm not sure that's correct. What's happening and how do I fix it? Thanks.

Edit: I was following the steps of the accepted answer of this post:
Eye socket help
Turns out it was the Knife Tool that caused my problem. I made a cut which didn't connect to a vertex, which apparently is a no-go. I still have no idea why my Shape Keys are affecting the the new vertices that I created on the face.

Hi Jesper I just look into your file and U have a HORRIBLE mess in the vertex groups and that makes the problems (for example in HEAD U missed some vertices on head but have another on back and hand assigned!). Try to inspect all those groups and assign correct vertices to correct groups - it solves all of your problems.

...as U could see here: http://pasteall.org/pic/d91f55da38960f7f46dbeeebc35878b9 ...now everything on the HEAD (others still a mess) is just fine but try it yourself as a training ;). Let me know if another prolem appears.

@JanMatys Thanks for your reply. I guess that is what you get for downloading someone else's mesh. I didn't make any of the vertex groups. Anyway, I tried correcting some of them (Head, neck, chest, hips) and I don't see any effect when I go back to Object Mode. Do I have to correct every single one before I can see an effect? Also, it really confused me that editing the head as little as I did could make such a huge mess... Everything was fine before.

@JanMatys Okay so I fixed the problem with the mesh looking all crazy. However, When I turn up the value of the Shape Keys for feet, legs, torso etc. I can see that it is affecting the vertices I have created on the face to model eyes, nose etc. How do I fix that?

Hi Jesper please upload the file how it looks now ... will try to check it soon.

Turns out it was the Knife Tool that caused one my problems. I made a cut which didn't connect to a vertex, which apparently is a no-go. After fixing this, changing the value of my shape keys still affected the new vertices that I added to the face. I solved this by adding the vertex group that I wanted to be affected by the individual shape keys to their "Blend" options.

Was this the solution to fixing your initial problem, or the one you had after following up on Jan Matys' comment?

In object mode, the slider for the shape key becomes activated, so that you can see what your shape key does.
However make sure that you are working on the shape key that you want to change.
For example, if you are making a change to the basis shape key, there will be no slider 0 placement.
You can delete the two shape keys if you want, by pressing the - button adjacent to the shape key list. You probably want to add them later once you have enough vertices.
I read some Blender users who wrote shape keys can be added to with new vertices and still function.
I guess this sort of thing requires an extra step for visual expectations to be met.. you may have to use a function like, a "new shape key from the mix" to add the new vertices and get them to move how you want them to. I haven't tried this yet.

If you still wish to repair the model, here is how:
Tab into edit mode and select the head key under object data (The Upside down Triangle with vertices).
Hide all the other keys if they are not already.
Your object should look normal, now toggle on and off the legs key and select the affected vertices.
Once they are all selected, delete them. (X > Vertices)
Hide every key except basis and select it. Now rebuild the faces. This is fairly easy with edge select and press  F.
Double check your weight painting and your all good.

Fellas dont use ANSWER as comments please next time.


text:
Blender character to unity scale problem
This has probably been asked many times before, but I can't find a solution to my problem. I have created a character in Blender, and when I import it into Unity by dragging in the .blend file, the character is huge compared to for example a default cube object:

Here is an image of my character and a cube in blender, along with the character's dimensions in meters:

Why is this happening, and how do I fix it? Hopefully someone can spot the issue, otherwise let me know if you need more info.

I solved it. Scene -> Units -> Set it to centimeters.


text:
What's the purpose of these red lines in edit mode?
What for are these red lines in that model?
They don't seem selectable

They are seams to assist with UV unwrapping.

https://youtu.be/Y7M-B6xnaEM


text:
my smoke simulation doesn't render correctly in cycles
This is my smoke in eevee rendered viewport:

This is my smoke in cycles rendered viewport:

When I rendered an image same thing happened.
I used only principled volume node and attach to volume.
my .blend file

hi and welcome to the forum! please use https://blend-exchange.giantcowfilms.com/ to share .blend files

Ok i will do this today

İ couldn t find any solution

The solution is empty space in smoke domain settings. it should be zero.


text:
What is the replacement of 'scene.render.layers['RenderLayer']' in blender 2.8?
It seems that the property scene.render.layers['RenderLayer'] is no longer available in blender-2.8. I just want to set the use_pass_uv property of the current scene, then what should I do?
'scene.render.layers['RenderLayer'].use_pass_uv=True' works well in blender-2.7, but in blender-2.8, there was an error like this ''AttributeError: 'RenderSettings' object has no attribute 'layers

'scene.render.layers['RenderLayer'].use_pass_uv=True' works well in blender-2.7, but in blender-2.8, there was an error like this ''AttributeError: 'RenderSettings' object has no attribute 'layers'

You can use the [edit] link at the bottom of your post to modify the text instead of using comments.

Render layers have been replaced by View Layers. Recommend do a search in the API docs or use the python console to figure out how to access the ViewLayers of the current scene:
 >>> C.scene.view_
                 layers
                 settings

>>> for vl in C.scene.view_layers: # Iterate through all view layers
...     print (vl.name) # print the name
...
View Layer
View Layer.001
View Layer.002
...

You can also access the current ViewLayer (in context) by using bpy.context.view_layer (or by using C convenience variable in the console C.view_layer):
>>> C.view_layer # View layer reference
bpy.data.scenes['Scene'].view_layers["View Layer"]

>>> C.view_layer.name # View layer name
'View Layer.001'

Another way is using get(<LAYERNAME>) on Scene.ViewLayers collection:
>>> C.scene.view_layers.get('View Layer')
bpy.data.scenes['Scene'].view_layers["View Layer"]

>>> my_vl = C.scene.view_layers.get('View Layer')
>>> my_vl.name
'View Layer'

Basic example on how to set attributes of the current view layer (in context):
import bpy

# Get the current view layer
vl = bpy.context.view_layer

# Set uv pass attribute
vl.use_pass_uv = True

# Set normal pass attribute
vl.use_pass_normal = True

# Enable diffuse light passes
vl.use_pass_diffuse_direct = True
vl.use_pass_diffuse_indirect = True
vl.use_pass_diffuse_color = True

Example on how to enable the 'UV' as well as the 'Normal' pass on all view layers in the scene:
import bpy

for vl in bpy.context.scene.view_layers:
    vl.use_pass_uv = True       # Enable UV pass
    vl.use_pass_normal = True   # Enable normal pass

Thanks for your kindly reply! It helps solving my problem.


text:
How to change the ratio of movement of a driver?
I have set up a driver which causes an object's z location to controller the other objects x rotation. It works, but I have to move the driver a long way in order to get only a slight change on the driven objects rotation. How do I change this ratio so that the driven object is affected more by less movement of the driver?

Hi. Please make the title of your question specific to the problem you are having and not just the general topic. Thanks.

You can simply multiply the driver value.

Select the driven object and go to Drivers editor
Click your Driver (mine is called Z Euler Rotation)
Go to Sidebar (N) > Modifiers > Generator and add a multiplier value

Perfect, thank you!

Glad to be of help :).


text:
Texture messes up after extruding a modified plane
I want to make some 3d models of pixel art. I started by adding a plane, adding a texture to it, added loop cuts to my plane, 15 loop cuts because it's a 16x16 texture, then I selected the blank faces and deleted them.
As I extrude this plane, A > E > $0.1$, the texture messes up on the edge of the item, as shown below

Although not all faces mess up on the edge, a lot still do. I tried recalculating normals, unwrapping the object again, but I ended with the same problem, no change at all. Though I may have done it wrong, since I never did it before.
I tried smart UV project and cube projection, but they just mess it up even more.
Does anyone have a solution to this?

The error results from anti-aliasing / inaccuracy / interpolation of the UV across faces. A solution is to get each face to read from a single point in the image.
This involves a couple more steps than it should, IMO.. it should not be necessary to split the geometry to do this, seams should do the job... but still, in 2.91, they don't.
You've probably already done most of this.. starting in the flat, with a simple plane:

Subdivide your plane with 15 cuts for 16x16 pixels, as you have.
Edit mode, Edge, All selected, right-click menu > Edge Split
UV Edit.. U Unwrap > Project from View (Bounds)
With the pivot in the UV Edit window set to 2D cursor, select all, move faces so the bottom left of the map is at the bottom left of the texture, select the vertex there, and Shift S snap the cursor to it.
Scale the map in X and Y so each face covers a pixel..

And as above, switch pivot to 'Individual Origins', and scale the UV faces to 0.
Back in the 3D View, AltM Merge > By Distance, weld the faces in the geometry back together.

Now the result of an extrusion or Solidify modifier will be clean.

Took me a while to figure out why it wasn't working, when I realized I needed to do this with a fresh project, as this must be done on a none extruded plane. Thanks!

Thanks to you, here's my first small project on 3d pixel art in blender! https://ibb.co/wWbkydK

@MaxAnimator  Yay! Thanks for sharing! Will edit answer, to make it a bit clearer.


text:
No shadows on plane in Eevee Rendering
Cycle renders is all good.

but, here is the Eevee one.

Its someway apart. What settings I need to change?

What type of light are you using?

To make the shadows stand out the most, a point light with a small radius is ideal. However, if you are using an area light or a sun light (or other large scene lighting), you can still achieve clean shadows by disabling "Soft Shadows" in the Render Properties settings. This will give the shadow an "aliased" look, however, so you may have to increase the Cube Size accordingly. Also, make sure to check "High Bitdepth".

For any lights you are using, go to the light properties, and make sure "Contact Shadows" is checked. This will make sure adjacent touching surfaces don't allow light to leak through.

Gotta admit, answers like this one are very appreciated :). Was never sure what these settings actually do.


text:
Copy rotation on limbs curl when character is rotated
The limbs on the ears, fingers, and feet curl whenever I rotate the main controller for the character. I checked for dependency loops, and tried switching the method of rotation to median point, individual origins, etc. But nothing seems to make any difference. Any ideas? Thank you all for looking at my question here.

Okay! So as it turns out, I was being awfully clumsy. I had a limit rotation on the feet, and was all upset when it didn't rotate all the way LOL! Also, I found out that I was using local space with parent for all the other limbs, such as the ears and fingers. The moral of this story is, always double-check your work. Thank you all for reading!


text:
How to fix problems withe textures of imported model?
I downloaded a fbx model from cgtrader.com. The model contains textures, but doesn't look good. First problem is that the textures of the head aren't placed correctly. The second problem is that the top can't be textured and only shows a pink color.
Trying to resolve the second problem, in UV mode I opened the image texture, selected the pink areas and replaced the auto generated grid to texture image, but it didn't work.

In render properties change render engine from eevee to cycles.
Create new material, assign this material to pink place and copy nodes from other texture, then change properties for current nodes.


text:
Background Image Setting Equirectangular is missing
For some reason, a previous saved blender project managed to give me the Background image option called 'Equirectangular' to successfully show the image. However, having recently started another project, that option is no longer available to me. Now I can't display a background image. Here are some screenshots of the settings. First one is with the Equirectangular' option, and the second image is not giving me that. Instead it gives me an extra setting box.

How did you add the image? These are the settings for an  Image Texture , not an Environment Texture.

Thanks for pointing that out. That was was the actual issue -- I chose Image Texture instead of Environment Texture. It's working now. Thanks again.


text:
Shapekey range animates in viewport but not in render
I have a mesh with two shape keys (Basis and Key). I keyframed the value of Key from 0 to 1 and back to 0, and added a cyclic modifier to its f-curve, so that the mesh continuously "pulses" between Basis and Key. Then I add keyframes to Key's Range Max, to control how much the Key shape influences the mesh at different times.
When playing the animation in the 3d Viewport or rendering a still, everything behave as expected, but when rendering the animation, the keyframed Range Max is discarded. If I start rendering whilst the playhead is on a frame where Range Max = 1, it stays at 1 for the whole animation and it stays at 0 if I start rendering from a frame where Range Max = 0 (so in this case doesn't animate the shapekey at all).
I've search to see if it's a known bug and didn't find anything. Also saw that cyclic dependencies could be a problem but I don't think that's what's happening here.
Here's a simple test file to illustrate. Compare playing in Viewport, with rendering from frame 1 to 100, with rendering from frame 50 to 100.

Edit: looks like a bug so I filed a report here

Hello, I feel like you could achieve the same effect with just the value keyframed. Looks like you know how to use fcurves modifiers. Set the After to No Cycles in your cycle modifier and you'll achieve the same result. FYI I think your problem comes from the fact that modifying the Max Range does not automatically cause an update of the value

hi, thanks but the example is a simplified version. In my actual project the shapekey is on a lattice that makes a character sway to the rhythm of a song for 3 minutes (hence the cycle). At 2 different moments i need the char to stand still for 10s each time. It looks perfect when played in the viewport, with the max range updating the value just fine

@Gorgious ... and also, the problem is the same when baking the cycled curve

It is a bug in 2.90 (and 2.8x). It is fixed in 2.91 alpha


text:
How can I model the crevasses in this low-poly sphere?
I've been trying to recreate the main grey sphere in this image:

My guess so far is that the approach should be to decimate an icosphere, then inset and scale down to make the crevasses. If that's the best approach, I can't figure out how how to get nice variability in the size of the faces.
Is my idea there right, and if so how can I achieve that geometry?

The Cell Fracture add-on would be a good start.
(The Cell Fracture add-on comes with Blender, all you have to do, is activating it via Menu -> Edit -> Preferences -> Add-ons)

Create a sphere (icosphere or rounded cube work best) with a decent polycount.

Initiate Cell Fracture via F3 - Search - Cell Fracture.
In the settings dialog under "Own Particles" - "Point Source",
change the Source Limit to 50 and under "Recursive Shatter", change
the Recursive Subdivision to "Big" and hit "OK".

Hide the original sphere, then select all objects with "_cell" in
their names.
Go to the "Transform Options" dropdown menu and check "Locations".
This will provide us with the option to "explode" the individual
objects away from their origins, which in our case is the center of
the original sphere.

Hit S and scale the selected objects, until the desired
gap size is reached.

You can then unhide the original sphere and proceed from there with
additional modifications (decimate, boolean, etc)


text:
Eyes wrong position after import
This is how my character looks in Blender:

After importing him to Unity, the eyes are no longer positioned correctly:

What could the problem be? How do I fix it?

@JudeDesir I'm quite new to this so I'm not sure. In unity, he is in the T-pose and in blender, I have ALT+G and ALT+R'ed him so I would say he is in the default pose. How do I check if there is a problem with the weighting?

@JudeDesir I have added my .blend file. Thank you so much dude!

@JudeDesir Hmm I'm not sure. When I click on e.g. my left eye, "Eye.L", under "Object" it says that the parent is the bone "Eye.L". Regarding the vertex group, under "Data" when I press "Select" on "Eyes" after going into Edit mode of an eye, it correctly selects all the vertices of that eye?

The issue is in your skinning.
For a mesh to be deformed by a bone, you need this mesh to be assigned to a vertex group named exactly like the bone.
Your eyes are assigned to a single vertex group named "Eyes", while you have two bones, named "Eye.L" and "Eye.R". So you have to remove that "Eyes" group, create new groups with the bones's names and assign the geometry accordingly.
Also, for each bone not supposed to deform the mesh, you should uncheck the Deform panel:

This will avoid unnecessary calculations, memory overload, and such non-deforming bones won't create vertex groups as they don't need to.

After doing this, if you for example start my "Idle" animation, the eyes are not in their sockets anymore. Is there an easy way to fix this, or do I have to manually set the position of the eyes for all my animations to place them in the sockets?

Remove the armature deform modifiers on each eye, select both of them in object mode, then the armature in object mode, and do Ctrl P → Armature deform. It will just recreate the armature deform modifiers, and you should be good from there.

When I unchecked "Deform" on the eyes, it worked. After doing the last steps with Ctrl + P the eyes no longer moved with the rest of the mesh?

Because you set their bones to not deform. Don't set bones not to deform if you want them to deform.

Sorry, I'm a complete newb and you didn't tell me to recheck the "Deform" button after unchecking. Anyway, it works now. Thanks a ton.

I wrote for each bone not supposed not to deform the mesh, I meant for each bone not supposed to deform the mesh.

Yeah, but you also wrote here in the comments Remove the armature deform modifiers on each eye. But yea, the mistake is probably on me for misunderstanding something. We should probably stop discussing this though. Again, thank you very much for your help.


text:
How do I shift a vertex to establish a single, flat surface on a quad?
One thing that I've noticed when drawing quads is that, if a single surface cannot be established using the vertex arrangement (for example, if you add the default plane and raise a single vertex to 1 on the Z-axis), Blender will treat it a quad (subsurf works fine with it and will smooth it out into a hyperbolic surface) but render it as two conjoined tris (prior to the subsurf).
Now, I'm fairly certain that I should avoid this in most cases and would want to fix it if it does occur. In my example above, I could obviously just shift the vertex back to 0 on the Z-axis, because the surface is completely flat. However, if I were to rotate this quad, I would be in a situation where moving the vertex to establish a flat surface would require very precise changes to the X, Y, and Z positions.
I was wondering if there is some feature of Blender or a technique to adjust vertices exactly that the quad is absolutely flat, even if the quad is rotated.
P.S. I apologize for the very technical  and possibly pedantic style of writing. Because I want to ensure the question is communicated clearly, I felt that it was necessary to be scrupulous.

Related https://blender.stackexchange.com/questions/35193/how-to-flatten-a-non-planar-face-to-a-targeted-plane

Extracted from my answer here, here is another scripted option. In contrary
to Blender Dadaist's answer, this method creates a planar quad, by only moving the active vertex. ⇧ Shift RMB select the three vertices of the quad, which are not supposed to change, then ⇧ Shift RMB select the vertice of the quad, which you wish to change, marking it as the active vertex.

The script registers an operator and places it in the menu: Mesh > Vertices > Flatten Vertex with the hotkey ⎈ Ctrl⇧ ShiftM.
bl_info = {
    "name": "Flatten Vertex Onto Face",
    "category": "Object",
}

import bpy
import bmesh

class ObjectFlattenVertex(bpy.types.Operator):
    """Flatten Vertex Onto Face"""
    bl_idname = "edit_mesh.flatten_vertex"
    bl_label = "Flatten Vertex"
    bl_options = {'REGISTER', 'UNDO'}

    influence = bpy.props.FloatProperty(name='Influence', subtype='PERCENTAGE', default=1, min=0, max=1)

    def execute(self, context):
        if (context.object == None):
            self.report({'ERROR_INVALID_CONTEXT'}, "This is only possible with vertices of an object.")
            return {'CANCELLED'}
        me = context.object.data

        if me.is_editmode:
            bm = bmesh.from_edit_mesh(me)
        else:
            bm = bmesh.new()
            bm.from_mesh(me)

        for elem in bm.select_history:
            if (isinstance(elem, bmesh.types.BMVert) == False):
                self.report({'ERROR_INVALID_INPUT'}, "Select vertices only.")
                return {'CANCELLED'}
        if len(bm.select_history) != 4:
            self.report({'ERROR_INVALID_INPUT'}, "Select exactly four vertices.")
            return {'CANCELLED'}
        if (bm.select_history.active == None):
            self.report({'ERROR_INVALID_INPUT'}, "Require an active vertex.")
            return {'CANCELLED'}
        active = bm.select_history.active
        # get only selected vertices
        p1, p2, origin = [v.co for v in bm.select_history if v != active]
        a = active.co - origin
        # normal
        n =  (p1 - origin).cross(p2 - origin)
        # projected
        prj =  n.cross(a.cross(n) / n.length) / n.length
        active.co = self.influence * prj + (1 - self.influence) * a + origin

        if bm.is_wrapped:
            bmesh.update_edit_mesh(me, False, False)
        else:
            bm.to_mesh(me)
            me.update()
        return {'FINISHED'}

def menu_func(self, context):
    self.layout.operator(ObjectFlattenVertex.bl_idname)

addon_keymaps = []

def register():
    bpy.utils.register_class(ObjectFlattenVertex)
    bpy.types.VIEW3D_MT_edit_mesh_vertices.append(menu_func)

    wm = bpy.context.window_manager # keymap
    kc = wm.keyconfigs.addon # background mode check
    if kc:
        km = wm.keyconfigs.addon.keymaps.new(name = "Window",space_type='EMPTY', region_type='WINDOW')
        kmi = km.keymap_items.new(ObjectFlattenVertex.bl_idname, type = "M", shift=True, ctrl=True, value = "PRESS")
        addon_keymaps.append(km)

def unregister():
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()

    bpy.utils.unregister_class(ObjectFlattenVertex)
    bpy.types.VIEW3D_MT_edit_mesh_vertices.remove(menu_func)

if __name__ == "__main__":
    register()

Some math
At # get only selected vertices the selected three vertice's coordinates (not the active) are stored in p1, p2 and origin. The active vertex is stored in active.
The two directional vectors of the plane are p1 - origin and p2 - origin. The "base" of the plane is at origin.
Thus, the normal vector of the plane is n =  (p1 - origin).cross(p2 - origin) (cross product).
The active vertex's position relativ to the origin is at a = active.co - origin.
Now, a has to be projected onto the plane with the normal vector n. This is explained here.

In case the link goes down, I will excerpt the math in a very condensed form, but it's just projecting the vector a onto the plane.
a1  ...        a projected onto the plane
|a| ...        magnitude of a
θ   ...        angle between a and n

d   ...        directional vector pointing to a (normalized)
d = (a / |a|) × ((b × a)/|(b × a)|)
d = norm(a) × norm(b × a)

l   ...        magnitude of the projected vector
l = |a| · sin(θ)

a1 = l · d
a1 = |a| · sin(θ) · norm(a) × norm(b × a)

Given: norm(a) × norm(b) = norm(a × b) · sin(θ)
a1 = norm(a) · norm(n) × norm(a) × norm(n)

a1 = n × (a × n / |n|) / |n|

The shift the projected vector a1 by the position of the origin.

Neat solution indeed! But I need some time to understand it. Would you mind explaining prj =  n.cross(a.cross(n) / n.length) / n.length or maybe just give a pointer where the relevant information can be found? Thank you.

@BlenderDadaist See edit.

If you only care about planar faces in general, then there's an automatic way for that by selecting Mesh > Clean Up > Make Planar Faces.
If you really want to only move a specific vertex of the quad, you can

move the 3D Cursor to one of the three other vertices (Select the vertex, Shift+S > Cursor to Selected) and switch to Pivot Point > 3D Cursor (. key)
Shift-select all three vertices that should define your plane and should not move
Hit Ctrl+Alt+Space to define a custom Transform Orientation
Select the vertex that you want to move and scale it locally along the Z-axis of the new transform orientation: SZZ 0 Enter

I knew it had to be somewhere ... of course, my meshes never need cleaning up... so I've never found that button   ¦  l

This should be possible via python. Basically you rotate the vertex in question around the origin by the difference between the normals of the two planar faces of the non-planar quad.
import bmesh
import bpy

bm = bmesh.from_edit_mesh(bpy.context.object.data)
vert = [v for v in bm.verts if v.select == True][0]
face = vert.link_faces[0] #Assuming single linked face
i = [i for i in range(0, len(face.verts)) if face.verts[i] == vert][0]
next  = face.verts[(i+1)%4]#quad
prev  = face.verts[(i-1)%4]
opp  = face.verts[(i+2)%4]
f1 = bm.faces.new([prev, vert, next])
f2 = bm.faces.new([next, opp, prev])
f1.normal_update()
f2.normal_update()
quat = f1.normal.rotation_difference(f2.normal)
bmesh.ops.rotate(bm, cent=(0,0,0), matrix=quat.to_matrix(), verts=[vert])
bm.faces.remove(f1)
bm.faces.remove(f2)
bpy.ops.object.mode_set(mode = 'OBJECT', toggle = False)

Interesting take, cool re using the modulus to get other verts from index.  Is it worth noting that this method using  rotation preserves edge length.  Method here translates vert to closest point on  plane defined by other 3 face verts.  Could use i = face.verts[:].index(vert)


text:
How can I make hair that looks like it's flowing in water?
I want to make a scene featuring a killer mermaid. I've run into two big issues: the flow of the hair and the effect of her prey's blood in the water, though I've put the blood thing into a separate question.
I want the mermaids hair to float around like it's being affected by the current, as well as move accordingly when she moves in an animation. The best examples for the hair effect that I can think of are Salazar from Pirates of the Caribbean: Dead Men Tell No Tales or the mermaid from Playdead's Inside:

How can I go about this?

First, you need to check Hair Dynamics in the particle system settings.
You can reduce gravity in the Scene settings. If you set it to a positive number, the hairs will be attracted to the top, as if they were floating.
To add a more interesting movement, you can use one (or more) force field (Shift+A / Force Field). A Turbulence should give good results ; increase its Strength, Random and Flow values. Wind and Vortex can also be used to simulate water flow.
To make the setup step easier, you can specify a relative short animation range (like 1-100), and run the simulation (Alt+A). While the simulation is running, you can tweak the values of the force fields and see the result in live.

This worked out very nicely, though I'm kind of wondering if there's anything I can do to utilize this effect while keeping downwards-oriented gravity (for example, a use of this could be someone sinking in the water while their hair still does this)?


text:
Are there any resources for learning CG related math (especially the math used by Blender)?
I want to get involved in developing Blender, maybe writing add-ons and stuff for the community. As far as I can tell, there's a lot of math involved with this (generally stuff like matrix/vector algebra, dot/cross products, quaternions, and complex numbers, and I'm sure a lot of other stuff); are there any resources for learning this stuff (in particular, that focus specifically on CG applications): books that are generally in high regards in the blender community or tutorials?
Addendum: I feel I should mention, I don't find my post to be a duplicate of this. First off, my question is about resources specific to learning CG related math and how it is implemented, specifically in a CG context (i.e. other applications of the math are not important.Because of this and a heavy emphasis on various algorithms, I also felt it would be considered off topic on the math SE), conversely, the other post appears to be focused on resources for using blender (add-ons, stock images/textures, other software that can be used along side it, tutorials on using it, etc.). I'm not looking for books on how to drive a car or looking for a different engine to add on; I'm looking for books on how engines work. What are the formulae for ray tracing, how do quaternions work, etc.
Secondly, math is a really fundamental part of CG works; I would think that since the other post didn't so much as even mention math (the closest thing I could find was some documentation about the Python API but even that is still pretty far off the mark), it wasn't because it was some tiny, obscure topic that was overlooked. So, it stands to reason that the resources I'm looking for aren't a good fit for it.

@RayMairlot I've written an addendum to specify why I don't feel this is a duplicate.

The reason that question exists is because normally these sort of questions are considered off topic, however I agree that the lack of maths resources is a pretty big oversight, so I have started a section there: https://blender.stackexchange.com/questions/15355/resources-for-blender/135314#135314.


text:
Why does my computer freeze when I add a subsurf modifier?
I have an object with over a million vertices. When I select subdivision surface, my Mac starts the rainbow circle and sits still. How do I fix this issue?

Hello :). First, enabling Subsurf creates 4 million verts from your 1 mil. Second - Blender 2.8+ has speed issues when adding subsurf modifier. It's currently a recognized bug.


text:
Video format that will play on MacOS
I exported my animation with all standard settings and used the 3rd Selection in the Video Format Options. When the render was complete, I couldn’t open it because it was in .mkv. What specific settings should I use for a Mac?

On a mac youi can use quicktime as a container, and then you can choose from a number of codecs. Depending on the quality you are after, choose DNXHD or ProRes for  high quality or mp4 for compatibility.

You should use FFmpeg video and MPEG-4. It will output a .mp4 file, which is the most common video file format and will probably work on any device, including mac.


text:
How to recall the window with the original creation settings of an object
After I place, for example a new mesh, and do any actions after that it is impossible to recall again the settings in the picture.

I know there is a way but I was not able to find an answer to that. Any ideas? Thank you!

Simply put - there is no way. Blender doesn't have construction history :).

it works just like that: once you "do any actions after the creation" you cannot bring back the original parameters.


text:
How to keep two separate UV maps when merging two objects into one?
I wondered how to keep two UV separate UV maps when merging two objects into one (CRTL+J)?
Currently I have blender 2.80.
I have two separate objects (in this case a turtle and a catapult from a game).
I would like to merge them both and let each keep it's own UV map.
In blender this seems alright before merging. However, after merging they
are converted into 1 wrong UV map. The turtle's UV map is degraded into a single pixel in the lower left of the UV map, resulting in a mono-colored animal.
The catapult has it's texture from in game, so I cannot supply it (but you can see it in the object).
Link for Blender file with objects:
https://www.dropbox.com/s/jvj2oafghnmll57/CataToSend.blend?dl=0
Link for JPEG turtle texture: https://www.dropbox.com/s/9a5yiftua1v1jek/20446_Sea_Turtle_diff.jpg.001.jpg?dl=0

On each object, prior to merging, give it an additional UV map with the name of the other object's UV map.  After merging the objects, it will merge these individual UV maps.  Although note that when you create an additional UV map, it will have the same UV values as the selected UV map, so you might want to do whatever you want to these-- there's no such thing as being unmapped in some map, that just means UV 0,0.

Much thanks for your answer, this indeed did fix the issue. I gave each UV map the same name before merging (to change the name -> select the Context (object data = small green upside down triangle in one of the side bars) -> UV Maps -> edit names). This resulted in being able to use the ideal texture for each object.


text:
dynotopo sculpting - which make the file to big
When I go into Dynotopo, I come with an 86 Mb file, and set it to constant detail 20, - and do a Little with the snakebrush, a Little inflation, and smooth - and then boom, after only 5-10 minutes i have 390 Mb file, and going rather slowly.
My computer is 16 gb ram and using a Nivida Geforce gtx 1660 graphic card. That I imagine is OK, on a not a specially small computer.
Can anybody tell me what to do?
I of course use the decimate modifier, but setting it to 0.3 only gets the mesh size down to 300 mb. it seems crazy that the mesh grows that fast.
[sculpture in 3 elements

Can't see the statistics in the status bar, so how many vertices/faces/edges has your object? How many the whole scene? Have you duplicated a sculpted object?

Does the model have several UV maps or weight groups?

its about 3millionverts and faces (cant remeber exact ) and it says 1,5 gb memory. It ends up being 370 mb fil. There is no weigth paint or uv mapping. its mostly a sculpture done with converted curve object to mesh, and skin modelling lines converted to medh


text:
Color not changing in eevee in material view
I am using a course from Udemy that says to change the color of the selected object, you should:

be in Object Mode
Render engine set to Eevee
View set to Rendered

I have done this, but when I choose 'Material', and try and pick a color on the color pinwheel, the object does not change.  I have tried Edit mode, View set to material, nothing appears to work.  Why is this simple task so complicated? :(

please [edit] your question and add an image that shows the problem. Additionally, are you using a GPU by the brand AMD? There have been a lot of problems with the drivers fur such hardware lately.

See How to upload an image
to a post?

Does this answer your question? AMD GPU Material in "material preview mode" and "rendered mode", is entirely gray as background. Only outline is displayed   Other questions related to issue https://blender.stackexchange.com/questions/linked/204297?sort=active  this one is a good match https://blender.stackexchange.com/questions/208172/material-preview-doesnt-show-color-changes-the-object-stays-black


text:
Green screen transparent layer questions video editing
I have two (newbie) questions:
1)I have made a green screen video transparent in the compositing-tool. But when I am rendering this image (without a background image) and I am trying to place this in the normal video editing tool, it is not transparent. Did I do something wrong? Can I only render a green screen video with a background image? Or are there settings to do this?
2)I have downloaded a green screen video with smoke. But this smoke is too white, it would like to have the opacity 50% or something. Is that possible?
Thank you

White or gray smoke works best with a black background and luma only compositing, not with green. Find a better source from someone who knows how to do it well. And yes, it is possible to composite it a the opacity you want.

Try exporting with ffmpeg, using RGBA(A for alpha), Container: Quicktime and Codec: PNG.

thank you, I will try that today :)

Unfortunatelly I do not have these options. I am probably using an older version of blender..

You'll have to select ffmpeg instead of PNG first and then the options will become available.

Many Options:

Do the compositing of the keyed video with the background elements directly on blender, and export the composited piece in whatever format the original video was using, and use it directly in your video editing app.

Export the matte/keying information only as grayscale, and leave the original video untouched (keep in mind that every time you re-encode you are loosing quality and introducing new artifacts)

Then use the matte in whatever other editing/compositing app you want.

(Best quality option) Export the Video Images and Alpha channel not as video, but as an sequence in OpenEXR format.


text:
Render is grainy with GPU
Here is my problem. When I try to render with my GPU the image (mainly the lights) are not the same as with my CPU. The image is more grainy with the GPU than with the CPU and even if I do not change any parameter from one rendering to another. I would like to be able to use my GPU to save time with my rendering
My config :
CPU : AMD Ryzen 2700x
GPU : EVGA GTX 1070
Blender version : 2.79
I can'T upload the .blend files because he is pack with all the texture (more than 600MB)

Edit your question and share the file, please. You can upload it here: https://blend-exchange.giantcowfilms.com/ Also - what version of Blender are you using?

Can't upload the project files too heavy (more than 600mb with all the HD textures)

I think more info is needed to determine the problem. Is it maybe possible to remove the parts of the scene that do not contribute to creating the problem? One way or another one would need to recreate the problem to start figuring out, why it's happening. Could you maybe at least share the screenshots of your render settings and tell more about how the scene is constructed?

maybe it has something to do with tile size and samples. Have you tried changing your tile size  to 256 when you switch to GPU. Its should be 16 or 32 when its on CPU. Maybe that is throwing the sample count off.

I think I found my problem. It is related to the shader "volume scattering" that I put in the world settings in the "volume" if I remove this option my CPU rendering become identical to my GPU rendering. I found on several website people who say that there is a problem with the "volume scattering" and the CUDA.
https://blenderartists.org/t/cycles-gpu-renderer-cant-render-volume-scatter/647962
https://developer.blender.org/T50808
https://blenderartists.org/t/volume-scatter-with-gpu-worse-than-with-cpu-in-cycles/651603

The picture is small, but it looks like fireflies.
You can eliminate them by going on Render -> Sampling and inputting a value between 1 and 2 in the Clamp field.
It should make your render smooth again.

The issue is a bit more complex than that if the results differ when rendering with CPU and GPU. They should be identical. Logical clamping values are also dependent on the specific scene. Your advised value is arbitrary and might decrease the quality of the render severely if the lights used are stronger. I would not consider this to be a good advice.


text:
utf-8 codec can't decode strings randomly
I am coding a binary format, and I am reading null-terminated strings with the following code:
def read_string(f):
    chars = []
    i = 0
    while True:
        c = f.read(1)
        i += 1
        if (c == b'\x00'):
            return (''.join(chars)) #.encode('utf-8')
        chars.append(c.decode('utf-8'))

And I have this problem that, when I want to access said strings, I get the following error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 0: invalid start byte
Usually in lines like these:
bone = armature.pose.bones[obj.name]

or:
if (objects[i].name == parentname):

I'm not sure what am I doing wrong, and I can't seem to figure out how to fix these random errors, that sometimes show up and sometimes don't, there doesn't seem to be an easy way to debug this, is there any way I could tell why this is happening?
I'm not sure if it's the way I'm reading python, or it's something else.
Thanks for reading!

Can you actually do this: c.decode('utf-8') ? c is always just a single byte so can't always be decoded into utf-8?

Yeah i do that on each loop, i added it so everything together is decoded i suppose, you are asking if i am able to do that? it lets me apparently, or if you mean if i have tried, i am currently doing it

I mean, is that what's causing your error?

I don't know whats really causing me the error, because the strings and the script itself reads the strings properly, but when i print them, or access to them, there's a chance i will get this error, it's not always on the same strings, so it makes me wonder if it's the way i read the string from the file, or it can be something else, i'm not entirely sure.

I spose what Ron is saying is that UTF has a variable length of bytes, not always just 1

So what you mean is that, converting a single byte that i read and decode it to utf-8 is a bad practice because it does not consistently work? honestly the utf part is not mandatory really, i just want to be able to access the strings without the program randomly stopping due to this error

yes, and I wouldn't bother if I were you, python's pretty good at handling strings by itself

I removed the utf part, and it's only chars.append(c.decode()) now. However the problem does not go away, since i'm forced to decode the chars separately, unless there's another way of doing this

c.decode() defaults to utf-8, see help(b''.decode)

I think your code is breaking because (as stated by @wilks) UTF has a variable length of bytes, not always just 1. Assuming your file format has UTF-8 null-terminated strings inside a larger block of binary data we can do something like the following little test program you can run in iPython or your favorite ide. It has a list of valid, null-terminated utf-8 bytes with cruft at the end.

bob=b'\xe2\x9c\x93 means check\x00\xc0'

chars = bytearray()

for c in bob:
    if c == 0: # c is int so does not match b'\x00'
        break
    chars.append(c)

print(chars.decode('utf-8'))

And here is the (untested) changes I would make to your read_string function:
def read_string(f):
    chars = bytearray() # avoid lists
    i = 0
    while True:
        c = f.read(1)
        i += 1
        if (c == b'\x00' ): # c is bytes()
            return (chars.decode('utf-8') )
        chars.append( c[0] ) # stick another bare byte onto chars

The first test worked very well, but the second one i get the following error:
TypeError: 'bytes' object cannot be interpreted as an integer. Am i missing a conversion?

Pythons types can be a pain. I fixed the code, the test for the null byte was failing to find it.

I noticed as well that 0 did not work out and i switched it for b'\x00' too, which i guess it makes me understand how this works more. The issue lies now when i attempt to append one of said chars in the bytearray. Maybe the way the binary reader is parsing the chars is not the right one, and might need some kind of struct.unpack method? Basically: 'bytes' object cannot be interpreted as an integer happens at chars.append(c), in this case the first byte is a b'l' (an L basically). Maybe i need a different method for reading

Oh, I had that one fixed, too. just forgot to put it up here. c is being read in as a bytes array, so we need to pull just the first (and only) byte.

Now it works like a charm! thank you so much!


text:
Smoke simulation disappears after 10 to 20 frames
I'm trying to understand how mantaflow works.
Every time I create a smoke simulation the smoke disappears after a couple of frames. It seems the simulation is still calculating all the data since the cache folder contains data for every frame with increasing size.
In this scene I only like to create a dust trail, emitted from particles behind the robots wheel. As you can see in my screenshots the smoke is present at frame 1 as expected. But this small smoke cloud is all that I can get.

The robot keeps driving and the particles keep flowing - but no smoke is emitted from anywhere. With density cranked up I can still render the smoke in frame 20 - but after that it's gone.

Some additional information: I have the same issue when creating smoke from a stationary emitter. I created the scene first in blender 2.91.2 and then changed to blender 2.82 in the hope to get the simulation running properly.
I read the posts in this forum that suggest to change substeps or increase the smoke domain size. But I tried everything I could come up with with absolutely no effect.
Do you guys have any idea what I could try?

Just to doublecheck, is the smoke source set to inflow instead of mesh.

Thank you for your comment. It is of course set to 'inflow'. I tried it several times again with different versions. And it suddenly worked with blender 2.90. I am just using this bake now since the result is pretty much what I wanted.
But I think it might just be a bug. Otherwise it would either work or not. ♀
I got to admit: I almost gave up with blenders smoke simulations. I bought the "Storm Simulation Tool" which comes with it's own problems - but at least the baking time is a fraction compared to blender. So I hope to save some time that way.

But I will try 2.92 for simulation. I just have to finish this project first.


text:
How do I use Grease pencil fill tool so that it doesn't bleed out of an area?
I am using grease pencil on version 2.8 from 12-16-2018.
I try to use the fill tool but the fill does not stay inside the lines or does not do anything it bleeds out to the whole area, is there too many lines of my drawing for it to handle?

I have tried increasing the leak size, adding the fill on the same layer that the line layer, making a simple closed shape to fill but nothing works. am I missing something? thanks for your help!

Firstly, make sure you have a material setup that has the "Fill" option enabled (ticked) and that its Alpha is set to any value above "0". Then, if it keeps bleeding off, while still in Draw mode, hold down ALT and draw 'invisible' lines to cap any gaps in your line work. Then just click to fill.
If the problem persists, I've found that you'd need to be on the same layer and select the strokes via Object mode. However, I did run into an issue where the fill will not line up with the stroke in the same 3D space.
Alternatively, if you don't need the fill as a separate object, you can adjust your material and just enable the "Fill" option. You can select individual strokes with edit mode and assign a specific material to whichever stroke you've selected.


text:
Stop cube and then continue
BGE question.
I have applied movement to a cube with apply.movment([0,1,0], True).
How can I stop it if is near a cylinder that is timed to flick from 5 to 5 seconds, and after to continue?
Let's consider the cylinder a barrier.

Do you mean gameplay stop?
If yes make a variable.give it a name like gameplay.
now make that variable True to make it boolean
import bge
cont = bge.logic.getCurrentController()
own = cont.owner
w_key = cont.sensors["w_key"] # This is to get the keyboard sensor

#The gameplay variable make it playable or not:
gameplay = True

if gameplay == True and w_key.positive:
    apply.movment([0,1,0], True)
elif gameplay == False and w_key.positive:
    print("You can't move!")


text:
How to set world's background without effecting the lighting?
Is there any way to make the world's background white without making everything way too bright?
I simply want to make the whole world white, without effecting the lighting.

Related: https://blender.stackexchange.com/questions/49337/how-to-use-multiple-hdris/49403#49403 , https://blender.stackexchange.com/questions/108867/how-to-make-colored-backgrounds-not-influence-the-color-of-an-object, https://blender.stackexchange.com/questions/34532/problem-with-transparency-when-using-two-world-images/34535#34535

for Cycles - World Properties > Ray Visibility > Camera (is the only one checked) https://blender.stackexchange.com/a/171096/2214

ThanksX ! How about eeveeee :)

https://blender.stackexchange.com/questions/58272

Light path node (works for Eevee & Cycles)...

How light path node works? :

https://docs.blender.org/manual/en/latest/render/shader_nodes/input/light_path.html


text:
Cycles render is blank and camera object changes
I have this problem where my scene render is blank, and I think I've figured out why, but it's weird.
I set my scene camera to the actual camera object:

But when I press f12 the render is blank. Not black, but transparent. Then for some reason, the camera object switches to 'bulb' by itself

Please help me out, this makes no sense.
 You can download the blend file here.

This could be very relevant to this and this based on my experience in the past.

@Amir Thanks for your comment, but I'm not using any scripts and I only have on camera in the scene, so I'm pretty sure my problem is different.

This is because the Bulb object is bound to the marker Jump. See this answer for details.
To fix it, you can either remove the marker (press X while hovering over it), or select your camera object and press Timeline header > View > Bind camera to markers (or press CtrlB in the timeline area).

@LeviJones Yep, definitely one of the more well hidden features :P


text:
Problem with wavy edges in pattern - equirectangular render/Cycles
I have a problem with wavy artifacts on straight objects, when I render panoramic scene. It’s shown only in pattern floor and it’s more visible as it’s closer to camera, like it could be caused by images stitching point.
First, I thought there is a problem that the floor is 3d model so I baked it and I made that floor as a texture on simple plain. But that problem still existed.
I have tried various settings, playing with dithering, rendering that floor in bigger resolution and scaling down… Nothing changed.
Of course these artifacts are only visible in panoramic viewers, like in google images, panoraven or newest Photoshop. When it’s shown in regular image viewer, edges looks straight.
Did someone has that problem and know a solution?
Edit: There is a blend file:

Please include the .blend so it's easier for us to find an answer.

@ValentinWalter Ok, I uploaded file


text:
How to use Geometry Nodes on vertices with rotation?
How would I distribute geometry following the rotation of the source mesh, but keep the distribution on the vertices (not random)?

actually i found solution it was blender 2.93 alpha with this nodes

Oh, I see... and you also used vertex_normal as attribute. I've watched tutorials where they only talked about attributes like location (or position?), rotation, scale, normal etc. without the "vertex" at the beginning. Maybe that's the mistake and it already works in 2.92? Have to test it tomorrow.

Checked the attribute vertex_normal in 2.92 but it's not working... so it looks like it's new in 2.93.


text:
how to blend two meshes
I am a beginner and when I am making a rifle I am using 3 or 4 cubes and then use verts to give it shape but when the rifle is complete, even in the render, it shows separations in the different parts. Like there is a separation between the handle and the top, sort of like lines. How do I make it look like there only one object in the render ?

To combine all the separate objects into one object, select all the pieces and join them with Ctrl+J. Once they are all one object, select it, enter edit mode, select the whole mesh, then choose mesh > clean up > merge by distance. You may need to increase the value in the box that pops up in the corner by a little bit to make sure you connect all the loose verts, but don't increase it too much or you may end up removing unintended vertices. You can see the number of verts removed at the bottom.

am i doing something wrong im trying but it wont work ? first i press A then i press tab then i go to mesh cleanup and merge vertices but it wont happen am i doing something wrong ? it still looks like two seperate objects im using blender 2.91

i tried selecting the edges and trying pressing f to fill then but even thats not working

Hmmm. Not sure then. It's hard to tell without seeing your .blend file, but even that wouldn't help at the moment as I'm not at my home computer and don't currently have access to blender. However, consider uploading your file anyway (or a minimized version) if possible, so that others might have a better chance of helping you. You can do it here - https://blend-exchange.giantcowfilms.com/


text:
Geometry node which allow me to skip every odd frame in the object animation
I need help to build a node tree which would allow me to skip every odd frame in the object's animation. Basically, I need a tool that behaves just like a stepped modifier but in geometry nodes.
Reason
My object can be either an alembic or a sequence obj which means it doesn't have keyframes to which I could apply a stepped modifier.
I also need the object to be the only one that skips frames whilst the rest of the scene runs at 24 fps, so I can't use 12 fps globally.
OBJ Sequence test
I found this node tree on the web that converts the obj sequence to animation. Unfortunately I am only able to slow down the animation meaning that, although one position takes 2 frames, the overall animation is twice as long. I need one position to hold for two frames, but the animation to still have the same length, meaning it sort of throws away every other frame.

ALEMBIC test
I have no idea what a node tree for alembic would look like, :-) but we managed to make the tool I need in Cinema 4D using Xpresso, I believe it can be done in blender as well.
I would be grateful for any advice :-)

Looks like you can replace your Divide with a Snap (still a Math node so just use the dropdown), setting Increment to 2.

Wow, that was quick thanks a lot, this works. Any idea how to solve it for the alembic? Do you know what the node tree should look like?

Sorry, I don't know anything about Alembic.

Nevermind thank you for advice :-)


text:
Error when processing a blender file in Python
I work on some system that generates objects in spatial configurations using Blender. I have a few samples of objects (.blend) file (e.g., cube, cylinder, sphere) and they work fine on my system. I tried to create more objects like: bottle, cup, toy, etc, and I follow tutorials on youtube but I always get errors when using them with python. One of these common errors is:
AttributeError: ‘AreaLamp’ object has no attribute ‘vertices’

This is particularly related to some code that loops over objects in the scene and use the vertices information of each object in order to calculate the centroid. So I can estimate that there is a problem in accessing vertex information.
Despite the fact that I compare the new blender files attentively to those that work well in the system, I have the same parameters in both but they always raise errors.
I attach a link to a new object (Cone) that I created which raised this error: Cone
VS
an original .blend file for an object (Sphere) which works in my python system without any problem:
Sphere
So what is missing that makes the (Cone) object raises this error?  Why isn't the vertex information accessible?

just from the error message looks like when looping through everything in the scene you get a lamp, which doesn't have vertices, so it breaks. do you know how that lamp gets there?

@wilks: Actually not! I simply use the same code I used with the Sphere file (attached above) which works without problem. When I created the (Cone) I paid attention to remove any lamp and make parameters look similar to the Sphere.blend file , but despite that I got this error. I guess the problem is not in the code or else it wont have worked for the original blend files provided files by the developer (e.g., Sphere), the problem is related to something in the blend files that I should think of. I sent the blend files to some guys but no one got any idea about what is missing! Can you help?

you could add some print statements to the script to help debug it. here I can't do much without seeing the script

The problem as noted above is undoubtedly related to the "other" objects in scene or selection not being of mesh type.  Recent & related https://blender.stackexchange.com/questions/196713/select-all-objects-with-x-amount-of-vertices/196722#196722  in that it checks the object type of objects in a scene mesh_objects_in_scene = [o for o in scene.objects if o.type == 'MESH'] If you are iterating over all objects in blend file bpy.data.objects then an object need not be linked to scene IMO Please add code to q rather than  rely on others downloading blend files. Did you write the code?

https://blender.stackexchange.com/questions/193966/getting-x-y-z-coordinates-of-objects-in-blender-api-for-multiple-objects#comment330287_193995

There's a chance you deleted the lamp but it's still lingering somewhere in your blendfile and the script is accessing it. To be sure this is not the case, try saving, closing, and opening the blendfile multiple times to completely get rid of unused data and try your script again. Or you can try copying the mesh files to a brand new blender scene without any object and run the script there

Opening and closing once is enough. For newer versions of Blender that wont work any more though, data has to be explicitly purged


text:
Blender Snow Simulation
How to Create This Snow Simulation.

I am not that into blender dynamics, but I think that with current tools being provided by blender itself there is nothing that it may help you for doing so complicated simulations. In that case I would go for Mantaflow build or flip-fluids.
Typically you need particles with attributes similar to fluids, like viscosity for instance and a way to displace the dynamically.

It would be done also by different combinations of using tools such as weight painting (dynamically) - in order to displace the snow - and fields (like magnetic) attached on a collider sphere, but these are just few ideas. The most trivial part is to deform the rest of the snow in a more natural way.

You should check out  https://youtu.be/82zWmOqE0Nc

You might be interested in checking out the Molecular Script Add-on, as someone has created a near-identical effect to the one you are looking for, with it: https://youtu.be/TJxbiCEoo1Y


text:
How to control the thickness and darkness of lines when exporting UV Layout
I exported an UV Layout from Blender 2.8 and imported in Photoshop in order to build a simple displacement map.
All the UV lines are not black but a kind of black to grey graduation.
The lines are not 1 pixel wide but 2 or three.
I have tried every setting I can do in the Export UV panel, but I got always the same.
Here you find the original UV layout in Blender 2.8:

And here you will find the snapshot out of Photoshop with the strange grayish lines:

BTW, I have the same issue editing the same file in GIMP or other graphic programs. So it seems that the Blender 2.8 exporter is creating this behavior.

I had a similar issue with the edge being 4px. There are a couple of options but none I can see to fix this. Preferences > theme > UV Image editor. You can change the vertex size but not the edge. Also on the overlays there are no specific size options in the Display As

Instead I exported the UV Map as .svg or .eps from here you can open in Adobe Illustrator which gives a sharp vector path. I would set the fill opacity to 0 to make sure there is no bleed from the black edge. You could open either of these formats in Ps but the same issue persists.

In Illustrator you can then adjust the stroke width from 1pt to 0.1pt and copy into Photoshop to give a single pixel width. Not perfect but the best I can see unless there is another option I am missing in Blender

Thank you, this is a good workaround. It takes some more time but it works well.
Many thanks for the hint!

Make sure you are exporting the UV's from the menu and not saving what is on the screen (I trust this is not what is happening because you have transparency):

But then drag the opacity slider up and ensure that all UV's are being exported. Use PNG as your file format and choose dimensions that fit your texture 1-to-1 or are bigger by multiples of 2:

My output looks like garbage in the Windows Image Viewer (or whatever it's called now) but I still get 1px lines every time. I will be on the lookout for unpleasant surprises though.

Hi, Thank you for your input. I would like to have a transparent map without fill, having just the edges with solid black and 1 px while I want t o build a displacement map. VeloFX brought a possible workaround for this behavior. I'm just wondering if blender developers are aware of this fact as I was not able to see this behavior in other software like Maya 3ds Max or Cinema 4d.

"Fill Opacity" affects the transparency of the outlines. If it's left at 25% you can't really see anything.

Export the UV-map double the size you need (for 2048x2048px export it as 4096x4096px)
Open it in photoshop and duplicate the layer and merge it multiple times. (to remove transparency)
Resize the image to the wanted size (half the width and height) and check resample image with Nearest Neighbor (hard edges)

Thank you for your answer and hint. Your method is working as long as you do not have some edges close to the others. In my case I have beveled one edge with 3 segments and with your method some of the edges went sharp and 1px wide, others are sharp but 2 pixels wide! Really strange!
Thank you anyway for your support. Much appreciated.

I think you can further reduce the linewidth if you export it event bigger (maybe 4 times the size) and scale it down accordingly


text:
Quaternion - I need to subtract the value from the parent bone. How I can calculate that?
I am getting quaternion data from my sensors. I use Python and Arduino. "Bone 1" is the shoulder. Bone2 is the upper arm, Bone3 is the forearm, and Bone4 is the hand. Each bone has a sensor. When I move the arm up, Bone2-4 have the same sensor readings.

Here you can see how the bones move incorrectly.

I need to subtract the value from the parent. I tried "q.rotation_difference ()", but then the bones all go in the wrong directions.
This is how it should look with an extended arm.

Does anyone know how I can calculate that?


text:
Make material local?
I have linked a group of meshes. The geometry needs to be linked in case I want to update the imported architecture model later, and keep all my new materials setting and attribution. (I model in Sketchup, render everything on blender.)
And then, all I want to do is to replace the materials of the linked meshes with new materials, but I can't do that?
I just want to have access to the greyed out drop down material menu in the material properties panel, then replace this linked material with another one in the entire scene, but I can't? Why? It's just a replacement of the material, I'm not altering any data!
The only way I found is by changing the material in question from data to object.
But this solution requires me to change this for EVERY object one at the time
and the "icing on the cake", it transform the material to single user
so when I link a scene with 300 meshes, and some materials that have 120+ users, I'm just screwed...
What am I supposed to do?

not sure to understand: do you mean you have imported a object as a linked object? in that case you can change the material in the original file. Maybe what you rather need is linked duplications?

Cycles Render or Blender Render ?

moonboots, no because if someone else decide to change the model , i have to delete it and re-import it , so all the work on materials are then gone

atomicbezierslinge
cycles

Do you know how to create a group?  If not search here at BSE or other place for 5 minute tutorial.

Do you know how execute a Python Script from the text editor window? Copy and Paste text or type text into text editor window. There is a [Run Script] button.    If not search here at BSE or other place for 5 minute tutorial.

Groups.  If the blender user can select 800 objects by box select or any other means, then a group can be created.  So this whole operation might be 33 or 3 seconds.

Please state your experience level with Python in the past year. For example . 6 months or 1 month or 1 week.  Loosely speaking.

@atomicbezierslinger hi , thanks for caring about my case ! i know how to use blender , im just not a coder , deeply sorry ... i will show you what i attempted to do in a response to my own question , it seems like i cant put imlages in "add a comment"

I have questions above that can be answered directly ... as in Yes No.  It is best not to write tutorials that are discussed on accessible websites with video tutorials.  Your comment below is not yet removed.

i deleted it now ,
yes i know how to create a group
yes i know how to execute a python script
no i have no experience with python

Changes via Script in Blender Render and Cycles [data to object]
Many of the changes can be done by Python Script.
You can make a selection of the objects a create a group.  The selection can be done manually by clicking on the 3D View .  Perhaps by spelling of name if that happens to be your case.
import bpy

#tested in blender render and cycles render lightly
def data_object_mat(groupname):
    for x in bpy.data.groups[groupname].objects:
        print(x.name)
        o = bpy.data.objects[x.name]
        m = o.material_slots[0].material
        o.material_slots[0].link = 'OBJECT'
        o.material_slots[0].material = m

#create a group with the name below in quotes or change the name
data_object_mat("MatGroup")

# this script does zero error checking and expects specific data to exist
# backup your file, create a discardable copy, use at your own risk
# you are responsible for any damages

The above script is still being tested. It is a starting point after you have created a group with the name in quotes.  The Script iterates through the group and is intended to perform the desired actions.
Consider use only on a discardable copy of your file.  Standard disclaimer.  Backup your files every hour and use Scripts at your own risk.    Scripts are put in the text editor window and executed. This is not a tutorial on any topic, because at the moment I do not have time. You may choose further research.

The image above shows the Run Script button and a group.
You may need to change your search to ... Python Script to [data to object] material.  You may also look at Material addons in the User Preferences.  Please improve my search suggestion.
If time is of the essence, for the above you may choose to do it manually.
Multiple Materials to One Material
copy linked materials nodes to local material
I saw something I believe here at BSE an question which brought up a material matching in the form of a Script.  I believe it reduces multiple matching materials into one material.
That script may be on the [Related column] on this same BSE page,
copy linked materials nodes to local nodes.

Above image shows some material addons.  I have not researched these.  The documentation button seems to link to non existant files.

@DorianBorremans ... Your comment above is incorrect and should be removed


text:
Big problem when exporte normal map from Substance Painter to Blender
I need help.
I have this problem when I export a normal map from Substance Painter to
use in Blender.
As you can see in the images it show some dark spots in the object, and
it looks worse at glancing angles.
I exported the normal map in OpenGL and it is configured in the node as
"Non-Color Data".
I already tried to invert the normal map channels but the same thing
keep happening, it is also worse if I export the normal map in 16bits
instead of 8 bits.
on Cycles the problem does not shows up, but it does show up on
everything else on Blender, even on Eevee.
Thank you all!
Edit: As I explained, I've already tried to invert the channels. And yet it does not solve the problem. I've already tried to invert the Y channel, as well as the others.
Blender File 1:
Blender File 2:
Substance Painter File 1:

Possible duplicate of Visible seams on tangent normal maps - this is likely due to flipped green channel.

Hi Sazerac.
As I explained, I've already tried to invert the channels.
And yet it does not solve the problem.
I've already tried to invert the Y channel, as well as the others.

There must be an issue when exporting from Substance Painter. That would make the question off topic on Blender Stack Exchange since you would have to solve the issue in Substance Painter.

Hi Martin.
I do not think it's in Substance.
It works normally in cycles and other softwares.

Silly question, but have you tried flipping the normals on your model? The image looks very like some sort of normal inversion/mismatch to me. Also did you flip the green colour info as describe inhttps://blender.stackexchange.com/questions/128103/normal-map-problem-inverting-color/128111#128111 or did you flip the Y in the UV mapping? You need to flip the green channel.

I had a look at the second file, Normals in blender are fine, green channel is ok, but there is something wrong with the map itself, it seems like there is slightly different curvature  represented in the map. Was the map baked on a lower resolution/subdivision version of the mesh?


text:
Relation between BGE framerate and Action framerate
By BGE framerate I mean the rate at which True pulse is fired (and thus attached Python controller script is executed) and by Action framerate I mean the rate at which the value returned by KX_GameObject.getActionFrame() is changing. (I've heard the term Logic framerate in the context of BGE, but I'm not sure if it is the same thing as BGE framerate I'm talking about :-/ Sorry!)
Here is a small snippet which I used for testing (which should clarify what I mean by BGE frame and Action frame):
import bge

BGE_frame = 0

def main(cont):
    global BGE_frame

    arm = cont.owner
    if not arm.isPlayingAction():
        arm.playAction("run", 0, 45, play_mode=bge.logic.KX_ACTION_MODE_PLAY)

    print(BGE_frame)
    print(arm.getActionFrame())

    BGE_frame += 1

Using the above script for Python controller attached to an Always True sensor gives following result (the n-th BGE frame and corresponding Action frame):
http://pastebin.com/NK2RrVkR
As we can see, there is a significant difference in both frame-rates (e.g. the 11th BGE frame corresponds to the 4th Action frame and 16th BGE frame corresponds to the 6th Action frame -- so roughly 5 BGE frames corresponds to 2 Action frames).
Assuming that the action starts playing when BGE frame is 0, in what way can we compute the Action frame from the BGE frame and vice-versa? More precisely, I'm looking something like:
import bge

BGE_frame = 0

def main(cont):
    global BGE_frame

    print(BGE_frame)
    print(BGE_frame_to_Animation_frame(BGE_frame)) # TODO: Outputs same result as above

    BGE_frame += 1

If it is needed here's the .blend file: http://wikisend.com/download/114182/framerate.blend
Thanks!

I think I solved it as follows:
import bpy, bge

BGE_frame = 0

scene = bge.logic.getCurrentScene()
bpy_scene = bpy.data.scenes[scene.name]

BPY_FPS = bpy_scene.render.fps / bpy_scene.render.fps_base
BGE_FPS = bge.logic.getLogicTicRate()

BPY_BGE_RATIO = BPY_FPS / BGE_FPS

def BGE_frame_to_Animation_frame(BGE_frame):
    return BGE_frame * BPY_BGE_RATIO

def main(cont):
    global BGE_frame

    arm = cont.owner

    print(BGE_frame)
    print(arm.getActionFrame()) # Kept for comparison
    print(BGE_frame_to_Animation_frame(BGE_frame)) # Outputs approx. same result as above

    if not arm.isPlayingAction():
        arm.playAction("run", 0, 45, play_mode=bge.logic.KX_ACTION_MODE_PLAY)
        BGE_frame = 0
    else:
        BGE_frame += 1

    print("\n")

I'm not sure of it is a good practice to access blender data from BGE, but it works :-) Comments/suggestions are welcome! Thanks.


text:
Video texture not playing in final render
I've applied video textures to the front face of 3 objects in Blender 2.82a. I can see the first frame on the objects but once rendered the texture behaves as a still frame. ie. It's not playing as a video.
What am I doing wrong?

Is the problem only in final render and the video is playing fine in preview?

Thanks for the response but I managed to work it out. I've never used video as a texture before so I didn't realise that I had to go into the "shading" settings and specify the amount of "frames" that I wanted the video to play. The "frames" setting was set to one. As soon as I set the amount of frames the video plays perfectly!

Oh good. Please delete the question then. :-)


text:
How to import a file on open?
How do I set Blender to automatically import a model such as an .OBJ (using the appropriate importer based on the file extension and default options) into the default startup scene when I double click the file in Windows?

Just append the file from file menu

Avoiding the file menu is specifically the point of this question. When you have lots of models in different formats and you're looking for the right one, it's infuriating to navigate to them through blender's file dialog when you have already found it in Explorer.


text:
How do I re-initialize a deleted image?
My script creates an image, bakes to it and saves it. The first time, it works. However, if I try to re-bake to the same image, and in the mean time the user decides to delete the image from disk for whatever reason, bake throws an error:
RuntimeError: Error: Uninitialized image

How do I re-initialize an image to solve the user-deletion problem, or, say, to change its resolution?
I tried creating and deleting a new temporary image for each bake, and that sort of works, but if I do this at the end,
baketarget.user_clear()
bpy.data.images.remove(baketarget)

it leaves an unresolved reference in the uv/image editor, if that happens to be open at the time the bake is started. How do I unlink the image from the image editor?

I had the same problem, yet not with scripting, but with my blend file moving to another computer, and I didn't take saved images with me.
Go to UV/Image editor, press N to bring up the properties panel, and in image tab change source to "Generated". You can change the resolution there as well if you need to.

As for scripting, you probably need to do
bpy.data.images["your_bake_texture"].source = 'GENERATED'
I haven't tried it myself, but I suppose it is what you need, that's what the info panel shows when I change source. It works from console at least.
EDIT1: a quick script to reinitialize all images in all materials in the active object, provided you have selected the image texture nodes in all materials (you need to do this to bake your textures anyway):
import bpy

for slot in bpy.context.active_object.material_slots:

    mat = slot.material

    imag = mat.node_tree.nodes.active.image

    imag.source = 'GENERATED'


text:
What version of OpenGL does Blender use?
I know that Blender makes extremely heavy use of OpenGL.  What version of OpenGL does Blender use, and how difficult would it be to port it over to OpenGL ES?

Blender requires OpenGL 3.3, however we may take advantage of newer OpenGL versions too.
So while Blender depends on 3.3, it may use newer features when available and fail gracefully if they are not (as opposed to crashing or not starting at all).
Note that some features are user preferences too since we can't always rely on asking the driver if a certain feature works well or not (drivers don't always give us reliable information).
See: https://www.blender.org/download/requirements/

More post 1.4 features are likely find their way into Blender with the Viewport FX project for GSoC 2013: http://code.blender.org/index.php/2013/05/google-summer-of-code-2013/

Updated answer, minimum version changed from 1.4 to 2.1.

Is this still the case with Blender 2.8?

Updated for 2.8x

Is 2.8 compatible with opengl es. E.g for the raspberry pi 4

Blender has no ties to a specific version of OpenGL. For the entire GUI it even still sticks to the OpenGL 1.4 standard, which is now over 12 years old and can be expected to run fine on all modern 3d hardware.

Blender 2.77 is the first version to require OpenGL 2.1.
Blender 2.8 (planned for 2016) will be the first to require GL 3.2 core profile.
Like ideasman42 explained, Blender can use GPU features higher than the required minimum, but it must check first at run-time. This has been true for a long time and will continue to be true.
Regarding the ES part of your question, GL core profile is very close to ES so it should be doable for someone with ample time and knowledge.
See http://www.phoronix.com/scan.php?page=news_item&px=MTE2OTY for a prototype running on Android in 2012, using OpenGL ES.

Update:  We ended up using OpenGL 3.3 core profile for Blender 2.8.

For GSoC 2012 there was a project to port part of Blender to Android and thus to OpenGL ES. See http://wiki.blender.org/index.php/User:AlexK/Gsoc2012