Skip to content

Commit

Permalink
Vertex groups handling
Browse files Browse the repository at this point in the history
Get individual vertices coordinates from vertex groups by using rasterized mesh from .to_mesh method.
  • Loading branch information
DreliasJackCarter committed Aug 15, 2021
1 parent 087a279 commit 4d59536
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
10 changes: 7 additions & 3 deletions PSXify.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 05/2021
# 08/2021
# PSXify script by Lucas Fierfort
# V1.1
# V1.2
# IMPORTANT : Please make sure to make a backup of your file before launching this script, just in case.

import bpy
Expand Down Expand Up @@ -75,6 +75,7 @@ def CreateWholeFakeScene(collectionSourceName, collectionDestName, scene):
PSXifiedObject.scale = (1.0, 1.0, 1.0)
PSXifiedObject.parent = None
PSXifiedObject.constraints.clear()
PSXifiedObject.vertex_groups.clear()
PSXcollection.objects.link(PSXifiedObject)

print("")
Expand Down Expand Up @@ -126,7 +127,10 @@ def PSXifyCollection(camera, collection, scene):
targetObject = scene.objects[object.name+'.PSXified']

# Object data
mesh = object.data
dg = bpy.context.evaluated_depsgraph_get()
eval_obj = object.evaluated_get(dg)
mesh = eval_obj.to_mesh()

targetMesh = targetObject.data
matrix = object.matrix_world
rotationQuat = object.rotation_euler.to_quaternion()
Expand Down
Binary file added Previews/CombineOrdinal.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ Give a PS1 appearance for your Blender 2.8+ renders !
This script is greatly inspired by Komojo's work from the following thread :
https://blenderartists.org/t/playstation-1-jittery-texture-effect-not-for-a-game/1167818

current version : V1.1
current version : V1.2

V1.2 Manages vertex groups.
V1.1 Handles lights according to Komojo's logic. see 'Lighting' part of Readme for more info.

## Presentation
![Combine Ordinal](https://github.com/DreliasJackCarter/PSXifyBlender2.8/blob/main/Previews/CombineOrdinal.gif)
#### Jittery models
This Python script rounds all vertex coordinates as seen from camera and creates a whole duplicata of the scene with those new coordinates taken into account.
#### Affine textures
Expand Down Expand Up @@ -74,8 +76,9 @@ I noticed some issues that I'm trying to fix :
* Objects must be Modifier free. Mirror, Array and such interfere with number of vertex.
* Ensure to backup your Blender file to prevent any damage.
* Eevee rendering is fast but randomly crashes. Cycles seems more stable but renders a bit slower.
~~* Light sources are not handled yet.~~
* Background textures and skyboxes are not handled.
* Soft armatures are not handled properly (see sword trail). It may be due to persistent vertex groups.
~~* Soft armatures are not handled properly (see sword trail). It may be due to persistent vertex groups.~~
* This script is made for rendering. Script execution is inappropriate for real time 3D.

## Feedback
Expand Down

0 comments on commit 4d59536

Please sign in to comment.