text:
What does this error mean and is it a Blender bug?
While working on an addon we made a hook to our cmake script to add it to blender. (Faster development cycle) We run a fragment of Python via this incantation:
blender -b -P blender_install.py

Here is the offending piece of code:
bpy.ops.wm.addon_disable(module=argv[1])
bpy.ops.wm.addon_remove(module=argv[1])

(The point is to uninstall the addon if another version was around.)
Blender gets quite creative:
Error: Traceback (most recent call last):
  File "/usr/share/blender/2.79/scripts/startup/bl_operators/wm.py", line 2155, in execute
    context.area.tag_redraw()
AttributeError: 'NoneType' object has no attribute 'tag_redraw'

location: /usr/share/blender/2.79/scripts/modules/bpy/ops.py:189

Traceback (most recent call last):
  File "/usr/share/blender/2.79/scripts/startup/bl_operators/wm.py", line 2155, in execute
    context.area.tag_redraw()
AttributeError: 'NoneType' object has no attribute 'tag_redraw'

location: /usr/share/blender/2.79/scripts/modules/bpy/ops.py:189

location: /usr/share/blender/2.79/scripts/modules/bpy/ops.py:189
Error: Traceback (most recent call last):
  File "/usr/share/blender/2.79/scripts/startup/bl_operators/wm.py", line 2155, in execute
    context.area.tag_redraw()
AttributeError: 'NoneType' object has no attribute 'tag_redraw'

location: /usr/share/blender/2.79/scripts/modules/bpy/ops.py:189

Info: Modules Installed (Audionodes) from '/home/gegaine/Audionodes/Audionodes.zip' into '/home/gegaine/.config/blender/2.79/scripts/addons'
Info: Modules Installed (Audionodes) from '/home/gegaine/Audionodes/Audionodes.zip' into '/home/gegaine/.config/blender/2.79/scripts/addons'

To my eye this looks like a crash having to do with background mode (the -b flag).
Am I doing something wrong or is this a bug with Blender's headless mode?

Not all Python operations are supported when running Blender in the background. The reasons for this is that operations are actions from user interface perspective. And some operations uses Graphical stuff like Window, Area or Region classes that do not exist when not having an UI.
The tag_redraw points me into that direction. You might try to fix the operation to make the wm.py not updating the UI at that point, but it not a bug.

(Context: We are trying to solve this issue together with Mörkö) wm.py is a part of Blender though. I understand that the headless mode isn't first priority, but doing something that doesn't necessarily need to update the GUI when the GUI isn't available shouldn't crash in my opinion.

for some reasons context.area can be null. therefore:
instead of
context.area.type == 'VIEW_3D':
        context.area.tag_redraw()

this can be fix
if context.area and context.area.type == 'VIEW_3D':
        context.area.tag_redraw()

also this may be used rather than tag_redraw in some cases:
bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)


text:
Can Cycles generate a per-ray random number without OSL
I am working on (or rather designing without access to Blender) a material setup to make a texture tileable (see here: http://blenderartists.org/forum/showthread.php?372297-Addon-WIP-Automatic-materials-from-textures-in-Cycles/page3). I basically need to mix a texture with a copy of itself moved slightly. (The factor comes from a texture) It can't be done deterministically without having two image nodes, because I need two separate vectors to have two separate images. What I would like to do is to have a per-ray random number, that will let me alternate between the two vectors, thus removing the need to have two images (it is not a huge burden in theory, but when I need to have all texture maps doubled, it becomes a complicating factor.). Does Blender have such a feature?

You mean per-ray random number like a noise texture?

I just asked a similar question here.  So far I haven't gotten anything.

Jerryno: No, I don't mean a noise texture. What I want is to have a different value for every ray, even if it hits the same pixel.

PGmath: What should I do? Close the question? I am a total noob stackexchange-wise.

source: Stack Exchange

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

sort: votes


text:
RNA definition type in user preference > input , how can I change this?

Hi. I want to add a new hotkey in Blender.
So, 'User Preferences > Input > + Add New' give me a hotkey slot and I name it as 'rotate view' with 'Alt + LMB' key.
However, I can't change the RNA. I guess it's about function of this hotkey.
How can I get this work?

Mouse
Available as mouse events are mouse movements, mouse wheel rolls, and any of the mouse buttons, on press, release or either. Aliases for the overall 'Select With: LMB/RMB' preference are available as the 'Select Mouse' or 'Action Mouse' button click events.
Modifier keys
The above events can be combined with the standard Ctrl/Alt/OS/Cmd modifiers in order to change their function As well as these, any other key can be used as a modifier key, for example the Grease Pencil tool is mapped to mouse tweak, with 'D' as the modifier key so the tool is used by holding 'D' and dragging the mouse

Check : http://archive.blender.org/development/release-logs/blender-256-beta/custom-keyboard-shortcuts/index.html

ChecK : http://download.blender.org/documentation/BlenderHotkeyReference.pdf

The RNA value comes from the operator named above. Were you have entered "rotate view" needs to be the name of the operator to be run when the key/mouse combination is pressed. The standard operator to rotate the view would be view3d.rotate.
To get the value of a custom operator, you need to use the value of bl_idname defined in the operator you wish to use.
Some operators will have other properties that can be set as well -

This appears a little misleading as the options appear disabled, when in fact that shows they are default values, changing the values highlights them and shows an 'X' to return to default values.

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


text:
Video editing, encodeing, rendering. Video Always Flickers
Reguardless of how I set the encoder and the frame rate up, the rendered video is always .avi and it always flickers on the edge of the video. It gets blury and then sharp again about every second. The videos I make are recorded with the Openbrodcaster software, and before I render them with Blender they look much better, even if they have the same bitrate.

Welcome knauziuz :) It would be nice if you could add a bit more information or an image with your issue to this question to understand it correctly. For testing purposes I would suggest you to render a jpeg sequence instead of an avi to see if it's a movie container issue.

I rendered an image and it didn't flicker. I'm one of the 8 million people on youtube who try to do let's plays. So here is the video i made: https://www.youtube.com/watch?v=7dtGmxIIWMg&user=Knauziuz   after the intro (which is basically just a rendered image) you can clearly see the flickering on the edge of the video. Especially after i entered the Arena (about 20 seconds into the video).
Oh, and thank you for the nice welcome and the fast answer :)

Glad I could help. You could also try to use H.264 instead of AVI, but to make sure you get the best quality out of it, I suggest you to render all frames as images (e.g. targa or tiff) and the audio separately. I know this is very expensive, but you have full control about the appearance of your video. Then you can join both strips (image and audio) with ffmpeg. Note: ffmpeg is a great tool to render videos directly for youtube / vimeo purposes, this makes it unnecessary to render an AVI.

My problem is, that I don't have any idea how to do this. Basically I just want to render it as a video, but it always renders as an .avi file. I can't switch it to an other kind of video format to render to. I mean a video editing software has to be capable of rendering videos without makeing the quality way worse. What I'm trying to say is... how do I use H.264 of ffmpeg, since it is always useing .avi?

Now my answer to this question is a bit off, if nobody reads the comments - that could be one reason why you got negative reputation. The other reason could be that the question is not formulated clearly enough. I suggest you to edit the title at least to make clear what you want so the question is useful for the community.

You can try to render a mp4 instead of avi. In the Render Tab scroll to Output and choose mpeg-4 or the h.264 Preset and set your desired values, which are similar to ffmpeg settings.

The H.264 thing really seemed to make a difference, thank you for all the answers! :)


text:
Need help with clothing my character mesh
I'm not entirely sure how specific I can be, but i need help with adding cloths to my character. Every tutorial I've seen so far are all tight fit clothing so it just looks like everyone is wearing under armor. I want to learn how to make it a bit more baggy, especially the pants. Is there anyone who can help me?

Lets see if this helps.

Select all the faces of the mesh your want to make clothes for.
I did face select, then i highlighted all the faces. (Photo above)

Duplicate that mesh by hitting 'Shift + D', then press 'enter'. After this you want to scale the mesh by going to your tools manu and hitting the 'scale', 'shrink/fatten', or 'push/pull' tab. (photo above and below)

To make the mesh "baggy" or thicker you can add a modifier like 'solidify'. (photo below)

change the 'thickness' value to get the desired results. (photo below)

these were my results.(photo below)

Thats it! now just shape your clothes to the desired shape and/or add a subdivision surface modifier to make it smoother. Then if you want you can sculpt the clothing, but thats all up to you.

THANK YOU!! THANK YOU SO FREAKING MUCH!
you have no idea how much this has helped me. Greatly appreciated

your very welcome, have fun!!!


text:
modeling clothes
I have no idea how to ask this, mostly because I have no idea whats going on. So I'm going to try my best to phrase this question. Pictures will be added for a better understanding of what im talking about.
So I am modeling a shirt for my characcter generated using the manuel bastioni software, but everytime i fit the shirt and change the models pose, the shirt does not follow.  What am i doing wrong??

Try applying scale, ctrl + A then click "Scale" on your shirt

I did that, it did not have the desired effect

Have you read through http://www.manuelbastioni.com/guide_a_detailed_tutorial_about_clothes.php fully? This should explain the process to fit to mesh, however it doesn't seem to actually add an armature modifier to stay with the pose, you need to manually update, which makes it useless for animation. Each time you repose you need to hit the fit button again.
If you need animation, you need to check that your clothes have an armature modifier with the appropriate armature selected and vertex weights exist on the clothes mesh for each of the necessary bones. If there aren't any weights, take a look at https://stackoverflow.com/questions/34719718/transferring-rig-weights-from-one-mesh-to-another-in-blender-2-76 for info on how to transfer weights form the character to the clothes.

This truly helped a lot. Thanks for the information Sazerac


text:
Sculpting a human model for animation
So I am sculpting a model to future animation. Right now I have the mouth sealed. Its basically just an outline of the mouth, so its like I'm sculpting it closed. My question is, do I have to sculpt the mouth open so that I can animate it in the future for speaking and expressions?? I'll be posting pictures so to get an idea of what I'm trying to say.

yes, the mouth could be sculpted as closed, but you have to make sure the upper and lower lips are separated from each other

You will retopoligize it, right?

Yeah, I plan to retopologize after sculpting. Thanks for the info!


