View Full Version : random selection of faces (again)
mynewcat 08-22-2007, 10:12 AM With reference to this useful thread:
http://forums.cgsociety.org/showthread.php?f=98&t=381323&highlight=random+faces
I need to assign material ids to all the faces (or selected faces) in an edit poly modifier. for some reason, all the tools I have found only work if they are working on a collapsed object - not if it's a modifier.... why is this?
Why aren't the commands essentially the same between the two (editable poly and edit poly)?
Would it be easy to convert Wahooney's script to work on a modifier?
|
|
soulburn3d
08-22-2007, 06:28 PM
With reference to this useful thread:
http://forums.cgsociety.org/showthread.php?f=98&t=381323&highlight=random+faces
I need to assign material ids to all the faces (or selected faces) in an edit poly modifier. for some reason, all the tools I have found only work if they are working on a collapsed object - not if it's a modifier.... why is this?
Why aren't the commands essentially the same between the two (editable poly and edit poly)?
Would it be easy to convert Wahooney's script to work on a modifier?
Well first, the editpoly modifier has only been around for like 1 max release (I believe it made it's debut in max8), wheras editablePoly has been around for 4 or 5 max verisons, so it's more likely to find tools that work on editablepoly and that don't yet work on editpoly because they haven't been updated recently. The commands to affect both are pretty similar though, so I think there's a good chance it would be pretty easy to have the script work on both.
- Neil
mynewcat
08-23-2007, 09:46 AM
Well first, the editpoly modifier has only been around for like 1 max release (I believe it made it's debut in max8), wheras editablePoly has been around for 4 or 5 max verisons, so it's more likely to find tools that work on editablepoly and that don't yet work on editpoly because they haven't been updated recently. The commands to affect both are pretty similar though, so I think there's a good chance it would be pretty easy to have the script work on both.
- Neil
Max 7 I think was edit poly. But yeah, all the examples and help (and existing scripts) seem to only work on the base mesh - so it was more a case of working out the syntax. But I wanted to work quick - I'm in an environment where people are distrustful of scripts and would rather I spend two days manually wasting time than gamble a couple of hours on a script.
Cheers for the help though - and for the record, I'll post the script in case anyone searches for this and needs to copy bits of it.
So what it does is bung an edit poly on an object and randomly assigns material ids from 1 to 5 onto all the faces, and then assigns material id 6 to the last face (highest number face) - which would be the top of an extrude by sheer luck.
macroScript Macro10
category:"DragAndDrop"
toolTip:""
(
modPanel.addModToSelection (Edit_Poly ()) ui:on
subobjectLevel = 4
jfaces = getNumFaces $
x = 1
$.modifiers[#Edit_Poly].SetSelection #Face #{}
$.modifiers[#Edit_Poly].Select #Face #{jfaces}
$.modifiers[#Edit_Poly].SetOperation #SetMaterial
$.modifiers[#Edit_Poly].materialIDToSet = 5
--$.modifiers[#Edit_Poly].Commit()
while x < jfaces do
(
jrandom = random 0 4
--print jrandom
$.modifiers[#Edit_Poly].SetSelection #Face #{}
$.modifiers[#Edit_Poly].Select #Face #{x}
$.modifiers[#Edit_Poly].SetOperation #SetMaterial
$.modifiers[#Edit_Poly].materialIDToSet = jrandom
-- $.modifiers[#Edit_Poly].Commit()
x += 1
)
)
Bercon
08-23-2007, 02:03 PM
Basicly you would have to code everything twice if you want to support both editable poly and edit poly modifier, since usually everybody work on editable poly everything is coded to it. Personally I've never even used edit poly modifier so it would seem pointless to go through all that trouble to support it.
CGTalk Moderation
08-23-2007, 02:03 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.