• All, Gmail is currently rejecting messages from my host. I have a ticket in process, but it may take some time to resolve. Until further notice, do NOT use Gmail for your accounts. You will be unable to receive confirmations and two factor messages to login.
Chronocrash Modders Tools

ChronoCrash Modders Tools 0.6.30

No permission to download
Piccolo, You thought about writing auto bbox function? So it would check for first non transparency pixels on the current image and will create upper left and bottom right corners for bbox coords ?
Usually bottom right last pixel represents transparency color, so after acquiring this it could look for pixels from upper left corner and bottom right corner that are not transparency to create bbox automatically.
I think having this as a button would be really really nice.

-----------

Ok i created it , please do borrow the code so it works in chronotools
You can test it out by saving this into bat file.

Code:
0<0# : ^
'''
@echo off
set script=%~f0
python -x "%script%" %*
exit /b 0
'''
import tkinter as tk
from tkinter import filedialog
from PIL import Image, ImageTk, ImageDraw
def get_transparency_color(image_path):
    image = Image.open(image_path)
    transparency_color = image.getpixel((image.width - 1, image.height - 1))
    return transparency_color
def find_non_transparent_bbox(image_path, transparency_color):
    image = Image.open(image_path)
    image_data = image.load()
    width, height = image.size
    left, top, right, bottom = width, height, 0, 0
    for y in range(height):
        for x in range(width):
            if image_data[x, y] != transparency_color:
                left = min(left, x)
                top = min(top, y)
                right = max(right, x)
                bottom = max(bottom, y)
    if left == width and top == height and right == 0 and bottom == 0:
        return None
    return left, top, right, bottom
def convert_bbox_to_bbox_format(bbox):
    left, top, right, bottom = bbox
    width = right - left + 1
    height = bottom - top + 1
    return left, top, width, height
def draw_bbox(image, bbox):
    image_draw = ImageDraw.Draw(image)
    left, top, right, bottom = bbox
    image_draw.rectangle([left, top, right, bottom], outline=(0, 0, 255), width=2, fill=None)
    return image
def upload_image():
    file_path = filedialog.askopenfilename()
    if file_path:
        transparency_color = get_transparency_color(file_path)
        image = Image.open(file_path)
        if image.mode != "RGBA":
            image = image.convert("RGBA")
        bbox = find_non_transparent_bbox(file_path, transparency_color)
        if bbox:
            bbox_format = convert_bbox_to_bbox_format(bbox)
            bbox_command = f"bbox {bbox_format[0]} {bbox_format[1]} {bbox_format[2]} {bbox_format[3]}"
            bbox_entry.delete(0, tk.END)
            bbox_entry.insert(0, bbox_command)
            max_size = (400, 400)
            image.thumbnail(max_size, Image.NEAREST)
            image_with_bbox = draw_bbox(image.copy(), bbox)
            photo = ImageTk.PhotoImage(image_with_bbox)
            canvas.image = photo
            canvas.create_image(0, 0, anchor=tk.NW, image=photo)
        else:
            bbox_entry.delete(0, tk.END) 
            bbox_entry.insert(0, "No non-transparent pixels found.")
root = tk.Tk()
root.title("BBOX Creator")
upload_button = tk.Button(root, text="Upload Image", command=upload_image)
upload_button.pack()
bbox_entry = tk.Entry(root, width=50)
bbox_entry.pack()
canvas = tk.Canvas(root, width=400, height=400)
canvas.pack()
root.mainloop()
I'll look into it later, should be easy enough to plugin ;)

Though I don't really see the appeal of this feature on an animation basis. I think it's almost as fast to draw the box, and more precise.

For a whole entity it's another story, as with this you can apply this process on all animations with a single click.
 
No, I wouldn’t use it for most things, but it would save a lot of time on lots of ancillary stuff. That bird for instance. It's probably just some some flying enemy that works perfectly well with a body box over its whole wing area.

