text:
how to move object by python script while keep its physics and collision
I am using python script to move an object (a ball) in a room, and it should be in the room, not going out.
I have set the rigid body, when play it is ok, it can stop when hit the wall.
but when controlled by script, it goes through the wall.
    ball = bpy.data.objects['ball']
    ball.select_set(True)
    bpy.ops.rigidbody.object_add()
    bpy.context.object.rigid_body.mass = 1
    ball.select_set(False)

    ball.location[0] = ball.location[0]+0.1  #this is in timer, repeat

how can I make it stop automatically when hit the wall?
can I running python code control its movements when in playing?

3d collision detection is a complex problem. No easy way to do in low level code.

sure, I do not want to do 3d collision myself, blender already does it well. the question is, how to let blender do it. as we know, in play mode, it does, but in play mode, the python code seems not work.

Unfortunately, Blender unlike the game engine. In blender, If you control the position manually, you need determine when the Rigid Body is Active.

You may add force to the object instead control the location.

good suggestion, how to add force by code?

Example scene for physics collision

Run the script to get the scene.
import bpy

# select and delete all object
if bpy.context.object:
    bpy.ops.object.mode_set(mode='OBJECT')
    bpy.ops.object.select_all(action = "SELECT")
    bpy.ops.object.delete(use_global=True, confirm=False)

unit_settings = bpy.context.scene.unit_settings
unit_settings.system            = 'METRIC'
unit_settings.scale_length      = 1
unit_settings.length_unit       = 'METERS'
unit_settings.mass_unit         = 'KILOGRAMS'
unit_settings.time_unit         = 'SECONDS'
bpy.context.scene.use_gravity   = True
bpy.context.scene.gravity[0]    = 0
bpy.context.scene.gravity[1]    = 0
bpy.context.scene.gravity[2]    = -9.81

bpy.ops.mesh.primitive_plane_add(size=5, enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))
bpy.context.object.name = "floor"
bpy.ops.rigidbody.object_add()
bpy.context.object.rigid_body.type = 'PASSIVE'
bpy.context.object.rigid_body.collision_shape = 'BOX'

bpy.ops.mesh.primitive_cube_add(size=5, enter_editmode=False, align='WORLD', location=(5, 0, 0), scale=(1, 1, 1))
bpy.context.object.name = "wall"
bpy.ops.rigidbody.object_add()
bpy.context.object.rigid_body.type = 'PASSIVE'
bpy.context.object.rigid_body.collision_shape = 'BOX'

bpy.ops.mesh.primitive_cube_add(size=0.2, enter_editmode=False, align='WORLD', location=(0, 0, 0.101), scale=(1, 1, 1))
bpy.ops.rigidbody.object_add()
bpy.context.object.rigid_body.type = 'ACTIVE'
bpy.context.object.rigid_body.collision_shape = 'BOX'
bpy.ops.rigidbody.mass_calculate(material='Iron', density=7874)

bpy.ops.object.empty_add(type='CIRCLE', align='WORLD', location=(-0.41, 0, 0), rotation=(0, 1.5708, 0), scale=(1, 1, 1))
bpy.context.object.name = "force"
bpy.ops.object.forcefield_toggle()
bpy.context.object.field.type = 'WIND'
bpy.context.object.field.strength = 100000

cool, so the basic idea is to add some force? code control box move will not make blender "know" collision?
can we add some force to an object (so we can add different force to different objects)? rather than a wind field?

If you know when the cube hit the wall, at that time, you can turn the Rigid Body Setting (Animated off) of the cube. That is bpy.context.object.rigid_body.kinematic = False. Then the cube will control by Rigid Body.

You also can use other Force type:  bpy.context.object.field.type = 'FORCE'. I tested it can work. But you need change the force Power and direction.


text:
how to adjust a cloth model to fit a body model
I found a good cloth model file from some website.
I want to put/wear this cloth model to my human model.
Do need advise/tutorial video for what kind of skill for this purpose, sculpt a little is ok, but if more, the cloth will be not look good. Also tried shrink modifier, help a little but not idea.
The tutorials I find are all about how to quickly make cloth for a body, not suit the purpose.

Hello, there are several ways to make clothes, maybe take a look at some tutorials like this one: https://www.youtube.com/watch?v=7h89tkUJLuM or this one: https://www.youtube.com/watch?v=AbyfuW5Aocg

Can you add a screenshot and show what you don't like? Scaling and sculpting should do the trick. But when the cloth is textured and has a normal map and the size differs a lot then there can be stretching and bad deformations.

source: Stack Exchange

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

sort: votes


text:
how to move teeth with mouth shapekey
The mouth movement is controlled by shapekey.
But the teeth has no movement.
How can I make the teeth move with the mouth?
Please find attached snapshot.

Can not share the file as it is about 1GB. The teeth is separate mesh, while the face is another. The face has shape key, can smile etc. is it clear?

my idea is to (1) make an empty object move with the mouth together, and then (2) let the teeth copy the movement of the empty object. I know how to do (2), but I don't how to do (1).

create an empty

right click on the empties z location -> copy as new driver

right click on your shape keys value -> paste driver

change to "scripted expression"

now you can move your empty on z-location from 0 to 1 and the mouth should open and close

repeat step 2

paste driver on your z-location of your upper teeth, change to scripted expression

do the same for lower teeth

depending on your teeth location adapt the formula for your tooth, mine worked with this:

result:

of course you should finetune the movement in the drivers editor.

Very good idea. But the first step should be opposite. Not make the empty object control/drive the mouth, but make the mouth (which is driven by shape key) drive the empty object. How to make it?   looks like the "scripted expression" can help.

I understand your point, it can solve the problem.

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


text:
how to set current transform as default status of an object in blender
in blender, after make transform to an object, for example, rotate it 90 degree, then it has a rotate transform number there. how to set this number to 0 while still keep the above transform? that is, I want the object keep current transformed direction as its first/default direction.

You need to apply the rotation (Ctrl A), or rotate your mesh in Edit mode instead of rotating the object in Object mode

You would just have to apply the current transformation of your object for that: Object -> Apply -> All Transforms


text:
object can not move
I download this car model from web, I can select all and move it, but the seat can not be moved! I don't know why?
have checked the modifier and the constrain, nothing.
why???

Can you upload your .blend file to https://blend-exchange.com/ ?

Probably the seats have their transforms locked.  Type N to open the side panel with one of them selected and look at the location transform.  If the lock is "closed" click it to open it.

thanks, it is the reason.  this question can close. how can I close this question and mark your comment as the answer?

You can either write the answer yourself and accept it or @MartyFouts can.

...or any other guy can write an answer ;)

I will write an answer.   Since you're apparently a new user to Blender StackExchange, you might want to read What should I do when someone answers my question? and perhaps accept my answer.

The seats have their transforms locked. Type N to open the side panel with one of them selected and look at the location transform. If the lock is "closed" click it to open it.


text:
How to make cloth fit body
How or what skill to make cloth fit a specific body?

Is this an animation or just a pose?

Currently this is just a pose, later we will make it animate, to make the cloth rig with body is another question.

I am figuring it out that the sculpt tool and function may help, but it is too much manual & visual work, and result is not perfect. I guess there should be some tool much more automatic.


text:
My bone is not letting me modify IK limits
First of all I'm a very beginner in terms of blender at the point that I'm still doing a course in Udemy, now we are on the rigging part of the blender course and I got my first issue.
We are trying to limit IK bones and every bone is working well except the root bone that have all the limit and IK options grayed out (more in the picture down there).
so as I did in my course forums I will give a checklist of what I did and checked:

it has no bone constraints applied
is parented with the base bone (the cycle on the picture that helps me move all the lamp)
when it had rotation lock with the bone constraint one it worked (which is not needed for the IK limiting that we are doing now on the course)
Auto IK is checked
Is not on rest position
it has rotation and scale applied

I'll upload the blend file if it you think it's gonna help.

Here you can learn everything about IK. It's very detailed: https://youtu.be/gq7K1mX4pRI

The root bone is not part of the IK chain (you've set a Chain Length of 3) so all the limit values are greyed.

Oh... well it was a good mistake to learn as a beginner, thanks for the help! you helped me a lot!


text:
Displacement Stretched
I have a simple displacement setup as follows:

When I apply this same material to two differently sized objects, the displacement seems stretched on the larger object:

Scale has been applied (Ctrl+A).
Is there a way to make the displacement the same 'scale' on objects of any size?
Here is a link to the sample .blend file:
https://1drv.ms/u/s!AqKxXPZzafVQla8hzonVpxSvpK9jwQ
This was created using Blender 2.8 beta.

have you applied the scale (ctrl A)?

@moonboots Yes. I have just updated the question to state that, thanks.

Try to plug Object socket from Texture coordinates to Noise texture

To have consistent scale, create an Empty in your scene and make it control the texture scale.

Create an Empty
Edit your material by adding an Input>Texture Coordinate, using the Object socket and linking it to the Empty in the "Object" dropdown

Scale (, Rotate, Move) the Empty to make the feature the size you want. This will apply in a coherent way to both objects that share that material.

Big Empty

Small Empty
Note: if your object is going to be moved in animation, and you want the texture to stick to it, then you should either (1) parent the empty to it, (2) consider following Mark Jackson's answer (although you will need to adjust the proportions of the texture manually), or (3) use an UV map.

Ingenious! This answer also helped me learn something cool :)

If you don't use UV textures, then applying materials will try to fit it to the entire object. So if your object is long, then it will stretch to fit your mesh.
To fix this, in your node editor, press "Shift+A" > "Input" > "Texture Coordinate"
                            Press again "Shift+A" > "Vector" > "Mapping"
Connect them up like this and in your Mapping Node, using the Scale to make the noise texture fit to the object. In my case I used the Y axis and increased the Scale of Y by 10.
See below:

I hope you can see it ok in the image and that this helps you.

One more thing, without defining the parameters (in this case, the scale) by using a Mapping node, blender will automatically assume the default values (X 1.0, Y 1.0, Z 1.0) and project the texture to fit onto the mesh object which in our case, is not uniform on all sides. So we need a mapping node to tell blender that these values are not default values and it needs to stretch or squash the texture to fit correctly onto our mesh object. In the texture coordinate, using Generated or Object will probably yield similar if not the same result.


