text:
How can I use my Blender models in WebGL
I would like to create WebGL applications and use Blender as a modelling tool. I don't necessarily need to translate game engine functionality to WebGL but I would like to retain as much of the UV mapping, vertex colors, materials, etc. info as possible.
I already know I should keep the polygon count low. What are the other things I should keep an eye on? (Such as don't use feature X because you won't be able to export it)
What tools do I need to learn? (WebGL framework specific plugins, generic tools like OBJ exporter)

Page 414 in this book.
Its easy to use your Blender models in WebGL.
https://sites.google.com/site/webglbook/

Blend4Web development was abandoned in favor of Blend4Web Studio which won't be based on Blender anymore. Check out Verge3D framework created by former B4W developers instead.

The answer is somewhat dependent on what file format the WebGL viewer ingests. And how good the Blender exporter is. But the most common format is probably the ASCII Obj format, for which Blender has a pretty decent exporter for.
So, things to watch out for:
Geometry: Avoid Ngons, or at least, triangulate before exporting. The exporter might produce unexpected results. Also, make sure the face normals are all oriented correctly. Blender renders both side of a polygon by default, many other 3D viewers don't. You can recalculate normals with Ctrl + N.
Mesh Modifiers: Even though the exporter probably applies the modifiers. It's better to be explicit than implicit. Also, it is a good idea to apply the transforms (Ctrl + A).
Materials and Textures: Avoid the Blender material panel(except basic colors). Use UV-mapped textures. Blender-specific features like procedural textures are not going to migrate properly. Image textures dimensions should be power of 2 square. (1024x1024, 512x512, etc)

All good points, You could also add that one should also remember to recalculate normals and make sure no duplicate verts are present.

On the WebGL side I'd recommend looking into Three.js It supports the Obj and other format and is very often used for all kinds of projects

Thanks, iKlsR, I added the bit about normals. Feel free to edit my answer next time.

+1 for apply modifiers. Also, don't forget to apply transforms.

Three.js comes with its own Blender import / export addon! https://github.com/mrdoob/three.js/tree/master/utils/exporters/blender

Blend4Web can do most of the work for you. It exports Blender models correctly and also sets up the WebGL page. It's free and open source.
https://www.blend4web.com/en/
June 2020 - blend4web does not appear to support the current version of Blender (v2.82)  It is not clear whether this product is even still available after it was reworked to support Maya and other environments,

It seems you can now use the Three.js Blender Exporter plugin and export your model into a WebGL compatible JSON file and load it into your 3D scene using Three.js.

You can do this 3 viable ways:

Export with the built-in glTF addon bundled with Blender and then use a WebGL library which can load such assets, Three.js for example. This option requires some JavaScript coding skills to setup a web application and write basic logic to control the camera, setup lighting, etc. Tedious but completely free.

Use Verge3D addon for Blender. This won't require any coding but will cost you $290. It implements various extensions to glTF standard which include more native information about Blender's datablocks, such as materials, cameras, lights, HDRIs, animations, etc. This tool is around since 2017 and keeps compatibility with latest Blender versions.

