-
Notifications
You must be signed in to change notification settings - Fork 14
卿爽的第一版中期作业 #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
卿爽的第一版中期作业 #6
Conversation
core/asset_introduction.py
Outdated
| """ | ||
| @File : asset_introduction.py | ||
| @Vision : 1.0.0 | ||
| @Time : 2019/10/3 17:34 | ||
| @Author : Qing Shuang | ||
| @Email : 2075693226@qq.com | ||
| @Software: PyCharm | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些在大型项目中不应当出现
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
sol87
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
暂时这么多
core/asset_introduction.py
Outdated
| """ | ||
| @File : asset_introduction.py | ||
| @Vision : 1.0.0 | ||
| @Time : 2019/10/3 17:34 | ||
| @Author : Qing Shuang | ||
| @Email : 2075693226@qq.com | ||
| @Software: PyCharm | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
core/asset_introduction.py
Outdated
| project_path = r'C:\Users\qingshuang\Documents\code\MyItem\td_study\mid_term_work\AssetIO\example\project' | ||
| target_path = r'C:\Users\qingshuang\Documents\code\MyItem\td_study\mid_term_work\AssetIO\example\project\TDC' | ||
| bake_path = r'C:\Users\qingshuang\Documents\code\MyItem\td_study\mid_term_work\AssetIO\example\project\TDC.bake' | ||
| record_original_file(asset_path=original_asset_path, output_path=project_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
调用函数缺乏状态获取
core/asset_introduction.py
Outdated
| if root == asset_path: | ||
| original_file_structure['Inbox'] = dirs + files | ||
| else: | ||
| dict_key = root.split('\\')[-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个切分不是很保险
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dict_key这个变量名不好
core/asset_introduction.py
Outdated
| else: | ||
| dict_key = root.split('\\')[-1] | ||
| original_file_structure[dict_key] = dirs + files | ||
| if len(files) > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个判断没有意义
core/asset_introduction.py
Outdated
| dict_key = root.split('\\')[-1] | ||
| original_file_structure[dict_key] = dirs + files | ||
| if len(files) > 0: | ||
| for file in files: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file关键字不能用
core/asset_introduction.py
Outdated
| original_file_structure[dict_key] = dirs + files | ||
| if len(files) > 0: | ||
| for file in files: | ||
| file_path = f'{root}\\{file}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用os.path.join可能会更好。最好,可以用Path类型来做
core/asset_introduction.py
Outdated
| # 创建必需的文件夹结构 | ||
| filter_path = target_path | ||
| for filter_name in ['Project', project_code, 'Asset', ['Cha', 'Env', 'Prop']]: | ||
| if isinstance(filter_name, str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个判断是为了解决自己制造出来的麻烦?
core/asset_introduction.py
Outdated
| def transfer_asset(target_path, bake_path): | ||
| """转移资产并记录文件的原始名字和修改后的名字""" | ||
| # 创建必需的文件夹结构 | ||
| filter_path = target_path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要重定义一个filter_path变量
core/asset_introduction.py
Outdated
| # 读取bake文件,提取所有文件名 | ||
| with open(bake_path, 'rb') as file_structure: | ||
| all_info_list = pickle.load(file_structure) | ||
| file_info_dict = all_info_list[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file_structure, file_info_dict = *all_info_list这么写也不一定是好的,但是它更加的清晰
thor-shuang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
卿爽的第二版中期作业,修改了上次课中提到的问题。
No description provided.