text:
How to pass additional property value with operator_menu_enum on execute?
I have an operator with couple EnumProperty properties, all of them enumerate the same item list. I'd like to know which property changed on execution from layout.operator_menu_enum().
With simple layout.operator() I can set it's property like this layout.operator(...).some_property = "value", can I do something similar with operator_menu_enum?

Not Currently.
(2.79. sept 12-2017) operator_menu_enum(....) doesn't return the operator reference, so assigning something to layout.operator_menu_enum(....).some_property='something' will fail.
would be super handy if it did.

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


text:
How can I set the object origin for an armature?
After importing a .bvh file from Motion Capturing, the object appears translated and its origin isn't in the objects geometric center. I've tried several options from the Set Origin menu (Shift + Ctrl + Alt + C).
However, I still couldn't find a way to have the object's center work in both Object Mode and Edit Mode. When I toggle between the two modes, the object jumps around.
How can I set the object's center for both modes?
Edit Mode:

Object Mode:

is this realy edit mode and not this other "pose mode" and so the offset in the translation is actually in the bvh data itself. It would be like animating an object via shapekeys and in a later frame the object center is offset from geometric position?

@miceterminator Thanks, do you have an idea on how I could check whether the offset is in each key-frame? I don't know what you mean by other pose mode.

Unless you set the armature to show rest position, what's shown in Object Mode is the current pose in Pose Mode, i.e. the imported animation itself. (And I'm not sure if the knee and elbow should be detached like that...)

In the Edit mode, the pose set in an armature is ignored.  Because in your case the object is translated in an unwanted way in the Object mode but not in the Edit mode, it is possible that you have accidentally set a pose which translates the whole object.
To clear the translation of a pose, do the following.

Select the armature and enter the Pose mode.
Select a bone you want to reset the translation of (or select all bones by using shortcut A if you want).
Press Alt+G (the shortcut for Pose > Clear Transform > Location).

In response to your comment, here is how to clear the keyframes for the bone translation (that is, remove the animation data of the bone location from all frames).

Select the armature and enter the Pose mode.
Select the bone, and open the Bone tab in the Properties window.
Right-click any of the three coordinates in Location, and select Clear Keyframes.

After clearing the keyframes, you can use Alt+G to clear the translation.
However, because this works for only one bone, if you want to do this for many bones, you have to repeat steps 2 and 3 many times.  Maybe there is a better way.

Thanks (+1) Alt+G helps temporary, when I move a keyframe forward and backward the offset re-appears do I have to 'apply' the new location?