It would be great for projectiles, platforms, boxes, really anything that you don't have to be super precise and has a uniform shape.
That was exactly what happend with Fighter Factory and Mugen. Started like this, and people ended blaming the engine/tool.
That is my fear.

And, using that bird image as example, it doesn't needs anything more than this as its bbox. No need to have that huge open space over his head.
1718720515529.png

There's probably something else that triggers this, I can't reproduce this. And from the previous reports, others didn't have this issue either. So it must happens in more specific situations than just setting z values to 0.
I can't reproduce it either
 
  • Like
Reactions: NED
For a whole entity it's another story, as with this you can apply this process on all animations with a single click.
Looks a good idea to save some time for uniform entities like projectiles and platforms.

Another question, is it possible to add some keyboard shortcuts for most common functions like the set visual prop and onion skin?

1718733596397.png

EDIT: Another idea to speed up the collision box creation is by holding the right mouse button and rolling the scroll to change between frames, this way we can draw bboxes with less clicks. I saw that the right mouse click does nothing if it's in the sprite area, so it will not break any other function.
And by holding the right mouse button we can avoid using zoom too.
 
Last edited:
I'll look into it later, should be easy enough to plugin ;)

Though I don't really see the appeal of this feature on an animation basis. I think it's almost as fast to draw the box, and more precise.

For a whole entity it's another story, as with this you can apply this process on all animations with a single click.
IT could be useful as platform creation code if expanded , cause platforms usually do need to be the size of the actual image content most of the time
 
Id add ctrl + mousebutton or alt +mouse button , one to add bbox and one to add attackbox
Good, it's easier than letters to use ctrl or alt. In this case I also suggest holding shift+mouse scroll to change frames without clicking on them.
 
I was changing a new animation name by clicking the green plus but labeled it with # as a comment as a name. I named it like this: follow74 #Safe fall 2 and pressed enter to have a new name. I was in animation tab, but didn't bother going to the text tab. I thought I would not receive an error message after I changed it and removed comments from animation names, but I did get it.

Code:
Traceback (most recent call last):
  File "gui\entity\__init__.py", line 856, in notifyChange
  File "gui\entity\__init__.py", line 1106, in processLines
KeyError: None

