Hi,

I solved my own problem.

I found the GetShaderParameterTargets() Method being just what I wanted and
wrote a little script to create a new Image Clip and delete the old one.

//-------------------
//JScript
//-------------------
var oSel = getvalue("selectionlist")
if (!oSel.Filter("ImageClip"))  var oClips =
ActiveProject.ActiveScene.ImageClips
else    var oClips = oSel

for ( var i=0; i < oClips.Count; i++ ) {
    var oClip = oClips(i);
    oClip.name = oClip.name + "_temp"
var sourceFile = oClip.parameters('SourceFileName').value
    var oClipTargets = oClip.GetShaderParameterTargets()
    var oNewClip = SICreateImageClip(sourceFile)(0);

    for ( var j=0; j < oClipTargets.Count; j++ ) {
        SIConnectShaderToCnxPoint(oNewClip, oClipTargets(j), false);
    }
    DeleteObj(oClip)
}
//-------------------

- It doesn't copy parameters so it will only work with default image clips.
- Works with selected Image clips, and if no image clips has been selected,
it will replace all image clips.


Martin


On Thu, Jul 30, 2015 at 7:16 PM, Martin Yara <furik...@gmail.com> wrote:

> Hi list,
>
> I'm using SI -> FBX -> Maya more than ever and I'm having some problems.
>
> Everytime I export a scene to FBX, it seems to change my current Softimage
> data which is weird because it shouldn't change your data !
>
> My image clips stop appearing on Texture Editor and the preview when you
> double click a image clip. The Texture Editor is just gray, and becomes
> very slow.
> I though it would be a problem with the real time shaders we were using
> but it happens with 1 texture simple Phong materials too.
>
> I'm not sure if it's related but for some reason, effects are enabled and
> can't be disabled.
>
> I haven't noticed it before because I didn't use to keep working on my
> scene after exporting, but now we are sharing WIP data with Maya users back
> and forward.
>
> Reloading and not saving after an FBX export with a custom FBX exporter
> could work, but I would still have to deal with already messed up data. I'd
> like a fix to the FBX broken scene instead of prevent the problem.
>
> The only solution I've found is to create my Image clips again and connect
> them to their respective shaders. I'm thinking in automatize this through
> scripting but I'm still not sure how to find the shaders they are connected
> to, not other way than get the material with the owner property and walk
> through all the shaders in the Material Tree until I find the image clip.
>
> Does anyone have found any solution to this?
>
> The other problem are weights and Symmetry Templates. I haven't found the
> source of the problem but it usually happens when I'm importing an FBX from
> Maya to SI. You just can't create a Sym.Template. This is easily solved by
> saving the weights and loading them again. Sometimes re-envelope is also
> needed. I had this problem since ever so I'm used to it, just adding the
> info in case someone is having the same problem.
>
> Thanks,
>
> Martin
>

Reply via email to