If you just want to check out a model quickly and not anything else,  there are bunch of drag-and-drop glTF viewers out there (e.g Google's Model Viewer). Basically once you upload a glTF asset, it will generate a code for embedding into a web page. Of course this is just a viewer, so no interactivity other than 360 rotating by mouse and basic animation playback.


text:
Make the "Ruler/Protractor" measurements to appear on renders
I recently realized that blender have a "Ruler/Protractor" tool for precise measurements. Is there a way to make those measurements appear on final renders?
(By the way, is there a way to customize the transparency of those measurement value displays?)
Thanks in advance for replies.
(I am using cycle for render, but it is fine if I have to use Blender Internal for the measurements to appear)

I don't think this is possible. The only way I can think of is by taking a screenshot and compositing it on somehow.. You might just be better off modeling your own ruler/protractor using the snapping tools (you would have to add the numbers manually).

Well, taking screenshot have the limit of resolution. Maybe the solution is really manually modelling the measurements. Is it possible that there is some sort of python addin that can achieve this?

A small trick is to temporarily increase the DPI value (located in User Preferences > System (maximum to 144), then maximize the 3D window and capture the screen. (Maximize the desktop resolution before that if possible).

However, you are right about the limit of resolution, so this is the last choice, I guess, unless capturing several parts and tiling them manually.

Thanks. This solve the problem of the small text at least. And I think this is the solution for now

Would an OpenGL render be better than a screenshot?

@AnsonSavage, AFAIK it isn't supported. Anway you may want to try some addons such as MeasureIt.

source: Stack Exchange

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

sort: votes


text:
Different materials for each fluid inflow?
How to assign a different color / material to each inflow object in one simulation (bake)?
In the following example we tried to mix two inflows and experience the mixing between the two fluids. However, as bake starts there is only one domain object as fluid (object!) which does not respect color / material assigned to inflow objects!

Unfortunately, I don't know of any way to do this with the main fluid simulator, however it is possible with blender's SPH fluid simulator.
Note that there is currently no way to convert fluid particles into a mesh from blender. There are some python scripts that do this, but these are mostly pretty slow. There are also a few patches, but it seems development on these has been dropped for the most part.
Some advantages of the SPH fluid simulator:

No domain bounds

Supports inter-fluid interactions

Supports force fields

To mix to different colored fluids:

Create two emitter planes (ShiftA> Mesh > Plane):

Add two separate particle systems to the planes in Properties > Particles:

Increase the Life time of the particles in Particles > Emission to be at least equal to the scene end frame:

Set the particle physics to Fluid in Particles > Physics:

Add an object to represent the fluid particles. It should be very low-poly, a 1 division icosphere works well (ShiftA> Mesh > Icosphere). Note that you will need one for each color:

Set the Shading to Smooth on the icospheres and move them to another layer (M)

Set the particle type to Object in Particles > Render and select an icosphere in Dupli Object:

In Particles > Physics > Fluid interaction press the + button to add an particle system interaction and select the other emitter plane as the particle system object:

With both planes setup this way, add another object (e.g. a floor plane) and make it a collision object in Properties > Physics:

Create separate materials for each of the icospheres.

Set the Size (in Particles > Physics) and Number (in Particles > Emission) for each particle system. Larger particles = lower resolution, smaller = higher resolution. Adjust these settings so as to make the particles appear as a fluid without making the simulation too heavy.

You may also want to set the cache step to 1 in Particles > Cache for each particle system to ensure accurate caching.

Result:

See the wiki for more information about each setting.

We accepted this even though SPH simulation is not even close to the blender built-in fluid simulation result (our target). Regardless of the size of particles (even very small) it is too far from what we expected. We searched extensively and watched videos (youtube) but haven't found any promising solution considered this as a limit of technology or a work under progress.

Ideally there would be a way to mesh the particles together into one solid mesh (you can kind of do this with meta balls, but it is very slow and still doesn't look the greatest). There are some patches and python addons to do this, but unfortunately it doesn't seem like this will be officially in blender for a while..

The first link is 404

Wiki link is a 404.

Basically a scene similar to the one gandalf created.
But 4000 particles of size 0.1

set  to Halo

and Fluid properties: Stiffness 0
Leave the impression that the fluids mix:

You can just use 2 complete fluid systems. You cannot bake with multiple domains, but you CAN play back more than one. Create the first sim and bake it to a directory. Now disable the Domain and create your second sim and bake to a new directory. Now enable the first domain and ensure it points to the correct bake directory. Both sims will play back and you can put whatever material you want on each.  I have had as many as 5 sims running at once and each started at a different time. All in one scene.

But AFAIK they can't mix, like the OP seems to want.

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


text:
Using Python to create a sphere and map a texture onto it
Is it possible to map a texture onto a sphere using python script? I am sure it is, but so far I was not able to figure out how to do it.

Related, How to get perfect UV sphere Mercator projection?.

You should follow some beginner tutorials first, like Blender manual, to have an idea how to find yourself around Blender's API.
To get some feedback on comman tasks just pull down Info Panel or change the layout to Scripting like:

Now you will have feedback for all actions you perform like you usually would:

Perhaps this post on Blender Artists could help you. It is covering version 2.5, but at least it can give you a direction to go in and help you know what steps are needed.
Here are some quotes from the thread:
OP's question:

Just a very simple problem I think, but how can I make a little piece of
Python 2.5 script for this :

Tell me which is the active object ?
Create a new material
Create a new texture : type Image or Movie
Load an image in the texture

Successful answer:

import bpy

def loadImage(imgName):
    img = bpy.data.add_image(imgName)
    tex = bpy.data.textures.new('TexName')
    tex.type = 'IMAGE'
    print("Recast", tex, tex.type)
    tex = tex.recast_type()
    print("Done", tex, tex.type)
    tex.image = img
    mat = bpy.data.materials.new('MatName')
    mat.add_texture(texture = tex, texture_coordinates = 'ORCO', map_to = 'COLOR')
    ob = bpy.context.object
    bpy.ops.object.material_slot_remove()
    me = ob.data
    me.add_material(mat)
    return

loadImage('/home/thomas/picture.jpg')

Give or take the snippets that you need.


text:
How to create a workable leaf spring in Blender?
I want to create a leaf spring which can be used in a physical simulation to spring away the objects when it is being deformed. Should I use a soft body to do this? However, it doesn't seem like soft bodies could accomplish this.

I am not sure if any object would be suited for that. The easiest way is probably to solve the Differential equation and hardcode this function to the spring. (You could just take a sinus function with exponantial decrease in Amplitude)

Are you looking for something like this: https://www.youtube.com/watch?v=PGzy3B9vw0g ?

This is the closest simulation I could think of (also made video version available):

Create a Cube Shift+amc and scale down it sz.1Returnsx.5Return.
Create and instance with Alt+dy2Return. Repeat several times with Shift+r, making sure to end with an uneven amount.
Select all newly created cubes and and make active rigid bodies Control+r.
In the the Tool Shelf under Rigid Body Tools, click Calculate Mass and select Steel.
One by one go along selecting each of the neighbouring cubes and click the Connect button (also in the Rigid Body Tools).
Finally select the centre cube and set it to passive Control+Shift+r.

It's just a one minute video, you don't have to go into too much detail, just leave a useful summary here. Link only answers aren't recommended, because if the link goes (ie, the video gets pulled), so does the answer.

You can definitely write this explanation out. It really isn't that long. Take some screenshots of the relevant portions, like where you set the middle piece to passive, and you should be good to go. Nice effect, by the way.

the one-by-one part can be vastly sped up with this addon: http://blenderartists.org/forum/showthread.php?275823-WIP-Bullet-Constraints-Tools-0-3-7


text:
How important is a GPU for modeling?
I don't plan to be doing much cycles rendering, but I wanted to know if a GPU is still important if I'm doing high-poly modeling.

I will assume you are talking about an external GPU in this case, say a Nvidia GTX 660 etc..
Excerpt from the Manual

...GPU rendering makes it possible to use your graphics card for
rendering, instead of the CPU. This can speed up rendering, because
modern GPUs are quite designed to do a lot of number crunching...

In short, No, you do not need an external GPU. Not to get too technical but except for drawing and viewport stuff amongst some other things, much of Blender's core functionality relies very little on a fully fledged GPU.
For modeling in your case, you are perfectly fine with just a decent CPU and an onboard graphics card that supports OpenGL (which in these modern times is pretty much every one of them).
Having one would be nice though as this can greatly improve the viewport performance among other things but it is not a major requirement unless you are going to be doing very heavy or demanding production work.

Graphics card note: Blender runs on all OpenGL compliant cards,
although there are some issues with cheap onboard cards (Intel, Via).
We therefore can't officially support and guarantee that Blender works
fine on those systems.

You can see the system requirements for Blender here.

High-poly modeling is not a very clear term, but if that includes sculpting I would definitely recommend a good NVidia or AMD GPU with 1GB memory minimum. Even for moderately complex scenes it's best to avoid onboard graphics whenever possible.

I think this answer needs to be a bit more clear about the role that the GPU plays in rendering the viewport. Every point/line/poly that shows up in the viewport has to be rendered by the GPU. In fact, the principles are (by design) extremely similar to 3D gaming. Asking if you need a GPU for Blender is almost exactly like asking if you need a GPU to play computer games: it depends. Do you want to play Crysis or Tetris? Are you okay with playing Crysis at 2 fps on the lowest settings, or do you need to run max settings at 120 fps? It all depends.

@Matt I think I summarized it well enough (it's good to have one but not necessarily needed) so feel free to add to it if you wish or roll your own answer :).

I take that back, I overlooked the link you provided to "What everybody needs to know about Blender Viewport performance." That should suffice ;-)

On-board Graphic cards are not much powerful.Its just one simple fact,if you want fast renders you will need a good graphic card.
Rendering time also depends on material. Suppose if you use SSS, you "will" need a graphic card.

the question, while perhaps not explicit enough, suggests that the major use case will be high poly viewport editing, and not rendering which your answer concentrates on.

Not only that, but SSS is not yet available on the GPU.

Renders are only capable of using the GPU in cycles. The GPU will not affect renders in the slightest outside cycles.

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


text:
silencing Blender output using Python
I have a python app that imports bpy as a module.  I am trying to silence all the Blender console outputs so that outputs like
Fra:1 Mem:7.99M (19.13M, Peak 27.65M) | Scene, Part 243-256
Fra:1 Mem:7.99M (19.16M, Peak 27.65M) | Scene, Part 244-256

doesn't flood the console and interfere with my own console output.
So far I've tried a few solutions I found but most of them seems to leave stdout in a weird state that causes certain errors. Here is my current code that works at silencing render.render() but throws an exception during save_as_mainfile() for some reason.
Is there anyway I can go about silencing Blender completely without any side effects?
The crash I am experiencing is only present on Windows. It seems supressing the stdout is much more reliable on Mac and Linux.
import os
import bpy

class SuppressOutput:
    def __init__(self):
        self.duplicate_stdout_fd: int | None = None

    def __enter__(self):
        sys.stdout.flush()
        self.duplicate_stdout_fd = os.dup(sys.stdout.fileno())
        null_fd = os.open(os.devnull, os.O_WRONLY)
        os.dup2(null_fd, sys.stdout.fileno())
        os.close(null_fd)

    def __exit__(self, exc_type, exc_val, exc_tb):
        sys.stdout.flush()
        os.dup2(self.duplicate_stdout_fd, sys.stdout.fileno())
        os.close(self.duplicate_stdout_fd)

if __name__ == "__main__":
    print("Hello")
    print("Blender Version is: ", bpy.app.version_string)

    with SuppressOutput():
        # comment out the save_as_mainfile() line to make this script work
        bpy.ops.wm.save_as_mainfile(filepath="//test.blend")
        bpy.ops.render.render()

    print("Goodbye")

I don't think that's it's a good idea to hijack the console. Imagine every script trying that. Why don't you just write the output of your script to a file?

The logging module is available in the Blender's Python version. Just saying ...

To be clear, this is not for a Blender addon. It's an app that calls Blender to do some work. My app is console based, so I agree with you that what the console shows should be strictly controlled. Which is why I only want MY app to output to it and have all Blender outputs be silenced.   I am already logging stuff, but a lot of Blender's output (like the rendering status) is being emitted at the C level.

stdout=subprocess.PIPE
If the app calls Blender with something like process = subprocess.Popen, you just capture all the output from the process with stdout=subprocess.PIPE and read it from process.stdout and print in the main process conditionally.
socket
You can also suppress all the output from the sub-process with stdout=subprocess.DEVNULL and instead create a socket connection and write to the socket from within the sub-process.
os.dup2
If you need to capture the stdout from within the same interpreter and from the same file descriptor the Blender is currently printing to you need to use low-level functions to create and override the file descriptors. You can redirect the stdout only to low-level file-like objects such as os.pipe or os.devnull or a file on disk.
Windows
On Windows Python 3.6 - 3.10 does some handling that caches sys.stdout.buffer and exhibit random erroneous behavior. It is a Python bug: bpo-30555: Fix WindowsConsoleIO errors in the presence of fd redirection. The fix was not backported. sys.stdout needs to be recreated both times after os.dup2. This has implications but for the usage such as the OP's as a throwaway instance of Blender for background jobs will suffice.
Handling like pytest's _windowsconsoleio_workaround
Capture_Stdout
import io
import os
import queue
import sys
import threading
import ctypes
import traceback

class Capture_Output:

    _std_output_name: str

    def __init__(self, is_dummy = False, use_set_other = True):
        self.lines = queue.Queue()
        self.is_dummy = is_dummy
        self.use_set_other = use_set_other

    def __enter__(self):

        if self.is_dummy:
            return self

        self.flush()

        std_output: io.TextIOWrapper = getattr(sys, self._std_output_name)

        self.prev_std_output = std_output

        self.file_descriptor = std_output.fileno()

        self.file_descriptor_copy = os.dup(self.file_descriptor)

        self.pipe_read_fileno, self.pipe_write_fileno = os.pipe()

        self.pipe_reading = threading.Thread(target=self.read_pipe)
        self.read_pipe_textwrapper = os.fdopen(self.pipe_read_fileno, encoding='utf-8')
        self.pipe_reading.start()

        os.dup2(self.pipe_write_fileno, self.file_descriptor)
        self.write_pipe_textwrapper = os.fdopen(self.pipe_write_fileno, 'w', encoding='utf-8')
        setattr(sys, self._std_output_name, self.write_pipe_textwrapper)

        if self.use_set_other:
            self.set_other(self.prev_std_output, self.write_pipe_textwrapper)

        return self

    def __exit__(self, exc_type, exc_value, _traceback):

        if self.is_dummy:
            return

        ctypes_flush_error, sys_flush_error = self.flush()

        os.dup2(self.file_descriptor_copy, self.file_descriptor)

        if self.do_need_recreate_windows_output():
            prev_std_output = self.copy_text_io_wrapper(self.file_descriptor, self.prev_std_output)
        else:
            prev_std_output = self.prev_std_output

        setattr(sys, self._std_output_name, prev_std_output)
        if self.use_set_other:
            self.set_other(self.write_pipe_textwrapper, prev_std_output)

        self.write_pipe_textwrapper.close()
        self.pipe_reading.join()
        self.read_pipe_textwrapper.close()

        if ctypes_flush_error is not None:
            print(ctypes_flush_error, file = sys.stderr)

        if sys_flush_error is not None:
            print(sys_flush_error, file = sys.stderr)

        os.close(self.file_descriptor_copy)

    def flush(self):
        """
        Theoretically `PYTHONUNBUFFERED=1` as an environment variable can be used instead.

        Use `flush=True` for time critical prints.
        """

        try:
            if os.name == 'nt':
                lib = ctypes.CDLL('api-ms-win-crt-stdio-l1-1-0.dll')
            else:
                lib = ctypes.CDLL('libc.so.6')  # not tested

            lib.fflush(None)

        except Exception as e:
            ctypes_flush_error = traceback.format_exc()
        else:
            ctypes_flush_error = None

        try:
            getattr(sys, self._std_output_name).flush()
        except Exception as e:
            sys_flush_error = traceback.format_exc()
        else:
            sys_flush_error = None

        return ctypes_flush_error, sys_flush_error

    def read_pipe(self):
        for line in self.read_pipe_textwrapper:
            self.lines.put_nowait(line)

    def copy_text_io_wrapper(self, fd: int, prev: io.TextIOWrapper):
        return io.TextIOWrapper(
            os.fdopen(fd, 'wb', -1 if hasattr(prev.buffer, 'raw') else 0),
            prev.encoding,
            prev.errors,
            prev.newlines,
            prev.line_buffering,
        )

    def do_need_recreate_windows_output(self):
        """
        bpo-30555: Fix WindowsConsoleIO errors in the presence of fd redirection
        https://github.com/python/cpython/pull/1927
        https://docs.python.org/3.10/whatsnew/changelog.html#id150
        """

        if os.name != 'nt':
            return False

        current_python_version = (sys.version_info.major, sys.version_info.minor)

        if current_python_version >= (3, 10):
            return False

        if current_python_version < (3, 6):
            return False

        if not hasattr(self.prev_std_output, 'buffer'):
            return False

        if hasattr(self.prev_std_output.buffer, 'raw'):
            buffer = self.prev_std_output.buffer.raw
        else:
            buffer = self.prev_std_output.buffer

        if not isinstance(buffer, io._WindowsConsoleIO):
            return False

        return True

    def set_other(self, prev_output, output):
        """ Replace other output targets. Patch this function if needed. """

        import logging

        for logger in logging.root.manager.loggerDict.values():
            for handler in getattr(logger, 'handlers', ()):
                if hasattr(handler, 'stream'):
                    if handler.stream is prev_output:
                        handler.stream = output

class Capture_Stdout(Capture_Output):
    _std_output_name = 'stdout'

class Capture_Stderr(Capture_Output):
    _std_output_name = 'stderr'

Tests
import os
import sys
import time

print('=' * 80)
print("Hello")
print("Python Version is: ", sys.version_info)

def is_in_blender():

    if os.environ.get('I_AM_NOT_BLENDER') == 'True':
        return False

    try:
        import bpy
        return bool(bpy.app.version) and bool(bpy.app.binary_path)
    except Exception:
        return False

if is_in_blender():

    import bpy

    print("Blender Version is: ", bpy.app.version_string)
    with Capture_Stdout() as capture:
        print(time.strftime('%H:%M:%S %Y-%m-%d'))

        if not bpy.context.scene.camera:
            camera = bpy.data.objects.new('Camera', bpy.data.cameras.new('Camera'))
            bpy.context.scene.collection.objects.link(camera)
            bpy.context.scene.camera = camera

        bpy.context.scene.render.engine = 'CYCLES'
        bpy.context.scene.cycles.samples = 1
        bpy.context.scene.cycles.use_denoising = False
        bpy.context.scene.render.resolution_y = 64
        bpy.context.scene.render.resolution_x = 64

        bpy.ops.render.render()

        bpy.ops.wm.save_as_mainfile(filepath=os.path.join(bpy.app.tempdir, 'some.blend'), copy=True)

    print(capture.lines.queue)

for i in range(1000):

    with Capture_Stdout() as capture:
        capture.lines.put_nowait(i)
        print(time.strftime('%H:%M:%S %Y-%m-%d'))
        print('hello')
        time.sleep(0.0001)
        print('world')
        print('world')
        print('world')
        print('world')
        with Capture_Stdout() as capture2:
            time.sleep(0.0001)
            print('world')
            print('world')
            print('world')
            print('world')
        print(capture2.lines.queue)
        time.sleep(0.0001)
        print('world')
        print('world')
        print('world')
        print('world')
        time.sleep(0.0001)

    try:
        print(capture.lines.queue)
    except Exception:
        import traceback
        traceback.print_exc(file=sys.stderr)
        print(_, file=sys.stderr)
        break

print("Goodbye")

Possible output
C:\Users\user>blender -b --factory-startup C:\Users\user\AppData\Local\Temp\blender_a20660\some.blend --python-text "Text"
Blender 3.1.2 (hash cc66d1020c3b built 2022-03-31 23:39:57)
Read blend: C:\Users\user\AppData\Local\Temp\blender_a20660\some.blend
================================================================================
Hello
Blender Version is:  3.1.2
['Fra:1 Mem:8.44M (Peak 8.47M) | Time:00:00.00 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Synchronizing object | Cube\n', 'Fra:1 Mem:8.44M (Peak 8.47M) | Time:00:00.00 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Initializing\n', 'Fra:1 Mem:8.35M (Peak 8.47M) | Time:00:00.00 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Waiting for render to start\n', 'Fra:1 Mem:8.35M (Peak 8.47M) | Time:00:00.00 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Loading render kernels (may take a few minutes the first time)\n', 'Fra:1 Mem:8.35M (Peak 8.47M) | Time:00:00.00 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Scene\n', 'Fra:1 Mem:8.35M (Peak 8.47M) | Time:00:00.00 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Shaders\n', 'Fra:1 Mem:8.85M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Procedurals\n', 'Fra:1 Mem:8.85M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Background\n', 'Fra:1 Mem:8.85M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Camera\n', 'Fra:1 Mem:8.85M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Meshes Flags\n', 'Fra:1 Mem:8.85M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Objects\n', 'Fra:1 Mem:8.85M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Objects | Copying Transformations to device\n', 'Fra:1 Mem:8.85M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Objects | Applying Static Transformations\n', 'Fra:1 Mem:8.85M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Particle Systems\n', 'Fra:1 Mem:8.85M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Particle Systems | Copying Particles to device\n', 'Fra:1 Mem:8.85M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Meshes\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Mesh | Computing attributes\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Mesh | Copying Attributes to device\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Scene BVH | Building\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Scene BVH | Building BVH\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Scene BVH | Building BVH 0%\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Scene BVH | Copying BVH to device\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Mesh | Computing normals\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Mesh | Copying Mesh to device\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Objects Flags\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Primitive Offsets\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Images\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Camera Volume\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.00M, Peak:0.00M | Scene, ViewLayer | Updating Lookup Tables\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.25M, Peak:0.25M | Scene, ViewLayer | Updating Lights\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.25M, Peak:0.25M | Scene, ViewLayer | Updating Lights | Computing distribution\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.25M, Peak:0.25M | Scene, ViewLayer | Updating Integrator\n', 'Fra:1 Mem:8.86M (Peak 8.86M) | Time:00:00.02 | Mem:0.26M, Peak:0.26M | Scene, ViewLayer | Updating Film\n', 'Fra:1 Mem:8.87M (Peak 9.12M) | Time:00:00.02 | Mem:0.01M, Peak:0.26M | Scene, ViewLayer | Updating Lookup Tables\n', 'Fra:1 Mem:8.87M (Peak 9.12M) | Time:00:00.02 | Mem:0.26M, Peak:0.26M | Scene, ViewLayer | Updating Baking\n', 'Fra:1 Mem:8.87M (Peak 9.12M) | Time:00:00.02 | Mem:0.26M, Peak:0.26M | Scene, ViewLayer | Updating Device | Writing constant memory\n', 'Fra:1 Mem:8.87M (Peak 9.12M) | Time:00:00.02 | Mem:0.26M, Peak:0.26M | Scene, ViewLayer | Sample 0/1\n', 'Fra:1 Mem:222.47M (Peak 317.39M) | Time:00:06.33 | Mem:150.56M, Peak:150.56M | Scene, ViewLayer | Sample 1/1\n', 'Fra:1 Mem:222.47M (Peak 317.39M) | Time:00:06.33 | Mem:150.56M, Peak:150.56M | Scene, ViewLayer | Finished\n', 'Info: Total files 0 | Changed 0 | Failed 0\n', 'Info: Saved "some.blend"\n', '04:34:27 2024-04-09\n', 'Info: Saved "some.blend"\n']
Goodbye

Blender quit

Kudos for identifying the underlying bug in Python that was causing this. That was the key the to kingdom! I happen to be using Python 3.10 & Blender 4.0. Will upgrade to Py 3.11 & Blender 4.1 wheel asap.

The bug was fixed in Python 3.10.0 beta 1. I don't think Blender is shipped with the beta versions.

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


text:
Eevee is using my CPU to render
I rendered a short animation using Eevee engine, but my cpu was used 100% of the time. The temperature and fan of the cpu went crazy. How is that possible? Eevee is supposed to use OpenGL and has nothing to do with the settings in preferences, correct me if I'm wrong. I do have Cycles on GPU Compute and Cuda selected in Preferences with no CPU, but that shouldn't matter anyway. I have my both monitors plugged in the GPU display ports. It's a RTX 2070. I rendered the animation 3 times and checked the hardware with CAM and Task Manager. Why is Eevee using my CPU instead of GPU???

Please refer to this question here: https://blender.stackexchange.com/questions/162264/blender-still-using-cpu-even-when-i-have-cuda-chosen-in-preferences/162265#162265

I have the Cycles engine setup just like that with GPU Compute and Cuda in Preferences. But it shouldn't matter anyway. I'm using Eevee for animation rendering and it uses my CPU 100%. How could that be? By the way, I just rendered it with Cycles and it's all good using my GPU completely.

Ah sorry, wrong link. I'll post the full answer

Make sure that Blender uses your dedicated GPU and not the integrated GPU in your CPU. This can be configured in the Nvidia control panel.

Let me check that and I will get back to you.

No particles or simulations, neither complex nodes. Very simple seen with few objects in it. I wen't to Nvidia Driver Control Panel and I changed the OpenGL from Auto-Select to GPU RTX 2070. It didn't fix the problem. I did another animation one with Cycles another one with Eevee. Cycles uses up to 85% the GPU and 9-10% the CPU, Eevee does exactly the opposite. It's totally abnormal behavior from Eevee. What's happening?

Guess what. Because you mentioned the Compositing piece I checked it out. I had an Alpha Over, an RGB and a Denoise Filter. I removed the denoise filter and problem solved. The CPU doesn't go nuts anymore when rendering with Eevee. If I keep the denoise on with Cycles there is no problem with the cpu though.

what?  no i'm not

If anybody runs into the same problem in Eevee where the cpu is overloaded while rendering check your Compositing mode and make sure you don't have a Denoise filter on. It doesn't create a problem when you render in Cycles but it does put stress on the cpu when rendering with Eevee.

Good to know, thanks :).

Why on earth would denoising ever cause issues like this?  It's either using a neural network to denoise (much faster on the GPU), or it is using a wavelet transform (again, much faster on the GPU).  This is a bug in Eevee if it is trying to do denoising on the CPU.

@whn s/bug/missing feature/?

From the Blender Manual:

CPU Rendering
Being a rasterization engine, Eevee only uses the power
of the GPU to render. There is no plan to support CPU (software)
rendering as it would be very inefficient. CPU power is still needed
to handle high scene complexity as the geometry must be prepared by
the CPU before rendering each frame.

In short: CPU is still needed to prep the scene, GPU is used to render it.

There is no complexity in my scene. There is no need for the CPU to kick in. The GPU is not even loaded. I wish I could send you a vid with the CAM graph to see it. It didn't happen before. It's just something new out of whack. Not sure what on planet earth is happening.


text:
how to render the correct animation
My animation keeps rendering the video editor place not the animation area.  If someone could help me that would be great.

This is a very common problem with an easy solution. You need to untick "sequencer" as is seen in this answer: https://blender.stackexchange.com/a/5286 Change this setting if you want to change between rendering the animation and rendering your Video sequence. Happy Blending! :)

Does this answer your question? Blender is rendering an older version my project


text:
How to set copy rotation range of influence (min 0.499 and max 0.96) using driver
I want to set a min and max influence range using a driver for the copy rotation constraint. I've tinkered with the driver graph in graph editor but it's too delicate to set my specific range --between 0.499 and 0.97.  So when I manipulate the target object in the scene--a slide control bar--up and down, it sets the copy rotation influence between 0.499 and 0.96.  The default range is between 0.0 and 1.0 when I slide the control bar targeted by driver.

This is graph editor screenshot with scripted expression from answer.  Driver holds influence value at 0.499 but does not increase to 0.96 when targeted slide control is moved along Z axis

Would look into why there is an ERROR message --> https://blender.stackexchange.com/questions/46899/python-auto-execution-disabled-error and whether this could be effecting your result.

You can use a scripted expression, using min() and max() functions.
Let's say you're driving this from the Z position of an empty, the variable for which is named var.
Then if you use an expression like "min(0.96, max(var, 0.499))" then you will get 0.96 if var is greater than 0.96 (because the minimum value of the two is 0.96), 0.499 if var is less than that (the maximum of the two values), and var if var is in between those two values.

It's also possible to do this by editing the driver curve, using vector handles for the controls, but I just use scripted expressions for this kind of thing.

Wow, thanks for quick answer especially on 4th of July!  I copied and pasted expression into scripted expression field (I'm using v2.79 btw).  Influence sets at 0.499 but does not change when I move slider control.  Am I doing something wrong?

I can upload a screenshot of blender control panels if you tell me how...sorry

@Dino808 I couldn't tell you without seeing a file or picture.  You can edit your question and copy/paste an image with your cursor in the edit field to upload a pic to SE.

I had to answer my own question to paste screenshot above.

Looks like moderator moved screenshot to original question post

@Dino808 Look at the error message in your driver tab.  You have Python disabled.  You can enable this in user preferences/save & load/blend files/autorun Python scripts.

Wow that did the trick...works!  Thanks Nathan..hope u can enjoy the rest of ur long 4th weekend!


text:
Not sure how to use multiple UV layers on one character
So one this character I have a UV layer for the face and one for the body. But when I swap between the UV layers to add more texture paint to either map, the UV layer for the face disappears. I don't really know how to keep both layers visible and active to paint on.
Here is the face layer displayed, it still lets me add detail to the objects on this layer.

And here is the body UV layer. I want them both active at the same time. And I'm aware that a lot character meshes use both a layer detailing the face, and one for the rest of the body. But I seem to be missing something when it comes to how to use them both... Does it have something to do with the node setup? I tried applying the UV layers as a material to the head and body in the materials tab of the properties panel, but it didn't seem to work. Thank you all in advance for your help and support, you guys rock!

And I did connect the textures with the mix node and it didn't work...

this video will help you https://www.youtube.com/watch?v=vJPJIXUkpqY&feature=youtu.be&fbclid=IwAR0AsV2YX1C7jeaVyrfrFCifRBmhbiJOgTweG1AFAnb4JdV4l0HIQMJkpzQ

Not sure if you are asking this, but why didn't you connect the respective UV maps to the image textures? Just like its shown in the below image, create a UV Map node for each image texture and connect the respective UV map to the texture.

Thank you all for taking the time to respond, but I watched the video, and tried this UV input technique and it didn't seem to change anything.


text:
Is it possible add a texture to a plane in the two-dimensional animation editor?
So I wanted to make a 2D animation about this specific spite of Mario( made by Nintendo) flying through an obstacle course. I added in a similarly 2D plane, rotated 90 degrees so I could see it from that angle. I was going to add this texture to it, but I didn't know how because I'm a newbie, so I tried out making materials with this texture. I couldn't find out how to add the texture to the material itself, however. So then I tried making nodes work, but to no avail. I have literally no idea how I'm going to do this besides what already failed. The 2D editor has no UV mapper, either. How am I going to add this image to a 2D animation?

Hi. What do you mean by "the two-dimensional animation editor"?

The 2D animation editor actually is the 3D view editor. The "2D Animation" startup file sets the world to white, adds a grease pencil object, and goes into edit mode. Other than that, it's just a different set of layout tabs for Blender.
Go ahead and, in the 2D animation editor tab, orbit around.
In respect to putting an image texture onto a plane, since it is actually the standard 3D space, look for UV and image texture material tutorials.
If you still need help, I might be able to provide a tutorial, but don't worry: There's nothing to be afraid of :)


text:
How can I create a mirror material for the game engine?
A google search found this demo of a mirror in the BGE Video:Mirror Made in Blender Game Engine but I can't find out how to setup the material. Unlike in the BI renderer the option Mirror isn't available when in BGE.
What tricks do I need to know?

It is called render to texture, you can also set it to mirror instead of UV, Generated, Object...etc. Here is a simple tutorial on render to texture inside of the blender game engine. https://www.youtube.com/watch?v=mPFhX_ogL2Y

You can easily fake it for Multitexture and GLSL - shading modes:

Give the Object a material
Give the material an image texture
In the Mapping panel of that texture, set the Coordinates to Reflection

To make it work, you should use a sphere map and use camera view. I did this sphere map by setting the camera to orthographic (Orthographic Scale of 2.0, because the sphere is 2 blender units in diameter) and rendering a reflective sphere.

The result looks like this:

It is possible by using bge.texture.ImageMirror.
Basically the mirror objects texture is frame by frame replaced with a video-texture which is captured by another camera.

A tutorial and an example .blend file which works with Blender 2.68.

So is this always one frame behind?

@WChargin currently I don't understand the implications of the script included in the .blend file.

Image without anti-aliasing is a bit strange... But it does work for me when I download a 2.6 example blend and open with 2.7, but I can not make one in my game in 2.72. Who can help me?


text:
How can a rigged model be used multiple times in a scene?
I've created a rigged model and created and grouped the model and rig.
I would like to add it multiple times in a single scene. I used File > Append selected the group, made it local L and created a proxy Ctrl + Alt + P.
But I can do this only once, when I try to repeat the procedure described before nothing happens.
It works when I save the group in another file, and link two different groups into the scene.
What am I doing wrong?

do you repeat if for the same group or a different one?

@iKlsR When I repeat it for the same file nothing happens (not even an error message), when I copy the file first say group1.blend and group2.blend then I can link two objects. This wouldn't be a good way to place a school of fish in a fishtank.

if you have already done the steps above, you wouldn't need to do it on the same file, just add a new grouped instance since the object is already in the scene.

IIRC, the rig is usually saved as a different object from the mesh? If so, just import both of them at the same time.

@iKlsR: Instancing two linked groups and making proxy of the rig in each of the group instances works.. But when posing the first proxy, the surface in the second group instance also moves.

One you have imported the model. You can add it to the scene just as you would add any other object. Just open the Space Menu and go to Group Instance and you should see a new entry there for the rigged model.

thank you, it didn't work from the Space menu, but from the Main menu / Add.


text:
Is there a way to find out what is in the latest build?
The release logs document the new features after a version has been released.
Is there a page which lists what of the announced features is already included in the latest build ?
I can't wait to test Multi-view (stereoscopic) render and display support.

Update
For bleeding edge changes and latest bug reports, even typo fixes you can access these feeds as well
https://twitter.com/BlenderLogs
https://twitter.com/BlenderBugs

There isn't a pretty or detailed view like the release logs for the latest builds, one way you can keep up to date with commits is to go to projects.blender.org developer.blender.org. As a new commit is made, it is updated there along with the revision number, files changed and or features added.
Additionally, if you are on twitter or Google+, Adventures in Blender posts about the latest additions or changes in detail with additional links at times. For example.
You can also now view the shortlog on git.blender.org for a quick summary of commits/fixes.

There is no such page (yet). Eventually a release log will be created in the blender wiki, but it will usually take some time before such an effort is started.
The best way to find out what is going on in the Blender code repository is to follow the commit messages in the commit list: http://lists.blender.org/pipermail/bf-blender-cvs/
This is a quite high-volume list, since a lot is going on.
Note that Blender code repository is scheduled to move to Git in the near future (but after Google Summer of Code 2013), after which you probably will find even more commits to browse through.


text:
Setup of PyDev and Eclipse for Blender Add-Ons
I followed the instructions in this ebook Programming Add-Ons for Blender 2.5 to setup a development environment.
Currently I try to debug an installed add-on called Bloop although it seems to work, eclipse still shows many error messages like:
class Mapping(object):

    def __init__(self, joint=None, id=None, bone=None, other=None):
        ...
        self.bone_matrix = bpy.bloop.armature.matrix_world.inverted() * self.bone.bone.matrix_local.inverted()
                               ^^^^
                               ErrorMsg: Undefined variable from import: bloop

The external libraries are configured as follows:

Blenders version is 2.67, the add-on was developed for 2.59. I have absolutely no experience with Python in blender.
Another type of errors is:
Unresolved import: MappingSet   bloop.py

from .mapping_set import MappingSet

Where MappingSet is in the same folder as bloop.py which tries to import.
The projects structure is as follows (I don't have a source folder since I want to edit in place)

What am I doing wrong?

I think this question is off topic, and relates more to eclipse than it does to Blender.

Does this answer your question?

I think it's still Blender related enough

@grc Thanks, this indeed help for one type of error messages, I added another type.

@stacker You could try this. If that doesn't work, you might have more luck just downloading Blender 2.59. Blender is portable so it's fine having multiple versions on your computer.

@grc Thanks again, unfortunatly the link describes how to add  external libraries which I already have, the problem here is that in the bloop source folder MappingSet from .mapping_set.py isn't resolved.

@stacker Since these errors are all coming from pydev, have you tried running it outside of eclipse?

@grc Yes seems that PyDev introduces more issues than it helps. I give up using PyDev until someone else has another idea.

A workaround to suppress at least the error messages is using #@UnresolvedImport and  #@UndefinedVariable at the end of those lines.

@stacker wasn't able to comment properly on this before but it relates more to Eclipse than Blender. Pertaining to your edit, I think this should be the other way around, IMO this belongs more on SO.

Posted on SO http://stackoverflow.com/questions/16821865/setup-of-pydev-and-eclipse-for-blender-add-ons

See the discusion for this question on meta


text:
How to fix fins clipping
This is my first time rigging a character in blender, i followed a tutorial so I have most of it done. The only problem I've encountered, is my character has fins on the back of their shins, so when they lift their legs they clip into the thighs. I have tried numerous times to have them pull together and kinda bunch up behind the knee, but no matter what I try it doesn't work.

I have tried the bones targetting the square bones on the left side using locked and damped track, I have tried limiting distance, none of it seems to work
Let me know if I need to add more detail like uv mapping and stuff, thanks for any answers!

You could use a driver using the "Rotational Difference between the two bones around the knee as source.
Hover the rotation channel you need to drive and hit ⎈ CtrlD to add Driver, then  RMB : Open in Drivers Editor.
From there, set the driver's type to Average Value, and the var type to Rotational Distance:

In the targets, set the armature object and the two bones around the knee.
Then, select the keyframes in the graph. Move your leg bones to the most rotations to which the fin shouldn't rotate yet, and move the keyframes so that the white dotted cursor is at zero. Then move the legs as much as it can go up, and move the second keyframe to whatever rotation you want the fin to have when the leg is that much bent.
Then move the leg back to check if there's any penetration between. If there is, add a new keyframe to deform the curve shape in between the extremes.
Finally, to be sure that the rotation can't go further, select the first and last keyframe, press V > Vector to set their handles to vector, and then ⇧ ShiftE > Constant so that the extrapolation stays constant.

The result should look like this:

Thank you so much! Gotta learn drivers now xD, either way a great help


text:
3D modelling Wired Designs
I came across this 3d printed item on shapeways, I was wondering how to model this wired design on Blender 2.69. I am fairly new in modelling on blender. Kindly give me one or two pointers.

You could start by modelling the wire shape, then using a Skin modifier to turn the edges into solid geometry that could be printed. I've seen the Skin modifier used to make basic figures based on a skeleton, and it works on the default cube, but when I just tried it on a Monkey, blender crashed for me, so make sure you save your work before you attempt to use the modifier!

You can use the new Wireframe modifier to do this. It will convert edges into solid geometry:

Or you can use the old Wireframe tool:

Select your mesh and enter edit mode (Tab)
Select all (A)
Press CtrlF> Wireframe.

add edgesplit modifier and move it at the top to give it better look (it will remove those rounded inner sides and give a proper wireframe look.

@dukejib You can do that by enabling Crease Edges in the modifier and setting the crease weight to 1. (In the screenshot it is .5, I rather liked the effect..). I tried the edge split modifier after reading your comment, but I did not get the expected result.

yeah. you are right. i forgot to mention crease,


text:
How to add transparency to a group of objects
I would like to make a group of objects semi-transparent. I could not find a straight forward answer and the ones related include menus I cannot find in my Blender. I am working with Blender 2.69.

You want to add a transparent texture to a group of objects?

I just want to make the objects look semi-transparent when I render them. I do not have any preference on how to achieve this.

You may want to stipulate how you want this semi-transparency to look (perhaps with an image). The time-consuming route would be to involve transparency in your material (how to do so varies with your choice in renderer). A faster way may be to put all of the objects on a single render layer and manage transparency from the node compositor.

Cycles or Blender internal?

Blender internal:
You can add a material with the transparency option enabled:
Cycles:
For cycles it's a bit different:

Assign material to your objects
After that you can assign manualy your material to your object one by one, or you can select all the object that you want to assign the material and select at last the object wich has already the transparent material. Then do ctrl+l and select Material. All your selected objects have now the transparent material.

The objects already have materials. Is there any way this new material can be applied over the existent materials?

You don't have to add a new material you just have to : in Blender internal to check the transparency option and set the alpha under 1, in cycles set the surface option to Transparency BSDF. I've updated the picture in my answer.

Is there any way I can do that to several materials at the same time? The group is formed by several objects with a number of materials. PS: I'm not working with cycles.

The only way is to check the transparency of your objects one by one. But of course you can script it.

Thanks. It definitely works... One last question: transparent objects are still casting shadows. Is there any way to correct this?

Found it: http://blender.stackexchange.com/questions/1906/dark-shadows-when-using-ao-with-transparent-materials


text:
Render a Bezier curve in the game engine
I would like to visualize a curve when the blender game engine is running. In the editor the curve is clearly visible:

But when I run the game engine it is not

What can I do to visualize the curve when running the game engine

Curves are a unique object type, they won't render without depth in the default renderer and even with depth, they won't render in the BGE as these and paths aren't supported.
To render these, you have to convert to a mesh, use AltC > Mesh from Curve/Meta/.... You can always duplicate and move the original to another layer before converting so you have a backup and in most cases, if the converted mesh is simple enough, you can convert it back to a curve via the same menu.

If you don't want to loose that ability to edit the curve you could also add a cylinder with an Array and a Curve Modifier, this would render in the BGE.

Won't quite get that smooth look but a good alternative.


text:
Mapping an algorithm to an animation
I have written an algorithm that can compute fingering of piano scores.
Now I would like to have a 3D animation of a pair of hands playing this score. Each finger is already assigned to a key.
How could I use blender api for this. If it is possible at all?

Can you elaborate some more. How do you envision this workflow to go? Should it be all automatic (maybe the best if you plan to animate long or many scores). Is it ok if there are some manual steps?

There should not be any manual steps. So basically, it should be able to operate command line. Input a musicXml with fingering information -> output animation

@dorien Have a look at the python API reference

Seems to me this would be ideal for the game engine.

@dorien Had you any problems to adapt the script below?

I was looking for something more specific for piano fingerings. As it would require a lot of rules to make the hand move correctly. If I have time I might give it a show.

Here is a very basic example of what you're trying to achieve:
A control file holds some data in the format
Frame-no obj_name,value of 'Key 1'
I have only created 2 shape keys (basic and 'Key 1') to test the script.
1 Finger1,1
1 Finger2,1
1 Finger3,1
1 Finger4,1
10 Finger1,.5
20 Finger2,.5
30 Finger3,.5
40 Finger4,.5
50 Finger1,1

The python script reads the control file and adds keyframes for each line
import bpy

filename='C:\\dev\\finger_shape.txt'

for line in open(filename):
    line=line.rstrip("\n")
    # Only append lines that have space in them.
    if line.find(" ") != -1 and line.find("#") == -1:
        # Split non comment lines of the format: Frame-no obj_name:value of 'Key 1'
        frame,obj_key= line.split(" ")
        obj,value=obj_key.split(",")
        bpy.context.scene.frame_set( int( frame ))
        bpy.context.scene.objects.active = bpy.data.objects[ obj ]
        bpy.context.object.data.shape_keys.key_blocks['Key 1'].value = float(value)
        bpy.context.object.data.shape_keys.key_blocks['Key 1'].keyframe_insert('value')

Result:

Regarding you comments on automatise the rendering you might find these posts interesting:

Is there a way to batch render multiple scenes?
Blender rendering automation (build script)

Parsing XML is not blender related but you should find examaples on SO:

https://stackoverflow.com/questions/1912434/how-do-i-parse-xml-in-python


text:
How can I set a custom projection matrix for rendering?
How can I set a camera projection matrix? I want to render a perspective like the old SimCity 1989:

Related: http://blender.stackexchange.com/questions/5183/how-to-make-a-two-point-perspective-render?, and http://blender.stackexchange.com/questions/1888/how-can-i-get-a-cabinet-projection-camera?rq=1

Great! Thanks very much! Please tell me how yu find the angles (curious how find them).

For my answer below I just eyeballed it based on the image you linked to.

This not correct, is close but not correct. x and y direction lines not 90°. In blender picture look close, x grid lines almost horizontal but not horizontal, y lines OK.

I think I need matrix like this or transpose (assume no translation, no scale, no rotation):
{x_c, y_c, z_c, w_c} =  {x_w, y_w, z_w_, w_w} × {{1,  0,  0,  0}, {0,  1, 0,  0}, {ส,  ส,  1  0 }, {0  0  1, 0}, {0  0  0  1}}
Subscript w is world coordinate, c is camera, ส is scale for project z direction to x and y axises.

@mrcavallo No solution yet. I still try find way use python for loading a matrix. I have correct matrix (show in comment above) but need way load inside camera matrix!

Related: http://gamedev.stackexchange.com/questions/23572

For orthographic rendering Blender can't take a custom projection matrix, however you can shear an orthographic projection to get the desired results.

Use an orthographic camera, with the camera set at an angle (45 degrees on the X and Z axis).
In the render settings, set the Aspect X to sqrt(2)This will give something almost exactly what you're looking for, except that its rotated 45 degrees.
To correct the rotation, use the compositors Distort -> Transform node.

Notes:

rotating the image will loose some accuracy, so you'll want to render larger, then scale down.
in the compositor you can scale down by 1/sqrt(2) to avoid loosing the corners.
Depth/Mist won't work as you might want, however its probably possible to use a gradient and offset the depth in the compositor.

Excellent work! Use rotation –45° for SimCity direction.

Careful, x and y direction ok; but z direction is not correct for mist or depth effects.

@Châu good point, noted in answer.


text:
How to get the current step number in volume render
I need to get the current step number while rendering a volume object
the step used for sampling the volume :

something like in light path node " transparent depth , ray depth "

could be something like Ray depth x step size

@Bithur it seems not, i think ray depth is not increasing inside the volume

yep, wasn't sure about that but didn't find anything else :(

In short, no. This isn't currently exposed to the user.
The Transparent Depth value is a count of each transparent object, not distance traveled within it.
There is a Ray Depth output, but it's unclear what that does.
There is a Ray Length output, but it doesn't increase inside a volume. It's measured after the sample is taken.

ray depth is the number of bounces


text:
Can this even be modeled? 3D modeling of flexible spheres in contact with one another
I've never used any modeling software before and just wanted to know if
what I'm envisioning can be even be modeled.  I wasn't sure where to post this question, so if this is the wrong place, please let me know.  I would be grateful for any advice you may have.  What I'd like to do is:

3D modeling of flexible (soft body?) spheres in contact with one another. The spheres are just a surface with no internal points.
There's an initial sphere (say layer 0) whose surface is covered as much as possible by non-overlapping spheres of the same size in layer 1.  Because you can't fit an integral number of equal-sized spheres around an inner sphere of the same size, some amount of a few of the layer 1 spheres will be trying to occupy the same location.  Because of this, these spheres won't be spheres but will be kind of hemispherical shapes meeting in the middle in a flat interface.
Any of the outer surfaces of the layer 1 spheres and hemispheres that are not already covered by other spheres, will also be covered by non-overlapping spheres (layer 2). Some of the layer 2 spheres will overlap if there's not a surface area that can fit an integral number of them.   Ideally, the appearance of the sphere layers (0, 1, 2, etc.) is a sequential process, but I don't think that's critical for the model.  In other words, they could all be there initially.
The overlapping hemispherical entities are  trying to achieve their natural spherical shape and thus will exert pressure on each other.  This is where the flexibility part comes in.  As the overlapping hemispheres push against each other, they will change shape and push into neighboring spheres.  All the spheres/hemispheres are trying to maintain a spherical shape, so if a sphere is bulged into, it will offer a small resistance to this.
Is it possible to make a 3d simulation of what happens when you start this running to see how the pressure waves and forces move through the spheres?

Thank you to both of you for your help.  Both your answers were very informative and
will help guide my work on my hobby!
Roger

There is nothing to model really, you can use blenders primitive spheres, and position them procedurally by using the centre of the parent sphere as the pivot point of the first layer of children and constraining them to the radius of the parent. This way they will appear on the surface of the parent.
The way you can create the spheres is creating a emitter sphere which would be at the origin of your parent sphere with a radius of:
EmitterSpereRadius = ParentRad + childrenRad
Then create a particle system using the emitter sphere as the ... emitter, and creating the desired amount of particles which you will set to be emitted from the surface of the sphere rather than the volume. Turn off all forces acting upon the particles and they should stand still.
Now you can replace this particles with instance geometry (your children spheres) and you will have a parent sphere with it's children just about touching it's surface. (Note, that if you distributed your particles randomly, some children could be overlapping).
Then as John Burrill suggested apply softbody dynamics to all spheres, make them collidable with each other and their parent, and apply a strong force filed to the children from the parent which would allow them only to encompass the parent, squashing against him and themselves...
Repeat the same process for more layers.
This would get you some results.
In the case that i haven't totally misunderstood the question, please ignore. :)

Thank you!  I appreciate your feedback.  I asked Mr. Burrill this, too, but could you roughly estimate how long it might take in my spare time (separate from my job) to become proficient enough at Blender to do what you're saying?  Because this is kind of a hobby, I want to balance the time spent on modeling with time spent thinking about how to further my model.  Thanks!

It is very hard to say, cause there are many unknowns...
Start from there, think about the problem you want to solve and split it into smaller tasks.
Relate each task with a specific blender, feature that you want to use, and then allocate time for reading the about the feature (say softbody dynamics or particle systems) and also try to play around with it. Only after that, start combining features together and see how it works.

You're talking about 2 different things: modelling the spheres and simulating the physics of applying forces to them.
The answer is yes, you can model this kind of thing in Blender and simulate elasticity using softbody dynamics which can show you realistic deformation based on general parameters.  Here's a quick clip showing an example of softbody dynamics:
https://www.youtube.com/watch?v=7gqSyojxC3g
Blender provides a convincing effect, but it doesn't incorporate real material properties like hardness, poisons ratio and modulus of elasticity and it doesn't do the kind of reporting needed to evaluate how the model would perform over time in the real world so it's not an analysis tool like ANSYS

Thank you!  I appreciate your feedback.  Starting from no knowledge, in order to become proficient enough at Blender to do what you're saying, can you roughly estimate how long this might take in my spare time (separate from my job)?  Because this is kind of a hobby, I want to balance the time spent on modeling with time spent thinking about how to further my model.  Thanks!

I think you'll need to learn these topics:
User Interface
Mesh modeling/editing (including a couple of obscure tools like align faces, coordinate systems, dupilverts)
modifiers
constraints
animation key framing
rigid body simulation
soft body simulation
Since you're new to animation and 3D modelling, you're going to have to absorb a lot of knowledge and concepts. If you are aggressive with finding answers-going to tutorials, forums and the online documentation as questions arise-then you can probably attain the skills needed for your project in 60-100 hours over 3 months)


text:
Can you use use Loop-Cut tool with ngons?
I have a loop cut(no face,vertices only) on one ngon cap of a cylinder. I would like to cut the opposing cap with this shape. I cant use mirror here because there are other shapes on the cap I dont want to copy. Is there any way to do this?

If you upload the .blend to pasteAll.org and paste the link here it will be easier to help since guessing at your setup makes an answer a bit difficult.  It does sound like the Knife Project tool is what you need though.

Knife project seems buggy with ngons even in the lastest version. I cut holes in a cylinder using KP and several curves. Worked on one face but not fully on the other. one of the curves didnt cut. File at http://www.pasteall.org/blend/33204

I think you could make it easier by insetting the ngons so you have a ring of quads around them, so the loop cut can turn the corner and make it easier to join afterwards. If you're subsurfing this will make your corners cleaner, if not you can limited dissolve them away again later.

thanks starweaver. That makes the most sense so far. ngons are easier to work with but since the final project should have as few as possible I should start learning to create quads. even if it mean trickier selection

Loop cut intentionally only cuts quads.
To cut across ngons you can:

Use the knife tool to cut up the face how you like.
Select 2 vertices and run join (Jkey).

Note, we have support for ths in the code, but after discussion with users, disabled it - see BMW_EDGERING_NGON
See:
http://lists.blender.org/pipermail/bf-blender-cvs/2012-March/043815.html

I would use the kinfe tool K to make the cut.

You can make complex cuts if you desire, by left clicking:

What if I need to make a complex cut? like a curved shape?

You can add any number of verts within the existing face using the knife tool. You can add one edge and then subdivide it etc. Once you have the edge in place you can use other tools to place them in a nice curve etc.


text:
How can edge rings be selected in a predictable way?
When trying to select multiple edge-rings Shift-Alt-RMB sometimes loops get selected in the one (green) way or the other (red) way.
I couldn't derive a general rule.
How can two or more face-rings following one direction be selected ?
(Easy to reproduce with a default torus mesh.)

The direction is determined from the edge your mouse is over when you click.
ShiftAltRMB clicking an edge will select the face loop perpendicular to the edge clicked:


text:
Is it possible to split a .blend file?
Is it possible to split a .blend file, e.g when a scene has grown and exceeded a manageable number of objects?
I would like to save some groups into a new .blend, texture the objects in the newly created file and link to the original scene. Probably I could export object to Collada and re-import them to a new .blend. Is there a native way that I've overlooked?

First, a workflow question about your scene: might it work just as well to set up a different scene in the same blend file, dividing the groups between the two scenes?
If not, I think the fastest way within blender would be to save your blender file under a new name (or twice, each under it's own new name) and delete the objects in the group you want to split out in one copy, and delete all of the other objects in the other copy. (Keeping the original unchanged is just part of my standard workflow. I'm too afraid of deleting an object from both copies and losing it. Your mileage may vary.)


text:
What is wrong with my repel player script?
Based off of another tutorial, I'm trying to put together a script for an object that will apply a force to anything near it, essentially repelling it when the "near" logic brick is triggered.
from bge import logic

def _getForceMagnitude(distance, max_force, max_range):
    return (distance * (-max_force/max_range)) + max_force

def repel():

    scene = logic.getCurrentScene()
    cont = logic.getCurrentController()
    shield = cont.owner

    for obj in scene.objects:
        vec = obj.worldPosition - shield.worldPosition
        vec.magnitude = _getForceMagnitude(vec.magnitude, 10, 4)
        vec.applyForce(vec)

It would help to know what's not working, do you get any errors in the console?

Sorry it took a while to respond. There are no errors being reported, but I do have another script  so similar to this one to get planetary gravity. Could it be that the two are in conflict?

I reworked the whole script from bottom up and came up with the solution that I needed. With this script, any object that triggers the near sensor will be pushed from the origin of the object with the near sensor. The from bge import render and render.drawLine(shieldLoc, objLoc, [0, 0, 255]) is just there to visually see the script when it triggers.
from bge import render
from bge import logic
from mathutils import Vector

def _getForceMagnitude(distance, max_force, max_range):
    return (distance * (-max_force/max_range)) + max_force

def main():
    cont = logic.getCurrentController()
    own = cont.owner
    scene = logic.getCurrentScene()
    #sensor and sensor location
    trigger = cont.sensors["Near"]
    shieldLoc = own.worldPosition

if trigger.positive:
    #iterate through all objects in range
    obj = trigger.hitObjectList
    for objList in obj:
        #location of each object and vecter
        objLoc = objList.worldPosition
        dist = own.getDistanceTo(objLoc)
        vec = objLoc - shieldLoc
        #applying vecter
        vec.magnitude = _getForceMagnitude(dist, 50, 25)
        objList.applyForce(vec)
        render.drawLine(shieldLoc, objLoc, [0, 0, 255])
main()

applyForce is only applicable to game objects.  Currently you are trying to apply force to a variable (vec) that you created.  Change the last line to
obj.applyForce(vec)

However, this will apply the force to EVERY object in the scene, not just the ones nearby which I don't believe is the behavior you want.
Also, I think you have a few issues with your script.  I made some modifications below.
You could try using the following:
from bge import logic

def _getForceMagnitude(distance, max_force, max_range):
    return (distance * (-max_force/max_range)) + max_force

def repel():

    scene = logic.getCurrentScene()
    cont = logic.getCurrentController()
    shield = cont.owner

    #Create reference to near sensor
    near = shield.sensors["Near"]

    #Check if near sensor is positive
    if near.positive:
        #Get the object that triggered the near sensor
        obj = near.hitObject
        #Get the distance from the object to the shield
        dist = shield.getDistanceTo(obj)

        vec = obj.worldPosition - shield.worldPosition
        vec.magnitude = _getForceMagnitude(dist, 10, 4)
        obj.applyForce(vec)

I'm not 100% sure what the distance variable in the _getForceMagnitude represents so I put in the distance between the shield and the object that triggers the near sensor.  Hopefully this helps.

Perhaps I implemented it wrong? Here is a scene with a cube falling onto a plane that should repel it: https://www.dropbox.com/s/casilne4znaedg8/test_repel.blend


text:
How do you check for a specific game engine property with python? (2.7x only)
Instead of having several ray sensors each set to look for a specific property, I would like to have one ray sensor that looks at everything and have python decide what to do with what is hit based on the property.
So something like this:
sensor = cont.sensors["Ray"]
if sensor.positive:
    trigger = sensor.hitObject
    if trigger.(whatever would determine if it has the property):
        # do something
    if trigger.(another property):
        # do something else

sensor = cont.sensors["Ray"]
if sensor.positive:
    trigger = sensor.hitObject
    if "property" in trigger:
        # do something

You may also want to check if the property exists and get it (all in one lookup), This can be done using get a fallback value to avoid try/except.
sensor = cont.sensors["Ray"]
if sensor.positive:
    trigger = sensor.hitObject
    prop = trigger.get("property", None)
    if prop is not None:
        # do something

This style of access is the same thats used in Python dictionaries. eg:
dct = {"a": 2}
if "a" in dct:
    print("found")

val = dct.get("b", 2)
print(val)  # -> 2 (or the value)


text:
How to model physics in Blender?
I'm robotic engineer. I'm using OpenSCAD to model robotic components (gears, pulleys, parts, etc). But I need application to model physics and interaction of the components (for i.e. how will robot move if I will rotate current gear).
So, is it possible to import OpenSCAD models into Blender and model interactions in it?
I have models in STL format (for i.e. gears). I need to make reductor from it and see how it moves (if possible - measure rotation speed and torque).

Are you talking about constraints and armatures? Or just the physics simulations?

I have models in STL format (for i.e. gears). I need to make reductor from it and see how it moves (if possible - measure rotation speed and torque)

@Robotex As folks are asking for clarifications, try to roll that information back into your question. That way folks are better able to help you with the information you need specifically. Thanks.

Blender supports some physics simulation for rigid bodies, soft bodies, cloth and fluids. However these are not aimed at CAD applications, there are no tools to measure things like rotation speed and torque, and there is no guarantee that the simulation results will match the real world to some precision.
I think you need to use specialised CAD/CAM software for this.

For those interested in robotics, here are some points of reference.
Blender wiki - Blender for robotics
MORSE - a part of the openrobotics project, uses blender as a robotic simulator.
Warp1337.com - a tutorial on modeling and rigging a mechanical arm, ends with info on using a kinect to control the arm in the game engine.

You can measure stuff if you code it in Python. As for making things move, you will probably have to rig your model. Bones, parents and alike.


text:
Setting default file format when saving baked textures?
Once I've baked a texture and want to save it - by default Blender offers me to save it as PNG RGBA, I change it to PNG RGB (no alpha) and save it.
The problem is that every time I re-bake the same texture and simply hit Save, it somehow saves as PNG RGBA again, not RGB as I saved it initially.
So I have two questions:

Why is it not remembering my file format when saving with "Save", not with "Save as" (from uv window)?
Where can I set its defaults to PNG RGB, so that every time I save a baked texture I won't have to go and click PNG RGB?

To change the default image file type produced by Blender, you actually want to change the image settings in the Render panel.
To change the default for a single file, go to the Properties>Render panel and scroll down to the 'Output' submenu. Then select the file format and BW/RGB/RGBA to your desired format.

If you want to set this as your default image type for all of your projects, first open a new file or open a new instance of Blender. Change the settings to what you would like to be default, then press Ctrl+U.
This changes your startup .blend file so that when you open future projects, they will come preloaded with these settings. It will not affect any of your old .blend files.

Well, thanks for the tip, however it seems not to cure the problem fully. After re-baking the texture it still saves as PNG RGBA, not PNG RGB.
P.S. To clarify situation - i am not trying to render the scene, i am baking a texture.

Thank you very much for bringing up this issue. I had the same problem where the saved render always display RGBA.
I managed to fix it by mainly going to my Node Editor > Properties Toolshelf (N) > Properties and unchecking Alpha.

It keeps defaulting to RGBA because the image has a alpha channel (and is trying not to loose information). Uncheck the Alpha option when creating the image and it'll default to RGB.

right, this one is unchecked for sure, no doubt about it. But right after the bake has happened, pressing F3 (Save As from UV window) gives me RGBA defaulted. And even then - if I specify RGB manually, then later on Alt+S (Save from UV window) saves it as RGBA again. So for some reason during the texture bake it thinks that it has Alpha channel in use. Under material textures - Image Sampling / Use Alpha is unchecked. Where else to look?

Additional/PNG saves do indeed always enable RGBA. This should be reported to the bug tracker.


text:
Calculating acceleration or velocity of a point on a rigid body?
I have a rigid body simulation involving a solid body.
It is a simple simulation with a box shape on a plane. The plane is slid out from under the box so it falls due to gravity.
Due to friction with the plane, the body doesn't fall straight but falls head first.
Is it possible to obtain the time varying acceleration vector of any one vertex?

Hi and welcome to Blender.SE! Could you please give more information, so that I can give a better answer?

@DantheMan Thank you! Yeah I have submitted a more verbose explanation.

Thanks for the info. I figured out how to calculate the velocity, but I'm not sure on the acceleration.

In rigid body simulations, external forces create two different kinds of effects on an object: linear acceleration and angular acceleration. Linear acceleration is how fast an object is moving incrementally, and angular acceleration is how fast an object is spinning incrementally.
To obtain the net external force on a single vertex or edge doesn't really make sense, because a vertex or edge doesn't have any volume and therefore doesn't have any mass. In the equation F=ma (Newton's second law of motion), solving for a, a=F/m, since a vertex or edge doesn't have any mass, the acceleration due to the force would be undefined, because you're dividing by 0. Forces have to be applied to masses. Therefore, when a rigid body is affected by a force, the force is applied throughout the entire mass, producing a linear and maybe angular acceleration.
To get the velocity vector, you need to use cross multiply the angular velocity with the vectorial distance of the vertex from the center of mass, and then add that to the linear velocity. (More info)
In script, it should look something like this:
v = object.getLinearVelocity(False)
omega = object.getAngularVelocity(False)
r = Vector((1,1,-1)) # offset of vertex (or point) from center of mass.

v_net = v + omega.cross(r)

Make sure you import the Vector class from mathutils

In case the Linear and AgularAcceleration is
provided by the API, then is is the same as
in the answere (only with the acceleration
getters). In case the API provides GetTorque
and GetForce, the acceleration can be calculated
by adding r.cross(GetTorque / TotalMomentOFInercia)
and GetForce / TotalMass.


text:
Character texture is messed up

As you can see above, that is my character, I modeled him, textured him, rigged him, used GLSL texturing, in the game engine, pressed "P," and he looked like this. I don't know what this is, is it transparent, I don't know? Please help!

I don't think it has anything to do with your textures. I'm not familiar with the game engine though. :-/

This looks like a depth problem, can you share the file.

Yeah, you need to bring that "patient" to us. :)

I think your material is set to alpha.

I'm 99% certain that your normals are inverted. Try the following with each object:
-Select the object and tab into edit mode
-Select all of the vertices
-Use the Mesh menu to select Mesh->Normals->Recalculate Outside
Alternatively, you can select a face in edit mode and press ctrlf to "flip normals." This will just reverse whatever direction it already is, so it's not quite and handy, but it might be helpful if the first method doesn't work.
The actual problem is that polygons only have one side. If they're viewed from the "wrong" side, they are completely invisible. So, you have to make sure that the visible side is facing out, not in. The "normal" is the vector that points straight out from the surface of the visible side. So, recalculating the normals so they face outside will make it look right.
Good luck!

I tried both ideas but that 1% was it, your solution didn't work, sorry.

Well... I can't go any further... you must finish the journey without me... Good luck ;-)

God dangit!?!?!

If you can upload your file, there are some other folks who seem to be willing to look at it (I'm at work, so I can't download stuff, or I'd look at it). It's not safe to go alone... take this: pasteall.org

I've noticed my problem, there was a small issue with the textures that had to be fixed, and it was not the alpha, sorry @Cobra that wasn't it, but on the bright side I am done with this problem. Now ill recreate one with better textures and enjoy him. Thanks all!


text:
How do you set the scale for a specific project?
For my current project, I've decided to use metric units. I am trying to work at the millimeter level, but when I create a new object (Cube) it's set to a one meter scale by default. How do I tell Blender that I want the default scale for all new objects in this blend file to be set to, for instance, one centimeter?
When using the Blender units scale I didn't concern myself with this stuff, but I'm trying to be more accurate in my designs.

You can set units and scale in the Properties Panel

Newly added cube after scaling to .01m with Edge Info Length enabled:

There are also a few settings in 3D-Views Properties-Panel (N) these influence only the display:

See also:

How to model effectively using exact measurements?
How can I use imperial units when entering measurements?

Thanks!  That setting had escaped me.  I kept looking in UserPref thinking it would be there but I guess this makes more sense


text:
Texture appears in render but not in game engine

It renders like this, but when I play the game it has no texture. Why doesn't the texture show up in the game engine?
Here is the file:
http://filedropper.com/textured

You could upload your .blend file using a service like http://www.filedropper.com/ and we could look in depth. Please update your question instead of posting additional info as an answer.

Thank you so much stacker and to all others. You guys helped me alot.

@Kyouma mark his answer as answered, if it solved your question.

It seems that you haven't unwrapped the mesh.
Change to Edit Mode in the 3D-View and select all A press U for unwrap.

In the texures settings select UV for Coordinates and UVMap as Map, Projection should be Flat by default.
Set the Viewport Shading to Texture

After that the texture should be shown in the Game Engine.
EDIT:
Examining your .blend shows that the texture wasn't included in the file. I replaced it with another one, the issue that the texture isn't rendered in the BGE could be fixed either by moving it into the first slot:

Alternatively you could set Shading to GLSL in Properties Panel N in the 3D-View in Object Mode:

Its still like this What should I do?

It seems that the current GLSL doesn't expose such problem. Removing the first slot is the key.

I tried several options I don't know why but GLSL and Singletexture also rendered it in the BGE, multitexture seems to skip textures if an empty slot is found.

Also, BGE is currently only supporting textures of image type, not the procedural textures.

Looking further at Multitexture vs GLSL, for the texture to display in Multitexture, it needs to be assigned to the faces: Edit Mode > Select All , Image Editor > select the correct texture


text:
Custom file output name format using incremental letters instead of numbers?
Lately I've been experimenting with importing rendered animation frames into a game engine which expects a very specific filename format consisting of four letters, followed by a fifth incremental letter, followed by a static numerical value.
NAMEA0.png
NAMEB0.png
NAMEC0.png

Is there a way to make it so blender automatically saves my rendered frames following this format? With frame 1 = A, frame 2 = B and so forth?
Thanks in advance.

What would happen with more than 26 Frames?

Not natively as far as I know, but you could probably script it with python. Might just be easier to rename them using a third party tool.

Well, this is awkward, I just figured it out. I had looked at an answer to a similar question here, but having no experience with scripting, I thought I wouldn't know how to adapt it to my needs. Turns out that after looking at some basic python tutorials, I managed to write a script that, while not very elegant, definitely works. Here's the script in question:
import bpy
letter = 'A'
def handler_set_filepath_based_on_frame(scene):
    if scene.frame_current == 1:
        letter = 'A'
    if scene.frame_current == 2:
        letter = 'B'
    if scene.frame_current == 3:
        letter = 'C'
    if scene.frame_current == 4:
        letter = 'D'
    if scene.frame_current == 5:
        letter = 'E'
    if scene.frame_current == 6:
        letter = 'F'
    if scene.frame_current == 7:
        letter = 'G'
    if scene.frame_current == 8:
        letter = 'H'
    if scene.frame_current == 9:
        letter = 'I'
    if scene.frame_current == 10:
        letter = 'J'
    scene.render.filepath = ("/tmp/NAME%s0#" % letter)

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

I'll likely will never need to render more than 10 frames or so. So manually defining a variable for each isn't that much of a hassle.
Here's the answer from which I based my script off of.
Changing filename format based on current animation frame?

You can do:
import bpy

def handler_set_filepath_based_on_frame(scene):
    letters = ['A','B','C','D','E','F','G','H','I','J','K']
    scene.render.filepath = ("/tmp/NAME%s0#" % letters[scene.frame_current])
    bpy.app.handlers.frame_change_pre.append(handler_set_filepath_based_on_frame)

then you don't have to care for each frame


text:
2.81: Where is the "Preferences option allows using the File Browser in full-screen layout."?
I cannot seem to find this option.
Where is the "Preferences option allows using the File Browser in full-screen layout."?
Thank you.

Hello :). Could you please mark one of the answers as accepted ✓? Just to keep this site nice and tidy :). Thanks.

It's in the Preferences, first tab.
Preferences->Interface->Temporary windows
And don't forget to save the preferences :).


text:
How can I get Cycles to work with NIVIDA GeForce GPU in Ubutnu 18.04 LTS?
I have an older laptop with a NIVIDA GeForce GPU that I would like to use to render with Cycles, and I understand that this is no longer officially supported. So, where do I hire the A Team (IE: with little experience in compiling, how specifically do I get the unofficial drivers or whathaveyou)? I have Ubuntu 18.04 LTS installed.

Where did you get that information about "not officially supported"? You need to install the closed-source NVIDIA drivers, because those are the only ones that support CUDA.

I believe that is what I have, but when trying to enable GPU computation for Cycles in User Preferences, the GPU does not appear. Just CPU. I do have a program that opens settings for the NIVIDA GeForce card, and upon computer logon the NIVIDA logo is momentarily shown. Best I can get from this site and others, this is because as of somewhere around 2.5 (not remembering clearly), blender stopped supporting the older GeForce GPUs.

See, and exactly that's why information is important. Nobody but you knows which GPU you have. We don't have magic crystal balls that give us all the answers about the information you won't give us. You might want to edit your question and add the exact model there. Besides - if your GPU isn't supported anymore by Blender, there's actually no way to get it working, except using one of the older builds.

Okay, hopefully you can see this. After finding out GPUs cost as much as a small barn, the specific model of GPU is GeForce GTX 260M best I can tell. Do you need the UUID?


text:
Can a Raspberry Pi GPU be used with Cycles?
I have a Raspberry Pi 2 and a 3, both of which have separate GPUs from the CPU. They are running the default Raspbian (9 I think), and Blender (slightly out-of-daste repository version) is successfully installed. Can I configure Cycles to work with the GPU or vice versa, possibly with additional software installation?

In addition to what @cegaton linked, OpenCL is kinda supported on the RPi with https://github.com/doe300/VC4CL so it might be possible, depending on the limitations of the embedded profile. Its pretty likely that this would require a lot of mucking around with custom blender builds.


text:
How can I make rain in blender?
I want to make plain rain in blender, but the most recent attempt in cycles resulted in the denoiser eating it :P Is my only option no denoising, EEVEE, or a purely compositing effect? Have somewhat considered rendering the rain in a separate layer, but rather not re-invent the wheel if the answer's already out there.

Hello, maybe give some details about what you want to achieve, is it realistic rain, cartoony, are you supposed to see puddles on the ground, splashes, etc? There are several tutorials on this topic on youtube, haven't you found one that works?

Quick fix: Put the rain on a separate render layer and don't denoise that.

Realistic rain on a city street. I had manually created mesh puddles. Have not had time to look on youtube, mainly. Originally had planned a misty rain that shows up mostly in front of street lamps, but the lamps are very close together, so maybe just kind of a drippy rain is better. Untextured volumetrics have been unsatisfactory: too uniform. Want streaks.

Have looked on youtube, and did find some helpful info :) One thing that helped alot was making the raindrop surface rougher.


