One of my object changes color after animation rendering This is what it looks like when I rendered an image of my final work

But after I rendered animation on it, the donut's changed color.

I'm new to Blender, I'm following the tutorial on Youtube for this project.

Can someone tell me the possible solution for this? I want it to look like the first image when it is rendered in animation.

Usually blender uses the color fuchsia for indicating that textures are missing, if I remember correctly he uses a texture to the doughnut. Your texture of the doughnut must be saved in a directory and added as a image texture for your doughnut in the shader editor.


Blender freezes / hangs when importing FBX exported from Rokoko Studio I am currently trying to import an FBX that has been exported from Rokoko Studio into Blender for retargeting purposes.

The FBX exported from Rokoko Studio opens just fine in Autodesk MotionBuilder, trying to import it to Blender v2.81 or v2.90 (Alpha) causes Blender to freeze and upon clicking into the application window, Windows to tell me that the application does not respond.

I tried changing the exporter to use a different FBX version (2011, 2012, 2013, 2014 & 2016), but no matter what, Blender is unable to import it. Due to the freeze, nothing is being written to the Debug Log and importing the Unreal Mannequin FBX works just fine, so I would assume there is something wrong with the files.

But, what could it be? And is this something I can fix or is it up to Rokoko to change the way their exporter works? In a video from August 2019 they show importing a FBX into Blender 2.8, so I would have assumed there hasn't been much that has changed.

I have uploaded a couple exported files here: Download via TinyUpload

Is there something wrong with the FBX that Rokoko produces?

This is caused by the way Blender imports FBX animations. It's extremely unoptimized which can cause long and complex animations (like motion capture ones) to take hours to import. You should use the BVH format with the HumanIK skeleton in the exporter options of Rokoko Studio to export your animation. This format can be imported into Blender quickly without any issues.


Cycle through Materials with Animation Nodes I have a project where I have an object (wristband) that has six different color options. I created one Cycles material for each option having six different materials.

In order to save setup time of creating a wristband for each material, I would like to use Animation Nodes to have one wristband but be able to cycle through the six materials based on the frame number I am on. Is this possible? I am very new to Animation Nodes.

You can just add your materials to a list, get a list element based on the frame, and set that material to the object using the Object Material Output node.


Set object local axis based on face orientation I am struggling to formulate my problem exactly, so edits are welcome.

I have an object where local axis are completely off, like in this simple example. I want fix it, so  align one axis with the face normal, another with one of the edges and third perpendicular to both. I created a Custom Transform Orientation using one of the edges and it is just perfect. Can I change the local axis to match it?

The motivation behind, is that I have to position the object vertically in my scene. The object is complex, so I struggle to do it visually.

Do I need some python to do this? Any hints on how to do it?

This is not exactly a solution, but a painful workaround. If someone can provides a better answer, I will accept it.

The solution relies on two assumptions:

You can create a Custom Transform Orientation which matched your desired orientation.
You don't mind that object will be moved.

"Solution":

Create a Custom Transform Orientation. For this simple example: select the edge you want to align, press CtrlAltSpace or find it at bottom of the N-Panel.
Rotate to align custom transform to global axis. I followed this post. In short: add empty at the face center, align it to custom transform, parent object to the empty, clear the empty rotation, clear the object's parent keeping transformation, rotate 180°.
Change local axis to match the global ones. Use Apply Transformation (CtrlA)


Rotation Driven by Position - Driver Issue When Rendering My latest rig in Blender 2.8 contains a ball that is supposed to roll on the floor. I already got it working in the viewport, but only until I hit the Render Button. When rendering, Blender completely ignores that driver, leaving the ball's rotation still.

Here is how the driver of the ball's axis-angle rotation W is set up:

CTL_TranslateScale is a parent of the driven ball and is therefore responsible for the ball's translation. (Should I use a self reference instead? Could not make that one work, yet).

CTL_Master is the root of the control rig.

Any ideas? Thanks in advance!

This is a bug. The Drivers - at least in this case and at least in 2.82 - update only if the current frame is changed manually by user. If it is changed by script (which Render Animation also is) Drivers ignore it. You can check it by typing in Blender Console C.scene.frame_current = 5 - or any other frame number - and you'll see, that your object rotation stays unchanged though your frame has changed. More to say, for example if you are at the frame 5, manually change frame to 4 and than back to 5 - the result on the frame 5 will be different than if you would change frame to 6 and than back to 5.

Blender Drivers are buggy. I'd suggest to use Animation Nodes addon instead, it works more stable in general.


VSE render black as transparent July 5th lots of fireworks vids. Using VSE I would like to overlay some of them on each other.  So convert all the black in the scene to transparent then render it out and bring the .png files back in and over lap the fireworks on top of each other...
Using nodes in the Compositor.
I have seen some tutorials added the Movie and Composite output setup a colorramp off the clip to the AlphaOver node Loc; with Image1 full transparent and in image two the movie clip image.
The viewer shows the fireworks on transparent background.
output .png ; for 24 frames; click animate and all the png rendered with black where the viewer shows transparent.. no alpha channel in rendered output.

I'm a bit confused here, did you want to composite the images using the VSE or the compositor? No need to do it twice, either section is capable of doing what you're asking.

If the background is completely black you don't need to change the alpha.
A common way of compositing images with dark backgrounds is to mix them via luma keying.
You can try to add alpha channels, but an easier way for this application would be to just add the clips.

In the VSE this can be done by selecting the clips above your base clip and setting the blend mode to add instead of cross.

In the node editor add a color->mix node and set the mode to add.
Hope that helps.


Non destructive curve to mesh ? i want to join all thoses curves with faces in a non destructive way , to form an organic building.
so when i join them with faces i want to still have the possibility to ajust thoses curves.
is it possible to do that ?

It's possible when Surface> NURBS Curves or NURBS Circles are used. Add and select them all and join with Ctrl+J in Object Mode. Next go to Edit Mode and press A followed by F. In edit mode you can stretch your shape to the endpoints and edit it. Once done,you may use Alt+C to convert object to mesh. NB: the number of control points must be the same for each element.


Blender ruins model/animation when switching actions Any ideas on how to fix this bug/feature of Blender? How can something so simple like selecting another action mess with my work?!

Here is the video: https://youtu.be/YE8sNfaVu6o
And the .blend file: http://www.filedropper.com/mccree28

It's not a bug, for the action called TestAction.001 you can see that a LocRotScale track has been created, it means that, additionally to the keyframes you've created for the bones, you've created some keyframes for the whole armature in Object mode. And if you unfold this track you'll see that you have Scale keyframes as well as Location and Rotation keyframes. So delete the whole track, then, as it has changed the size of your armature when you've selected it in the Dopesheet, just select the armature and altS to reset the scale.


I cant get back to edit my model, how do i do this? i am unable to get out of this to get back to my model

If you want to get back to the 3D view click the bottom left icon to "3D view" as Paul suggested if you want to see the the image again change the "paint" drop down to "View"


How to animate object target positions while respecting rigid body collisions? I would like to have about 20 shapes and animate the target position for those objects. The objects would try to reach those positions, but colliding with each other (instead of going through each other as ghosts).

Is that somehow possible, even if it involves scripting?

So far I've only figured out I can have a dummy with an attractive force, and then all objects try to reach that one dummy. But how could I have one target dummy per object?

Reading old posts I get the impression that one could have forces that are only active in one render layer. Using View Layers in Blender 2.8 doesn't seem to have that effect: the force seems to apply to objects in other view layers too.

The solution, indicated by Rich Sedman (thank you!), is to use Rigid Body Constraints with Generic Springs.

Create 3 cubes
Add Rigid Body to each cube
Create 3 spheres (will act as targets)
Add Rigid Body (passive) to each sphere. Mark it as animated and place it in Collections 2 to avoid colliding with the boxes.
Add Rigid Body Constraint to each sphere, type Generic Spring. Activate Linear limits in all 3 axes. For Objects set First to the sphere itself, Second to the corresponding cube. Set Stiffness and Damping for Springs > Angular and Linear according to taste.
Put each sphere centered in a cube. If you place the cube under the sphere, it will be hanging. When you animate the sphere position the cube will follow, hanging under it. I wanted to avoid that, so it doesn't feel like marionettes.
Animate the sphere positions so they pass near other spheres. The Cubes will collide and avoid each other.
Disable gravity (optional).

What's missing for me is to figure out the right values for the constraints so the motion feels right.


how to make the separated vertex is the active object after separation with python? I am trying to make a simple script but I have a problem,the problem is when I separate some vertex from my mesh and go to object mode the active object is the unselected vertex,so how to make the separated vertex is the active object after separation with python?

Maybe this will lead you to the solution:

so = bpy.context.scene.objects
so.active = o2
for obj in so:
    obj.select = (obj==o2)


