help with last similar operation in stack

User avatar
Kolya
Posts: 39
Joined: 03 Oct 2017, 19:17

Re: help with last similar operation in stack

Post by Kolya » 03 Nov 2021, 14:27

2.

Code: Select all

SetTransientReferencePlane();
var refMode = GetUserPref("3D_TRANSFO_REFERENTIAL_CHANGED")
if(refMode == 3)
	SetUserPref("3D_TRANSFO_REFERENTIAL_CHANGED", 19);//ref(3) + cog(16)
else
	SetUserPref("3D_TRANSFO_REFERENTIAL_CHANGED", 3);
3. So you wont SplitEdgeTool() to Split All Parallel Edges on left mouse button instead of middle?

kowy
Posts: 47
Joined: 01 Jun 2020, 16:30

Re: help with last similar operation in stack

Post by kowy » 03 Nov 2021, 17:12

2 . yeap, looks perfect
3. yes, as it will be set to mouse4/5, that's the intention

User avatar
Kolya
Posts: 39
Joined: 03 Oct 2017, 19:17

Re: help with last similar operation in stack

Post by Kolya » 04 Nov 2021, 09:19

This plugin will make SplitEdgeTool Split All Parallel Edges on LMB and Split Edge on MMB https://drive.google.com/file/d/1WbXcrh ... sp=sharing

kowy
Posts: 47
Joined: 01 Jun 2020, 16:30

Re: help with last similar operation in stack

Post by kowy » 05 Nov 2021, 04:34

u've swapped left and with middle, I was wondering why I could not find in commands !
Splendid ! Thanks !

kowy
Posts: 47
Joined: 01 Jun 2020, 16:30

Re: help with last similar operation in stack

Post by kowy » 27 Nov 2021, 00:15

ohayo
is it possible with ice to make smt similar ? Caps for a curve, mb dublicate along curve - to have as istances
the way i do is with Set path

User avatar
Kolya
Posts: 39
Joined: 03 Oct 2017, 19:17

Re: help with last similar operation in stack

Post by Kolya » 27 Nov 2021, 09:14

Hi, to duplicate along curve there is Dupalong addon in the resources section

kowy
Posts: 47
Joined: 01 Jun 2020, 16:30

Re: help with last similar operation in stack

Post by kowy » 24 Dec 2021, 05:03

Dupalong error loading plugin
another question
insert polygons to keep borders (symmetric objects) if it's possible
this is not part of xsi so i guess is a c++ implementation ?!?!? May be is a way around

User avatar
Kolya
Posts: 39
Joined: 03 Oct 2017, 19:17

Re: help with last similar operation in stack

Post by Kolya » 24 Dec 2021, 10:31

1. Did you download 64 bit version of Dupalong?
2. Do you mean Inset Polygons? then the easiest way to do that would be by using bevel and changing center parameter

Code: Select all

if(Selection.Filter.Name == "Polygon"){
	var sel = selection.GetAsText();
	SelectFilter(siEdgeFilter);
	var oldEdgeSel = selection.GetAsText();
	SelectPolygonOutline(sel);
	var BorderEdges = SelectAllUsingFilter("Border_Edge", false, false);
	RemoveFromSelection(BorderEdges);
	var newEdgeSel = selection.GetAsText();
	SelectGeometryComponents(oldEdgeSel);
	SelectFilter(siPolygonFilter);
	var bevel = ApplyTopoOp("BevelComponent", newEdgeSel);
	for(i=0; i<bevel.Count; i++){
		bevel(i).Parameters("miter").Value = true;
	}
	InspectObj(bevel);
}

kowy
Posts: 47
Joined: 01 Jun 2020, 16:30

Re: help with last similar operation in stack

Post by kowy » 24 Dec 2021, 22:07

1. one of forums, anyway found blender's can do this job, wrote exports between softwares
2. thanks ! forgot about this future

kowy
Posts: 47
Joined: 01 Jun 2020, 16:30

Re: help with last similar operation in stack

Post by kowy » 05 Jan 2022, 01:06

ohayo
if u can help with smt else, quickthickness - positive value since 90% using that - beauty of this is has a recipe for flipping values, for negative values found "Interactive thickness" another addon
i've tried to modify myself, but luck of knowledge, have to look into modifier stack & find my extrude modifier

Code: Select all

# QuickThickness

import win32com.client
from win32com.client import constants
c = win32com.client.constants

null = None
false = 0
true = 1

