Need Help Porting Scripts to Blender 2.8

Hello,
I think the only thing keeping me from go ahead and use Blender 2.8 is that I use these two scripts a lot:

“blender select similar vert count” script 8 lines of code (SOLVED!)
“uv maps rename” script 4 lines of code

I really use it very often and I wonder how to fix so it work on 2.8.

I am not sure where I downloaded it from so I not even know if its legal to place the code here (gpl and stuff :D)

If someone wish to help please reply here,

My regards!

one is from here:

and I just found the select similar 2.8 version here :smiley:

Hi rafbr,

when I run the “uv maps rename” script from the accepted answer of your stackexchange link it just works without errors in my Blender 2.80 (from last Friday’s buildbot, after RC2). Doesn’t it work for you? Are you getting any errors when you run it? Which Blender build are you using?

Thank you Sanne for your time, and yes it works!

I am sorry to bother but I tested a few other scripts and no one of them worked so I thought every one should have to be coded again.

https://archive.blender.org/wiki/index.php/Extensions:2.6/Py/Scripts/Object/Drop_to_ground/
What about this one? This is not a script but a addon.
I think it is one of the most convenient add-ons since we live on a planet surface with gravity…

Should I look for a way to port it or it is really advanced for a no programmer?

My regards!

Is this the latest working version? The pictures doesn’t seem to match the code on that page. The random location option is not even in the code.

Great the script it works for you also!

Regarding addons, they all have to be updated for Blender 2.80, because Blender’s addon API changed in some places. The API got stable only recently, so it might be a while until all addons are updated, it depends on the developer.

If you want to try yourself, here are two useful threads:

2 Likes

Drop to ground 2.8 worked very well. I am glad for your help! :grinning::grinning::grinning:
I have been using Blender 2.8 the last couple of days with a very heavy scene with linked objects and all and it is working very well, so I am leaving 2.79 and is nice to have these scripts again!

My regards!

Thank you very much, very useful script!

1 Like

https://b3d.interplanety.org/en/changing-objects-visibility-in-the-viewport-and-while-rendering/

This script is failing to me. It gives error in line 2. And it is supposed to work on 2.8

Problem solved, my mistake typing it!
Might be useful script for you anyway.
My regards!

Need Help!
The ‘select similar 2.8’ version not working fine when two or more collections inside the Scene Collection.

To reproduce this error:

You have ‘Scene Collection’ and inside of it ‘Collection’, ‘Collection 2’
Now just put some cubes and spheres in both collections and you are done.
The script become inconsistent, some times it Works with no erros, some time Works with erros and sometimes do not work at all.

Traceback (most recent call last):
File “<blender_console>”, line 3, in
RuntimeError: Error: Object ‘Sphere’ can’t be selected because it is not in View Layer ‘View Layer’!

How to make this script to look only on enabled collections/not hidden objects?

My regards!

I did a google search “blender bpy.context” and found that replacing “bpy.context.scene” for “bpy.context.collection” it solved this issue. Well, almost…

After another round of trial and error I got it working:
“bpy.context.view_layer.objects” works! :grinning:

2 Likes

Maybe you could look into this:

:slightly_smiling_face: