changing of models

Discussions regarding modelling with SOFTIMAGE©
Post Reply
Botan
Posts: 7
Joined: 14 Nov 2018, 21:37

changing of models

Post by Botan » 23 Nov 2022, 14:09

Hey, guys! Are we still alive here?) If so, pleease, help me - how to change parts of model with another one?
For example, I have many nuts or bolts on my model and wanna change them with another version of them (and redistribute them in the same place, of course).
What I can do now is only copy one new nut - match it with old - delete old one...quite slow pipilene, uh?
Is it possible to automatize it somehow? Thanks.

opoppopopp
Posts: 169
Joined: 16 Jun 2009, 06:23

Re: changing of models

Post by opoppopopp » 23 Nov 2022, 17:24

Botan wrote: 23 Nov 2022, 14:09 ...change parts of model with another one...
Simple batch Scripting will give you some automation, but other than substituted new object, like you described.
You also can modify the PolyMesh, through scripting, so that you keep all your keyframe, constraints, operators etc. if any.
because you modify a object, not replace it.

Botan
Posts: 7
Joined: 14 Nov 2018, 21:37

Re: changing of models

Post by Botan » 23 Nov 2022, 17:54

I'd like to replace them, not modified...and coordinates and objects are different, so as I can see,
it is impossible just to write in script smth like "match" -
it will be other pair of matches every time, no? But I'm not so strong in scripting anyway)

opoppopopp
Posts: 169
Joined: 16 Jun 2009, 06:23

Re: changing of models

Post by opoppopopp » 24 Nov 2022, 14:58

Botan wrote: 23 Nov 2022, 17:54 I'd like to replace them, not modified...and coordinates and objects are different, so as I can see,
it is impossible just to write in script smth like "match" -
it will be other pair of matches every time, no? But I'm not so strong in scripting anyway)
Is this what you want?
"match" the new object to old one, then delete the old one, but again, you will lose all you constraints etc.
Image

Surface_VR
Posts: 39
Joined: 11 May 2020, 14:22

Re: changing of models

Post by Surface_VR » 30 Nov 2022, 05:02

I know it's a little late for that.
If it's just for looks, I could convert it to particles once and then convert it...
it's quite difficult...


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

Re: changing of models

Post by Kolya » 01 Dec 2022, 12:16

Hello, I made a script.
Select objects to replace, run the script and pick object to replace with.

Code: Select all

//JScript
OpenUndo("");
var sel = Selection;
var sel_count = sel.Count;
if(sel_count > 0){
	var pick = PickObject("Duplicate", "Clone");
	var button_pressed = pick(0);
	if(button_pressed !== 0){
		var ch = 2;
		if(button_pressed == 2)ch = 3;
		var picked_obj = pick(2);
		var dup = SIDuplicate(picked_obj, sel_count, null, ch);
		for(var i=0; i<sel_count; i++){
			var sel_obj = sel(i);
			var dup_obj = dup(i);
			var sel_obj_par = sel_obj.Parent3DObject;
			var dup_obj_par = dup_obj.Parent3Dobject;
			if(sel_obj_par.FullName !== dup_obj_par.FullName)
				ParentObj(sel_obj_par, dup_obj);
			dup_obj.Kinematics.Global.Transform = sel_obj.Kinematics.Global.Transform;
			
		}
		DeleteObj(sel);
		SelectObj(dup);
	}
}

CloseUndo();


User avatar
X-said
Posts: 63
Joined: 08 Jun 2009, 19:33
Location: Omsk RF
Contact:

Re: changing of models

Post by X-said » 07 Dec 2022, 06:58

Thanks for the script

Botan
Posts: 7
Joined: 14 Nov 2018, 21:37

Re: changing of models

Post by Botan » 17 Dec 2022, 08:08

Kolya, you are man! I should try it!

Talik
Posts: 56
Joined: 09 May 2017, 11:13
Skype: nihao00042

Re: changing of models

Post by Talik » 23 Jul 2023, 20:24

Kolya X-said Did you come here from Softimage.ru ? I saw you there
Kolya nice to see you here. Did you make any new scripts?

User avatar
X-said
Posts: 63
Joined: 08 Jun 2009, 19:33
Location: Omsk RF
Contact:

Re: changing of models

Post by X-said » 01 Aug 2023, 16:07

Since Kolya is from Ukraine and with the beginning of this fucking SVO, he disappeared from the radar and now he has no time for scripts. I hope to see him safe and sound in the vastness of this forum.
Так как Коля с Украины и с началом этого долбаного СВО он пропал с радаров и ему сейчас не до скриптов. Надеюсь увидеть его в целости и сохранности на просторах данного форума.

Post Reply

Who is online

Users browsing this forum: No registered users and 70 guests