text:
How to unwrap two image textures onto one object without deforming the UV mapping of either texture
I've been having trouble with an effect I'm trying to achieve.
Right now I'm using a 2D texture for black and white tiles that has normals applied in the influence tab.

Since I also need a dirty map that I don't want invovled with the normals of the tile texture, I added another texture tab in the material. However, as it stands right now, with the UV texture, the result is not quite right for me.

Therefore, I tried to scale down the UVs I selected, but when I do, the tiles become bigger. It must be because the UVs for both images are connected, where I cannot change the UV position and size for one image without doing the same for the other.

Is there a way for me to change the UV size for one projected image without effecting the UVs for a different image within the same material on the same object?
Maybe I could make a transparent layer above the floor and create an image of the dirty map on top instead, but I want to know if this is possible first...
Thank you in advance!

You can use Scale sliders in the texture settings > Mapping rollout (assuming you use Blender Internal, if Cycles use Mapping node). Then the texture will be scaled with its options, not with UV map. Or create another UV map and use it exclusively for dirt material. Afaik no way to scale one UV map used in 2 textures independently.

Thanks, I looked it up and figured it out. Thanks for the help!

Is it okay if I link to the page that solved it? If so, then here's the link to the answer page if anyone needs to know: https://blender.stackexchange.com/questions/18346/texture-mapping-with-multiple-uv-maps

It is, and thank you, I didn't have enough time to answer my question before I went to work.


text:
Objects are not counted in the header and will not export
I have a scene full of objects that won't export properly (I need either FBX or Obj, it's for Unity but that's irrelevant). After a lot of work I've been able to narrow down the problem to the fact that those objects are not being properly counted.. (see picture, objects counts 0..)
The objects that are being counted export fine. :(

Any idea what is wrong with those objects?...
I have a work-around: joining a problematic object to a working  object, and then separating them again, but there are dozens of objects in that scene, it would take me days to fix all this like that.
Any help would be very welcome. :(

Aloys, Welcome to the site. Is this a linked item, by any chance? If not, you're probably going to have to provide a ~.blend file with this one...

Thank you for your answer Brasshat.
None of these items are linked or instance. I have tried making them single users anyway, no change.
In case that's any help here is a scene with problematic objects.

Also I have noticed that if I add a new object (any kind: mesh/camera/empty..), it is not taken into account either. That totally baffles me. =(

Only objects which are in visible Scene layers are counted in the info header.
Note the difference between Scene layers and View layers:

View layers are set in 3D view > Header, and are independent between different 3D view editors. Only objects in the the current 3D view's view layers are shown in that 3D view.
Scene layers are set in Properties > Renderlayers > Layer > Scene, and control the visibility of objects for the enter scene. This visibility is used for scene-wide operations such as renders and exports.

By default these two layer sets are locked together so that they are always set to the same layers, however this option is disabled in your file (1).
Either re-enable this option, or set the scene layers to match your view layers in the header of the 3D view (2).

Bingo! That was the problem. :)
Thank you for that info, I couldn't find it anywhere else...
I don't understand why that freaks out the export, but it does..
Thank you again for the tip!

@Aloys See my edit :)

I don't really know what's wrong, but appending all the objects to a new file works; Objects are counted again.
Create a new File, By going to the Header>File>New or pressing Ctrl + N.
Then go to Header>File>Append or press Shift + F1, locate your *.blend file, click it, then go to Object and select the objects you want to import to the new file.

That works; thank you so much! I'm still puzzles by what went wrong, but at least I can keep working. Thank you!

source: Stack Exchange

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

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

sort: votes


text:
Edging alpha texture viewport Blender
I'm having difficulties to understand what happens with textured models using alpha textures in Blender's viewport.
As exemple,I have a fence made of a grid (which is an alpha texture), or some trees with leaves, using as well obviously alpha textures. And all the time, I have edging around my models...
Unless I select my model ! Indeed if my model is selected, I don't see anymore these edgings around my leaves, grids and etc..
Why ? And how to solve it !?

At first glance this seems like an alpha problem. I tried quickly, but cannot reproduce your problem. Can you include a picture, that would be helpful. Also, which image format are you using?

I put a link in my first post. It seems I have as well the prob when the mesh is selected, check the picture, you'll notice the big palmtree is the one selected, the problem is present as well even if it's selected finally...

This looks like it might be an issue of having an image with premultiplied alpha and Blender is treating it as being non-premultiplied (straight) alpha. What image format are you using for your textures?

This post might help somewhat..

As @Fweeb mentioned it's probably an issue with straight or premultiplied alpha. Try changing the alpha setting for your image(s) to premultiplied or straight (depending how it's set now) in the image settings.

I think your issue is the texture. It has bad antialiasing. Try loading in simple texture (i.e. http://www.pasteall.org/pic/54862), your result should look like this: (http://www.pasteall.org/pic/54861).

Hello all and thanks for your input, but It seems the problem is still there. I'm using TGA with alpha channel, I switched to PNG24 and the problem is still remaining. @CharlesL : I tested what you told me, If I only apply the texture to a single plane whitout anything around, indeed, that's working well, I have no artifacts but once I do that in a environement, with others meshes, the problem appears again, check the attached pictures. => http://tinypic.com/r/2e0vko2/5

Well, finally, I I've found the way to "solve" it, if that could be called really an issue... It's true that Blender display badly meshes with alpha material if the map is low quality or small when I'm in the "Blender render" mode, well from what I've tested, that's what I've noticed...
However here, as I'm working with low poly assets and small maps, I just switched to "Blender Game engine" render, and by pressing "P" to have a preview of the "game", I don't have anymore those artefacts... There was as well the fact the shader was set in the shading tab to "shadeless" ! Unchecking this, is also important, even thought in this case I really want the shader to be shadeless...
Sorry for my ignorance... I guess you didn't think about that because that was too much simple...

Another relevant option is the Clip Alpha  setting in User preferences > System:

This makes all alpha below a certain amount completely transparent.

You are totally right about that, that's another setting to look at to solve the issue I had ! That's even the most important in fact...

Try a higher level of png file (png 32 or higher). I believe that png 24 is not the best quality for Alpha. Check out this sight: http://blog.deepbluesky.com/blog/-/the-difference-between-png24-and-png32_49/http://blog.deepbluesky.com/blog/-/the-difference-between-png24-and-png32_49/
In my case (on a Mac), the png files don't appear to have a number attached. I tried 'Premultiplied' and 'Straight', and the 'Straight' definitely works better.

Awful. Premultiplied or straight alpha isn’t an option; figure out what type it is, and do the proper operation.

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


text:
Getting a normal map to work in a multiple uv node setup
The setup is not that complex, it has the typical stuff for color, normal, ambient occlusion and specularity maps.
Problem is that there are multiple UV maps, and some of them overlap each other, f.e. the sand overlaps the mountain uv map.
So I try to figure out a) how to limit some of these texture maps properly to separate uvs and b) how to get the normal map to work.

Here is the node setup for the mountain(Gebirge means mountain):

Notice how I tried to limit all of the image textures with an attribute to the mountain(the uv map is called like the attribute), I didnt use the UV map node it is just still there.
Notice how I tried to limit the Diffuse and Glossy Shaders to the mountain with the output of the normal map node. This does have an effect, I still don't know if it is correct like this and I don't know if there will be problems with the other textures/UV maps.
Notice how the normal map is set up, it doesnt work like this.

Now here is a picture of the mountain, don't mind the red spots on the stuff which is not mountain, it's part of its uv map:

Last but not least this is the kind of node setup I want to use to show other textures (of sand and stuff) on other UV maps but all in the same material:

I'd love if someone could maybe give me some live support with this. Like chat or skype, I send you the .blend file plus the textures and stuff.
Just send me a PM or chat invite.

EDIT: Now the normal map works with the solution that MrZak provided:

But there is still the problem with the other areas being influenced by the Glossy and probably the Diffuse Shader too. You can see this at the red tinting of the beach cause by the slightly red glossy shader.
I tried the attribute and the uv map node but they wont restrict it to the UV map of the mountain.
You could comment on this if you have a solution but I'll probably post a new question for it.

I'm not sure what happens with beach but there're several problems.

Don't plug output of the Normal map into the Displacement input, see this very good answer for more info. In your case it may be enough to use only normal maps.
Consider plugging image into the Normal Map node if it's the result of processing with using some programs where the result is image of purple color. Otherwise plug it into the Bump node instead (the link above again can be helpful).
(less important) Why not using UV Map node and Attribute one instead ?
Regarding to UV maps I think it's better to search for some questions here or to ask new one (as it seems to be arranging and managing the UV maps). Basically you press CtrlA to average islands' scale and CtrlP to make them fit in the texture space (pack them); but the exact way depends on situation, it may be needed to use some other tricks like stitching etc.
You may want to read about normal maps, how to and how not to bake normal maps and a lot more
See wiki article for more info on creating, editing and managing UV maps.

Thank you once again Mr Zak for taking the time to give a noob like me some advice. I'll check out all of the links and go through this and tell you if it worked afterwards.

Normal map works now, Yay!

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


text:
Delete animation
I got an animation, deleted all the keyframes, no fake user and it is still there.
Went to dope sheet and F-Curve editor, checked the ghost icon, still there are no keyframes.
I got little knowledge of how material or animation data is linked to a user and when it is linked to nothing it will be erased automatically.
The animation seems to be linked to nothing yet it won't be erased.
How do I get rid of it?
Edit: I found out that the animation is saved in the action stash of the armature. Still googling.

Ok I found it out... kind of:
The animations were saved as NLA tracks in action stashes and you can delete them in the NLA editor.
I dont really know how much of the above is complete bs, it can be quite confusing, if someone would like to share his expertise and explain the issue correctly please do so.

Had the same problem and this fixed it, thanks.


text:
BGE: What objects are Game Properties?
This and/or how to access and change them in a script.
If you use the .getPropertyNames()-function of an object it only provides you with a list of the names of the properties. How can one actually change them?
Also you could use a property actuator with the python controller but the property and python controller are on 2 different objects.
So it is about changing game properties of another object.

Use the object like a dictionary to access and change properties
# Access
print (object['propertyname'])

# Change
object['propertyname'] = 4

@Jonathan, see, I was right

Thanks a lot! I probably could not have found that out by googling and checking the documentation.

authors: Γιωργος Παπανδρεου


text:
can't find python debug console in blender 2.7.6
I'm trying to debug a Python script by placing print( "hello") statements in my code.
But where does the output appear?
It doesn't appear on the Python Console, there is no option for 'Window > Toggle System Console.'
I am using blender 2.7.6 and ubuntu 14.04


