Skip to content

Commit

Permalink
fixed gitignore, added a script to list all items in 1.16 i gotta do
Browse files Browse the repository at this point in the history
  • Loading branch information
torshepherd committed Feb 19, 2021
1 parent 7987c50 commit 61285a1
Show file tree
Hide file tree
Showing 658 changed files with 3,621 additions and 3,075 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
src/resourcepack/assets/minecraft/item/inspect/*
**/inspect/
**/unused/
Binary file modified src/__pycache__/animation.cpython-38.pyc
Binary file not shown.
21 changes: 16 additions & 5 deletions src/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def printv(text, verbosity_needed=VERBOSITY_EXPLAIN, verbosity=VERBOSITY_EXPLAIN
if verbosity >= verbosity_needed:
print(text)

# Creating animations -------------------------------------------------------

def cubic_function_gen(start_point, end_point, frames: int):
# cubic(t) => c1(t)**3 + c2(t)**2 + c3t + c4
Expand Down Expand Up @@ -150,7 +151,7 @@ def create_animation_from_timeline(animation_name, model_parent='handheld', verb
raise Exception('Perlin paths cannot include the key \'end_frame\'.')
offset += section['frames']

# Creating new filetree for new model
# Creating new filetree for new model -------------------------------------------------------


def write_model_file(name, num_frames, model_parent='handheld', textured=True, verbosity=VERBOSITY_EXPLAIN):
Expand Down Expand Up @@ -207,7 +208,17 @@ def write_model(name, model_parent='handheld', textured=True, animation_name='sw
else:
raise Exception('Number of frames must be greater than zero.')

# Open input frame json file
# Open output frame json file
# Generate cubic function mapping between them
# Iterate over frames, generating each frame json file

# Creating key json of all items in version -------------------------------------------------------
def get_overview_of_models(path_to_dir):
total_data = {}
for model in os.listdir(path_to_dir):
with open(os.path.join(path_to_dir, model)) as model_file:
data = json.load(model_file)
if 'parent' in data.keys():
if data['parent'] not in total_data.keys():
total_data[data['parent']] = []
total_data[data['parent']].append(os.path.splitext(model)[0])

with open(os.path.join(PATH_TO_SRC, 'parents.json'), 'w+') as overview_file:
json.dump(total_data, overview_file, indent=2)
62 changes: 43 additions & 19 deletions src/inspect_sword_animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,48 @@
from perlin_noise import PerlinNoise

animation_name = 'sword_1'
create_animation_from_timeline('sword_1', model_parent='handheld')
create_animation_from_timeline('sword_2', model_parent='handheld')

for item in ['wooden_sword', 'stone_sword', 'iron_sword', 'golden_sword', 'diamond_sword', 'netherite_sword']:
write_model(item, animation_name='sword_2')


for item in ['wooden_pickaxe', 'stone_pickaxe', 'iron_pickaxe', 'golden_pickaxe', 'diamond_pickaxe', 'netherite_pickaxe']:
write_model(item, animation_name='sword_2')


for item in ['wooden_axe', 'stone_axe', 'iron_axe', 'golden_axe', 'diamond_axe', 'netherite_axe']:
write_model(item, animation_name='sword_2')


for item in ['wooden_shovel', 'stone_shovel', 'iron_shovel', 'golden_shovel', 'diamond_shovel', 'netherite_shovel']:
# create_animation_from_timeline('sword_1', model_parent='handheld')
# create_animation_from_timeline('sword_2', model_parent='handheld')
# create_animation_from_timeline('item_1', model_parent='generated')

get_overview_of_models(os.path.join(PATH_TO_MODELS, 'item/unused/items_1_16_3'))

for item in ['wooden_sword',
'stone_sword',
'iron_sword',
'golden_sword',
'diamond_sword',
'netherite_sword',
'wooden_pickaxe',
'stone_pickaxe',
'iron_pickaxe',
'golden_pickaxe',
'diamond_pickaxe',
'netherite_pickaxe',
'wooden_axe',
'stone_axe',
'iron_axe',
'golden_axe',
'diamond_axe',
'netherite_axe',
'wooden_shovel',
'stone_shovel',
'iron_shovel',
'golden_shovel',
'diamond_shovel',
'netherite_shovel',
'wooden_hoe',
'stone_hoe',
'iron_hoe',
'golden_hoe',
'diamond_hoe',
'netherite_hoe']:
write_model(item, animation_name='sword_2')


for item in ['wooden_hoe', 'stone_hoe', 'iron_hoe', 'golden_hoe', 'diamond_hoe', 'netherite_hoe']:
write_model(item, animation_name='sword_2')
for item in ['acacia_boat',
'stone_hoe',
'iron_hoe',
'golden_hoe',
'diamond_hoe',
'netherite_hoe']:
write_model(item, animation_name='item_1')
Loading

0 comments on commit 61285a1

Please sign in to comment.