ScriptSpot

Forum topic · General Scripting

Sweep modifier

By PIXandDOTS · 2015-10-02

Description

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 (5)

Hi again pixamoon and miauu

PIXandDOTS · 2015-10-19

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 · 2015-10-05

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 · 2015-10-05

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 · 2015-10-06

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 · 2015-10-04

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