text:
How to modify width of "wire" material type
I'm struggling to model my objects into a 90's retro vector style, with the wireframe and low poly look.
Freestyle won't render in a game mode, and it seems to use a tremendous amount of time just to render simple black outlines around my mesh faces.
It seems if I create two materials, one as "wire" and the other as a surface - it does the trick, however it's only 1 pixel thick, and seems to get lost.  When I pan around different angles, the matte material seems to take over the wireframe material.
Does anyone know how to modify the thickness of that wire attribute in the materials?

I don't want to create a whole different mesh object for the wireframe effect, that the blender previewer seems to handle gracefully by default in preview mode. The render animation seems to do a whole lot of extra work to render frames, and all I want is a retro 90's cartoon, and possibly do something in simulator / game mode.

I presume you're using the Blender Internal renderer and not Cycles?

Yes.  Cycles seems to take forever to render.  I'm not producing a video for Skywalker ranch, I just to make a low-poly cartoon that looks like a 90's video game.

Apart the Z offset setting shown in another answer, there are at least other 2 ways to render that wireframe: freestyle and wireframe modifier.
The first draws stylized lines over the resulting object after all rendering finish. You can customize the lines styles and where to apply them, like:

The second method can be used with two copies of the object: one gets the usual colored material, the other has the wireframe modifier, and gets another material just for the wire mesh to display, and you have some degree of editing for  the wireframe "style"

here you see how the wireframe is really a separate object, I scaled it up a bit...

Thanks for the response.  The freestyle mode doesn't seem to render in game engine, and creating separate objects for the model might be too much.  I'm creating a model of my entire town with houses and seems like too much information for it to process.

Increase the Z offset on your wireframe material slot. I have the monkey here set up with all vertexes duplicated and the duplicates on the second material slot.

Basically, this moves all of the vertices in the second material slot 1 meter closer to the camera. This keeps them from Z-fighting with the main material. This should let you get the effect you want.


text:
How do I preview a procedural texture to animate in BI?
I want to apply "distorted noise" texture to a material, to simulate moving white noise on an animation sequence (blender internal).
If I click "Render" in 3d viewport shading, I can see the material.  Any other option in 3d viewport (texture, material) gives me a cube with a solid color.  I really can't rely on my own imagination to predict how textures and images render since there are so many variables in blender.
The ultimate problem: I go to create an animation sequence - I have to wait about 2 hours to render, just to check the size, pitch, placement of the animated texture (or ANY texture) on the object in the scene.
Is it possible to edit objects with textures in a preview mode using blender-internal?  All my frustrated search results pin me back to "use cycles render"; which I am not interested in, since it takes overnight for me to render 2 minutes in cycles.


text:
How to search images in folder by suffixes and add as Image nodes?

I'm working on an addon which will add image nodes with custom images.
Here is the plan:
 - click on "file browser" button and choose a folder with 5 textures (every texture has a suffix (tex_nor, tex_col etc.))
 - script will automatically recognize suffixes and add textures as nodes to active material
I wrote a script with interface which adds new material, but I don't have any ideas how to write next part.
import bpy, os

# Add material
def MakeMaterial_1():
mat = bpy.data.materials.new("PBR_group")
mat.use_nodes = True
nodes = mat.node_tree.nodes
for node in nodes:
    nodes.remove(node)

##########   Add custom nodes ########
# create emission node
    node_emission = nodes.new(type='ShaderNodeEmission')
    node_emission.inputs[0].default_value = (0,1,0,1)  # green RGBA
    node_emission.inputs[1].default_value = 5.0 # strength
    node_emission.location = 0,0

# create output node
node_output = nodes.new(type='ShaderNodeOutputMaterial')
node_output.location = 400,0
mat.diffuse_shader = 'MINNAERT'
mat.diffuse_color = (1.0, 0.719, 0.137081)
mat.darkness = 1
return mat

# Panel
class PBRGROUP(bpy.types.Panel):
bl_label = "PBR Group Addon"
bl_idname = "PBR_Group"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "material"

def draw(self, context):

    layout = self.layout
    obj = context.object
    layout.operator("add.button")

# Button
class AddButton(bpy.types.Operator):
bl_idname = "add.button"
bl_label = "Add PBR Group"

def execute(self, context):
    obj = bpy.context.object
    # Change render on Cycles
    bpy.context.scene.render.engine = 'CYCLES'
    # Add a material slot
    bpy.ops.object.material_slot_add()
    # Assign a material to the last slot
    obj.material_slots[obj.material_slots.__len__() - 1].material = MakeMaterial_1()

    return{'FINISHED'}

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

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

if __name__ == "__main__":
register()
bpy.utils.register_module(__name__)


text:
Unable to select the right frame on 2d Blender
I'm working on a short animation, and I have every key frame loaded up at the bottom of my screen. The only problem is, when I go to try to select a specific frame in order to do things like duplicate it, I'm unable to click the right frame. It always clicks one several frames to the left. It's nothing wrong with my laptop (to my knowledge), so is there a way to zoom into the frames on 2d blender? If not, can I highlight a single frame in some way that I don't already know? Thanks!

from the Blender documentation:
Adjusting the View
The Timeline can be panned by holding MMB, then dragging the area left or right.
You can zoom the Timeline by using Ctrl-MMB, the mouse Wheel, or pressing NumpadMinus and NumpadPlus.
You can also use the scrollbars, located at the bottom or the right of the editor, to pan and zoom the view.
https://docs.blender.org/manual/en/latest/editors/timeline.html#:~:text=The%20Timeline%20can%20be%20panned,pan%20and%20zoom%20the%20view.


text:
Randomly create holes in mesh in "Shading" Tab
I'am currently trying to make a cookie in blender. Looking at a reference photo, I found that cookies have small holes. So, to recreate this texture, I used a "Noise Texture" Node, which I inverted. This works well, but there are way too many holes and the holes are stretched, so all in all it looks really bad. (see picture down below). How can I fix this? Or is there a better way to do it? I also tried to use Displacement and searched for this question on this page, but I didn't find a solution.
Thank you very much!

Try using Object or Generated texture coordinates for your Noise Texture (I think object will probably work best to avoid the stretching). Also, add a ColorRamp after the Noise texture (before the Bump Node), so you can sharpen the Texture by tightening the sliders.

Thank you very much! I guess that answers the question, though I'm not finished yet.


text:
In the MB-lab character creator, viewport render and eevee turns pink, but works fine in cycles?
In the Mb-Lab character creator, the viewport shading and Eevee render preview, render the character pink on the skin and all over except the eyes.
I set the character to Eevee engine in the creator:

Then in solid mode looks like this:

In viewport shading and Eevee render preview, it looks like this:

Finally in cycles render preview + denoiser, it looks like this:

If anyone can figure this out it would help a lot. Thx by the way it is blender 2.91 I'm using, but I also tested it in 3.0.

Hi :). I believe Eevee has lower limit for amount of textures in a material. Could that be the case?

If so, where is the setting in which I could change the limit? Because a lot of Youtube tutorials about this addon successfully have it rendered in Eevee.


text:
Color Shift when saving rendered image/video
Really frustrating issue going on. When I save a rendered image/video as any file format there's this super obvious color shift that occurs. It pulls down the saturation and boosts the brightness/highlights. The only solution I've found is to correct it via an image editor.
This seems to be the same issue as: color issue when save my render. But I am not very smart so idk what to make of the answer— if someone could give me a dummy walkthrough or explanation that would be soo helpful and appreciated.
I'm using Blender 2.92 on a MacBook Pro M1(I know, not ideal)
Rendered image is on the left and the saved image from render is on the right.

did you try to set "view transform" to standard?

Yes, Standard is what it's set to for this render!

Ok, then please provide blend file

The HDR is missing not sure how to correct it but should still get color shift??

just because i am curious: how long does it take to render that image on your M1?

i now saved it as .exr ....this is a bit better - but still not the same

Blender isn't optimized for the M1 yet so its running through Rosetta 2- that render took almost 6 min at 300 samples with denoising. I'm new to blender so it could probably be optimized better

thank! and...did you try this? https://blender.stackexchange.com/questions/98279/color-difference-in-saved-images-vs-render-view

@saltyaf I've downloaded the file and the HDRI you used but I can't reproduce this error. Maybe because I'm running on Windows. My render looks exactly like the saved image - which looks like your saved image on the right. The only difference is I don't have that thick dark border on the top... I guess you should have a closer look on that link Chris provided in the previous comment.

Thanks it looks like it may be an Apple issue, ill try rendering on a PC and see what happens!

So I rendered the image on a PC. The render and saved image were the same- they looked like the saved image above(on the right).
So it seems like on my MacBook the saved image may be correct while the rendered image within blender as well as any color in blender is oversaturated and has its brightness/highlights turned down. Maybe due to my display's color profile or maybe blender's colors work off a different color profile with Apple vs PC??

I have found 3.0 does not have this issue and cycle render time is much shorter.

I had the same issue and I think I figured it out! I opened the saved image in Photoshop, went to Edit > Assign Profile > Display (the last option).
This caused the image colors to look exactly as they look in the Blender Render viewer. Which is great if you are just going to be looking at the image on your Mac.
If you want to share it on the web it will not look the same, since the "display" color profile on a Mac has a wider range of colors than a web browser or PC is capable of, which I believe is sRGB.
So if the image is for sharing it makes sense to use the sRGB profile rather than Apple display if you want it to look the same across platforms.


text:
Extending the limit of UV Maps an object can have
A little quick one here, but I seemed to have run into a large problem when UV texturing an object. In the object under the data panel, I've successfully created and used a total of eight UV Maps, all with there own names, (Including the first UV Map before I added others).
However, now that I've went back in to add another, it simply does not respond, it doesn't add one, and doesn't give me an error message or whatnot.
Is there a limit to how many UV Maps can be on one object? Or is there a button I can switch to allow me more UV Maps?
I've seen from another question here that someone once had hundreds of UV Maps on single objects, so I don't think its a limitation, but I don't know what's really causing this.
EDIT: I tried to add the UV Maps in the Python console, and the same limitation happens, but this time I get a message when I reach the eighth map.

It says "cancelled" if I input another command to add in another UV Map. Is there a way to fix that so I can add more?
EDIT:
I tried out creating two objects with the "maximum" amount of UV Maps and combined them, but it did not create any new ones.
I also read here that there was a maximum of eight available texture spaces. However, that was from two years ago, and I don't know if it's been updated...
I'm using blender internal by the way if you didn't know.
Any help will be appreciated.