def XSILoadPlugin( in_reg ):
    in_reg.Author = "eistan"
    in_reg.Name = "QuickThickness"
    in_reg.Major = 1
    in_reg.Minor = 0

    in_reg.RegisterCommand("QuickThickness","QuickThickness")
    in_reg.RegisterMenu(constants.siMenu3DViewObjectMeshContextID,"QuickThickness_Menu",false,false)
    in_reg.RegisterMenu(constants.siMenuTbModelModifyPolygonMeshID,"QuickThickness_Menu",false,false)
    #RegistrationInsertionPoint - do not remove this line

    return true

def XSIUnloadPlugin( in_reg ):
    strPluginName = in_reg.Name
    Application.LogMessage(str(strPluginName) + str(" has been unloaded."),constants.siVerbose)
    return true

def QuickThickness_Init( in_ctxt ):
    oCmd = in_ctxt.Source
    oCmd.Description = ""
    oCmd.ReturnValue = true

    return true

def QuickThickness_Execute(  ):
	a = Application
	sel = a.Selection
	lm = LogMessage


	listx = []
	lista = []


	for x in range(0, sel.Count):
		geo = sel(x).activeprimitive.geometry
		geoCount = geo.Edges.Count
		selcon = sel(x).activeprimitive.ConstructionHistory

		if selcon.Find( "extrudenormalop" ) and selcon.Find( "invsrf" ) and selcon.Find( "invertpolygonop" ) and selcon.Find( "extrudecompaxisop" ):
			lista.append(sel(x).Name)
		else:
			listx.append(sel(x).Name)


	if listx:
		oProgressBar = XSIUIToolkit.ProgressBar
		oProgressBar.Maximum = len(listx)
		oProgressBar.Caption = "Quick Thickness Process..."
		oProgressBar.Visible = True
		for y in range(0, len(listx)):
			
			
			a.SelectObj(listx[y], "", True)
			a.SelectGeometryComponents(".poly[*]")
			a.ApplyTopoOp("InvertPolygon", "", "siUnspecified", "siPersistentOperation", "")

			a.DuplicateMeshComponent("", "siPersistentOperation", "", "", "", "", "", "", "", "", "", "", "", "", True)
			a.ApplyTopoOp("InvertPolygon", "", "siUnspecified", "siPersistentOperation", "") 
			a.ApplyTopoOp("ExtrudeComponentNormal", "", "siUnspecified", "siPersistentOperation", "")
			a.SetValue(a.Selection(0).Name +".polymsh.extrudenormalop.length", 0.1, "")

			a.SelectObj(listx[y], "", True)
			a.SetSelFilter("Border_Edge")
	 
			edge = a.SelectAllUsingFilter("Border_Edge", "siCheckComponentVisibility", "", "")
			if edge.Count > 0:
				a.ApplyTopoOp("WeldEdges", "", "siUnspecified", "siPersistentOperation", "")
			a.ActivateObjectSelTool("")
			a.SelectObj(listx[y], "", True)
			a.ApplyTopoOp("Inverse", "", 3, "siPersistentOperation", "")
			a.SetValue(".polymsh.invsrf.inv", False, "")
			oProgressBar.Increment()

			Application.SelectObj(listx)
			a.ActivateRaycastPolySelTool("")
			

	if lista and listx:
		a.AddToSelection(lista)
	elif lista:
		a.SelectObj(lista)

	oProp = XSIFactory.Createobject( 'CustomProperty' )
	oProp.Name = "Quick Thickness"

	oProp.addparameter2( "Thickness", 5, .1, -100, 100, -5, 5)
	oProp.addparameter2( "Subdivs", 2, 0, 0, 100, 0, 5)
	oProp.addparameter2( "Inset", 5, 0, -100, 100, -5, 5)
	oProp.addparameter2( "Freeze", 5)

	oLayout = oProp.PPGLayout

	oLayout.AddItem( 'Thickness', "Thickness" , c.siControlNumber)
	oLayout.AddItem( 'Subdivs', "Subdivs" , c.siControlNumber)
	oLayout.AddItem( 'Inset', "Inset" , c.siControlNumber)
	oLayout.AddItem( 'Freeze', "Freeze" , c.siControlButton)

	oLayout.Language = "Python"


	oLayout.Logic = '''
a = Application
sel = a.Selection
lm = LogMessage
list = []
for x in range(0, sel.Count):
	list.append(sel(x))
		

def Thickness_OnChanged():
	for y in range(0, len(list)):	
		list[y].ActivePrimitive.ConstructionHistory.Find( "extrudenormalop" ).Parameters(1).Value = PPG.Thickness.Value
		if PPG.Thickness.Value < 0:
			list[y].ActivePrimitive.ConstructionHistory.Find("invsrf").Parameters(0).Value = True
		else:
			list[y].ActivePrimitive.ConstructionHistory.Find("invsrf").Parameters(0).Value = False

def Subdivs_OnChanged():
	for y in range(0, len(list)):	
		list[y].ActivePrimitive.ConstructionHistory.Find( "extrudenormalop" ).Parameters(6).Value = PPG.Subdivs.Value
		
def Inset_OnChanged():
	for y in range(0, len(list)):	
		list[y].ActivePrimitive.ConstructionHistory.Find( "extrudenormalop" ).Parameters(2).Value = PPG.Inset.Value
		
def Freeze_OnClicked():
	a.SelectObj(list, "", True)
	a.FreezeModeling("", "", "")
	PPG.Close()
'''

	if listx or lista:
		a.inspectobj( oProp , "", "", 3) 

	return true

