Sweep modifier

Hi there
I am trying to ad a sweep modifier via a script (using a custom shape).
The shape are skinned (a skin modifier on top of editable spline).
When I run the script it will not take the skin modifier in ("jumps" down to the editable spline as its ref).
The thing is that it works when I manual do the process. What am I missing here?

on btn_profilDoor pressed do
(
selected = $
sweepMod = sweep()
select $door
addModifier $ sweepMod
sweepMod.shapes[1] = selected
sweepMod.customShape = 1
sweepMod.PivotAlignment = 8
sweepMod.AssignCSType = 2
btn_profilDoor.text = $.name
)

Best regards
-David

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
PIXandDOTS's picture

Hi again pixamoon and miauu

Sorry for the confusion, i might not have made my self clear.

It is the other way around :) i need the skinmodifier to be taken into account.

Best regards
-David

PIXandDOTS's picture

Hi Pixamoon Thanx for your

Hi Pixamoon

Thanx for your suggestions.

What is the .baseObject supposed to do?

The "sweepMod.CustomShapeName = selected.name" returns an error saying that it is a read only property...

-David

miauu's picture

.

Baseobject is the object without any modifiers. For example if you have a mesh object with edit poly modifier and the topology of the object is changed by the edit poly modifier, the $.baseobject will gives you the o bject before the changes made by the edit poly modifier.

Search the forum for sweep modifier. I remember that Barigazy posted some snippeds for it.

pixamoon's picture

`

Yes, exactly.

why .baseobject ? - because you wrote you have some skin modifier on shape, so to down step and use just a shape as custom sweep shape u need to use selected.baseobject

You can skip the line with custom shape name...

Cheers,
Pixamoon

pixamoon's picture

`

Hey, Try to just use "selected.baseObject" instead of just "selected"

selected = $
sweepMod = sweep()
select $door
addModifier $ sweepMod
 
sweepMod.customShape = 1
sweepMod.shapes[1] = selected.baseObject -- <-- add .baseObject
sweepMod.CustomShapeName = selected.name -- <-- you can add also custom shape name
 
sweepMod.PivotAlignment = 8
sweepMod.AssignCSType = 2

Best,
Pixamoon

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.