how to combine two meshes without ugly overlapping? I tried a few things but didn`t get it working. how to combine two meshes without ugly overlapping?

I think I would use a booline, then relax the edges of the cut where the meshes join until they are smooth and clean looking.


Mirror modifier deforms mesh Whenever I apply mirror modifier to my mesh the mirrored part becomes deformed and wrinkled as shown in the image. I exported the mesh as obj and opened it in another window and tried to mirror it again but the same thing still happens. How can I fix this?
Thanks in advance

.blend file:

I believe that you must Apply the modifier. To do this, Click the Apply button. When I downloaded the file, I did not see any disturbances in rendered view. If you are still having them, consider going to File > External Data and check Automatically Pack Into .blend before uploading. This will allow me to view the file with the textures. I will update my answer as needed.


Blender Separating vertices on object when restarting Blender Summary:
I am having this extreme problem with Blender where I have this character I am creating. The character uses a mirror modifier, and I am using Blender 2.83. I saved my file and restarted Blender and when I restarted Blender, some vertices and edges were not together and made it's own separate object.
What I  Tried:
I tried everything with all joining of vertices with using the F key and all. I cannot find any answer on the web about this. I am just learning Blender, but I know that everything was together and I know I didn't press anything that could cause it so I desperately need help with this.
Image Illustrations

Image of what is should look like together:
Isn't actually together but what it should look like together.
This image below shows it together and should be connected with the whole surrounding, it worked before I restarted Blender.

Image when it is separated:
But once I restarted blender, it wasn't together like it is suppose to. I had trouble selecting the whole separate object but it still proves but point on how difficult it is when it is separate.

Also, while I already have this question written, how do I hide and show that selector mover thing, the green, red, and blue arrows one, I accidentally shown it but don't know how to hide it again. I do have some uses for it in the future hopefully but like to hide it in the mean time so it's out of the way.

I believe I found the answer to this. It took a while but I think I finally found it. In Blender 2.8, you will select everything by pressing the "A" button and then you will go to the Mesh option on the nav bar on the 3D screen and hover over the merge option and then click by distance. So if anyone has this problem then this should help. If my answer seem to be confusion then here is a screenshot.


Using Boolean Wraps texture awkwardly I added textures to a minecraft character, but I realized I forgot the holes for the eyes. So I used a boolean modifier to make the holes, but it was unsuccessful. The holes appear except the texture wrap becomes messy and doesn't go around my character properly.

Without Boolean modifier

With Boolean modifier

I don't know why your head object is acting so strangely with the Boolean modifier. The proper setting for the Boolean is "Intersect" in order to get the cubes to cut holes in the head:

However, I don't know why the body disappears. So, here is a work-around:

First, delete the back vertices of the cubes you're going to use to cut out the eye holes so they are just rectangles, like this:

Then go into Front Ortho view (front view with Numpad 1, ortho view with Numpad 5):

Now first select the rectangles, then hold down SHIFT and also select the player, so that both are selected together.
Now, press TAB to go into Edit mode, then in the Tools panel, in the Tools tab, click on Knife Project:

This will cut holes in the face of the player.
Now select the vertices of the newly-made eye sockets and extrude them back along the Y axis:

Now select the back-most vertices of one eye socket and then press F to make a face there. Then do the same thing for the other eye socket:


How can i control the extrude size of a curve while creating it? i need to make a sightly smaller subdivission on my curve because i need to reach a part of the 3D enviroment without having to move the object, so i use extrude (pressing E) but the curve created is too long and the shape is lost.
Is there any way i can control the curve size while pressing E?

When creating a curve you have some control using the parameters on the tool bar (press T to make it visible) or revel the tool options bypressing F6

Once a Curve has been created it can be manipulated with precision using the Transform control panels. (Press N to make it visible)


How to make a advanced torso RIG with I'm learning rigging and most of the rig systems I found pretty easy to reproduce by watching videos and demos. I understand local\global\parent coordinates even creating complex bone based facial rigs, but...

I found realy dificult to create a more advanced rig for a torso.
something like that: https://youtu.be/im5XhbpGXjw
and even do not have ways to think how to describe this kind of rig.

how this hinge and pivot slide works?

Please, don't tell me to use the rigfy addon or blenrig, this is not my goal.
I'm trying to learn how does this stuff work, think will be usefull in future.

That looks the Sintel rig from Blender Foundation Open Movie Durian Project  Sintel.

It is open content freely available to anyone, you can use it study it, modify it and redistribute it as you see fit, along with all assets and production files from the movie.

You can access it by subscribing to the Blender Cloud just like any of the content from all other Blender Foundation Open Projects which will cost you a small symbolic monthly fee.

While doing so you will also be happy to know you are helping the Blender foundation monetarily, and funding Blender development that benefits everyone.


Data Transfer Blend not smooth I'm following a tutorial how to blend 2 object and get a smooth transition using the data transfer (after Shrinkwrapping my object), but I still seem to be getting the hard outline. Any ideas why this is not smooth?

Reference for the tutorial is at 4min to 5min.

https://www.youtube.com/watch?v=luFz5gzvM9s

And here is my result which I'm getting.

Your reference video illustrates a way of applying 3D decals to curved surfaces, filleting and concealing the junctions between the decals and the surface.

The way I went with your example involved quite a bit of incremental adjustment - I'll just try to cover the main points:

Sanitize the mesh.  Your decal had a lot of duplicate faces and vertices, normals pointing the wrong way.. possibly from abandoned extrusions / solidifies? To locate errors, H hide some faces in Edit Mode to check for duplicate or internal faces, jiggle some vertices around.. Use Overlays in the 3D view to display normals, face orientation. Delete surplus faces and AltM merge vertices by distance to leave yourself with a single skin.
Consider the method. The reference method is well-suited to small decals, in the scale of the curvature of the substrate...

...asking the Shrinkwrap modifier to cover the gap at the extremes, here, is pushing it. The parts of the decal which you'd like to spread on the surface will wind up piled on top of one another. Fixes for this might be to model the decal with a curvature more similar to the substrate, or 'pre-bend' the whole decal with a Lattice modifier, (the lattice shrink-wrapped to the surface) before assigning the other modifiers... but I guess that's what the reference was trying to avoid.

The decal in the reference is modeled with a skirt, part of which will conform to the surface closely,and  become the fillet after deformation, so I added one to yours.

Adapt the method I found that with such a large decal, 2 vertex groups helped. One to deform the mesh with the shrink-wrap..

and a smaller one to pick up the normals from the sphere...

The vertex-groups can be edited 'live', under the influence of the modifiers by assigning edge-loops with weights in the decal's Data > Vertex Groups panel, so you can see what they are doing.

This result is sort of getting there..

.. but I think things would be easier if you bent the decal as a whole, preparatory to making the invisible fillet.


How to get all faces based on a certain angle of their normals? I would like to create a list of faces/polygons based on the angle of each corresponding normal. I've tried something like board.data.polygons[0].normal > 0, but that doesn't seem to work.

Question: How to pick the normals that are pointing downwards (-z axis) and append their associated faces/polygons to a new list?

Use Vector.angle(Vector)

To get all normals that are within 89 degrees of the -z axis in local space (down = Vector((0, 0, -1)) use face.normal.angle(down) which calculates the angle between the face normal and the local vector pointing down.

import bpy
from math import radians
from mathutils import Vector
context = bpy.context
obj = context.object
me = obj.data
down = Vector((0, 0, -1)) #  -z axis.
test_angle = radians(89)
# list all faces with normal less than 89 degrees to down
faces = [f for f in me.polygons
        if f.normal.angle(down) < test_angle]

print(faces)

Change the test_angle value to suit.


Is a quad in a triangular shape still bad for topology? I am trying to make an anime style model with a good topology but I keep running into quads (faces with 4 vertices). If I tried to make it square it would really mess up the model. The model is supposed to be for animations. I have the quads on the cheeks of the mesh and I do plan on rigging the face.

A good trig or quad topology depends on what you intend to use it for.
If you want to use blender modeling function (such as subsurf, snooth and other deformations) it is better to use quad since trig can make ugly/buggy result.

Some publications say trig can be usefull in animation or game but it depend what software you use. But usually quad is  better.


Hard time getting my coiled thread like 'painting' to look right I'm an industrial designer and I'm trying to make 3D recreations of my work in Blender, I mainly use a technique that consists in coiling threads over wood surfaces as you can see here:

For a closer look at the threads see here:

The thing is that I already got the 3D model basically done with very accurate dimensions, as you can see here:

However, I'm having a really hard time getting the threaded textures to look right, I already made a texture taken directly from a photo of my work

But the results I'm getting aren't the best.

What am I doing wrong? What's the best approach to simulate those materials in Blender? Should I stick to making (better) textures or there's a good way to make realistic procedural threads like the ones used in my work?
I'll share a photo of my Texture Nodes

and here are the rest of the nodes used for the material

(The nodes called Patterns and Fabric are from a tutorial that teaches how to make fabric-like materials).
I won't be using AutoCAD or any other industrial design software since I'm looking to do some cinematic animations/effects with the models that are more easily achievable with Blender (2.82 btw).

For those interested, I was able to accomplish this material with something like this.

Although it looks congested, the concept is rather simple - I used wave textures to mainly just compose a bunch of different small line maps of different widths and rotations and adding them together. I probably could have done this more efficiently, but I was just prototyping. I also made some small color lines as well, because it looks like the background is disturbed by some other colors in addition to the black. After that, it was just a matter of mixing them together.

To get a realistic thread look, I combined 2 more wave textures, one sharper and at an angle to the other to make a rope like shape.

I then mixed this pattern with the original horizontal lines to get that wrapped-thread look. Afterwards, I mixed this combo with another wave texture with a smaller scale, which I used to form the large stripes.

For the background, I simply used a gradient texture with aqua colors, but I also used a slightly distorted noise texture to add some yellow as well. I mixed these together using a diagonal gradient as a factor, because in the image you have it looks like the yellowish tinge is mostly in the top left corner areas.

Lastly I made some normal and height information from a black and white version of the small stripe mix. I kept the values very low to give a subtle effect. The final result looks like this:

I made 2 versions of the material - one of them is a simple version using an emission texture to make the colors pop (done entirely from object coordinates), whereas the other one I aimed for a complex, but realistic thread like art look which is more costly because of the displacement, but looks more realistic (done mostly with generated coordinates).
I'll also upload the .blend file. It is here -
Happy Shading!


Textures are missing, but only when I render I was trying to make an animation but for some reason when I try to render it or just go into render view the materials are all pink.
I seen other posts about a similar problem of the textures not being linked to the file or whatever but that's not the issue, the textures appear when I'm in material view. I have it set to render using CPU in my user preferences. This is happening for all my projects in Cycles render. The few projects that I made in Blender render when I first began do not have this problem.

You might move your textures or renamed it
So u just replace it in same location or use external data/find missing files feature
When u want to  email it just some one just pack all textures by this feature external data/pack all files


Bake Mesh Sequence Cache to Keyframes or Shape Keys? I have a Mesh Sequence Cache modifier that references a .abc file. Is there any way I could bake the modifiers' motion to the object so it doesn't have to reference the .abc file?
I'm doing this so that I can give the .blend file to SheepIt for rendering.

Realized I can't do this, keyframes won't work for geometry and shape keys require each frame to have the same polycount.


How to mix 2 keying nodes in the compositor to keep the alpha channel from both? How do I mix two keys in the compositor to form an image that uses both the keyed out parts?  Movie Clip node > Keying node > Viewer = green screen removed; then same Movie Clip node > different Keying node > Viewer = blue markers removed.  How do I combine these?  I am trying to remove the background, and isolate the people in the foreground and have an alpha channel background.

edit: I don't really know what to search for, can anyone maybe share a link or just tell me the words to search for in Google?

Do I need to render out 1, then go back and re-render out the second?  I feel like there is a way, similar to render layers, but with images/movies, sorry if this doesn't make sense, I will edit it when I can.

put one into the other as so - that way each node changes the previous


Why does part of my model's texture appear purple? In the rendered viewport the model appears as it should, however, when I actually render it, part of the texture appears purple, which normally means I'm missing a texture but only part of the texture is purple, which doesn't make any sense. Also, all the textures are in the directories that they should be, I don't see what the issue is.
Ive attached the .blend file here:

And the textures here:

I find the issue to my problem, I had a second object that I had hidden in the 3d view, and then forgot about. This caused it to appear in the render image, and the hidden object was using a texture that I had deleted causing it to be purple. It was also in the same place as the object that was normal, causing the overlapped portion to appear purple.


Is there a way to find all vertices mapped to a specific UV image I have imported a VRML from an N64 emulator.  Everything looks correct on the model  but each face in the model has a different texture  i.e. 7C764073_c.bmp, 7C764073_c.bmp.001, 7C764073_c.bmp.002 etc.  When I select an image in the UV editor  is there a way to select the vertices that are mapped to that specific image?

A slight variation of this answer, if you paste the following script into blenders python console you will get a list of what face uses which material and image.

import bpy

for obj in bpy.context.scene.objects:
    if obj.type == 'MESH':
        for f in obj.data.polygons:
            mat = obj.material_slots[f.material_index].material
            if mat and mat.use_nodes:
                for n in mat.node_tree.nodes:
                    if n.type == 'TEX_IMAGE':
                        print('Face', f.index, 'uses', n.image.name, 'from', mat.name)

If you are using 2.80, while in edit mode enable indices in the overlays menu.

Now in face select mode, when you select a face you will see the face index. Match this with the face index from the script to see what image it uses.

If you are using 2.7x, first enter bpy.app.debug=True in the python console, then you will find the indices option under Mesh Display, everything else is the same.


How to render what I see in the texture view I apologize for what I'm sure is an incredibly stupid question. I've just picked up Blender this weekend, wanting to map a 2d texture onto a plane and manipulate it with sculpt mode. I got it roughly where I want it, but when I go to render, the render view displays with a blown out, nearly entirely white image. What I see in texture view is what I'd like to export, however, so if anyone knows how to do that, or how to fix what's happening in the render view I'd appreciate it.

Thanks!

What you will want to do is an OpenGL render. In order to this go into your camera view by pressing 0 on your numpad, then in the top Info panel click on Render, then click on OpenGL Render Image. You can also do this by clicking on the little camera icon at the bottom of the 3d view panel.

Hope this helps.

-Tom


Navigation working in Object mode but not Edit mode? Hi I've got left mouse navigation working in object mode but in edit mode it doesn't work.

Alt Left - Rotate
Shift Alt Left - Pan
Ctrl Alt Left - Zoom

Also this only breaks when using left mouse selection

Any ideas why it would work in Object mode but not in edit mode?

Thanks,
Vaughan

Yes, this happens when you use "LEFT" click selection (not the default).

the shortcuts you used above need the "emulate 3 button mouse" setting enabled... which you can do with "RIGHT" click selection:

but as soon as yu enable "LEFT" click selection, the setting is unavailable (greyed), and thus those shortcuts doesn't work anymore

I guess you're on Windows, and I suggest you to use a little utility (called X-mouse, or a similar one) I suggested in another answer, here;

Can't navigate in the 3d view

With that, you can have an automatic setup just for Blender mouse usage, and your 3 button mouse will use the middle button as it is intended by Blender, so you don't need the "emulate 3 button mouse" setting, and thus you don't need the shortcuts either...

hth


Where is the 'selected to active' bake option in new version? Where is the 'selected to active' bake option in new 2.8 version?
There is 'bake from multires' now, but options are only normals and displacement, and I need to bake color

I'm just posting this so I can post this pic. This is taken from blender 2.83 in Cycles. If you're setup doesn't look like this, there's likely something wrong with your version of blender.


Generate multiple renders of same scene, each at a different resolution? I would like to generate several renders of a static scene, each render being a different size (eg 1024x1024, 512x512 etc). Other than the size, each render will be identical.

Is there a way of doing this using, say, the command line, or a script? I am currently doing this by manually changing the dimensions within the render panel every time, but I was wondering if there's a quicker way.

I am using Blender Internal in this specific instance.

Many thanks

You could also render the maximum size and then plug some Scale nodes into the compositor followed by File Output nodes. That way you only have to render once, and the smaller resolutions will be generated by the big one. (set the Scale node to Absolute and choose the size in the X and Y fields below)


How to rotate UV and preserve the correct aspect ratio? Based on this answer,
Rotate UV by specific angle e.g. 30deg in Python script in backgroud mode

you can do a rotation of the UV mapping, then enter the rotation angle, so far everything is ok.
The problem arises when working with images of rectangular and non-square proportions.
This function will not take into account the appearance of this image, so the rotation will deform the image.
Obviously this does not happen in the uv editor.
It seems that this can be compensated for by obtaining the aspect ratio of the image. But I think it is an incorrect or inconvenient practice.
The question is therefore whether it is possible to obtain a correct UV rotation without knowing the aspect ratio of the image.
Here I attach the .blend example of the problem

Clearly the UV editor uses the aspect ratio.

Closing the image in the UV editor on LHS demonstrates that the UV editor is using the aspect ratio of the image when rotating.  The LHS rotation result is equivalent to running script result in question, or with unit aspect ratio below.
Instead of our normal 2D rotation matrix,
$$R=\left[
\begin{array}{ccc}
 \cos \theta & \sin \theta& 0 \\
 -\sin\theta & \cos\theta & 0 \\
 0 & 0 & 1 \\
\end{array}
\right]$$
can allow for a non uniform aspect ratio $\rho$
$$R=\left[
\begin{array}{ccc}
 \cos \theta & \dfrac{\sin \theta}{\rho } & 0 \\
 -\rho  \sin\theta & \cos \theta& 0 \\
 0 & 0 & 1 \\
\end{array}
\right]$$
Here is a an object mode script using numpy and the $XY$ dimension of the object (for example, if imported using image as planes) to calculate $\rho$ which will emulate the rotation as shown on RHS of gif.  Setting p = 1 will be same as shown on LHS.
import bpy
from mathutils import Matrix, Vector
import numpy as np

ob = bpy.context.object
me = ob.data
uvlayer = me.uv_layers.active

pivot = Vector((0.5, 0.5))
angle = np.radians(30)
# aspect ratio
p = ob.dimensions.y / ob.dimensions.x
# aspect rotate
R = Matrix((
            (np.cos(angle), np.sin(angle) / p),
            (-p * np.sin(angle), np.cos(angle)),
        ))

uvs = np.empty(2 * len(me.loops))
uvlayer.data.foreach_get("uv", uvs)

# shear rotate about origin, translate to pivot
uvs = np.dot(
        uvs.reshape((-1, 2)) - pivot,
        R) + pivot
# write the new UV's back
uvlayer.data.foreach_set("uv", uvs.ravel())
# update mesh to display changes.
me.update()

Result on image imported from "Images as Planes" addon. Note positive rotation is clockwise, where-as blender uses CCW (simply change sign of angle to change)


Why does the wire-frame material fades across the object? Why does the wire-frame material fades across the object?

Here is what I did - I created a new material and I selected on "Wire" and I made it shadeless. Then, I created a new material and assigned the new material on the on the object. However, doing it that way, it allows me to render both materials - "Wire" and "Surface". Then I get a fading result like this -

But I want all of the edges to be shown, not a fading result. How can I make that?

Here is the blend file if anybody wants to check it out -
http://www.pasteall.org/blend/31021

Enable Z transparency and increase the Z offset:


How to align local coordinate with global axis? I want to know if there is a way to align the local axis of an object to its global axis, without actually rotating the object. Please help me out, thanks in advance !!

Press CtrlA to bring up the Apply object Transformation menu and select Rotation.

From the blender manual:

  This will make Blender consider the current rotation to be equivalent to 0 degrees in each plane i.e. the selection will not rotated, the current rotation will be considered to be the “default rotation”


Where did the Hidden Wire feature go in Blender 2.78? I don't see mention anywhere of the removal of the Hidden Wire feature but no matter what I do I no longer see the Hidden Wire option is the Shading Panel of the Properties Shelf (N). Does anyone know where it is or how to get it working? I would like to filter out the backfacing polygons while retopologizing.

Here you have two pictures of the torus in Edit Mode. Note the button I've pointed out with the mouse. Is that what you are looking for?
Or are you looking for "hidden wire" checkbox on the properties panel, which usually shows on the right side of 3d view? In solid mode, there it is.


Hide part of object during animation I am animating the opening of a shutter door. I don't want to deform this door like in real life, just move it on the Z axis.

How would I mask or hide the part that will obviously stick through the roof?

Use some transparent object and make the boolean difference with the door.

Modifier setup on right below:

Alternatively, if for instance the boolean fails, you can modify the door material so that everything above an empty is set transparent:

The node setting compares the empty position (object texture coordinates, so one location) to the correspondant location on the object surface (also one location). If the Z part of these locations are showing that the door is upper the empty, alpha is set to zero.


Texture also applying to separated object I am working on creating a hammer in Blender, but I am having a problem. I separated the hammer and the handle into two separate objects, but when I apply textures to one of the items, it applies the texture to both objects. I used P and then selection to separate the two pieces.

You still have the same material on both objects. You can create a new material, if you need an entirely different material.

Or click on the plus button, to make a new material from the current material. Then there will be two separate materials for your two objects.
Documentation about materials.


Cutting the face it create extra geometry I have a simple object and i want to cut that object with the cylinder and im getting extra geometry. a file attached to know more my problem

its because the boolean operator works only on volumetric meshes.
say tube and cube, but not tube and plane. a plane is flat.

also sometimes it goes wrong because you think the shape is 3d but its not some flaw, resulting in a non watertight shape.

in your case you might apply a solidify modifier to the plane and then go on with what you did. (you need to apply it, not only add the modifier).

happy blending.


How can I make an object spin without slowing down? I want to make an object spin without slowing down when animation is playing again.

In the graph editor, hit T and select Linear interpolation


How to join multiple separate faces into one mesh I imported a model into Blender and all faces are separate. Nothing is connected together except the three vertices of each triangle. Is there any way to join all of the triangular faces at once in a logical manner? This is the model with one face separate for demonstration purposes.

Use A once or twice while in edit mode to select all faces (will be outlined in orange, then key W and click on Remove Doubles from the menu that appears.


Triangulation using X, Y, Z data file to create an elevation model I have a raster based height map, which I can convert to X,Y,Z heights, i.e. I can get a CSV (Comma Separated Value) file, which has X, Y and Z values.

Since it is a raster, the sampling of the X,Y,Z values would be uniform. Can I create a python script that would create a rectangular mesh with the same resolution as the raster map, and then I modify the Z-coordinate of the vertices from the height map?

Edit: Coding developed using GDAL

With the help of @zelfii in one of the answers here, I have developed a code, which can read the GeoTIFF raster data (SRTM based elevation model) and can create a mesh. However, I am facing some memory problems (Blender is taking too long to process the data)

The size of the raster in question is 4500 x 4500 (approximately).

import bpy
from osgeo import gdal
from gdalconst import *
from math import floor
import easygui

def getFacetIndex(c, r, cols):
    return (c + r * cols)

def getFaceVertexList(geoData):
    faces = []
    vertices = []

    cols = geoData.RasterXSize
    rows = geoData.RasterYSize
    transform = geoData.GetGeoTransform()
    xOrigin = transform[0]
    yOrigin = transform[1]
    pixelWidth = transform[1]
    pixelHeight = transform[5]

    band = geoData.GetRasterBand(1)

    verts_per_side_x = cols

    for i in range(cols * rows):
        x = (i % (cols))
        y = floor(i / cols)

        level = x + (y * verts_per_side_x)
        idx1 = level
        idx2 = level + 1
        idx3 = level + verts_per_side_x + 1
        idx4 = level + verts_per_side_x
        if (x < cols - 1) & (y < rows - 1):
            faces.append([idx1, idx2, idx3, idx4])

        xc = xOrigin + pixelWidth * x;
        yc = yOrigin + pixelHeight * y;
        data = band.ReadAsArray(x,y,1,1)
        zc = data[0,0]
        if (zc <= 0):
            zc = 340
        vertices.append((xc, yc, zc))

    return vertices, faces

def generate(image_name, geometry_name):
    theData = gdal.Open(image_name, GA_ReadOnly)
    verts, faces = getFaceVertexList(theData) #

    mesh = bpy.data.meshes.new(geometry_name + "_mesh")
    mesh.from_pydata(verts, [], faces)
    mesh.update()

    obj = bpy.data.objects.new(geometry_name, mesh)
    bpy.context.scene.objects.link(obj)
    obj.select = True
    obj.show_bounds = True

#open the file dialog
theFile = easygui.fileopenbox()
#open the GDAL file
gdal.AllRegister()

generate(theFile, "theModel")

raster to csv to 3d surface

in a CSV all you need to provide are the z-heights per column / row. Decide on a formula to convert pixel intensity (RGB) to the z-height. You do not need to specify x,y components associated with the z-height, because they are implied by the position of the z value in the csv row/column.

At most you need to provide the spread distance between rows and columns, once. Given you are working from a raster image, and assuming the pixels are square, usually the spread_x and spread_y are the same value.

raster direct to 3d surface

If you can import the raster as a png or other supported file format, it is possible to convert straight from the image to a mesh..

import bpy
from math import floor

scalar_z = 2.3    #  amplification in z direction
scalar_xy = 1.0   #  amplification in xy

def generate_face_keys(num_x, num_y):
    faces = []
    verts_per_side_x = num_x

    for i in range((num_x - 1) * (num_y - 1)):
        x = (i % (num_x - 1))
        y = floor(i / (num_x - 1))

        level = x + (y * verts_per_side_x)
        idx1 = level
        idx2 = level + 1
        idx3 = level + verts_per_side_x + 1
        idx4 = level + verts_per_side_x
        faces.append([idx1, idx2, idx3, idx4])

    return faces

def geometry_function(image_name):
    img = bpy.data.images[image_name]
    num_x = w = img_width = img.size[0]
    num_y = h = img_height = img.size[1]

    # work on copy only
    pxls = img.pixels[:]
    num_pixels = int(len(pxls) / 4)

    verts = []
    add_vertex = verts.append

    # generator expression
    gen_obj = (i for i in pxls)

    for idx in range(num_pixels):
        y = int(idx / w) * scalar_xy
        x = (idx % w) * scalar_xy
        r = next(gen_obj)
        g = next(gen_obj)
        b = next(gen_obj)
        a = next(gen_obj)

        # height-map, would be grayscale, so z can be set to r*scalar
        z = r * scalar_z
        add_vertex((x, y, z))

    faces = generate_face_keys(num_x, num_y)
    return verts, faces

def generate(func, image_name, geometry_name):
    verts, faces = func(image_name)

    mesh = bpy.data.meshes.new(geometry_name + "_mesh")
    mesh.from_pydata(verts, [], faces)
    mesh.update()

    obj = bpy.data.objects.new(geometry_name, mesh)
    bpy.context.scene.objects.link(obj)
    obj.select = True
    obj.show_bounds = True

generate(geometry_function, "wvb_flat_2b.png", "3d_Surface_Object")

produces:


Python: Low level apply rotation to an object How to apply rotation directly to an object in Python (not BGE, not bpy.ops...)?

import bpy
import mathutils
from mathutils import*

obj = bpy.context.active_object
obj.rotation_euler = Vector([0, 0, 45])

#obj.apply_rotation
#Apply rotation like CTRL+A -> Rotation

Thanks!

I need a method for an object that's been already rotated like in my example code.

To apply transformation really low-level, you should probably set the object's matrix directly and avoid bpy.ops.object.transform_apply() entirely:

import bpy
from math import radians
from mathutils import Euler, Matrix

euler = Euler(map(radians, (0, 0, 45)), 'XYZ')

ob = bpy.context.object

loc, rot, scale = ob.matrix_world.decompose()

smat = Matrix()
for i in range(3):
    smat[i][i] = scale[i]

mat = Matrix.Translation(loc) * euler.to_matrix().to_4x4() * smat

ob.matrix_world = mat

Change the last line to ob.matrix_local = ob.matrix_parent_inverse * mat if you want to set a rotation of 0°, 0°, 45° (as seen in Object tab) even if the object is parented.

The code might need further adjustments if drivers or modifiers are involved, non-uniform scaling in combination with parenting does not seems to work fine however.


Why do I have a strange kink at the edges of the tiles? I'm using Blender Render, a 90° FOV Camera. My Tiles are 512x512.

But when rendering, there is something strange happening at the edges of the tiles. Does anybody know something about it?

Ah, i found the problem myself!

I set the camera to Panoramic instead of Perspective

Now I changed it to Perspektive and the edges are gone.


How can I populate a model with smaller models? My mission here is to use this Atlas model as a rough container of lego figurines. There are at least two sub-objectives that need to be accomplished:

Fill Atlas object with particles represented by the figurines and then remove container.
Animate removal of container so that the figurines may all fall to the floor.
Generate random assortment of figurines and/or material properties (maybe just color) to populate the container.

Really not sure how to start, but I was thinking maybe there was a way to automate this via Python that will allow me to quickly form a 3d array of these duplicates and apply a random color transformation with each iteration. Alternatively, I thought of iterating through the coordinates of the Atlas and inserting a Lego object with appropriate spacing. If there is a simpler method, pleeease advise! I know filling the container is different from just stacking as an array and will probably affect the physics of the animation. Thank you for any feedback!

Take the Atlas figure, duplicate and apply a displace modifier that makes it smaller (just by a little bit). Use this to spawn particles from source: volume. This prevents any minifigs from sticking out through Atlas. This image shows roughly how the shape would change with a displace modifier. It would not be hollowed out like with a solidify modifier.

Create a particle system. Under render options choose render as object. Select the minifig as the object to render. Play around with particle scale and rotation until it looks good. Apply the particle system under modifiers. Now you have a whole bunch of minifigs filling Atlas.
Select all of the minifigs. Then Object>Rigid Body>Add Active. Now the minifigs will bounce off of each other and whatever objects you set as passive rigid bodies.
Under the material for the minifigs, add an object info node. Use the "random" input from this into a hue/saturation node in order to randomly alter the color of each individual minifig.


Locking a vertex group from modification In a mesh there is a group of vertices which should not move after being positioned once. I would like to find a way to lock them in place for the whole duration of the project.

Currently I 'lock' them by hiding them and then sculpting. I imagine it is possible also to create shape keys for the vertices. Or I could write a script which would save position of the vertices.

Is there a better way to do it?

I think you outlined most of the the good ways, but here is another option:
Mask modifier:
You could try using the Mask modifier:

Add a mask modifier, select your vertex group and enable Invert so the vertex group is hidden.

Enable Edit mode visibility and Apply to edit cage so that there is no way to select the vertex group elements in edit mode:

This will basically function like hiding geometry, except it gives more control and does not interfere with normal hiding.
Note that it does not work in sculpt mode (hidden geometry will still be sculpted)
Shape keys:
However, I Think Shape keys is the way to go as it works for both modeling and sculpting.
To set this up:

Add vertex group of all the geometry to want to modify (excluding the geometry you want to lock)

Add two shape keys, a Basis and a shape key. Set the Value of the shape key to 1 and do your modeling sculpting etc.

Set the Blend group to your "modifiable" group. Now only the modifiable geometry will be moved to the new shapekey position, the rest will remain in the Basis position:


How do i use the screw tool in blender 2.8 When I use the screw tool the same way that I do in 2.79 in blender 2.8, it always shows the wrong invalid/unset axis.

I don't know if something of screw has changed in 2.8.

It seems to work the same as before, even though it is not as of yet listed in any menus, so you need to enter "screw" into the Search Menu to run it.

You can use open or closed geometry in it. The lose edge on the right side is a guide vector that the algorithm uses to guide the direction and length of the extrusion. The structures created by the guide are supposed to be deleted manually after the operation.

The 3D Cursors location is where the transforms pivot gets placed

You can override these settings from the Operator Panel (F6)

I do get the error you mentioned, when I set the axis values to 0, but the operation still does its job afterwards.


zoom to an object without using the NumPad I zoom all the time for many situations, but most of the time the zoom goes to nowhere and I have to adjust all the time to get the right spot. I have tried ShiftB which works ok only sometimes.
I can press NumPad because I'm on my laptop, and I can't find a similar way.

What I need the best is to select an object from my scene list, then click for a zoom  that will bring me the right zoom for that object.
Is there a handy way to do this on a laptop?
Also what would be handy is a zoom to center, I could not find a laptop solution for this.

You could use the menu item 3D view header View > View Selected, that is the same command as pressing NumPad .

AltF will center the view depth over whatever the mouse hovering on.

Home will zoom and center the view so all objects are in view.

Possibly the best solution for you is in the User Preferences under the Interface tab then check the two boxes for Auto Depth and Rotate Around Selection. That will make the viewport rotate around whatever object(s) is selected.

Also in the user preferences under the Input tab you could try enabling the Emulate NumPad check box. That will make the regular 1-0 keys act like the NumPad.


Increase power of emitters on objects? Is there a way to change the power of an emitter hitting a certain object? For example, if I had an emitter object with strength 5, and nearby had several other objects, could I set one of those nearby objects to treat light rays hitting it as twice as powerful, so that it would be hit for strength 10 while leaving the emitter as strength 5 for the rest of the objects?

The closest thing I can think of is doubling the entire shader of the object you want to be more illuminated.  This is done by adding the shader to itself.  To do this plug plug your shader nodes into both sockets of an add shader at the very end of the node tree.

It produces the following result.  The center ball uses the above technique while the other two use just the node group.

The disadvantage of this is that it doubles all rays hitting the object, not just ones from a specific emitter.

See this post and this post for more on the add shader node.


My Donut Will Not Bake I am new to blender but I spent hours watching tutorials online on baking. I created myself a donut and textured it however, when I press A to select all, it only selects the icing which is a separate mesh from the donut itself. How do I bake the entire donut and not just the icing? PROBLEM: When I try to select the entire donut in edit mode, it only selects the icing.

Donut:

https://imgur.com/a/0RCtRlP

Blender:

 https://imgur.com/a/ySSqfwv

Please correct me if I am wrong but, it looks like you have 2 objects and only have one of them selected. One being the doughnut, the second being the icing. In order to bake them you must first Join the 2 meshes together, making one object. Do this by selecting both objects in Object Mode. Shift + Right Mouse Button (provided you use default controls). Then with the mouse in the 3D viewport tap the spacebar to access the search function and type "Join". Select the first option. Both meshes are now one object. Then unwrap them. Once that is done, then you can bake the entire doughnut.


Creating a Custom Properties Tab in Blender 2.80 I have a suite of several addons that I grouped together in a custom tab in Blender 2.7x, assigning the bl_category to the name of my custom suit:

class Panel1(bpy.types.Panel):  # Blender 2.7x
    bl_label = "Panel 1"
    bl_space_type = "VIEW_3D"
    bl_region_type = "TOOLS"
    bl_category = "MyToolSuite"

In Blender 2.80, I would like to group the tools together in a new properties tab.  How can I create a custom properties tab?

The following works to put my panel inside an already-existing tab, but does not work to create a new tab to hold all my panels:

class Panel1(bpy.types.Panel):
    bl_label = "Panel 1"
    bl_space_type = "PROPERTIES"
    bl_region_type = "WINDOW"
    # bl_context = "object"     # this puts my panel in the Object tab
    bl_context = "MyToolSuite"  # this does nothing?

What else needs to be done to create a new tab in Blender 2.80?

Thanks!

The code you've posted adds a tab to the Tool Shelf, not the Properties. As far as I know you cannot add new tabs to the properties, you can however add tabs in the 3D View.

In Blender 2.8 you need the following attributes to create your own tab:

bl_category = "Name of your tab"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"

A minimal add-on that adds a panel in a separate tab:

import bpy

class EXAMPLE_PT_panel(bpy.types.Panel):
    bl_label = "My own addon"
    bl_category = "Name of your tab"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    def draw(self, context):
        layout = self.layout

        layout.label(text="This is a label")

classes = (EXAMPLE_PT_panel,)

def register():
    for cls in classes:
        bpy.utils.register_class(cls)

def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)

if __name__ == "__main__":
    register()


Blender viewport and UI lag when external monitor connected I have a macbook pro running windows 7 and I use a 1080p monitor when at home with laptop screen disabled. When I have my second monitor plugged in (via mini display port -> VGA apple adaptor) there is a lot of UI lag.

Nvidia 650M GT oc'd

i7 quad core hyper threaded 2.7 -> 3.6GHz

8 GB RAM

Turbo boost (3,6GHz) only boosts one core. The others sleep, I guess.
So I guess you shouldn't use the boost here. RAM is okay, unless rendering, graphics card isn't used anyway. I use mini-display-port on my System as well, no problem. But im on windows so maybe it's a MAC's problem. Please check out other programs, like Video editing Programs or other comples ones like photoshop. (there are free trials)


Vector Displacement not showing same result as the mask of it So recently I decided to try vector displacement. I tried to make something simple, such as this shape. It's sort of a "gun shape", but I've ran into a problem.
I wanted to make an "extrusion" downwards in a square shape. So, I made a simple square mask, using the polar coordinates formula. The first 2 groups calculate angle and distance and the third one calculates the shape.

Then, I added one Z mask, in order to remove the square from the top face- so it only appears on the bottom.

After inverting it, so that it's white shape on black background, I plugged it into the Z input of the combine XYZ node and then the vector went into a Vector math node, set to Add, which then goes into the vector displacement node.

The problem is, that in order to get the cube to be thinner(smaller on X and Z) I have to multiply it before. That causes my new shape to also be squashed on one side.

How can I have my cube to be deformed, but at the same time to have the shape follow the mask?

I can't be sure this is your problem without seeing a bit more of your shader-tree, but..
There's a difference between Generated-space and Object-space coordinates, where render-time displacement is concerned.

The Generated coordinates of mesh elements are evaluated before
displacement. (They measure 0-1 along the sides of the bounding-box of
the (unscaled) object, irrespective of its size, oriented with the
object's local axes.)
The Object coordinates of mesh elements are evaluated after
displacement. (They are measured in Blender Units from the (unscaled)
object's origin, along the object's local axes.)

Both sets of coordinates translate, rotate, and scale with their objects.
So, in this cube being displaced to a sphere, with the same 3D texture, a grid of cubic cells with thin walls:

On the left, the Generated coordinates are evaluated in the original state of the cube, and displace along with it, 'sticking' to the surface of the deforming object.
On the right, the Object coordinates of shading-points are evaluated after displacement, so the
deforming surface 'swims' through Object space.
So, for example, if you're making masks for displacement, and want to see where they wind up on the displaced surface, it's much easier to work in Generated space. I put mine in a group that I can re-use around the tree, offset so the origin is at the center of the bounding box, and ready-separated, to avoid too many Separate XYZ 's and spaghetti:


Alternate tiling around a cone/curve (Rocket hull) I am aiming to (non-destructively) model this tiling pattern:

This requires curving the plates in two axes, tapering them, and offsetting to get that alternating tile pattern.
So far I can array a plate along a curve in one axis:

But I'm not sure what the best next steps are. Ideally I would be able to control the shape of the cone with a curve (unless anyone knows a better way of getting that shape), and could change how many tiles there are per ring, how many rings, and the taper via modifiers.
(Credit to NeoPork on Twitter for the renders)

It depends what you mean by non-destructive, but you could try it this way:
Create the pattern:

Array it on the X and Z axis:

Bend it 36° with the Simple Deform modifier (Bend mode):

Give it its final rocket shape with a Mesh Deform or a Lattice cage:


modeling screw plastic cover for 3d printing Hello I have been using blender for a little while now and while I am quite confident at modeling "normal" objects I am now stuck at the right way to model a plastic cover for assembly screws that is shaped like an angled screw cap. But pictures are surely more explicative than my words (see below). what's the best way to approach this modeling?

If you have already modeled the solid piece, maybe you could delete the faces you don't need (on the second photo the face "under" and "right side" ) and use the "SOLIDIFY" modifier ? find the good value for thickness, apply the modifier. Then you can add the hinges by extruding some faces.
If this can help ?


How to recover overwritten files in blender I had just finished creating a realistic human head in blender that took me about four hours to make. I then tried to open it in a new file but I accidentally saved over it.

Someone please help, I'm really upset about losing all that time and effort.

There are several backup systems in blender:
Temporary files (saved every 2 minutes by default)
These will be saved in your temporary directory (specified in User preferences > File) with a random number as the name.
You can quickly open an auto saved file by pressing File > Recover auto save, then selecting the auto saved file (the modification times can be very useful for determining which file to pick):

You can adjust the interval at which these are saved in CtrlAltU User preferences > File > Auto save > Timer:

Temporary quit files (saved on quit)
These are also saved in your temporary directory, with the name quit.blend.
You can quickly open it one by pressing File > Recover last session:

Persistent save files for reverting accidental/unwanted saves (saved when saving)
These are saved as .blend1, .blend2, etc. files in the same directory as the current .blend.
.blend1 will be the file as it was the save before your last save, .blend2 will be the save before the save before your last save, etc.
To open these files, navigate to the directory where your file was saved and enable backup files in the display filter:

You can configure the number of these to save in User preferences > File:

Without knowing more about your particular situation (how long it's been, has tmp been cleared, how often did you save, etc.), it's hard to say which will work best. There's no risk to trying them all, be beware that /tmp or \Temp is normally cleared out at some point, so get any useful backups out while you can.


Gain access to material info in 2.79 I would like to created a dictionary which contains material names of all object contained in a scene in Blender version 2.79

Afterwards I could have access to material data by name I think. Am I right?

How would I code this?

I know it's only one question per post but, in Blender when we use a material on a cube, for example, does it have the same material on every polygon, or could we set one material per face?

Materials are globally stored in:

bpy.data.materials

which is an array of materials that you can index per name or per index.
On the other hand, an object has an array of material slots (which correspond to what you see in the material panel of the object):

obj.material_slots

And get the material from the slot is:

obj.material_slots[i].material

and it also has the list of the materials it is using in its data:

obj.data.materials

Each polygon of a mesh knows the index of the material it is using. This index is the index in obj.material_slots (or obj.data.materials):

p = obj.data.polygons[0]
p.material_index

So to answer your question, it depends of what you want to do.
If the goal is to know which materials are referenced by an object, look at obj.data.materials.
If the goal is to know which are really used, you'll need to dig into polygons to check which is really assign to them (you can have more mats in obj.data.materials than the one really used).
Notice that a material slot can be empty. In this case, the material_slot exists but contains no material. And also, obj.data.materials contains an empty element (as these two arrays are internally kept at the same size).
To have all the materials references by the objects of a scene, in a dictionary by name, you can:
import bpy
all_referenced_materials = set((m for o in bpy.context.scene.objects if o.type == 'MESH' for m in o.data.materials if m is not None))
dictionary = {m.name:m for m in all_referenced_materials}

Note: if I remember well, 16 material slots max. So no more than 16 materials per object.


Can't select some vertices I've tried to make a model according to the lesson https://www.youtube.com/watch?v=EztmPOhnWwA. After applying the subdivision surface modifier, I faced an issue when one of the "tongues" displayed incorrectly. I suspected that the problem might be caused by duplicated vertices but "Merge -> By distance" didn't help. Then, I've turned on displaying of normals for vertices, and deleted a part of the "tongue's" vertices. After I did it, three normals appeared in a place that was empty (it seems the "tongue" was in this place until I moved it). The vertices which the normals may belong to are not visible. When I'm trying to select them with the box selection tool in wireframe mode, and delete, nothing happens. When I select all the vertices with hotkey "A" and delete them, these three normals remained on the scene while the other vertices were deleted. I suspect that it might be a bug in Blender but since I'm a novice, I'm not sure. I filmed a video with the issue demonstration: https://youtu.be/5QpX0yr1_OY. Blender version - 2.92.0. If someone is interested, link to the .blend file: https://drive.google.com/file/d/12sMXc79xpEDRgyUej0e3-2WO93rTlFcx/view?usp=sharing

It looks like you accidentally hid those faces/vertices.. If you open that model again, go into 'Edit Mode' then press 'ALT+H' you'll see that those vertices/faces were, maybe by mistake, hidden. 'H' hides anything that you have selected. and 'ALT+H' unhides them. If you selected those faces, verts or edges and accidentally pressed 'H' then you probably hid them so they'd remain hidden until you press 'ALT+H' to unhide them.


I'd like to know how to overlay a hue shift effect on an object I'd like to know how to overlay a hue shift effect on an object (like an adjustment layer in photoshop, but applied through nodes).

Let's say I have a sphere. The sphere has a texture applied - let's say it's blue. I also have a second, striped image, which is a black to white gradient in 5 steps.

I want to use the alpha from the second, striped image to determine the hue shift applied to the underlying colour, so that where the stripe is black the object would be blue (no offset), and where the stripe is white, the object would be yellow (full offset), with shades between black and white equating to the colours in between.

Does this make sense, and how would I set it up?

Thank you.

Use a hue/saturation node to shift the hue, and then remix that with the original image using a mixrgb node, the mix factor being the mask image.  Looks like this:
 (Color mode for the mask actually should be 'Non-color')


Only one child light source for parent objects created multiple times I have a minimal knowledge of Blender because two classes in my course requires it. I'm making a game where a cannon shoots at targets. I've decided to make a night level (the day level is 100% working) and add point light sources to the targets and the ammo, which is a ball.

I created a point light source and added it as a child to the ball. Both are located on a different layer than the "shooter". When I fire a shot, the light follows the ball as expected. But when I fire several shots, there's only one point light source and it follows the last ball fired, jumping from ball to ball as I fire them.

I've searched a bit and I found out that that may be impossible, but I'm not sure, so that's why I'm asking if it can be done and how. I'm not in a hurry since this is not mandatory.

Using Blender 2.73a in GLSL mode (can't change that) in Windows 7 Ultimate.

Thanks in advance.

This solution, is called a FX lamp lending library.

Add a bunch of FX lamps like lamp1, lamp2, lamp3 etc,

Parent them to a object, name it LampFX, set each lamp energy to zero

Add a property in each lamp "Lamp"

Have the LampFX object run this (one time)

#build lamp list
import bge
cont = bge.logic.getCurrentController()
own = cont.owner

if "LampList" not in own:
    Lamps =[ ]
    index=0
    for child in own.children:
        if "Lamp" in child:
            Lamps.append([child, False])
            child['index'] =index
            index+=1

    own["LampList"] =Lamps

When a projectile is added to scene, use

added = own.scene.addObject("projectile", own, 0)
for Lamp in own.scene.objects["LampFX"]["LampList"]:
     if Lamp[1]==False:

         Lamp[0].worldPosition = added.worldPosition
         Lamp[0].setParent(added,0,1)
         Lamp[1] = True
         Lamp[0].energy = 1.0
         break

Now the lamp is "checked out"

Now, before the projectile is deleted, a script needs to put it back and check it back in, so another projectile can chexk it out again.

for child in projectile.children:
    if "Lamp" in child:
        own.scene.objects["LampFX"]["LampList"][child[index]][1] = False
        child.removeParent()
        child.energy =0.0

own.endObject()


How do I programmatically determine if an object is a 'linked duplicate' of another? I'm trying to determine if an object is a linked duplicate in a script.
My test scene is as simple as possible, 2 cubes, one a linked duplicate of another.
The following I have tried to no avail:

bpy.data.objects["Cube.001"].library (returns None)
bpy.data.objects["Cube.001"].original (returns "Cube.001")
bpy.data.objects["Cube.001"].is_property_set("linked") (fails to run)

I attempted to grep around in the source code to find a solution but I, unfortunately, couldn't find anything that worked.

Object.data
Linked duplicates will have the same linked data, if there is linked data.  For an empty ob.data is None
import bpy
from collections import defaultdict

scene = bpy.context.scene

data_links = defaultdict(list)
for ob in scene.objects:
    data_links[ob.data].append(ob)

for k, v in data_links.items():
    print(k, v)

Sample output,  notice there are 4 objects using the mesh "Cube.001"
<bpy_struct, Mesh("Cube.001")> [bpy.data.objects['Cube'], bpy.data.objects['Cube.001'], bpy.data.objects['Cube.002'], bpy.data.objects['Cube.003']]
<bpy_struct, PointLight("Lamp")> [bpy.data.objects['Lamp']]
<bpy_struct, Camera("Camera")> [bpy.data.objects['Camera']]
None [bpy.data.objects['Empty'], bpy.data.objects['Field']]


Where i can find this properties panel in blender 2.79 i am trying to find this properties panel in blender 2.79 but i am not able to find it, can you guys tell me that does this panel exists in blender 2.79 or not?

In 2.7 the background images don't work the same way as in 2.8. If you want to load a background image you need to open the N panel, enable Background Images and load your image. Then you can only change the settings you see in the N panel, you can't manually move the image in the 3D view and you don't have access to any settings in the Properties panel:

That said, you can create an Empty > Image, then you have some settings in the Properties panel > Object Data. It doesn't work as a Background or Reference image, but you can use it as such:


Help to find IAP_SHADELESS I am new in Blender. I am trying to modify the transparency of a plane as an image. And apparently this node is necesary. I hope you can help me. Thanks.

It's a custom Group created by the add-on "Import-Export: Import Images as Planes". (IAP = Images As Planes)
Go to Edit > Preferences > Add-ons, search for "Images" and tick the checkbox to enable the "Import-Export: Import Images as Planes" add-on.

Now you can use the add-on through File > Import > Images as Planes (or through the Add menu in the 3D View). Select an image to import and pick "Shadeless" under the Material Settings. Then hit import.

Your image will be imported as a quad. The material it uses will have the IAP_SHADELESS node.
After you've done this once in a file, you can add the group to any material you want by picking Add > Group > IAP_SHADELESS in the Shader Editor.


How do I make backfaces override transparency into a flat color? I want to be able to change the outer edge seen as A into B where the transparent part is shown as green.

As long as it looks like the B version on this image.
Without changing any aspect of the inner sphere.
While keeping the toon shading as is.
Without adding any additional mesh.

You can use nodes to set different materials to the front and the back faces.

In your case, I would use the outer mesh exclusively for the outline, with a node material:

The green materials is shadeless.

Then, again using nodes, you can mix the shadeless and the toon shaded materials for the inner shape:


"Align rotation with snapping target" not working properly newbie to Blender here. I'm having trouble using the snapping tool, specifically the "align rotation" one. For some reason when I use it, the object instead of dragging along with the surface as it should normally, it kind of... "flips" itself, for example:

Here's how it looks without doing any action,

but the moment I try to move it around...

zoop

What is causing this? Am I doing something wrong? Did I forgot to configure a thing?

I believe the problem is that you are doing this in Edit Mode, all within a single object. Instead you should be doing this in Object Mode, and the cube should be a separate object from the surface you want to align it to.

With all the vertices of the cube selected, press P to separate it into its own mesh object. Then try again from Object Mode.


When can a Color Ramp be used to create a gradiant in a Cycles shader? When can you use a ColorRamp node or better to say where can you use a color ramp to manipulate the color of the mesh to be a gradient and not solid?

I tried to plug the ColorRamp in to the Color input of the Diffuse shader, but I didn't get a gradient, instead I always got one color.

The ColorRamp node only remaps existing information. So without an input, you will only get a solid color as output (the solid color in the middle of the ramp, to be exact).

This is easily fixed by providing an input, such as a procedural gradient texture node:


Xparts and Yparts Blender 2.63 or 2.72 It was looking like dividing by parts, a scene for rendering and reading this,

http://wiki.blender.org/index.php/Doc:2.4/Manual/Render/Options

see Xparts and Yparts but on blender 2.4, but the interface has changed I currently have the 2.63 and download the, 2.73 and see but I can not see the menu for Xparts and Yparts, someone can say me if these options are even, and if I could show where.

Thanks.

This change was made in version 2.65, described in the release notes here under 'User Interaction'. You now have to define the size of the tiles by pixels in the performance panel, instead of defining how many tiles. For example, setting a tile to be 100px x 100px when rendering a 1000px x 1000px image would results in 10 tiles by 10 tiles.

However, I personally like to also have the option to define by the number of tiles, using the old way as you describe. I wrote a small addon which restores this functionality which can be found on github here, which adds back render parts options at the bottom of the performance panel:


animation track with two stripes and second stripe strart where first stripe ends? How to work with animation and tracks (stripes)?
I create Stash and Track in Notlinear Animation. I add two Action Stripes (from created Action Stash) in one Track. How to do the second Stripe starts (rotation and location) where the first Stripe ended?
Is it possible?
Or am I trying to work wrong with tracks and stripes? And I have to create every animation step by step and again and again and I cannot reuse already created parts of animation?

Here is simple example what I mean:
1: create Cube in 0,0,0; create key frame in frame 1 (I) = Location
2: move Cube to 1,0,0 in frame 20; create key frame = Location
3: click on buton Stash in Action Editor

4: Add Tracks in Notlinear Animation (track will be named NlaTrack)
5: Add Action Strip in NlaTrack track and this step I will repeat (I will have got in NlaTrack two CubeActions)

Now I Play track NlaTrack and I will see cube is moving from 0,0,0 to 1,0,0 and jump to 0,0,0 and moving to 1,0,0.
What I am asking is can the second strip in track continue where previous strip ends? It means first stripe move cube from 0,0,0 to 1,0,0 and second stripe should start from 1,0,0 to 2,0,0.

Finally, I to solved my problem:
I create Stripe with cube moving from 0,0,0 to 0,1,0. I create first Track with added this Stripe and second Track with this Stripe. I set Blending = Combine in Second Track. So the second Stripe begins when the first Stripe ends. At the end of the Tracks is cube on the position 0,2,0.


Toon material present some kind of deformation, jagged, spike noise Please take a look at the images and tell me if there are any way to have a perfect transition between colors and get rid of that noise marked in the last image.
There is a way to make that plane receive the sphere shadow with the plane's darker color (dark pink)? The way it is now, the sphere has no projected shadow.

(I created the plane's material the same way I created the sphere, but with just two color instead of four)

The problem is caused by the geometry at the pole of the UV Sphere interacting with the Smooth Shading to produce artifacts in the generated Normal as described in this question and its associated answers : How to avoid the wrinkle at the poles of the UV sphere?

The UV Sphere consists of edges formed from the Latitudinal lines (those around the sphere) and the Longitudinal lines (those going north to south). The Longitudinal lines all converge at the poles and this creates a number of long thin triangle faces as shown :

The problem is that slight inaccuracies in the smooth shading of each adjacent face is resulting in noticeable artifacts in your toon shader.

You can avoid this problem by changing the geometry to avoid such long thin triangular faces. The attached answers provide some methods of achieving this but an alternative is to use an Ico Sphere in place of a UV Sphere.

The geometry of an Ico Sphere is made up by subdividing an Icosahedron (a 20-sided regular mesh) such that each face is an equilateral triangle. As there is no 'pole' to provide difficult geometry you should no longer get the issue.

Once you have created the Ico Sphere you can adjust the number of sub-divisions to determine the level of detail.

Setting the mesh to Smooth Shading should produce a consistently smooth sphere.

For the shadows you could simply use the Shadow output of the existing Lamp Data node as the factor to a MixRGB node set to Multiply by a light grey (vary the intensity of this grey to affect the density of the shadow) as shown :


What does "number of diffuse/glossy/... bounce samples" mean? In Cycles render, when enabling branched path tracing, one can specify the number of diffuse/glossy/transmission/... bounce samples for each AA sample. Can someone explain to me in little more words what this means?

I know what diffuse/glossy/... materials are, but I don't know what is meant with a glossy bounce sample.

BPT allows you to give sampling priority to materials which take longer to converge.  As you have probably experienced, some more complex shaders (SSS, translucency, rough gloss, etc.) often create much more noise in a render and thus require more sampling than materials such as diffuse or a sharp gloss.

(If you are unclear on the technical meaning of samples, check out this post.)

BPT lets you adjust the relative amount of samples for each type of shader individually to manually optimize your rendertimes.  So if you are getting a lot of noise in your scene from a particular SSS shader but your diffuse surfaces look fine, you can knock up the SSS samples to reduce the noise from the SSS without having to waste samples on the diffuse surfaces that don't need any more sampling.

Keep in mind that when used, BPT does seem to take a little bit longer and generate a little bit more noise than standard path tracing.  So it is best used in situations where the difference in noise created by different shaders is quite large so the gains are large enough to outweigh the higher base values for noise and rendertime.

This is a more practical explanation of how to use BPT, if you want a more technical explanation check out this post


What datablock should I use to store properties? I'm using Scene data block to store properties and use them later in my script, e.g.:

def register():
    Scene.bcp_return_result: BoolProperty = BoolProperty(default=return_result,
                                                         name="Return result",
                                                         description="Indicates if result of command should be returned")

And later:

return_result=bpy.context.scene.bcp_return_result

But content of Scene datablock is lost after opening a new scene or creating a new one.
What content could I use to still access properties in this way and have them stored between scenes?

You use bpy.context.scene. which refers to your current active scene, e.g. bpy.data.scenes['Your Scene Name']. When you change the active scene in Blender the bpy.context.scene. starts to refer to another scene, e.g. bpy.data.scenes['Another Scene Name'] Context in bpy.context means "current". About Blender Properties like bpy.types.BoolProperty and the others - they are supposed to be used to dinamically change values of operators, not for storing any constant information.

If you want to store your properties you can:

1) Set a global variable outside all classes, right in your script body and call it from your functions and methods by marking it global (using global variables in big programs is not a very good idea because as your program grows it is getting hard to manage them):

bcp_return_result = None

def register():
    global bcp_return_result
    bcp_return_result = 1

print(bcp_return_result) # >>>None
register()
print(bcp_return_result) # >>>1

2) Set and change it as your class variable. It can be either Blender Operator class

import bpy
from bpy.utils import register_class, unregister_class

class RegisterOperator(bpy.types.Operator):
    bl_idname='reg.op'              # id_name for bpy.ops, e.g. bpy.ops.reg.op()
    bl_label = 'Register Operator'  # Operator name
    bcp_return_result = 0           # Operator class variable

    def execute(self, context):     # to work as an operator this method must be
                                    # called "execute" and have self and context
                                    # arguments

        op = bpy.types.REG_OT_op    # to access an operator as a class we type:
                                    # "bpy.types", add uppercased start of
                                    # bl_idname, add _OT_ instead of dot and the
                                    # final part of bl_idname as it is
                                    # Example: 'reg.op' = 'REG_OT_op'

        op.bcp_return_result = 1    # change operator class variable with what
                                    # you need

        return {'FINISHED'}         # also necessary part of operator

register_class(RegisterOperator)    # register operator

op = bpy.types.REG_OT_op            # set variable with operator class

print(op.bcp_return_result)         # >>>0
bpy.ops.reg.op()                    # execute operator
print(op.bcp_return_result)         # >>>1

or just a common Python class:

class RegisterClass():
    bcp_return_result = 0           # Operator class variable

    def __init__(self):
        pass

reg = RegisterClass                  # create class instance

print(reg.bcp_return_result)         # >>> 0
reg.bcp_return_result = 1            # change class variable
print(reg.bcp_return_result)         # >>> 1


Armature doesn't work properly I have rigged a left foot in Blender and want to rig the other foot, but when I test the another foot, the armature didn't work well.

The armature twitches or flickers as shown in this video.

Video Showing Issue

In the linked file there is no right leg bones so it's hard to say what's your problem. Anyway, you can easily fix it:

First give all your left leg bones a ".L" or "_L" suffix.
Then select all the left leg bones, go in the Armature menu and choose Symmetrize.
You now have right leg bones and they work.


How to decorate cyclinder I would like to decorate a vase with flowers that is extruded from the surface.
Shrink wrap may be useful,not sure how to go about that. I am able to do this on a flat surface but not when the object is to be applied to a curved surface   Could some one please point me in the right direction to apply a 3D object onto a curved surface. Thanks

this what I have in mind. Then extrude the image and 3d print it

I write this as an answer to be able to add a picture of what I guessed you want: is it something like this?

I can explain step-by-step how to get it, but I wish to be sure that I did understand well...

this was obtained starting from a simple cylinder and then an image like this:

Let me know, in comments, if you wished to get something like this, and if you still need instructions, I'll add to this answer...

[edit] Ok, since you still need it I try a complete step by step description of how I got that vase above. I hope your hospital trip was nothing too bad, anyway :)

The overall descriptio is this: we're going to create a quite detailed vase, first, applying all modifiers, in order to obtain a good-looging basic shape, with smooth geometry (remember that 3d printers don't smooth geometry as 3d programs do, so to get printed smooth results, your mesh needs to be really smooth, and thus, detailed).

Then, we will duplicate a rectangular portion of the outside conical surface of the vase, that we will use to create an "extruded" flower shape, using a displacement modifier. This extrusion needs to be far more detailed than the vase, because this is required to have a good displacement result, but the displacement will be applied to a curved surface, so the "extruded" flower shape will nicely follow the overall vase curvature.

Done that, you'll have two separate shapes: the basic vase, and a rectangular portion of its outside surface dispalced as a fower: you can then join the two objects, and try to export this to STL format, and print that: in my experience, 3d printer's software (like CURA or others) can print an object if they can spot a "solid" shape, even if it comes from a roughly joined mesh,like in this case.

Here's how to:

First step is start from a basic cylinder, remove top face, and scale lower face, to get a basic vase shape, giving it a "brick red" material (cyles renderer, later on this)

Then, use a solidify modifier to give some depth to your vase mesh, and apply it whan satisfied

Then, since we're going to use a subdivision modifier (subsurf), let's add some extra edge loop near the top and bottom of the vase shape (and also on the top ring of the vase), otherwise it would distort too much there. You can do this with CTRL+R command: a new purple edge appears, then move it where you need, then apply (right click or enter).

Now let's apply the subsurf modifier, level 2 is enough,

and then apply it, getting a quite dense and smooth basic shape

Now move the view to front, and select a rectangular shape of faces

Then duplicate it

And then separate this duplicate part, obtaining a separate object. Don't move, scale rotate this separate object or the vase, they need to stay where they are now!

To get a better view of the separate object, hide the vase (select it and press H)

Now you could make this object mesh more evenly spaced, but preserving its curvature: I'm not sure this is really needed, but I did so, dissolving some edges

...ending with just this central one

then, using again CTRL+R  I subdivided the upper and lower parts, ending with the same amount of vertical and orizontal loops.

then I subdivided this mesh 20 times (needed for later displacement): you'll get a VERY dense mesh...

then I loaded a black flower on white background image in the image/UV editor, like this. The flower image is also set as the texture of the vase "brick red" material (see texture settings)

in edit mode, using U on the complete selected mesh, I chose "project from view (bounds)" to get a nice fill of the UV grid on the image (on the left)

Then, move to modifiers and insert a displacement one, select a small negative strength, select "UV" texture coordinates, and set the object UV map as "UV map"

What you'll get in object mode is like this:

Now unhide the vase you hidden before since it's invisible now, see the outliner, and clik on the disabled "eye" icon to make it visible again, you'll get something like this:

Place camera and lights in a good way to see the result, which should be something like the above result:

I know this isn't too short, but is not that complex, after all. Let me know if some clarification is needed. Meanwhile, I thought of another method, maybe simpler, to get similar results... If it works, I'll add another answer, or add to this one.


Grease Pencil Animation I am wanting to use the new features of the grease pencil for animation.  I am going to have a sphere that I want to draw facial expressions on top of.  However, it is not very efficient to try to draw directly on the mesh, especially if you are animating the position/rotation of the model.
Is there a way to draw grease pencil in a 2D window, and then apply that animation to the mesh of my character?
Please let me know if you need more clarification.  Thanks.

I got an answer off of Packtpub.com.  If any of you want to check out the course, it's called "Blender 2.8 Game Character Creation."

His method for being able to draw the face in a window at the same angle was to create a camera that was positioned face on at the head of the figure, and then to parent it to the head bone.

It's at that moment when you think: "Why didn't I think of that?"  You just have to look outside the box, I guess.


Duplicating light along path in blender 2.8 I've been following 'Create an Underground Subway Scene in Blender' from BlenderGuru in youtube.

When he started to duplicate the lights along the path using Duplicate menu in object tab he used an option called 'Frames' which, as I understand, duplicates based on frames generated by Follow Path option.

I was following the video using blender 2.80 beta and there is no 'Frames' option, nor 'Duplication' tab. I guess they changed Duplication to Instancing but Frames option is still missing. I tried to look for a solution to instance lights using 2.8 but most answers are made for older versions of blender thus I wasn't able to get past this problem.

What I tried so far:

Instancing with 'Verts' option. This did not work (I am guessing it is because light has no vertices)
Instancing with 'Faces' options. Failed, probably same issue as above.
Using 'Follow Path' constraint instead of Ctrl + P > Follow Path. Did not work either.
Using 'Motion Paths', even though i have no clue what it actually does, failed.

Any help is appreciated!

Not sure if this is going to help you but:

1 Create a light and a curve.

2 Convert the curve to Mesh.

3 Select the Light go to >> object >> Relations >> Parent (here, put the curve).

4 GO to the Curve >>Object >> Instancing >>Verts.

Good Luck


Bone rotation problem I set a bone to copy rotation of the arm bone when it rotates on Z axis to enable a corrective shape key. The problem is that when i rotate the arm on the X axis, the bone that is copying rotation rotates on Z axis and enables the corrective shape key, distorting the mesh.

as your bone is not completely aligned with the global X axis, rotating it on the global X axis makes it rotate on its local Z. If you align it completely with the global X axis in Edit mode, it won't happen any more. Once aligned:

Not sure why you need to rotate it on the global X axis though, just keyframe rotations on its local Y axis.


How can I cast a text element to float in animation-nodes? I read some data from an external csv file into animation nodes, split the lines into individual parts (data columns) containing floating point numbers and want to use these floating point numbers in an object transformation.

However, the split lines are of type text, while the transformation expects float. How can I transform text to float? In the image the current value is 7.5 as can be seen in the debug node, I'd like to use this as input to the combine vector node.

In python this is easy enough >>float() so I tried to do this, using the script animation node, but could not figure out how to deal with input/output values within the script node.

Search in the menu (Shift+A) for Convert

It's a generic node that converts all to all.
There are other nodes that are not in the menu yet.

Sometimes it is added automatically.

In this case it is not cause you have to be a bit careful about the input, not to get a None. None is not taken well by some types of data/sockets and will give errors for vectors and others. So don't jump in using it all around :)


See Through Render Layer Edit:
Please looks at the image below. It is a better view

As shown in my render above, you can see the exhaust of the ship somehow protruding through the engines. The exhaust and the ship are separate render layers with the ship being above the exhaust. I have composited them with the Add node with the ship above the exhaust. It's not the ship's material as it not transparent and when they are on the same render layer it looks fine. My render layer properties look like this:

How can I make the exhaust go behind the ship, what am I doing wrong?

Edit:

This is my compositor with the Alpha over node. I just added a few adjustments to the exhaust, but the problem persists.

Use "Alpha over" instead of "Add" node

Assuming that you are in a situation with a bright light sources behind your object like in the example below:

The use of an Color Add Node would sum the pixel colors from the two render layers, while what you probably want is to override the pixel color information basing on which layer is in front of you.

In this and your case, as both the layer of my light and your exaust are almost white, we can't see the "adding" because the are both almost full white, so what exceed the full white (RGB=1,1,1) is being clamped to 1.

Here's an exampe with a light source whose strength is 0.1, The addition is more visible now.

I would suggest to use the Alpha over node instead, which put the second imput image imput upon the first imput image taking alpha channel in account.

Remember that the second imput socket of the Alpha over node is the images that will be put above the source image (which is connected from the firts imput socket). So in your case, the source image must be the Exaust, and the second the Ship.

From the Blender reference manual's page about Alpha over node:

  Use this node to layer images on top of one another. This node takes two images as input, combines them by a factor, and outputs the image. Connect the Background image to the top input, and the foreground image to the lower input.


Spherical gradient for spot light I know how to create spherical gradient textures for objects and I also know how to assign image and radial gradient textures to spotlights. I am struggling however with the spherical gradient on spotlights.

EDIT: This is not a duplicate of the IES light question, I am specifically asking how to do this with a spot light and without an image, which proved possible (see accepted answer).

I want to achieve this, but without an image.

EDIT: this is the nodetree that worked,

thanks to Secrop's answer. Funny thing, I already had Z scaled to 0 for the image texture.

I think you want to make something like fake IES lights. I don't know how to make it with spotlights, but maybe this will help you. So here we go!

Final result:

Steps:

Create simple Circle filled with Ngon or Triangle, or even fill it as you pleased and scale it down to 0.1.
Create this node setup (I'll explain it later):

Most interesting stuff:

Light Falloff.
You can control here light strength and smoothness.

Color Ramp.
This will make gradients as you like. Try adding/deleting/shifting colors and you'll see the magic.

Blackbody.
Real deal here. It's simulating temperature of light. You can delete it and set any color you want.

That's it. You have now fancy fake IES lights with color temperature.

Blend file:


Register a Persistent Handler in Addon I have an addon with various modules and submodules. One of these submodules is specifically for handlers. When testing my addon, I noticed that whenever I installed and loaded the addon, the handler within my handler module would not register. How do I register a persistent handler as part of a submodule in an addon? And, how do I make sure that the handler is only registered once, and unregistered if the addon is removed?

import bpy
import os
from bpy.app.handlers import persistent

@persistent
def my_load_handler(dummy):
    print("Load Handler:", bpy.data.filepath)

def register():
    bpy.app.handlers.load_post.append(my_load_handler)

def unregister():
    bpy.app.handlers.load_post.remove(my_load_handler)

Blender only calls register() and unregister() on the top-level module, i.e. the file that has the bl_info dict in it. You're responsible for calling things on your submodules.

You could be importing a module that handles registration on something wildly different. For example, a register() function in some submodule could register a new user here on Stack Overflow. Blender doesn't know which function does which, and thus only calls that one top-level register() function.


Is it possible to deselect vertices in Python? I have an existing selection which I'd like to further isolate using Python scripting. In this instance the math is simply that if the X coordinate is greater than zero, it should be deselected.

I already have this code, which successfully selects half of the object:

import bpy

obj = bpy.context.active_object
bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.mesh.select_mode(type="VERT")
bpy.ops.object.mode_set(mode = 'OBJECT')

for i in range(len(obj.data.vertices)):
    if obj.data.vertices[i].co.x > 0:
        obj.data.vertices[i].select = True

bpy.ops.object.mode_set(mode = 'EDIT')

If I change the > to a < and run the script, then it selects the rest of the object, so it does seem that selections are able to build upon each other.

If I change True to False,  I would expect selected areas matching the logic (co.x > 0) to be deselected, since it is setting the select property to false. However, this doesn't actually work. Running the script with False instead of True results in the selection being unchanged regardless of any conditions I set. It seems that nothing happens when I use .select = False. There are no errors printed to the console or anything.

After finding this question, it seems that I'm not the only one with the problem, but the answers simply seem to indicate that this is impossible due to the way Blender works with selecting faces and edges. So, is it possible? Can we deselect all connected faces and edges of a vertex in a Python script so that we can deselect the vertex?

if you want to run it in object mode:

import bpy
vert = bpy.context.object.data.vertices
face = bpy.context.object.data.polygons #not faces!
edge = bpy.context.object.data.edges
#vertices can be selected
#to deselect vertices you need to deselect faces(polygons) and edges at first
for i in face:
    i.select=False
for i in edge:
    i.select=False
for i in vert:
    i.select=False
    if i.co.x > 0:
        i.select = True