-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from FailSpy/viewmodel-clipping-experiment
Automatic shader tools for easy disabled clipping on viewmodels (ViewmodelSpace)
- Loading branch information
Showing
12 changed files
with
1,034 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
extends ShaderMaterial | ||
class_name ConvertedMaterial | ||
## See Material3DConversion. Any changes made to this will not stick if you go back to the regular models by unbaking! | ||
|
||
@export var original_material : String | ||
@export var original_material_cache : StandardMaterial3D | ||
|
||
func cache(mat : StandardMaterial3D): | ||
if Engine.is_editor_hint(): | ||
if (not mat.resource_path) or '.tscn' in mat.resource_path: | ||
print("WARNING: Material ",str(mat), " is not saved to disk. Storing in memory. Recommend un-baking, save to disk, then re-bake") | ||
original_material_cache = mat | ||
else: | ||
original_material = mat.resource_path | ||
|
||
func get_original_material() -> StandardMaterial3D: | ||
var mat = original_material_cache | ||
if not mat: | ||
mat = load(original_material) | ||
return mat |
Oops, something went wrong.