Confusion

I think that:

Object.SetPoint PointIndex, PointX, PointY, PointZ
andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;^^^^^^

Should be:

Object.SetPoint CurrentIndex, PointX, PointY, PointZ
andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp; andnbsp;^^^^^^^^

Richard

I’ve been experimenting with modifiying the andquot;shift active objectandquot; script into a andquot;shift active FACEandquot; script. The script runs but I get rather unusual results, perhaps as a result of a lack of understanding on my part…

For example:
Does Set Face = andquot;Scene.GetActiveFace(0)andquot; return the selected face if only one face is selected?

The fragment of interest is:

‘ ***********BEGIN*********************
Dim Object, Face, ShiftX, ShiftY, ShiftZ
Dim PointCount
Dim PointIndex, CurrentIndex
Dim PointX
Dim PointY
Dim PointZ
Dim ActiveFaceCount

‘ fixed shifts for testing
ShiftX = 0
ShiftY = 1
ShiftZ = 0

‘assume 1 active object
Set Object = Scene.GetActiveObject(0)
‘ and one face ??????
Set Face = Scene.GetActiveFace(0)

‘get the number of points in the face
PointCount = Face.GetPointCount

‘Run through the points shifting them
For PointIndex = 0 to PointCount – 1
‘get the point index in the object
CurrentIndex = Face.GetPoint(PointIndex)
‘ get the coord of the point
Object.GetPoint CurrentIndex, PointX, PointY, PointZ

‘shift the point
PointX = PointX + ShiftX
PointY = PointY + ShiftY
PointZ = PointZ + ShiftZ

‘set the point
Object.SetPoint PointIndex, PointX, PointY, PointZ
Next

‘ ************* END *******************

When the above is run against a face of a cube the shift appears to do the expected only if the face is the -Z most face (the face shifts up by 1). Running against a different face yields a very distorted cube.

Thanks in advance!

Deanville

Thanks Richard! I should have desk checked it again. It now does what I expected.

Deanville

Thanks for the correction.

That does make things more consistent. I thought I had to map back to the object, that is why I had the andquot;CurrentIndex = Face.GetPoint(PointIndex)andquot; statement and used CurrentIndex.

However, the face shift is still applied always on the -Z face rather than the face selected. Am I using GetActiveFace correctly? I assumed that the 0th entry was the selected face if only one was selected.

Deanville

I looked at your script, and it was the andquot;SetPointandquot; that should have been changed, not the andquot;GetPointandquot;. I think that is the problem.

Richard

This could be a bug in 5.0. Could you send me your script (<!– e –><a href="mailto:richard@amabilis.com">richard@amabilis.com</a><!– e –>) and I’ll have a look at it.

Thanks,

Richard

You must be logged in to reply in this thread.

6 posts