Is there anyone that can help me with this? There doesn't seem to be anything on here that asks this question...

It isn't mentioned in the manual but as far as I know you can't add more than 8, you'll need to create a workaround, like more materials, different objects etc

About the materials, in my scene I have on object with a multitude of different materials, and in each material there is one separate texture for the image and UV Map. Is that what you are talking about or is it something different?

I guess something like that, materials which are added in the Properties editor > Materials tab (as one way) and are assigned to different faces / areas of the mesh somehow. It could be interesting to look at the question here you mentioned where more than 8 UV maps are created.

This is the question I was referring to: https://blender.stackexchange.com/questions/65996/how-to-efficiently-remove-a-huge-number-of-uv-maps-from-an-object

My issue is that I have one base uv map that every material uses, and then each material uses another uv map atop of that. However, each additional UV Map can not match the unwrap of the base map. I'm gonna ask another question detailing a possible work-around. Hopefully it gets fixed, since I can't move on in my project without this.


text:
BPY attribute error: "'bpy_prop_collection' object has no attribute 'new'"
I'm writing code to render (assemble) dozens of animations from pre-rendered frames using the video sequence editor.
My workflow that I'm trying to achieve per animation is as follows:
-> Take set of images from folder
-> Add set of images as a singular image strip into the VSE
-> Render said image strip as an .avi file and save to same folder where the images are taken from
-> Reverse image strip's frames for reversed version of animation
-> Render and save again
This process will be iterated in a for loop, but right now I'm trying to test it on a single folder to get the process working first.
Here is my code, I will describe what the problem is after:
import os
import shutil
import bpy

img_dir = r'D:\TTITF\Game Files and Animations\Animations\Bridges\Walk ~ Alvie - V_2 R TRIMMED - Copy\V_O to V_4'

frame_duration = len(os.listdir(img_dir))
files0 = [f for f in os.listdir(img_dir) if os.path.isfile(os.path.join(img_dir, f))]
files00 = []

for f in files0:
    filename, file_ext = os.path.splitext(f)
    files00.append(filename)

files = sorted(files00)
scene = bpy.context.scene
sed = scene.sequence_editor_create()
seq = sed.sequences
duration = len(files) - 1
fp = files.pop(0)
imstrip = seq.new + image(
    name=fp.name,
    filepath=str(fp),
    frame_start=0,
    channel=1,
)
while files:
    imstrip.elements.append(files.pop(0).name)
imstrip.frame_final_duration = duration
imstrip.update()