text:
Having some trouble with Grease Pencil
I'm not entirely sure whats happening but every time I try to use Grease pencil on my mesh it comes out all scrambled and weird. Posting pic for more information,.

It is possible that this is connected to the add-on, and not directly a problem in Blender. Try disable SpeedRetopo and see if you can use the grease pencil as intended. If it is connected to the working of the add-on  I suggest you rephrase your question... or ask the creator directly: http://www.pitiwazou.com/contact/

So apparently I had bsurfases added twice. I just had to delete one of the installations. Now everything works fine


text:
Animating using shape keys, not animating
There are actually quite a few posts of this question, but apparently I'm having a different problem. All i want is for my character to slowly open his eyes using the shape keys. I set frame 1 with eyes closed. then frame 30 with eyes open. When I go back to frame one, it doesn't reset to the closed eyes and when i hit play nothing happens. Does anyone possibly have a solution on why this may be happening??

I'm quite sure you forgot to set keyframes, happened to all of us :)
See the docs https://docs.blender.org/manual/en/latest/animation/introduction.html or watch a tutorial on keyframing basics (you'll find plenty yourself on youtube)

I just figured out how to get my eyes to slowly open the way i wanted them to. Instead of going to the object data, setting the values and inserting the key frames from there, I instead went into the dope sheet editor, and set the values in the shape key editor which automatically created the key frames for me (as long as i had the right frame set when changing the values.)

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


text:
Help with transfering items to rig
This may have been answered in another post, is so simply direct me to that post. (I had a pretty hard time searching for it)
Here's my problem- I've been trying to transfer (or move, not yet any good with terminology) the shoes I've modeled for my character to the rig so that when I move his foot, the shoes will move with it. But every time I do, the shoes become off set from where I modeled them. (pics will be posted for better example) Does anyone know why this is happening?? Its probably a simple issue I'm just missing.

What do you mean move/transfer? are you adding the shoes to the rig?
If you are it may be the case that your rig isn't in resting pose, as such when you add the shoes they are being transformed by the bones rotation, effectively causing a double transform, as they are being rotated once by you and once more by the bones.

Yes, I am attempting to add the shoes to the rig. Sorry I wasn't clear. Had a hard time trying to word the question. I'm pretty sure I have the rig in resting mode but I will double check. Thanks for your input!

Thank you so much @Firewill !! Turns out you were right!! I just knew it was something simple.

In case it gets by passed, @Firewill helped me to solve the issue I was having. I was trying to add the shoes to the rig, but the objects would always end up off set. @Firewill discovered that my rig was not in resting pose. Simple solution. I clicked the armature and went into pose mode. From there I hit ALT-R to put the rig in resting pose. I then went into object mode and clicked on the shoes object and Shift-clicked the armature. Next I hit Ctrl-P > with automatic weights and boom goes the dynamite. All fixed
 Thanks again @Firewill.

It looks like you did't add the Armature Modifier to the shoes. You need the armature to deform the shoes, using same vertex group names you used for feet.

I did that, and got the same result


text:
When I render the scene, the dress gets weird
I don't even know whats going right now. So im just going to post an image hoping someone can help me lol.
The Left is before render and the right is after render.
P.S. when is (Shift-Z render its fine, but when I F12 render the image or animation this error happens)
Can someone help explain to me why the dress is doing that when its rendered??

"So im just going to post an image hoping someone can help me lol" Nah, we aren't about to play a guessing game, so you better post some info about your scene setup, otherwise this would be a shot in the dark

Never mind, figured it out. (It only took me like 50+ legit hours)
I had the displacement modifier turned off. Simple solution.

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


text:
Blender 2.79 (rendering 6 render layers)
So Im working on an animation using 2.79's Internal render and I need to render 6 different render layers so that rendering the animation won't be so slow (because as of now its taking hours to render one frame). I need to know what kind of node set up am I looking at to make this happen because I can't seem to figure it out. I've tried Z passes, mix and add nodes and nothing gets the result i want. Can anyone help??

Use alpha over, can chain as many as needed. Simple example, related: https://blender.stackexchange.com/questions/21440/how-can-i-combine-two-render-layers

z-combine should be your friend: https://blender.stackexchange.com/questions/81251/how-can-i-z-combine-multiple-render-layers


text:
.obj export - moving the origin
I'm having trouble with the Wavefront .OBJ export script (using Blender 2.69). I can't seem to affect the origin of the exported vertices.
I've seen other threads suggesting the origin is that of the scene/world, but as far as I can tell the origin seems to always be the centre of the object's bounds. This makes it difficult to position objects in the game I'm developing because I'm never sure where exactly the origin is.
I have tried the following:

Tweaking all the export settings
Moving the object's origin around
Moving the object around in the scene (inc applying transformations)

All of the above have no effect on the exported vertices.
Any help would be much appreciated; thanks.

This is exactly why it's common practice to normalize the location of every mesh asset. If every mesh has its origin at 0,0,0 then importing, exporting, and rigging are much simpler.

This is quite strange, blender does apply the objects transformation when exporting - so grabbing and object and moving it will move it in relation to its origin. If you import the OBJ back into Blender is it centered? You can also just export a triangle, open it in a text editor- and see if the points are around the 0,0,0 origin or not.

Another issue, how are you checking where the origin is? - perhaps this is incorrect. or the tool re-centers the geometry.

Can you please Explain what you did in beginner level? It would be helpful

I now feel silly. Turns out I was wrong and the obj export script does work as expected. Instead, the object was being recentred by another script I was using afterwards (obj2opengl.pl). The solution was to use the -noMove switch when running this second script otherwise the default is to "move [the object] to the center of its vertices"
Thank you for the comments, it helped me realise the true problem!

You may now accept your own answer :)


text:
Is it possible to render video sequence animations with network render?
I would like to render a lengthy video sequence in the VSE faster using network render.
It works great for 3D animations but I can't get it to work with video sequences. The result is usually a blank screen with audio only. Has it been done before?

Rendering several sections on different computers as mentioned @martinlindelof and then put them together in avidemux, succeeding in less than a second

Related: http://blender.stackexchange.com/q/38899/2843

a possible workaround would be use dropbox or have the source .blend on the network file servers. Open on different machines and use the Star Frame: & Frame Skip: settings in render panel.

Computer#1: Star Frame 1: & Frame Skip: 5
Computer#2: Star Frame 2: & Frame Skip: 5
Computer#3: Star Frame 3: & Frame Skip: 5
Computer#4: Star Frame 4: & Frame Skip: 5

and so on, thats just a workaround, cannot find a addon for this either.

Not quite an answer to OP's question, cuz you wouldn't be able to do this with a video file, only with individual frames.

If you have two (or more) PCs render to the same location (network share, OneDrive, etc.) then select "Placeholder" and UNselect "Overwrite" (in render output settings). "Placeholder" causes Blender to create an empty file as soon as it STARTS rendering a file (which then gets replaced with the finished frame). When the other PC looks for the next frame to render, "Overwrite" being UNchecked will cause it to SKIP any existing frames INCLUDING the empty placeholder and start on the next unrendered frame. This makes for rudimentary automatically load-balanced network rendering.

You cannot have more than one contributor to an open file (video or otherwise), frame sequence renders avoid this by allocating a render instance (multiple machines) to each frame. If you want to render a contiguous video file (with or without audio) you can only have one device create it.
Alternatively you could render portions across various machines and stitch them together later (faster if no additional effects are required). Although this would result in re compression of frames.

Good point... I suppose the workflow could be something like this: split the sequence up into 5-10 min blocks; farm out to x number of computers; have each render their portion to a lossless format; collect each movie to central location, mux them together and then apply final compression. If only I was savvy enough to create a python plugin that could do this automatically.


text:
How do I turn the pivot point off?
I turned pivot point on at one point trying to use it but I definitely don't like the way the camera feels, how do I turn this off and go back to the normal free camera where I can go up and down with Q,E, and move around freely?
Appreciate any answers, this is driving me crazy and I can't continue until it is fixed.

By free camera it sounds like you are referring to Walk Navigation (Shift F). However this is a modal operator and can only be used temporarily as you can't do anything else while it's running. Which makes me suspect you might mean something else (walk mode definitely isn't the default)

By camera do you mean the camera object used for rendering or the 3d view?

I'm really not sure what it was but it was how blender came default, these camera modes just don't feel right in the way they rotate. Sorry I really don't know more about the camera mode I'm looking for but I am pretty new still.

@Dkace By default blender uses a turntable style of rotation (options in Ctrl Alt U > User preferences > Input). But AFAIK the only mode where Q and E move up and down is walk navigation (FPS style).

Moving the camera with the Q and E keys is part of the view navigation controls, not part of the pivot point choice.
The effect of the keys is different depending on whether you are using walk or fly mode and the controls are described in more detail here. The default mode can be started with ⇧ ShiftF and either fly and walk mode can be chosen directly from View> Navigation> Fly Navigation or View> Navigation> Walk Navigation.

This navigation mode [walk] behaves similar to the first person navigation system available in most 3d world games nowadays. It works with a combination of keyboard keys (WASD) and mouse movement. By default the navigation is in the 'free' mode, with no gravity influence. You can toggle between gravity and free mode during the navigation (↹ Tab).
You can:
Move the mouse left/right to pan the view left/right or
move the mouse up/down to tilt the view up/down.
Move the camera forward/backward (W/S).
Strafe left/right (A/D).
Jump (V) - only in 'gravity' mode.
Move up and down (Q/E) - only in 'free' mode.
Alternate between 'free' and 'gravity' modes (↹ Tab).


text:
Some objects change position when becoming children of bones
I created shoulder plates for my armor in Blender and tried to add a Child Of constraint to it and set it to be a child of a bone in another object's rig (character's rig).
This is where the object is in relation to my character:

Having it selected I add a "Child Of" constraint to the plate:

