Jump to content
Sign in to follow this  
Tompi

Distribute space between objects

Recommended Posts

Hi,

I'm trying to distribute space between objects evenly with xpresso as the number or the size of the objects can change.

I know what the programing theory is but as I'm quite new in xpresso (and don't know how to use python  for now) I would need some help.

The steps should be something like this:

- sum all the heights in a loop (I found a small python tag to convert my text into a polygonal one and use it with a bounding box tag but I'm unable to create that loop)

- rest that number from the total space I have

- divide this number b ytwice the number of objects I have to get the space I should let around my text

- Position my objects based on this

 

I hope there is enough information so someone can help me with this.

 

Thanks in advance

Screenshot 2020-06-25 12.24.35.png

Screenshot 2020-06-25 12.25.17.png

Share this post


Link to post

Looping is quite hard in XPresso - need to use python. In this file I calculated the gap and positioned each text word at 

 

previous position + previous height + gap

 

words align gap.c4d

 

time to read up on Python lists 😀

Share this post


Link to post
  • Topic Author
  • Author of the topic Posted

    I'll give it a deeper look but at first it looks like what I need.

    And, yeah, I'll definitely have to dive into python.

     

    Thanks a lot for your time.

    Share this post


    Link to post
  • Topic Author
  • Author of the topic Posted
    On 6/25/2020 at 2:44 PM, jed said:

    Looping is quite hard in XPresso - need to use python. In this file I calculated the gap and positioned each text word at 

     

    previous position + previous height + gap

     

    words align gap.c4d 422.64 kB · 1 download

     

    time to read up on Python lists 😀

    That was exactly it.

    With some tweak in your code I got it working with my scene.

    Thanks a lot again

    Share this post


    Link to post

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    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...

    FORUMS INFO:

    Dear members, we are aware of few more bugs that are still present withing the theme.We just wanted to let you know that we are working to fix them as soon as possible.
     

    NEW MEMBERS:

    Please be aware that we are manually approving all new registrations, due to spam prevention. Please be patient in case you cannot login right away, we will approve you within 12h or less if we decide you are not potential spammer. 

     

    Thanks for understanding! :cowboypistol: