Announcement

Collapse
No announcement yet.

Batch Create Shape from Section script?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Batch Create Shape from Section script?

    I have about 400 section objects in Max that I need to Create Shape from. Max will only let you do one at a time. Anyone know of a script that will let you do this all at once? It will save me a lot of time...
    "Why can't I build a dirigible with my mind?"

  • #2
    Can you show me how to recreate what you need albeit less scope, and I'll see what I can do quickly.
    Colin Senner

    Comment


    • #3
      Cant you attach all the section objects together, create a shape containing all of the sections in one and then break that into seperate splines?
      edit: I may have oversimplified your question, i'm not sure if i'm with you anymore now.

      Comment


      • #4
        Well, very simply: I have a long, irregular, complex curvilinear mesh volume. I need to get spline section profiles at certain intervals along this volume.

        In my case, I need 400 sections, and I have created 400 section objects. I can select any one section object, and then click Create Shape. However, I can only do one at a time.

        I have encountered this issue several time before, but never found a script for it. My maxscript skills are practically non-existent, and I could do all 400 one at a time before I could figure out how to script it.
        "Why can't I build a dirigible with my mind?"

        Comment


        • #5
          I would be more than happy to write something quick, however I still don't understand what it is, 400 section objects? Are they splines? I'm lost...Can you recreate a simple scene so I can test it on.
          Colin Senner

          Comment


          • #6
            Okay, thanks. I can mock something up and send you an email later...
            "Why can't I build a dirigible with my mind?"

            Comment


            • #7
              Sure thing.
              Colin Senner

              Comment


              • #8
                It's in your email Clifton, for anyone else who needs it create shapes from tons of section objects here's the code

                Code:
                -- SectionBatchCreateShape v1.0 
                -- By Colin Senner  03-27-2008
                rollout rlt_SectionBatchCreateShape "Sections" (
                	button btn_create "Create Shapes" offset:[0,4]
                	
                	on btn_create pressed do (
                		local objs = getCurrentSelection()	-- Saves the current selection of objects in an array variable "objs"
                		-- Different from using $ because $ updates dynamically, and we just want what the user had selected when running the script
                		
                		if objs.count != 0 then (
                			undo "Create Spline/Section" on (
                				for o in objs where (classof o) == Section do				
                					try ( convertToSplineShape o ) catch ( format "Error Creating shape %\n" + o.name )
                			)
                			redrawViews()
                		) else
                			messageBox "Please select at least one object"	
                	)
                )
                createDialog rlt_SectionBatchCreateShape 110 40
                Colin Senner

                Comment


                • #9
                  Wow cool script, so simple.

                  Another approach,

                  There is a Slicer script on Scriptspot.com that moves the slice plane in editable poly incrementally and creates slices. After you use the slice plane, the new slice edges are selected at the subobject level and you can Create Shape from there. I use this method sometimes to cut floor plates from a building mass.
                  Last edited by jonahhawk; 27-03-2008, 08:51 AM.

                  Comment


                  • #10
                    Awesome! Thanks a lot. I will be giving that a try tomorrow.

                    @jonahhawk: You can do that in editable poly, but it involves an extra couple steps, i.e. slicing, then selecting, then creating spline from selection. I like the section object because you can create multiple section objects, and their output is already a spline.

                    Cheers,

                    Aaron
                    Last edited by Clifton Santiago; 27-03-2008, 09:15 AM.
                    "Why can't I build a dirigible with my mind?"

                    Comment


                    • #11
                      You can easily have section objects created with maxscript and then sliced if you like (similar to the slicer tool by blur scripts).

                      Check the maxscript help file under "Section - Superclass shape" for an illustration of it on a sphere object.

                      -Colin
                      Colin Senner

                      Comment


                      • #12
                        You can just select all the sections and then right click and collapse to editable spline. Only problem with this, however, is that the verts on all the splines need to be welded.
                        -----Dwayne D. Ellis-----

                        Comment

                        Working...
                        X