Then I select the type of object I want to constraint it to with the picker tool (the bone that is located just under the plate, in my character's upper arm):

Then I type in the name of the bone in constraint settings:

As soon as I do that the object is much smaller and far from its previous position:

It comes back when I disable the position, rotation and scale relations, but if I do that then any movement of the bone won't affect the object, so it's going to be useless for rigging.
Could you please help me with this?

check the scale on your object, and on that bone.

also clear all data on the bone (rot loc scale)

try setting the inverse, see this http://blender.stackexchange.com/q/28859/5113

@Chebhou thank you, it works. You can post your comment as an answer and I will select it as the correct one


text:
Procedural terrain Parenting script
I wrote a script with 3 while loops for a 10x10x10 xyz range and creates block of terrain at each XYZ made of voxels, cutting off each column of voxels at a noise value which gives a terrain look.
I am trying to parent the voxels to an empty so they can start working in chunks and be deleted in groups, but when I use an empty to place them and parent them to the spawner empty (another empty), the entire terrain flips upside down, not the individual cubes, but the terrain cut off looks flat on the top but on the bottom of the 10x10x10 block is the hills upside down.
How do i fix it to have the terrain work again?

The primary culprit code is narrowed down to two lines of code which is a scene.addObject line where I use the other empty (not the spawner empty with the code on it) to place the blocks, and a parent line of code to parent cubes to the spawner empty.  The two are dependent of each other due to the fact the placer empty is used in the scene.addobject line.  And to work it needs to be parented to the original spawner empty or something.  If it would help I can draw a diagram of what is going on or give code which could simplify any confusion.

I have a visual reprentation of my problem on a Google+ post.  Here is a link : https://plus.google.com/115731765934668406440/posts/F1EJA38RdHE

Good news!  I have fixed the problem by changing which empty is the parent.


text:
python - Obtain list names used in a project (Noobie Question)
There are actually 2 questions here...
I'm just starting to learn Python and I'm try to write a script to dissect a group of models and pull possible modeling problems in attributes of the Blender bpy.data.objects API that the model might might have. (unassigned bones, unweighted vertices, mesh objects that have too many vertices/bones)
My programming background (what little I have) is VBA for Office and I'm use to throwing stuff I want to grab into a temporary spreadsheet or a database Table and search those via SQL. I destroy them after I get what I need.
I'm finding the concept of lists, dictionaries, and sets difficult to comprehend (this one can have duplicates, this one can't, you can change stuff that one but not this one and I don't even want to get into list comprehension, I'm not there yet.) I have not had any luck with 2/3 dimensional arrays (which I think would solve my problem completely.), everything I've tried ends up in either a syntax or indentation error.
Also, because I want to do total model summaries as well as print individual elements for each mesh, I'm finding that I have to repeat steps over and over again. (I'm not at the defining Classes and Functions stage yet.)
Situation:
To mimic the environment I'm use to working in, I generating lists on the fly from strings to separate things I want to call against with a commands like:
mdlMesh = []
   for msh in object:
       if msh.type == 'MESH":
           mdlMesh.append(msh.name) # get the meshname
       if hasattrib(msh.vertex_groups):
           mdlVGrps.append(msh.vertex_groups)
           ... #'BSBound' # is returned as mdlMesh[0] and it does have Vertex Groups
           ... # I want to dump the contexts mdlVGrps into a mesh specific list so I can
       ...     # build the Model
       ...
   ... # Summary Report after getting all the data before I dig into Mesh specific reporting
...

if I manually type the command into the editor (I'll add this to code to the script later, I'm still experimenting with it):
>>>exec(str(mdlMesh[0]) + "_VGrps = []") # I can create a list called BSBound_VGrps from the string

>>>BSBound_VGrps # I type directly into the editor to check creation and existence

[]  # and find the New blank list was created, it is declared and waiting to be populated

as these are going to be created on the fly throughout the script, I'll never know if a list is actually  created or not or what name I have to access (without using a string) for the information I need.
Question 1:

Is there a way to create a list of (or print) the list names created by the script?

Question 2:

Is there a way to access\call the string generated lists and populate
them using a string or will I have to use the exec command to rebuild
the list name again with a try statement with and argument for the
elements I want to add to the lists?

Problems:
The generated lists are not named consistently or may not be created at all:
example:
I'm looping through all the mesh objects in a model and creating a msh object, so the msh.name[x] in the msh.name attribute changes in each loop.
I want to create a list for based each mesh object name to gather information so I'm creating them on the fly in each pass with the exe command based on the msh.name_attribute_being_pulled and adding the element of that attribute I need to the generated list name (ie "VGrps for msh.name[x].vertex_groups. = mshName_VGrps
However, the new list may not be created because there may not be data for the object attribute I'm trying to pull.
example:
the mshName object may be exist but it doesn't a .vertex_groups attribute, so the exec(str(mshName[x]) + "_VGrps = []") command is skipped over in the code and the list for that attribute is not created.
Then,
check to see if they were actually created, populate if they exist and call on them for information with a string?
example:
The list myMsh1_VGrps = [] (and a bunch of others) have been created exec command.
They are empty but I have no idea if any of them exists.
How can I check for existents, populate and call information from them using strings in the code?
I can't hard code direct naming like:
if myMsh1_VGrps: # because this name is different in each pass of mesh objects
    for i in myMsh1_VGrps:
        ...
else:
    ....

or use something like
myMsh1_VGrps = ["something", "or_something_else", "BECAUSE", "I_don't_know_if_this_REALLY_Exists"]

Any help would be appreciated.
Thanks For reading!

Hello, I did not understand the final use of instantiating all these lists, could you elaborate on that part ? Did you explore the fact that you can have access to these lists from each object using the API ?

Basically, the instancing and printing of the list is just to see what lists I've managed to create on the fly while coding and to catch what might be causing errors.  For example while creating lists, python errors out because a list I'm trying to create has a dot (.) in the name (like capsule.001) or the name I'm trying to use starts with a 0 and I get the invalid token error and changing to a string still throws the error. As I'm just learning Python, I need to be able to capture what I'm doing wrong so I can research the problem and change the logic of the code.

And I don't see where I can access lists in the API.  Can you provide a screen shot of where the list object or object list is?

OK so first as you experienced it's not recommended to use exec and eval because the compiler can't really know in advance what's what and you will have trouble debugging. In most cases getattrwill do the same. Also it can execute harmful code really easily. You can access a list of objects with bpy.data.objects. See https://docs.blender.org/api/current/bpy.data.html You can also access a bunch of data directly from the object https://docs.blender.org/api/current/bpy.types.Object.html or from mesh (obj.data for a mesh object) https://docs.blender.org/api/current/bpy.types.Mesh.html

Yes, I know exec and eval are bad practice, but for debugging, they're great. for example to create my listOfLists  lstNames = [i for i in vars() if isinstance(eval(i),list)] then I can evaluate the data the lists hold with a for loop against the listOfLists list.  I would not release code using them unless absolutely ABSOLUTELY necessary.

Re-reading your comment on accessing lists, I think you're confusing Objects that are in the scene with stuff I'm putting in the created list names and want to view. I'm creating lists from the data.objects of the models in scene.  Then pinning statistical data (how many verts, how many bones, are vertices weight painted, are vertex groups deform type, do bones have mesh painted via VGrps... etc.) into a txt file for analysis based on each model in scene. This data is going from entire model, to individual mesh objects to individual verts. That is why I need to debug at the list level.

BTW Gorgious, I really appreciate your comments. they are really helping with the logic flow.

I think I understand your workflow better, and if using eval and exec suits your needs, go for it by all means :) But I'm afraid you're kind of reinventing the wheel there, mostly because you don't know (yet) where to find the relevant information. I'd advise you to start small with the API, fetch mesh data, then fetch polygons data, then fetch vertices positions, etc. All these containers are available without using voodoo magic and you don't run the risk of having duplicated data be outdated by the time you evaluate it somewhere else

In as much as it's great you are learning python, (to script in blender), the process of doing so is not  conducive  the type of q&a  SE is designed for. My 2c worth of tips,  before asking questions, i) use the python console for instant feedback. ii) Search re python syntax, there is possibly toooooo much info out there already iii) (as well put in comment above) start simple and build up from there. iv) If you come to a road block, ask a question.  Try and avoid XY Problems ie ask what you wish to achieve, not why the way you are trying to do so

does not work.  Given where you are at now, this q could be "How to create a dictionary of all scene meshes with coordinates and vertex groups" or some-such.

Thanks batFINGER, and yes, I'm trying to employ things before I fully understand them. "Baby Steps" is what I should be taking. However, Blender is now using Python 3.7.7 I believe and I usually spend an hour or 2 googling and trying solutions that fail only to find that command syntax have either been depreciated or have changed. It's very discouraging and extremely frustrating, dictionary['key'].append(value) for example no longer exists and using dictionary['key'].update(value) is just changing the current value and not appending anything new.  ARG!!!  LOL

Working my way through this and learning what little I have about lists(arrays), tuples and  dictionaries, I think the best way to go about this is to use dictionaries. Using Keys I can name them whatever I like, I can stack them with values I need and I can get away from using dangerous commands like exec and eval which all of a sudden aren't performing the way they were when I posted my last answer (I probably fluked something when I was working with them and got the results I was looking for.)
Now I just have to get list comprehension down in order to build my dictionaries properly and minimize the for - while and if statements I'm writing in the code.
Thanks to everyone who have read and especially those who responded.

I think I have the answer...
After the exec command runs, do an evaluate and stash a true\false return somewhere.
exec(str(msh.name[0]) + "_VGrps = []")
result = isinstance(eval(str(msh.name[0]) + "_VGrps"),list)
if Result == True:
   newlist.append(str(mdlMesh[0]) + "_VGRps")
else:
   listfail.append(str(mdlMesh[0]) + "_VGRps")

This is the result of a test I just ran:
>>> exec(str(mdlMesh[0]) + "_VGRps = []")
>>> result = isinstance(eval(str(mdlMesh[0]) + "_VGRps"),list)
>>> print(result)
True

another test
>>> str(mdlMesh[0]) + "_VGRps = []"
'BSBound_VGRps = []'

>>> eval(str(mdlMesh[0]) + "_VGRps")
[]

And the check may not even be necessary...
you can append directly to the str(mdlMesh[0])+ "_vGRps" list is it exists
 eval(str(mdlMesh[0]+"_VGRps")).append("THIS IS A TEST")
>>> BSBound_VGRps
['THIS IS A TEST']

