• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Austin Sass Blender 2.8 Script Error (solved)

Messages
195
Country
us-ohio
I'm trying to run a script for Blender in order to speed up modelling but the script was for previous versions of blender. Specifically, the line "bpy.context.scene.objects.active" (bold) is supposedly no longer used by Blender. I don't quite understand what I should replace that line with in order to fix the script for Blender 2.8. There were also similar issues for the VIEW3D lines. If you're curious about this script, it came from Austin Sass (no longer active unfortunately so he couldn't answer these questions)

Error Message: AttributeError: bpy_prop_collection: attribute "active" not found
Error Message:
File "C:\Program Files\Blender Foundation\Blender 2.82\2.82\scripts\modules\bpy\ops.py", line 199, in __call__
ret = op_call(self.idname_py(), C_dict, kw, C_exec, C_undo)
AttributeError: Calling operator "bpy.ops.view3d.viewnumpad" error, could not be found

Script:
import bpy
template = 'Loft 2.5'
selected = bpy.context.selected_objects

for o in selected:
o.data.bevel_object = bpy.data.objects['Loft 2.5']

for o in selected:
bpy.ops.object.mode_set(mode = 'OBJECT')
bpy.context.scene.objects.active = o
bpy.ops.object.convert(target='MESH')
bpy.ops.object.transform_apply(location=False, rotation=True, scale=True)
bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.mesh.select_all(action = 'DESELECT')
bpy.ops.object.mode_set(mode = 'OBJECT')
o.data.polygons[0].select = True;
bpy.ops.object.mode_set(mode = 'EDIT')
for area in bpy.context.screen.areas:
if area.type == 'VIEW_3D':
override = bpy.context.copy()
override['area'] = area
bpy.ops.view3d.viewnumpad(override, type='TOP', align_active=True)
break
bpy.ops.mesh.select_all(action = 'DESELECT')
bpy.ops.mesh.select_all(action = 'TOGGLE')
for area in bpy.context.screen.areas:
if area.type == 'VIEW_3D':
for region in area.regions:
if region.type == 'WINDOW':
override = {'area': area, 'region': region, 'edit_object': bpy.context.edit_object}
bpy.ops.uv.follow_active_quads()
break
bpy.ops.object.mode_set(mode = 'OBJECT')

EDIT (SOLUTION): Here is the corrected script for Blender 2.8 import bpy
template = 'template'
selected = bpy.context.selected_objects

for o in selected:
o.data.bevel_object = bpy.data.objects['template']

for o in selected:
bpy.ops.object.mode_set(mode = 'OBJECT')
bpy.context.view_layer.objects.active = o
bpy.ops.object.convert(target='MESH')
bpy.ops.object.transform_apply(location=False, rotation=True, scale=True)
bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.mesh.select_all(action = 'DESELECT')
bpy.ops.object.mode_set(mode = 'OBJECT')
o.data.polygons[0].select = True;
bpy.ops.object.mode_set(mode = 'EDIT')
for area in bpy.context.screen.areas:
if area.type == 'VIEW_3D':
override = bpy.context.copy()
override['area'] = area
bpy.ops.view3d.view_axis(override, type='TOP', align_active=True)
break
bpy.ops.mesh.select_all(action = 'DESELECT')
bpy.ops.mesh.select_all(action = 'TOGGLE')
for area in bpy.context.screen.areas:
if area.type == 'VIEW_3D':
for region in area.regions:
if region.type == 'WINDOW':
override = {'area': area, 'region': region, 'edit_object': bpy.context.edit_object}
bpy.ops.uv.follow_active_quads()
break
bpy.ops.object.mode_set(mode = 'OBJECT')
 
Last edited:

Pyscen

Resource contributor
Messages
2,994
Country
us-texas
The latest toolset works for blender v3.x.x to LTS V3.6.x (including LTS 3.3.x) The toolset is for fsx through p3d v5

The script by Austin, I think you are out of luck. Blender v2.80 is very old and many.changes were made since then.
 
Messages
4
Country
brazil
thank you Doug, can you help where can i find this toolset for this version above 3.3x? the script by austin i foud only for version 2.8, and didnt work with me because my is 3.5.0. will be greatfull if you can help me.
 
Messages
4
Country
brazil
The latest toolset works for blender v3.x.x to LTS V3.6.x (including LTS 3.3.x) The toolset is for fsx through p3d v5

The script by Austin, I think you are out of luck. Blender v2.80 is very old and many.changes were made since then.
thank you Doug, can you help where can i find this toolset for this version above 3.3x? the script by austin i foud only for version 2.8, and didnt work with me because my is 3.5.0. will be greatfull if you can help me.
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,944
Country
us-wisconsin
You can still use v2.8 You don't always need the latest version of Blender. If you use the Portable (Zipped) versions of Blender, you could have multiple versions on the same computer.
 

Pyscen

Resource contributor
Messages
2,994
Country
us-texas
Hello...

thank you Doug, can you help where can i find this toolset for this version above 3.3x? the script by austin i foud only for version 2.8, and didnt work with me because my is 3.5.0. will be greatfull if you can help me.

Within the resource section on this site:


As Dick mentioned you can install multiple versions of Blender - just install by using the zipped up version of any version of Blender you wish. Just need to create a shortcut for the version.
 
Messages
4
Country
brazil
Olá...



Na seção de recursos deste site:


Como Dick mencionou, você pode instalar várias versões do Blender - basta instalar usando a versão compactada de qualquer versão do Blender que desejar. Só precisa criar um atalho para a versão.
muito obrigado vou fazer agora :)
 
Messages
1
Country
algeria
the script by austin i foud only for version 2.8, and didnt work with me because my is 3.5.0. will be greatfull if you can help me.

pour moi ca marche sur le version 2.93.10 je vien de l'essayer sur la 4.1 ca marche aussi a essayer chez vous le truc a faire c'est avant de lancer le scipt il faut suivre ces étape en photos
si quelqun a une solution pour cette astuce via le script je suis prenneur

for me it works on version 2.93.10 I've just tried it on 4.1 it also works try it at home the thing to do is before launching scipt follow these steps
if anyone has a solution for this trick via the script, I'm interested.
 

Attachments

  • blender.jpg
    blender.jpg
    214 KB · Views: 8
  • blender2.jpg
    blender2.jpg
    245.6 KB · Views: 8
Last edited:
Top