def QuickThickness_Menu_Init( in_ctxt ):
    oMenu = in_ctxt.Source
    oMenu.AddCommandItem("QuickThickness","QuickThickness")
    return true

kowy
Posts: 47
Joined: 01 Jun 2020, 16:30

Re: help with last similar operation in stack

Post by kowy » 05 Jan 2022, 01:08

& is there a way to setup hotkeys for move component - weld & slide ?

User avatar
Kolya
Posts: 39
Joined: 03 Oct 2017, 19:17

Re: help with last similar operation in stack

Post by Kolya » 05 Jan 2022, 10:15

1. Can you please explain it better, in more detail, because I'm not familiar with quickthickness plugin.
2. Keyboard Mapping > Group:Tweak Tool > Command:Slide Components and Weld Components

kowy
Posts: 47
Joined: 01 Jun 2020, 16:30

Re: help with last similar operation in stack

Post by kowy » 05 Jan 2022, 15:13

"Interactive thickness" add thickness to a plane opposite to normals (duplicate polys, invert, extrude along normals, merge together) - blenders solidify in 1 direction
quickthickness - addon found also on rray.de - same as "Interactive thickness" but in both directions, what i tend to do is solidfy* on positive direction of normals - revert to "Interactive thickness"

User avatar
Kolya
Posts: 39
Joined: 03 Oct 2017, 19:17

Re: help with last similar operation in stack

Post by Kolya » 06 Jan 2022, 09:53

So you want quickthickness to work as "Interactive thickness" but in opposite direction, without inverting normals when the thickness parameter goes negative?

Code: Select all

# QuickThickness

import win32com.client
from win32com.client import constants
c = win32com.client.constants

null = None
false = 0
true = 1

def XSILoadPlugin( in_reg ):
    in_reg.Author = "eistan"
    in_reg.Name = "QuickThickness"
    in_reg.Major = 1
    in_reg.Minor = 0

    in_reg.RegisterCommand("QuickThickness","QuickThickness")
    in_reg.RegisterMenu(constants.siMenu3DViewObjectMeshContextID,"QuickThickness_Menu",false,false)
    in_reg.RegisterMenu(constants.siMenuTbModelModifyPolygonMeshID,"QuickThickness_Menu",false,false)
    #RegistrationInsertionPoint - do not remove this line

    return true

def XSIUnloadPlugin( in_reg ):
    strPluginName = in_reg.Name
    Application.LogMessage(str(strPluginName) + str(" has been unloaded."),constants.siVerbose)
    return true

def QuickThickness_Init( in_ctxt ):
    oCmd = in_ctxt.Source
    oCmd.Description = ""
    oCmd.ReturnValue = true

    return true