And my answer to the Topic question is:
>>> for a in vars():
...     if isinstance(eval(a),list):
...         print(a)
...
mdlNoParMod
mdlVerts
mdlParent
mdlArmatures
mshName
mdlBones
boneLayers
armDataName
vg
mdlMesh
mdlVGrps
BSBound_VGRps


text:
Blender 2.9 Eevee- Materials and textures not showing in render or viewport shading (Update)
(Update: I am NOT using a AMD GPU, so the question that has been answered referring to changing the AMD GPU driver to its previous version does NOT work for me. So now I am reposting the question to get an answer.)
So I am trying to add a shader to my model and when I try to check in the shader viewport or render viewport I just get what looks like a transparent model. I've added different light sources, removed light sources, changed shader nodes, and played with textures and I get nothing. I've searched online but of the results I found, they were either irrelevant to my problem or required a fix that did not work for me particular issue. I really hope someone can help. I'd like to share the file here but I have no idea how so we'll start with screen shots.

deleting and re-posting the same question is not how this site works. Editing  your question so it can be reopened (which it would have been) is how this site works. Now, what is your GPU? Have you updated your drivers lately?

Sorry I didn't know that. I thought I automatically had to repost the question. My GPU is a NVIDIA Geforce GTX 1060 6GB

Please don't post the same question more than once. If you feel your previous question was incorrectly marked as duplicate, or the linked posts don't adequately address your issue, go back to your previous question and edit by pressing the Edit button below, including information of what you have tried, why it failed and how the duplicates don't address your issue. Once edited the question is automatically queued up for review so it can be reopened.

Please read through the help for the site, there's some useful information there for users to get familiar with how things work and to best benefit. The [tour] is especially helpful if you have never read through it. Also, new information is usually better as an [edit] so other users see it when they read your question.

@DuarteFarrajotaRamos Yeah sorry about that. Duly noted.

@Timaroberts Got it. Thanks for that info. I'll go through the tour asap. Again, my apologies.

please provide your blend file to we can check it out

https://www.dropbox.com/s/k7721ijfisehpj9/Tora1.zip?dl=0

I haven't figured out why the issue is happening but have discovered a fix. Its kind of annoying but I opened blender 2.79 and appended the model there. Deleted all materials and textures, saved, then appended the model back into blender 2.9. Everything seems to work fine now.


text:
How to remove object from group?
How do I remove one object from a group hierarchy? I don't want to delete it, just remove it from one specific group.

In Blender version 2.74.

Found it: Ctrl+Alt+G does "Remove From Group".

You can manage an object's groups from the object properties panel under the groups rollout.

These settings allow you to:

Remove the object from a specific group by clicking the x next to the group's name.
Re-name any of the groups the object belongs to by simply typing in the text box with the group's name.
Only allow the object to be visible on certain layers when duplicated (via particle system, dupli-verts, etc.) using the dupli-visibility layer selector.
Offset the object when duplicated using the x, y, z spinners.

authors: Артур Пипченко


text:
Creation of lists in blender python
I'm trying to create a list box on a 3d view panel but I can't seem to find the correct control in the list of properties that have an associated UI or in any other related documentation.
What I'd like to do is instantiate on of these:

within a blender python script.
Does the API expose these controls and if not, is there some way of creating a custom control with its own drawing and mouse handling routine within python or would I have to add that in C++ and expose it to python (which is probably a bit more involved than I have time for at the moment)

No problem. Glad I could help @Luther


text:
Importing multiple files in blender import plugin
I'm writing an import plugin for blender 2.8x and I'd like to make use of the multiple file selection feature. Unfortunately, I can't find any provision for this in 'ImportHelper' (the class I derive from) and web searches haven't yielded anything that seems to work and I can't seem to find anything in the documentation either.

0
It turns out there are several things you need to do to make this work, it's not yet covered in the documentation.
First of all, it helps to know what the base class 'ImportHelper' does when using it in an import script. On initialisation, the script calls 'context.window_manager.fileselect_add(self)' which adds several objects to your class. This string in the source code gave it away:

"The string properties 'filepath', 'filename', 'directory' and a
'files' " "collection are assigned when present in the operator"

The 'files' object is what we need but that's only present in if you also have the correct property present in your class, for example:
files: CollectionProperty(
            type=bpy.types.OperatorFileListElement,
            options={'HIDDEN', 'SKIP_SAVE'},
        )

then, if that is present, you can access this in your class's 'execute' method to iterate through all the files in your selection:
for meshfile in self.files:
            filepath = meshfile.name
            print(filepath)

Also, remember to include the correct properties, I include these in my importer:
from bpy.props import (
    BoolProperty,
    CollectionProperty,
    StringProperty,
)

Thanks @Luther, most helpful. io_import_images_as_planes.py has a working example of this.

Thank you for this @Luther. How would I go if I'd like to select a FOLDER, instead a file or a set of files? Is this possible?

@Sergio - I'd use the python module 'glob' for that,


text:
Export/Import Screen Layouts
Just downloaded the latest version of Blender and was hoping for an easy way to port over some screen layouts made in the previous version.
Here's what worked for me:

Open previous version of Blender
Save current state as startup.blend (or other filename of choice)
Open the startup.blend file in new version of Blender and choose File -> Save Startup File (Ctrl + U)

Does anyone know of a better way to import/export screen layouts? Even though this worked for me, it doesn't seem like the best practice since some things may or may not get carried over in a startup.blend file.

You can copy the startup.blend file from your old blender config directory to the new one.
Example:
(on most linux distros) ~/.blender/2.69/config/startup.blend -> ~/.blender/config/startup.blend.
On Mac OS, it'd be in ~/Library/Application Support/Blender/<version>/config. Not sure about windows.
The only other things that seem to be there are user-installed add-ons (in scripts rather than config), bookmarks (config/bookmarks.txt) and recently opened files (recent-files.txt). You should be able to copy those without an issue.
For the startup blendfile, it's probably a good idea to save your settings after having started up, or to just continue doing it as you wrote in your question, to make sure that the blendfile is actually of the right version. Shouldn't make a big difference what with it still being a blendfile and the great reverse compatibility in blender, but you never know!


text:
Set Default MPEG Preseek
Every clip added to the video Sequence editor (VSE) defaults to an MPEG Preseek of 0. Does anyone know of an addon or a way to have each clip inherit a user-defined preseek setting?
It would save a great deal of time with this project and future ones. Thanks in advance for your input.

There is an addon called Property Chart

This addon adds a panel to the properties sidebar that allows you to easily copy settings between items. This addon works in the 3dview as well as the VSE.

By adding mpeg_preseek to the list, the value is then shown for the selected items and by setting the top item to the desired value you can then click the clipboard and have the value copied to all other items. One catch is that you need to set the value in the top item, if the top item doesn't have mpeg_preseek then you can't set it. This only matters as the last item selected when you select all will be on top of the list, having a transform selected first will then stop this working, so be sure to select a movie strip then select all.
A small script could also be used to set them. With a little effort this can be adjusted to add a properties panel with a button to set all strips to the desired value.
import bpy

for seq in bpy.context.scene.sequence_editor.sequences:
    if hasattr(seq, 'mpeg_preseek'):
        seq.mpeg_preseek = 25


text:
Know object select order in python
I create Python script for automatic create particle system use any two selected objects. Object 1 is emitter object and object 2 is particle object.
objectSelectList = bpy.context.selected_objects
print(objectSelectList)

This command give list of objects a user selected but sometime list order is reverse order (user select object A first then object B but list is: object B, object A).
How get correct select order?

I am not a Python expert, but it appears that you would first need a Python function to actively listen for selection events and to build a list based on that. Every time you select an object, it will be added to the list of selected objects in the order that you selected them. You would also probably need a "stop" listening function so the list stays clean.

Blender doesn't really have a "select order"
The standard method used by blender operators is to use the context object (context.object, context.active_object) and selected object(s) (context.selected_objects in which if there is a context object, it will occupy position 0).
For example Ctrl+P the parent operator makes the context object the parent of all selected objects, except itself. One parent many children.  Similarly for join all like typed selected objects are joined to the context object.
Henceforth for making an operator to select emitter and particle you need to decide which is the  many, ie make the context object a particle and then make all other selected objects an emitter of that particle, or vice versa.

context.selected_objects won't automatically shift the active_object to position 0, does it? Example in case that logic isn't automatically applied.active_obj = bpy.context.active_object  selected_objs = [obj for obj in bpy.context.selected_objects if obj != bpy.context.active_object]

You can use bpy.context.scene.objects.active to get the active object (the last selected object)

Use get_ordered_selection_objects()
import bpy

def get_ordered_selection_objects():
    tagged_objects = []
    for o in bpy.data.objects:
        order_index = o.get("selection_order", -1)
        if order_index >= 0:
            tagged_objects.append((order_index, o))
    tagged_objects = sorted(tagged_objects, key=lambda item: item[0])
    return [o for i, o in tagged_objects]

def clear_order_flag(obj):
    try:
        del obj["selection_order"]
    except KeyError:
        pass

def update_selection_order():
    if not bpy.context.selected_objects:
        for o in bpy.data.objects:
            clear_order_flag(o)
        return
    selection_order = get_ordered_selection_objects()
    idx = 0
    for o in selection_order:
        if not o.select_get():
            selection_order.remove(o)
            clear_order_flag(o)
        else:
            o["selection_order"] = idx
            idx += 1
    for o in bpy.context.selected_objects:
        if o not in selection_order:
            o["selection_order"] = len(selection_order)
            selection_order.append(o)

def selection_change_handler(scene):
    if bpy.context.mode != "OBJECT":
        return
    is_selection_update = any(
        not u.is_updated_geometry
        and not u.is_updated_transform
        and not u.is_updated_shading
        for u in bpy.context.view_layer.depsgraph.updates
    )
    if is_selection_update:
        update_selection_order()

def register():
    bpy.app.handlers.depsgraph_update_post.append(selection_change_handler)

if __name__ == "__main__":
    for f in bpy.app.handlers.depsgraph_update_post:
        if f.__name__ == "selection_change_handler":
            bpy.app.handlers.depsgraph_update_post.remove(f)
    register()