LIFE SAVER!!! I have been trying to figure out why the origins in the model and armature are different in edit mode and object mode. Could not figure it out for days :( Then, you pointed out the pose...oi. Thanks!

Even I am new to blender and was facing the same issue, what helped me was as follows:
Go to Object Mode->Select the armature->Press N->Click on Tool->Expand Options->Expand Transform->Affect Only-> Select Origin.

Then you will be able to move the origin in the viewport.
Hope that helps.

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


text:
Moving and spawning objects randomly with python
I'm creating a simulation in blender whereby the objects move randomly, but where the code I have attached applies.
At the moment, they are stationary.
The code I have attached basically states that when in a given distance within each-other, objects can spawn at their location.
Dnapolymerase is an object which upon reaching a certain radius between nucleotides, can spawn nucleotides at their location. Almost like the snake game? Where snake eat apples and grow longer.
I'm hoping to get the same kind of result in this simulation, without using physics in the game engine or using keyboard sensors. The movement must be completely random.
Random movement was achieved in the previous code I had, most likely by looking at nearest.worldPosition or something like that, but I'm not sure how I can apply that to the code I have.
Any help would be amazing.
(I've attached all relevant code/video and if need be I can send you blend files of my script)
This is probably going too far, but I'm willing to literally pay someone to help me. I'm not kidding. I am prepared to do this.

The link shows a video which depicts how I would like the objects to move (tinyurl)

What exactly is you question?

I think the best way to do this is by assigning your main function to a frame change handler. This way your simulation can be executed by starting the animation, and you will also see the result live in the viewport. This is a good example on how to set up a frame handler:
http://blender.stackexchange.com/questions/7904/how-can-i-make-dynamic-text-in-an-animation/8087#8087


text:
Follow Active Quads doesn't align the ends of UV properly
I am trying to UV unwrap the face of a cylinder so the texture creates concentric rings on the surface. However I can't get the UV map to properly align the "ends" and instead always distorts at one of the edges. I have used the "Follow Active Quads" command and even tried the reset trick that some users have mentioned.
Any help would be much appreciated. TIA

maybe it has to do with the Subdivision Surface modifier, in its Advanced options make sure it is set to Boundary > Keep Corners?

Aha! Yes, that was it. Thank you kindly!

It has to do with the Subdivision Surface modifier, in its Advanced options make sure it is set to Boundary > Keep Corners.


text:
Blender 3.0 Geometry Nodes Moss Effect
Trying to replicate the moss effect shown in one of the feature videos for the new Blender 3.0 geometry nodes.
The video is title Eevee Atributes and is about half way down this page.
I can get most of it, except for when it comes to changing the material I can't figure out how to get the gradient blend between the vertexes. There's just a hard edge.
I'm guessing there's something going on in group I can see titled 'GE-view_pattern'?
See my efforts below. Ignore all the empty node sockets, I couldn't figure out how to delete them.

Since it relies on information on the geometry level, you'll need to subdivide your mesh more

I just tried subdividing more but don't think that's all there is to it. Also it just lags too much before it looks close to being as smooth in the video.

All good, I figured it out. I needed to capture and output the attribute and then plug it into the Fac of a mix shader to combine the green and grey materials.


text:
cannot find 'instancing' in object properties of metaball

Hi
I'm practicing geometry node in blender 3.0.
I was trying to scatter metaball on cube.
However, I cannot find instancing menu in object properties.
Is it removed in blender 3.0?

You need to access the instancing panel on the instancer  (ie the cube), not the instanced object

The option has been removed for metaballs in Blender 3.0. Have a look here to make metaballs work with geometry nodes: https://blender.stackexchange.com/questions/245991/is-there-any-way-to-work-with-metaballs-via-geonodes


text:
How do I get rid of the part of an object which can't be seen in edit mode?
I am really new to Blender, sorry if my question is stupid.
How do I get rid of the straight one? Both "rods" are part of the same object I think.
However, I see no trace of the straight rod when I go into edit mode.
(except for the really small orange dot in the bottom of the straight rod, which appears in both edit and object mode)
Please look at the images below

The other part is probably hidden in edit mode.  Alt-h in 3D viewport, edit mode to unhide all; then x->vertices to delete selected.

Haha, I feel kinda dumb now. But thank you very much! (it worked)

Incidentally, the orange dot marks the origin of your object.


text:
Bevel problem (im new to blender)
I recently got to blender and while trying out the bevel modifier on a cube i couldnt get what i wanted. I am using blender 3.3.1.
So i wanted this:

But i can only get this:
How do i fix it? and also, how do i get this type of thing where there are 2 flat surfaces?:

The object is beveling "weird" because you scaled the cube in object mode (Scaling in edit mode is usually preferable because it maintains the objects' global scale). However, if you do scale in object mode, you can select the object (in object mode), then press Ctrl+A and select "scale" to reset it. You can get the flat top and bottoms by weight painting them and then selecting "weight" as the limiting factor in the bevel modifier (or in the case of the bottom image. you could just select the 4 side edges of a cube then bevel with Ctrl+B, drag the mouse out and scroll up a couple of times).

Hi Please use a title that reflects the content of the question. It should be descriptive but succinct, unique and identifying, summarizing the issue so that users can at a glance understand what your post is about. Use the [edit] link below your post and avoid anything not strictly essential to the post. Remember, your title is the first thing potential visitors will see, and makes your question findable for future users. See "What is the problem with posting an image or link and asking “How do I do this?""


text:
Weird deformities when remeshing and using the grab brush
Using grab brush but instead of moving as one smooth mesh, it is chunky and drastically raised in some parts despite just doing a minor adjustment. I used the voxel remesher at .02 and have a mirror modifier and have the setting use deform only on to run a bit faster. Not sure what is relevant. How do I get rid of these weird deformities? Smooth them out doesn't fix it. I tried remeshing again but it didn't help.

Had clipping enabled in Mirror modifier. Unchecked that and now it is fixed.


text:
UV Unwrapping Woes - Extra Faces?
I'm new to 3D modeling and especially to getting my UVs unwrapped.  Currently, as seen in the screenshot below, I appear to have a whole slew of faces (54, I believe) that cannot be seen, nor do I want them to be seen.  I'd like to get rid of those faces, but I can't seem to find them to select - as if they were inside the geometry.  Is there are easy way (or heck, a complicated way) to find and remove these faces?
I'm also not sure what those long triangles are that are on the front and rear surface of the coin. The edges are uneven purposefully - the edges were extruded some to give it a very uneven feel.  When I select a face on the UV window, no part of it looks particularly strange.

EDIT:
Issue area:

The shape changed, but now I have these two rings (I have them lying atop one another currently while I was trying to figure it out) that don't seem to be visible faces, but increase the face count by more than double.  I believe I should have 34 total faces.  So this and trying to figure out why my UV unwrapping doesn't seem to go into the export file.  Oy!

Could you upload blend file to: http://blend-exchange.giantcowfilms.com/ and mark on the screenshot what exactly you want to remove?

Ugh, actually I think I have it figured out.  It looks like I forgot to reset my scale to make everything 1.0, 1.0, 1.0 after I'd resized it.  Of course, now it seems that despite having unwrapped it and it looking good, my unwrapped UVs are being stored in the export (Painter is saying that my mesh has no UV coordinates).  Is there some step required to "bake" the unwrap?

Nope, I take that back, there are still a ton of extra faces.  I'll upload it.

Tip: if you tap 'L' (lowercase) while hovering your cursor over a vertex, it will select everything that's directly attached to that vertex. So, if you deselect everything, you can use 'L' to select only one of the overlapped rings, and move it away from the other. The same works in the 3D view.

I'm making an answer, it seems that the only way to make something out of it is recreating this coin.

@Matt - I tried this in both 3D and UV views.  In 3D, there's nothing I can select and press 'L' on that also highlights those errant faces.  In UV, I can select one, press 'L' and look around on my 3D view, but I can't see them selected anywhere.

If you press 'L' in a view, it'll select things in that view (3D or UV, but not both). That is, unless you have this setting turned on: https://blender.stackexchange.com/a/3255/1653

Another approach would be to use 'L' to select whatever you can in the 3D view, press 'm' and move that selection to another layer. Whatever is left will be much easier to see/select. Once you've cleaned up, you can move everything back the the first layer.

Okay, using that setting allowed me to move just those faces out of the way and delete them with 'X'.  That's hugely helpful, and I'm back down to 32 faces.  Thank you!  Any tips on the UV Unwrap not being exported?  It says an unnamed mesh, but I believe the mesh is named "Coin".

First of all lets start by pointing out what's not ok with your mesh.

It seems that you have there not one coin but three of them. As pointed by @Matt you can select loose parts by hovering over them and pressing L. Remove both of them.
After deleting them Select All (A) then W > Remove Doubles.
If you want to select UV Island in UV Image Editor and see it in 3D view as well, you need to check Keep UV and Edit Mode selection in sync option (marked on the screenshot). Remember to be in Face Select mode if you want to use Island Selection (L).

Consider filling top and bottom faces with Triangle Fan or Grid Fill (based on mesh purpose) as ngons could not be the best choice for texturing.

At the end don't forget to Recalculate Normals > Ctrl+N.

Blend file:

Thank you, LukeD, that's incredibly helpful.  I'm not sure how the other coins got in there.  My steps to create were basically: Create cylinder, scale axis down to flatten it, apply scale, extrude vertices to make the rough edges.  But, I'm an utter newbie to Blender, so I may have inadvertently done something else that I'm not aware of.  If I can't figure out the UV Unwrap thing, I'll probably just create a new question specifically for it, but I'm going to keep plugging away.

@JesseWilliams For rough edges you can always make Cylinder, scale it properly, go to edit mode, Select All and then Mesh > Transform > Randomize and tweak settings. Also check my answer here: https://blender.stackexchange.com/questions/78358/how-to-straighten-curved-uvs-into-straight-belt/78362#78362 it will help you to have straight UV islands ;)

Oh very nice! So much to learn. Developing a video game is great fun, not having or being an artist is kicking my butt. I've been learning Substance Designer (which I love), but now I need stuff to poly those substances to. This is causing me grief lol. Most of the tutorials I've found either assume a certain existing level of knowledge, or are difficult for me to follow. Thank you for your very thoughtful answer and link.

@JesseWilliams  I don't want to advertise anybody in particular but I cannot say it differently. Blender Guru has some nice beginner tutorials, and paid ones from CGCookie are really great.


text:
Assign variable selecting vertex group in blender
I have a mesh with particular vertex groups that form a circle around different sections of the mesh. I want to be able to call those vertex groups using a single variable name (radius 1, radius 2). I've been using bpy.ops.object.vertex_group_select() to select vertex group (but vertex group name must already be highlighted under "Vertex Groups" header. Is there a way to code a variable, that will select an individual Vertex Group when called?

This is a python script which will select all the vertices in a vertex group with weight>0.5
import bpy
import bmesh

def selvg(obj, name):
    bm = bmesh.from_edit_mesh(obj.data)
    for i in range(len(obj.data.vertices)):
        try:
            s = obj.vertex_groups[name].weight(i) >0.5
            s=True # or maybe you don't care what the weight is, and even weight 0 is acceptable
        except:
            s=False
        bm.verts[i].select = s
    bmesh.update_edit_mesh(obj.data)

selvg(bpy.context.active_object, "Group")

Nice one. Though I would suggest to replace the try-except clause with a condition obj.vertex_groups[name].index in [ g.group for g in obj.data.vertices[i].groups ].

That alteration might not be effective.  When I print out [ v.groups[:] for v in obj.data.vertices ] I get [[], [], [], [], [], [], [], []] .  Since vertex groups are per-object (not per-mesh) I am not surprised.

Yeah, verts that are not part of any group will have an empty list, though that should work to differentiate between those included in the vgroup of interest and those that are not. But hey, the try-catch solution seems fine, I'm just biased against using try-catch when it's not absolutely necessary :)

Thank you for the help! I don't receive an error message when I run the script in edit mode, however it only seems to move the 3D cursor to the location of the vertex group, it isn't selecting all of the vertices within that group so I can create a variable out of it that can later be called for further operations. You'll have to forgive me for not fully understanding as I've only learned Python within the past week (the joys of getting my MSc), but would you mind explaining the code a bit more, maybe I'm missing something?

Perhaps it is because some of the vertices in the group have a weight <=0.5 .  I have modified the script with an s=True so you can try that variation.

So according to other chains the following code should work to select a Vertex Group based on its index
bpy.context.object.data.vertices[0].groups #calls the first vertex group created
However it only seems to select the final vertex group created regardless of which index I enter, any suggestions or edits?


text:
Can I use a texture as hair density map?
I would like to use a texture as density map because it can be much more precise than a vertex group, is it possible? In Cycles render.

You want to make it in Cycles or Blender Internal?

In Cycles select the mesh, give it a material, then go the Particles header and add a new texture in the Textures panel.

Prepare your black and white density map. Here's mine:

Next go to the Texture header, add a new texture (Image or Movie) and check the Density checkbox in the Influence panel. Note: I also checked the Lenght checkbox to make the render look more clear.

In Blender Internal you can do it the same way. After giving the mesh a material and the particle system you go to the Texture header-->Particle Texture button, load your texture as Image or Movie and select what kind of influence on particles it should have.

I just want to note, that if you need to remember that by default it uses Generated Texture Coordinates, so you have to switch it to UV if your mask depends on it.
Also you need to redo the settings for every particle system, it will keep the texture andcolor space but nothing else, not even the texture coordinates as far as I am aware of.


text:
Making an edge parallel with another
Edit: Changed the screenshots and some of the descriptions to be clearer
I was trying to make an edge parallel to another according to the slow, accurate way stated in this page: How to extrude a face parallel to another?
However although the vertex aligned itself with the pivot point, it went downwards, distorting the edge it was subdivided from.
I'd like to have all the bottom edges stay parallel to each other, i.e the parallel with the edge marked with red colour. The subdivided vertex, however, creates an angle on the now separated edge after aligning itself with the pivot point.

The edge I'm trying to create is marked blue in colour, and I need it to be parallel with the green edges while allowing the red edges to remain a straight line. The yellow point would be the subdivided vertex.

I need it to behave like a sliding vertex along the edge while parallel to the frontal slope (i.e the green edge marked above). Simply sliding the vertex won't work because I don't know if it's parallel with the green edge.

I can't really understand what problem you are confronted to, seeing your object it seems you should ring select your edges and subdivide, then slide the edge loop (shortcut for all three operation in one move is ctrl+r if I remember). Anyway by double pressing g you make any move a slide along edge.

@Yvain Not only I need the vertex behave like being slid, I need it to align with the pivot point at a certain degree so that the edge it creates will be parallel to the frontal slope. Please refer to my new screenshot.

what i would do (if your two adjacent edge form a loop) is CTRL+R and before clicking to apply, slide the edge up to the extremity so that is sticks to the border, now you can double G and slide it to the proper position.

It's difficult to see from your screenshots, but what you may need to do is apply the object rotation and scale before you add that extra vertex.
Try this:

come out of Edit Mode and enter Object Mode again
with your object selected, hit CTRL+A
now select Rotation and Scale
enter Edit Mode and try again

Without this, Blender will often produce unexpected effects when editing the object further, particularly if you've scaled a primitive in one or two axis before editing it.
Good luck!

Well... That didn't work...
I have changed the screenshots to be clearer on what problems I faced and what I'm trying to achieve. I hope this helps.


text:
Remove selection overlays when Editing UVs?
How can I view my meshes UV's in Edit Mode without a selection overlay? I want to be able to view my object with its texture map (and edit it) without having highlighted vertices/edges/faces obscuring my view.

You can turn off vertex highlighting in Edit mode, if that's really what's bugging you

@Gwenn, how do you do that?

In the Transform menu (right-hand side), scroll down to 'Mesh Display' and uncheck everything

I think you could phrase your question more usefully How can I view my meshes UV's without selection overlay. Currently you are asking for a specific answer, rather then asking for a solution to the problem you describe.

@ideasman42, so it's not possible to edit UV's without entering edit mode?

@CharlesL, Correct - you can't edit UV's outside of editmode - unless you count using scripts or modifiers which can change UV's but I don't think this is what you are asking.

@ideasman42, in that case I will rephrase the question.

Personally I just flop in and out of edit mode a lot no matter what I'm doing… returning to object mode also updates the object mode undo list which can be handy…

You can get close (though you still need to keep Edit mode enabled):

In the 3D View's Properties region (N), go to the Display panel and enable the Only Render checkbox
In the Mesh Display panel, disable all of the overlays
Change to Edge Select mode in the 3D View (this at least hides the vertices, although the edges will still be highlighted).

And if you enable the UV Select Sync button in the UV editor (it's in the header), then the only edges you'll see in the 3D View are the ones that are selected in the UV editor.

"Edit Mode" is required for UV editing. Here's a workaround for your display issue:

Use the Array modifier to display a copy.
Use View > Clipping Border (Alt+B) to display only the array instance.
Toggle the mesh cage as needed using the  button in the modifier header.

Not really a fan of this, while it works array modifier is slow for high poly objects and an unnecessary step if all you want to do is to tweak drawing options, which you can do without using the array modifier.

Indeed, but hiding the selection/vertices was specificity asked for, and can't be done using the display settings.


text:
Bool Tools difference problems (multiple objects)
I created 5 objects which I have joined into one, applied transforms, then attempted to use the Bool Tools difference to remove it from another object that currently has another difference applied, and I'm getting undesired results.
Following other questions about problems with the boolean in Blender, I've checked normals, checked faces, but must still be missing something.
Objects Pre-Bool Tools Difference:
https://snickers.org/~davis/blender/objectspreboolean.jpeg
Results of Difference:
https://snickers.org/~davis/blender/booleanresult.jpeg
Normals and Faces of Diamonds used for the difference:
https://snickers.org/~davis/blender/dimondfacenormals.jpeg
Normals and Faces of Star:
https://snickers.org/~davis/blender/starfacenormals.jpg
Should I be using Bool Tools Difference on each diamond individually instead of join'n them together? My 3D background is cough from mid 90s POV-Ray so Boolean is my default thinking which I am attempting to un-learn.
Source File: https://snickers.org/~davis/blender/start003.blend
Edit: Blender Version 2.93.6 (2.93.6 2021-11-17) under Mac OS X Mojave

Is this the desired result?

Then delete both modifiers from Object Circle.005.
Next select 'Circle.005' as Object to second boolean modifier of Object Circle.003.
A red modifier icon means incorrect settings. This modifier will not work. Here I can't see any any advantage to handle the pieces individually. Merging them before boolean operations makes it easier. But maybe different names for the objects?


text:
Creating custom node types for geometry nodes
is it possible to create custom nodes for the geometry node editor (NOT node groups, combining blender built-in nodes), define inputs and outputs and execute some python code in between? I couldn't find any information about completely userdefined nodes nor tutorials anywhere.
Further information about the usecase:
I want to create a node, which executes a more elaborate python code involving some linear algebra and finding eigenvalues of matrices. Therefore I created a python code using scipy, installed the scipy package in blender and I am already able to execute it within blender in the scripting environment and it outputs the correct values in the system console. Now I want to take the input values from a geometry node (position in x and y), calculate the output value of my python function and assign it as a z coordinate to all my verticies.

No, it's not possible.  The developers have never exported an interface to python that would allow doing so and have routinely said that for performance reasons they would not.

ahhh, thats too bad. My problem is, that the operation is too complicated and can't be expressed as a combination of math nodes as far as I know. Due to the fact, that one input value of the matrix process has to be animated, I can't precompute the values in a different script and apply them as a displacement texture.

instead of giving up or fixating on GN i would think about animation nodes or sverchok. There you can execute python code and use that result. And yes, you can combine animation nodes and geometry nodes.

Thanks Chris! I managed to use animation nodes(AN) and created my geometry inside AN, moved my verticies with some python code, thats it. perfect! thanks, I was not aware of AN.

While there is no python API (and no plans to add one), the internal C++ API is fairly concise. I recommend this article on how to add your own geometry node: https://blog.exppad.com/article/writing-blender-geometry-node

Is there a way to create custom Node types or Nodes Categories using Python?

I've found this method:
import bpy
from bpy.types import Node, NodeSocket

class MyCustomNode(Node):
    '''This is a custom node that multiplies two inputs and outputs the result.'''

    bl_idname = 'CustomNodeType' # Unique identifier for your node type
    bl_label = 'My Custom Node' # Display name for your node

    # Define the input and output sockets for your node
    my_input_1 : NodeSocket
    my_input_2 : NodeSocket
    my_output : NodeSocket

    def init(self, context):
        # This method is called when the node is created
        self.inputs.new('NodeSocketFloat', 'Input 1')
        self.inputs.new('NodeSocketFloat', 'Input 2')
        self.outputs.new('NodeSocketFloat', 'Output')

    def update(self):
        # This method is called when the node updates
        self.outputs[0].default_value = self.inputs[0].default_value * self.inputs[1].default_value

# Register your node type with Blender
bpy.utils.register_class(MyCustomNode)

Simply execute the script, then add it to your nodes:

I was searching too, I'm just testing to go further...
Blender v3.4.1 - It's now possible -

Hello ! Have you tested this ? It doesn't work.

Interesting approach, but unfortunately I have to confirm what @Gorgious noted: The node is visible, but the values are empty (tested with 3.4.x and 3.5.x).

Hi, yes that's what I said at the end of my post :
"I'm just testing"... the node is created in the interface.
It seems to be good to respect the connections types between nodes.
Now I know nothing about the "update" function
It's just a try, let's keep on going =)

I was searching for other tools I need, before coming back to find a complete solution...
you can find :
update()
Update on node graph topology changes (adding or removing nodes and links)
Here : https://docs.blender.org/api/3.4/bpy.types.NodeInternal.html#bpy.types.NodeInternal
My example is missing the method to be called on input values changing, I guess...

I've found this :
socket_value_update(context)
Update after property changes
but it's not called on inputs changed ...
Almost searching

there are complications :
https://projects.blender.org/blender/blender/issues/67649
PS: old posts, real situation to define...

may be a way to do that
https://gist.github.com/strike-digital/0b5a2c0111f1aec3923b5fd17d1881e2
lines 40, 218, then 248

Your approach can work as a kind of a wrapper for a driver, or a more elaborate driver. It can modify 'default values' of standard nodes, it can provide some cool interface to the user, but it can't ever process data evaluated in geonodes, not without going to extreme lengths by detecting a change in the node tree, inserting some kind of output node (e.g. spawning a point based on a value of interest), evaluating the modifier (if there's more, disabling all modifiers below current), reading a value in the evaluated object...


text:
Render opaque object as background
I am attempting to render 2D sprites for a game. Optional components of objects are rendered as separate sprites and layered on top. Depth sorted is created by cutting out parts of the sprite that would be occluded. Is there a material or render setting that occludes objects behind it while being invisible after rendering?

The solution is the use of Holdout material or the Holdout property of collections: https://www.youtube.com/watch?v=JpdmneLtlXQ


text:
Blender 2.8 Grease Pencil - How to draw continuous lines
How can i draw continuous lines in blender 2.8 grease pencil?
I can click on draw shape - select line but then i can only draw one line between two points i want to be able to carry on adding more points and for the line to be connected.

To draw a polygon (i.e. a set of connected lines), use the Poly function. It's right next to the Line button:

Hi, I do not have that option ... please see the picture i edited my question with after your answer - i definitely do not have the poly option...

@Kommando1980 oh, your interface seems to be different, maybe because you're using the experimental 2.8. See if you can get the Tool Shelf in the 3D view by using View > Tool Shelf. Then, you will hopefully have the same options in the Grease Pencil tab.

Hi, thanks for the reply - I could not find such an option unfortunately in the 2.8 build. I am trying to learn blender using the experimental build since i am not doing any production work yet. if you do however find that option in the 2.8 build please let me know

You can go to Edit Mode and each frame extrude the last vertex, then it looks like the line is continuous.


text:
Not executing commands immediately
For example, I press left click on the 3D view to change my cursor position. Nothing happens until I do something else, for example zooming in/out.
Also, I press 'T' to hide the tools panel. It just does it after doing something else.
In summary, whatever I do, it gets executed/showed up with "one instruction of delay".
SORY if it's a noob question
Update:
I tried Blender 2.7 and Blender 2.79.
Both on Windows 7 64 bits
Resolved :)
Now the behaviour is correct, with these Window Drawing Method configs:
Window Draw Method: Full
MultiSample: 2
Region Overlap checkd

