XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Sun May 28, 2017 9:55 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 47 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: Noesis tutorial Basic Model
PostPosted: Sun Sep 02, 2012 1:40 pm 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Fri Aug 05, 2011 9:31 pm
Posts: 240
Location: Antwerp
Has thanked: 13 times
Have thanks: 41 times














You can make the ads go away by registering

Try using something along the lines of:
Code:
dirPath        = rapi.getDirForFilePath(rapi.getInputName())

with
Code:
tex         = open(dirPath + '/texfolder/' +texName,'rb').read()
texture     = rapi.loadTexByHandler(tex,'.dds')
texture.name    = texName.split('.dds')[0] #//you can leave the .split() away if you want
texList.append(texture)



mdl.setModelMaterials(NoeModelMaterials(texList, matList))


Top
 Profile  
 
 Post subject: Re: Noesis tutorial Basic Model
PostPosted: Sun Sep 02, 2012 2:00 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran

Joined: Sat Apr 09, 2011 1:22 am
Posts: 2387
Has thanked: 170 times
Have thanks: 275 times
It should be enough to just specify the absolute path of the texture in the material and just set that as the texture.

I usually just tell people to create a "textures" folder and dump all the textures in there.

_________________
Model Import Plugins/Scripts

Noesis Plugins | Reference files

Reference
Guide to 3D model reversal | 3D glossary


Top
 Profile  
 
 Post subject: Re: Noesis tutorial Basic Model
PostPosted: Sun Sep 02, 2012 8:46 pm 
Offline
advanced

Joined: Wed Apr 04, 2012 10:17 am
Posts: 46
Has thanked: 6 times
Have thanks: 0 time
Code:
#Noesis Python model import+export test module, imports/exports some data from/to a made-up format
from inc_noesis import *
import noesis
#rapi methods should only be used during handler callbacks
import rapi
#registerNoesisTypes is called by Noesis to allow the script to register formats.
#Do not implement this function in script files unless you want them to be dedicated format modules!
def registerNoesisTypes():
   handle = noesis.register("Rinne no Lagrange Kamogawa Dream Match", ".gcm")
   noesis.setHandlerTypeCheck(handle, noepyCheckType)
   noesis.setHandlerLoadModel(handle, noepyLoadModel) #see also noepyLoadModelRPG
       #noesis.setHandlerWriteModel(handle, noepyWriteModel)
       #noesis.setHandlerWriteAnim(handle, noepyWriteAnim)
   noesis.logPopup()
       #print("The log can be useful for catching debug prints from preview loads.\nBut don't leave it on when you release your script, or it will probably annoy people.")
   return 1

NOEPY_HEADER = "PHYR"

#check if it's this type based on the data
def noepyCheckType(data):
   bs = NoeBitStream(data)
   if len(data) < 7:
      return 0
   if bs.readBytes(7).decode("ASCII").rstrip("\0") != NOEPY_HEADER:
      return 0
  return 1       

#load the model
def noepyLoadModel(data, mdlList):
   ctx = rapi.rpgCreateContext()
   bs = NoeBitStream(data)
   rapi.rpgClearBufferBinds()   
   return 1

I'll wrote Noesis plugins.
I'm not sure whether I'm doing this right, so far.
Will you explain this part "if len(data) < 7:"?
Is this number right?


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject: Re: Noesis tutorial Basic Model
PostPosted: Sun Sep 02, 2012 9:33 pm 
Offline
Moderator
User avatar

Joined: Sun May 18, 2008 3:01 pm
Posts: 2397
Has thanked: 56 times
Have thanks: 1134 times
NOEPY_HEADER = "PHYR"

#check if it's this type based on the data
def noepyCheckType(data):
bs = NoeBitStream(data)
if len(data) < 7:
return 0
if bs.readBytes(7).decode("ASCII").rstrip("\0") != NOEPY_HEADER:
return 0
return 1

should be

NOEPY_HEADER = "PHYR"

#check if it's this type based on the data
def noepyCheckType(data):
bs = NoeBitStream(data)
if bs.readBytes(4).decode("ASCII").rstrip("\0") != NOEPY_HEADER:
return 0
return 1

this just checks to make sure the first 4 characters of the file are PHYR

also your file is big endian keep that in mind


Top
 Profile  
 
 Post subject: Re: Noesis tutorial Basic Model
PostPosted: Mon Sep 03, 2012 10:40 am 
Offline
beginner

Joined: Fri Apr 08, 2011 9:31 pm
Posts: 35
Has thanked: 12 times
Have thanks: 40 times
Hi,

