Jump to content
Developer Wiki and Function Reference Links ×

SetTexMapReal Updating Values But Texture Not Changing


dhughes3

Recommended Posts

Hi,

 

I'm trying to write a script which updates the texture mapping offsets using SetTexMapReal but am having a little trouble... After running the script the OIP correctly shows the new offsets but when you view the object the texture hasn't moved to reflect the new values. Any idea what I am doing wrong?

 

Thanks,

Duncan

Link to comment
13 minutes ago, klinzey said:

Try ResetOject()

Nope. didnt work. Maybe I'm doing something wrong in my code...

 

Procedure SetMapping;

	Procedure SetOffset(h :HANDLE);
	BEGIN
		SetTexMapReal(h,3,1,300);
		ResetObject(h);
	End;
	
Begin
	ForEachObject(SetOffset,(Sel=True));
End;
Run (SetMapping);

 

Link to comment
  • 2 years later...

Has anyone found a way to update texture mapping settings. Tried all of above to no avail. Alternatively is there a way to invoke the "Update" button on the "Render" tab.

 

Looks like "ExtrudeAlongPath" call sets Mapping type to "Perimeter" which has now changed (at VW 2022) to "Surface UV" when using "Extrude Along Path" menu command.

 

I am thinking of using "auto align plane" and "follow longest edge" set using

 

SetTexMapIntN(fsactlayer,3,0,1,0); {Plane}

SetTexMapBoolN(fsactlayer,3,0,7,True); {auto align}
SetTexMapBoolN(fsactlayer,3,0,5,True); {long edge}

 

but have no way to invoke update.

 

I note GetTexMapIntN(fsactlayer,3,0,1) returns 0 for both "Plane" and "Auto Align Plane" options.

 

It would be nice if we could have an updated "ExtrudeAlongPath" call to handle all the options available in the "Extrude Along Path" menu command.

 

I know we can use (from Marionette)

        eap = vs.CreateCustomObjectPath('Extrude Along Path', path, profile)
        vs.SetObjectVariableBoolean(eap, 1167, True)
        vs.SetRField(eap, 'Extrude Along Path', 'Fix Profile', 'No')

 

but had problems in the past using this method.

Link to comment

This is something I have been dealing with as well.  I have a script which runs through a series of objects and offsets the X and Y of the texture to more randomize multiple identical objects with the same texture.  But, they do not update unless I move the objects.

Link to comment

Thanks for reminding me. Just a note for others, for event enabled plugins, presumably the plugin option "Reset on Move" will need to be set.

 

I haven't tried but I wonder if "PrepRelatedObjectForChange" might work but I doubt it. Generally, I have never successfully used this call (amongst a few other calls)

Link to comment
  • 2 weeks later...

Good day @SamIWas and @BillW,

 

unfortunately, i don’t have a script on hand that quickly changes the textures of objects so i can test it. I would appreciate it if you could provide a test file for me.

Recently, i was able to automatically update a Marionette with ResetObject (see post).

I can’t say if this also applies to a texture changed by the script.

There was also a post where the author updated with python the normal faces with ReDraw after making changes.

Maybe this will help you a bit further.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...