Obviously this is not typical behavior.  No matter how long you wait, it never happens unless you perform another action?  And it always happens as soon as you perform another action?

Exactly as you tell

Its normally a problem with the graphic. Check that your graphics drivers are up to date. Also once you have done and if the problem is still there mess with the windows draw settings in user preferences. The settings under system.
Also have a look at these links
Link
https://www.blender.org/forum/viewtopic.php?t=28035


text:
How to make "Himalayan" rock salt chunks in Blender
Dear experienced Blender users,
please help me finding a solution for the following task:
The material I am looking for respectively that I would love to know about how to create it in Blender is:
Rock salt.
Nice, pink-ish to orange colored chunks of "Himalayan" rock salt.
You may know pictures like these:

If someone of you could enable me to get hold of a Blender material like this - it would help me so much to design items with or out of this material!
As you can see, it is somehow transparent and allows light to go through, it is rough and some areas are "white" where the chunks collided with each other. Some chunks also do have darker "inclusions" as you might recon on the tealight. So, it's quite a challenge and would for sure cost me the next two years to find out alone...
Your kind help and support would be highly appreciated and I want to thank whomever very, very much in advance already.
Thank you and please have a nice day!
Spotty110
Edit01: Btw, (and Thanks to Duarte Farrajota Ramos' comment!), I am still struggeling to learn how to model some decent chunks - I'm worlds away from even opening the node editor for a material... Forgive me!)

What have you tried so far? Could you show us your current material, and a screenshot of your node setup?

Ok here is something I made awhile back. It is really involved and maybe overkill. But it is a great learning experience.
I dont have time now but I will try to update my answer to fill in more details.
Its too shiny but this should get you started.
I got a lot of tips from this user.
https://www.blendernation.com/2017/03/23/gemstone-sculpting/
He also did a tutorial on how to do the shader.
https://www.blendernation.com/2017/03/25/gemstone-shader-breakdown/

Here is the blend file to mess around with

Here is another more simple set up that looks pretty good.

and this is the Gradient node you will need to build.

I made mine with only the default cube (I'm a purist)

I added some modifiers to get the rough shape, deforming in the z axis to make a crystal effect.

I added a volumetric with absorption and emission seperated by a texture sphere to get the glowing center.

On top I have added a glass node to make it a bit reflective.

Then I added the trace salt crystals as a texture on top of that.

All together

Its best viewed as a cube though ;-)

I can't see the images, but I've got the stuff at home, so I know what you need. Start off with the base colors. Imagine a perfect version of a rock salt, polished and all. I'd probably give it a pink-ish diffusion and a white-ish specular. Add some subsurface scattering, too. Now on to the discoloration. Use a generated texture map to modify the diffusion slightly, and use another to mess with the normals. Add a few spots of crusty white all over with (another) texture map, this time actually texturing it. Rock salt has cubic striations, so add a bump map that mimics this.


text:
Issues and troubles with a gold decal or gold foil sticker on a glass in Blender 2.8 upwards
I ran an old problem here (see an old post of mine dated back to 2017) - I recently switched from Blender Version 2.79b to 2.8 respectively 2.9...
When modelling some glass now for a new gold decal/foil sticker design, my render (Cycles) came out the way as shown below! Superstrange with a ghost picture. The glass is supposed to only show the decal to a restricted area (like the complete frog you can see...).
This is like what I want to build:

Oh, of course, I UV-unwrapped the section I wanted to put the decal on - I did it a lot successfully in Blender 2.79b, you know...:

