Jump to content

Fighting with "object_" names


esDotDev

Recommended Posts

We're trying to port our animations over to Unity, and I think we're running into some bugs as a result of old version of Spriter.

 

The problem is only present in some of our very earliest animations. Under the Z-Index column, all the pieces are named "object_00x" to "object_2xx", and each animation has unqiue names. So, our main character has over 200 of these objects defined in his SCML file. For example:

814e6100d7e3b5aded958eb17b9120e9.png  39187afc64cd0ae0c049525e5df72763.png  908d3195848b5a5ac5673f072a236cec.png  

etc...

 

This breaks the Sprite2Unity importer and Sprite Swapping functionality, as it creates a new child for every single unique name in the z-index column.

 

If I try and rename the animations, and make them look like this:

9ed8dd31fc1512c23de9048364feda3d.png

 

Spriter won't allow me to do it. I can fix one animation, but when fixing subsequent anims, Sprite auto renames "head" to "head_000", or "torso" to "torso_000". Next animation, will force me to name it "Head_002", and etc. It simply won't allow me to fix these names within the Editor.

 

Is there any way you can think of to fix these old SCML files? I can't hand edit it, it's close to 11,000 lines... 

Link to comment
Share on other sites

hi @esDotDev,
There is a feature to help with this type of thing. It's undocumented, and thus hasn't been tested as much as the more well known features, so please make sure the first step you take is to begin with a backup scml or scon file.
 

  • Make sure you're using a backup, and not the original file.
  • If you have set any options in File|Other File Actions...|Custom Save Options aside from the 'prettify' options, unset them temporarily.
  • Switch to the Object Pane in the Palette Window. The object pane shows a list of all objects in the entity along with every image it uses if it's a sprite. The problem now is that rather than every animation using it's own instance of a single object, each animation has it's own named object.
    switchtoobjectpane.PNG
  • Make sure 'Show Objects Already in Current Frame' is selected, and select every object you want to combine into one object.
    Then right click on the object with the name you'd like to keep, and choose 'Combine Selected Objects With'.  
    This will leave behind empty sprites for the objects that got combined, but when you save and reload your project they will be gone.
    combine.PNG

     

Please let me know if you have any trouble.

Link to comment
Share on other sites

Woah, didn't expect there to really be a workaround for this, sweet!

 

Doesn't seem to be working properly though, when I combine sprites, they dissapear from the animation. Re-opening the file doesn't seem to help. 

 

Looking at the SCML, shows the following:

832bb1bfe2b55cf7c9f40c1f4689d150.png

 

[uPDATE] It seems that simply renaming all the objects, in the Objects Pane works fine. If I just go through every single object_xxx and replace with the proper name, close and restart, it works like a charm.

Link to comment
Share on other sites

Sorry I missed your reply, initially.  Glad you got it working, though.

 

You probably already know this by now, but just to make sure or for anyone else who might stumble on this thread.  To reuse objects on new animations, you can either:

  • Start a new animation by cloning a previous animation
  • Copying the object from another existing animation (or copying an entire frame with Control - Shift - C)
  • Dragging out objects you want to reuse from the object pane (Dragging images from File Palette creates a new object)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...