def QuickThickness_Execute(  ):
	a = Application
	sel = a.Selection
	lm = LogMessage


	listx = []
	lista = []


	for x in range(0, sel.Count):
		geo = sel(x).activeprimitive.geometry
		geoCount = geo.Edges.Count
		selcon = sel(x).activeprimitive.ConstructionHistory

		if selcon.Find( "extrudenormalop" ) and selcon.Find( "invsrf" ) and selcon.Find( "invertpolygonop" ) and selcon.Find( "extrudecompaxisop" ):
			lista.append(sel(x).Name)
		else:
			listx.append(sel(x).Name)


	if listx:
		oProgressBar = XSIUIToolkit.ProgressBar
		oProgressBar.Maximum = len(listx)
		oProgressBar.Caption = "Quick Thickness Process..."
		oProgressBar.Visible = True
		for y in range(0, len(listx)):
			
			
			a.SelectObj(listx[y], "", True)
			a.SelectGeometryComponents(".poly[*]")
			inverseop = a.ApplyTopoOp("Inverse", listx[y], 3, "siPersistentOperation", "")
			a.SetValue(str(inverseop)+".inv", True, "")
			a.DuplicateMeshComponent("", "siPersistentOperation", "", "", "", "", "", "", "", "", "", "", "", "", True)
			a.ApplyTopoOp("InvertPolygon", "", "siUnspecified", "siPersistentOperation", "")
			a.ApplyTopoOp("ExtrudeComponentNormal", "", "siUnspecified", "siPersistentOperation", "")
			a.SelectObj(listx[y], "", True)
			a.SetSelFilter("Border_Edge")
	 
			edge = a.SelectAllUsingFilter("Border_Edge", "siCheckComponentVisibility", "", "")
			if edge.Count > 0:
				a.ApplyTopoOp("WeldEdges", "", "siUnspecified", "siPersistentOperation", "")
			a.ActivateObjectSelTool("")
			a.SelectObj(listx[y], "", True)
			#a.ApplyTopoOp("Inverse", "", 3, "siPersistentOperation", "")
			#a.SetValue(".polymsh.invsrf.inv", False, "")
			oProgressBar.Increment()

			Application.SelectObj(listx)

	if lista and listx:
		a.AddToSelection(lista)
	elif lista:
		a.SelectObj(lista)

	oProp = XSIFactory.Createobject( 'CustomProperty' )
	oProp.Name = "Quick Thickness"

	oProp.addparameter2( "Thickness", 5, 1, -100, 100, -5, 5)
	oProp.addparameter2( "Subdivs", 2, 0, 0, 100, 0, 5)
	oProp.addparameter2( "Inset", 5, 0, -100, 100, -5, 5)
	oProp.addparameter2( "Freeze", 5)

	oLayout = oProp.PPGLayout

	oLayout.AddItem( 'Thickness', "Thickness" , c.siControlNumber)
	oLayout.AddItem( 'Subdivs', "Subdivs" , c.siControlNumber)
	oLayout.AddItem( 'Inset', "Inset" , c.siControlNumber)
	oLayout.AddItem( 'Freeze', "Freeze" , c.siControlButton)

	oLayout.Language = "Python"


	oLayout.Logic = '''
a = Application
sel = a.Selection
lm = LogMessage
list = []
for x in range(0, sel.Count):
	list.append(sel(x))
		

def Thickness_OnChanged():
	for y in range(0, len(list)):	
		list[y].ActivePrimitive.ConstructionHistory.Find( "extrudenormalop" ).Parameters(1).Value = PPG.Thickness.Value
		#if PPG.Thickness.Value < 0:
		#	list[y].ActivePrimitive.ConstructionHistory.Find("invsrf").Parameters(0).Value = True
		#else:
		#	list[y].ActivePrimitive.ConstructionHistory.Find("invsrf").Parameters(0).Value = False

def Subdivs_OnChanged():
	for y in range(0, len(list)):	
		list[y].ActivePrimitive.ConstructionHistory.Find( "extrudenormalop" ).Parameters(6).Value = PPG.Subdivs.Value
		
def Inset_OnChanged():
	for y in range(0, len(list)):	
		list[y].ActivePrimitive.ConstructionHistory.Find( "extrudenormalop" ).Parameters(2).Value = PPG.Inset.Value
		
def Freeze_OnClicked():
	a.SelectObj(list, "", True)
	a.FreezeModeling("", "", "")
	PPG.Close()
'''

	if listx or lista:
		a.inspectobj( oProp , "", "", 3) 

	return true

def QuickThickness_Menu_Init( in_ctxt ):
    oMenu = in_ctxt.Source
    oMenu.AddCommandItem("QuickThickness","QuickThickness")
    return true


kowy
Posts: 47
Joined: 01 Jun 2020, 16:30

Re: help with last similar operation in stack

Post by kowy » 02 Mar 2022, 19:44

thanks ! one note that earlier worked in both direction, now only in one
one question about U - polygons selection
select between 2 polygons not shortest but area (blender like) if it's such option, i know rcTOols, as it, searching for defaults

kowy
Posts: 47
Joined: 01 Jun 2020, 16:30

Re: help with last similar operation in stack

Post by kowy » 24 Jul 2022, 08:40

Kolya wrote: 18 Oct 2021, 13:10 Hi, place .xsicompound into C:\Users\user_name\Autodesk\Softimage_version\Data\Compounds and restart Softimage

Code: Select all

var s = new ActiveXObject( "XSI.Collection" );
s.AddItems(Selection);

var c = Clone(s);
for(var i=0, sCount=s.Count; i<sCount; i++){
	var op = SIApplyICEOp("MirrorConstraint", c(i),  s(i));
}
Thanks one more time for script ! I have 2 minor problems
1. to export model i have to freeze transforms, when doing so - mirrored one change's vertex position in a weird way - only solution I found is to merge both together & separate
2. if i have Ngons & try to freeze both(original with mirror) will mess up vertex position & process doesn't apply any undo - only backup(or early saved) can restore the model - solution is to save before freezing

Post Reply

Who is online

Users browsing this forum: No registered users and 48 guests