Files0 creates a list of files from the folder.
Then each file in that list is appended to another one without its extension.
So that way the files are just numbers, "6120", "3187", etc... instead of "6120.png" "3187.png"...
Then they are sorted for the rendering process.
The rest of the code, I took from another question on here (can't find it rn), so I don't know exactly how all of it works.
But when I attempt to run it as a script in Blender, I get an error message on the System Console:

How do I deal with this issue? Are there certain libraries or information I need to import for this?
I've finished a couple of python scripts on Pycharm, but I don't know what to look out for when coding python for Blender. (I'm new to python coding in general)
============================================
EDIT: While I haven't figured out how to fix the specific error here, I have figured out a work-around to achieve what I was originally trying to do.
import os
import bpy

img_dir = r'D:\TTITF\Game Files and Animations\Animations\Bridges\Walk ~ Alvie - V_2 R TRIMMED - Copy\V_O to V_4'

files = [f for f in os.listdir(img_dir) if os.path.isfile(os.path.join(img_dir, f))]
frame_duration = len(files)
filepath = os.path.join(img_dir, str(files[0]))
files.pop(0)

context = bpy.context
scene = context.scene
sed = scene.sequence_editor
sequences = sed.sequences

frame_start = 0
frame_end = 1

image_strip = sequences.new_image("IM Strip", filepath, 1, frame_start)

image_strip.frame_final_end = frame_end

for f in files:
    image_strip.elements.append(f)

I was originally trying to create the full image strip with all its contents all at once like I would manually, but instead I added just the first image as an image strip and then appended the rest of the images to it instead. For me, this manages to produce the right result.

I think you want to call the function seq.new() rather than access seq.new as a variable, but I think that's still not enough to give you imstrip

I tried putting in seq.new() instead of seq.new, but it gave me the same error

Okay, I've done a lot more digging and still cannot find a solution for the this general problem.  This code looked promising, but I have no idea how to make implement the set of files I defined. It just tells me that it needs to be a "dict" or an "RNA" collection, which are things I do not know how to make or deal with. https://learnsharewithdp.wordpress.com/2018/08/27/import-multiple-images-in-blender-vse-using-python-script/

I was also looking at this question: https://blender.stackexchange.com/questions/39854/how-can-i-open-a-file-select-dialog-via-python-to-add-an-image-sequence-into-vse But even if I use the last part of the answer, I ultimately cannot define what "scene" is after a bit of research. This is really mindboggling, and I hope I can find some kind of solution, whether it be in 2.79 or 2.8+

I'm sorry, I haven't time to dig into VSE from python; but this might help you get a start.

Managed to find a workaround to avoid the error.


text:
How to bend a large model?
I have a city model (all one mesh) and a separate curved base plane. I would like to have the bottom faces of the each building in the city mesh flat against the plane and keep each building at 90 degrees to follow the curve of the base plane. This is illustrated here in the inception movie poster although this looks more like a sharper curve than I thinking but is a very good visual.

(source: wikimedia.org)
I have tried the shrink wrap modifier but cant seem to get the settings to keep each building 90 degrees to the curve. I cant use the particle method because I want to use a real city model that is one mesh.
How can I do the Inception style city on a curved plane effect in blender?


text:
How to duplicate and move a selected edge in normal direction?
I want to duplicate a selected edge and translate it to another location, based on the normal direction.

(source: shshop.da.to)
This is my current code:
import bpy
import mathutils
import math

obj = bpy.context.object
me = obj.data
eg = me.edges[2]

nor1x = me.vertices[eg.key[0]].normal.x
nor1y = me.vertices[eg.key[0]].normal.y
nor1z = me.vertices[eg.key[0]].normal.z

nor2x = me.vertices[eg.key[1]].normal.x
nor2y = me.vertices[eg.key[1]].normal.y
nor2z = me.vertices[eg.key[1]].normal.z

x = nor1x + nor2x
y = nor1y + nor2y
z = nor1z + nor2z

norSum = mathutils.Vector((x,y,z))

What is your question? Does the code nor work?

Blender only uses faces to calculate vertex normals. It looks like you're expecting it to use edge connectivity

There are several normal directions, not sure what you actually desire. In your figure, it looks as if you want to translate to the average vertex normal direction, but only in 2D.
Here's a 3D example using the bmesh module:
import bpy
import bmesh

me = bpy.context.object.data
bm = bmesh.from_edit_mesh(me)

active_edge = None
for elem in reversed(bm.select_history):
    if isinstance(elem, bmesh.types.BMEdge):
        active_edge = elem
        break
else:
    raise Exception("No active edge!")

v1, v2 = active_edge.verts
#co1 = v1.co + v1.normal
#co2 = v2.co + v2.normal
n = (v1.normal + v2.normal) * 0.5
co1 = v1.co + n
co2 = v2.co + n

ret = bmesh.ops.duplicate(bm, geom=[active_edge])
new_verts = [elem for elem in ret['geom'] if isinstance(elem, bmesh.types.BMVert)]

# Order???
new_verts[0].co = co1
new_verts[1].co = co2

bmesh.update_edit_mesh(me)

We would be happy if you shared your final solution (edit your question to append it), and I if you accepted my answer :)


text:
How do I model these spoilers?
I'm trying to model an airplane wing. I've already done the main wing body and the flaps, and I'm on my way to model the spoilers (the plates extending upwards):

How can I go about extruding these plates out of the wing body? I've tried extruding these edges but they get into a weird orientation and I can't align it with the wing's surface. How can I do this maintaining a good topology?
This is my reference image (notice how the spoilers cover the flaps' leading edge):

Here is the .blend file:
http://www.pasteall.org/blend/36159

Hey, just ran across this and thought you might want to take a look for the problem.  http://blender.stackexchange.com/questions/38482/extrude-edge-along-roof-angle?newsletter=1&nlcode=485175%7c782b
Just wanted to let you know; I'm still watching out for easier ways. :-)

The problem is, in your mesh model and as shown in the images, the mesh making up the wing tapers from the fat end to the narrow wing tip.  This makes the lines appear, kind of, parallel but they are just straight lines with various angles at different x,y,z levels, so when you extrude, the extrusion stays at a right angle (normal) to the lines being extruded from; but, while the long(itudinal) edges are mostly parallel, the (latitudinal) edges of the flap or any other part of the wing change in the XY axis.
In other words each line making up the wing and flap have a similar vanishing points (are nearly parallel), to make the streamline wing, but they are not aligned to the extrusion point.  So, it's not possible to extrude along the normal, and end up aligned with the flap or other points on the wing; but, you can edit the verts, or edges you extrude from the surface, to make them align.
Here's how I would do it. Read this first, I have put step by step instructions below this talk through.
While looking (top view) down on the plane, in vertex select mode, select the verts that represent the width of the spoiler you want to make, where you want to start the extrude. (With the instructions below, we're going to end up with single plane aligned the way you want).
Looking at the wing from the side view, extrude the verts at the approximate angle you wish toward the flaps (a combination of X & Y axis). This will give two edges at the angle you want (temporarily) above the Z axis.
You will now have two edges, two verts each; two are part the wing edge, and two at some height above the z-axis at an angle toward the flaps, but not yet what you want.
Go back to the top view. We're still in vertex select mode; but, we want, snap to vertex ON, and select vertex, (the magnet 'snap during transform' or use Shift + Tab, and 'type of element to snap to: vertex' (right next to the magnet, select vertex).
You will first need to select one of the two end verts of one of the two extruded edges, then press key G (grab), then degress of freedom for X & Y axis by Shift + Z [this says, freedom to move in X&Y but not Z axis.] This will allow you to retain your Z-axis (height of that vert above the wing or flap), but will allow you to snap to one of the verts that are part of the wing (or flap), without actually snapping to the wing (or flap)!  So, you have grabbed, and set X & Y axis (not Z), now move to the correct vert, you may have to move your pointer around till you see it snap to the one you want.  Once it has snapped to the vert you want, click to set it.  Now, do the same for the other vert of the 2nd extruded edge.
Turn off snap to: (magnet)
Add a face in the usual manner, select the four verts of the extruded edge, and press F to make face.  You can now edit as you wish.
Note: If you need to adjust the z axis, just select the two verts, press G > Z to only move them along the Z axis to adjust the angle.
Here are the steps and modified blend: http://www.pasteall.org/blend/36162

Top view (ortho), (Vertex select mode) select two verts to extrude for spoiler.
Side view (ortho), extrude in the general directions and angle you want.
Turn on Snap to (magnet) and vertex in the bottom menu.
Top view (ortho), G to grab one of the verts, Shift + Z (select X,Y axis)
Move pointer to vert to snap to: may have to wiggle pointer around to get it to snap to the vert you want.
Use LMB to set vert.
Repeat steps 4-6 for other vert.
Turn off Snap to (magnet)
If you need to adjust angle

Top View (ortho), Shift + RMB the two verts
Side View (ortho)
G to grab, then Z to select Z axis.
Move up or down for correct angle.
Press LMB to set.

Set face by selecting the four (4) verts of the spoiler, pressing F make face.

Of course, you'd have to remove some faces if you want to see through the wing that made the spoiler, and put in some machinery; but, that's another question.

Thank you for this incredibly detailed answer! But Im trying to model the spoilers out of the wing body, they should start on the tip of the body and cover a small lenght of the flaps. I've tried to use this method but with no luck yet ):

I extruded this from the wing body; and you can't just extrude, as I said, because extrusions have edges with are normal to each other and the wing.  The wing is not drawn normal to other parts of the wing because it is not a square shape.  So, you have to edit the extrusion to put it over the wing, and over the flaps.  How long the extrusion is, how far it goes over the wing and the flaps. It's all about the verts you chose to align the end extrusion.
The 2D view has perspective even in ortho, because we only see in 2D on the screen; but, it will be correct observed from all correct angles.

I used the verts at the closest edge of the flap, you have to pick another vertex on the edge.  The problem is that the alignment is to the z axis, looking down, just select verts on the sides of the flap further along the wing towards the flap tip.  If a vert doesn't exist, you will have to either eyeball it, which will be tough, or your will have to make one on the flap, to ensure it's aligned right.  As far as I know, there is no easier answer because of the wing shape.  It is because the wing has yaw and pitch.

The problem is in how the design was drawn, and the way extrude works. The wing in the image is not of the same design as in the blend. The answer provides a technique if the design has the data needed to extrude.  Another way to get the perspective you want, if it doesn't exist in the design, Using the same technique, I would first overlay a rectangular 'mesh plane'  onto the wing face by snapping the four vertices of the 'mesh plane' to the face of the wing; then pivot, and raise it to the correct angle. Simple extrusion would only work with modification of the way the wing is drawn.

I pratically only have a top down ortho view of the wing, I'll attach it to the question later

Another method would be to use "Local" and "Global" axes.  I believe this is what you want.  For each part of the plane, you will have several Local Axes groups, this depends on what is aligned with what.  You will sill need to make your orignal edges and such aligned globally, but, before you rotate them to align to a new orientation or angle, you will need to switch to local mode.
Make all your angle changes in local mode, like the angle that the wing sweeps back. Each line would have it's own orientation from along the global X,Y, & Z axis.  If you're new to this, you'll have to make a line, and play with it some to see how this works.
By changing the orientation in local mode.  The object or lines done locally will have two orientations.  Global will be aligned with the X-Y & Z axis that is normal to Blender. (I don't think these can be changed.)  However if you switch to Local, then Rotate or Translate, these now have their own axes.  So, a line can be at 45° toward the y axis globally, and extruded along, these global axis, or they can be extruded along the local axis which has the 45° from global as the x axis.  To extrude using local axes. You would 'E'xtrude "XX" or "YY" or "ZZ". Note, if you rotated the lines in Global mode, and didn't switch to "Local" before rotating it, all axes will be aligned to global still.  Local mode transforms the axis, not the object when doing rotations.
Hope this helps.

This method would be completely different from the other answer.  If you are willing to attach the flaps after you make them, you could draw them separately from the wing.  In Blender, when you extrude, you can specify an axis of extrusion.  If the line from which you want to extrude was aligned along the x,y or z plane, then you could extrude that line along one of the other two planes.  Try these commands to make your first line, keeping in mind the number of segments you want.
you need a single vertex.  To get this vertex:

Add a mesh plane. Go into 'Top Ortho' view mode to see X & Y axes.
Tab to edit mode.
In the bottom menu, select snap to 'vertex'
Select three vertices by Shift and click on each, or "C", and 'using scroll wheel to size circle' click to select each of 3 verts to remove. Wheel-click to remove a section if you accidentally select all.  (My select button is my left, my release is my right mouse button).  When done, release the circle by clicking the left mouse button (right in my case).  You will now have 3 verts selected.
'X' & 'V' to delete 3 verts, you now have one vertex.
Type 'Shift-C' to center the view, and place the cursor at the center.
Select the only remaining vertex. Type 'Shift-S'(Snap) and "C" (Selection to Cursor) to place the vertex at the center of the three axes.
To make a 5 segmented line, "E"xtrude "X" to constrain the extrude along the X axis, then click to create the extruded line.  Repeat for each segment, making sure to select the X axis till done.  You will now have a line of n segments along the 'X' axis.
While still in edit mode, you can either select 'all' to select all the vertices, or select two, to select an edge.
"E"xtrude "Y" to extrude constraining the extrude to the 'Y' axis only. Repeat for additional lines.
You will now have your flaps.

You will still have to join them to the wing of the plane.  Please post another question, as I'm restricting the answer to creating the flaps. Attaching them to the wing is another skill. You will need to orient them before joining them (CTRL-J).  But, you just can't get away without having to orient the flaps.  You will need to work in 3 dimensions to do this, and you will see that the process needed to do this has similarities with the first answer.  Blender has to be specifically told which way to extrude, and draw lines.  It would be nice it we could constrain the extrude at a specific angle, but you'd still need to figure out what that angle is.


text:
How to organize an extensible and reusable object?
I'm modelling an aircraft landing gear. I have currently done the wheel part only, but as it's just a piece of the whole landing gear, I would like to have it as a "base" object that can be used in many configurations. Some examples (not mine) are front landing gear

(source: foundation3d.com)
and wing landing gear

(source: aircraftrecognition.co.uk)
As you can see, the wheel itself is pretty much the same on either, but the part that connects it to the airplane can be very different depending on the configuration.
Should I create the different gear configurations by duplicating the wheel itself and editing? Or are there better methods where I can have only one wheel model (like an array modifier)? It seems to me the multiple objects approach (wheel, gear) is clumsy as I can't control how exactly the wheel connects to the gear.

If I remember correctly there is a way to have multiple objects use the same mesh data. I'd have to dig deeper on this.

Alt+d (Duplicate Linked) might be what you are looking for.  By duplicating this way, when you edit one of the instances then all the others will be changed as well.


text:
How to get rid of these displacement artifacts?
Got a big plane, sculpted some hills, put a displacement modifier on the plane, the coordinates are a uv map for just the hills. Now there is these nasty artifacts at the borders of the whole thing. Also notice how high the strength is, usually you have to set it lower than 1.
Is there an easy workaround to get rid of the artifacts or do I need to sculpt it?
What is the reason for the high strength of the modifier to see results of the displacement?

The sculpted hill. The selection is the uv map which the modifier gets applied to. (one won't see the back of it)

The displacement map. Don't worry about the upper part it's from a hill somewhere else.

Try to place a Subsurf Modifier below a Displacement.

It's not obvious to me what part is sculpted, how much is sculpted, what the displacement map looks like. Can you clarify with some more screenshots?

@Gonzou Nope, sadly this doesn't solve it. The order of the modifiers is better this way or the subsurf will take away detail from the displace.

@Gunslinger Sure, I'll add a screenshot of the sculpted hills and the displacement map.

If I understand you correct, it is the sudden drop in the terrain and the jagged edge that you want to avoid. You must smoothe the edges of the heightmap.
The transparent portion of your texture is treated as white. So it goes quite abruptly from dark to white.
One way to do this is in photoshop.

Duplicate the layer.
Smooth the bottom layer. (the smaller blur radius the better result)
Merge the two layers.
Repeat this until the entire image is filled.

It is handy to make this an action (a macro or a script) in photoshop. It can easily be recorded.

Halfway step:

Final result:

That is the answer I was hoping for, like how to avoid it mapwise. I'll definitely try this with a macro in PS. Thank you man!

Ok, if there is no simple workaround at least there is the difficult, manual way:
Just flip the plane upside down (bottom view with Ctrl+7) and use the Smooth brush on the inner normals of the edge, works like a charm.
In the end there is still a little bit of a hollow, just go into top view and use the Flatten brush (with caution) on the outer normals, et voilà.

@Ray Mairlot Thx for the fancy keys :*

look at the source to see how to insert your own buttons. PS any time you see some neat formatting in a post, you can hit the edit button to see how it is done.


text:
How to get normal/displacement/ao maps for a part of a photo
So I used a tool to create maps from a photo, turned out that the map of a cut out shape of the photo completes itself with the rest of the photo.
This is very bad, is there another way to get maps for a part of a photo?
Just the photo:

Normal map from it:

The cut out shape:

The normal map of the shape with autocompleted parts and a strange border on top:

An example with another shape which I only imported like this:

Its normal map is as it should be:

As you wish, it was answered quite perfect by TLousky anyway.

I'm voting to close this question as off-topic because it is about generating maps in crazybump

It kind of is... yet the answer is about the maps in general. And the question could be seen too in relation to the answer.

Tried to reword it, maybe someone else will also need a reminder of simple graphic design techniques.

This shouldn't bother you much, since you probably have the original cut image, with all the removed parts transparent (?)
In that case you can use the alpha to either make a mask / selection and remove the useless bits from the generated maps in photoshop / gimp,
Or you can use the alpha from the cut color map in color mix nodes in the node editor. Either way it won't have any effect.

Of course! I can just cut the shape out of the maps. Thanks man, I was too stupid to come up with this easy solution lol

Sometimes the obvious stuff is the most elusive, happens to me all the time :)

It is even better since the normal map of a cut out shape gets "corrupted" by the background.


text:
How can I use clone brush in the UV/Image editor?
I am using a clone brush on a model using CTRL+Left Mouse Button to define origin of the clone brush. Why it doesn't work when I'm doing the same in UV/Image Editor?

I'll show you the method, which does not work exactly like the one you mentioned (Ctrl+Left Mouse Click) but may be useful for you.
In Uv/Image Editor change the Mode to Paint.

Place the cursor in the Uv/Image Editor window and press T. It will display the Tools panel on the left. Choose the clone brush and an image, which will be the source for cloning.

Place the image wherever you want holding the Right Mouse Click. Paint by pressing the Left Mouse Click.

Thanks, that may be a temporary solution, its not very intuitive for inexperienced users, would be nice to have the clone option like in photoshop or other image editors.

For some reason I do not have Blend type option in clone brush.

Note: It can happen that the clone image is not visible, because it is positioned far away, zoom out too find it.


text:
How to use procedural texture color as vertex group?
Is it possible to convert color intensity of procedural texture to weighs so it can be used as vertex group in modifiers?

Probably using Vertex Weight Edit modifier, that is already described here - http://blender.stackexchange.com/questions/3355/vertex-group-from-texture.


text:
Values from system console
I have values printed in a system console in long lines and the lines are split to fit the window.
Is there a way to copy the values without breaking the lines?
I'm using windows 10

This doesn't really seem to be a blender-specific question? Seems to me this may be better suited to super user

I'm voting to close this question as off-topic because it is about an operating system console.

@gandalf3 I was hoping to get a solution maybe using python, but its simpler just to adjust the console window.

@Denis using python to manipulate the console/terminal would be even more platform specific. In linux you could for instance start blender in a pseudo terminal (pty) and do whatever you want  .

@user2859 The question is not really about manipulating the console window, all I needed is a way to copy the values without breaking the lines.

Not sure how the windows 10 console works, but wrapping lines doesn't do anything bad for copy and paste in gnome-terminal. Then again windows console was always a mess. Or is it just about beautifying the output?

@user2859 If the lines are longer than the window they are split to the next line and I have to manually correct that, but adjusting the layout width fixing the problem like its shown in the answer.

@Denis Not really sure how it works on windows, but I doubt blender has any control over how the console decides to display output.

The minimum you could expect is usually 80x24, which is originated from the smallest vt100 resolution. That being said it's still not related to blender in any way. For instance the answer gnome-terminal --geometry 80x24 -e ./blender would also be correct..

Consider changing the [width] property from the properties of your console.  You need to know the length of the longest line by inspection.
Under MS Windows it is done with the properties panel as depicted below.
Your OS was not specified.
Blender output seems wrapped to the current width of the console.

You can also consider changing your print statements to some some other function which writes text it to a file, append, open and close.  File Redirection may be possible.  I am not currently using Linux/Variants but in some programs one may choose the console.

Im on windows 10, and it solved the problem. where can i find an example how to print it into a text file? I have each frame printed into one line.

@Denis you can write the output directly to a file, no need to start blender with a pipe/redirection. file=open('./myfile', 'w+')
file.write('Blah') or even print('Blah', file=file)

Suppose you have N (number) print statements you want to go to a file.  You might copy and paste N new file write/append statements.  Depending on how much formatting you have you may or may not like this.  I suggest you have a new question if it is worth your time.  How do I convert/supplement Blender console Python print statements into file write/append statement in an efficient way?

@atomicbezierslinger it doesnt really matter as long as I can copy the values correctly.

@user2859 Is a file close good form or unnecessary for append?   Name suggestion for windows myfile.txt.

@atomicbezierslinger close is good form and recommended. The file will be automatically closed by the garbage collector though. I just left that out of the comment.


text:
How to connect N number of values to RGB combine node and to have all possible variations
I have created a node with 21 outputs which I want to be connected to RGB combine node and I want some way scroll through ALL the variation with ability to know the variation of inputs. Can anyone suggest a way to solve this problem?

Are those 21 different outputs combined RBG outputs that you want an easy way to cycle through, or are they separate R, G & B components you want to mix in every different possible combinations? Because if it is the second option will yield A LOT of possible combinations. Now math is not my strong suit but I believe that would be 21 x 21 x 21 = 9261 possible combinations and that does not seem trivial to do. Could you add some screenshots of your custom node and the desired output?

@DuarteFarrajotaRamos I need a variation of 3 values from the 21, I think its around 1300 variations.

@DuarteFarrajotaRamos  My midnight combinatorics skills say it should be 21P3=21x20x19=7980 (you can't pick the same socket for all 3).

@PGmath the order doesn't matter so the number of variations is 1330, and I probably will reduce the number of outputs to 10, depends if there is a good contrast in the outputs.

@Denis  I think you are thinking combinations (order of sockets picked doesn't matter) instead of permutations (order matters), which is why you are off by 3!=6.  Unless the order doesn't matter, does it?  (I.e. should [1,2,3] be different than [2,3,1] etc.?)

@Denis  You answered my question telepathically!

@Denis two more questions.  What kind of input do you need?  Would an approach that does generate permutations be acceptable, or does it have to weed out duplicate combinations?

@PGmath I would prefer that its not generated randomly but in a sequence and duplicates are not really important.

@denis I don't have time to do it tonight, but my idea is to take an input number and convert it to a 3-digit base-N number (using modulo math nodes), each digit of which is sent to a homemade N-way mix node.  Clunky, but doable.  (I will see if I can find a way of weeding out the duplicate combos mathematically.)

@PGmath I think this way its not very productive and too complex to make, maybe to put something on each color that scrolls quickly through the outputs will be better. I will do some more tests and probably will change the question.

Here's the script I came up with. I called the panel "Socket Arranger", and I put it in a new tab called "Socket" in the node editor.
Here's the main logic behind creating the links:

Focus on two groups: 1. the output sockets of one node and 2. the
input sockets of another node.
I created sets from the output sockets. Each set should be unique (it
shouldn't share sockets with other sets). That way, I can consider
each set separately when thinking about how they should be connected
to the input sockets. Therefore, use itertools.combinations.
The size of all sets made from itertools.combinations should be the
same as the amount of input sockets. For example, only 3 output
sockets can connect to 3 input sockets. (I didn't consider
disconnected sockets. I don't know if you need it. Plus it sounds
hard to do haha.)
For each unique set, I'm looking for as many input setups as
possible, so it doesn't matter what order I connect them to the input
sockets. When I dealt with the input sockets, I used
itertools.permutations.
Each unique set made from itertools.combinations contains the same amount of input socket possiblilities (since we're only doing itertools.permutations on the same set of input sockets). So to find the total amount of output/input
combinations, I multiplied len(itertools.combinations) of output sockets with len(itertools.permutations) of input sockets. Basically, in this case, "21 C 3" * "3 P 3" = 7980 unique combinations.
@PGMath was right.
Overall, the code was about mixing a combination of output sockets with a permutation of input sockets.

Code:
import bpy, itertools
from bpy.types import Panel, PropertyGroup, Operator
from bpy.props import StringProperty, IntProperty, PointerProperty, CollectionProperty, BoolProperty
#I make my own term called a 'node map'. I call it a list of tuples with information about how the sockets should be linked. A larger CollectionProperty() stores a list of node maps.'

def updateBeforeFrame(scene):
    '''force update of node setups before the frame is rendered'''
    #This looks repetitive, but apparently this explicit assignment calls the proper "update" functions. Otherwise, it doesn't work, even if you see the index inputs in the Socket Arranger Panel changing
    if scene.inputGroup.combOrIso == True:
        scene.inputGroup.combIndex = scene.inputGroup.combIndex
    else:
       scene.inputGroup.isolateIndex = scene.inputGroup.isolateIndex

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

def linkNodes(self,context):
    '''get all the node maps generated from the "Set Up Combinations" button, and interface with "Combination Index" slider to access the maps'''
    mt = bpy.data.materials[context.scene.inputGroup.mat]
    nOu = mt.node_tree.nodes[context.scene.inputGroup.nodeOut]
    nIn = mt.node_tree.nodes[context.scene.inputGroup.nodeIn]

    intIndex = context.scene.inputGroup.combIndex

    set = context.scene.combSet[intIndex]
    lst = eval(set.miSetString) #convert list earlier converted to a string back to a list
    for output, input in lst:
        mt.node_tree.links.new(nIn.inputs[input], nOu.outputs[output])
    mt.node_tree.update_tag()

def linkIsolatedNodes(self,context):
    '''same as linkNodes, but with the "Isolate String" button and the "Isolate Index" button'''
    mt = bpy.data.materials[context.scene.inputGroup.mat]
    nOu = mt.node_tree.nodes[context.scene.inputGroup.nodeOut]
    nIn = mt.node_tree.nodes[context.scene.inputGroup.nodeIn]

    intIndex = context.scene.inputGroup.isolateIndex

    set = context.scene.isoCombSet[intIndex]
    lst = eval(set.miSetString)
    for output, input in lst:
        mt.node_tree.links.new(nIn.inputs[input], nOu.outputs[output])
    mt.node_tree.update_tag()

class CombinationSet(PropertyGroup):
    '''a holder for each list of node maps generated from "the "Set Up Combinations" button'''

    miSetString = StringProperty()

class IsolatedCombinationSet(PropertyGroup):
    '''same as CombinationSet, but for "Isolate String button'''

    miSetString = StringProperty()

class InputGroup(PropertyGroup):
    '''hold inputs for the script's panel here'''
    #I can set soft_min to 0 for all IntProperties here since when I index any CollectionProperty, it always starts at 0

    combIndex = IntProperty(name="Combination Index", soft_min = 0, update=linkNodes)

    mat = StringProperty(name="Material Name")

    nodeOut = StringProperty(name="Node for Outputs Name",
    description="The name of the node to get output sockets from. (in the Node Panel)")

    nodeIn = StringProperty(name="Node for Inputs Name",
    description="The name of the node to get input sockets from. (in the Node Panel)")

    inOrExclude = BoolProperty(name="Must Contain All Listed?",
    description = "If yes, isolate only the combinations containing all of the sockets. If no, look for items with at least one of the sockets listed. (The original combination list won't be affected.)",
    default = False)

    isolateString = StringProperty(name="Isolate String",
    description="Type in the names of either input or output socket node names, separated by commas, to choose specific combinations. (Leave empty to get the original combination list)")

    isolateIndex = IntProperty(name="Isolate Index", soft_min = 0, update=linkIsolatedNodes)

    combOrIso = BoolProperty(name="Render combination keyframes? (else isolated keyframes)",
    description="If yes, the scene will render out keyframes put on the 'Combination Index' slider. If no, it'll render out the 'Isolate Index' slider.")

class SetUpCombinations(Operator):
    '''set up a list of "node maps"'''
    bl_idname="custom.set_up_combinations"
    bl_label = "Set Up Combinations"
    bl_options = {"REGISTER", "UNDO"}

    def execute(self, context):
        mt = bpy.data.materials[context.scene.inputGroup.mat]
        nOu = mt.node_tree.nodes[context.scene.inputGroup.nodeOut]
        nIn = mt.node_tree.nodes[context.scene.inputGroup.nodeIn]

        nOuNames = []
        nInNames = []
        for socket in nOu.outputs.values():
            nOuNames.append(socket.name)
        for socket in nIn.inputs.values():
            nInNames.append(socket.name)
        miniSetSize = len(nIn.inputs.values())

        comb = list(itertools.combinations(nOuNames, miniSetSize))
        permu = list(itertools.permutations(nInNames, miniSetSize))
        cSet = context.scene.combSet
        cSet.clear()

        for com in comb:
            for per in permu:
                newSet = cSet.add()
                miniSet = list(zip(com, per))
                newSet.miSetString = str(miniSet) #convert to string so can be stored in a StringProperty for long-term usage

        context.scene.inputGroup.maxIndexLabel = str(len(cSet) - 1)
        return {"FINISHED"}

class IsolateCombinations(Operator):
    '''same as SetUpCombinations, but with the option to isolate certain node maps by socket name'''
    bl_idname = "custom.isolate_combinations"
    bl_label = "Isolate Combinations"
    bl_options = {"REGISTER", "UNDO"}

    def execute(self, context):
        iCoSet = context.scene.isoCombSet
        iCoSet.clear()

        stringLst = context.scene.inputGroup.isolateString.strip('[]').split(',')
        for i in stringLst:
            stringLst[stringLst.index(i)] = i.strip()

        if context.scene.inputGroup.inOrExclude == True:
            for set in context.scene.combSet:
                add = True
                for string in stringLst:
                    if string not in set.miSetString:
                        add = False
                        pass
                if add:
                    newSet = iCoSet.add()
                    newSet.miSetString = set.miSetString
        else:
            for set in context.scene.combSet:
                add = False
                for string in stringLst:
                    if string in set.miSetString:
                        add = True
                        pass
                if add:
                    newSet = iCoSet.add()
                    newSet.miSetString = set.miSetString
        return {"FINISHED"}

class SocketArranger(Panel):
    bl_idname = "socket_arranger"
    bl_label = "Socket Arranger"
    bl_space_type = "NODE_EDITOR"
    bl_region_type = "TOOLS"
    bl_category = "Sockets"
    bl_context = "objectmode"

    def draw(self, context):
        lt = self.layout
        iGroup = context.scene.inputGroup

        length = len(context.scene.combSet)
        maxIndex = length - 1
        if length == 0:
            maxIndex = 0

        lt.prop(iGroup, "combIndex")
        lt.label(text="Max Comination Index: " + str(maxIndex))
        lt.label(text="(Max Combinations: " + str(length) + ")")
        lt.prop(iGroup, "mat")
        lt.prop(iGroup, "nodeOut")
        lt.prop(iGroup, "nodeIn")
        lt.operator("custom.set_up_combinations")
        lt.prop(iGroup, "isolateString")
        lt.operator("custom.isolate_combinations")
        lt.prop(iGroup, "isolateIndex")
        lt.prop(iGroup, "inOrExclude")

        length = len(context.scene.isoCombSet)
        maxIndex = length - 1
        if length == 0:
            maxIndex = 0
        lt.label(text="Max Isolate Index: " + str(maxIndex))
        lt.label(text="(Number of Isolated Combinations: " + str(length) + ")")

        lt.prop(iGroup, "combOrIso")

def register():
    bpy.utils.register_module(__name__)
    bpy.types.Scene.inputGroup = PointerProperty(type=InputGroup)
    bpy.types.Scene.combSet = CollectionProperty(type=CombinationSet)
    bpy.types.Scene.isoCombSet = CollectionProperty(type=IsolatedCombinationSet)

def unregister():
    bpy.utils.unregister_module(__name__)
    del bpy.types.Scene.inputGroup
    del bpy.types.Scene.combSet
    del bpy.types.Scene.isoCombSet

if __name__ == "__main__":
    register()

I also added some options to allow you to isolate certain socket set ups to experiment with. I thought it might help you, especially with 21 output sockets. This doesn't work for nodes while you're editing a node group. If I can get it done, I'll try to add that in, maybe along with the "disconnected sockets" scenarios.

At the end of linkNodes() you can add mt.node_tree.update_tag() and it will trigger a render refresh in the viewport as you change the combination index.

This is perfect! Testing it now, I tried to animate the combinations but it looks like its not updating in the 3D view, is there a way to fix that?

@Denis Cool. What do you mean by "animate"? Like, "is the 3D View updating every time I try a different combination?" The update_tag() function sambler suggested should make it work. In render mode, at least you should see the render info. bar on the top change slightly as you scroll through the combinations.

@DragonautX When I keyframe the combination index and hit play the screen is not updating in any mode, not even when i try to render the animation.

@Denis Oh ok. Apparently, the update functions linkNodes() and linkIsolatedNodes() aren't called when the frame changes. What I found from here though is that I can explicitly call a handler function to run those update functions before a frame. I called it updateBeforeFrame(). I also found that assigning a Property to itself calls an update function. It sounds odd, but if it works, it works haha. I've updated the script with edits.

@Denis Also, I added a checkbox at the bottom of the panel to say whether to animate using the "Combination Index" keyframes or the "Isolate Index" keyframes.

@DragonautX I'm not sure if I'm doing something wrong but keyframed animation is not updating or rendered.

@Denis Did you check the new checkbox I made? Or is your node setup complete, like is everything connected to a Diffuse BSDF or Material Output ? Maybe clicking "Set Up Combinations" will help. If you'd like, I can look at your Blender file.

@DragonautX the node setup is complete and I tried to keyframe all the variations, but its stuck in one combination that was set manually. And the file is too big to upload.

@Denis What do you mean by "set manually"? You put a keyframe on 1 and 20 for example to run through all variations, and then what did you "set manually"? Does it involve keyframes? And how big is the file?

@DragonautX Just for testing I set the frames equal to the combinations and set the keyframes from 0 to the end, but the frames rendered only the  combination that was initially in the node setup even though i can see the keyframed index is changing every frame but not the node connections. The file is about 700mb

@DragonautX I dont really need to render the animation, but it would help to play the animation instead of scrolling through the combination one by one

@Denis Oh ok, so like from frame 0 to 7979, and for each frame, show a specific node setup. And even when you press play, you dont see anything in the node editor changing, only what was originally there. Odd. Adding the handler function should've fixed this. It did for me. Wow thats a big file haha. Was it that size before you ran the script? If no, maybe you could run a clear () to reduce file size. If the animation is for just looking at different settings, you can set the 3d view to render and you can click and hold the "Combination Index" Panel and move the mouse to scroll comfortably.

@DragonautX I reloaded the script and it solved the problem, Im not sure why it didnt work before

@Denis Oh, it's all working now, socket changes and animation? Awesome! Oh ya that's right. When I try to reimport scripts into the console, it doesn't update, so the last option I always see is to save the blend file and scripts and reopen the same file. Anyways, well, if everything works for you, then happy Blending then!

@DragonautX Thanks a lot! all working well now :)

Oops, had to add a missing mt.node_tree.update_tag() to linkIsolatedNodes(). Just a self note.

For a simple script, create a combineRGB node for each 3 outputs from the group. That makes 7 different mixes from the 21 outputs you have.
Changing the mixing seed allows different combinations to be made.
import bpy
import random

mixing_seed = 2

node_tree = bpy.context.object.active_material.node_tree
nodes = node_tree.nodes

grp = nodes['Group']

out_idxs = [i for i in range(len(grp.outputs))]
pos_x = grp.location.x + 300
pos_y = grp.location.y

random.seed(mixing_seed)
random.shuffle(out_idxs)
while len(out_idxs):
    n = nodes.new('ShaderNodeCombineRGB')
    n.hide = True
    n.location.x = pos_x
    n.location.y = pos_y
    pos_y -= 70
    for c in range(3):
        node_tree.links.new(n.inputs[c], grp.outputs[out_idxs.pop()])
        if len(out_idxs) == 0: break


text:
Reposition navigation gizmo
As a pen user and newbie, I rely greatly on clicking on buttons over key shortcuts. As a left handed user, I would benefit from essentially flipping the UI horizontally, so tools are more reachable. This can be done with most elements, including the toolbar and sidebar (as per this answer). The only thing I couldn't figure out how to move are the navigation tools. Is there a way to move the axis ball and the buttons under it to the left of the viewport?

Related: https://blender.stackexchange.com/questions/136848/reassign-position-and-scale-of-the-navigation-gizmo

There may be an way to do it with BPY code that I am unaware of.
On the other hand, you can toggle the viewport 3D gizmo visibility by clicking the Viewport Gizmos popover menu in the 3D View header, then clicking the option Navigate.
There is also the shortcut  ~ to toggle the gizmo visibility.

I should've clarified, I'm not looking for a programmatic solution, only a UI option. I'll accept this answer as a 'no' and try hitting up Right Click Select.


text:
Mesh gets deformed after parenting with automatic weights
I've been trying to attach this character mesh to an armature using Armature Deform with Automatic Weights, but after setting the weights, the character gets its limbs shifted strangely (wrists turn up, feet come together) even though I haven't touched the pose. I'm new to character modeling and rigging, so I'm not sure if I'm missing something.
Mesh After Parenting

Original Mesh

I think you should apply armature pose as a rest pose, what i believe happens in your case is that you have corrected the armature pose in the pose mode instead of edit mode, that way you have a non neutral pose on your armature which means as soon as you apply that armature to the mesh all bones that are not in the rest pose will apply its transformations to assigned vertices.
Hope this helps.

I think this is in fact the issue! Thanks! The armature comes with its own animation I am trying to rig the mesh to, and the t-pose frame at frame 0 was not set to be its rest pose. Unfortunately for me, this means that setting the rest pose doesn't fix the rest of the animation, but thanks for helping me with this part of my problem!

You can try this: before parenting the mesh to armature, create a new animation 'action', enter pose mode, select all bones in the armature and press "alt + R" (reset rotation), then "alt + G" (reset location), then "alt + S" (reset scale). Then go back to object mode and whatever the pose the skeleton ended up in, make your mesh match that pose, and only then try to parent the mesh to the armature with automatic weights.
I'm not 100% sure it would solve it, but I'm pretty confident it would.

Try applying the transforms of the meshes in Object > Apply> All Transforms then re automatic weight it.


text:
When using an Operator Modal Timer, how do i change the time period such that it executes every 5 seconds?
I'm trying to use a modal operator timer to get a piece of code to execute every 5 seconds. Currently all i want is for it to print a statement every 5 seconds however, in the future, this will be changed to create a new object every 5 seconds.
Currently i use the following which prints the statement multiple times a second.
import bpy

class ModalTimerOperator(bpy.types.Operator):
    """Operator which runs its self from a timer"""
    bl_idname = "wm.modal_timer_operator"
    bl_label = "Modal Timer Operator"

    _timer = None

    def modal(self, context, event):
        if event.type in {'RIGHTMOUSE', 'ESC'}:
            self.cancel(context)
            return {'CANCELLED'}

        if event.type == 'TIMER':
            print("5 seconds has passed")

        return {'PASS_THROUGH'}

    def execute(self, context):
        wm = context.window_manager
        self._timer = wm.event_timer_add(1.0, window=context.window)
        wm.modal_handler_add(self)
        return {'RUNNING_MODAL'}

    def cancel(self, context):
        wm = context.window_manager
        wm.event_timer_remove(self._timer)

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

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

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.wm.modal_timer_operator()

How do i change this to run once every 5 seconds?

Related https://blender.stackexchange.com/a/131934/15543

The event timer has a property which defines how often your modal function will get called with the timer event, just change the value accordingly in the execute function:
time = 5.0
self._timer = wm.event_timer_add(time, window=context.window)

how often the modal is called or when timer event is true?

it will get called for every occuring event (such as ESC for cancelling), but only every 5 seconds from the timer event

To clarify re comment: If a print("bar") is added under def modal(... and a print("foo") in if event.type == 'TIMER' it will print a lot of bars between each foo.  Feel that your answer is implying modal is being called every 5 secs which AFAIC is not the case.

you're right, modal gets called more often. I included the timer event in my answer, is that enough?


text:
How to make the light from the flashlight in Blender Cycles?
How to make the light from the flashlight in Blender Cycles?
The Emission node doesn’t give volumetric light:

I'll use it in animation, example:
.

http://blender.stackexchange.com/questions/16594/how-can-a-light-cone-volumetric-be-setup-with-cycles and also http://blender.stackexchange.com/questions/30695/lighting-specific-objects-in-cycles-with-volumetric-atmosphere

here is a posibility too: https://www.youtube.com/watch?v=xw9FALJ7fvo

the volumetric part of the light could be a parented object on his own, with appropriate nodes and textures for emission, transparency, translucency, maybe in a separate layer to be blurred, alpha overed and color corrected.

Can you show me concrete nodes & settings of the volume light?

authors: Владислав Самохин


text:
When I want to move my model It doesnt go smooth
When I try to move it around with G it doesn't go smooth, it makes like big jumps and not smoothly... I'm in pose mode trying to make an animation.

Have you got the button "snap during transform" enabled (magnet icon)?

Ohh my god thanks! I'm a beginner I didnt see that one comming :')


text:
Turn off the completed frame presentation
I am editing a movie clip for the 2d stabilization; at the top I can see that each frame is taking around half a second each, but blender feels the need to show me what it completed by pausing its work and leaving the last rendered frame up there for around a second before starting the next one. I can see my frame counter go up at the bottom, and each one is taking longer than a second. Is there a way to turn this "feature" off?

I'm not exactly sure what you mean.. Is this during tracking or rendering? Which editor are you in?

In the compositor, I deleted the render layers node and I added the 2d stabilization node and the movie clip node, then hit render.

Hm. Well, i'm not aware of any sort of feature which behaves like this. Is it possible it is writing the frame during this delay? Can you see an increase in disk activity around these pauses?

Blender isn't pausing the render to show you the frame it just rendered, 'around a second' is just the time it is taking before it can start rendering the next frame in your scene. As gandalf3 mentioned in the comments, that could be because it's writing the image to disk, doing some pre-processing of the file, reading in textures (or in your case a movieclip) or doing any memory freeing that might have to happen between frames.
(Note: I don't actually know the specifics of what blender does between frames, I'm just trying to get the point across that blender doesn't delay things on purpose).
If you render blender's default scene of just a cube at a low resolution you will see how quickly the frames advance. There isn't much 'pausing' happening because the scene is so simple that it requires very little processing (or barely any time to write the frame to disk).
However, there is a way you can potentially speed this up a bit, which is by locking the interface while the render is happening. This is done with the lock icon in the 'Render' panel:

This may give a minor speedup as the render result doesn't have to be drawn to the screen while rendering, but bare in mind that it's probably the processing happening that is causing the most delay, not the drawing to the screen.
Maybe if you render from the command line you will get a more detailed log of what is happening at each point in the rendering process.


text:
How to register keymaps for all editor types?
I want to write an addon, which enables you to switch quickly, via a pie menu, between the editor types. (e.g. Node Editor, 3D View, Graph Editor, etc...)
To get my shortcut working, I need to register the same keymap for every space or editor type.
(e.g.:keymap_items.new("wm.call_menu_pie", type = "E",alt=True, value = "PRESS"))
Right now I got it working with only one editor type:
keyconfigs.addon.keymaps.new(name = "Node Editor", space_type = "NODE_EDITOR")
I know, I could simply register my keymap for every single editor type with a loop, but I am sure there is a more convenient and beatiful way to accomplish my objective.
( Maybe something like space_type = "WINDOW"?)
PS: My current registration code looks like this:
addon_keymaps = []
def register_keymaps():
    global addon_keymaps
    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name = "Node Editor", space_type = "NODE_EDITOR")
    kmi = km.keymap_items.new("wm.call_menu_pie", type = "E",alt=True, value = "PRESS")
    kmi.properties.name = "view3d.switcher"
    addon_keymaps.append(km)

I randomly discovered the answer to my question on the Blender Python API Documentation
My registration code now looks like this:
addon_keymaps = []
def register_keymaps():
    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name = "Window",space_type='EMPTY', region_type='WINDOW')
    kmi = km.keymap_items.new("wm.call_menu_pie", type = "E",alt=True, value = "PRESS")
    kmi.properties.name = "editor_switcher_pie_menu"
    addon_keymaps.append(km)

You can find the final version of my addon on GitHub


text:
Other programs support .blend
Is there any program that import blender objects and animate them with it
Cuz i have made a 3d logo with blender and it is kind of difficult to animate it  (with my little experience ) with blender so is there any chance of another program??

there could be others, but why not exporting your modeled object to (say, .obj, or .fbx) and import it in your favourite animation package?

How do i do that ??

model your object in blender, then from the menu file > export, choose a format that is suitable for your other animation program. in the default install there are most popular ones, but you can enable others, from the user preference panel, "add-ons tab" (see menu file > user preferences...). knowing which program you wish to import it into, a few suggestion could be made...

You can use After Effect with Element 3D and then export the blender file as an OBJ


text:
Can't save blended file? Unable to pack file source path?
This keeps coming up I can't save any files, I put everything in the same folder, I have two different models I made one in cycles the other in blender
I combined both of them into one folder...Blender doesn't seem to work the same as MMD...anyway
One is a 3d character the other is a model of a room
I can't save

Do you have autopack enabled in File > External data?


text:
Making a hollow, 3-D pipe/duct: after joining two cubes, how can I delete the surface inside the pipe/duct to make it hollow?

What is the simplest possible method for making a 3-D hollow pipe/duct out of two cubes in Blender?  One example of what I'd like to achieve is shown above (I would like to do this many times and change the dimensions of the joined bodies).  This question has been asked before.  I have spent the last couple of days googling and trying to understand explanations, but either I get lost or nothing has worked for me.  It seems like many of the available explanations are designed for 2-D and I can't extend them to my setup.
More detail:
I have to use two cubes of different size to make a pipe/duct.  I will have to do this many, many times, so would prefer to find a fast method.  I can't eyeball/estimate anything about the fit or size or orientation of the cubes because I'm trying to make a geometry for use in a simulation.  My problem is that when I join the cubes, I have a surface crossing the pipe/duct at the join (in the figure below, this surface is oriented the same way as the grid).  I have tried using the "knife project" tool, but I don't have vertices in the right place to use it and can't figure out how to get them.  In one online resource, someone mentioned a "Union" addon, but it doesn't appear in my list of add-ons.
Is there a simple way to do this?  All I need to do is get rid of one surface of each cube and then join the cubes.

Is it possible to show some screenshots of what exactly you are trying to achieve? So far I think the answer to your question might be here - https://blender.stackexchange.com/questions/28190/a-problem-with-blenders-bridge-edge-loops-system

Thank you Mr Zak. I'll upload a couple of shots right now and will check out your link.

I found in an earlier question that objects of your size are generally harder to work with, i would start by making it not the size of sears tower.

Thanks for letting me know, Vince.  Unfortunately, I don't have much of a choice about my dimensions!  I could, of course, do some initial tests at smaller scales though.

Answer coming up, gimme a sec here.

Thanks so much, Vince. I have to step out for about an hour, but will be back.

Perfectly alright, takes me a while to write an answer anyhow!

First of all, I don't know if I quite understood the question correctly, but  what I got out of it tells me you have a shape like this:

And that you want to make sure that the intersection there is clean, and not screwy.
This can be accomplished with Loop-Cut-an-Slide tool. It can be accessed in edit mode by pressing Ctrl + R. when you place it on the upper cube, it looks like this:

Don't bother sliding it, just click and place it there for now. Next you're gonna want to turn on vertex snapping, it can be found on the bottom bar of your 3D view-port. Click the magnet to turn on snapping, then click the grid icon just right of it and change it to vertex, portrayed by a grey cube with two white studs on it
once this is enabled you can select the four vertices of the loop you added and hit G + Z to Grab them down on the Z axis.
now, if you mouse over one of the vertices of your bottom cube until an orange circle appears around it, then click to finish placement.

Now all you have to do is remove those inner four vertices to get a clean cut.
If you add two loop-cuts on the bottom cube and hitS + X
 to Scale them on the X axis and then snap them to the new bottom of your top cube. Now remove doubles and your gold!

You can also do this by simply grabbing the four vertices that you don't like and G + Z to Grab them up on the Z axis until they snap with the top of the top cube.
Sorry for the super long answer. :D hope this helps, Ciao!

Wow, thank you for going to so much trouble, Vince!  I am trying it out right now.  It may take me a while but it looks promising.

Vince, sorry if I don't understand correctly.  I need to be able to flow fluid through the geometry.  So I want to remove the surface where the cubes join.  Your answer helps me with another issue, so thanks for that.  It might also help me solve my problem...  I will work with it.

You can! just delete the entire top face and ramake the ones on either side by selecting the four corners and hitting  [F].

I'll try it!  It will probably take me a while because I'm not very fast in Blender yet.  Thanks a lot for your patience.

Vince, it worked!!  Thank you so much!  I have spent nearly a week on this and was ready to give up on Blender. Unfortunately, I can't vote you up because I'm not important enough.

It's alright. just glad to help.! have fun with your project!


text:
Subdivision Surface creates only one level of subdiv in 3.6
I got this strange behaviour of the SubSurf Modifier and the Multires modifier in 3.6. Until 3.5 everything works as expected.
I saw that lots of people don't have any issue, and I didn't find anything similar on the web.
Any idea of what could be the problem?
Windows 11, i9 13900, RTX 4070Ti, 64 GB RAM, drivers updated, it happens both with GPU Subdiv preference turned On and Off.
Thank you

That image is too small to see what you are doing. Could you please explain the exact sequence of events you're using?

On default cube I add the subdiv, crank up both Viewport and render levels to 6, then apply the modifier. I get a cube subdivided une time instead of 6. Then I repeat the sequence and I get another single level of subdiv.

That works absolutely fine here with the subdiv modifier under Blender 3.6.4 and Windows 10. I've not checked the multires modifier because I've never used it and don't know how it's supposed to work.

Yes, thank you, I know that it's a problem of my config, but I've tried to turn off addons, set factory pref, reinstall from scratch, 3.6.3 and 3.6.4, always the same problem, I don't understand what could be causing this issue.

Putting a second modifier on it when you've already applied one with 6 levels is going to give you problems anyway because of the number of verts it's trying to process. In fact blender locks up and eventually crashes if I go above a couple of levels on a second modifier.

In 3.5 it works fluently.

3.5.1 crashes when I increase the second modifier to level 5 here but is a bit more responsive than 3.6 at lower levels.

Check if simplify is not on by default, also try portable Blender, if that's not the case, it's probably a bug to report

@joshsanfelici you said that you reinstalled 3.6.4 from scratch. Did you try that after either renaming, or moving the 3.6 folder out of the Users->your user name->AppData->Roaming->Blender Foundation->Blender folder? I don't know if it would make any difference, but you might try it. If you were going to do that I would suggest that you don't click on the "use settings from 3.5" or whatever that option says the first time you open the reinstalled Blender.

Thanks to everyone, it was my fault, I had the Simplify option enabled with a max subdivision level on 1.
Sorry for this stupid mistake.


text:
Gltf 2.0 Not exporting animations
I made a simple subdivided cube with a simple armature and a simple animation, for testing the Glb/Gltf exporter.
No matter all exporting options I tried, the model gets correctly exported, with materials, vertex groups, armature, but no animation data.
I've tried with NLA, with actions in action editor, with all 3 different file format (Glb, Gltf, Gltf Embedded), checking and unchecking all different export options.
I've tried without filters, filtering by collections, filtering by selected.
I've always obtained everything correctly exported except animations, even reimporting into a .blend file or a gltf viewer (in the data analisys I get "animationCount": 0, in the importing .blend file no action is present).
I've read all the official documentation, but couldn't find any info to solve the problem.
What am I missing?
Windows 10, blender 3.3.1 and 3.4.0, i7 8 threads, 32 Gb Ram, Gtx 970.
Thank you.

i just exported gltf, and imported again - > worked. But i am on macos and tried it on 3.5 alpha

Thanks Chris, it's something very strange, I can't find a solution.

Do you by any chance have Auto-Rig Pro installed? Try disabling it from your preferences and trying to export again.

I had the exact same issue, which was solved after disabling the Auto-Rig Pro add-on. Thanks for the tip! @molevision


text:
How do I create a heightmap from a python array of numbers?
I have a python numpy array similar to the following:
Array = ([[1, 2, 1, -1, -1, -3],
          [3, 4, 2, 1, -2, -2],
          [3, 4, 1, -1, -2, -2]])

I want to convert this to a heightmap in blender where a plane is subdivided into the equal number of rows and columns and each subdivision is displaced proportional to the numbers in the array.
Can this be done through a python script running in Blender?
Are there any other methods of creating a heightmap from a python array?

Here's a script that generates a blender image from the array, and maps it to an image texture on a displacement modifier assigned to a Plane object.
import bpy, math
import numpy as np

a = np.array([
    [1, 2, 1, -1, -1, -3],
    [3, 4, 2, 1, -2, -2],
    [3, 4, 1, -1, -2, -2]
])

# Normalize values
anorm = (a - a.min()) / (a.max() - a.min())

# Generate RGBA image from grayscale normalized array
pixels = np.dstack([anorm]*3+[np.ones(anorm.shape)])

# Generate or update image object in Blender
# Based on this answer: https://blender.stackexchange.com/a/105312/15861
height, width = anorm.shape
image_name = "dispmap.png"
if image_name not in bpy.data.images.keys():
    bpy.data.images.new(image_name, width=width, height=height, alpha=True, float_buffer=False)

outputImg  = bpy.data.images[image_name]
input_res  = int(math.sqrt(outputImg.size[0]))
np_out_img = pixels.astype( np.float16 )
outputImg.pixels = np_out_img.ravel()

# Add or get displacement modifier
plane_obj = bpy.data.objects['Plane'] # Assumes the plane object is named "Plane"
if 'Disp' not in plane_obj.modifiers:
    m = plane_obj.modifiers.new('Disp', 'DISPLACE')

m = plane_obj.modifiers["Disp"]

# Add or get displacement image texture
if not m.texture:
    t = bpy.data.textures.new('DispTex', 'IMAGE')

t = bpy.data.textures['DispTex']

# Set image texture and image
t.image = outputImg
m.texture = t

Generated height (displacement) map and resulting mesh:

Array as vertex height
Similarly to @Chris's answer if the array values are interpreted as vertex z values

Add a grid of same dimensions (unit size)
Scale such that each xy grid is square
Use foreach_get and foreach_set to quickly set the z offset without looping. (Or edit mode)

Test script.
import bpy
import numpy as np
from mathutils import Matrix

scale_factor = 2

a = np.array([
    [1, 2, 1, -1, -1, -3],
    [3, 4, 2, 1, -2, -2],
    [3, 4, 1, -1, -2, -2]
])

rows, cols = a.shape
# make the grid rows x cols blender  units
S = Matrix.Diagonal((rows - 1, cols - 1, 1, 1))
# add a grid
bpy.ops.mesh.primitive_grid_add(
        size=1,
        x_subdivisions=rows,
        y_subdivisions=cols,
        )

ob = bpy.context.object
me = ob.data
#scale it
me.transform(scale_factor * S)
# update z coord from data
coords = np.empty(rows * cols * 3)
me.vertices.foreach_get("co", coords)

x, y, z = coords.reshape(-1, 3).T

me.vertices.foreach_set(
        "co",
        np.array([x, y, a.T.ravel()]).T.ravel(),
        )

"co", RuntimeError: internal error setting the array. not sure why?

I use a grid (instead a plane, i hope that's ok).
Then i just loop over the vertices and set the vertices height from the array.
Code:
import bpy
import bmesh

bpy.ops.mesh.primitive_grid_add(x_subdivisions=5, y_subdivisions=5)
bpy.ops.object.mode_set(mode="EDIT")

Array = ([[1, 2, 1, -1, -1, -3],
          [3, 4, 2, 1, -2, -2],
          [3, 4, 1, -1, -2, -2]])

context = bpy.context

bm = bmesh.from_edit_mesh(context.edit_object.data)
# deselect all
for v in bm.verts:
    v.select = False

bm.verts.ensure_lookup_table()

for x in range(6):
    print("x",x)
    for y in range(2):
        print("y",y)
        bm.verts[y * 6 + x].co.z = Array[y][x]

Result:


text:
How do I apply different colours to an object that change depending on the z location of the object to make a contoured heightmap?
I have a heightmap of the height of terrain above and below sea level as a single object. I wish to colour it such that any part of the object that is below sea level (z<0) is coloured blue, and any part above sea level (z>0) is coloured green. How would I do this using a python script?

Hello, how do you want to apply the color ? Vertex colors ? Texture map ? Procedural shader ?

@Gorgious whichever would take the least time to execute whilst putting the change in colour at exactly z=0

https://blender.stackexchange.com/questions/5491/how-do-i-colour-a-3d-terrain-based-on-its-height

Yeah those are what I would like to do but using a python script.

... yeah initially closed as dupe, then re-opened since the question related to  python. Dupe gives examples of a material to create. There are numerous answers re adding a material with python.  Sometimes you can make no effort and get lucky, sometimes not.  Also consider accepting and or up-voting  answers to your questions that have helped or answered them.


text:
EEVEE renders blank frames
I'm trying to render an animation frame by frame in EEVEE for a personal project, this is the third shot so it has the exact same render settings as the previous 2 shots but when I hit render animation, blender either struggles to render the first frame or renders a black, empty frame. every frame. The scene has is the smallest of the three shots I've rendered so I doubt it'll be due to an image texture/ model overload, but I could be wrong!
I've searched online and tried what I could find but nothing seems to be working. TIA for any help
Here is the blender file for reference.

Just disable your hidden side wall from rendering.

i know it would be obvious. didn't expect it to be that obvious. Thanks so much! aha


text:
Graph in Graph editor too small - Animation tab
I'm currently learning blender with the donut tutorial from blender guru. In Part 4, Level 4, he's switching from the "Layout" tab to the "Animation" tab at 5:27. Here's a link to the video. Now, my problem is: the graph editor is tiny. I can see the different vertices, but the graphs are very close to each other. I've looked in the settings tab, looked after a solution on the internet (especially here), but I can't find anything that solves the problem.
Thanks for your help! I am looking forward to your answer.

just press CTRL-SPACE when hovering over the editor -> full screen

Thank you, it's now working!

you are welcome. just hit the same shortcut again, to go back to normal size. By the way -> you can do this with any panel.

For expanding the editor window aka timeline editor, just select the edge of the timeline window and move it up/down to your liking.
To enlarge timeline graphs, simply zoom in/out with the mouse wheel while hovering over the timeline editor window.
You can also hold Ctrl and use  MMB (Middle Mouse Button) to scale along a desired axis.

I found another solution myself now (Blender guru says that in his video, but a bit later): Just press pos1, also known as "Home Key". It will center at the existing keyframes.