text:
Will Linking or referencing in multiples of the same rig be a feature in 2.8 (re depGraph)?
I love blender for just about everything animation related including blender pipelines....however one thing that really is frustrating is how you cannot link in the same rig multiple times. I've looked through the dependency graph proposal update for 2.8 and some makes sense but still a bit complex for me to fully grasp what's going on, so question for some smarty out there, will this fix this issue? From a big production point of view this is a must to have!

You should try to ask developers through specific channles, imho. See options in this page: https://www.blender.org/get-involved/developers/

Found the answer, and its exciting :)
Question to sergey re the dep graph proposal for 2.8

can this make linking x times one asset possible, each having own animation ? (character with armature)

Yes, that’s the idea. Even more, each of the characters could be customized by overrides, so you create varieties of characters in the same scene.

Source (comment section)
https://code.blender.org/2016/12/dependency-graph-proposal/


text:
Bake Simple Deform animation into mesh for Unity3D export?
I'm trying to use a .blend file with a keyframe animation on the angle of a Simple Deform modifier in Unity3D. Unity3D however does not know how to handle modifiers and hence cannot play the animation.
How can I bake/save the animation to the .blend file so that Unity3D can play it?

Did you try to apply the modifier as a shape key and export the shape key into unity? The shape key animation won't export from what I gather, but you can re-animate it in Unity.

There's not much ways to do that… Only one I can think of is applying enough 'keyframes' of your deform animation as shapekeys (you can copy modifier, apply as shapekey the copy, go five frames later, copy, apply as shapekey the copy, etc.), and then in Unity (or Blender), create an animation interpolating between those shapekeys. But this will be rather painful to set up I’m afraid.

You can make use of third party assets to do this for you, the MegaFiers asset for example has most of the modifiers/deformers found in Max, Maya etc so you could maybe recreate it with that, it also has support for Point Cache playback of industry standard cache files such as .pc2 .mdd and .mc files.

Yeah, I could, if only I had the money... can't afford it unfortunately. I'm bound to using free stuff like Blender and Unity Free. But thanks anyway for the advice.


text:
Red lines in dope sheet?
I've had no luck googling for it, yet. What do the red lines in the dope sheet mean?

Both the dopesheet and the graph editor show a red line when the data path for the fcurve cannot be found. While most times the fcurve stays connected to the correct item, there can be times when this doesn't happen, most often when the item is renamed or deleted in an external file from the one containing the animation. You will also notice that the shown data path is the complete raw path when it is broken, rather than the more user friendly abbreviation.
If an item has been renamed, we can correct the data path in the fcurves properties panel in the graph editor. If the item was deleted then you can just delete each fcurve, you can do that by selecting it in the list and pressing X or ⌦ Delete.

For a large number of items, it may be easier to make a script that will correct the data paths.

use this script
import bpy
# Get the active action in the Action Editor
action = bpy.context.object.animation_data.action

# Create a list to store the channels to remove
channels_to_remove = []

# Iterate over each F-Curve in the action
for fcurve in action.fcurves:
    # Check if the RNA data path contains "pose.bones"
    if "pose.bones" in fcurve.data_path:
        # Extract the bone name from the RNA data path
        bone_name = fcurve.data_path.split('"')[1]

        # Check if the bone exists in the armature
        if bone_name not in bpy.context.object.pose.bones:
            channels_to_remove.append(fcurve)

# Remove the channels with missing pose bones
for fcurve in channels_to_remove:
    action.fcurves.remove(fcurve)

For anyone that needs to rename these for a relatively small number of animations (AKA Actions) and a small number of bones, you can do the following for each messed up animation:
Make sure you're in Pose Mode for that armature or have the Outliner open to select the bone
1) Select each messed up animation in the Dope Sheet (in Action Editor mode)
2) Rename the bone that should be referenced in that key (the thing with the dropdown arrow) to the name that it still has stored (See example below)
3) Then rename the bone back to the desired name (while the same action is selected)

Here, I have the messed up action selected and I would rename "Gun.R" back to "Gun" so it matches up with the messed up animation. Then, I would rename the bone back to "Gun.R" and the animation key will be renamed correctly and the red lines will go away.
It's not a practical solution for many messed up animations and bones, but it works for few..

I think those are error keys getting generated by default when we animate..usually i just delete them to reduce the load on the file. This error gets generated every now and then.

Error keys getting generated by default? Why?


text:
In single image render trail of moving objects
I want to render a single frame of an animation and would like to have some of the moving objects to be rendered as a trail between either

the beginning of the animation (frame 0),
a particular number of n frames or
the previous keyframe,