text:
How to get bounding box of multiple objects in a rendered image with Python?
Hello I am trying to get bounding box of items in my image which is generated automatically using a script by running blender from background. I am using the object index to get the boxes.
This is my current compositor setup,

This is the code I am using to find the boxes
import bpy
import numpy as np

def getVisibleBoundingBox(objectPassIndex,pixels,height,width):
    bbox = np.argwhere( pixels == objectPassIndex )
    (ystart, xstart), (ystop, xstop) = bbox.min(0), bbox.max(0) + 1
    return xstart, xstop, height - ystart, height - ystop

def getAllBoxes():

    S = bpy.context.scene
    width  = int( S.render.resolution_x * S.render.resolution_percentage / 100 )
    height = int( S.render.resolution_y * S.render.resolution_percentage / 100 )
    depth  = 4

    pixels = np.array( bpy.data.images['Viewer Node'].pixels[:] ).reshape( [height, width, depth] )
    print(max(pixels[540][1]))
    pixels = np.array( [ [ pixel[0] for pixel in row ] for row in pixels ] )
    boxes = []
    for i in  bpy.data.collections['CurrentItems'].objects:
        boxes.append([getVisibleBoundingBox(i.pass_index,pixels,height,width),i.name.split('.')[0]])
    return boxes

print(getAllBoxes())