But this is the Render outcome:

And this is the node setup I built and used:

And here's the "Frog Mask" I intended to use for the gold foil material - Black and Transparency:

The glass should be clear except for the centered complete frog design.
Oh - The Frog of course is not yet of a gold material - I just wanted to get the setup right first... But like 6 hrs up until now made no change...

The issue is not with the materials, but with how the UV maps are created. Please show an image that shows the whole UV map (in the UV map editor) to get better help. Basically you have a UV map that uses not only the area you chose for the frog, but other faces of the object as well. You can fix that by creating a new UV map just for the placement of the frog, or correcting the original one. The node setup  for the material is the same as the one for your original question from 2017.

Agree with susu...


text:
i am using sculpt mode in blender but when i use draw format in it it uses draw from both sides of the plane how can i draw it from one side?
As  my draw format of Sculpt Mode is working in dual form, please recommend a solution. I want to create something on only one side of my object.

Possible duplicate of How to get sculpting to stop mirroring?

@Timaroberts Until the OP comments, I don't think it's clear if they are talking about mirroring or backfaces.

If I understand right, you have a mirror lock on. While in Sculpt Mode, key T to toggle open/close the Toolshelf, then go to the 3D Viewport > Toolshelf > Tools tab > Symmetry/lock dropdown and turn off all of the Mirror: values.

Try this option, if I understood the problem ...

authors: Дмитрий Байстрюченко


text:
model flickers when I rotate the view
In my default startup .blend file, whenever I rotate the view, the cube flickers and duplicates like there are two of them. Watch this video to see what I'm talking about.

What kind of computer do you have? Your computer could be too slow to effectively run Blender.

Could be the mouse. Try swapping out your mouse

I've been told that some Mac users have been having this problem... maybe because of graphics card...
Try downloading the latest version of Blender and also disabling the Continuous Grab option @ User Preferences > Input tab.


text:
Procedural Snow with Particles
Basically, I want to have a quick way of simulating snow. My plan was to use particles to simulate where snow would fall, but I can't figure out a workflow. The only tutorial/article that I could find was one for 3DSMax. How can I do the same in Blender? The 3DSMax tutorial is 100% what i was looking for, but I can't seem to figure out how to do it in Blender.
Link to tutorial.
Hope you guys can point me to any plugins or ways of achieving that tutorial's results.
Thanks for your help!

After a lot of searching i did end up finding a plugin for Blender that does what i need! Its called Cubesurfer - its by Jean-Francois Gallant.
So what you do is spawn particals and the add on spawns mesh around those particals, if the balls of mesh touch it becomes one solid block. Then you need to smooth it all out with a smooth modifier. Done!

Could you include a link to this solution?

I've only a week ago done a basic but effective looking snowfall. I'll try and place the Blender file up here.  I used two emitters, one for distant flakes and another for closer and a circular variety.  The Blender file  (just over 3 MB)...

As for directional flow, go to the emitter's "Velocity" tab and drag X, Y or Z values to suit.  You can also turn gravity off if desired.  You'll find that under the "Field Weights" tab further down.
As snowflakes can flutter on the way down, I've adjusted the Brownian value in the "Physics" tab.
Apologise for the missing texture files - tried to pack them into the Blender file but it kept coming up with "cannot find errors" even when I moved the files into the project's folder and re-saved.
Everything you need is still there and the snow still works though. (CTL-A)
Screenshot -

While your post certainly looks like snowfall and does look nice its sadly not what i am looking for, please see rhe 3dsmax tutorial - thats what i am trying to recreate in blender as i dont own max. thanks

authors: Мария Насырова


text:
Adding a documentation reference for a custom Object attribute
It is possible to assign custom documentation webpages for operators by using a manual map:
def my_addon_docs():
    map = (
        ("bpy.ops.myaddon.bone_preset_*",            "/workflowpresets/"), # <== works
        # ...
    )
    return "https://some.website", map

bpy.utils.register_manual_map(my_addon_docs)

I have seen that i can also RMB on object properties and then call the "Online Manual" entry. However i can not see how i have to do the mapping from a custom object attribute to the webpage. I tried this:
def my_addon_docs():
    map = (
        ("bpy.data.*.RigProps.rig_use_bind_pose",    "/posing/"), # <== breaks
    )
    return "https://some.website", map

bpy.utils.register_manual_map(my_addon_docs)

But then i get an error when i try to call the online manual:
AttributeError: 'RNA_Types' object has no attribute 'RigProps'

bpy.data.*  has attributes like objects, meshes, speakers, cameras etc.  None of these collections have a RigProps pointer property.  Use the type that the custom property has been registered on.
Patterns must be all lowercase since this commit.
Small example, Object has an IntProperty named "example" registered.  Added UI in object properties name panel to test.
import bpy
from bpy.props import IntProperty
bpy.types.Object.example = IntProperty()

def draw(self, context):
    self.layout.prop(context.object, "example")

def my_addon_docs():
    map = (
        ("bpy.types.object.example",    "/posing/"),
    )
    return "https://some.website", map

bpy.types.OBJECT_PT_context_object.append(draw)
bpy.utils.register_manual_map(my_addon_docs)

In your case, I'd suggest using the map
    map = (
        ("bpy.types.object.rigprops.*",    "/posing/"),
    )
    return "https://some.website", map

Or if you have anchors (or query strings)
def my_addon_docs():
    props = ("use_xxx", "use_yyy", "use_zzz")
    map = [
        ("bpy.types.object.rigprops.%s" % prop,
          "#%s" % prop) for prop in props]
    return "https://some.website/posing", map


text:
Changing tooltip for menu entries which use the same operator
I have created a set of menu entries which all use the same operator, but with different operator parameters:

As it is now all menu entries show the same tool tip. But i need to add different tool tips here so users can be better informed about what the different entries do. The only idea i have so far is to create a unique operator for each menu entry. But how can i do this dynamically?
Or is there a better solution to get different tool tips for each of the menu entries?
Here are the menu and operator that i use (simplified):
class MyAddMenu(bpy.types.Menu):
bl_label = "MyMenu"
bl_idname = "OBJECT_MT_my_add_menu"

def draw(self, context):
    lo = self.layout
    op = MyAddItem.bl_idname
    ps = get_p_list_from_somewhere()

    for p in ps:
        text = "entry-%s" % p
        lo.operator(op, text=text, icon='OUTLINER_OB_ARMATURE').p=p

class MyAddItem(bpy.types.Operator):
    bl_idname = "OBJECT_MT_my_add_item"
    bl_label = "Add Item"
    bl_description ="The operator Tool Tip"
    bl_options = {'REGISTER', 'UNDO'}

    p = StringProperty()

def execute(self, context):
    # Do something
    return {'FINISHED'}

Defining dynamically an operator class for each item ? (just an idea... dont know if it can work...)

FYI related : http://blender.stackexchange.com/questions/56741/register-class-and-readonly-state-how-to-for-dynamically-generated-operator-c . If this can work, you can have op with its own tooltip (waiting for an answer)

What about an enum property?  For instance the add lamp menu gives a different icon and tooltip based on the bpy.types.OBJECT_OT_lamp_add.bl_rna.properties['type'] enum.  (layout.operator_enum) Or depending on the list, set up your own dynamic enum property, display with layout.prop_menu_enum,  and call the op via the enum's update method.

It Is seems that this will be soon officially implemented in 2.81
Webpage:
https://wiki.blender.org/wiki/Reference/Release_Notes/2.81/Python_API
It gives the following code example:
class WM_OT_tooltip_test(bpy.types.Operator):
    arg: bpy.props.StringProperty()

    @classmethod
    def description(cls, context, properties):
        return "Arg is: " + properties.arg

While i think that all answers above can be helpful, i decided to use the new option for having a dynamic description() function. this matches pretty well to my case.

Using a dynamic operator enum property
Add a custom property "prop" to the scene to show dynamic behaviour.  Once added will add a new item to menu.
import bpy
#populate itemslist
def items_list(self, context):
    items = [
        ("RED", "Red", "This will add RED",  'OUTLINER_OB_ARMATURE', 1),
        ("GREEN", "Green", "This will add GREEN",  'OUTLINER_OB_ARMATURE', 2),
        ("BLUE", "Blue", "This will add BLUE",  'X', 4),
        ("YELLOW", "Yellow", "This will add YELLOW",  'BLENDER', 8),
        ]
    # test dynamic by adding custom prop "prop" to scene
    if "prop" in context.scene.keys():
        items.append(('BLACK', "Black", "This will add BLACK", 'BLANK', 16))
    return items

def draw_enum(self, context):
    self.layout.operator_context = 'INVOKE_REGION_WIN'
    self.layout.operator_menu_enum("object.simple_operator", "type", text="My Menu")

bpy.types.INFO_MT_add.append(draw_enum)

class SimpleOperator(bpy.types.Operator):
    bl_idname = "object.simple_operator"
    bl_label = "Add Avastar..."
    bl_description= "Avastar"
    #bl_options = {'REGISTER', 'PRESET', 'UNDO'}
    #dynamic enum property
    type = bpy.props.EnumProperty(items=items_list)
    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    def execute(self, context):
        print("run with ", self.type)
        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

PS: from your screenshot it looks like you are using presets, check out Python add drop down menu that stores data  The preset code is in 2.77/scripts/startup/bl_operators/presets.py

I understand nothing about how all that interact... could you please explain a bit more ? (I am very new to Python). What is "bpy.types.INFO_MT_add.append(draw_enum)"  doing ?

