Jump to content
Sign in to follow this  
diddykonga

Ref Parent Number References?

Recommended Posts

So i just recently got some of the Art Packs, and Spriter Pro, when i exported the SCON of the BasicPlatformerPack's Platformer character, i noticed that inside the Mainline Key's there Ref's all have parent ID's that reference an Object in the Object Info data. So i have two questions.

 

  1. Why dont Ref's store the Parent as a Timeline ID like the Timeline is stored inside the Ref?
  2. I noticed if you set the custom save option to export out Sprites in the Object Info data, then the Parent ID inside the Ref's no longer points to the correct Object Info ID, but instead would usually point you to another Sprite instead of a Bone, is this intended?

Share this post


Link to post
Share on other sites

1. The idea was that you build the hierarchy from the bonerefs into a flat resizeable array, and then you refer to the information in this array by index.  
For instance:

<bone_ref id="0" timeline="15" key="2"/>
<bone_ref id="1" parent="0" timeline="16" key="2"/>
<object_ref id="0" parent="0" timeline="2" key="2" z_index="0"/>
<object_ref id="1" parent="1" timeline="3" key="2" z_index="1"/>

You would proceed in order, and push the results of the first tweening operation (boneref id=0) into the first index index of the array.  Let's call it transformedArray.
Since there is no parent, you would transform it using the transform information of the entire game object (the character's x,y,angle, etc in the game world) as it's parent.
Then when you calculate the second boneref (id=1), the parent is 0, so you would transform the result of it's tweening using the information from transformedArray[0].  And you would store the transformed result in the next index - and so on.   

2.  As above, the parent should always refer to the index within your 'transformedArray'

Please let me know if this answers your question.

Share this post


Link to post
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.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...