I don't remember how I got this. Maybe I erased the comment label from the animation name. The comment next to the animation name wasn't in the label part. It was in the same room as the animation ID section. (Solved: Had it until I figured out that I'd need to view text tab and back to animation tab.)

Code:
Traceback (most recent call last):
  File "\\VBoxSvr\Partage\CMT\cmt.py", line 254, in autoSave
  File "gui\main\__init__.py", line 103, in backupUnsaved
  File "gui\main\__init__.py", line 417, in updateFD
  File "gui\entity\__init__.py", line 626, in getFullLines
  File "gui\entity\__init__.py", line 1106, in processLines
KeyError: None

P.S.: After receiving these errors, I tried naming another animation name with its new comment label. This time, I had to click on the text tab, and go back to the animation tab. So far, I didn't get a similar message as the previous ones.

You can check it. I may be wrong.

P.S. 2: I got another error this time from viewing one animation.

Code:
Traceback (most recent call last):
  File "gui\entity\animselector.py", line 326, in loadAnim
  File "gui\entity\__init__.py", line 664, in loadAnim
  File "gui\entity\__init__.py", line 1711, in rebuildText
  File "data\__init__.py", line 560, in getCompactText
  File "data\__init__.py", line 446, in getText
IndexError: list index out of range
 
Code:
anim    attack9 #Close HK
    offset    17 97
    delay    7
    bbox 11 2 33 96
    sound data/sounds/common/kick2.wav
    hitfx data/sounds/common/beat6.wav
    @cmd    keyint2 "ANI_freespecial32" 0 "F" 0
    @cmd    keyint2 "ANI_freespecial33" 0 "B" 0
    @cmd    makeOpponentBlock
    frame    data/chars/ryu/247.gif
    offset    6 100
    bbox 5 2 33 96
    frame    data/chars/ryu/248.gif
    attack11 33 3 50 76 8 0 0 0 0 0 # attack# x y right down dmg pwr blk noflash pausetime z
    bbox 21 27 33 103
    @cmd    makeOpponentBlock
    offset    17 129
    #delay 12
    frame    data/chars/ryu/249.gif
    attack11 0 0 0 0 0 0 0 0 0 0
    delay 12
    offset    15 125
    frame    data/chars/ryu/250.gif
    delay 7
    attack6 42 5 59 50 10 0 0 0 0 0
    bbox 17 2 33 103
    @cmd    makeOpponentBlock
    range    0 90
    offset    7 103
    frame    data/chars/ryu/251.gif
    attack6 0 0 0 0 0 0 0 0 0 0
    bbox 11 2 39 103
    offset    8 98
    frame    data/chars/ryu/252.gif
    offset    10 99
    @cmd    makeOpponentUnblock
    frame    data/chars/ryu/253.gif
    offset    16 101
    bbox 5 2 39 103
    frame    data/chars/ryu/254.gif

I tried to open a new character and other things, but it still pops up every time I click on anything like text tab, animation tab, animation names, etc. I have to close it and reopen it.
 
Code:
anim    attack9 #Close HK
    offset    17 97
    delay    7
    bbox 11 2 33 96
    sound data/sounds/common/kick2.wav
    hitfx data/sounds/common/beat6.wav
    @cmd    keyint2 "ANI_freespecial32" 0 "F" 0
    @cmd    keyint2 "ANI_freespecial33" 0 "B" 0
    @cmd    makeOpponentBlock
    frame    data/chars/ryu/247.gif
    offset    6 100
    bbox 5 2 33 96
    frame    data/chars/ryu/248.gif
    attack11 33 3 50 76 8 0 0 0 0 0 # attack# x y right down dmg pwr blk noflash pausetime z
    bbox 21 27 33 103
    @cmd    makeOpponentBlock
    offset    17 129
    #delay 12
    frame    data/chars/ryu/249.gif
    attack11 0 0 0 0 0 0 0 0 0 0
    delay 12
    offset    15 125
    frame    data/chars/ryu/250.gif
    delay 7
    attack6 42 5 59 50 10 0 0 0 0 0
    bbox 17 2 33 103
    @cmd    makeOpponentBlock
    range    0 90
    offset    7 103
    frame    data/chars/ryu/251.gif
    attack6 0 0 0 0 0 0 0 0 0 0
    bbox 11 2 39 103
    offset    8 98
    frame    data/chars/ryu/252.gif
    offset    10 99
    @cmd    makeOpponentUnblock
    frame    data/chars/ryu/253.gif
    offset    16 101
    bbox 5 2 39 103
    frame    data/chars/ryu/254.gif

I tried to open a new character and other things, but it still pops up every time I click on anything like text tab, animation tab, animation names, etc. I have to close it and reopen it.
Ok this one is caused by the comment at the right of attack

attack11 33 3 50 76 8 0 0 0 0 0 # attack# x y right down dmg pwr blk noflash pausetime z
I'll fix this in next release, in the mean time, just move the comment on a separate line
 
EDIT: Another idea to speed up the collision box creation is by holding the right mouse button and rolling the scroll to change between frames, this way we can draw bboxes with less clicks. I saw that the right mouse click does nothing if it's in the sprite area, so it will not break any other function.
And by holding the right mouse button we can avoid using zoom too.
Those are great ideas. Just to be clear about the quoted part, you mean two separate things right ?

1 / draw the box with right button held
2 / use mouse wheel to change frames ("rolling the scroll to change between frames")

I'm not sure I understood what you meant, especially the 2/
 
Another question, is it possible to add some keyboard shortcuts for most common functions like the set visual prop and onion skin?
I was implementing this and realized "A" and "B" already work, respectively, for setting attack box, and body box.
 
I was implementing this and realized "A" and "B" already work, respectively, for setting attack box, and body box.
lol it's true, sorry to not test it before suggesting.

1 / draw the box with right button held
Not exactly, it's like the A/B keys already works, you press the button without holding and then draw the boxes. As an additional option the ctrl / alt keys would be a good idea too.

2 / use mouse wheel to change frames ("rolling the scroll to change between frames")
Basically the idea is to hold a certain button and then use the mouse wheel to change frames, scroll up to advance and down to back in the same way the keyboard arrow does. Usually I use arrows for most tasks but optionally we could have the mouse wheel to speed up drawing collision boxes.
For this one I think we can discard holding the right mouse button and consider holding shift key in conjunction with the mouse wheel, this way it will not conflict with the zoom function.
 
Piccolo updated Chronocrash Modders Tools with a new update entry:

Changelog 0.6.22

Animation editor :

- When Ctrl key is pressed, drawing a rectangle with mouse will directly draw an attack box
- When Shift key is pressed, drawing a rectangle with mouse will directly draw a body box
- When drawing a rectangle with right mouse button, it will draw a box with the previously used type (between attack, body and range)

- When using mouse wheel while Ctrl key is held, it will change frames instead of zoom/unzoom

Local shortcut (work only when widget has focus) :
- O : will...

Read the rest of this update entry...
 
Everything works nice, its superfast to make hitboxes and bboxes, i just wish there was undo or a shortcut to remove bbox or hitbox when i mess up.
Also tkinter error when i press E :
Code:
Traceback (most recent call last):
  File "gui\entity\__init__.py", line 2075, in extractBBox
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "gui\entity\bwwd_lib.py", line 1, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "PIL\ImageTk.py", line 29, in <module>
ModuleNotFoundError: No module named 'tkinter'
 
Piccolo updated Chronocrash Modders Tools with a new update entry:

Changelog 0.6.23

- Fixed dependency bug for "E" key in animation editor

- Added first version of undo/redo buttons in animation editor. WARNING : I wouldn't rely on this at this stage, it's an early draft that I plugged in very fast. From my testings, it should work alright if you want to go back to state "n-1" (single undo) or state "n+1" (single redo after undo). Going back and forth more than that seems to be unreliable at this stage.

@bWWd

Read the rest of this update entry...
 
If undo is problematic its not that important , e works nicely now but creating bboxes with rmb now is so nice, brilliant idea, so simple and so useful, so easy that its actually fun to do.
Maybe one more for platform creation? with some default depth like 50, maybe alt + left button will start creating patforms "front wall" the one that is facing us.

When we scroll frames with scrollwheel, can you force the small frame thumbnail to be highlighted like if we clicked on one when we scroll with scrollwheel ?
I know that frame number on top is updated but id make it so if we release the scrollwheel - it jumps to the frame like if we clicked on it.
 
Last edited:
Code:
Traceback (most recent call last):
  File "gui\entity\__init__.py", line 856, in notifyChange
  File "gui\entity\__init__.py", line 1425, in processLines
AttributeError: 'Platform' object has no attribute 'xOffset'

Code:
Traceback (most recent call last):
  File "\\VBoxSvr\Partage\CMT\cmt.py", line 254, in autoSave
  File "gui\main\__init__.py", line 103, in backupUnsaved
  File "gui\main\__init__.py", line 417, in updateFD
  File "gui\entity\__init__.py", line 626, in getFullLines
  File "gui\entity\__init__.py", line 1425, in processLines
AttributeError: 'Platform' object has no attribute 'xOffset'

Code:
anim    pain #LP pain normal
@script
if(frame == 0){
    void self = getlocalvar("self");
    int index = getentityproperty(self, "playerindex");
    int dir = getentityproperty(self, "direction");
    int guard = getentityvar(self, "guard");
    int left = playerkeys(index, 0, "moveleft");
    int right = playerkeys(index, 0, "moveright");
    int down = playerkeys(index, 0, "movedown");
 
    if(guard == 1){
        if((dir == 1 && left) || (dir == 0 && right)){
            performattack(self, openborconstant("ANI_FOLLOW4"));
            updateframe(self, 1);
        }
        else if((dir == 1 && left && down) || (dir == 0 && right && down)){
            performattack(self, openborconstant("ANI_FOLLOW5"));
            updateframe(self, 1);
        }
    }
}
@end_script
    delay    4 #Pain from both close and far ranges of light punch
    offset    25 99
    bbox 8 1 32 101
    platform 4 99 0 0 46 46 1 55
    frame    data/chars/ryu/0500000000.gif # 0
    @cmd    velo001 -2 0 0
    delay    7
    platform 4 99 0 0 46 46 1 55
    frame    data/chars/ryu/0500000000.gif # 1
    offset    35 100
    delay    5
    platform 12 100 0 0 46 46 1 55
    frame    data/chars/ryu/0500000010.gif # 2
    offset    25 99
    @cmd    velo001 0 0 0
    platform 4 99 0 0 46 46 1 55
    frame    data/chars/ryu/0500000000.gif # 3
    #@cmd    aniframe "ani_follow40" 0
    @cmd beidle
    frame    data/chars/ryu/0500000000.gif # 4
    #Crouch pain activated via onpainscript and ondoattackscript
    offset 26 67
    bbox 8 1 32 69
    frame data/CHARS/Ryu/0502000000.gif #5
    offset 38 68
    frame data/CHARS/Ryu/0502000010.gif #6
    frame data/CHARS/Ryu/0502000010.gif #7
    frame data/CHARS/Ryu/0502000010.gif
    #offset 45 67
    #frame data/CHARS/Ryu/0502000020.gif
    #offset 57 67
    #frame data/CHARS/Ryu/0502000030.gif
    #@cmd    aniframe "ani_follow40" 16
    @cmd    keyint2 "ANI_DUCK" 2 "D" 0 #Stay ducking?
    @cmd    keyint2 "ANI_FOLLOW6" 0 "D" 1 #Get up?
    #frame data/CHARS/Ryu/0502000030.gif
    offset 26 67
    frame data/CHARS/Ryu/0502000000.gif #5

The funny thing is that other chars that have platforms do work well, but I think only Ryu's pain anim that has it doesn't.

EDIT: Another one.

Code:
Traceback (most recent call last):
  File "\\VBoxSvr\Partage\CMT\cmt.py", line 254, in autoSave
  File "gui\main\__init__.py", line 103, in backupUnsaved
  File "gui\main\__init__.py", line 417, in updateFD
  File "gui\entity\__init__.py", line 627, in getFullLines
  File "gui\entity\__init__.py", line 1807, in validateChanges
  File "gui\entity\__init__.py", line 1653, in rebuildText
  File "gui\entity\__init__.py", line 179, in __getitem__
IndexError: list index out of range

This is when I tried to input delay and before I started to add its value, I received this.
Code:
Traceback (most recent call last):
  File "\\VBoxSvr\Partage\CMT\cmt.py", line 254, in autoSave
  File "gui\main\__init__.py", line 103, in backupUnsaved
  File "gui\main\__init__.py", line 417, in updateFD
  File "gui\entity\__init__.py", line 627, in getFullLines
  File "gui\entity\__init__.py", line 1807, in validateChanges
  File "gui\entity\__init__.py", line 1654, in rebuildText
  File "data\__init__.py", line 60, in set
IndexError: list assignment index out of range
 
Last edited:
The first one make sense because it happens when multiple platforms are set. I fixed it in the code.

The other two I will need context and the text of animation too, because it doesn't simply happen when you write delay value in most of animations.
 
Back
Top Bottom