Merge branch 'master' of https://git.alanocull.com/triple-aaa-games/assets
This commit is contained in:
commit
15ad88204e
3
.gitignore
vendored
3
.gitignore
vendored
@ -15,3 +15,6 @@ exports/
|
|||||||
|
|
||||||
# Ignore Krita and Blender backups
|
# Ignore Krita and Blender backups
|
||||||
*.*~
|
*.*~
|
||||||
|
|
||||||
|
# Ignore development files
|
||||||
|
pipeline/blender_autocomplete/
|
||||||
|
8
.vscode/extensions.json
vendored
Normal file
8
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"jacqueslucke.blender-development",
|
||||||
|
"blenderfreetimeprojects.blender-python-code-templates",
|
||||||
|
"ms-python.vscode-pylance",
|
||||||
|
"ms-python.python"
|
||||||
|
]
|
||||||
|
}
|
19
.vscode/settings.json
vendored
Normal file
19
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"python.autoComplete.extraPaths": [
|
||||||
|
"pipeline/blender_autocomplete/3.6"
|
||||||
|
],
|
||||||
|
"python.linting.pylintArgs": [
|
||||||
|
"--init-hook",
|
||||||
|
"import sys; sys.path.append('pipeline/blender_autocomplete/3.6')"
|
||||||
|
],
|
||||||
|
"python.analysis.extraPaths": [
|
||||||
|
"pipeline/blender_autocomplete/3.6"
|
||||||
|
],
|
||||||
|
"blender.addon.moduleName": "BoneJuice",
|
||||||
|
"blender.addon.loadDirectory": "pipeline",
|
||||||
|
"blender.addon.reloadOnSave": true,
|
||||||
|
"blender.addon.sourceDirectory": "pipeline",
|
||||||
|
"python.analysis.diagnosticSeverityOverrides": {
|
||||||
|
"reportInvalidTypeForm": "none"
|
||||||
|
}
|
||||||
|
}
|
@ -63,5 +63,7 @@ If you need results from an automated process, see the `pipeline` directory. Eac
|
|||||||
|
|
||||||
For animations, please include the `pipeline/export_anims.py` script in your Blender file. This allows one-click exporting of FBX animations (may be fully automated with a script later).
|
For animations, please include the `pipeline/export_anims.py` script in your Blender file. This allows one-click exporting of FBX animations (may be fully automated with a script later).
|
||||||
|
|
||||||
|
See [automation docs](docs/automation.md)
|
||||||
|
|
||||||
## Questions
|
## Questions
|
||||||
If there are any questions or feedback on these guidelines and conventions, please poke Alan with a sharp, pointy stick.
|
If there are any questions or feedback on these guidelines and conventions, please poke Alan with a sharp, pointy stick.
|
||||||
|
BIN
animations/infantry/anims-alan.blend
(Stored with Git LFS)
BIN
animations/infantry/anims-alan.blend
(Stored with Git LFS)
Binary file not shown.
BIN
animations/insurrectionist/anims-tommy6.blend
(Stored with Git LFS)
BIN
animations/insurrectionist/anims-tommy6.blend
(Stored with Git LFS)
Binary file not shown.
15
docs/automation.md
Normal file
15
docs/automation.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# Automation
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
- Ensure you have Blender 3.6 installed (hopefully at the location: `C:\Program Files\Blender Foundation\Blender 3.6`)
|
||||||
|
- Run the script located at `pipeline/export_all_anims.cmd`
|
||||||
|
|
||||||
|
## Editing
|
||||||
|
- Ensure Python is installed on your machine
|
||||||
|
- Ensure you have Visual Studio Code installed
|
||||||
|
- Open this directory in VS Code and install the recommended plugins
|
||||||
|
- Open terminal, `cd` into `pipeline`, and run the following command: `$ git clone https://github.com/Korchy/blender_autocomplete.git`
|
||||||
|
- Your workspace is now set up!
|
||||||
|
|
||||||
|
## Resources
|
||||||
|
- [Blender as a Python Module](https://pypi.org/project/bpy/)
|
3
pipeline/export_all_anims.cmd
Normal file
3
pipeline/export_all_anims.cmd
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
set PATH=%PATH%;"C:\Program Files\Blender Foundation\Blender 3.6"
|
||||||
|
blender ..\animations\infantry\anims-alan.blend --background --python export_anims.py
|
||||||
|
blender ..\animations\insurrectionist\anims-alan.blend --background --python export_anims.py
|
@ -1,4 +1,58 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
from bpy.types import LayerCollection, Object, NlaTrack
|
||||||
|
|
||||||
|
# Enter object mode
|
||||||
|
bpy.ops.object.mode_set(mode='OBJECT')
|
||||||
|
|
||||||
|
# FIRST, toggle collections
|
||||||
|
collections_exportable = [
|
||||||
|
"insurrectionist", "infantry", "rigging", "geometry", "grapple", "baton", "helmet", "gun", "jetpack"
|
||||||
|
]
|
||||||
|
def toggle_collection(coll: LayerCollection):
|
||||||
|
# Iterate over all child LayerCollections
|
||||||
|
for child in coll.children.values():
|
||||||
|
c: LayerCollection = child
|
||||||
|
|
||||||
|
# Force include/exclude character-related collections so they're included/excluded from export
|
||||||
|
c.exclude = not (c.name in collections_exportable)
|
||||||
|
if c.name == "insurrectionist" or c.name == "infantry":
|
||||||
|
bpy.context.view_layer.active_layer_collection = c
|
||||||
|
toggle_collection(bpy.context.view_layer.layer_collection)
|
||||||
|
|
||||||
|
# Find rig to make it active, and select all objects
|
||||||
|
for objBase in bpy.context.scene.objects:
|
||||||
|
obj: Object = objBase
|
||||||
|
if obj.type == 'ARMATURE':
|
||||||
|
bpy.context.view_layer.objects.active = obj
|
||||||
|
if obj.visible_get():
|
||||||
|
obj.select_set(True)
|
||||||
|
|
||||||
|
|
||||||
|
# EXTREMELY UGLY HACK TO EXIT TWEAK MODE
|
||||||
|
# see: https://blender.stackexchange.com/questions/316547/how-to-override-context-area-using-script-when-running-blender-using-command-lin
|
||||||
|
# and https://blender.stackexchange.com/questions/6101/poll-failed-context-incorrect-example-bpy-ops-view3d-background-image-add
|
||||||
|
def get_view_nla(): # Get any window
|
||||||
|
for window_manager in bpy.data.window_managers:
|
||||||
|
for window in window_manager.windows:
|
||||||
|
for area in window.screen.areas:
|
||||||
|
area.type = 'NLA_EDITOR'
|
||||||
|
for region in area.regions:
|
||||||
|
if region.type == 'WINDOW':
|
||||||
|
return dict(window=window, workspace=window.workspace, screen=window.screen, area=area, region=region)
|
||||||
|
raise Exception('NLA context not found.')
|
||||||
|
|
||||||
|
# Forcibly override context to a window so we can access NLA editor
|
||||||
|
with bpy.context.temp_override(**get_view_nla()):
|
||||||
|
if bpy.context.scene.is_nla_tweakmode:
|
||||||
|
bpy.ops.nla.tweakmode_exit() # Exit tweakmode
|
||||||
|
|
||||||
|
|
||||||
|
# Go through all NLA tracks, unstar them and mute them
|
||||||
|
bpy.context.active_object.animation_data.nla_tracks.active = None # Make track inactive
|
||||||
|
for trackBase in bpy.context.active_object.animation_data.nla_tracks:
|
||||||
|
track: NlaTrack = trackBase
|
||||||
|
track.mute = True # Mute all tracks
|
||||||
|
track.is_solo = False # Disable solo view for all tracks
|
||||||
|
|
||||||
# Get export directory
|
# Get export directory
|
||||||
path: str = bpy.data.filepath.replace('\\Shelby', '').replace('\\Tommy', '')
|
path: str = bpy.data.filepath.replace('\\Shelby', '').replace('\\Tommy', '')
|
||||||
@ -74,22 +128,4 @@ bpy.ops.pose.transforms_clear() # Clear all transforms
|
|||||||
bpy.ops.object.mode_set(mode='OBJECT')
|
bpy.ops.object.mode_set(mode='OBJECT')
|
||||||
|
|
||||||
## FOR DEBUGGING, see https://blender.stackexchange.com/questions/93728/blender-script-run-print-to-console
|
## FOR DEBUGGING, see https://blender.stackexchange.com/questions/93728/blender-script-run-print-to-console
|
||||||
# from bpy import context
|
# exit()
|
||||||
# import builtins as __builtin__
|
|
||||||
# def console_print(*args, **kwargs):
|
|
||||||
# for a in context.screen.areas:
|
|
||||||
# if a.type == 'CONSOLE':
|
|
||||||
# c = {}
|
|
||||||
# c['area'] = a
|
|
||||||
# c['space_data'] = a.spaces.active
|
|
||||||
# c['region'] = a.regions[-1]
|
|
||||||
# c['window'] = context.window
|
|
||||||
# c['screen'] = context.screen
|
|
||||||
# s = " ".join([str(arg) for arg in args])
|
|
||||||
# for line in s.split("\n"):
|
|
||||||
# bpy.ops.console.scrollback_append(c, text=line)
|
|
||||||
|
|
||||||
# def print(*args, **kwargs):
|
|
||||||
# """Console print() function."""
|
|
||||||
# console_print(*args, **kwargs) # to py consoles
|
|
||||||
# __builtin__.print(*args, **kwargs) # to system console
|
|
||||||
|
BIN
promotional/itch/background.jpg
(Stored with Git LFS)
Normal file
BIN
promotional/itch/background.jpg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
promotional/itch/cover1.png
(Stored with Git LFS)
Normal file
BIN
promotional/itch/cover1.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
promotional/itch/cover1_bright.png
(Stored with Git LFS)
Normal file
BIN
promotional/itch/cover1_bright.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
promotional/itch/screenshot1.png
(Stored with Git LFS)
Normal file
BIN
promotional/itch/screenshot1.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
promotional/itch/screenshot2.png
(Stored with Git LFS)
Normal file
BIN
promotional/itch/screenshot2.png
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user