and the current frame.
The objects I want the trail to be rendered of are markers on a human body (like, little red dots, i.e. spheres with a 100% emissive red material, on the shoulder, elbow, hand of a humanoid figure)
The reason that I want the animation being rendered as a trail of the markers is that I want to use the image in a printed technical documentation that describes a particular motion. For obvious reasons an actual animation is not possible in this case.
I have already tried rendering the trail of the markers by using motion blur but the results were far from what I would like them to look. Furthermore the motion blur does for some reason not really follow the actual trail of the markers (I don't know why) and is also influenced by motion of the camera.
I would like to avoid post-composition of multiple frames by hand.
One idea would be to render only the markers for the n frames before the current frame with transparent background, fully render only the current frame and blend the frames together.
Is this possible in blender? Can it be automated? How?

Maybe related - https://blender.stackexchange.com/questions/33993/how-to-make-precisely-defined-trails-along-orbits-in-space/45077#45077

It is possible by using Animation nodes.

Here is a setup for duplicating and distributing objects on every frame:

there are multiple markers that I would like to render the trails of.
  Furthermore it seems impossible to set a maximum lengh of how far the
  trail goes into the past.

For more control nodes are more complex. This node-setup gets objects from group and arranges markers between selected frames:

I provide blend-file (note, AN must be enabled):

This is an interesting approach, but a little cumbersome since there are multiple markers that I would like to render the trails of. Furthermore it seems impossible to set a maximum lengh of how far the trail goes into the past.

@HendrikWiese In AN nodes there is no such definition as "impossible", You get the blocks and build anything that you want.

Ah, I see. Yeah, sure, there's no such thing as "impossible" at all. It all depends on the effort you want to put into something. I was hoping for something a little less complex. But it's okay, I guess I'll use this method. Thanks for your help!

Okay, one last thing I'm struggling with: I'm trying to create the trail not from a static from to a static to but from current frame - n to current frame. So that the trail instances have kind of a lifetime. I've tried setting the from and to data inputs from time info frame and time info frame - some input age. That sadly does not work. How would I do that?


text:
Particle Effect Hair - Grows randomly during animation
I have put together a basic human rig. I'm still new to this and this is one of the first, however it is my first attempt at making hair. I decided to try doing it with partcles after watching a video of how nicely it seemed to work with its own physics and all. It all seemed to work beautifully until I tried animating the rig with a completely basic head turn to see how the hair reacted. Instead of bouncing a bit, or even bouncing a bit much it did something a bit more extreme that I don't know how to explain... and so... I provided pictures.

My files for particles:

This only happens when he is in motion. Still shots render nicely as such

just a thought, does unticking the Hair Dynamics checkbox fix it?

Unticking the Hair Dynamics does indeed fix it. However doesnt that make it so it will no longer bob at all? Making it stiff and solid.

Yes, however we now know that it is the Hair Dynamics settings that are causing the issue. You can now try changing some settings and noticing what helps/makes it worse.

You can use a lower Stiffness value in the hair dynamics settings (less than 2) for short hair.


text:
Exporting Particles?
So I've taken the route of making my characters hair in blender with particles, kind of giving them their own physics and all. It works wonderfully in blender, but no matter what format I export it in, it seems I get a pearly white bald head when opening it in Unity. Is there any way to export it without having any changes to it?

I actually wouldn't use particles for hair in Unity. That could be... disastrous.

Why would that be? It wouldnt be particles if it was exported, clearly as it cannot be done in blender apparently. It would have to be converted to a mesh somehow I would assume. Then some kind of modifier/physics/animation to make it move with head motions/wind?

Are you trying for a game?

Yes. If possible I would like to make it fairly similar in the game to how it reacts in blender. Its pretty common place in games today to have more "lively" hair that move with the character instead of being stiff.

You can have it lively without using particles. Try if you want, but I don't think it'll work.


text:
Materials not applying how the appear in preview (after rendering)
So I've never tried using a texture before on a model but I was making a building and I wanted to give the door frames a 'limestone/marble' look to them so I popped in a texture and plugged it in from Image Texture to Diffuse to Output via color then BSDF ports. In the preview it appears like it came out good but when rendering my texture is a rather flat color similar to the texture I used. Image to show what I mean, thanks in advance.

Possibly related: http://blender.stackexchange.com/q/14114/599

What you need is to input some sort of texture coordinate for Blender to map the texture to your mesh. All image textures require this.
What you needto do is to go to the Node editor and press Shift+A and add either a Texture Coordinate or a UV Map node.

Put one of the values into the purple Vector socket in your Image Texture node.

You can use any of these values, plug them into the same place as shown.

If the texture was appearing in textured view like the OP suggests, then they must have a UV map already (which would be used automatically).

Wait, what? Blender doesn't automatically use UV maps for me :-(

Huh? It always does for me..?

In cycles? I always have to add a UV or vector input.

Try this file: http://www.pasteall.org/blend/33723

It works . . . that is odd.

what version do you have ?

2.49, 2.6, 2.70-2.73 and some others in between . . .

How recently was this functionality added?

It's been here since forever I think. IIRC the earliest release with cycles did this (just tested in 2.62, which is the oldest version of blender with cycles that I have around).

If no vector is connected, image textures will use UVs and procedural textures will use Generated coords.

Using a "generator texture coordinate" worked. Thanks a lot guys! It looks like the texture image is a bit large making it look odd but I can fix that. :D


text:
Changing display modes in blender 2.8
I downloaded the daily blender build from the 2.8 branch a few days ago to try out some new features. I found that some of the interface has changed, especially that the display modes button is missing.
The default mode is rendered. How can I change that to solid or wireframe?

I'm voting to close this question as off-topic because it is about an unreleased unsupported version of Blender

Any chance the off-topic could be made clear in the help center itself? Or one usually has to go to meta for this? Stack exchange seems to imply there is a defined scope in the help center ("This question does not appear to be about Blender within the scope defined in the help center."), while there really isn't much over there.

This is a very recent situation, I don't think the help center has been updated to reflect that. Also very localized one, once 2.8 is releases it wouldn't be an issue any more. There is some discussion about it here https://blender.meta.stackexchange.com/questions/2349/are-questions-about-the-2-8-branch-on-topic

It won't be an issue for 2.8 anymore, but it will still be an issue for future versions. So maybe an overall "questions about unreleased versions are off-topic"? Yeah, I already jumped to meta and caught that one. A little too late, but oh well.

You should bring that up in the meta site then. Feel free to post a question mentioning this thread. I am sure some of the moderators might be interested in adding it to the rules.

2.8 builds are work in progress so that they can test features and introduce work that needs to be considered - but these builds are not complete and finished for production, and they might not be ready for all use cases just yet. I also wonder about where the wireframes will come in since I use them for some cases when painting and masking, but for now I stick to the 2.78c where my addons work.


text:
How to use modifiers on a metaball animation
I know that if I want to use modifiers on metaballs, I first have to convert them to a mesh. However I'd like to use modifiers on a metaball animation, and the only way I know of is to repeat the steps of [convert to mesh, use modifiers, render image] for every single frame of the animation.
Is there a way around that, for example, converting the whole animation to an animated mesh, or an addon that automates the process?

The Animation Nodes add-on works on metaballs using the Mesh nodes. So you can do all kinds of things with them. Most of the things the modifiers do, if not all (but much more for sure).
The latest version is here.
There's plenty of resource on Youtube to learn how to use this big and powerful add-on. Even the developer Jacques Lucke has a Youtube channel full of it. The documentation is also very useful.
Actually, even Sverchok works on metaballs, so I guess you're pretty much covered. Sverchok is similar to Animation Nodes but offers other possibilities. And the resources are even more extensive. There's a Documentation too and Jimmy Gunawan made so many videos, any effect you can think of, he's certainly got one for it. Heck, he's got a whole series with Metaballs !
There's a bit of a learning curve for both of these add-ons, but every minute spent on them is worth it. They're arguably among the best free add-ons for Blender and we won't have a built-in "Everything Nodes" anytime soon.
If you're stuck on how to do a specific effect with any of these add-ons you can ask in another question and give a link in a comment below. But first learn the basics.
Good luck !


text:
Get bones associated with specific action in python
Let's say I have a mesh with an armature and I've given it an animation action. I know I can get the action with bpy.data.actions and the bones with bpy.context.selected_pose_bones. But how would I get only the bones that have keyframes set for that specific action? For example, let's say I make a kick action and only bones for the right leg have keyframes, no other bones have any for that action. How would I get the bones for the right leg given the kick action?

Following is one way of getting the bones in a given action.
armature = bpy.context.scene.objects['Armature']
action = bpy.data.actions['ArmatureAction.002']

pose_bones = set()

for fcurve in action.fcurves:
    pose_bone_path = fcurve.data_path.rpartition('.')[0]
    pose_bone = armature.path_resolve(pose_bone_path)
    pose_bones.add(pose_bone)

>>> pose_bones
{
    bpy.data.objects['Armature'].pose.bones["R_lower_jnt"],
    bpy.data.objects['Armature'].pose.bones["R_hip_jnt"],
    bpy.data.objects['Armature'].pose.bones["R_thigh_jnt"]
}

Getting to the actual bone (that belongs to the data of the Armature) is accomplished like below
>>> bone = armature.data.bones[pose_bone.name]
>>> bone
bpy.data.armatures['Armature'].bones["R_hip_jnt"]

References

path_resolve
FCurve


text:
How to get angle of edge ? (python)
How can I get the angle of the edge , is there a method that return the angle of selected edge ?

I'm not very good at maths but can't you compute it easily from its start and end point coordinates.

@DuarteFarrajotaRamos I did that already many times , unfortunately I never got the correct angle.

Manually:
In edit mode, with your edges selected, fire up the properties panel N, and click on Edges, & Angle.
It worked for me.

Python:
bpy.data.meshes["Plane"].show_edges
bpy.data.meshes["Plane"].show_extra_edge_angle

Since you modified your question:
Here is an append to this answer that may get you closer:
To Actually access the information that you need, you could get all the verts and calculate angle based on XYZ deltas:
bpy.data.meshes['Plane'].vertices.items()[0][1].co
I'm not going to solve it for you, but I will at least tell you how I would approach it.
I would first loop through the verts using something like:
for vert in bpy.data.meshes['Plane'].vertices:
    print(str(vert.co.x) + "," + str(vert.co.y) + "," + str(vert.co.z))
Note this is just printing the coordinates of each vert (not very useful, other than showing you how to access their info).
Then I would calculate the angle between each vert, find the selected edges that match these verts, and spit out the angle.
Please note that you can access .edges similarly to .vertices, inside of the .edges object you will have a vertices object that is a list of two vertex indices:
eg. py.data.meshes['Plane'].edges[0].vertices[0]
It seems doable, just have to figure out the calculations, and how you are going to narrow down your selection.
Hope it helps.

I think that you would have an easier time if you thought about doing the calculations after you account for coordinate system rotations in the following example case I'm simplifying this to only "Z"
Here is a visual circular example to show you what I mean:

From your comment it seems that you are not taking this into account.
It is advisable to calculate the midpoints of the section, and do your calculations from there, because as you see in the circular example on side of the mesh is longer than the other, and getting the midsection helps you to work on the average edge rotation.
Once you have this, you can translate your coordinate locations to rotate about "Z" via the indicated angle.
As another hint, it may be advantageous to think about this angle according to the following (Where I believe that your desired angle is the sum of a2 & a3):

sorry if my question was not clear , I want to get the value of the angle to use it for example :
angle = edge.get_angle()

if angle > 50:
    do something

is there a method that return the angle of the edge ?

@Dante just updated my answer to hopefully get you pointed in the right direction.

thanks for the answer , I tried many ways but still can't get the displayed angle correctly :(
while the angle for the selected edge is Zero when i run this code it give me 35.98

import bpy,bmesh
import math
obj = bpy.context.object.data
bmsh = bmesh.from_edit_mesh(obj)
for e in bmsh.edges:
if e.select:
a_b = e.verts[0].co.x * e.verts[1].co.x + e.verts[0].co.y * e.verts[1].co.y + e.verts[0].co.z * e.verts[1].co.z
a = math.sqrt(e.verts[0].co.x * e.verts[0].co.x + e.verts[0].co.y * e.verts[0].co.y + e.verts[0].co.z * e.verts[0].co.z)
b = math.sqrt(e.verts[1].co.x * e.verts[1].co.x + e.verts[1].co.y * e.verts[1].co.y + e.verts[1].co.z * e.verts[1].co.z)
rad = (a_b/ab)
deg = rad180/3.14
angle = deg
print(angle)

@Dante I believe that my appended answer will help point you in a better direction - see edits.

The last hint would be something like the following to calculate 'a2' for instance: sin(deltaX(ptA, ptC) / deltaZ(ptA, ptC)). Where deltaX and deltaZ would be functions that you write to get an absolute difference between two input parameters.

thank you very much finally it works , I will post the code

import bpy
import math
import bmesh

vert = []

obj = bpy.context.object.data

bmsh = bmesh.from_edit_mesh(obj)

for elem in reversed(bmsh.select_history):
    if isinstance(elem, bmesh.types.BMVert):
        vert.append(elem)

v1 = vert[0].co - vert[1].co

v2 = vert[2].co - vert[1].co

v1mag = math.sqrt(v1.x * v1.x + v1.y * v1.y + v1.z * v1.z)

v1norm = [v1.x/v1mag , v1.y/v1mag , v1.z/v1mag]

v2mag = math.sqrt(v2.x * v2.x + v2.y * v2.y + v2.z * v2.z)

v2norm = [v2.x/v2mag , v2.y/v2mag , v2.z/v2mag]

res = v1norm[0] * v2norm[0] + v1norm[1] * v2norm[1] + v1norm[2] * v2norm[2]

angle = (math.acos(res)*180/math.pi)

print(angle)

bmesh.update_edit_mesh(obj)

this code depend on the selection of three vertices , it will calculate the angle for the second selected vertex.

for edge angle :
angle = (math.acos(res)*180/math.pi)-180

@DuaneDibbley Thank you , I wasn't aware of these functions.


text:
Swapping away from Sequence Render
I rendered an animation and then placed it into the video sequence editor to test it, and rendered that as a video.
Now I want to render a second animation (in other words, keep working), but when I press render animation, it's still using the sequence render option? (Rendering it as pngs). I was wondering how to switch between sequence render and animation render properly?

I have no answer to your question, but exactly for this I always create new .blend file for work in sequence editor.

You can turn Sequencer render on and off, as well as the compositor, by toggling these properties in the Scene Render Properties panel.

You can choose to render in frame sequence or a video codec here. All you do is feed a different source to the render engine.


text:
Riggify hand points down when IK handle is moved hand points to ground
I'm working on a rig in riggify. When I move the IK rig the hand points to the ground which makes me have to rotate the wrist. When I rotate the wrist it rotates the forearm. I've turned off inherit rotation for the forearm tweak which helped a little bit when I do the same with the wrist it breaks the rig. Then I tried turning the influence on the hand joint down to zero which fixed where the hand was pointing but once again turned off the rotation controls.
Is there a way to either fix where the hand points when moving the ik handle or can I control stop the tweak at the wrist affecting the forearm? Any help will be greatly appreciated!


text:
How can I output audio at 48khz?
Very noob question, I know, but I can't find the answer on Google or in the manual.
I'm editing a movie file in the VSE, and nothing else. When I want to render it out, the audio is at 44.1kHz, and I'd like it to be 48kHz. I can't find the setting for that anywhere.
The audio I've imported is already at 48kHz.
Can anyone point me in the right direction?

In the 'Scene' buttons, there is an Audio Panel. It has a Format: label, under which you can adjust the Channel count and Rate.
Then you can render Audio from the render panel (also known as Mixdown).


text:
Custom property hops{}
Blender 2.78c adds an object custom property hops{} which is labeled "API Defin" - can't be edited, won't stay deleted, can't find docs on it. Anyone know what it is and if it's documented somewhere?

Did you try disabling addons and see if it is from one of them?

Brilliant! Didn't think of that - yes, it is something that the hardops add-on is adding. Mystery solved - thanks for the suggestion!

Great! I have added my comment as an answer to your question with some additional information. You could accept it if you think that it is appropriate.

You can debug this issue by disabling addons and see if it is from one of them?
Blender Python API allows addons to register properties on some of the builtin types when the addon is enabled. These properties are attached to builtin types in the addon register function and detached in the unregister function.

Turns out it is something that the Hardops add-on is adding. Mystery solved.


text:
How to set different Profile Curve resolution for each instanced curve?
I want to have a different resolution for each profile curve based on curve index. However, all of the curves end up having the same profile curve resolution.

Edit (with deformation):

It seems you want this:

.......

Inefficient as hell, but technically it solves the question! I guess there is really no other way.. Would this be a good feature to ask for on Right Click Select?

@VSB the feature to ask for is loops. There are no real loops in geometry nodes. It is possible, however, to reproduce the curve beveling in geometry nodes and therefore create an efficient alternative. Problem is, the node tree would be so big it would be a poor fit for BSE.

Instead of instantiating the base curve along a line, and extruding a profile along it, you would have to reverse that in this case:
First instantiate the profile curves, subdivide them as you wish, and extrude them all together along your base curve.
This could look something like this:

(Blender 3.2+)

Can you make that work with instanced curves instead of instanced profiles? Or with instanced curves and instanced profiles?

@VSB Unfortunately, I do not understand this question. The curves used here are "profiles" (Profile Curve) for Curve to Mesh. What exactly do you want to do?

The file I provided is a very simplified version. Actual application instances curve lines and not the Profile Curve, so above needs to also instance the Curve Line. There is a deformation applied to the curve line creating a variation. I have uploaded a more complex example.

@VSB Ah, now I understand what you mean. I'm afraid this won't work, unfortunately. Curve to Mesh extrudes along one or more base curves, which can also be different, but it always uses all passed profile curves at once for each extrusion. Unfortunately, with this node you can't selectively decide on which base curve to extrude which profile, so you'd have to think of another solution. Sorry, this is the way this node works.


text:
Align To Euler on Curve Tangent problem

I can solve the spinning issue by constraining pivot axis to X or Y instead of auto, but I am not sure how to combine the two rotations (assuming that is what needs to be done). This might be a Euler to Quaternion conversion issue.
Here is what I am trying to achieve (but this only works rotating around x-axis and does not work for y or z axis rotation of course):

Please see attached .blend file.
The curve needs to be able to rotate on all axis without the instances moving out of place.

Level 2 with the curve deformation (I am not sure this one can be solved):

I'm really not sure you asked the right question.
This question has 2 parts.
1:
But here is an example that I think you need:

enter link description here
As you can see, we have 2 vector: Curve Normal and Curve Tangent.
Math side of this problem: Matrix. For build correct euler rotation vector, first have to build matrix. This not so correct, but it clear.
Idea: Cross production of 2 vector is other one, perpendicular vector.
Now, is combine 3 parallel vector in one object, we have matrix.
Matrix can be reinterpreted in to euler rotation vector.

Right now you can skip matrix part in geometry nodes by using Align Euler to Vector. If imagine: this node create serphase, what normal is inputting vector. Theoretically, now you can get random rotation from this surface. But this no make sense. We can get only one random rotation to point on this surface.
Now another one Align Euler to Vector rotate previous euler rotation (attached to new surface) for align to new normal what is Curve Normal.
This step finalize mathix by 2 vector, but virtually, we work only with surfaces, normals and rotations.
But as result, we get full rotation matrix, builded in euler rotation vector.
Last one step. Random rotation, if convert it to rotation matrix, we can multiply it on other matrix, that can be other rotation matrix is.
You can avoid matrix on this step by Rotate Euler node.

If write this as math formular:
Curve Basis = {Curve Normal, Curve Normal * Curve Tangent, Curve Tangetn};
Other Matrix (Rangeom intances rotation euler vector) -> to matrix;

New one = Curve Basis * Other Matrix;

Rotation = New one -> as euler;

Not yet:

Patrionally this task will be solved, if Jacques Lucke (Geometry Node dev) will add Axis to Euler node (that just combine first two steps).

Or if Lukas Toenne finished nodes-matrix-types branch

2:
The rotation of the curve implies a complete change in its position. Unlike default attributes, normal and tangent are parametric. And the calculation happens at the moment you need the attribute.
That is, if you rotate your geometry, the parametric attributes will be calculated according to the new state. This means that the parametric normal will be calculated differently. And under certain conditions, it will look like excessive rotation.
Since you are not deforming the curve, but transforming it (by multiplying by the matrix in theory), then in order to be able to capture the normal before the transformation, during the transformation, the normal must also be rotated (multiplied by the matrix of the new space). Just like any other vector. But the parametric normal is the only thing that changes in this case.
Fixed your example file

At last, will be more simple, if instansing all elements at first, and after this just use Transform Geometry (or make it to be another instane and transfome this)

Thank you for trying to answer this question, but above does not appear to work. Please see the .blend in the question. I want to rotate the curve and the instances to move with the curve without spinning out of place (I will attach a gif of the desired effect). I believe this is happening due to Euler limitation when converting to Quaternion matrix.

I was add another one point directly for your case

You are pretty close with the last edit, but it breaks with non-zero rotation point. I moved the host curve using Set Position node and changed your file to sample the position of the first index to use as the center of rotation for the "Rotate" groups. When rotating it began to behave similar to the issue I had.

Make sure, you haven't rotate normal around some non-zoro centre

That solved it!!! Thank you!

If you want the tangent to stay consistent to the rotation given to the spiral curve, just add a vector input (for the rotation) and plug it to the Align Euler to Vector.
Doing that, the relative relation between the spiral rotation and its tangents should be constant, and there is no more spinning effect for the instances.

Complement: why the instances are spinning without that?
As the Rotation input of Align Euler to Vector was not given Blender considers it as $(0, 0, 0)$ rotation.
When the parameter is "auto", the documentation says:

Auto
The best rotation angle is computed automatically.
This minimizes the angle of rotation.

And to minimize the angle considering the tangent and the constant $(0, 0, 0)$, this is not always the same result, and that explains the spinning of the instances.
Giving the same rotation for both the spiral points and the Align Euler to Vector, this calculation stays stable, as the tangents are rotated the same way the spiral itself is.

Maybe I don't understand the question, nor your answer, but if you don't plug in a node at the Rotation input, the values $(0,0,0)$ are automatically used.

@quellenform, yes this is the point... I'll add some explanation about that... my understanding of the question "when the spiral is rotated, the instances are spinning around the spiral and this is unwanted", right?

Ah, now I understand: you mean that the desired rotation should be entered here. ...I have misunderstood. This would actually stabilize the rotation, because the same rotation applies to both the base object and the instances created there. Correct!

yes, nothing to do with the normals here (imo) as they are not involved in this calculation.

Yes, I agree with you: that would not be necessary. Just manage the rotation via a common input, as you have done. This is more efficient.

Similarly, you could just rotate once in the end? https://i.imgur.com/P9EhbHt.png

@MarkusvonBroady, yes, but this is similar to Robin's answer (deleted): have a look at the comments below it.

It would be nice to produce a real case then, because honestly I don't understand the problem. Your solution is fine, of course, but for multiple such objects you could just convert each to an instance and then rotate instances in order to have a separate rotation for each.

@MarkusvonBroady, yes, but we don't really know what VSB wants to do at the end...

@lemon this answers the question as it is written as well! Bonus points if you can make it work without knowing the rotation of the host curve. In my actual application the host curve is a Realized Instance on a highly deformed curve. I was trying to keep the question simple..

@VSB... this is nearly a totally different question! I'll try to think about it, but in this case, I'm not sure there is a solution, except maybe the one of mod nop... could you upload a blend with an example of that?

If the curve is realized, what I don't understand is "what is the importance of the initial rotation in this case"?

In the answer above, I approached the question of how to use the curve parameters (normal and tangent), and later extended it to transform the curve. If the question was only about what to duplicate the transformations, then yes, this is a completely different question.

@modnop, yes. I've not read your node tree for now. But what you describe seems to be the good approach... I think the question should be updated for clarification.

@lemon and all... I  had to reward the accepted answer in the end, sorry, yours is fine, too. This whole discussion still leaves the Q I had in mind unanswered ? The Tangent of a curve is fixed by its own geometry, leaving a disc of possible Normals. Which one is selected presumably is a cross-product between Tangent and something, but I can't reproduce it by hand.. normalized Position doesn't seem to work for me? . Will post a Q of my own, after checking for silly mistakes.. A sniff at the right part of the code would be good.. if only I could find it.

@RobinBetts, np for me. I agree that the Q is still opened. I had no time to go further but had in mind the following: calculating a local space for each point using locations at previous and next indices, so that we have a rotation matrix. But from that, going back to a Euler rotation is headache for me... so??

@lemon I added the deformation example, sorry it took so long!

@VSB, ok, could you clarify which part can be modified? Is it only the pink part in regard to rotation given to the curve in the top left part?

@lemon yes, just the rotation vector. But the rotation can be set after instancing if needed. Set Position node can be used instead of Rotate Instances.


text:
Error: Object 'Sphere.022' has no mesh data to be used for ray casting
I am getting above error when trying to obj.ray_cast() from a copy of an object:
obj = bpy.data.scenes[0].objects["Sphere"].copy()
is_hit, hit_loc, hit_normal, index = obj.ray_cast(localA, localB)

I figured out this was due to objects being linked. Making object data single user solved this issue. However, I need to keep it linked. Is there a way to keep objects in linked state and still use the ray_cast() function?

You need to link the object to the scene and update it for ray casting to work.
import bpy, mathutils

obj = bpy.data.scenes[0].objects["Cube"].copy()
# Insert your new object in the scene
bpy.context.scene.objects.link(obj)
# Update scene
bpy.context.scene.update()

is_hit, hit_loc, hit_normal, index = obj.ray_cast(mathutils.Vector(), mathutils.Vector([1,1,1]))

print(is_hit, hit_loc, hit_normal, index)

Prints:
True <Vector (1.0000, 1.0000, 1.0000)> <Vector (0.0000, 1.0000, 0.0000)> 5

You might need to delete the object after your operation
bpy.context.scene.objects.unlink(obj)
bpy.data.objects.remove(obj)
del obj


text:
Python: Object custom property glitch
I have the following custom prop:
class Settings(bpy.types.PropertyGroup):
    enabled = False
    state = {
        "some_data": None, # edit: this points to numpy array
        "some_other_data": None
    }
    string_prop = StringProperty(
        name='Heyyy')

Assigned to:
bpy.types.Object.my_settings = PointerProperty(type=Settings)

There are two issues I am having.
1) I cannot change the value of enabled, like so:
class Init(bpy.types.Operator):
    bl_idname = "object.init"
    bl_label = "Init"
    def execute(self, context):
        context.object.my_settings.enabled = True
        return {'FINISHED'}

