SCS Blender Tools

User avatar
abasstreppas
Posts: 7492
Joined: 06 Feb 2013 20:32
Location: Back on Öland again
Contact:

Re: SCS Blender Tools

#3102 Post by abasstreppas » 08 Jun 2022 22:42

Can I change a default value on the vertex paint somewhere in some file so it sets to 0.5 and not to 1.0, when adding a new vertex paint layer?
User avatar
xXCARL1992Xx
Posts: 16524
Joined: 17 Aug 2016 12:18
Contact:

Re: SCS Blender Tools

#3103 Post by xXCARL1992Xx » 09 Jun 2022 15:49

normally if you apply a a material to a new mesh the BT panel will give you 2 options to apply correct vertex color

[ external image ]

but if you mean in vertex paint mod, just open blender, go into vertex paint mod, set color to 0.5, and save is as default scene, File > Defaults > Save Startup Scene
| !!!NO SUPPORT OR REQUESTS OF ANY SORT VIA PM!!! | Screenshot Thread | Steam Workshop | World of Trucks Profil |
[ external image ]
User avatar
abasstreppas
Posts: 7492
Joined: 06 Feb 2013 20:32
Location: Back on Öland again
Contact:

Re: SCS Blender Tools

#3104 Post by abasstreppas » 09 Jun 2022 16:15

It's more like when I have older models that needs updating with base and alpha color 0.5 it would be very handy to just delete the vertex paint layers and add new base and alpha that has 0.5 as default. No need to do any extra clicks or drop down menus. I'm lazy... lol
User avatar
xXCARL1992Xx
Posts: 16524
Joined: 17 Aug 2016 12:18
Contact:

Re: SCS Blender Tools

#3105 Post by xXCARL1992Xx » 09 Jun 2022 16:17

this is what the image does, if you delete them it will create new ones if you click on it, but only for one object at a time, the other way would be to do it via python if possible
| !!!NO SUPPORT OR REQUESTS OF ANY SORT VIA PM!!! | Screenshot Thread | Steam Workshop | World of Trucks Profil |
[ external image ]
User avatar
abasstreppas
Posts: 7492
Joined: 06 Feb 2013 20:32
Location: Back on Öland again
Contact:

Re: SCS Blender Tools

#3106 Post by abasstreppas » 09 Jun 2022 17:33

Did what you pic showed and it was a nice feeling :D I have never seen that before as I always tend to add vertex colors the first thing, before adding any shader. I searched through all python files earlier but didn't find anything that worked. Anyway, what you suggested works like a charm. Thanks :)
User avatar
xXCARL1992Xx
Posts: 16524
Joined: 17 Aug 2016 12:18
Contact:

Re: SCS Blender Tools

#3107 Post by xXCARL1992Xx » 09 Jun 2022 18:19

@abasstreppas
well, i have hacked together something i found on google, i cant get it to work so it does it for all selected object, but it can set it for the active object that is selected, maybe this is better ?

[ external image ]

Code: Select all

import bpy

for me in bpy.data.meshes:
    uvs = [uv for uv in me.vertex_colors]
    while uvs:
        me.vertex_colors.remove(uvs.pop())
        
import bpy
import bmesh
from random import uniform
context = bpy.context
mesh = context.object.data
bm = bmesh.new()
bm.from_mesh(mesh)
    
color_layer = bm.loops.layers.color.new("Col")
color = (0.5, 0.5, 0.5, 0.5)
for face in bm.faces:
    for loop in face.loops:
        print("Vert:", loop.vert.index)
        loop[color_layer] = color
        
color_layer = bm.loops.layers.color.new("Col_alpha")
color = (0.5, 0.5, 0.5, 0.5)
for face in bm.faces:
    for loop in face.loops:
        print("Vert:", loop.vert.index)
        loop[color_layer] = color

bm.to_mesh(mesh) 
i better everybody who knows python will kick me 6 ways from sunday for it :rofl:

edit:
tweaked it a bit, what it does now is delete all vertex color from selected object and then create col and col_alpha with 0.5 color
| !!!NO SUPPORT OR REQUESTS OF ANY SORT VIA PM!!! | Screenshot Thread | Steam Workshop | World of Trucks Profil |
[ external image ]
User avatar
xeviax
Posts: 572
Joined: 22 Jun 2018 17:33

Re: SCS Blender Tools

#3108 Post by xeviax » 11 Jun 2022 10:50

I don't know why this is happening. I copied this part from the base game. So this shouldn't suppose to give me any problems.
[ external image ]
Everything looks fine when I render this reflective part in the blender. But it doesn't show up in the game.
[ external image ]
Instead it gives me following error repeatedly.

Code: Select all

00:01:54.623 : <ERROR> [dx11] Unable to map attribute (v.factor)
00:01:54.624 : <ERROR> [dx11] Failed to create vertex input layout!
As far as I know, these errors are related to UV map layers. But I checked & they look OK to me as you can see in the first image.
User avatar
xXCARL1992Xx
Posts: 16524
Joined: 17 Aug 2016 12:18
Contact:

Re: SCS Blender Tools

#3109 Post by xXCARL1992Xx » 11 Jun 2022 10:56

remove piko.alldir, blender doesnt support this shader
| !!!NO SUPPORT OR REQUESTS OF ANY SORT VIA PM!!! | Screenshot Thread | Steam Workshop | World of Trucks Profil |
[ external image ]
User avatar
xeviax
Posts: 572
Joined: 22 Jun 2018 17:33

Re: SCS Blender Tools

#3110 Post by xeviax » 11 Jun 2022 17:29

Thanks, carl1992. I almost forgot that blender did not support certain shaders yet. I fixed my issue.
Post Reply

Return to “General discussion”

Who is online

Users browsing this forum: No registered users and 4 guests