This all worked fine when tested it with the gui but when running blender as background from command line it just gives this error
ValueError: cannot reshape array of size 262144 into shape (1080,1063,4)
I believe that is the empty viewer node image thats causing this.
Any ideas on how to get the image or some other method to get the bounding box that would work from background would be most helpful.
I have also tried saving the image as PNG and tried using that but it seems the objectPassIndex data is lost when saving as png.
P.S. I dont want to use world_to_camera_view as there is no reliable way to check for occlusion with that method.
EDIT: The bounding box needs to be a rectangle with the whole object inside it.
If a object is occluded by some other object then only the visible part be included in the rectangle.

Can you provide more information about how the IndexOB is being used? And why don't you use bpy.data.images.size[:] for your height and width? What did you mean empty viewer? 262144 == 256*256*4 it is not empty, is it caused by running Blender in Background?

Hi, I hope you don't mind me editing the title. I think with it being more specific this good question has a higher chance of catching the eyes of people who might be able to help.

Might be related: Python render script different outcome when run in background

@HikariTW When you disconnect the viewer node there is a blank image in view node image and that is of the same size as this.When testing some stuff I accidentally left the node disconnected once and got this same error with the same number. And yes this is caused by running blender in background

Please exactly define how the bounding box needs to be. If there are 2 Objects and one partially occludes the other one, is the the bounding box of the occluded object what is still visible or the theoretical outline of the object? Is the bounding box the outermost rectangle in pixels, that doesn't touchg the pixels of the object, or does the bounding box touch the othermost pixels in x and -y dimension. Also is the bounding box retangular and the axis parallel to the edges of the image or can it also turn to give a best possible fit?

A solution that worked for me was to use an File Output node instead of viewer node and save the image in openEXR format with full float color depth using this node setup

And then read that image via CV2 library instead of reading it from viewer node image.
Simply replace the following line in the code snippet in question
pixels = np.array( bpy.data.images['Viewer Node'].pixels[:] ).reshape( [height, width, depth] )

with
pixels = cv2.imread(r"filepathOf.exr",  cv2.IMREAD_ANYCOLOR | cv2.IMREAD_ANYDEPTH)
pixels = cv2.flip(pixels,0)

and it should work fine giving you coordinates of the bounding boxes

Am i missing something here? because "pixels = cv2.imread(r"filepathOf.exr",  cv2.IMREAD_ANYCOLOR | cv2.IMREAD_ANYDEPTH)" gives an error"cv2.error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\core\src\ovx.cpp:101: error: (-215:Assertion failed) !flag && "OpenVX support isn't enabled at compile time" in function 'cv::setUseOpenVX'" I assume that opencv can't read an ".exr" file unless i rebuild it from source? I'm i understand it correctly?

@miaomiao https://stackoverflow.com/a/73494845 this will resolve your issue