2) All of the objects share and control values of state
There are no issues with blender props like the string_prop above.
I assume this is just how Blender handles custom PropertyGroups. Is there a way to make this work? I need to have information stored per object. The only other solution I can think of so far is to store an array of custom props per scene and check which one is currently active based on the id of the selected object, but that is more complicated than I would like it to be.

The issue as I see it is in storing your custom data.  Your enabled property above is a class property.  bpy.props.stringproperty is used to add a property of that type on each instance.  See docs on property getter setter which shows how the properties are stored  using custom properties of the same name.  You can also use the ol' fashioned python property(getter, setter)  and a global (if you don't need to save) or could save to a string json style etc.

The boolean flag is the simple part here. As you already assumed, those PropertyGroups are designed to hold Blender Properties only. So instead of
enabled = False

you should use
enabled = BoolProperty(default = False)  // which is anyways the default

The state property is more difficult. There are no Dictionary properties available to you, but maybe you can work around your issue by using a CollectionProperty instead?
Create a class first to hold your collection, for example:
class MyCollection(PropertyGroup):
    val1 = StringProperty()
    val2 = IntProperty(min = 0, max = 999)
    // etc etc

Then, in your Settings class, reference it like this:
variableCollection = CollectionProperty(type = MyCollection)

To add items to the collection, use this in your operator code:
x = context.object.my_settings.variableCollection.add()
x.val1 = 'This works'
x.val2 = 34

