Announcement

Collapse
No announcement yet.

Scripting - simple issues here :)

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

  • #16
    Code:
    addmodifier o UVWMap1
    addmodifier o UVWMap2
    classOf o --only do this 1 time, after adding the modifiers. this "initializes" the modifier, so that the gizmo position can be modified by maxscript
    UVWMap1.gizmo.position = [1,1,1]
    UVWMap2.gizmo.position = [.3,-.8,0.7]
    you should learn maxscript basics, for example the youtube tutorials by bobo are great. (already recommended in this thread)
    what you're doing now is trial & error, you wont get far by doing so
    Marc Lorenz
    ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___
    www.marclorenz.com
    www.facebook.com/marclorenzvisualization

    Comment


    • #17
      Ha thanks ! Will test it out in a sec.

      I'm doing this series http://vimeo.com/album/1514565/format:detail but he magically forgot to mention multiple modifiers etc etc
      CGI - Freelancer - Available for work

      www.dariuszmakowski.com - come and look

      Comment


      • #18
        this should do the trick:

        Code:
        (
        modifier_positions=#([1,1,1], [.3,-.8,0.7], [-0.86,2,-0.96])
        
        for o in selection where (isKindOf o GeometryClass) do
            (
        		for i=1 to modifier_positions.count do
        		(
        			this_mod = UVWMap name:("UVW_Map"+(i as string)) maptype:4 length:0.8 width:0.8 height:0.8 mapChannel:i
        			addmodifier o this_mod
        			classOf o
        			this_mod.gizmo.position = modifier_positions[i]
        		)
            )
        )
        Marc Lorenz
        ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___
        www.marclorenz.com
        www.facebook.com/marclorenzvisualization

        Comment


        • #19
          Code:
          for o in getCurrentSelection() where (isKindOf o GeometryClass) do -- Now we're doing a simple check to make sure we're applying it to just geometry in the selection     
          (         
                  UVWMap1 = UVWMap name:"UVW_Map1" maptype:4 length:0.8 width:0.8 height:0.8 mapChannel:1    -- Created 3 variables to store our modifiers         
                  UVWMap2 = UVWMap name:"UVW_Map2" maptype:4 length:0.8 width:0.8 height:0.8 mapChannel:2    -- So it's easier to refer back to them         
                  UVWMap3 = UVWMap name:"UVW_Map3" maptype:4 length:0.8 width:0.8 height:0.8 mapChannel:3          
          
                  -- Add the modifiers              
                  addmodifier o UVWMap1             
                  addmodifier o UVWMap2         
                  addmodifier o UVWMap3 
                 
                  -- Forgot this initially         
                  classof o
          
                  UVWMap1.gizmo.position = [1,1,1]
                  UVWMap2.gizmo.position = [.3,-.8,0.7]
                  UVWMap3.gizmo.position = [-0.86,2,-0.96]
          )
          Marc's is correct as well, but I'll trade the readability anyday for saving a couple lines.
          Last edited by MoonDoggie; 15-02-2012, 03:06 PM.
          Colin Senner

          Comment


          • #20
            Originally posted by MoonDoggie View Post
            Marc's is correct as well, but I'll trade the readability anyday for saving a couple lines.
            my version is very readable as far as i'm concerned, I could do it with half the lines as well
            the idea of using a second loop is that you can quickly edit the array in the first line to change the number of modifiers.
            Marc Lorenz
            ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___
            www.marclorenz.com
            www.facebook.com/marclorenzvisualization

            Comment

            Working...
            X