Jump to content

Multi-Mesher Object Generation


smvwhite
 Share

Recommended Posts

Same as post at CGTalk - real important that I can solve this problem.

 

I can see that people in arch viz professions could benefit from what I am trying to complete - unfortunately I am spinning my wheels on achieving the following, and would really value some assistance.

 

To automate tasks in converting architectural elements into Mesher objects via a rollout the following script needs to do the following.

 

1. ID a master building element - called MS (named before running script)

2. User selects "Highlight Source OBJ" button to read MS object data into rollout.

3. User clicks a spinnner to set 'Time Offset' of last mesher element, eg. 8th mesher-to-be object from selected objects.

 

 

User then selects a group of objects in the viewport to become mesher objects.

 

This I have done, now here is what I cannot achieve....

 

 

4. User clicks on "Convert to Mesher" button that works through an array of the objects and creates new mesher objects modelled on the source object MS. Each object has its 'Time Offset' assigned incrementally within the loop to a fraction of the spinner (8th object) divided by the $.count 'number of objects'.

 

5. Selected group of objects (non mesher) are then copied to a separate layer to remove these from the visible layer. (I have this scripted already).

 

rollout myRol "Mesher Tools" width:160 height:345

 

Code:

(

label lab1 "Set up Mesher Series" --Label at top of rollout

 

-- set up text areas to display MS obj details

edittext edit_text_item "Selected:" text:"" width:100 align:#center

 

label label_item "No Value" pos:[13,70]

spinner spinner_item "Time Offset" pos:[13, 110]

 

button myButton "Highlight Source OBJ" pos:[13,40] width:125 height:25

on myButton pressed do (

 

obj = getnodebyname "MS" -- select object with name "MS"

if obj != undefined then select obj

 

theValue = obj

 

edit_text_item.text = theValue as string -- display MS

label_item.text = theValue as string -- display MS

 

)

 

 

button myButton2 "Convert to Mesher" pos:[13,150] width:125 height:25

on myButton2 pressed do (

 

dataAr=#()

for i = 1 to dataAr.count do -- $.count returns number of selected objects

(

 

 

)

 

 

)

)

 

try (destroydialog myRol) catch()

createdialog myRol

------

 

 

 

I have clicked around the 'net for days to try to learn how to finish my task so any light that anyone can shine on this problem (please) would be really, really appreciated. smile.gifsmile.gif

Edited by smvwhite
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...