Alternatively, you can also nest PropertyGroups of course. That would be
nestedProperties = PointerProperty(type = MyCollection)

That would allow you to do:
context.object.my_settings.nestedProperties.val1 = 'This is nested'
context.object.my_settings.nestedProperties.val2 = 33

It depends on your situation in terms of what works best. But keep in mind that Blender's own property types are the only ones it can store with the file.
One last way to store Python data - but this does not save that data with the file - is simply using a key - value approach on the object. You can always use something like:
x = bpy.context.object
x['myCustomKey'] = myDesiredValue

The resulting data can then even be viewed in the viewport:

thanks for a great answer! Unfortunately I am storing numpy arrays and lists in the state dic..

@VSB Maybe you should use a different approach then: try x = context.object followed by x['myCustomData'] = whateverYouNeed. This can hold arrays, lists, whatnot, and is attatched to the object in question. Unfortunately, you cannot save the results this way in the file.

haha that I think should work perfectly, thanks!!

looks like we almost had it.. for some reason Blender converts numpy arrays stored per object to IDPropertyArray :(

@VSB maybe Richard Colburn can help? He did a few numpy for Blender Tutorials here https://m.youtube.com/channel/UCavaCSVksKt6RvrBmohmSoA

it looks like Blender just does not allow anything other than the standard data types. I will have to use another way or just go back to having settings per scene. ¯\(ツ)/¯


text:
Fastest way to move image pixels between Blender and GPU memory?
I want to cudaMemcpy directly into bpy.data.images["my_image"].pixels, is that possible?
Right now I am doing this, and it is not as fast as I would like..
# upload image to a numpy array
np_data = numpy.zeros((my_image.size), dtype=numpy.float32)

pixels_list = list(my_image.pixels)

for i in range(0, len(my_image.pixels)):
    np_data[i] = pixels_list[i]

# do stuff on GPU
GPUkernel.apply_filter(ctypes.c_void_p(np_data.ctypes.data))

# move data back to host from GPU into np_data
# code here..

# update image in blender
my_image.pixels = np_data.tolist()


text:
When I Import Two Models Into Blender I Can Only Edit One at a Time
So I made a few models for a project I'm working on and I decided I wanted to certain parts individually and then import them in as a .obj file. So I did that and then when I tried to go into edit mode I could only edit one of objects. Also I noticed that, when highlighted the objects have different shades of orange. I would really appreciate any help I can get to solve this problem.
Thanks, Nova

Editing multiple objects
First of all, you can only edit one object at a time.  Normally if you want to edit multiple objects at a time you will have to join them with Ctrl + J.  However there is an addon called multi-edit which allows you to edit multiple objects simultaneously.
The active object
When you go into edit mode with more than one object Blender will keep all other objects selected, but will only allow you to edit the geometry of the active object.  The active object is marked by a slightly lighter orange border than other selected objects.  It is typically the object which you single selected last.  If you do a group select (such as box select with B or brush select with C) the active object does not change.
Check out this post for more on the active object.


text:
Baked smoke shakes during render - Eevee
See render here
Smoke simulation is shaking / moving in Eevee render.
Blender 2.90.1

Does baking the light help? See: https://blender.stackexchange.com/a/128164/31447

@brockmann assuming I did it right, it did not help..

Would take some time to rebuild the smoke so most likely easier for all here if you'd share a file: https://blend-exchange.giantcowfilms.com/#

@brockmann I figured it out, this was due to Adaptive Domain being enabled. I remember now reading about this issue long ago, I guess they never bothered to fix it. Typical Blender stuff...

Cool! Do you mind adding that as an answer for future visitors?

Hello and welcome. While images and links are helpful additions, questions should stand on their own. Please provide some context and explanation, don't just post an image or link

The "shaking" is due to Adaptive Domain, as the domain adjusts to the size of the simulation it stretches and "moves" the smoke simulation. This is a known old issue as can be seen here as well.


text:
Python - Assigning vertex weights is extremely slow
Current very slow method (code reduced):
    obj = bpy.context.active_object
    vgroups = obj.vertex_groups.new(name="test_layer")

    for loop in obj.data.loops:
        vindex = obj.data.loops[loop.index].vertex_index
        vgroups.add([vindex], value, "REPLACE")

Performance is tested on 1024 x 1024 grid and takes minutes to complete for several weight layers.
My goal is not to assign the same weight value, but different values for each vertex.
I believe I am looking for something like below, which does not exist.
active_object.vertex_groups[group_name].foreach_set()

As noted in answer below, loop over verts not loops. 8 verts in cube, 24 loops.   Also content that loop is obj.data.loops[loop.index] in code above.

@batFINGER that is a good point, I did not think about that and will rewrite to use vertex index instead. I was using loops to get UV data for that vertex, but maybe even that is not necessary.

Usage of loops here is not clear.
You can:
import bpy

obj = bpy.context.active_object
vgroup = obj.vertex_groups.new(name="test_layer")

value = 0.5

for i in range(len(obj.data.vertices)):
    vgroup.add( [i], value, 'REPLACE')

We add vertices to a group, using their indexes.
The documentation is here:

add(index, weight, type)
Add vertices to the group

Parameters
        index (int array of 1 items in [-inf, inf]) – Index List
        weight (float in [0, 1]) – Vertex weight
        type (enum in ['REPLACE', 'ADD', 'SUBTRACT']) –
        Vertex assign mode
            REPLACE Replace, Replace.
            ADD Add, Add.
            SUBTRACT Subtract, Subtract.

I am using loops due to other processes in the function. The method you provided is the same one I use and is very slow. For example to batch set vertex colors this should work active_object.data.vertex_colors[0].data.foreach_set(new_color_set)

OK. I tested what I propose on over a million of vertices, it is nearly instant (maybe 1s).

If you use data.loops and want to 'replace' the weight, you're just doing it several times. Why are you talking about vertex colors now?

No need for loop  with constant value  (value = 0.5 as coded above) vg.add(range(len(obj.data.vertices)),  value, 'REPLACE')

@batFINGER. Sure but he ask for several values. "My goal is not to assign the same weight value, but different values for each vertex."

Yes can read. Maybe use random() or zip in example shown in answer  code. AFAIK there is no quick way to do foreach_set / get here. .

@batFINGER, yes but it is a bit unclear. In comments he's talking about vertex colors, now... so I don't know. And this is not so slow, so there is something elsewhere in the code that is slow.

I went to edit the comment to clarify, but missed the 5 minute time limit. I was just adding vertex_colors as an example. 1 second is better than what I am getting now, but is still slower than foreach_set would be unfortunately. On a 4k grid it would take 16 seconds and there are 5 vertex layers, so would take over a minute. I will rewrite my code to not use loops, that should help some.

@VSB, your question was about vertex groups, not colors. You can't foreach_set for groups.


text:
Python - How to detect when user opens another file inside Blender?
Edit: I think I have found what I was looking for bpy.app.handlers.load_post, but will leave it open for maybe better suggestions.
I have a class variable that is stored in bpy.types.Scene.my_class, which I access with context.scene.my_class.
The problem I am having is that I need this class to be deleted and recreated when the user opens another .blend file from within Blender. The only way I can think of is to store path + file_name to the current .blend and check it before running the rest of my script to decide if my_class needs to be refreshed.

Is it a property or some "monkey patch" arrangement like bpy.types.Scene.foo = 2 ?

@batFINGER It is a monkey patch for sure, holds a custom class with internal data (numpy arrays, etc..)

Using a handler to remove my_class:
from bpy.app.handlers import persistent

@persistent
def handler_new_scene(scene):
    del bpy.types.Scene.my_class

I think del scene.my_class will work also, or scene.my_class = None if still need to have the attribute.
In the register function I add my function to the load_pre handler, which will run before a new scene is loaded:
bpy.app.handlers.load_pre.append(handler_new_scene)