Jump to content

Sign in to follow this  
chadiabo

Need help in Python syntax

Recommended Posts

Hello

What is the easiest syntax in Python to make the following :

 

1-from a A selection of splines or polygons - ---> make a A list

2-from a B selection of objects ----> make a B list

3-copy or instance a random object from B selection to stick it to the center of the object from A list

 

I have a group of closed spline that forms a city scape and I want to extrude each spline randomly and attach an object from a B list to populate randomly the buildings 

 

I am trying the Mo Extrude approach to get different heights but I can't be able to attach other objects that stick to that surface in Mograph

 

Best

 

 

 

Share this post


Link to post

Can you share a scene file or reduced version? There might be easier ways to go about this

Share this post


Link to post
  • Topic Author
  • Here is a simple scene

    I am trying to stick some random objects to each building, I used some null objects to prevent repeating this on every building 

    Let me know if you have ideas

    small_city.c4d

    Share this post


    Link to post

    Axis of your object which you are cloning is offset, that is why there is an issue. You can simplify your scene, here is a quick try. Note that you can use correction deformer to create selections and then use that selection on connect object

    small_city_0001.c4d

    Share this post


    Link to post
  • Topic Author
  • Thanks buddy, but my issue was how to tell the scattered objects to stick to the different heights of the buildings after using Noise function in MoExtrude.

    Also I can't figure out how I can use polygon selections on Connect object but this is minimal for now

    Share this post


    Link to post

    Ah, I see. Is this what you are after?

     

    small_city_0003.c4d

     

    To create selection on connect simply subordinate correction deformer under it, make a selection on correction deformer and then copy the tag to connect

     

     

    Share this post


    Link to post
  • Topic Author
  • Great, really thank you, so your correction deformer was done then you took it off? Any how it works great

    Many thanks

     

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