Softimage Forum (Read Only)
Welcome to Autodesk’s Softimage Forums. Share your knowledge, ask questions, and explore popular Softimage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Implict Selection

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
306 Views, 9 Replies

Implict Selection

How do i get the currently implicitly selected object when using a sub component filter on an object, such as Polygon Filter on a Polygonal Mesh.
Selection only returns sub components in this case, and when none is selected i can't look up their parent either.

This is just convenience for a conditional selection script, eliminating the step of having to step out of the current filter and select the object.
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: Anonymous

logmessage Selection(0).Name

I think should work for you

Chin

PS I find using the SDK Explorer amazing for this type of info. It has helped me so much in the past. If you don't use it already I highly recommend it!
Cntrl+Shift+4 = hotkey
Message 3 of 10
Stephen.Blair
in reply to: Anonymous

If you want to get the X3DObject directly:

LogMessage( classname(Selection(0).Subcomponent.Parent3DObject) );


// Stephen Blair
// Arnold Renderer Support
Message 4 of 10
Anonymous
in reply to: Anonymous

Selection(0).Name, // ERROR : Object required - (In Vertex and Edge Filters, Polygon Filter returns a valid name.

The latter requires a component to be selected tho.

Guess a fair compromise is to either have the user select an object, or add to the current selection.
Message 5 of 10
Anonymous
in reply to: Anonymous

Ah I did not realise you meant when no component selected. This is a workaround:

set sel = Application.Selection
set currentFilter = sel.Filter
logmessage currentFilter.Name
ActivateObjectSelTool
LogMessage Selection(0)

'Set back to the current filter
if currentFilter.Name = "Vertex" then
ActivateVertexSelTool
elseif currentFilter.Name = "Edge" then
ActivateEdgeSelTool
elseif currentFilter.Name = "Polygon" then
ActivateRaycastPolySelTool
end if
Message 6 of 10
Anonymous
in reply to: Anonymous

Thanks Chinny, Actually works quite well.

var filter = Selection.Filter;
SelectObjectFilter();
var objectName = Selection(0).Name;
LogMessage( objectName );
SelectFilter(filter);

var object = ActiveSceneRoot.FindChild(objectName);
LogMessage( object.Name );
I'll try to put the script in a presentable form sometime next week 🙂
As a side note, just trying to match XSI's behaviour.
Should the script be expected to work with multiple objects? Seems like i.e the select n-sided polygons is able to work with multiple objects. (Just a user leisure question)

Edit: Wait, why am i traversing the scene to find the object when i have it right there in Selection?

A Cleaner version would obviously be

var filter = Selection.Filter;
SelectObjectFilter();

var oObject = Selection(0);
SelectFilter(filter);
Message 7 of 10
Anonymous
in reply to: Anonymous

Another side note, Point::Position seem to hold relative (local transform) values?
How do i get absolute values? 😉

Edit: Yet another thing. is there a C++ equivalent to SelectFilter? digging trough the docs i can't seem to find a method to set the selection filter.
Message 8 of 10
Anonymous
in reply to: Anonymous

Another side note, Point::Position seem to hold relative (local transform) values?
How do i get absolute values? 😉



Perhaps XSIMath.MapObjectPositionToWorldSpace?
Message 9 of 10
Anonymous
in reply to: Anonymous

Still looking for a way of setting the current selection filter using the object model as Selection.Filter is read only.
Message 10 of 10
Anonymous
in reply to: Anonymous

Ended up just writing a wrapper using Application.ExecuteCommand.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report