@lemon It appends the draw_enum method to the Add menu (bpy.types.INFO_MT_add ... used to be in the INFO space, hence the break from usual naming convention. MT for menu type OT for operator type PT for panel type.  Can see the menu id by mousing over and the source by right clicking and selecting view source.

still lost (sorry)... Where is that (bpy.types.INFO_MT_add.append) documented, please ?

https://www.blender.org/api/blender_python_api_2_77_0/bpy.types.Menu.html#extending-menus

thanks again ! (ok I know I should avoid thanks... but I need to here...)

You can dynamically define a class at runtime and give each one some unique properties. I would define a base class that performs the needed actions to create an object from a data file and then create a custom version for each object. We can't access the filesystem when registering an addon so we will need to keep a list of available objects that exist in a data directory.
Start by defining some variables -
obj_dir_name = 'custom_data'
obj_list = [
    'Female_body',
    'RacingCar',
    'iPhone',
    'Male_body',
    'Tank',
    'Toaster'
]
custom_items = []

Then define a base operator that can read the object data and create the objects. In this example I just open the file and create an empty with a matching name. If you can keep all the needed data to make your objects in the one file then you can change obj_list to be a list of classes or functions that make each object.
class CustomObjectBase(bpy.types.Operator):
    """Base for adding a custom object"""
    bl_idname = 'object.add_custom_item'
    bl_label = 'Add Item'
    bl_description ='Base operator for adding custom objects'
    bl_options = {'REGISTER', 'UNDO'}

    obj_file = bpy.props.StringProperty()

    def execute(self, context):
        with open(self.obj_file, 'r') as f:
            # read data and create mesh
            obj_name = os.path.basename(self.obj_file)
            obj = bpy.data.objects.new(obj_name, None)
            context.scene.objects.link(obj)
        return {'FINISHED'}

Then we can create an operator for each object and dynamically fill in properties to make each one unique. The bl_description property is set to define the tooltip for each item, the bl_label is also set and will be used to display the item in the menu.
def addCustomItems():
    for obj_name in obj_list:
        op_name = 'object.add_custom_' + obj_name.lower()
        data_file = os.path.join(os.path.dirname(__file__),obj_dir_name,obj_name)
        nc = type(  'DynOp_' + obj_name,
                    (CustomObjectBase, ),
                    {'bl_idname': op_name,
                    'bl_label': 'Add a ' + obj_name,
                    'bl_description': 'This adds an ' + obj_name,
                    'obj_file': data_file
                })
        custom_items.append(nc)
        bpy.utils.register_class(nc)

You can find a complete example of this as an addon here which also adds a submenu to the add objects menu.


text:
How do I add a panel to Object Properties?
I'm creating an add-on with a custom object. When I select the object, I'd like to be able to edit some custom properties of the object with a small panel. I'd prefer to put it in the object properties menu, here:

How do I go about creating and adding a panel here?

To create a custom panel you subclass bpy.types.Panel and set the space, region and context to suit. Setting the space and region to PROPERTIES and WINDOW will place the panel within the properties. Without a context it will show in every section, object will place it only in the object properties.
class testPanel(bpy.types.Panel):
    bl_label = "Test Panel"
    bl_idname = "OBJECT_PT_tester"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = 'object'

    def draw(self, context):
        row = self.layout.row()
        row.label(text='stuff here')


text:
How to use vertex weight to control gravity strength in particle system?
I want to use preset vertex weights to control the strength of gravity in the particle system, but I found that the gravity option only supports textures.
So is there a way to convert the vertex weights I set into textures or something. My vertex weight is a animated weight, generated by the Vertex Weight Proximity Modifier, and the result will be that the upper position is always affected by less gravity (the circle is constantly rotating).

Would geometry nodes solution ok for u?

Yes. Please!! Thanks~

can you link a video how the end effect should look like please? because i am still not sure how it should look like...

meanwhile you could read this: https://blender.stackexchange.com/questions/15167/weight-paint-in-cycles-nodes/109099#109099 ...this might help you

I'm sorry for my expressiveness. The torus I posted works as a particle emitter, and I want the emitted particles to be given the corresponding gravitational strength using vertex weights in picture.(The way the ring rotates is like a ferris wheel thing)

ok, here a solution with particles:
I have a torus with a force like this:

so the force will be driven by the surface.
I added a vertex group to the torus with all vertices.
And i added the vertexweightproximity to the torus with the sphere as "reactor", which i animate in a circle along the torus, and with a mask modifier i delete parts of the torus and the force modifier at last.
Result looks like this:

Note: i turned gravity completely off for this so the particles are only influenced by the force.


text:
How to subdivide a bone already linked to a mesh?
I'm a beginner in Blender but I will try to describe my problem as proper as possible:
I downloaded a blender file. It contains a mesh and a complex armature system with bone groups and many bones. I have a bone (a bone of a whole finger) and I want to modify it. The tale of this bone is linked to the hand bone. The head of it is free. If I rotate this bone in pose mode, the mesh (finger) follows the rotation. But if I subdivide the bone, only the original one will drive the mesh. If I rotate the new bone (last fingertip), it won't affect the mesh. So basically I want to make the armature more detailed. Is it possible to subdivide bones and keep the behavior of the armature at the same time? Many thanks!

You can subdivide the bone. Then to recalculate the influence you can try this: Select the armature, shift select the object, switch to Weight Paint mode, select the bone you want, go into the Weights panel and choose Assign Automatic from Bones:

If it doesn't work right, you need to paint manually. Or you can assign the vertices to the correct group in the Object Data panel > Vertex Groups. You'll see that the Assign Automatic from Bones has created a new group for the new bone:

Many thanks! I will try them!


text:
How to export node tree to mtl
I created a nice "Pattern" using the node editor,
When I try to export it to .obj and .mtl file
and use it in website, using Three.js.
But I found my nice pattern were gone, only the basic color left.
What should I do ?
What I am trying to do is to create a generic model, and a set of materials to apply

You cannot properly export a node based material from Blender with all features like the original material.

Currently I am baking the material into image, but lighting is an issue... my material mostly based on roughness

As stated in multiple answers across Blender Stack Exchange, many softwares (and Blender is no exception) and render engines have specific features that are strongly related to this particular engine/software and cannot simply be transferred. Even within Blender itself, depending on which render engine you use, Cycles or Eevee, not all options and nodes are available in both, neither do they always look the same even though they are available for both. If you then use some other renderer like LuxRender or Octane etc. you have to create different materials for them as well.

If you're exporting to three.js, the best option would be to use Principled BSDF materials — with baked textures — and export to glTF. You can find examples of the materials supported for export in the Blender glTF addon documentation. Properties like roughness and metalness are supported in glTF, but not in OBJ/MTL.


text:
Mesh jumping to armature origin with automatic weighting
I have an issue in blender where when I assign automatic weight to the object's mesh. It deforms to the object's origin.
This is a video showcasing the issue.
I use Rigify to generate the armature and Blender 2.9. The topology of the model is good. I am really at my wit's end with it.

We need to see what the rig looks like in the rest position.  It looks as if somewhere or another, some bone in it posed strangely.  If this is a straight "generate rig" from the metarig, then something has gone wrong with the bone constraints.

I Think this is what you wanted correct? I also set the origin of the armature to the 3d mass and it changes the way the automatic weights work. It always seems to point towards the origin point. Video of rest position

Then there's something weird going on with the constraints in the rig.  I'd have to see a file to be able to tell you more.

Okay, So here is the blender file Here
Sorry for taking four hours to respond.

There's something really weird going on there.  I don't know what it is; I suspect that something is way bugged.  I'll continue to look, will let you know if I figure anything out.

Let's generate a rig and then look at the deform layer.  I'll disable shapes so that I can see what I'm doing.  I'm using b-bone display instead:

So the reason I'm using b-bone display here is, because, look at that bone I have selected-- for some reason, your metarig has generated this as a 10-segment bendy bone.  It shouldn't be; that's basically turning all of your deform bones into tentacles, which are deforming even in rest because of their intro/outro angles.
To fix this, simply set all the deform bones b-bone segments to "1":

Switch rig to layer 30 (deform bones.)  Select a bone, then select all bones.
On properties/bone/bendy bones, set Segments to 1.
Right click in the same segments field and select "Copy to Selected".

Now, you can parent it to the armature with automatic weights and it'll be fine.
I have no idea how Rigify thought that it should turn all of your deform bones into bendy bones-- I'm not up on all of the customization that can be done with Rigify armatures-- but that's the fix.

You are amazing. Thank you so much.


text:
Why is my texture pink in material material preview, but not in rendered view?
I'm a beginner in Blender, and from my understanding, when a texure is pink it is because something is wrong with the file, or the reference to the file. However, my texture is showing in rendered view, but not in material preview. How can I fix this issue?
Material preview:

Render preview:

please provide blend file

solid view can have textures as well, you can see that bottom part has some texture and top is pink because texture is missing... providing your file would solve that, please don't forget to go to File > External Data >Pack all into .blend

If you are using Nodes make sure the Material Output node is set to All.
The menu allows you to create shader variations depending on the active rendering engine, but if a material doesn't have an output for the current one it shows up as pink.
For versions 4.2 and later, Blender allows to connect nodes in a way that it's wrong and it results in pink color. For me the problem was a combination of displacement map, normal map and bump nodes.

I am not sure why anyone gave you -1, this is the best possible solution in this case if we don't have his file, I am giving you +1

Doing this fixed my problem, thanks!


text:
Extracting internal forces of cloth simulation springs for manipulation in Python script
Is it possible to extract the simulated forces per-frame per-vertex in the 4 springs as described here Link?
I have come across this Mesh Tension Tool which infers strain(tension) through mesh deformation(new_edge_len/pristine_edge_len), but preferably would be better to access the numeric data in the simulated spring directly.
I have dug around the Blender API (BMesh in particular Here), but not sure if the data is stored with mesh data/exposed by the API. The cloth simulation setting (Here) variables appear to be as described, settings only. Given that we can define the maximum of these forces (Here), I assume that there will be some way to access these values per-frame per-vertex, rather than just user defined settings?
Would there be any possibility of getting in touch with the cloth simulation authors regarding the feasibility of this?
Thank you!


text:
Blender 2.77a crashes on startup
Receiving error when starting Blender:
C:\Program Files\Blender Foundation\Blender>blender
Warning! Legacy WGL is unable to select between OpenGL versions.found bundled py
thon: C:\Program Files\Blender Foundation\Blender\2.77\python
Fatal Python error: Py_Initialize: unable to load the file system codec
  File "C:\Python27\Lib\encodings\__init__.py", line 123
    raise CodecRegistryError,\
                        ^
SyntaxError: invalid syntax

Current thread 0x000008d4 #most recent call first

Note that I have a full version of Python 2.7.12 (32-bit) loaded at c:\python which is the default Python found when using my PC.

Found that I had PYTHONPATH set as an Environment Variable so I'm going to set up a batch file that resets that var before starting Blender.
This does resolve my issue, for anyone else with the same problem.

authors: Максим Демиденко


text:
Pose mirroring wrong
Blender newbie here. I have a problem mirroring poses that's giving me a headache.
When I mirror, for example, the left leg, the right leg isn't
correctly mirrored; it's rotated for some reason.
I've read possible solutions and watched some videos,
but I still get bad results.
This is what I do:
First, I create the bones I need:

I placed the 3D cursor at (0, 0, 0).
I select all of them except the torso and head bones. I key Shift + D, then Esc, then Ctrl + M, then X, and finally Enter
to create a mirrored copy. Afterwards, I key W to open the Edit Mode Specials Menu and select to Flip Names.

Once that is done, I go to Pose Mode and move some bones on the right side:

Then, with those bones selected, I press Ctrl + C, then Ctrl + Shift + V to paste mirrored,
but this is what happens:

What could I be doing wrong?

I solved my problem.
For every bone in Edit Mode, I had to set the Roll value to 0.
Then, for some bones with Bone Constraints, I had to set the Pole Angle to 0 or 180.
Finally, I had to clear parents for my meshes and parent them to the bones again.

As you have discovered, mirroring bones like this will lead to incorrect rolls. There is a symmetry mode in edit mode that will help with roll angles etc if you do this again. After flipping the names, you should enable symmetry on the x axis and grab and release all the bones on one side so sync all the properties with the other.


text:
Make Less Water Come From an Inflow Blender
How can I make an Inflow release less water? I looked at the Inflow settings and there is nothing. What settings in the Domain (I would assume it is the Domain) would make it look like there is less water coming out of the Inflow object? I want there to still be the same amount of frames, have the water travels just as far (I can't just slow down the time), and have everything else look the same.

I'm sorry I was just working in Unity. It's in Blender

Lower the velocity you have set in the sources fluid settings. The velocity changes how fast water flows out of it. Also, scaling down the object can change the size f the stream that comes out.

That seems to help but then the water simply falls off of the inflow. Is there a way to give it more starting velocity while still keeping the amount of water outputted the same?

@DylanSiegler The only way (I know of) to change water output on an inflow is scaling the source object or changing velocity values. You can only change how much water comes out of it at once (The size, or scale of the object) and how fast that water comes out (Velocity)

@R00t I think its more the mass or volume of the object than the amount of vertices on that object.


text:
How do I get rid of this red dot
I have tried to look online but I haven't found anything. There is a red dot on my screen in only this blender file, and only in the layout tab. It isn't an annotation and it isn't an object, and it is in the same place regardless of how I move or rotate, it isn't attached to anything on the axis. Does anyone know what happened?

it looks like the origin of your object called Cube.044, no?

Press the period (full stop) key on the numpad. That should bring the object into view and you can then scroll the view out to see where it's actually located in your scene.


text:
Blender 3.0 Cycles Render Devices Missing - Mac Pro Monterey
I've been trying to read all the information I can on the new Cycles X AMD GPU support and thought Blender 3.0 would have the HIP option for AMD GPUs but the option is not populating in the Preferences > System window.
Mac Pro 2019
3.3GHz 12‑core Intel Xeon W processor
Radeon Pro W6800X, 32GB

I am sorry to tell you that version 3.0.0 only supports Rdna cards (like 6000 series)and Radeon Pro 21.Q4 driver+ if I read the information correctly, 3.1.0 should add more support but this is completely on AMD side being slow, not the Blender... It works on my workstation with 6700XT but doesn't work on my personal RX 580

Short Answer: You can't (right now). In March, it will be ready. Long Answer: If you really want to do it and you have no patience, here are the steps.
Step 1: Go to https://beta.apple.com/sp/betaprogram and create an Apple Beta account. Download the latest beta of macOS Monterey 12.3 Beta 3. After the update is complete, proceed to step 2.
Step 2: Go to https://builder.blender.org/download/daily/ and download any version of EITHER Blender 3.2 Alpha or 3.1 Beta, as long as it is February 16th or newer. (I recommend just downloading the newest). After doing this. Open up Blender and in the preferences, it should show your GPU. I've the same model and it is working for me. After selecting the GPU, go into rendered view in Cycles with GPU compute selected. It will say it is loading render kernels, and that is okay. Depending on the hardware of your computer, wait 1-5 minutes and after the kernels load, it should be good.
Note: Kernels will have to load every time you download a new version of Blender and/or update your Mac. However, the kernels will not have to reload every time you go into rendered view, only if you update.
Hope this helps.


text:
Merge by Distance/remove_double removes 0 vertices when scripted with bpy
I am having trouble getting Merge by Distance to work in a python script while it works fine manually in the UI.
When I run Mesh > Clean Up > Merge by Distance on a selection of vertices, the vertices are successfully merged.

The same selection of vertices is not merged when I have them selected and run
bpy.ops.mesh.remove_doubles(threshold=0.001, use_unselected=False)

Info: Removed 0 vertice(s)
{'FINISHED'}

Is there another step needed to script remove_doubles successfully?

My selection script below selects only the inner top layer of vertices that I want to merge but this issue happens if I just select any group of vertices in the UI so I don't think my selection is the issue.
import bpy

ob=bpy.context.active_object
verts=ob.data.vertices
for v in verts:
   if v.co[2] > 0:
      v.select=False
   else:
      v.select=True

bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_mode(type="VERT")
bpy.ops.mesh.select_more()
bpy.ops.mesh.select_all(action='INVERT')

bpy.ops.mesh.remove_doubles(threshold=0.001, use_unselected=False)

Your problem is caused by altered unit scale, which apparently you have to use to recalculate the distances on your own:
desired_threshold = 0.001

import bpy
from bpy import context as C

for v in C.object.data.vertices:
    v.select = v.co.z <= 0

bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_mode(type="VERT")
bpy.ops.mesh.select_more()
bpy.ops.mesh.select_all(action='INVERT')

recalculated_threshold = desired_threshold / C.scene.unit_settings.scale_length
bpy.ops.mesh.remove_doubles(threshold=recalculated_threshold, use_unselected=False)

Thank you, that did the trick. What is the difference between using object and active_object to access the object? I noticed that I need to select the object (so it is highlighted in orange) before running the script to get the vertices to select even though object and active_object both return the same last selected but now deselected object.

@ansonl you can compare active_object to object (same code)


text:
Automate preinstalled Add-On action (3D-Print Toolbox)
I've been using the 3D Print Toolbox Add-on in Blender to check for and fix non manifold edges and would like to automate the actions on a list of STL files. Right now I do the following:

Import an STL into Blender
Select the object
Open the 3D Print Toolbox
Use add on action under 3D-Print > Checks > Solid to check if the model has any non manifold edges
If there are non manifold edges, click 3D-Print > Clean Up > Make Manifold to repair the object
Blender then freezes while importing, checking, repairing, and exporting the file without a progress indicator or notification of success/failure which leads to a lot of manual checking if Blender has finished and "unfrozen" :(

Actions I perform are all the same in every case and I have a filepath for every STL I process. I looked at the 3D-Print addon code and have some programming knowledge but haven't found any resources on automating addon actions in Blender.
What would be the best way for me to automate this check and repair of STLs? Thanks!

You could use python and connect it to the 3D ToolBox, but unless you are going to find the same issue with the STL's your using there's really no way to do that...at-least at the moment (to many variables - overlapping geometry, missing faces, inverted faces etc... ).

@RickT Yes, using python to connect to the 3D ToolBox addon is what I would like to do. Most of my STLs have the same issues that 3D ToolBox is able to fix. Is there a reference you can point me to for connecting to addons?

you may want to contact one of the developers.  https://github.com/agapas/3d-print-toolbox-modified


text:
Make Hair Particles Glow or Emit Light
I know you can make objects glow or emit light with an Emission node, but can you do this with hair particles, too?

Absolutely! Just make sure the material option in the particles tab is set to the material you want, whether that be an emission shader or a hair shader.
Keep in mind that the material setting is a selection based on your objects material slots. If you select one of them, it will use that material, even if no parts of your mesh are assigned to it.

Idle Chit-chat
I can think of one simple, easy, two-part solution that produces something like the following result with no lighting except one point lamp at Emission: 100.

Solution
Part 1
Select the object that will emit the Hair Particles. Go to the Properties panel > Materials tab and add a new material. Name it "Mesh." This will be your mesh's material. Customize it as you will.
Add another material. Name it "Hair." This will be your hair's material. Set it to a Mix Shader with a Fac: value of 0.3 (you can adjust this to your liking), Hair BSDF in the top input, and Transparent BSDF in the bottom. Adjust the Hair BSDF's settings as you will, but make sure that the color is roughly similar to the Emission node's (brown and yellow, red and orange, yellow and white, et cetera). The Transparent BSDF should be pure white. Plug an Emission node into the Volume output. Set the Hex Color Value to F5FF4D. The Strength: can also be adjusted to your liking. After this, your material nodes might look something like the following.
Sample mesh material nodes (totally random; adjust to your material):

Sample hair material nodes (to my formula; adjust some things to your liking):

Part 2
Go to the Properties panel > Particle systems tab > Render dropdown. In the Material Selection slot, make sure Hair is selected. It should look something like the following.

If you so desire, you can examine the following .blend file, which includes the cube and hair from the top. You may have to resimulate the hair, though. Do this by keying Shift + LeftArrowKey to go to frame 1 and then keying Alt + A to cache. Let it cache until frame 31 (the frame I rendered).


text:
Have object rotate when player does
I'm still trying to get the fundamentals of the blender game engine down, but for now I have this:

The camera's position is controlled with W A S D, and the camera rotates to where the mouse is, like in Minecraft.
What I want to happen is when the player presses W, the cart moves forward, along with person while maintaining the same distance away. I thought about just copying the W to move forward from the camera to the cart, but that didn't work. Right now you have to actually push the cart and I don't want that. I also want the cart to rotate when the player does using the mouse using the origin of the camera as a pivot point. At first I thought using a game property, but apparently they're only relative to a single object? I've used a 2-D game engine before where you could make a property (called an Attribute) that was relative to the scene, game, or character. I'd appreciate it if it could be done using logic bricks, as I'm still working on Python. I feel like I'm not explaining this right, so just add a comment if you need clarification.

If your basically going to have the cart as the player's body, then parent the camera to the cart.
In this example, I'm using a pretty blue cube, and not a cart.

This is actually rather simple - you want the camera to be able to look around, and then drive the cube/player/cart in the direction the camera is facing, and have the camera follow? easy. I'm assuming your using the mouse look actuator on the camera.

If you are, delete or disable it for now, because there is a better way. While this works for the camera, it only works in terms of a spectator, free floating camera. This will make more sense if you think of it in terms of a battleship gun. On a battleship turret, the base rotates from left to right, and the barrel, mounted in the base, rotates up and down. Although the barrel can point in all directions, the base remains even. We want a setup similar to this. On the player/physics cube/ cart, put a mouselook actuator which only allows motion right to left.

Why is the Y disabled? In 2D terms, the X axis is left to right, and the Y axis is top to bottom. By disabling the Y, we are only allowing the mosuelook actuator to respond to mouse movement from left to right.
Now, if we push play, we should be able to move the mouse and rotate the camera from side to side.
Now, we can put the same logic setup on the camera, but this time, the mouse look actuator will only respond to mouse motion on the Y axis.

Now, we can put the WASD logic on the physic cube/player/cart/whatever, and it will move forward along the ground in the direction the camera is facing - not into the ground when looking down, or up into the sky when looking up.

Now, for new BGE users, I think it is sometimes helpful to play around with an already working file - see how or why things work. Staring at a blank file can only help someone so much, so feel free to play around with this blend.

Do I need to put them on a certain physics type, and I'm setting the carts/cubes parent as the camera not vise versa right? Cause it's not working. I must be missing something; Adding the .blend would help me a lot. BTW I like your tooltips

@SammySwanson added the blend file.

The always sensor didn't work, but using the mouse sensor and set to movement did...

Oh wait, nvm. I didn't click that little '  "  ' button!

How about parenting the cart to the player object?

While this may technically answer the question, it isn't much help to someone who doesn't know what that means.  Please add some more information and details on how to do this.

this would only work if the camera could only rotate along the Z axis. with his setup, when you look down, and press forward, you would be trying to drive into the ground.


text:
Edit Mode Wireframe + Translucent View?
I'm trying to texture a model I made with a texture pallet I imported into the Compositing View with Smart UV Unwrap, but when I'm in Edit Mode, the entire model is in a sort of mid-way-to Wireframe View in which everything is grey but still see-through and selectable through. When I key Z to toggle to wireframe, the grayness goes away and my model is simply shown in regular wireframe. From YouTube tutorials, I see no one with this issue. Please help!

Can you add a screenshot to clarify?

I assume you're talking about something like the following.

This is enabled by the Limit Selection to Visible button at the bottom of the 3D Viewport (). Clicking it will toggle the transparency.


text:
Origin of object not moving when armature moves the object
I have created a turret style gun in Blender for my first Unity game. I've created an object with a single face at the end of the gun barrel in order to attach a Line Renderer in Unity, but the line is shooting from above the barrel.
When I look in Blender, the origin of the single face is higher than the face itself. The reason is because I built the turret with its arm stood up straight and I have now used the armature to bend the arm into a shape similar to the less than symbol (<).
The turret is all one object and the single face is a child of that object. The single face follows the gun barrel perfectly when I move the armature, but the origin stays in its original position. If I enter edit mode the single face moves back to its origin. Even if I set origin to center of mass in object mode it still goes to the original position. If I apply the location of the face then the origin goes to 0,0,0 and the line renderer draws from the base of the turret.
How can I get the origin to move with the face/object so the line renderer draws from the correct position?

Armatures don't move the object's origin. That's just Blender.

Thanks for your reply. Is there any way to calculate the offset to make line render at the correct starting position? I.e. work out how much the bone has moved in relation to its original position? (Even though the default pose was positioned in blender)

Can you upload your .blend file to Blend Exchange?

Sure. It's my first time making a 3D model so it's not the best :P Plus the normals were wrong on some faces when I baked the texture, so the colours are dark in places and need to be redone lol. Here's the link: Turret Blend


text:
Dynamic paint effect disappears after first frame in rendered animation (waves lapping on a beach)
I'm using the beach (modified plain w/ textures applied) as the canvas and another plain with an Ocean modifier as the brush. All is visible and seems to work in Solid View when scrubbing the Time Simulator of the Ocean modifier.
And, I can successfully render a single image (Dynamic Paint shows up) at any random time.

The problem is with key framing the Time Simulator on the Ocean modifier. Although the Dynamic Paint animation seems to work in Solid View, it disappears after the first frame upon rendering the animation.

I'm stumped and have no idea how to fix this. It leaves me wondering if I've missed something fundamental.
I'd greatly appreciate some help.
Thanks.

Can you upload a .blend file to Blend Exchange?

Sorry for the delay. My bad. Here's the Blend file...


text:
Running a script via module vs script mode in the BGE
When a script is run via Script mode through the Python Controller there is no need to have import bge in the script.
Why does running a script via Module mode require importing bge?
Documentation on the blender wiki of the differences between script and module modes.

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

Why does running a script via Module mode require importing bge?

Because the import statement is the proper way of writing Python code.
The auto-import within script mode is a dirty shortcut. It is still there for backward compatibility. But it is no good design.
Pro

You always need it to access the the BGE context anyway.
(In module mode you do not really need it as you can get access via function arguments.)
Bge is not a real Python module. It is a wrapper around the BGE native code.

Contra

It violates the Python convention to show where objects are coming from (defined by the code or imported from other modules)
It hides the fact that this module is imported at all. So a reader will never see an explicit assignment to bge.
The bge module should behave like regular Python modules, so it should be imported as any other Python module too.

I strongly suggest to add the import statement in script mode too and ignore the auto-import.
I hope it helps

ok, so why does bge get auto imported when run as a script, but not when run as a module?

I can't tell the reasons, because I do not know them. The auto-import was there as I met the BGE the first time (~2.37). The module was called GameLogic at that time and only script mode was available.


text:
How can we change the direction of the Shadow filter
I am trying to create a cavity map from a normal map. In Photoshop, we can set an angle for the emboss, the red channel of need to be emboss to the right and the green to the top. In Blender, I guess we must add nodes to edit the shadow filter. Also, when I use the shadow filter i don't get a flat color i still get a variation of gray.
The normal map and goal on this link. The tutorial in Photoshop can be found here.


text:
Number Keys not Changing View
As I understand it, the number keys are used for changing the view, but they are changing the 3D Layers instead. Can anyone help me? Thanks!

@ShadyPuck 3D layers are not Render layers

@MrZak Huh. I always thought they were sort of interchangeable. They are related, tho. Anyway, thanks!

@ShadyPuck if you aren't sure about definitions consider googling / checking manual about them first.

@MrZak Noted, but sorry if I wasn't clear, because I was sure that I was correct.

You have to use the numpad keys, not the number keys. However, if you are on a laptop or similar device that does not have a numpad, you can do the following.
Go to File > User Preferences > Input tab and check Emulate Numpad. This will allow the number keys at the top of your keyboard to function as numpad keys. You will, however, lose the functionality to switch layers, the shortcut to add a Subdivision surface object modifier, and whatever else they are good for. Make sure to click Save User Settings at the bottom of the User Preferences panel. This will make it so that you can use these keys every time you open Blender, rather than having to change the user preferences every time.
The File menu:

The User Preferences window:

@Tsakov glad to hear it. If you like it, please consider accepting it. Click the checkmark at the top left of my answer. It would help me greatly and make me very happy!


text:
How to control camera view
I am right clicking, but I can't seem to rotate or move the camera at all. Any ideas? Blender only seems to be able to move objects and lights. Really confused since I'm new. Please help me if you can.

you probably should of read the manual, not that I can say much. But to control the camera view is not right click. Its the middle mouse button. If you dont have one you can use your arrows on the control to move around. For more information about navigation, you can read this manual:
https://docs.blender.org/manual/en/latest/editors/3dview/navigate/index.html
And here is the full manual for help on anything else you might need:
https://docs.blender.org/manual/en/latest/

Wow that was a fast response, but I thanks. I seriously thought it was right click to move around, I don't have a middle mouse button since I use a laptop, so its good that I can use the control pad to move around. I'll try reading the manual to understand it better.

yea, I just got on the website and saw this question, I hardly get blender and I am actually having a problem right now, but if you could, can you accept my answer? I want the teacher badge lol.

View -> Camera (or Numpad 0)
Shift + F (enter flight mode)
WASD to control camera and leftmouse to set the view

You can right click the camera, then key G to grab it, or use the translate controls to position it.

you must choose camera view by
- clicking on the small camera icon on right top of the viewport
- hit N on the keyboard
- and check Lock camera to view
than orbit as usually


text:
Blender armature screwing up rig hierarchy in ue4
I'm trying to export a rig to Unreal Engine 4 and have it match the hierarchy of the default ue4 rig. The issue is that the armature shows up in the hierarchy.
This is what it looks like in blender.

In unreal this ends up being HeroTPP > root > pelvis > etc. when it should be root > pelvis > etc.
How do I get it so that the root bone is the actual root of my rig so that the hierarchy matches up with the one in unreal?

I have absolutely same problem. Did you find any solution?

The unreal engine devs were aware of this issue and have made it so that unreal just ignores the extra root that blender creates when you import so the problem should be fixed now for everyone importing rigs into unreal.

Try renaming the Hero TPP -> root.  To do this, Ctrl+ click on the Hero TPP object on the outliner.
It shouldn't interfere with the actual bone named root, because one is on the Object level, the other on the Bone level.

That doesnt work because unreal reads it as a bone so it wont even import. Is there are way to move stuff around in the hierarchy or delete without breaking the rig? This rig seems to have an armature inside of an armature. Unreal reads the second armature as null and doesnt include it but it includes the first one.

I could rename the armature to root and delete the rootbone but I'm not sure what effect thats going to have on the animations when using rootmotion.

So as it turns out this looks like its a bug in the newer blender versions. I tested the same rig in 2.74 and it exports properly without the armature being a bone.

@KrunkFu - if it's a reproduceable bug, please make sure to file a bug report. Further explanations here: http://archive.blender.org/development/report-a-bug/