this time i don't ask for help :D but it's somehow connected to file check. My plugin is ready, but every time i select the file format i only get an empty list in the viewer, but it occurs only under win7x64. The problem doesn't appear under xp.
Is there a workaround to solve this? I tried to run as admin but that didn't helped.
Should I run Noe in compatibility mode? (I'm currently at work so i can't try it out, and it's so long until i get home :D)


Top
 Profile  
 
 Post subject: Re: Noesis tutorial Basic Model
PostPosted: Mon Sep 03, 2012 11:06 am 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Fri Aug 05, 2011 9:31 pm
Posts: 240
Location: Antwerp
Has thanked: 13 times
Have thanks: 41 times
I run 7x64 and don't seem to have that problem, pm me the script and a model to test.

Does it occur if you just select "all known formats" ? Also, in the Noesis explorer try going to a parent fodler and back, see if that helps.


Top
 Profile  
 
 Post subject: Re: Noesis tutorial Basic Model
PostPosted: Mon Sep 03, 2012 11:16 am 
Offline
advanced

Joined: Wed Apr 04, 2012 10:17 am
Posts: 46
Has thanked: 6 times
Have thanks: 0 time
Thank you very much for your quick reply.
May I ask a few questions?
I've got a lot to learn.
Actually, I don’t know what to question, at first.


Top
 Profile  
 
 Post subject: Re: Noesis tutorial Basic Model
PostPosted: Mon Sep 03, 2012 1:49 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran

Joined: Sat Apr 09, 2011 1:22 am
Posts: 2387
Has thanked: 170 times
Have thanks: 275 times
You should start by reading the tutorial.

_________________
Model Import Plugins/Scripts

Noesis Plugins | Reference files

Reference
Guide to 3D model reversal | 3D glossary


Top
 Profile  
 
 Post subject: Re: Noesis tutorial Basic Model
PostPosted: Mon Sep 03, 2012 2:44 pm 
Offline
advanced

Joined: Wed Apr 04, 2012 10:17 am
Posts: 46
Has thanked: 6 times
Have thanks: 0 time
finale00 wrote:
You should start by reading the tutorial.

Sorry,
I'm a complete noob, please help.
Image
I can't understand "bs.seek(0x1C, NOESEEK_ABS)" part.


Top
 Profile  
 
 Post subject: Re: Noesis tutorial Basic Model
PostPosted: Mon Sep 03, 2012 3:05 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran

Joined: Sat Apr 09, 2011 1:22 am
Posts: 2387
Has thanked: 170 times
Have thanks: 275 times
There are several ways to go to different positions of a file (eg: seeking)

They are typically seeking from
-beginning of the file (absolute offset) eg: seek_abs
-current position (relative offset) eg: seek_curr
-end of file (seeking backwards)

_________________
Model Import Plugins/Scripts

Noesis Plugins | Reference files

Reference
Guide to 3D model reversal | 3D glossary


Top
 Profile  
 
 Post subject: Re: Noesis tutorial Basic Model
PostPosted: Mon Sep 03, 2012 3:43 pm 
Offline
advanced

Joined: Wed Apr 04, 2012 10:17 am
Posts: 46
Has thanked: 6 times
Have thanks: 0 time
finale00 wrote:
There are several ways to go to different positions of a file (eg: seeking)

They are typically seeking from
-beginning of the file (absolute offset) eg: seek_abs
-current position (relative offset) eg: seek_curr
-end of file (seeking backwards)

Thank you for your explanation.
But, i don't understand these code "0x1C".


Top
 Profile  
 
 Post subject: Re: Noesis tutorial Basic Model
PostPosted: Mon Sep 03, 2012 4:12 pm 
Offline
mega-veteran
mega-veteran
User avatar

Joined: Fri Aug 05, 2011 9:31 pm
Posts: 240
Location: Antwerp
Has thanked: 13 times
Have thanks: 41 times
http://en.wikipedia.org/wiki/Hexadecimal

0x is the way to write hexadecimal


Top
 Profile  
 
 Post subject: Re: Noesis tutorial Basic Model
PostPosted: Mon Sep 03, 2012 6:45 pm 
Offline
advanced

Joined: Wed Apr 04, 2012 10:17 am
Posts: 46
Has thanked: 6 times
Have thanks: 0 time
Demonsangel wrote:
http://en.wikipedia.org/wiki/Hexadecimal

0x is the way to write hexadecimal

That's not what I want to know.
Why it was "1C" what I'd like to know.


Top
 Profile  
 
 Post subject: Re: Noesis tutorial Basic Model
PostPosted: Mon Sep 03, 2012 6:49 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran

Joined: Sat Apr 09, 2011 1:22 am
Posts: 2387
Has thanked: 170 times
Have thanks: 275 times
This tutorial assumes you already know how to reverse models

You should read
viewtopic.php?f=29&t=3739

_________________
Model Import Plugins/Scripts

Noesis Plugins | Reference files

Reference
Guide to 3D model reversal | 3D glossary


Top
 Profile  
 
 Post subject: Re: Noesis tutorial Basic Model
PostPosted: Mon Sep 03, 2012 6:53 pm 
Offline
advanced

Joined: Wed Apr 04, 2012 10:17 am
Posts: 46
Has thanked: 6 times
Have thanks: 0 time
finale00 wrote:
This tutorial assumes you already know how to reverse models

You should read
viewtopic.php?f=29&t=3739

Thanks, finale00


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 47 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group